View | Details | Raw Unified | Return to bug 3020
Collapse All | Expand All

(-)a/C4/Serials.pm (-6 / +7 lines)
Lines 1347-1353 $subscriptionid = &NewSubscription($auser,branchcode,$aqbooksellerid,$cost,$aqbu Link Here
1347
    $add1,$every1,$whenmorethan1,$setto1,$lastvalue1,$innerloop1,
1347
    $add1,$every1,$whenmorethan1,$setto1,$lastvalue1,$innerloop1,
1348
    $add2,$every2,$whenmorethan2,$setto2,$lastvalue2,$innerloop2,
1348
    $add2,$every2,$whenmorethan2,$setto2,$lastvalue2,$innerloop2,
1349
    $add3,$every3,$whenmorethan3,$setto3,$lastvalue3,$innerloop3,
1349
    $add3,$every3,$whenmorethan3,$setto3,$lastvalue3,$innerloop3,
1350
    $numberingmethod, $status, $notes, $serialsadditems)
1350
    $numberingmethod, $status, $notes, $serialsadditems, graceperiod)
1351
1351
1352
Create a new subscription with value given on input args.
1352
Create a new subscription with value given on input args.
1353
1353
Lines 1370-1376 sub NewSubscription { Link Here
1370
        $lastvalue3,    $innerloop3,   $numberingmethod, $status,
1370
        $lastvalue3,    $innerloop3,   $numberingmethod, $status,
1371
        $notes,         $letter,       $firstacquidate,  $irregularity,
1371
        $notes,         $letter,       $firstacquidate,  $irregularity,
1372
        $numberpattern, $callnumber,   $hemisphere,      $manualhistory,
1372
        $numberpattern, $callnumber,   $hemisphere,      $manualhistory,
1373
        $internalnotes, $serialsadditems,
1373
        $internalnotes, $serialsadditems, $graceperiod
1374
    ) = @_;
1374
    ) = @_;
1375
    my $dbh = C4::Context->dbh;
1375
    my $dbh = C4::Context->dbh;
1376
1376
Lines 1383-1390 sub NewSubscription { Link Here
1383
            add2,every2,whenmorethan2,setto2,lastvalue2,innerloop2,
1383
            add2,every2,whenmorethan2,setto2,lastvalue2,innerloop2,
1384
            add3,every3,whenmorethan3,setto3,lastvalue3,innerloop3,
1384
            add3,every3,whenmorethan3,setto3,lastvalue3,innerloop3,
1385
            numberingmethod, status, notes, letter,firstacquidate,irregularity,
1385
            numberingmethod, status, notes, letter,firstacquidate,irregularity,
1386
            numberpattern, callnumber, hemisphere,manualhistory,internalnotes,serialsadditems)
1386
            numberpattern, callnumber, hemisphere,manualhistory,internalnotes,serialsadditems,graceperiod)
1387
        VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
1387
        VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
1388
        |;
1388
        |;
1389
    my $sth = $dbh->prepare($query);
1389
    my $sth = $dbh->prepare($query);
