Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -184,38 +184,50 @@
{$detail.checkOutDate|escape}
{/if}
</td>
<td data-entry-id="{$detail.id}" data-original-date="{$detail.checkInDate}" data-edited-date="{$detail.editedCheckInDate}">
{assign var="displayDate" value=$detail.checkInDate}
{if !empty($detail.editedCheckInDate)}
{assign var="displayDate" value=$detail.editedCheckInDate}
{/if}
{if empty($detail.checkInDate) && empty($detail.editedCheckInDate)}
<div class="editable-return-date-inline">
<span class="date-display label label-success">{translate text="Currently Checked Out" isPublicFacing=true}</span>
<input type="text" class="date-edit form-control" style="display:none;" value="" placeholder="YYYY-MM-DD">
</div>
{elseif $detail.checkInDate == -1 && empty($detail.editedCheckInDate)}
<div class="editable-return-date">
<div class="date-display-wrapper">
<span class="date-display text-muted">{translate text="Unknown" isPublicFacing=true}</span>
{if empty($disallowReturnDateEdits)}
{* Editable version *}
<td data-entry-id="{$detail.id}" data-original-date="{$detail.checkInDate}" data-edited-date="{$detail.editedCheckInDate}">
{if empty($detail.checkInDate) && empty($detail.editedCheckInDate)}
<div class="editable-return-date-inline">
<span class="date-display label label-success">{translate text="Currently Checked Out" isPublicFacing=true}</span>
<input type="text" class="date-edit form-control" style="display:none;" value="" placeholder="YYYY-MM-DD">
</div>
</div>
{else}
<div class="editable-return-date">
<div class="date-display-wrapper">
<span class="date-display">
{if is_numeric($displayDate)}
{$displayDate|date_format:"%b %d, %Y"}
{else}
{$displayDate|escape}
{/if}
</span>
<input type="text" class="date-edit form-control" style="display:none;" value="{if is_numeric($displayDate)}{$displayDate|date_format:"%Y-%m-%d"}{else}{/if}" placeholder="YYYY-MM-DD">
{elseif $detail.checkInDate == -1 && empty($detail.editedCheckInDate)}
<div class="editable-return-date">
<div class="date-display-wrapper">
<span class="date-display text-muted">{translate text="Unknown" isPublicFacing=true}</span>
<input type="text" class="date-edit form-control" style="display:none;" value="" placeholder="YYYY-MM-DD">
</div>
</div>
</div>
{/if}
</td>
{else}
<div class="editable-return-date">
<div class="date-display-wrapper">
<span class="date-display">
{if is_numeric($displayDate)}
{$displayDate|date_format:"%b %d, %Y"}
{else}
{$displayDate|escape}
{/if}
</span>
<input type="text" class="date-edit form-control" style="display:none;" value="{if is_numeric($displayDate)}{$displayDate|date_format:"%Y-%m-%d"}{else}{/if}" placeholder="YYYY-MM-DD">
</div>
</div>
{/if}
</td>
{else}
{* Read-only version *}
<td>
{if empty($detail.checkInDate) && empty($detail.editedCheckInDate)}
<span class="label label-success">{translate text="Currently Checked Out" isPublicFacing=true}</span>
{elseif $detail.checkInDate == -1 && empty($detail.editedCheckInDate)}
<span class="text-muted">{translate text="Unknown" isPublicFacing=true}</span>
{elseif is_numeric($displayDate)}
{$displayDate|date_format:"%b %d, %Y"}
{else}
{$displayDate|escape}
{/if}
</td>
{/if}
<td>
{if !empty($detail.format)}
{$detail.format|replace:',':', '}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,5 +116,7 @@
<script type="text/javascript">
AspenDiscovery.Ratings.initializeRaters();
AspenDiscovery.Account.ReadingHistory.initAccordions();
{if empty($disallowReturnDateEdits)}
AspenDiscovery.Account.ReadingHistory.initEditableReturnDates();
{/if}
</script>
13 changes: 13 additions & 0 deletions code/web/release_notes/26.11.00/DIS-2978.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Jira: DIS-2827
Type: Enhancement
Developer: Kodi Lein (KL)
Contributing Org: Grove For Libraries
Sponsor: OCLS
GroveRelease: 26.11.00
CommunityRelease: 26.12.00
Component: Reading History
Description:
- Add option to disallow editing of reading history return dates.
New Settings:
- Library Systems > ILS/Account Integration > Reading History > Disallow Editing of Return Dates
New Permissions:
1 change: 1 addition & 0 deletions code/web/services/MyAccount/AJAX.php
Original file line number Diff line number Diff line change
Expand Up @@ -4781,6 +4781,7 @@ public function getReadingHistory() : array {
$interface->assign('library', $patronHomeLibrary);
$result['showCostSavings'] = $patronHomeLibrary->enableCostSavings && $patron->enableCostSavings;
$result['costSavingsMessage'] = $user->getTotalCostSavingsMessage(true);
$interface->assign('disallowReturnDateEdits', $patronHomeLibrary->disallowReturnDateEdits);

$result['success'] = true;
$result['message'] = "";
Expand Down
55 changes: 55 additions & 0 deletions code/web/sys/DBMaintenance/version_updates/26.11.00.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?php
/** @noinspection SqlDialectInspection */

/** @noinspection PhpUnused */
function getUpdates26_11_00(): array {
$now = time();

return [
/*'name' => [
'title' => '',
'description' => '',
'continueOnError' => false,
'sql' => [
''
]
], //name*/

//mark n

//kirstien

//kodi
'disallow_reading_history_return_date_edits' => [
'title' => 'Disallow reading history return date edits',
'description' => 'Add setting to library table for disallowing editing of return dates in reading history.',
'continueOnError' => false,
'sql' => [
"ALTER TABLE library ADD COLUMN disallowReturnDateEdits TINYINT(1) NOT NULL DEFAULT 0"
]
], //disallow_reading_history_return_date_edits

//yanjun

//imani

//galen

//chloe

//pedro

//mark j

//lucas

//tomas

// stephen

//jacob - OpenFifth

//kyle - ByWater

];
}
10 changes: 10 additions & 0 deletions code/web/sys/LibraryLocation/Library.php
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ class Library extends DataObject {
$displayCallNumberInCheckoutHistory;
public /** @noinspection PhpUnused */
$displayVolumeInCheckoutHistory;
public $disallowReturnDateEdits;

public $alwaysDisplayRenewalCount;
public $allowRenewingOutOfHoldGroupCheckouts;
Expand Down Expand Up @@ -3134,6 +3135,15 @@ static function getObjectStructure(string $context = ''): array {
'permissions' => ['Library ILS Connection'],
'relatedIls' => ['evergreen', 'koha'],
],
'disallowReturnDateEdits' => [
'property' => 'disallowReturnDateEdits',
'type' => 'checkbox',
'label' => 'Disallow Editing of Return Dates',
'description' => 'Whether users can edit the return date of titles in their reading history within Aspen.',
'hideInLists' => true,
'default' => 0,
'permissions' => ['Library ILS Options'],
],
'forceReadingHistoryOptIn' => [
'property' => 'forceReadingHistoryOptIn',
'type' => 'checkbox',
Expand Down
Loading