From b87ae720aedb6820f344d8c744f667a6123a82c6 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 20 Aug 2013 11:14:09 +0200 Subject: [PATCH 1/1] Bug 10851: Serials - Add missing statuses 4 new missing statuses is added by this patch: never received, sold out, damaged or 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. --- C4/Serials.pm | 15 +++++--- .../prog/en/modules/catalogue/detail.tt | 4 ++ .../prog/en/modules/serials/claims.tt | 8 ++++ .../prog/en/modules/serials/serial-issues-full.tt | 4 ++ .../prog/en/modules/serials/serials-collection.tt | 4 ++ .../prog/en/modules/serials/serials-edit.tt | 40 ++++++++++++++++++++ .../prog/en/modules/serials/serials-recieve.tt | 20 ++++++++++ .../prog/en/modules/serials/subscription-detail.tt | 4 ++ koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt | 27 +++++++------ .../prog/en/modules/opac-full-serial-issues.tt | 4 ++ 10 files changed, 110 insertions(+), 20 deletions(-) diff --git a/C4/Serials.pm b/C4/Serials.pm index a2498c8..e012c1e 100644 --- a/C4/Serials.pm +++ b/C4/Serials.pm @@ -97,7 +97,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|; @@ -421,7 +421,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'}; @@ -848,7 +850,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); @@ -1147,7 +1149,8 @@ sub ModSerialStatus { $missinglist=~ s/(^|;)\s*$serialseq(?=;|$)//g; } $missinglist .= "; $serialseq" - if $status==4 && $missinglist!~/(^|;)\s*$serialseq(?=;|$)/; + if ( $status==4 or $status == 41 or $status == 42 or $status == 43 or $status == 44 ) + && $missinglist!~/(^|;)\s*$serialseq(?=;|$)/; $missinglist .= "; not issued $serialseq" if $status==5 && $missinglist!~/(^|;)\s*$serialseq(?=;|$)/; @@ -1872,7 +1875,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" @@ -1889,7 +1892,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 d5a006b..998b193 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -686,6 +686,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 f4de94c..47de49a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/claims.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/claims.tt @@ -209,6 +209,10 @@ + + + + @@ -285,6 +289,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 dbdfda9..fb020a0 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 4141200..ec4c753 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 @@ -306,6 +306,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 8f9ea5f..fdd1daf 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 %] @@ -306,6 +326,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 04db346..f93c8c7 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 959f14f..f806e90 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 @@ -350,6 +350,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 e5d9c3c..65e3577 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt @@ -1209,20 +1209,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 e0fb803..ab48058 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 %] -- 1.7.10.4