Bug 766: Use the new plugin to generate sort dropdown list - memberentry
authorJonathan Druart <jonathan.druart@biblibre.com>
Thu, 6 Mar 2014 16:08:37 +0000 (17:08 +0100)
committerGalen Charlton <gmc@esilibrary.com>
Sun, 4 May 2014 23:02:48 +0000 (23:02 +0000)
Now we can use the method plugin from the memberentry form.

Test plan:
1/ Create a patron and verify sort1 and sort2 dropdown list are
   correctly generated.
2/ Select values.
3/ Save.
4/ Edit the patron and verify the selected values are displayed.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Works as described.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt
members/memberentry.pl

index 694432e..c4d0c6a 100644 (file)
@@ -1,3 +1,4 @@
+[% USE AuthorisedValues %]
 [% IF ( opduplicate ) %][% SET focusAction = "clearDupe" %][% END %]
 [% USE KohaDates %]
 [% INCLUDE 'doc-head-open.inc' %]
         <label for="sort1">
       [% END %]
       Sort 1: </label>
-      [% IF ( CGIsort1 ) %] 
-        [% CGIsort1 %]
-      [% ELSE %]
-            <input type="text" id="sort1" name="sort1" size="20" value="[% sort1 %]" class="[% focusAction %]" />
-         [% IF ( mandatorysort1 ) %]<span class="required">Required</span>[% END %]
-      [% END %]   
+      [% AuthorisedValues.BuildDropbox("sort1", "Bsort1", sort1, { class => focusAction, size => 20 } ) %]
+      [% IF ( mandatorysort1 ) %]<span class="required">Required</span>[% END %]
     </li>
         [% END %]
         [% UNLESS nosort2 %]
     <label for="sort2">
     [% END %]
     Sort 2: </label>
-    [% IF ( CGIsort2 ) %] 
-      [% CGIsort2 %]
-    [% ELSE %]
-        <input type="text" id="sort2" name="sort2" size="20" value="[% sort2 %]" class="[% focusAction %]" />
-         [% IF ( mandatorysort2 ) %]<span class="required">Required</span>[% END %]
-    [% END %] 
+    [% AuthorisedValues.BuildDropbox("sort2", "Bsort2", sort2, { class => focusAction, size => 20 } ) %]
+    [% IF ( mandatorysort2 ) %]<span class="required">Required</span>[% END %]
     </li>
         [% END %]
        </ol>
index ff92447..3b042e3 100755 (executable)
@@ -630,9 +630,8 @@ $template->param( sort1 => $data{'sort1'});         # shouldn't this be in an "else" st
 $CGIsort = buildCGIsort("Bsort2","sort2",$data{'sort2'});
 if ($CGIsort) {
     $template->param(CGIsort2 => $CGIsort);
-} else {
-    $template->param( sort2 => $data{'sort2'});
 }
+$template->param( sort2 => $data{'sort2'});
 
 if ($nok) {
     foreach my $error (@errors) {