1390
    $sth->execute(
1390
    $sth->execute(
Lines 1409-1414 sub NewSubscription { Link Here
1409
        $numberpattern,                 $callnumber,
1409
        $numberpattern,                 $callnumber,
1410
        $hemisphere,                    $manualhistory,
1410
        $hemisphere,                    $manualhistory,
1411
        $internalnotes,                 $serialsadditems,
1411
        $internalnotes,                 $serialsadditems,
1412
        $graceperiod,
1412
    );
1413
    );
1413
1414
1414
    #then create the 1st waited number
1415
    #then create the 1st waited number
Lines 2364-2372 sub abouttoexpire { Link Here
2364
      $sth->execute($subscriptionid);
2365
      $sth->execute($subscriptionid);
2365
      my ($res) = $sth->fetchrow ;
2366
      my ($res) = $sth->fetchrow ;
2366
#        warn "date expiration : ".$expirationdate." date courante ".$res;
2367
#        warn "date expiration : ".$expirationdate." date courante ".$res;
2367
      my @res=split /-/,$res;
2368
      my @res=split (/-/,$res);
2368
      @res=Date::Calc::Today if ($res[0]*$res[1]==0);
2369
      @res=Date::Calc::Today if ($res[0]*$res[1]==0);
2369
      my @endofsubscriptiondate=split/-/,$expirationdate;
2370
      my @endofsubscriptiondate=split(/-/,$expirationdate);
2370
      my $x;
2371
      my $x;
2371
      if ( $per == 1 ) {$x=7;}
2372
      if ( $per == 1 ) {$x=7;}
2372
      if ( $per == 2 ) {$x=7; }
2373
      if ( $per == 2 ) {$x=7; }
(-)a/installer/data/mysql/kohastructure.sql (+1 lines)
Lines 1896-1901 CREATE TABLE `subscription` ( Link Here
1896
  `hemisphere` tinyint(3) default 0,
1896
  `hemisphere` tinyint(3) default 0,
1897
  `lastbranch` varchar(10),
1897
  `lastbranch` varchar(10),
1898
  `serialsadditems` tinyint(1) NOT NULL default '0',
1898
  `serialsadditems` tinyint(1) NOT NULL default '0',
1899
  `graceperiod` int(11) NOT NULL default '0',
1899
  PRIMARY KEY  (`subscriptionid`)
1900
  PRIMARY KEY  (`subscriptionid`)
1900
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1901
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1901
1902
(-)a/installer/data/mysql/updatedatabase.pl (+6 lines)
Lines 2240-2245 if (C4::Context->preference("Version") < TransformToNum($DBversion)) { Link Here
2240
    SetVersion ($DBversion);
2240
    SetVersion ($DBversion);
2241
}
2241
}
2242
2242
2243
$DBversion = "3.01.00.025";
2244
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
2245
    $dbh->do("ALTER TABLE `subscription` ADD COLUMN `graceperiod` INT(11) NOT NULL default '0';");
2246
    print "Upgrade to $DBversion done (Adding a field in issuingrules table)\n";
2247
    SetVersion ($DBversion);
2248
}
2243
2249
2244
=item DropAllForeignKeys($table)
2250
=item DropAllForeignKeys($table)
2245
2251
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tmpl (+3 lines)
Lines 1000-1005 $('#numberpattern').change( function() { Link Here
1000
            
1000
            
1001
        </li>
1001
        </li>
1002
        <li>
1002
        <li>
1003
    		<label for="graceperiod">Grace period:</label> <input type="text" name="graceperiod" id="graceperiod" value="<!-- TMPL_VAR name="graceperiod" -->" /> day(s)
1004
	    </li>
1005
        <li>
1003
            <label for="notes">Public note:</label>
1006
            <label for="notes">Public note:</label>
1004
            <textarea name="notes" id="notes" cols="30" rows="2"><!-- TMPL_VAR name="notes" --></textarea>
1007
            <textarea name="notes" id="notes" cols="30" rows="2"><!-- TMPL_VAR name="notes" --></textarea>
1005
        </li>
1008
        </li>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tmpl (+1 lines)
Lines 66-71 function popup(subscriptionid) { Link Here
66
        <!-- TMPL_ELSE -->
66
        <!-- TMPL_ELSE -->
67
            <li>Serial receipt does not create an item record.</li>
67
            <li>Serial receipt does not create an item record.</li>
68
        <!-- /TMPL_IF -->
68
        <!-- /TMPL_IF -->
69
        <li><span class="label">Grace period:</span> <!-- TMPL_VAR name="graceperiod" -->&nbsp;</li>
69
        <!-- TMPL_IF name="callnumber" --><li><span class="label">Call Number:</span> <!-- TMPL_VAR name="callnumber" -->&nbsp;</li><!-- /TMPL_IF -->
70
        <!-- TMPL_IF name="callnumber" --><li><span class="label">Call Number:</span> <!-- TMPL_VAR name="callnumber" -->&nbsp;</li><!-- /TMPL_IF -->
70
        <!-- TMPL_IF name="letter" --><li><span class="label">Patron alert with:</span> <!-- TMPL_VAR name="letter" -->&nbsp;</li><!-- /TMPL_IF -->
71
        <!-- TMPL_IF name="letter" --><li><span class="label">Patron alert with:</span> <!-- TMPL_VAR name="letter" -->&nbsp;</li><!-- /TMPL_IF -->
71
        <!-- TMPL_IF name="notes" --><li><span class="label">Notes:</span> <!-- TMPL_VAR name="notes" --></li><!-- /TMPL_IF -->
72
        <!-- TMPL_IF name="notes" --><li><span class="label">Notes:</span> <!-- TMPL_VAR name="notes" --></li><!-- /TMPL_IF -->
(-)a/kohaversion.pl (-1 / +1 lines)
Lines 10-16 Link Here
10
use strict;
10
use strict;
11
11
12
sub kohaversion {
12
sub kohaversion {
13
    our $VERSION = '3.01.00.019';
13
    our $VERSION = '3.01.00.025';
14
    # version needs to be set this way
14
    # version needs to be set this way
15
    # so that it can be picked up by Makefile.PL
15
    # so that it can be picked up by Makefile.PL
16
    # during install
16
    # during install
(-)a/serials/subscription-add.pl (-18 / +19 lines)
Lines 161-182 $template->param( 'dateformat_' . C4::Context->preference('dateformat') => 1 , Link Here
161
                );
161
                );
162
162
163
if ($op eq 'addsubscription') {
163
if ($op eq 'addsubscription') {
164
    my $auser = $query->param('user');
164
    my $auser           = $query->param('user');
165
    my $branchcode = $query->param('branchcode');
165
    my $branchcode      = $query->param('branchcode');
166
    my $aqbooksellerid = $query->param('aqbooksellerid');
166
    my $aqbooksellerid  = $query->param('aqbooksellerid');
167
    my $cost = $query->param('cost');
167
    my $cost            = $query->param('cost');
168
    my $aqbudgetid = $query->param('aqbudgetid'); 
168
    my $aqbudgetid      = $query->param('aqbudgetid'); 
169
    my $startdate = $query->param('startdate');
169
    my $startdate       = $query->param('startdate');
170
    my $firstacquidate = $query->param('firstacquidate');    
170
    my $firstacquidate  = $query->param('firstacquidate');    
171
    my $periodicity = $query->param('periodicity');
171
    my $periodicity     = $query->param('periodicity');
172
    my $dow = $query->param('dow');
172
    my $dow             = $query->param('dow');
173
    my @irregularity = $query->param('irregularity_select');
173
    my @irregularity    = $query->param('irregularity_select');
174
    my $numberlength = 0;
174
    my $numberlength    = 0;
175
    my $weeklength = 0;
175
    my $weeklength      = 0;
176
    my $monthlength = 0;
176
    my $monthlength     = 0;
177
    my $numberpattern = $query->param('numbering_pattern');
177
    my $numberpattern   = $query->param('numbering_pattern');
178
    my $sublength = $query->param('sublength');
178
    my $sublength       = $query->param('sublength');
179
    my $subtype = $query->param('subtype');
179
    my $subtype         = $query->param('subtype');
180
    my $graceperiod     = $query->param('graceperiod') || 0;
181
180
    if ($subtype eq 'months'){
182
    if ($subtype eq 'months'){
181
        $monthlength = $sublength;
183
        $monthlength = $sublength;
182
    } elsif ($subtype eq 'weeks'){
184
    } elsif ($subtype eq 'weeks'){
Lines 220-226 if ($op eq 'addsubscription') { Link Here
220
					$add3,$every3,$whenmorethan3,$setto3,$lastvalue3,$innerloop3,
222
					$add3,$every3,$whenmorethan3,$setto3,$lastvalue3,$innerloop3,
221
					$numberingmethod, $status, $notes,$letter,$firstacquidate,join(",",@irregularity),
223
					$numberingmethod, $status, $notes,$letter,$firstacquidate,join(",",@irregularity),
222
                    $numberpattern, $callnumber, $hemisphere,($manualhistory?$manualhistory:0),$internalnotes,
224
                    $numberpattern, $callnumber, $hemisphere,($manualhistory?$manualhistory:0),$internalnotes,
223
                    $serialsadditems,
225
                    $serialsadditems,$graceperiod
224
				);
226
				);
225
227
226
    print $query->redirect("/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=$subscriptionid");
228
    print $query->redirect("/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=$subscriptionid");
227
- 

Return to bug 3020