From 4601cdd069595c009aab2859ce49596995648f7b 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=UTF-8 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 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 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. Signed-off-by: Marc VĂ©ron --- circ/add_message.pl | 4 +- circ/circulation.pl | 5 --- .../prog/en/includes/members-toolbar.inc | 45 ++++++++++++++++++++ .../prog/en/modules/circ/circulation.tt | 39 +---------------- members/readingrec.pl | 1 - members/routing-lists.pl | 1 - 6 files changed, 48 insertions(+), 47 deletions(-) diff --git a/circ/add_message.pl b/circ/add_message.pl index 317f34b..aee65a1 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 3a57685..04e3039 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -649,15 +649,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' } ), ); 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 9ecce10..7144a4f 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' ) %]