Enhanced Mark Item Functionality ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Evergreen's Mark Item Damaged and Mark Item Missing functionality has been enhanced, and the ability to mark an item with the Discard/Weed status has been added. This enhancement affects both the Evergreen back end code and the staff client. Staff Client Changes ++++++++++++++++++++ The option to "Mark Item as Discard/Weed" has been added to areas where the option(s) to "Mark Item as Missing" and/or "Mark Item as Damaged" appear. This is primarily in the action menus on the following interfaces: * Item Status * Checkin * Renew * Holds Pull List * Patron Holds List * Record Holds List * Holds Shelf * Holdings Edit This new option allows staff to mark a copy with the Discard/Weed status quickly and easily without necessarily requiring the intervention of cataloging staff. In order to mark an item with the Discard/Weed status, staff will require either the `MARK_ITEM_DISCARD` or `UPDATE_COPY status` at the item's owning library. (NOTE: This permission choice is consistent with the permission requirements for the current Mark Item Damaged or Missing functionality.) If the item to be marked Discard/Weed is checked out to a patron, the staff will be presented with a dialog informing them that the item is checked out and asking if they would like to check it in and proceed. If they choose to continue, the item will be checked in and then marked with the Discard/Weed status. If the staff person chooses to cancel, then the item will not be checked in, and it will not be marked Discard/Weed. The Mark Item Missing functionality has also been changed to exhibit this behavior with checked out items. The Mark Item Damaged functionality already handles checked out item. Should the item have a status of In Transit at the time it is to be marked, then staff will be prompted to abort the transit before proceeding with changing the item's status. If they choose to abort the transit and they have the permission to do so, the transit will be aborted and the item's status changed. If they choose to cancel, then the transit will not be aborted and the item's status will remain unchanged. This change applies to all three of the current Mark Item statuses: Missing, Damaged, and Discard/Weed. Marking an item Discard/Weed is typically one step away from deleting the item. For this reason, if the item to be marked Discard/Weed is not in a Checked Out or In Transit status, but it is in a status that restricts item deletion, the staff will be presented with a dialog notifying them of the item's status and asking if they wish to proceed. If staff choose to proceed and they have the `COPY_DELETE_WARNING.override` permission, then the item will be marked with the Discard/Weed status. Naturally, the item's status will be unchanged if they choose not to proceed. This change does not affect the marking of an item as Missing or Damaged. Marking an item as Discard/Weed has one more additional check that the other statuses do not. If the item being marked as Discard/Weed is the last copy that can fill a hold, then staff will also be notified of this condition and asked if they wish to continue. In this case, there is no permission required. Whether or not the item is marked as Discard/Weed in this case depends solely on the staff's choice. Back End Changes ++++++++++++++++ In order to accommodate the presentation of dialogs and overrides in the staff client, the `OpenILS::Application::Circ` module's method for marking item statuses has had a few changes made. Firstly, the code of the `mark_item` function has been rearranged to a more logical flow. Most of the condition and permission checks are made before creating a transaction. Secondly, it has been modified to return 3 new events when certain conditions are met: * `ITEM_TO_MARK_CHECKED_OUT` * `ITEM_TO_MARK_IN_TRANSIT` * `ITEM_TO_MARK_LAST_HOLD_COPY` The `COPY_DELETE_WARNING` event will be returned when attempting to mark an item with the Discard/Weed status and the status has the `restrict_copy_delete` flag set to true. The function now also recognizes a hash of extra arguments for all statuses and not just for the mark Damaged functionality. This argument hash can be used to bypass or override any or all of the above mentioned events. Each event has a corresponding argument that if set to a "true" value will cause the `mark_item` to bypass the given event. These argument flags are, respectively: * `handle_checkin` * `handle_transit` * `handle_last_hold_copy` * `handle_copy_delete_warning` The code to mark an item damaged still accepts its previous hash arguments in addition to these new ones. The function still returns other errors and events as before. It still returns 1 on success. It is also worth noting here that the staff client can be easily extended with the ability to mark items into the other statuses offered by the back end functions. Most of the staff client functionality is implemented in two functions with placeholders in the main function (`egCirc.mark_item`) for the unimplemented statuses.