From 776825651a204756ddbec2a8ef1b8819038408f9 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 20 Aug 2013 11:14:09 +0200 Subject: [PATCH] Bug 10851: add additional "missing" statuses for serials issues 4 new statuses to represent variations on "missing" is added by this patch: "never received", "sold out", "damaged", and "lost. These status have the same behavior than the simple Missing status. Test plan: - Find a serial to claim. - Modify the status of this serial with one of these new statuses. - Try to find it with the "serials to claim" search. - Verify that the status is displayed on the serial module pages and on the OPAC. Signed-off-by: Nicolas Bravais Signed-off-by: Katrin Fischer Signed-off-by: Galen Charlton --- C4/Serials.pm | 18 +++++---- .../prog/en/modules/catalogue/detail.tt | 4 ++ .../prog/en/modules/serials/claims.tt | 8 ++++ .../en/modules/serials/serial-issues-full.tt | 4 ++ .../en/modules/serials/serials-collection.tt | 4 ++ .../prog/en/modules/serials/serials-edit.tt | 40 +++++++++++++++++++ .../en/modules/serials/serials-recieve.tt | 20 ++++++++++ .../en/modules/serials/subscription-detail.tt | 4 ++ .../opac-tmpl/prog/en/modules/opac-detail.tt | 27 ++++++------- .../en/modules/opac-full-serial-issues.tt | 4 ++ 10 files changed, 112 insertions(+), 21 deletions(-) diff --git a/C4/Serials.pm b/C4/Serials.pm index 81fa86c604..e745458b14 100644 --- a/C4/Serials.pm +++ b/C4/Serials.pm @@ -102,7 +102,7 @@ sub GetSuppliersWithLateIssues { WHERE id > 0 AND ( (planneddate < now() AND serial.status=1) - OR serial.STATUS = 3 OR serial.STATUS = 4 + OR serial.STATUS IN (3, 4, 41, 42, 43, 44) ) AND subscription.closed = 0 ORDER BY name|; @@ -425,7 +425,9 @@ sub PrepareSerialsData { } } $subs->{ "status" . $subs->{'status'} } = 1; - $subs->{"checked"} = $subs->{'status'} =~ /1|3|4|7/; + if ( grep { $_ == $subs->{status} } ( 1, 3, 4, 41, 42, 43, 44, 7 ) ) { + $subs->{"checked"} = 1; + } if ( $subs->{'year'} && $subs->{'year'} ne "" ) { $year = $subs->{'year'}; @@ -879,7 +881,7 @@ sub GetLatestSerials { my $strsth = "SELECT serialid,serialseq, status, planneddate, publisheddate, notes FROM serial WHERE subscriptionid = ? - AND (status =2 or status=4) + AND status IN (2, 4, 41, 42, 43, 44) ORDER BY publisheddate DESC LIMIT 0,$limit "; my $sth = $dbh->prepare($strsth); @@ -1248,8 +1250,10 @@ sub ModSerialStatus { if ( $status == 2 || ($oldstatus == 2 && $status != 2) ) { _update_receivedlist($subscriptionid); } - if($status == 4 || $status == 5 - || ($oldstatus == 4 && $status != 4) + if( grep { $_ == $status } ( 4, 41, 42, 43, 44, 5 ) + || ( + grep { $_ == $oldstatus } ( 4, 41, 42, 43, 44 ) + && ! grep { $_ == $status } ( 4, 41, 42, 43, 44 ) ) || ($oldstatus == 5 && $status != 5)) { _update_missinglist($subscriptionid); } @@ -2030,7 +2034,7 @@ sub GetLateOrMissingIssues { LEFT JOIN biblio ON subscription.biblionumber=biblio.biblionumber LEFT JOIN aqbooksellers ON subscription.aqbooksellerid = aqbooksellers.id WHERE subscription.subscriptionid = serial.subscriptionid - AND (serial.STATUS = 4 OR ((planneddate < now() AND serial.STATUS =1) OR serial.STATUS = 3 OR serial.STATUS = 7)) + AND (serial.STATUS IN (4, 41, 42, 43, 44) OR ((planneddate < now() AND serial.STATUS =1) OR serial.STATUS = 3 OR serial.STATUS = 7)) AND subscription.aqbooksellerid=$supplierid $byserial ORDER BY $order" @@ -2047,7 +2051,7 @@ sub GetLateOrMissingIssues { LEFT JOIN biblio ON subscription.biblionumber=biblio.biblionumber LEFT JOIN aqbooksellers ON subscription.aqbooksellerid = aqbooksellers.id WHERE subscription.subscriptionid = serial.subscriptionid - AND (serial.STATUS = 4 OR ((planneddate < now() AND serial.STATUS =1) OR serial.STATUS = 3 OR serial.STATUS = 7)) + AND (serial.STATUS IN (4, 41, 42, 43, 44) OR ((planneddate < now() AND serial.STATUS =1) OR serial.STATUS = 3 OR serial.STATUS = 7)) $byserial ORDER BY $order" ); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt index dd8487e97f..539c4f121d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -809,6 +809,10 @@ function verify_images() { [% IF ( latestserial.status2 ) %]Arrived[% END %] [% IF ( latestserial.status3 ) %]Late[% END %] [% IF ( latestserial.status4 ) %]Missing[% END %] + [% IF ( serialslis.status41 ) %]Missing (never received)[% END %] + [% IF ( serialslis.status42 ) %]Missing (sold out)[% END %] + [% IF ( serialslis.status43 ) %]Missing (damaged)[% END %] + [% IF ( serialslis.status44 ) %]Missing (lost)[% END %] [% IF ( latestserial.status5 ) %]Not issued[% END %] [% IF ( latestserial.status6 ) %]Delete[% END %] [% IF ( latestserial.status7 ) %]Claimed[% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/claims.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/claims.tt index 4959982907..288620ba33 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/claims.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/claims.tt @@ -216,6 +216,10 @@ + + + + @@ -289,6 +293,10 @@ [% IF ( missingissue.status1 ) %]Expected[% END %] [% IF ( missingissue.status3 ) %]Late[% END %] [% IF ( missingissue.status4 ) %]Missing[% END %] + [% IF ( missingissue.status41 ) %]Missing (never received)[% END %] + [% IF ( missingissue.status42 ) %]Missing (sold out)[% END %] + [% IF ( missingissue.status43 ) %]Missing (damaged)[% END %] + [% IF ( missingissue.status44 ) %]Missing (lost)[% END %] [% IF ( missingissue.status7 ) %]Claimed[% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serial-issues-full.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serial-issues-full.tt index dbdfda9d06..fb020a0e31 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serial-issues-full.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serial-issues-full.tt @@ -72,6 +72,10 @@ function active(numlayer) [% IF ( serial.status2 ) %]Arrived[% END %] [% IF ( serial.status3 ) %]Late[% END %] [% IF ( serial.status4 ) %]Missing[% END %] + [% IF ( serial.status41 ) %]Missing (never received)[% END %] + [% IF ( serial.status42 ) %]Missing (sold out)[% END %] + [% IF ( serial.status43 ) %]Missing (damaged)[% END %] + [% IF ( serial.status44 ) %]Missing (lost)[% END %] [% IF ( serial.status5 ) %]Not issued[% END %] [% IF ( serial.status6 ) %]Delete[% END %] [% IF ( serial.status7 ) %]Claimed[% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tt index 060ecaf291..ed1dc3903e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tt @@ -257,6 +257,10 @@ $(document).ready(function() { [% IF ( serial.status2 ) %]Arrived[% END %] [% IF ( serial.status3 ) %]Late[% END %] [% IF ( serial.status4 ) %]Missing[% END %] + [% IF ( serial.status41 ) %]Missing (never received)[% END %] + [% IF ( serial.status42 ) %]Missing (sold out)[% END %] + [% IF ( serial.status43 ) %]Missing (damaged)[% END %] + [% IF ( serial.status44 ) %]Missing (lost)[% END %] [% IF ( serial.status5 ) %]Not issued[% END %] [% IF ( serial.status6 ) %]Delete[% END %] [% IF ( serial.status7 ) %]Claimed[% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tt index 1599bfd2c6..bddffca7c8 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tt @@ -196,6 +196,26 @@ $(document).ready(function() { [% ELSE %] [% END %] + [% IF ( serialslis.status41 ) %] + + [% ELSE %] + + [% END %] + [% IF ( serialslis.status42 ) %] + + [% ELSE %] + + [% END %] + [% IF ( serialslis.status43 ) %] + + [% ELSE %] + + [% END %] + [% IF ( serialslis.status44 ) %] + + [% ELSE %] + + [% END %] [% IF ( serialslis.status7 ) %] [% ELSE %] @@ -309,6 +329,26 @@ $(document).ready(function() { [% ELSE %] [% END %] + [% IF ( newserialloo.status41 ) %] + + [% ELSE %] + + [% END %] + [% IF ( newserialloo.status42 ) %] + + [% ELSE %] + + [% END %] + [% IF ( newserialloo.status43 ) %] + + [% ELSE %] + + [% END %] + [% IF ( newserialloo.status44 ) %] + + [% ELSE %] + + [% END %] [% IF ( newserialloo.status7 ) %] [% ELSE %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-recieve.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-recieve.tt index 04db346d96..f93c8c76c3 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-recieve.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-recieve.tt @@ -127,6 +127,26 @@ function barcode_check(){ [% ELSE %] [% END %] + [% IF ( serialslis.status41 ) %] + + [% ELSE %] + + [% END %] + [% IF ( serialslis.status42 ) %] + + [% ELSE %] + + [% END %] + [% IF ( serialslis.status43 ) %] + + [% ELSE %] + + [% END %] + [% IF ( serialslis.status44 ) %] + + [% ELSE %] + + [% END %] [% IF ( serialslis.status5 ) %] [% ELSE %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt index 59b12a7f49..f02194e615 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt @@ -269,6 +269,10 @@ $(document).ready(function() { [% IF ( serialslis.status2 ) %]Arrived[% END %] [% IF ( serialslis.status3 ) %]Late[% END %] [% IF ( serialslis.status4 ) %]Missing[% END %] + [% IF ( serialslis.status41 ) %]Missing (never received)[% END %] + [% IF ( serialslis.status42 ) %]Missing (sold out)[% END %] + [% IF ( serialslis.status43 ) %]Missing (damaged)[% END %] + [% IF ( serialslis.status44 ) %]Missing (lost)[% END %] [% IF ( serialslis.status5 ) %]Not issued[% END %] [% IF ( serialslis.status6 ) %]Delete[% END %] [% IF ( serialslis.status7 ) %] diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt index 05c4010474..a4003cb2df 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt @@ -1213,20 +1213,19 @@ YAHOO.util.Event.onContentReady("furtherm", function () { [% latestserial.planneddate %] - [% IF ( latestserial.status1 ) %]Awaited - [% ELSE %] - [% IF ( latestserial.status2 ) %]Arrived - [% ELSE %] - [% IF ( latestserial.status3 ) %]Late - [% ELSE %] - [% IF ( latestserial.status4 ) %]Missing - [% ELSE %] - [% IF ( latestserial.status5 ) %]Not issued - [% END %] - [% END %] - [% END %] - [% END %] - [% END %] + + [% IF ( latestserial.status1 ) %]Expected[% END %] + [% IF ( latestserial.status2 ) %]Arrived[% END %] + [% IF ( latestserial.status3 ) %]Late[% END %] + [% IF ( latestserial.status4 ) %]Missing[% END %] + [% IF ( latestserial.status41 ) %]Missing (never received)[% END %] + [% IF ( latestserial.status42 ) %]Missing (sold out)[% END %] + [% IF ( latestserial.status43 ) %]Missing (damaged)[% END %] + [% IF ( latestserial.status44 ) %]Missing (lost)[% END %] + [% IF ( latestserial.status5 ) %]Not issued[% END %] + [% IF ( latestserial.status6 ) %]Delete[% END %] + [% IF ( latestserial.status7 ) %]Claimed[% END %] + [% IF ( latestserial.status8 ) %]Stopped[% END %] [% latestserial.notes %] diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-full-serial-issues.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-full-serial-issues.tt index e0fb803d39..ab480582d6 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-full-serial-issues.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-full-serial-issues.tt @@ -224,6 +224,10 @@ function showlayer(numlayer){ [% IF ( serial.status2 ) %]Arrived[% END %] [% IF ( serial.status3 ) %]Late[% END %] [% IF ( serial.status4 ) %]Missing[% END %] + [% IF ( serial.status41 ) %]Missing (never received)[% END %] + [% IF ( serial.status42 ) %]Missing (sold out)[% END %] + [% IF ( serial.status43 ) %]Missing (damaged)[% END %] + [% IF ( serial.status44 ) %]Missing (lost)[% END %] [% IF ( serial.status5 ) %]Not available[% END %] [% IF ( serial.status6 ) %]Delete[% END %] [% IF ( serial.status7 ) %]Claimed[% END %] -- 2.39.5