[MT1234] Replaced useless selectbox in the title of contact form
authorJean-André Santoni <jeanandre.santoni@biblibre.com>
Thu, 10 Dec 2009 10:20:03 +0000 (11:20 +0100)
committerHenri-Damien LAURENT <henridamien.laurent@biblibre.com>
Thu, 28 Jan 2010 14:11:44 +0000 (15:11 +0100)
admin/aqcontract.pl
koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqcontract.tmpl

index eea782d..cd5b2f8 100755 (executable)
@@ -77,6 +77,7 @@ $template->param(
 if ( $op eq 'add_form' ) {
     $template->param( add_form => 1 );
     my $data;
+    my $booksellername;
 
     #---- if primkey exists, it's a modify action, so read values to modify...
     if ($contractnumber) {
@@ -86,16 +87,12 @@ if ( $op eq 'add_form' ) {
         $data = $sth->fetchrow_hashref;
         $sth->finish;
 
-        for my $bookseller (@bookseller) {
-            if ( $bookseller->{'id'} eq $data->{'booksellerid'} ) {
-                $bookseller->{'selected'} = 1;
-            }
+        for ( @bookseller ) {
+            $booksellername = $$_{name} if $$_{id} eq $$data{booksellerid};
         }
     } else {
-        for my $bookseller (@bookseller) {
-            if ( $bookseller->{'id'} eq $booksellerid ) {
-                $bookseller->{'selected'} = 1;
-            }
+        for ( @bookseller ) {
+            $booksellername = $$_{name} if $$_{id} eq $booksellerid;
         }
     }
     $template->param(
@@ -104,7 +101,7 @@ if ( $op eq 'add_form' ) {
         contractdescription      => $data->{'contractdescription'},
         contractstartdate        => format_date( $data->{'contractstartdate'} ),
         contractenddate          => format_date( $data->{'contractenddate'} ),
-        booksellerloop           => \@bookseller,
+        booksellername           => $booksellername,
         booksellerid             => $data->{'booksellerid'},
         DHTMLcalendar_dateformat => C4::Dates->DHTMLcalendar(),
     );
index 6d3f053..d1823fa 100644 (file)
@@ -89,19 +89,9 @@ function Check(ff) {
                         <input type="hidden" name="op" value="add_validate" />
                         <input type="hidden" name="checked" value="0" />
                         <!-- TMPL_IF NAME="contractnumber" -->
-                            <h1>Modify contract <!-- TMPL_VAR NAME="contractname" -->
-                                <select id="booksellerid" name="booksellerid">
-                                <!-- TMPL_LOOP NAME="booksellerloop" -->
-                                    <!-- TMPL_IF NAME="selected" -->
-                                        <option value="<!-- TMPL_VAR NAME="id" -->" selected="selected"><!-- TMPL_VAR NAME="name" --></option>
-                                    <!-- TMPL_ELSE -->
-                                        <option value="<!-- TMPL_VAR NAME="id" -->"><!-- TMPL_VAR NAME="name" --></option>
-                                    <!-- /TMPL_IF -->
-                                <!-- /TMPL_LOOP -->
-                                </select>
-                            </h1>
+                            <h1>Modify contract <!-- TMPL_VAR NAME="contractname" --> for <!-- TMPL_VAR NAME="booksellername" --></h1>
                         <!-- TMPL_ELSE -->
-                            <h1>New contract</h1>
+                            <h1>New contract for <!-- TMPL_VAR NAME="booksellername" --></h1>
                         <!-- /TMPL_IF -->
                         <fieldset class="rows">
                             <ol>