Bugzilla – Attachment 49716 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), 8.47 KB, created by
Marc Véron
on 2016-03-31 05:53:43 UTC
(
hide
)
Description:
Bug 3669: Moving 'Add a new message' into a pop up box and adding to patron toolbar
Filename:
MIME Type:
Creator:
Marc Véron
Created:
2016-03-31 05:53:43 UTC
Size:
8.47 KB
patch
obsolete
>From a374ff0f04fb50d5bcf7f3f9ff15e6515c10978f 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 >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 <veron@veron.ch> >--- > 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 %] >+ >+<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> >+ >+ <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" /> >+ <input type="hidden" name="branchcode" value="[% branch %]" /> >+</fieldset> >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(){ > <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 +211,15 @@ 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"> >+ [% INCLUDE 'member-add-message.inc' %] >+ </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 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 %] > > <!-- 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 %] >@@ -854,6 +816,19 @@ 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> >+ >+ <!-- Modal --> >+ <div id="add_message_form" class="modal hide" tabindex="-1" role="dialog" aria-labelledby="addnewmessageLabel" aria-hidden="true"> >+ <div class="modal-body"> >+ [% INCLUDE 'member-add-message.inc' %] >+ </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> > </div> > > </div> >-- >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