Bugzilla – Attachment 29052 Details for
Bug 12451
circulation rule cant be edited if itemtype contains a space character
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED-OFF] Bug 12451 - circulation rule cant be edited if itemtype contains a space character
SIGNED-OFF-Bug-12451---circulation-rule-cant-be-ed.patch (text/plain), 2.51 KB, created by
Owen Leonard
on 2014-06-19 15:42:23 UTC
(
hide
)
Description:
[SIGNED-OFF] Bug 12451 - circulation rule cant be edited if itemtype contains a space character
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2014-06-19 15:42:23 UTC
Size:
2.51 KB
patch
obsolete
>From a5efee3bb7c028343fa96031773b416493d4bbc9 Mon Sep 17 00:00:00 2001 >From: Fridolin Somers <fridolin.somers@biblibre.com> >Date: Thu, 19 Jun 2014 10:17:53 +0200 >Subject: [PATCH] [SIGNED-OFF] Bug 12451 - circulation rule cant be edited if > itemtype contains a space character >Content-Type: text/plain; charset="utf-8" > >When an itemtype description contains a space character like " Book" >(often used to set this itemtype as first in sorted lists), the edition >of an existing circulation rule does not work, it selects the default >itemtype. Same for patron category. > >It's because the JavaScript code performs a trim on value existing in >table itm = itm.replace(/^\s*|\s*$/g,''); This patch adds trim on select >options in editing line. > >Test plan : >- Create an itemtype with a leading or trailling space in description : > ie " Book" >- Go to cgi-bin/koha/admin/smart-rules.pl >- Create a rule with this itemtype, Unit=hours and Hard due date=Exactly > on 31/12/2015 (any date) >- Click on Edit on this rule line > => Without this patch, the default itemtype is selected in edition > line > => With this patch, the correct itemtype is selected in edition line > >Check others selects are ok : > - Create a rule with Unit=hours and Hard due date=Exactly on > 31/12/2015 (any date) > - Click on Edit on this rule line > => The correct options are selected >Same tests with a patron category containing a leading or trailling space in description > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >--- > .../prog/en/modules/admin/smart-rules.tt | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > >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 a7fe76e..1b8b21a 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 >@@ -42,7 +42,9 @@ $(document).ready(function() { > $(current_column).find("input[type='text']").val(itm); > // select the corresponding option > $(current_column).find("select option").each(function(){ >- if ( $(this).text().toLowerCase() == itm.toLowerCase() ) { >+ opt = $(this).text().toLowerCase(); >+ opt = opt.replace(/^\s*|\s*$/g,''); >+ if ( opt == itm.toLowerCase() ) { > $(this).attr('selected', 'selected'); > } > }); >-- >1.7.9.5
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 12451
:
28979
|
29052
|
29054