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

(-)a/C4/Serials.pm (-9 / +8 lines)
Lines 1108-1114 Note : if we change from "waited" to something else,then we will have to create Link Here
1108
=cut
1108
=cut
1109
1109
1110
sub ModSerialStatus {
1110
sub ModSerialStatus {
1111
    my ( $serialid, $serialseq, $planneddate, $publisheddate, $status, $notes ) = @_;
1111
    my ( $serialid, $serialseq, $planneddate, $publisheddate, $published_end_date, $status, $notes ) = @_;
1112
1112
1113
    #It is a usual serial
1113
    #It is a usual serial
1114
    # 1st, get previous status :
1114
    # 1st, get previous status :
Lines 1125-1133 sub ModSerialStatus { Link Here
1125
    }
1125
    }
1126
    else {
1126
    else {
1127
        my $query =
1127
        my $query =
1128
'UPDATE serial SET serialseq=?,publisheddate=?,planneddate=?,status=?,notes=? WHERE  serialid = ?';
1128
'UPDATE serial SET serialseq=?,publisheddate=?,published_end_date=?,planneddate=?,status=?,notes=? WHERE  serialid = ?';
1129
        $sth = $dbh->prepare($query);
1129
        $sth = $dbh->prepare($query);
1130
        $sth->execute( $serialseq, $publisheddate, $planneddate, $status, $notes, $serialid );
1130
        $sth->execute( $serialseq, $publisheddate, $published_end_date, $planneddate, $status, $notes, $serialid );
1131
        $query = "SELECT * FROM   subscription WHERE  subscriptionid = ?";
1131
        $query = "SELECT * FROM   subscription WHERE  subscriptionid = ?";
1132
        $sth   = $dbh->prepare($query);
1132
        $sth   = $dbh->prepare($query);
1133
        $sth->execute($subscriptionid);
1133
        $sth->execute($subscriptionid);
Lines 1173-1179 sub ModSerialStatus { Link Here
1173
1173
1174
        # next date (calculated from actual date & frequency parameters)
1174
        # next date (calculated from actual date & frequency parameters)
1175
        my $nextpublisheddate = GetNextDate( $publisheddate, $val );
1175
        my $nextpublisheddate = GetNextDate( $publisheddate, $val );
1176
        NewIssue( $newserialseq, $subscriptionid, $val->{'biblionumber'}, 1, $nextpublisheddate, $nextpublisheddate, undef, $newlastvalue1, $newlastvalue2, $newlastvalue3 );
1176
        NewIssue( $newserialseq, $subscriptionid, $val->{'biblionumber'}, 1, $nextpublisheddate, $nextpublisheddate, $published_end_date, undef, $newlastvalue1, $newlastvalue2, $newlastvalue3 );
1177
        $query = "UPDATE subscription SET lastvalue1=?, lastvalue2=?, lastvalue3=?, innerloop1=?, innerloop2=?, innerloop3=?
1177
        $query = "UPDATE subscription SET lastvalue1=?, lastvalue2=?, lastvalue3=?, innerloop1=?, innerloop2=?, innerloop3=?
1178
                    WHERE  subscriptionid = ?";
1178
                    WHERE  subscriptionid = ?";
1179
        $sth = $dbh->prepare($query);
1179
        $sth = $dbh->prepare($query);
Lines 1483-1500 returns the serial id Link Here
1483
=cut
1483
=cut
1484
1484
1485
sub NewIssue {
1485
sub NewIssue {
1486
    my ( $serialseq, $subscriptionid, $biblionumber, $status, $planneddate, $publisheddate, $notes, $x, $y, $z ) = @_;
1486
    my ( $serialseq, $subscriptionid, $biblionumber, $status, $planneddate, $publisheddate, $published_end_date, $notes, $x, $y, $z ) = @_;
1487
    warn "NewIssue( $serialseq, $subscriptionid, $biblionumber, $status, $planneddate, $publisheddate, $notes, $x, $y, $z )";
1488
    ### FIXME biblionumber CAN be provided by subscriptionid. So Do we STILL NEED IT ?
1487
    ### FIXME biblionumber CAN be provided by subscriptionid. So Do we STILL NEED IT ?
1489
1488
1490
    my $dbh   = C4::Context->dbh;
1489
    my $dbh   = C4::Context->dbh;
1491
    my $query = qq|
1490
    my $query = qq|
1492
        INSERT INTO serial
1491
        INSERT INTO serial
1493
            (serialseq,subscriptionid,biblionumber,status,publisheddate,planneddate,notes,serialseq_x,serialseq_y,serialseq_z)
1492
            (serialseq,subscriptionid,biblionumber,status,publisheddate,published_end_date,planneddate,notes,serialseq_x,serialseq_y,serialseq_z)
1494
        VALUES (?,?,?,?,?,?,?,?,?,?)
1493
        VALUES (?,?,?,?,?,?,?,?,?,?,?)
1495
    |;
1494
    |;
1496
    my $sth = $dbh->prepare($query);
1495
    my $sth = $dbh->prepare($query);
1497
    $sth->execute( $serialseq, $subscriptionid, $biblionumber, $status, $publisheddate, $planneddate, $notes, $x, $y, $z );
1496
    $sth->execute( $serialseq, $subscriptionid, $biblionumber, $status, $publisheddate, $published_end_date, $planneddate, $notes, $x, $y, $z );
1498
    my $serialid = $dbh->{'mysql_insertid'};
1497
    my $serialid = $dbh->{'mysql_insertid'};
1499
    $query = qq|
1498
    $query = qq|
1500
        SELECT missinglist,recievedlist
1499
        SELECT missinglist,recievedlist
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tt (+7 lines)
Lines 150-155 $(document).ready(function() { Link Here
150
		<th>Expected on</th>
150
		<th>Expected on</th>
151
		<th>Status</th>
151
		<th>Status</th>
152
		<th>Notes</th>
152
		<th>Notes</th>
153
                <th>Bound volumes<br/>Ending published on</th>
153
	</tr>
154
	</tr>
154
[% FOREACH serialslis IN serialslist %]
155
[% FOREACH serialslis IN serialslist %]
155
    [% UNLESS ( loop.odd ) %]
156
    [% UNLESS ( loop.odd ) %]
Lines 225-230 $(document).ready(function() { Link Here
225
        <td>
226
        <td>
226
            <input type="text" name="notes" value="[% serialslis.sernotes %]" size="20" maxlength="255" />
227
            <input type="text" name="notes" value="[% serialslis.sernotes %]" size="20" maxlength="255" />
227
        </td>
228
        </td>
229
        <td>
230
            <input type="text" name="published_end_date" value="[% serialslis.published_end_date %]" size="10" maxlength="15" class="datepicker" readonly="readonly"/>
231
        </td>
228
    </tr>
232
    </tr>
229
  [% UNLESS ( serialslis.subscriptionexpired ) %]
233
  [% UNLESS ( serialslis.subscriptionexpired ) %]
230
  [% IF ( serialslis.serialsadditems ) %]
234
  [% IF ( serialslis.serialsadditems ) %]
Lines 335-340 $(document).ready(function() { Link Here
335
        <td>
339
        <td>
336
            <input type="text" name="notes" value="" size="20" maxlength="255" />
340
            <input type="text" name="notes" value="" size="20" maxlength="255" />
337
        </td>
341
        </td>
342
        <td>
343
            <input type="text" name="published_end_date" value="[% newserialloo.published_end_date %]" size="10" maxlength="15"  class="datepicker" readonly="readonly"/>
344
        </td>
338
    </tr>
345
    </tr>
339
  [% IF ( newserialloo.serialsadditems ) %]
346
  [% IF ( newserialloo.serialsadditems ) %]
340
          <tr>
347
          <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 206-212 if ( $op and $op eq 'serialchangestatus' ) { Link Here
206
207
207
    my $newserial;
208
    my $newserial;
208
    for ( my $i = 0 ; $i <= $#serialids ; $i++ ) {
209
    for ( my $i = 0 ; $i <= $#serialids ; $i++ ) {
209
        my ($plan_date, $pub_date);
210
        my ($plan_date, $pub_date, $pub_end_date);
210
211
211
        if (defined $planneddates[$i] && $planneddates[$i] ne 'XXX') {
212
        if (defined $planneddates[$i] && $planneddates[$i] ne 'XXX') {
212
            $plan_date = format_date_in_iso( $planneddates[$i] );
213
            $plan_date = format_date_in_iso( $planneddates[$i] );
Lines 215-220 if ( $op and $op eq 'serialchangestatus' ) { Link Here
215
            $pub_date = format_date_in_iso( $publisheddates[$i] );
216
            $pub_date = format_date_in_iso( $publisheddates[$i] );
216
        }
217
        }
217
218
219
        if (defined $published_end_dates[$i] && $published_end_dates[$i] ne 'XXX') {
220
            $pub_end_date = format_date_in_iso( $published_end_dates[$i] );
221
        }
222
218
        if ( $serialids[$i] && $serialids[$i] eq 'NEW' ) {
223
        if ( $serialids[$i] && $serialids[$i] eq 'NEW' ) {
219
            if ( $serialseqs[$i] ) {
224
            if ( $serialseqs[$i] ) {
220
225
Lines 227-232 if ( $op and $op eq 'serialchangestatus' ) { Link Here
227
                    $status[$i],
232
                    $status[$i],
228
                    $plan_date,
233
                    $plan_date,
229
                    $pub_date,
234
                    $pub_date,
235
                    $pub_end_date,
230
                    $notes[$i]
236
                    $notes[$i]
231
                );
237
                );
232
            }
238
            }
Lines 237-242 if ( $op and $op eq 'serialchangestatus' ) { Link Here
237
                $serialseqs[$i],
243
                $serialseqs[$i],
238
                $plan_date,
244
                $plan_date,
239
                $pub_date,
245
                $pub_date,
246
                $pub_end_date,
240
                $status[$i],
247
                $status[$i],
241
                $notes[$i]
248
                $notes[$i]
242
            );
249
            );
243
- 

Return to bug 8956