From c53a907c66aab7f932f3bf09924084935aae5962 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Fri, 17 Sep 2021 09:06:08 +0000 Subject: [PATCH] Bug 27947: (follow-up) Add OPAC cancellation as new reason too Something that currently comes up now already too: If the user cancels from the OPAC page, there is no reason in the notice. We could simply add one now. Test plan: Run dbrev to add the OPAC authval. Create new AR and cancel it from OPAC. Verify notice created for the user. Signed-off-by: Marcel de Rooy Signed-off-by: Tomas Cohen Arazi Signed-off-by: Martin Renvoize Signed-off-by: Jonathan Druart --- installer/data/mysql/atomicupdate/bug_27947.pl | 8 ++++---- installer/data/mysql/en/optional/auth_val.yml | 4 ++++ installer/data/mysql/fr-CA/facultatif/auth_val.sql | 3 ++- .../data/mysql/fr-FR/1-Obligatoire/authorised_values.sql | 3 ++- installer/data/mysql/nb-NO/2-Valgfritt/auth_val.sql | 3 ++- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt | 2 +- 6 files changed, 15 insertions(+), 8 deletions(-) diff --git a/installer/data/mysql/atomicupdate/bug_27947.pl b/installer/data/mysql/atomicupdate/bug_27947.pl index 3905db87f0..de4eaf3404 100755 --- a/installer/data/mysql/atomicupdate/bug_27947.pl +++ b/installer/data/mysql/atomicupdate/bug_27947.pl @@ -13,10 +13,10 @@ return { say $out "Add AR_CANCELLATION category for authorised values"; $dbh->do(q{ - INSERT IGNORE INTO authorised_values (category, authorised_value, lib) VALUES ('AR_CANCELLATION','NOT_FOUND','Item could not be located on shelves'); - }); - $dbh->do(q{ - INSERT IGNORE INTO authorised_values (category, authorised_value, lib) VALUES ('AR_CANCELLATION','DAMAGED','Item was found to be too damaged to fill article request'); + INSERT IGNORE INTO authorised_values (category, authorised_value, lib) VALUES + ('AR_CANCELLATION','NOT_FOUND','Item could not be located on shelves'), + ('AR_CANCELLATION','DAMAGED','Item was found to be too damaged to fill article request'), + ('AR_CANCELLATION','OPAC','Cancelled from the OPAC user page') }); say $out "Add AR_CANCELLATION authorised values"; diff --git a/installer/data/mysql/en/optional/auth_val.yml b/installer/data/mysql/en/optional/auth_val.yml index d2497d79db..6612ae4134 100644 --- a/installer/data/mysql/en/optional/auth_val.yml +++ b/installer/data/mysql/en/optional/auth_val.yml @@ -309,3 +309,7 @@ tables: - category: "AR_CANCELLATION" authorised_value: "DAMAGED" lib: "Item was found to be too damaged to fill article request" + + - category: "AR_CANCELLATION" + authorised_value: "OPAC" + lib: "Cancelled from the OPAC user page" diff --git a/installer/data/mysql/fr-CA/facultatif/auth_val.sql b/installer/data/mysql/fr-CA/facultatif/auth_val.sql index c424c3a6c9..b03795e3c9 100644 --- a/installer/data/mysql/fr-CA/facultatif/auth_val.sql +++ b/installer/data/mysql/fr-CA/facultatif/auth_val.sql @@ -93,4 +93,5 @@ INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('HOLD_CA -- article request cancellation INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('AR_CANCELLATION','NOT_FOUND','Item could not be located on shelves'); -INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('AR_CANCELLATION','DAMAGED','Item was found to be too damaged to fill article request'); \ No newline at end of file +INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('AR_CANCELLATION','DAMAGED','Item was found to be too damaged to fill article request'); +INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('AR_CANCELLATION','OPAC','Cancelled from the OPAC user page'); diff --git a/installer/data/mysql/fr-FR/1-Obligatoire/authorised_values.sql b/installer/data/mysql/fr-FR/1-Obligatoire/authorised_values.sql index 8c70ff0602..fc305ca654 100644 --- a/installer/data/mysql/fr-FR/1-Obligatoire/authorised_values.sql +++ b/installer/data/mysql/fr-FR/1-Obligatoire/authorised_values.sql @@ -727,4 +727,5 @@ INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('HOLD_CA -- article request cancellation INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('AR_CANCELLATION','NOT_FOUND','Item could not be located on shelves'); -INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('AR_CANCELLATION','DAMAGED','Item was found to be too damaged to fill article request'); \ No newline at end of file +INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('AR_CANCELLATION','DAMAGED','Item was found to be too damaged to fill article request'); +INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('AR_CANCELLATION','OPAC','Cancelled from the OPAC user page'); diff --git a/installer/data/mysql/nb-NO/2-Valgfritt/auth_val.sql b/installer/data/mysql/nb-NO/2-Valgfritt/auth_val.sql index 86a502d448..f4e7001e3b 100644 --- a/installer/data/mysql/nb-NO/2-Valgfritt/auth_val.sql +++ b/installer/data/mysql/nb-NO/2-Valgfritt/auth_val.sql @@ -112,4 +112,5 @@ INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('HOLD_CA -- article request cancellation INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('AR_CANCELLATION','NOT_FOUND','Item could not be located on shelves'); -INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('AR_CANCELLATION','DAMAGED','Item was found to be too damaged to fill article request'); \ No newline at end of file +INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('AR_CANCELLATION','DAMAGED','Item was found to be too damaged to fill article request'); +INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('AR_CANCELLATION','OPAC','Cancelled from the OPAC user page'); diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt index 60e66845c4..730400e7e1 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt @@ -932,7 +932,7 @@ if( result ){ $.ajax({ type: "DELETE", - url: '/api/v1/public/patrons/'+borrowernumber+'/article_requests/'+article_request_id, + url: '/api/v1/public/patrons/'+borrowernumber+'/article_requests/'+article_request_id+'?cancellation_reason=OPAC', success: function( data ) { row.parents('tr').hide({ duration: 'slow', -- 2.39.5