From 573f1ac474d6c3d4eaba0422f30981aca02a3e8b Mon Sep 17 00:00:00 2001 From: Aleisha Date: Thu, 24 Mar 2016 00:28:42 +0000 Subject: [PATCH] Bug 3669: Moving 'Add a new message' into a pop up box and adding to patron toolbar MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This patch moves all the code into an include which can be accessed from the 'Add a new message' link or the patron toolbar. EDIT: Ensuring modal opens on all pages EDIT2: Once the form has been submitted the page will redirect to where you submitted the form from. EDIT3: Fixing indentation of member-add-message.inc Ensuring messages save on every page Fill branch Ensure predefined notes appear Form redirects to where it was submitted from, or just the circulation page. EDIT4: Removing the new include file and moving it all into the modal in the toolbar EDIT5: Removing swp file and unnecessary code duplication by utilising plugins EDIT6: Batch checkout fixes EDIT7: Ensure you do not get JS error from Comment 24 (Batch checkout syspref must be turned on) To test: 1) Go to a patron circ page (circ/circulation.pl?borrowernumber=X) 2) Click 'Add a new message' under Messages 3) Confirm this brings up the modal to add a message. Confirm clicking Save saves your message. If it is an OPAC message (for the user), confirm it shows as expected on the OPAC. 4) Click Cancel. Confirm this closes the modal. 5) Click 'Add message' button in toolbar. Complete steps 3 and 4. 6) Confirm the modal opens from all other pages with the members toolbar. Confirm predefined notes shows. circ/circulation.pl members/moremember.pl members/routing-lists.pl members/statistics.pl members/boraccount.pl members/pay.pl members/maninvoice.pl members/mancredit.pl members/readingrec.pl members/notices.pl members/member-flags.pl members/member-password.pl members/paycollect.pl members/files.pl turn on BatchCheckouts syspref and put in appropriate patron category circ/circulation.pl?borrowernumber=X&batch=1 7) Confirm that the page redirects to where you submitted the form from once you have submitted it. 8) Go to Check Out tab and confirm your message saved (or OPAC, wherever you saved it) Sponsored-by: Catalyst IT Followed test plan, works as expected. (Re-tested for comment #24) Signed-off-by: Marc Véron Signed-off-by: Jonathan Druart Signed-off-by: Kyle M Hall --- circ/add_message.pl | 4 +- circ/circulation.pl | 5 --- .../prog/en/includes/members-toolbar.inc | 45 +++++++++++++++++++ .../prog/en/modules/circ/circulation.tt | 39 +--------------- .../circ/circulation_batch_checkouts.tt | 4 +- .../prog/en/modules/members/moremember.tt | 1 - .../prog/js/pages/circulation.js | 2 - members/readingrec.pl | 1 - members/routing-lists.pl | 1 - 9 files changed, 50 insertions(+), 52 deletions(-) diff --git a/circ/add_message.pl b/circ/add_message.pl index 317f34bf6d..aee65a1b91 100755 --- a/circ/add_message.pl +++ b/circ/add_message.pl @@ -51,5 +51,5 @@ Koha::Patron::Message->new( } )->store; -print $input->redirect( - "/cgi-bin/koha/circ/circulation.pl?borrowernumber=$borrowernumber"); +my $url = $input->referer() // "/cgi-bin/koha/circ/circulation.pl?borrowernumber=$borrowernumber"; +print $input->redirect($url); diff --git a/circ/circulation.pl b/circ/circulation.pl index bf10bc6150..ef743bedc5 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -658,15 +658,10 @@ $template->param( my $patron_image = Koha::Patron::Images->find($borrower->{borrowernumber}); $template->param( picture => 1 ) if $patron_image; -# get authorised values with type of BOR_NOTES - -my $canned_notes = GetAuthorisedValues("BOR_NOTES"); - $template->param( debt_confirmed => $debt_confirmed, SpecifyDueDate => $duedatespec_allow, CircAutocompl => C4::Context->preference("CircAutocompl"), - canned_bor_notes_loop => $canned_notes, debarments => GetDebarments({ borrowernumber => $borrowernumber }), todaysdate => output_pref( { dt => dt_from_string()->set(hour => 23)->set(minute => 59), dateformat => 'sql' } ), modifications => Koha::Patron::Modifications->GetModifications({ borrowernumber => $borrowernumber }), diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc index b7e7178f0a..75cb6bc893 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc @@ -1,5 +1,7 @@ [% USE Koha %] [% USE Borrowers %] +[% USE Branches %] +[% USE AuthorisedValues %] [% SET NorwegianPatronDBEnable = Koha.Preference( 'NorwegianPatronDBEnable' ) %]