moving more html out of the script
authorrangi <rangi>
Wed, 22 Oct 2003 20:01:28 +0000 (20:01 +0000)
committerrangi <rangi>
Wed, 22 Oct 2003 20:01:28 +0000 (20:01 +0000)
circ/circulation.pl
koha-tmpl/intranet-tmpl/default/en/circ/circulation.tmpl

index 0a898a9..e1db535 100755 (executable)
@@ -155,9 +155,13 @@ if ($borrowernumber) {
 ##################################################################################
 # HTML code....
 
-my $responsesform = '';
+my %responseform;
+my @responsearray;
 foreach (keys %responses) {
-    $responsesform.="<input type=hidden name=response-$_ value=$responses{$_}>\n";
+#    $responsesform.="<input type=hidden name=response-$_ value=$responses{$_}>\n";
+    $responseform{'name'}=$_;
+    $responseform{'value'}=$responses{$_};
+    push @responsearray,\%responseform;
 }
 my $questionform;
 my $stickyduedate;
@@ -289,7 +293,6 @@ $template->param(
                branchname => $branches->{$branch}->{'branchname'},
                printername => $printers->{$printer}->{'printername'},
                allowborrow =>$allowborrow,
-
                #question form
                question => $question,
                title => $iteminformation->{'title'},
@@ -304,14 +307,13 @@ $template->param(
                monthoptions => $monthoptions,
                yearoptions => $yearoptions,
                stickyduedate => $stickyduedate,
-               responseform => $responsesform,
                rejected => $rejected,
                message => $message,
                CGIselectborrower => $CGIselectborrower,
-
                amountold => $amountold,
                todayissues => \@realtodayissues,
-               previssues => \@realprevissues
+               previssues => \@realprevissues,
+               responseloop => \@responsearray 
        );
 
 if ($branchcookie) {
index 170a765..ecbf92c 100644 (file)
@@ -78,7 +78,9 @@
                                                        <input type=hidden name=stickyduedate value=<TMPL_VAR name="stickyduedate">>
                                                        <input type=hidden name=branch value=<TMPL_VAR name="branch">>
                                                        <input type=hidden name=printer value=<TMPL_VAR name="printer">>
-                                                       <TMPL_VAR name="responsesform">
+                                                       <TMPL_LOOP NAME="responseloop">
+                                                       <input type=hidden name="<TMPL_VAR="name">" value="<TMPL_VAR NAME="value">">
+                                                       </TMPL_LOOP>
                                                        <input type=hidden name=answer value=Y>
                                                        <input type=submit value=Yes>
                                                        </form>
@@ -94,7 +96,9 @@
                                                        <input type=hidden name=stickyduedate value=<TMPL_VAR name="stickyduedate">>
                                                        <input type=hidden name=branch value=<TMPL_VAR name="branch">>
                                                        <input type=hidden name=printer value=<TMPL_VAR name="printer">>
-                                                       <TMPL_VAR name="responsesform">
+                                                       <TMPL_LOOP NAME="responseloop">
+                                                       <input type=hidden name="<TMPL_VAR="name">" value="<TMPL_VAR NAME="value">">
+                                                       </TMPL_LOOP>
                                                        <input type=hidden name=answer value=N>
                                                        <input type=submit value=No>
                                                        </form>