Bugzilla – Attachment 80957 Details for
Bug 12365
Allow descriptive notes to be added to circulation and fine rules
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 12365: (follow-up) Adding maxlength attribute and popover
Bug-12365-follow-up-Adding-maxlength-attribute-and.patch (text/plain), 7.48 KB, created by
Michal Denar
on 2018-10-19 19:35:00 UTC
(
hide
)
Description:
Bug 12365: (follow-up) Adding maxlength attribute and popover
Filename:
MIME Type:
Creator:
Michal Denar
Created:
2018-10-19 19:35:00 UTC
Size:
7.48 KB
patch
obsolete
>From 225c930c145ed75fb697cb1d6b8e82aef0fb1da5 Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleishaamohia@hotmail.com> >Date: Wed, 4 Jul 2018 00:12:21 +0000 >Subject: [PATCH] Bug 12365: (follow-up) Adding maxlength attribute and popover > >Test that you can't add a note of more than 100 characters. >Test notes with rules, notes are hidden by 'View note' and the >popover correctly displays note. >View the note by hovering over the link >I've moved the Note column so the popover displays nicely and doesn't >cover the buttons. I've also changed the placement so that it doesn't >cover information in the row. > >Update: Test that you can edit the note when clicking 'Edit' and that >behaviour is the same for editing all other fields > >Signed-off-by: Michal Denar <black23@gmail.com> > >Signed-off-by: Michal Denar <black23@gmail.com> >--- > .../prog/en/modules/admin/smart-rules.tt | 25 ++++++++++++++++------ > 1 file changed, 18 insertions(+), 7 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt >index 52f5525702..3c23afd213 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt >@@ -70,6 +70,7 @@ > <th>Patron category</th> > <th>Item type</th> > <th>Actions</th> >+ <th>Note</th> > <th>Current checkouts allowed</th> > <th>Current on-site checkouts allowed</th> > <th>Loan period</th> >@@ -96,7 +97,6 @@ > <th>Item level holds</th> > <th>Article requests</th> > <th>Rental discount (%)</th> >- <th>Note</th> > <th>Actions</th> > </tr> > </thead> >@@ -120,6 +120,11 @@ > <a class="btn btn-default btn-xs delete" href="/cgi-bin/koha/admin/smart-rules.pl?op=delete&itemtype=[% rule.itemtype | html %]&categorycode=[% rule.categorycode | html %]&branch=[% rule.current_branch | html %]"><i class="fa fa-trash"></i> Delete</a> > </td> > >+ <td> >+ [% IF rule.note %] >+ <a name="viewnote" data-toggle="popover" title="Note" data-content="[% rule.note %]" data-placement="top" data-trigger="hover">View note</a> >+ [% ELSE %] [% END %] >+ </td> > <td>[% IF ( rule.unlimited_maxissueqty ) %] > <span>Unlimited</span> > [% ELSE %] >@@ -247,6 +252,7 @@ > <button type="submit" class="btn btn-default btn-xs"><i class="fa fa-save"></i> Save</button> > <button name="cancel" class="clear_edit btn btn-default btn-xs"><i class="fa fa-undo"></i> Clear</button> > </td> >+ <td><input type="text" name="note" id="note" size="15" value="" maxlength="100"></td> > <td><input type="text" name="maxissueqty" id="maxissueqty" size="3" /></td> > <td><input type="text" name="maxonsiteissueqty" id="maxonsiteissueqty" size="3" /></td> > <td><input type="text" name="issuelength" id="issuelength" size="3" /> </td> >@@ -318,7 +324,6 @@ > </select> > </td> > <td><input type="text" name="rentaldiscount" id="rentaldiscount" size="2" /></td> >- <td><input type="text" name="note" id="note" size="15" value=""></td> > <td class="actions"> > <input type="hidden" name="branch" value="[% current_branch | html %]"/> > <button type="submit" class="btn btn-default btn-xs"><i class="fa fa-save"></i> Save</button> >@@ -330,6 +335,7 @@ > <th>Patron category</th> > <th>Item type</th> > <th> </th> >+ <th>Note</th> > <th>Current checkouts allowed</th> > <th>Current on-site checkouts allowed</th> > <th>Loan period</th> >@@ -349,14 +355,13 @@ > <th>No renewal before</th> > <th>Automatic renewal</th> > <th>No automatic renewal after</th> >- <th>No automatic renewal after (hard limit)</th> >+ <th>No automatic renewal after (hard limit)</th> > <th>Holds allowed (count)</th> > <th>Holds per record (count)</th> > <th>On shelf holds allowed</th> > <th>Item level holds</th> > <th>Article requests</th> > <th>Rental discount (%)</th> >- <th>Note</th> > <th> </th> > </tr> > </tfoot> >@@ -788,6 +793,8 @@ > var MSG_CONFIRM_DELETE = _("Are you sure you want to delete this rule? This cannot be undone."); > > $(document).ready(function() { >+ $('[data-toggle="popover"]').popover(); >+ > $(".delete").on("click",function(){ > return confirmDelete(MSG_CONFIRM_DELETE); > }); >@@ -825,7 +832,11 @@ > itm = $(this).text(); > itm = itm.replace(/^\s*|\s*$/g,''); > var current_column = $("#edit_row td:eq("+i+")"); >- if ( i == 7 ) { >+ if ( i == 3 ) { >+ // specific processing for the Note column >+ var note = $(this).find("a[name='viewnote']").data("content"); >+ $(current_column).find("input[type='text']").val(note); >+ } else if ( i == 8 ) { > // specific processing for the Hard due date column > var select_value = $(this).find("input[type='hidden'][name='hardduedatecomparebackup']").val(); > var input_value = ''; >@@ -836,7 +847,7 @@ > } > $(current_column).find("input[type='text']").val(input_value); > $(current_column).find("select").val(select_value); >- } else if ( i == 13 ) { >+ } else if ( i == 14 ) { > // specific processing for cap_fine_to_replacement_price > var cap_fine_to_replacement_price = $(this).find("input[type='checkbox']"); > $('#cap_fine_to_replacement_price').prop('checked', cap_fine_to_replacement_price.is(':checked') ); >@@ -861,7 +872,7 @@ > // Remove potential previous input added > $(current_column).find("input").remove(); > $(current_column).append("<input type='hidden' name='"+name+"' value='"+val+"' />"); >- } else if ( i == 3 || i == 4 ) { >+ } else if ( i == 4 || i == 5 ) { > // If the value is not an integer for "Current checkouts allowed" or "Current on-site checkouts allowed" > // The value is "Unlimited" (or an equivalent translated string) > // an it should be set to an empty string >-- >2.11.0
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 12365
:
61865
|
63902
|
64441
|
64443
|
64565
|
66829
|
66830
|
67802
|
76609
|
76637
|
76658
|
77147
|
77275
|
78685
|
78686
|
80790
|
80956
|
80957
|
80958
|
80997
|
80998
|
81603
|
81604
|
81605
|
81606
|
81647
|
81648
|
81649
|
81650
|
82081