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

(-)a/C4/Serials.pm (-9 / +8 lines)
Lines 1088-1094 Note : if we change from "waited" to something else,then we will have to create Link Here
1088
=cut
1088
=cut
1089
1089
1090
sub ModSerialStatus {
1090
sub ModSerialStatus {
1091
    my ( $serialid, $serialseq, $planneddate, $publisheddate, $status, $notes ) = @_;
1091
    my ( $serialid, $serialseq, $planneddate, $publisheddate, $published_end_date, $status, $notes ) = @_;
1092
1092
1093
    #It is a usual serial
1093
    #It is a usual serial
1094
    # 1st, get previous status :
1094
    # 1st, get previous status :
Lines 1105-1113 sub ModSerialStatus { Link Here
1105
    }
1105
    }
1106
    else {
1106
    else {
1107
        my $query =
1107
        my $query =
1108
'UPDATE serial SET serialseq=?,publisheddate=?,planneddate=?,status=?,notes=? WHERE  serialid = ?';
1108
'UPDATE serial SET serialseq=?,publisheddate=?,published_end_date=?,planneddate=?,status=?,notes=? WHERE  serialid = ?';
1109
        $sth = $dbh->prepare($query);
1109
        $sth = $dbh->prepare($query);
1110
        $sth->execute( $serialseq, $publisheddate, $planneddate, $status, $notes, $serialid );
1110
        $sth->execute( $serialseq, $publisheddate, $published_end_date, $planneddate, $status, $notes, $serialid );
1111
        $query = "SELECT * FROM   subscription WHERE  subscriptionid = ?";
1111
        $query = "SELECT * FROM   subscription WHERE  subscriptionid = ?";
1112
        $sth   = $dbh->prepare($query);
1112
        $sth   = $dbh->prepare($query);
1113
        $sth->execute($subscriptionid);
1113
        $sth->execute($subscriptionid);
Lines 1153-1159 sub ModSerialStatus { Link Here
1153
1153
1154
        # next date (calculated from actual date & frequency parameters)
1154
        # next date (calculated from actual date & frequency parameters)
1155
        my $nextpublisheddate = GetNextDate( $publisheddate, $val );
1155
        my $nextpublisheddate = GetNextDate( $publisheddate, $val );
1156
        NewIssue( $newserialseq, $subscriptionid, $val->{'biblionumber'}, 1, $nextpublisheddate, $nextpublisheddate, undef, $newlastvalue1, $newlastvalue2, $newlastvalue3 );
1156
        NewIssue( $newserialseq, $subscriptionid, $val->{'biblionumber'}, 1, $nextpublisheddate, $nextpublisheddate, $published_end_date, undef, $newlastvalue1, $newlastvalue2, $newlastvalue3 );
1157
        $query = "UPDATE subscription SET lastvalue1=?, lastvalue2=?, lastvalue3=?, innerloop1=?, innerloop2=?, innerloop3=?
1157
        $query = "UPDATE subscription SET lastvalue1=?, lastvalue2=?, lastvalue3=?, innerloop1=?, innerloop2=?, innerloop3=?
1158
                    WHERE  subscriptionid = ?";
1158
                    WHERE  subscriptionid = ?";
1159
        $sth = $dbh->prepare($query);
1159
        $sth = $dbh->prepare($query);
Lines 1463-1480 returns the serial id Link Here
1463
=cut
1463
=cut
1464
1464
1465
sub NewIssue {
1465
sub NewIssue {
1466
    my ( $serialseq, $subscriptionid, $biblionumber, $status, $planneddate, $publisheddate, $notes, $x, $y, $z ) = @_;
1466
    my ( $serialseq, $subscriptionid, $biblionumber, $status, $planneddate, $publisheddate, $published_end_date, $notes, $x, $y, $z ) = @_;
1467
    warn "NewIssue( $serialseq, $subscriptionid, $biblionumber, $status, $planneddate, $publisheddate, $notes, $x, $y, $z )";
1468
    ### FIXME biblionumber CAN be provided by subscriptionid. So Do we STILL NEED IT ?
1467
    ### FIXME biblionumber CAN be provided by subscriptionid. So Do we STILL NEED IT ?
1469
1468
1470
    my $dbh   = C4::Context->dbh;
1469
    my $dbh   = C4::Context->dbh;
1471
    my $query = qq|
1470
    my $query = qq|
1472
        INSERT INTO serial
1471
        INSERT INTO serial
1473
            (serialseq,subscriptionid,biblionumber,status,publisheddate,planneddate,notes,serialseq_x,serialseq_y,serialseq_z)
1472
            (serialseq,subscriptionid,biblionumber,status,publisheddate,published_end_date,planneddate,notes,serialseq_x,serialseq_y,serialseq_z)
1474
        VALUES (?,?,?,?,?,?,?,?,?,?)
1473
        VALUES (?,?,?,?,?,?,?,?,?,?,?)
1475
    |;
1474
    |;
1476
    my $sth = $dbh->prepare($query);
1475
    my $sth = $dbh->prepare($query);
1477
    $sth->execute( $serialseq, $subscriptionid, $biblionumber, $status, $publisheddate, $planneddate, $notes, $x, $y, $z );
1476
    $sth->execute( $serialseq, $subscriptionid, $biblionumber, $status, $publisheddate, $published_end_date, $planneddate, $notes, $x, $y, $z );
1478
    my $serialid = $dbh->{'mysql_insertid'};
1477
    my $serialid = $dbh->{'mysql_insertid'};
1479
    $query = qq|
1478
    $query = qq|
1480
        SELECT missinglist,recievedlist
1479
        SELECT missinglist,recievedlist
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tt (+7 lines)
Lines 211-216 $(document).ready(function() { Link Here
211
		<th>Expected on</th>
211
		<th>Expected on</th>
212
		<th>Status</th>
212
		<th>Status</th>
213
		<th>Notes</th>
213
		<th>Notes</th>
214
                <th>Bound volumes<br/>Ending published on</th>
214
	</tr>
215
	</tr>
215
[% FOREACH serialslis IN serialslist %]
216
[% FOREACH serialslis IN serialslist %]
216
    [% UNLESS ( loop.odd ) %]
217
    [% UNLESS ( loop.odd ) %]
Lines 281-286 $(document).ready(function() { Link Here
281
        <td>
282
        <td>
282
            <input type="text" name="notes" value="[% serialslis.sernotes %]" size="20" maxlength="255" />
283
            <input type="text" name="notes" value="[% serialslis.sernotes %]" size="20" maxlength="255" />
283
        </td>
284
        </td>
285
        <td>
286
            <input type="text" name="published_end_date" value="[% serialslis.published_end_date %]" size="10" maxlength="15" class="datepicker" readonly="readonly"/>
287
        </td>
284
    </tr>
288
    </tr>
285
  [% UNLESS ( serialslis.subscriptionexpired ) %]
289
  [% UNLESS ( serialslis.subscriptionexpired ) %]
286
  [% IF ( serialslis.serialsadditems ) %]
290
  [% IF ( serialslis.serialsadditems ) %]
Lines 386-391 $(document).ready(function() { Link Here
386
        <td>
390
        <td>
387
            <input type="text" name="notes" value="" size="20" maxlength="255" />
391
            <input type="text" name="notes" value="" size="20" maxlength="255" />
388
        </td>
392
        </td>
393
        <td>
394
            <input type="text" name="published_end_date" value="[% newserialloo.published_end_date %]" size="10" maxlength="15"  class="datepicker" readonly="readonly"/>
395
        </td>
389
    </tr>
396
    </tr>
390
  [% IF ( newserialloo.serialsadditems ) %]
397
  [% IF ( newserialloo.serialsadditems ) %]
391
          <tr>
398
          <tr>
(-)a/serials/serials-collection.pl (-1 / +1 lines)
Lines 79-85 if($op eq 'gennext' && @subscriptionid){ Link Here
79
	     my $nextpublisheddate = GetNextDate( $expected->{planneddate}->output('iso'), $subscription );
79
	     my $nextpublisheddate = GetNextDate( $expected->{planneddate}->output('iso'), $subscription );
80
	     ## Creating the new issue
80
	     ## Creating the new issue
81
	     NewIssue( $newserialseq, $subscriptionid, $subscription->{'biblionumber'},
81
	     NewIssue( $newserialseq, $subscriptionid, $subscription->{'biblionumber'},
82
	             1, $nextpublisheddate, $nextpublisheddate, undef, $newlastvalue1, $newlastvalue2, $newlastvalue3 );
82
	             1, $nextpublisheddate, $nextpublisheddate, undef, undef, $newlastvalue1, $newlastvalue2, $newlastvalue3 );
83
83
84
	     ## Updating the subscription seq status
84
	     ## Updating the subscription seq status
85
	     my $squery = "UPDATE subscription SET lastvalue1=?, lastvalue2=?, lastvalue3=?, innerloop1=?, innerloop2=?, innerloop3=?
85
	     my $squery = "UPDATE subscription SET lastvalue1=?, lastvalue2=?, lastvalue3=?, innerloop1=?, innerloop2=?, innerloop3=?
(-)a/serials/serials-edit.pl (-3 / +9 lines)
Lines 81-86 my @serialids = $query->param('serialid'); Link Here
81
my @serialseqs      = $query->param('serialseq');
81
my @serialseqs      = $query->param('serialseq');
82
my @planneddates    = $query->param('planneddate');
82
my @planneddates    = $query->param('planneddate');
83
my @publisheddates  = $query->param('publisheddate');
83
my @publisheddates  = $query->param('publisheddate');
84
my @published_end_dates = $query->param('published_end_date');
84
my @status          = $query->param('status');
85
my @status          = $query->param('status');
85
my @notes           = $query->param('notes');
86
my @notes           = $query->param('notes');
86
my @subscriptionids = $query->param('subscriptionid');
87
my @subscriptionids = $query->param('subscriptionid');
Lines 134-140 foreach my $serialid (@serialids) { Link Here
134
        && !$processedserialid{$serialid} )
135
        && !$processedserialid{$serialid} )
135
    {
136
    {
136
        my $serinfo = GetSerialInformation($serialid); #TODO duplicates work done by GetSerials2 above
137
        my $serinfo = GetSerialInformation($serialid); #TODO duplicates work done by GetSerials2 above
137
        for my $d ( qw( publisheddate planneddate )){
138
        for my $d ( qw( publisheddate planneddate published_end_date )){
138
            if ( $serinfo->{$d} =~m/^00/ ) {
139
            if ( $serinfo->{$d} =~m/^00/ ) {
139
                $serinfo->{$d} = q{};
140
                $serinfo->{$d} = q{};
140
            }
141
            }
Lines 205-211 if ( $op and $op eq 'serialchangestatus' ) { Link Here
205
206
206
    my $newserial;
207
    my $newserial;
207
    for ( my $i = 0 ; $i <= $#serialids ; $i++ ) {
208
    for ( my $i = 0 ; $i <= $#serialids ; $i++ ) {
208
        my ($plan_date, $pub_date);
209
        my ($plan_date, $pub_date, $pub_end_date);
209
210
210
        if (defined $planneddates[$i] && $planneddates[$i] ne 'XXX') {
211
        if (defined $planneddates[$i] && $planneddates[$i] ne 'XXX') {
211
            $plan_date = format_date_in_iso( $planneddates[$i] );
212
            $plan_date = format_date_in_iso( $planneddates[$i] );
Lines 214-219 if ( $op and $op eq 'serialchangestatus' ) { Link Here
214
            $pub_date = format_date_in_iso( $publisheddates[$i] );
215
            $pub_date = format_date_in_iso( $publisheddates[$i] );
215
        }
216
        }
216
217
218
        if (defined $published_end_dates[$i] && $published_end_dates[$i] ne 'XXX') {
219
            $pub_end_date = format_date_in_iso( $published_end_dates[$i] );
220
        }
221
217
        if ( $serialids[$i] && $serialids[$i] eq 'NEW' ) {
222
        if ( $serialids[$i] && $serialids[$i] eq 'NEW' ) {
218
            if ( $serialseqs[$i] ) {
223
            if ( $serialseqs[$i] ) {
219
224
Lines 226-231 if ( $op and $op eq 'serialchangestatus' ) { Link Here
226
                    $status[$i],
231
                    $status[$i],
227
                    $plan_date,
232
                    $plan_date,
228
                    $pub_date,
233
                    $pub_date,
234
                    $pub_end_date,
229
                    $notes[$i]
235
                    $notes[$i]
230
                );
236
                );
231
            }
237
            }
Lines 236-241 if ( $op and $op eq 'serialchangestatus' ) { Link Here
236
                $serialseqs[$i],
242
                $serialseqs[$i],
237
                $plan_date,
243
                $plan_date,
238
                $pub_date,
244
                $pub_date,
245
                $pub_end_date,
239
                $status[$i],
246
                $status[$i],
240
                $notes[$i]
247
                $notes[$i]
241
            );
248
            );
242
- 

Return to bug 8956