Rename the block period description field to notes for compatibility with the other unavailability events
This commit is contained in:
parent
602afb50b9
commit
f5360d2f2d
5 changed files with 14 additions and 14 deletions
|
@ -127,7 +127,7 @@ class Blocked_periods extends EA_Controller {
|
|||
'name',
|
||||
'start_datetime',
|
||||
'end_datetime',
|
||||
'description'
|
||||
'notes'
|
||||
]);
|
||||
|
||||
$blocked_period_id = $this->blocked_periods_model->save($blocked_period);
|
||||
|
@ -166,7 +166,7 @@ class Blocked_periods extends EA_Controller {
|
|||
'name',
|
||||
'start_datetime',
|
||||
'end_datetime',
|
||||
'description'
|
||||
'notes'
|
||||
]);
|
||||
|
||||
$blocked_period_id = $this->blocked_periods_model->save($blocked_period);
|
||||
|
|
|
@ -46,7 +46,7 @@ class Migration_Create_blocked_periods_table extends EA_Migration {
|
|||
'type' => 'DATETIME',
|
||||
'null' => TRUE,
|
||||
],
|
||||
'description' => [
|
||||
'notes' => [
|
||||
'type' => 'TEXT',
|
||||
'null' => TRUE,
|
||||
],
|
||||
|
|
|
@ -34,7 +34,7 @@ class Blocked_periods_model extends EA_Model {
|
|||
'name' => 'name',
|
||||
'start' => 'start_datetime',
|
||||
'end' => 'end_datetime',
|
||||
'description' => 'description',
|
||||
'notes' => 'notes',
|
||||
];
|
||||
|
||||
/**
|
||||
|
@ -281,7 +281,7 @@ class Blocked_periods_model extends EA_Model {
|
|||
->from('blocked_periods')
|
||||
->group_start()
|
||||
->like('name', $keyword)
|
||||
->or_like('description', $keyword)
|
||||
->or_like('notes', $keyword)
|
||||
->group_end()
|
||||
->limit($limit)
|
||||
->offset($offset)
|
||||
|
@ -322,7 +322,7 @@ class Blocked_periods_model extends EA_Model {
|
|||
'name' => $blocked_period['name'],
|
||||
'start' => array_key_exists('start_datetime', $blocked_period) ? $blocked_period['start_datetime'] : NULL,
|
||||
'end' => array_key_exists('end_datetime', $blocked_period) ? $blocked_period['end_datetime'] : NULL,
|
||||
'description' => array_key_exists('description', $blocked_period) ? $blocked_period['description'] : NULL
|
||||
'notes' => array_key_exists('notes', $blocked_period) ? $blocked_period['notes'] : NULL
|
||||
];
|
||||
|
||||
$blocked_period = $encoded_resource;
|
||||
|
@ -358,9 +358,9 @@ class Blocked_periods_model extends EA_Model {
|
|||
$decoded_resource['end_datetime'] = $blocked_period['end'];
|
||||
}
|
||||
|
||||
if (array_key_exists('description', $blocked_period))
|
||||
if (array_key_exists('notes', $blocked_period))
|
||||
{
|
||||
$decoded_resource['description'] = $blocked_period['description'];
|
||||
$decoded_resource['notes'] = $blocked_period['notes'];
|
||||
}
|
||||
|
||||
$blocked_period = $decoded_resource;
|
||||
|
|
|
@ -92,10 +92,10 @@
|
|||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="form-label" for="description">
|
||||
<?= lang('description') ?>
|
||||
<label class="form-label" for="notes">
|
||||
<?= lang('notes') ?>
|
||||
</label>
|
||||
<textarea id="description" rows="4" class="form-control" disabled></textarea>
|
||||
<textarea id="notes" rows="4" class="form-control" disabled></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -21,7 +21,7 @@ App.Pages.BlockedPeriods = (function () {
|
|||
const $name = $('#name');
|
||||
const $startDateTime = $('#start-date-time');
|
||||
const $endDateTime = $('#end-date-time');
|
||||
const $description = $('#description');
|
||||
const $notes = $('#notes');
|
||||
const moment = window.moment;
|
||||
|
||||
let filterResults = {};
|
||||
|
@ -130,7 +130,7 @@ App.Pages.BlockedPeriods = (function () {
|
|||
name: $name.val(),
|
||||
start_datetime: startDateTimeMoment.format('YYYY-MM-DD HH:mm:ss'),
|
||||
end_datetime: endDateTimeMoment.format('YYYY-MM-DD HH:mm:ss'),
|
||||
description: $description.val()
|
||||
notes: $notes.val()
|
||||
};
|
||||
|
||||
if ($id.val() !== '') {
|
||||
|
@ -235,7 +235,7 @@ App.Pages.BlockedPeriods = (function () {
|
|||
$name.val(blockedPeriod.name);
|
||||
App.Utils.UI.setDatetimepickerValue($startDateTime, new Date(blockedPeriod.start_datetime));
|
||||
App.Utils.UI.setDatetimepickerValue($endDateTime, new Date(blockedPeriod.end_datetime));
|
||||
$description.val(blockedPeriod.description);
|
||||
$notes.val(blockedPeriod.notes);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue