From fa4cead90956d3a8ebf0da470176663fbc5dc1d7 Mon Sep 17 00:00:00 2001 From: Paul POULAIN Date: Fri, 4 Apr 2008 11:15:59 +0200 Subject: [PATCH] reintroducing history manual modification feature The history start date and enddate is also useful to modify manually for the same reason : your serial collection may be older than your Koha serial management. This commit reintroduce the feature. Signed-off-by: Joshua Ferraro --- C4/Serials.pm | 1 + .../en/modules/serials/subscription-add.tmpl | 51 ++++++++++++------- .../modules/serials/subscription-detail.tmpl | 32 +++++++----- serials/subscription-add.pl | 42 +++++++++------ serials/subscription-detail.pl | 2 + 5 files changed, 82 insertions(+), 46 deletions(-) diff --git a/C4/Serials.pm b/C4/Serials.pm index c5d14cfe9f..913292549a 100644 --- a/C4/Serials.pm +++ b/C4/Serials.pm @@ -352,6 +352,7 @@ sub GetSubscription { my $query = qq( SELECT subscription.*, subscriptionhistory.*, + subscriptionhistory.enddate as histenddate, aqbudget.bookfundid, aqbooksellers.name AS aqbooksellername, biblio.title AS bibliotitle, diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tmpl index 4626a63b72..319b101952 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tmpl @@ -1178,24 +1178,39 @@ window.onload = irregular_order();

Subscription history

- - - - - - - - - - - - - - - - - -
Subscription start date" /> (start date of the 1st subscription)
Subscription end date" />(if empty, subscription is still active)
Received issues
Missing issues
+
+ + " /> + +

Hint : you can update the serial history manually. This can be useful for an old subscription or to clean the existing history. Modify those fields with care, as future serial recieve will continue to update them automatically.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
Subscription start date" /> (start date of the 1st subscription)
Subscription end date" />(if empty, subscription is still active)
Received issues
Missing issues
Note for OPAC
Note for staff
+ +
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tmpl index d71c4306cd..0950afdd97 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tmpl @@ -350,18 +350,26 @@ function popup(subscriptionid) {

Subscription summary

- - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + +
diff --git a/serials/subscription-add.pl b/serials/subscription-add.pl index 6142a4a459..a4b48d1104 100755 --- a/serials/subscription-add.pl +++ b/serials/subscription-add.pl @@ -121,8 +121,12 @@ if ($op eq 'mod'||$op eq 'dup') { warn "Attempt to modify subscription $subscriptionid by ".C4::Context->userenv->{'id'}." not allowed"; print $query->redirect("/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=$subscriptionid"); } - for (qw(startdate firstacquidate histstartdate enddate)) { - $subs->{$_} = format_date($subs->{$_}) if $subs->{$_}; + for (qw(startdate firstacquidate histstartdate enddate histenddate)) { + if ($subs->{$_} eq '0000-00-00') { + $subs->{$_} = '' + } else { + $subs->{$_} = format_date($subs->{$_}); + } } $subs->{'letter'}='' unless($subs->{'letter'}); $irregularity = $subs->{'irregularity'}; @@ -285,25 +289,31 @@ if ($op eq 'addsubscription') { my $letter = $query->param('letter'); my $manualhistory = $query->param('manualhist'); my $enddate = $query->param('enddate'); + # subscription history + my $histenddate = format_date_in_iso($query->param('histenddate')); + warn "HIST END : $histenddate"; my $histstartdate = format_date_in_iso($query->param('histstartdate')); my $recievedlist = $query->param('recievedlist'); my $missinglist = $query->param('missinglist'); my $opacnote = $query->param('opacnote'); my $librariannote = $query->param('librariannote'); - &ModSubscription( - $auser, $branchcode, $aqbooksellerid, $cost, - $aqbudgetid, $startdate, $periodicity, $firstacquidate, - $dow, $irregularity, $numberpattern, $numberlength, - $weeklength, $monthlength, $add1, $every1, - $whenmorethan1, $setto1, $lastvalue1, $innerloop1, - $add2, $every2, $whenmorethan2, $setto2, - $lastvalue2, $innerloop2, $add3, $every3, - $whenmorethan3, $setto3, $lastvalue3, $innerloop3, - $numberingmethod, $status, $biblionumber, $callnumber, - $notes, $letter, $hemisphere, $manualhistory,$internalnotes, - $subscriptionid); - - ModSubscriptionHistory ($subscriptionid,$histstartdate,$enddate,$recievedlist,$missinglist,$opacnote,$librariannote); + my $history_only = $query->param('history_only'); + if ($history_only) { + ModSubscriptionHistory ($subscriptionid,$histstartdate,$histenddate,$recievedlist,$missinglist,$opacnote,$librariannote); + } else { + &ModSubscription( + $auser, $branchcode, $aqbooksellerid, $cost, + $aqbudgetid, $startdate, $periodicity, $firstacquidate, + $dow, $irregularity, $numberpattern, $numberlength, + $weeklength, $monthlength, $add1, $every1, + $whenmorethan1, $setto1, $lastvalue1, $innerloop1, + $add2, $every2, $whenmorethan2, $setto2, + $lastvalue2, $innerloop2, $add3, $every3, + $whenmorethan3, $setto3, $lastvalue3, $innerloop3, + $numberingmethod, $status, $biblionumber, $callnumber, + $notes, $letter, $hemisphere, $manualhistory,$internalnotes, + $subscriptionid); + } print $query->redirect("/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=$subscriptionid"); } else { diff --git a/serials/subscription-detail.pl b/serials/subscription-detail.pl index 83e720f87b..94242ec9e2 100755 --- a/serials/subscription-detail.pl +++ b/serials/subscription-detail.pl @@ -34,6 +34,7 @@ my $sth; my ($template, $loggedinuser, $cookie, $hemisphere); my $subscriptionid = $query->param('subscriptionid'); my $subs = &GetSubscription($subscriptionid); + $subs->{enddate} = GetExpirationDate($subscriptionid); if ($op eq 'del') { @@ -87,6 +88,7 @@ $subs->{startdate} = format_date($subs->{startdate}); $subs->{firstacquidate} = format_date($subs->{firstacquidate}); $subs->{histstartdate} = format_date($subs->{histstartdate}); $subs->{enddate} = format_date($subs->{enddate}); +$subs->{histenddate} = format_date($subs->{histenddate}); $subs->{abouttoexpire} = abouttoexpire($subs->{subscriptionid}); # Done in Serials.pm # $subs->{'donotedit'}=(C4::Context->preference('IndependantBranches') && -- 2.39.5