From 5555b9b780e79154707cac8c9c9116287ee3b3c4 Mon Sep 17 00:00:00 2001 From: Henri-Damien LAURENT Date: Fri, 23 Oct 2009 12:12:36 +0200 Subject: [PATCH] Adding toggle of subscriptionhistory information --- .../en/modules/serials/subscription-add.tmpl | 87 ++++++++++--------- serials/subscription-add.pl | 15 ++-- 2 files changed, 53 insertions(+), 49 deletions(-) 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 f977ff88b6..f01041d4f0 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 @@ -917,6 +917,13 @@ function Check(f) { $(document).ready(function() { init_pattern(); + + $("#subscription_form_history").show(); + + $("#manuallist").click( function(){ + $("#subscription_form_history").toggle(); + } + ); // $(".widelabel").attr("width", "300px"); // labels stay skinny in IE7 anyway. set_num_pattern_from_template_vars(); @@ -944,8 +951,8 @@ $(document).ready(function() {
-

Modify subscription for Add a new subscription

+
@@ -1060,7 +1067,42 @@ $(document).ready(function() {
-
+ + +
Serials planning @@ -1382,47 +1424,6 @@ $(document).ready(function() {
- -
-

Subscription history

-
- - " /> - -

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

-
-
    -
  1. - - " />
    (start date of the 1st subscription)
    -
  2. -
  3. - - " />
    (if empty, subscription is still active)
    -
  4. -
  5. - - -
  6. -
  7. - - -
  8. -
  9. - - -
  10. -
  11. - - -
  12. -
-
-
-
-
- -
diff --git a/serials/subscription-add.pl b/serials/subscription-add.pl index c8f049b3b0..6ee32f5d23 100755 --- a/serials/subscription-add.pl +++ b/serials/subscription-add.pl @@ -107,7 +107,7 @@ if ($op eq 'mod' || $op eq 'dup' || $op eq 'modsubscription') { $op => 1, "subtype_$sub_on" => 1, sublength =>$sublength, - history => ($op eq 'mod' && $subs->{manualhistory} == 1 ), + history => ($op eq 'mod'), "periodicity".$subs->{'periodicity'} => 1, "numberpattern".$subs->{'numberpattern'} => 1, firstacquiyear => substr($firstissuedate,0,4), @@ -199,6 +199,12 @@ if ($op eq 'addsubscription') { my $startdate = format_date_in_iso($query->param('startdate')); my $enddate = format_date_in_iso($query->param('enddate')); my $firstacquidate = format_date_in_iso($query->param('firstacquidate')); + my $histenddate = format_date_in_iso($query->param('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'); my $subscriptionid = NewSubscription($auser,$branchcode,$aqbooksellerid,$cost,$aqbudgetid,$biblionumber, $startdate,$periodicity,$dow,$numberlength,$weeklength,$monthlength, $add1,$every1,$whenmorethan1,$setto1,$lastvalue1,$innerloop1, @@ -208,6 +214,7 @@ if ($op eq 'addsubscription') { $numberpattern, $callnumber, $hemisphere,($manualhistory?$manualhistory:0),$internalnotes, $serialsadditems,$staffdisplaycount,$opacdisplaycount,$graceperiod,$location,$enddate ); + ModSubscriptionHistory ($subscriptionid,$histstartdate,$histenddate,$recievedlist,$missinglist,$opacnote,$librariannote); print $query->redirect("/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=$subscriptionid"); } elsif ($op eq 'modsubscription') { @@ -273,7 +280,6 @@ if ($op eq 'addsubscription') { my $missinglist = $query->param('missinglist'); my $opacnote = $query->param('opacnote'); my $librariannote = $query->param('librariannote'); - my $history_only = $query->param('history_only'); my $staffdisplaycount = $query->param('staffdisplaycount'); my $opacdisplaycount = $query->param('opacdisplaycount'); my $graceperiod = $query->param('graceperiod') || 0; @@ -285,9 +291,6 @@ if ($op eq 'addsubscription') { $firstissuedate = $nextacquidate if($nextexpected->{isfirstissue}); } - if ($history_only) { - ModSubscriptionHistory ($subscriptionid,$histstartdate,$histenddate,$recievedlist,$missinglist,$opacnote,$librariannote); - } else { &ModSubscription( $auser, $branchcode, $aqbooksellerid, $cost, $aqbudgetid, $startdate, $periodicity, $firstissuedate, @@ -301,7 +304,7 @@ if ($op eq 'addsubscription') { $notes, $letter, $hemisphere, $manualhistory,$internalnotes, $serialsadditems, $staffdisplaycount,$opacdisplaycount,$graceperiod,$location,$enddate,$subscriptionid ); - } + ModSubscriptionHistory ($subscriptionid,$histstartdate,$histenddate,$recievedlist,$missinglist,$opacnote,$librariannote); print $query->redirect("/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=$subscriptionid"); } else { while (@subscription_types) { -- 2.39.5