Bugzilla – Attachment 50976 Details for
Bug 3669
Create a template for circ/add_message.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 3669: Moving 'Add a new message' into a pop up box and adding to patron toolbar
Bug-3669-Moving-Add-a-new-message-into-a-pop-up-bo.patch (text/plain), 12.11 KB, created by
Aleisha Amohia
on 2016-04-29 01:51:36 UTC
(
hide
)
Description:
Bug 3669: Moving 'Add a new message' into a pop up box and adding to patron toolbar
Filename:
MIME Type:
Creator:
Aleisha Amohia
Created:
2016-04-29 01:51:36 UTC
Size:
12.11 KB
patch
obsolete
>From e06fcea717d08528256f00580119ce3a6fda6049 Mon Sep 17 00:00:00 2001 >From: Aleisha <aleishaamohia@hotmail.com> >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 >EDIT6: Batch checkout fixes > >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. >Signed-off-by: Marc Véron <veron@veron.ch> >--- > circ/add_message.pl | 4 +- > circ/circulation.pl | 5 --- > .../prog/en/includes/members-toolbar.inc | 45 ++++++++++++++++++++ > .../prog/en/modules/circ/circulation.tt | 39 +---------------- > .../en/modules/circ/circulation_batch_checkouts.tt | 4 +- > members/readingrec.pl | 1 - > members/routing-lists.pl | 1 - > 7 files changed, 50 insertions(+), 49 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 4a38f71..a0d5cfe 100755 >--- a/circ/circulation.pl >+++ b/circ/circulation.pl >@@ -652,15 +652,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' ) %] > <script type="text/javascript"> > //<![CDATA[ >@@ -170,6 +172,8 @@ function searchToHold(){ > <a id="searchtohold" class="btn btn-small" href="#"><i class="fa fa-search"></i> Search to hold</a> > [% END %] > >+ <a id="addnewmessageLabel" href="#add_message_form" data-toggle="modal" class="btn btn-small"><i class="fa fa-comment-o"></i> Add message</a> >+ > <div class="btn-group"> > <button class="btn btn-small dropdown-toggle" data-toggle="dropdown">More <span class="caret"></span></button> > <ul class="dropdown-menu"> >@@ -209,3 +213,44 @@ function searchToHold(){ > </ul> > </div> > </div> >+ >+<!-- Modal --> >+<div id="add_message_form" class="modal hide" tabindex="-1" role="dialog" aria-labelledby="addnewmessageLabel" aria-hidden="true"> >+ <div class="modal-body"> >+ <form method="post" action="/cgi-bin/koha/circ/add_message.pl" id="message_form" name="message_f"> >+ <fieldset id="borrower_messages" class="brief"> >+ <legend>Leave a message</legend> >+ <ol> >+ <li> >+ <label for="message_type">Add a message for:</label> >+ <select name="message_type" id="message_type"> >+ <option value="L">Staff - Internal note</option> >+ <option value="B">OPAC - [% firstname %] [% surname %]</option> >+ </select> >+ </li> >+ [% bor_notes = AuthorisedValues.Get( 'BOR_NOTES' ) %] >+ [% IF bor_notes %] >+ <li> >+ <label for="type">Predefined notes: </label> >+ <select name="type" id="type" onchange="this.form.borrower_message.value=this.options[this.selectedIndex].value;"> >+ <option value="">Select note</option> >+ [% FOREACH bor_note IN bor_notes %] >+ <option value="[% bor_note.lib %]">[% bor_note.lib %]</option> >+ [% END %] >+ </select> >+ </li> >+ [% END %] >+ <li> >+ <textarea rows="3" cols="60" name="borrower_message" id="borrower_message" ></textarea> >+ </li> >+ </ol> >+ <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" /> >+ <input type="hidden" name="branchcode" value="[% LoginBranchcode %]" /> >+ </fieldset> >+ </div> >+ <div class="modal-footer"> >+ <fieldset class="action"> >+ <input type="submit" value="Save" /> </form><a href="#" class="cancel" data-dismiss="modal" aria-hidden="true">Cancel</a> >+ </fieldset> >+ </div> >+</div> >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 ec3a1d9..67544c2 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"); > var MSG_CONFIRM_DELETE_MESSAGE = _("Are you sure you want to delete this message? This cannot be undone."); > >@@ -159,43 +158,6 @@ $(document).ready(function() { > [% END %] > > <!-- INITIAL BLOC : PARAMETERS & BORROWER INFO --> >-<div style="display: none;" id="add_message_form"> >-<form method="post" action="/cgi-bin/koha/circ/add_message.pl" id="message_form" name="message_f"> >-<fieldset id="borrower_messages" class="brief"> >-<legend>Leave a message</legend> >- <ol> >- <li> >- <label for="message_type">Add a message for:</label> >- <select name="message_type" id="message_type"> >- <option value="L">Staff - Internal note</option> >- <option value="B">OPAC - [% firstname %] [% surname %]</option> >- </select> >- </li> >- [% IF ( canned_bor_notes_loop ) %] >- <li> >- <label for="type">Predefined notes: </label> >- <select name="type" id="type" onchange="this.form.borrower_message.value=this.options[this.selectedIndex].value;"> >- <option value="">Select note</option> >- [% FOREACH canned_bor_notes_loo IN canned_bor_notes_loop %] >- <option value="[% canned_bor_notes_loo.lib %]">[% canned_bor_notes_loo.lib %]</option> >- [% END %] >- </select> >- </li> >- [% END %] >- <li> >- <textarea rows="3" cols="60" name="borrower_message" id="borrower_message" ></textarea> >- </li> >- </ol> >- <fieldset class="action"> >- <input type="submit" value="Save" /> <a href="#" class="cancel">Cancel</a> >- </fieldset> >- >- <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" /> >- <input type="hidden" name="branchcode" value="[% branch %]" /> >-</fieldset> >-</form> >-</div> >- > [% IF ( was_renewed ) %]<div class="dialog message">Patron's account has been renewed until [% expiry | $KohaDates %]</div>[% END %] > > [% IF additional_materials %] >@@ -856,6 +818,7 @@ No patron matched <span class="ex">[% message %]</span> > [% END %]</li> > [% END %] > </ul> >+ <a id="addnewmessageLabel" href="#add_message_form" data-toggle="modal">Add a new message</a> > </div> > > </div> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation_batch_checkouts.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation_batch_checkouts.tt >index eadeb1d..c0b7e5d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation_batch_checkouts.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation_batch_checkouts.tt >@@ -70,7 +70,7 @@ $(document).ready(function() { > [% END %] > </div> > [% ELSIF borrower and not checkout_infos %] >- <form method="post" enctype="multipart/form-data" action="/cgi-bin/koha/circ/circulation.pl"> >+ <form method="post" enctype="multipart/form-data" action="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% borrowernumber %]&batch=1"> > <fieldset id="circ_circulation_issue"> > <label for="barcode">Checking out to [% INCLUDE 'patron-title.inc' %]</label> > <fieldset class="rows"> >@@ -101,7 +101,7 @@ $(document).ready(function() { > [% ELSIF borrower %] > [% IF confirmation_needed && CAN_user_circulate_force_checkout %] > <h3>Batch checkout confirmation [% IF borrowernumber %] for [% INCLUDE 'patron-title.inc' invert_name = 1 %] [% END %]</h3> >- <form method="post" action="/cgi-bin/koha/circ/circulation.pl" id="mainform" name="mainform" autocomplete="off"> >+ <form method="post" action="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% borrowernumber %]" id="mainform" name="mainform" autocomplete="off"> > [% ELSE %] > <h3>Batch checkout information [% IF borrowernumber %] for [% INCLUDE 'patron-title.inc' invert_name = 1 %] [% END %]</h3> > [% END %] >diff --git a/members/readingrec.pl b/members/readingrec.pl >index 79351ff..35a1ad4 100755 >--- a/members/readingrec.pl >+++ b/members/readingrec.pl >@@ -119,7 +119,6 @@ if (C4::Context->preference('ExtendedPatronAttributes')) { > ); > } > >- > $template->param(%$data); > > $template->param( >diff --git a/members/routing-lists.pl b/members/routing-lists.pl >index 1925880..6c99034 100755 >--- a/members/routing-lists.pl >+++ b/members/routing-lists.pl >@@ -101,7 +101,6 @@ if ($borrowernumber) { > > ################################################################################## > >- > $template->param(%$borrower); > > $template->param( >-- >1.7.10.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 3669
:
49497
|
49610
|
49714
|
49716
|
49833
|
50044
|
50047
|
50100
|
50976
|
51353
|
51374
|
52277
|
52641
|
52642
|
52796