Fix the checked box "manual history" and fix the "null" value of serial next issue...
authorNahuel Angelinetti <nahuel.angelinetti@biblibre.com>
Fri, 17 Oct 2008 13:44:44 +0000 (15:44 +0200)
committerHenri-Damien LAURENT <henridamien.laurent@biblibre.com>
Fri, 6 Mar 2009 09:47:31 +0000 (10:47 +0100)
first part of this patch is the manual history must be checked if in database its checked.
Then, when you do not enter a value "Next issue publication date", a null value was set in the database, now, if empty, the  "first issue date" is set as "next issue".
And finally, We check that "manual history" is checked to show the "Subscription history" part. Actually its never shown.

Signed-off-by: Henri-Damien LAURENT <henridamien.laurent@biblibre.com>
koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tmpl
serials/subscription-add.pl

index ec835cc..60e09d7 100644 (file)
@@ -1171,7 +1171,14 @@ $('#numberpattern').change( function() {
                     <option value="11">1/2 years</option>
                 <!-- /TMPL_IF -->
                 </select> <span class="required">Required</span></li>
-                               <li><label for="manuallist"> Manual history:</label> <input type="checkbox" name="manualhist" id="manuallist" value="1" /></li>
+                <li>
+                    <label for="manuallist"> Manual history:</label>
+                    <!-- TMPL_IF name="manualhistory" -->
+                        <input type="checkbox" name="manualhist" id="manuallist" value="1" checked="checked" />
+                    <!-- TMPL_ELSE -->
+                        <input type="checkbox" name="manualhist" id="manuallist" value="1" />
+                    <!-- /TMPL_IF -->
+                </li>
         <li>
            <label for="numberpattern"> Numbering pattern:</label>
             
index 37a465e..39bd8ff 100755 (executable)
@@ -128,7 +128,7 @@ if ($op eq 'mod' || $op eq 'dup' || $op eq 'modsubscription') {
                     $op => 1,
                     subtype => \@sub_type_data,
                     sublength =>$sublength,
-                    history => ($op eq 'mod' && ($subs->{recievedlist}||$subs->{missinglist}||$subs->{opacnote}||$subs->{librariannote})),
+                    history => ($op eq 'mod' && $subs->{manualhistory} == 1 ),
                     "periodicity".$subs->{'periodicity'} => 1,
                     "dow".$subs->{'dow'} => 1,
                     "numberpattern".$subs->{'numberpattern'} => 1,
@@ -235,7 +235,9 @@ if ($op eq 'addsubscription') {
     my $biblionumber = $query->param('biblionumber');
     my $aqbudgetid = $query->param('aqbudgetid');
     my $startdate = format_date_in_iso($query->param('startdate'));
-    my $nextacquidate = format_date_in_iso($query->param('nextacquidate'));    
+    my $nextacquidate = $query->param('nextacquidate') ?
+                            format_date_in_iso($query->param('nextacquidate')):
+                            format_date_in_iso($query->param('startdate'));
     my $periodicity = $query->param('periodicity');
     my $dow = $query->param('dow');
     my $sublength = $query->param('sublength');