Skip to content

Commit

Permalink
DIS-18 Add a Hold Not Needed Status
Browse files Browse the repository at this point in the history
  • Loading branch information
mdnoble73 committed Oct 11, 2024
1 parent 04ab818 commit da63fe1
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 6 deletions.
3 changes: 2 additions & 1 deletion code/web/release_notes/24.10.00.MD
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

### Aspen Materials Request Updates
- Add new options to Materials Request Statuses to define which should be checked to see if the requests are eligible for holds, which should be set after a hold is placed successfully, and which should be used if a hold fails to be placed. (DIS-18) (*MDN*)
- Create a new default statuses for "Hold Placed Successfully", and "Hold Failed", existing sites are not updated with the new statuses.
- Create a new default statuses for "Hold Placed Successfully", "Hold Not Needed", and "Hold Failed", existing sites are not updated with the new statuses.
- Update the default status of "Item purchased" to be an open status.
- Add the ability to map formats between formats in the catalog and formats defined for materials requests using the new menu option Materials Requests > Format Mapping (DIS-18) (*MDN*)
- All Aspen formats will be shown by default, and the administrator can choose the Materials Request Format that applies.
Expand Down Expand Up @@ -70,6 +70,7 @@
- Materials Request > Manage Statuses > Check for holds?: If the status has this option checked, any requests with this title will be checked to see if the title is in Aspen so a hold can be placed for it.
- Materials Request > Manage Statuses > Hold Placed Successfully?: Only one status can be flagged with this option. When a hold is placed successfully, the request will be moved to this status
- Materials Request > Manage Statuses > Hold Failed?: Only one status can be flagged with this option. When a hold cannot be placed, the request will be moved to this status. (Staff can also choose to not move requests to this status and retry later)
- Materials Request > Manage Statuses > Hold Not Needed?: Only one status can be flagged with this option. When a hold is not desired for a request, the title can be moved to this status.

</div>

Expand Down
7 changes: 4 additions & 3 deletions code/web/release_notes/24.10.00_action_items.MD
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
### Materials Requests
1. Update your request statuses to be compatible with placing holds if you wish to use the new functionality to place holds for materials requests.
1. Update your Item Purchased Status to be an open status and select the check for holds option. Update your email template as needed.
2. Add a new Hold Placed status with Hold Placed Successfully? selected. Add an email template if desired.
3. Add a new Hold Failed status with Hold Failed? selected. Add an email template if desired.
- Update your Item Purchased Status to be an open status and select the check for holds option. Update your email template as needed.
- Add a new Hold Placed status with Hold Placed Successfully? selected. Add an email template if desired.
- Add a new Hold Not Needed status with Hold Not Needed? selected.
- Add a new Hold Failed status with Hold Failed? selected. Add an email template if desired.
4 changes: 2 additions & 2 deletions code/web/services/MaterialsRequest/RequestsNeedingHolds.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public function getCustomListPanel() : string {
global $interface;
//Load status information
$materialsRequestStatus = new MaterialsRequestStatus();
$materialsRequestStatus->orderBy('holdFailed DESC, holdPlacedSuccessfully DESC, description ASC');
$materialsRequestStatus->orderBy('holdNotNeeded DESC, holdFailed DESC, holdPlacedSuccessfully DESC, description ASC');
$homeLibrary = Library::getPatronHomeLibrary();
if (is_null($homeLibrary)) {
//User does not have a home library, this is likely an admin account. Use the active library
Expand Down Expand Up @@ -225,7 +225,7 @@ function updateRequestStatus() : void {
$materialsRequest->id = $requestId;
if ($materialsRequest->find(true)) {
if ($materialsRequest->status != $newStatus) {
if ($newStatusObject->holdFailed || $newStatusObject->holdPlacedSuccessfully) {
if ($newStatusObject->holdFailed || $newStatusObject->holdPlacedSuccessfully || $newStatusObject->holdNotNeeded) {
$materialsRequest->holdsCreated = 1;
}
$materialsRequest->status = $newStatus;
Expand Down
17 changes: 17 additions & 0 deletions code/web/sys/DBMaintenance/version_updates/24.10.00.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@ function getUpdates24_10_00(): array {
"ALTER TABLE materials_request_status ADD COLUMN holdFailed TINYINT(1) DEFAULT 0",
]
], //add_hold_options_for_materials_request_statuses
'add_hold_not_needed_for_materials_request_statuses' => [
'title' => 'Add Hold Not Needed Options for Materials Request Statuses',
'description' => 'Add hold not needed option for materials request status',
'continueOnError' => false,
'sql' => [
"ALTER TABLE materials_request_status ADD COLUMN holdNotNeeded TINYINT(1) DEFAULT 0",
]
], //add_hold_options_for_materials_request_statuses
'add_materials_request_format_mapping' => [
'title' => 'Add Materials Request Format Mapping',
'description' => 'Add new a new table to define mapping between Aspen Materials Request Formats and Aspen Catalog Formats',
Expand Down Expand Up @@ -112,6 +120,15 @@ function getUpdates24_10_00(): array {
Thanks', 0, 1, -1)",
]
], //update_default_request_statuses
'update_default_request_statuses_2' => [
'title' => 'Update default material request statuses pt 2',
'description' => 'Update default material request statuses pt 2',
'continueOnError' => false,
'sql' => [
"INSERT INTO materials_request_status (description, sendEmailToPatron, emailTemplate, isOpen, holdNotNeeded, libraryId)
VALUES ('Hold Not Needed', 1, '', 0, 1, -1)",
]
], //update_default_request_statuses_2
'materials_request_hold_candidate_generation_log' => [
'title' => 'Materials Request Hold Candidate Generation Log',
'description' => 'Create a table to store information about generating hold candidates for materials requests',
Expand Down
7 changes: 7 additions & 0 deletions code/web/sys/MaterialsRequests/MaterialsRequestStatus.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class MaterialsRequestStatus extends DataObject {
public $isPatronCancel;
public $checkForHolds;
public $holdPlacedSuccessfully;
public $holdNotNeeded;
public $holdFailed;

public $libraryId;
Expand Down Expand Up @@ -101,6 +102,12 @@ static function getObjectStructure($context = ''): array {
'label' => 'Hold Placed Successfully?',
'description' => 'Only one status can be flagged with this option. When a hold is placed successfully, the request will be moved to this status.',
],
'holdNotNeeded' => [
'property' => 'holdNotNeeded',
'type' => 'checkbox',
'label' => 'Hold Not Needed?',
'description' => 'Only one status can be flagged with this option. When a hold is not needed, the request will be moved to this status.',
],
'holdFailed' => [
'property' => 'holdFailed',
'type' => 'checkbox',
Expand Down

0 comments on commit da63fe1

Please sign in to comment.