From ef946da09b3728c05a12f750d7edb57bc37f1493 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.
---
.../intranet-tmpl/prog/en/modules/admin/smart-rules.tt | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 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 0a10714..7e0e788 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
@@ -66,6 +66,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>
@@ -92,7 +93,6 @@
<th>Item level holds</th>
<th>Article requests</th>
<th>Rental discount (%)</th>
- <th>Note</th>
<th>Actions</th>
</tr>
</thead>
@@ -116,6 +116,11 @@
<a class="btn btn-default btn-xs delete" href="/cgi-bin/koha/admin/smart-rules.pl?op=delete&itemtype=[% rule.itemtype %]&categorycode=[% rule.categorycode %]&branch=[% rule.current_branch %]"><i class="fa fa-trash"></i> Delete</a>
</td>
+ <td>
+ [% IF rule.note %]
+ <a 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 %]
@@ -213,7 +218,6 @@
[% END %]
</td>
<td>[% rule.rentaldiscount %]</td>
- <td>[% rule.note %]</td>
<td class="actions">
<a href="#" class="editrule btn btn-default btn-xs"><i class="fa fa-pencil"></i> Edit</a>
<a class="btn btn-default btn-xs delete" href="/cgi-bin/koha/admin/smart-rules.pl?op=delete&itemtype=[% rule.itemtype %]&categorycode=[% rule.categorycode %]&branch=[% rule.current_branch %]"><i class="fa fa-trash"></i> Delete</a>
@@ -243,6 +247,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>
@@ -314,7 +319,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 %]"/>
<button type="submit" class="btn btn-default btn-xs"><i class="fa fa-save"></i> Save</button>
@@ -326,6 +330,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>
@@ -345,14 +350,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>
@@ -767,6 +771,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);
});
--
2.1.4