From a374ff0f04fb50d5bcf7f3f9ff15e6515c10978f 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 EDIT: Once the form has been submitted the page will redirect to where you submitted the form from. 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 (ie Details, Fines etc) 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 +- .../prog/en/includes/member-add-message.inc | 32 ++++++++++++ .../prog/en/includes/members-toolbar.inc | 14 ++++++ .../prog/en/modules/circ/circulation.tt | 51 +++++--------------- 4 files changed, 61 insertions(+), 40 deletions(-) create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/member-add-message.inc diff --git a/circ/add_message.pl b/circ/add_message.pl index 317f34b..c266e61 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(); +print $input->redirect($url); diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/member-add-message.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/member-add-message.inc new file mode 100644 index 0000000..f18ec0d --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/member-add-message.inc @@ -0,0 +1,32 @@ +[% USE Koha %] + +
+
+Leave a message +
    +
  1. + + +
  2. + [% IF ( canned_bor_notes_loop ) %] +
  3. + + +
  4. + [% END %] +
  5. + +
  6. +
+ + + +
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..13951aa 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc @@ -170,6 +170,8 @@ function searchToHold(){ Search to hold [% END %] + Add message +
+ + +
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt index 0efe49b..06ee5cb 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -45,7 +45,6 @@ var relatives_borrowernumbers = new Array(); relatives_borrowernumbers.push("[% b %]"); [% END %] -var MSG_ADD_MESSAGE = _("Add a new message"); var MSG_EXPORT_SELECT_CHECKOUTS = _("You must select checkout(s) to export"); columns_settings = [% ColumnsSettings.GetColumns( 'circ', 'circulation', 'issues-table', 'json' ) %] @@ -154,43 +153,6 @@ $(document).ready(function() { [% END %] - - [% IF ( was_renewed ) %]
Patron's account has been renewed until [% expiry | $KohaDates %]
[% END %] [% IF additional_materials %] @@ -854,6 +816,19 @@ No patron matched [% message %] [% END %] [% END %] + Add a new message + + + -- 1.7.10.4