koha-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Koha-cvs] koha/serials serials-home.pl serials-recieve.pl... [rel_3_0]


From: paul poulain
Subject: [Koha-cvs] koha/serials serials-home.pl serials-recieve.pl... [rel_3_0]
Date: Mon, 30 Oct 2006 10:22:46 +0000

CVSROOT:        /sources/koha
Module name:    koha
Branch:         rel_3_0
Changes by:     paul poulain <tipaul>   06/10/30 10:22:46

Modified files:
        serials        : serials-home.pl serials-recieve.pl 
                         subscription-add.pl subscription-detail.pl 
Removed files:
        serials        : alt_subscription-add.pl 
                         alt_subscription-detail.pl 

Log message:
        - fixing many bugs in serials
        - removing alt_ serials features, as they are now "official" templates
        - reintroducing patron alert management

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/serials/serials-home.pl?cvsroot=koha&only_with_tag=rel_3_0&r1=1.5&r2=1.5.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/serials/serials-recieve.pl?cvsroot=koha&only_with_tag=rel_3_0&r1=1.4.2.1&r2=1.4.2.2
http://cvs.savannah.gnu.org/viewcvs/koha/serials/subscription-add.pl?cvsroot=koha&only_with_tag=rel_3_0&r1=1.6.2.2&r2=1.6.2.3
http://cvs.savannah.gnu.org/viewcvs/koha/serials/subscription-detail.pl?cvsroot=koha&only_with_tag=rel_3_0&r1=1.3.2.2&r2=1.3.2.3
http://cvs.savannah.gnu.org/viewcvs/koha/serials/alt_subscription-add.pl?cvsroot=koha&only_with_tag=rel_3_0&r1=1.2&r2=0
http://cvs.savannah.gnu.org/viewcvs/koha/serials/alt_subscription-detail.pl?cvsroot=koha&only_with_tag=rel_3_0&r1=1.2&r2=0

Patches:
Index: serials-home.pl
===================================================================
RCS file: /sources/koha/koha/serials/serials-home.pl,v
retrieving revision 1.5
retrieving revision 1.5.2.1
diff -u -b -r1.5 -r1.5.2.1
--- serials-home.pl     20 Jul 2006 06:09:02 -0000      1.5
+++ serials-home.pl     30 Oct 2006 10:22:46 -0000      1.5.2.1
@@ -17,7 +17,7 @@
 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
 # Suite 330, Boston, MA  02111-1307 USA
 
-# $Id: serials-home.pl,v 1.5 2006/07/20 06:09:02 bob_lyon Exp $
+# $Id: serials-home.pl,v 1.5.2.1 2006/10/30 10:22:46 tipaul Exp $
 
 =head1 NAME
 
@@ -57,10 +57,6 @@
 my $routing = $query->param('routing');
 my $searched = $query->param('searched');
 my $biblionumber = $query->param('biblionumber');
-my $alt_links = 0;
-if(C4::Context->preference("RoutingSerials")){
-    $alt_links = 0;
-}
 my @subscriptions = GetSubscriptions($title,$ISSN,$biblionumber);
 my ($template, $loggedinuser, $cookie)
 = get_template_and_user({template_name => "serials/serials-home.tmpl",
@@ -86,6 +82,5 @@
        ISSN => $ISSN,
         done_searched => $searched,
         routing => $routing,
-        alt_links => $alt_links,
        );
 output_html_with_http_headers $query, $cookie, $template->output;

Index: serials-recieve.pl
===================================================================
RCS file: /sources/koha/koha/serials/Attic/serials-recieve.pl,v
retrieving revision 1.4.2.1
retrieving revision 1.4.2.2
diff -u -b -r1.4.2.1 -r1.4.2.2
--- serials-recieve.pl  2 Oct 2006 09:15:44 -0000       1.4.2.1
+++ serials-recieve.pl  30 Oct 2006 10:22:46 -0000      1.4.2.2
@@ -17,7 +17,7 @@
 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
 # Suite 330, Boston, MA  02111-1307 USA
 
-# $Id: serials-recieve.pl,v 1.4.2.1 2006/10/02 09:15:44 hdl Exp $
+# $Id: serials-recieve.pl,v 1.4.2.2 2006/10/30 10:22:46 tipaul Exp $
 
 =head1 NAME
 
@@ -28,7 +28,7 @@
 =over 4
 
 =item op
- op can be :
+op can be :
     * modsubscriptionhistory :to modify the subscription history 
     * serialchangestatus     :to modify the status of this subscription
 
@@ -129,7 +129,7 @@
                
                my ($oldstatus) = $sth->fetchrow;
                if ($serialids[$i]) {
-                       
SerialChangeStatus($serialids[$i],$serialseqs[$i],format_date_in_iso($planneddates[$i]),format_date_in_iso($publisheddates[$i]),$status[$i],$notes[$i])
 unless ($hassubscriptionexpired && $oldstatus == 1);
+            
ModSerialStatus($serialids[$i],$serialseqs[$i],format_date_in_iso($planneddates[$i]),format_date_in_iso($publisheddates[$i]),$status[$i],$notes[$i])
 unless ($hassubscriptionexpired && $oldstatus == 1);
                        if (($status[$i]==2) && 
C4::Context->preference("serialsadditems")){
                                my %info;
                                $info{branch}=$homebranches[$i];
@@ -186,6 +186,7 @@
 my ($totalissues,@serialslist) = GetSerials($subscriptionid);
 my $count = @serialslist;
 for(my $i=0;$i<$count;$i++){
+    warn "la : $i";
     $serialslist[$i]->{'callnumber'} = $subscription->{'callnumber'};
     my $temp = rand(10000000);
     $serialslist[$i]->{'barcode'} = "TEMP" . sprintf("%.0f",$temp);
@@ -218,7 +219,6 @@
                                );
                push @branchloop, \%row;
        }
-       
        my $itemstatushash = GetItemStatus($fwk);
        my @itemstatusloop;
         my $itemstatusloopcount=0;    
@@ -230,7 +230,6 @@
                $itemstatusloopcount++;
                push @itemstatusloop, \%row;
        }
-       
        my $itemlocationhash = GetItemLocation($fwk);
        my @itemlocationloop;
        foreach my $thisitemlocation (keys %$itemlocationhash) {
@@ -264,7 +263,6 @@
 $sth->execute($subscriptionid);
 my $solhistory = $sth->fetchrow_hashref;
 
-    
 $template->param(
             user => $auser,
             serialslist => address@hidden,

Index: subscription-add.pl
===================================================================
RCS file: /sources/koha/koha/serials/subscription-add.pl,v
retrieving revision 1.6.2.2
retrieving revision 1.6.2.3
diff -u -b -r1.6.2.2 -r1.6.2.3
--- subscription-add.pl 2 Oct 2006 09:15:44 -0000       1.6.2.2
+++ subscription-add.pl 30 Oct 2006 10:22:46 -0000      1.6.2.3
@@ -13,6 +13,7 @@
 use HTML::Template;
 use C4::Serials;
 use Date::Manip;
+use C4::Letters;
 
 my $query = new CGI;
 my $op = $query->param('op');
@@ -23,7 +24,7 @@
        $add2,$every2,$whenmorethan2,$setto2,$lastvalue2,$innerloop2,
        $add3,$every3,$whenmorethan3,$setto3,$lastvalue3,$innerloop3,
        $numberingmethod, $status, $biblionumber, 
-       $bibliotitle, $callnumber, $notes, $hemisphere);
+       $bibliotitle, $callnumber, $notes, $hemisphere, $letter);
 
        my @budgets;
 my ($template, $loggedinuser, $cookie)
@@ -88,8 +89,6 @@
            $sublength = $numberlength;
            $sub_on = $subscription_types[0];
        }
-        
-
         while (@subscription_types) {
            my $sub_type = shift @subscription_types;
            my %row = ( 'name' => $sub_type );
@@ -100,7 +99,6 @@
            }
            push( @sub_type_data, \%row );
         }
-    
        $add1 = $subs->{'add1'};
        $every1 = $subs->{'every1'};
        $whenmorethan1 = $subs->{'whenmorethan1'};
@@ -126,6 +124,8 @@
         $callnumber = $subs->{'callnumber'};
        $notes = $subs->{'notes'};
         $hemisphere = $subs->{'hemisphere'};
+       $letter = $subs->{'letter'};
+       defined $letter or $letter='';
        $template->param(
                $op => 1,
                user => $auser,
@@ -171,8 +171,8 @@
                weekarrayjs => $weekarrayjs,
                weekno => $weekno,
                hemisphere => $hemisphere,
+            letter => $letter,
                );
-
        $template->param(
                                "periodicity$periodicity" => 1,
                                "dow$dow" => 1,
@@ -180,6 +180,18 @@
                                );
 }
 
+my $letters = GetLetters('serial');
+my @letterloop;
+foreach my $thisletter (keys %$letters) {
+    my $selected = 1 if $thisletter eq $letter;
+    my %row =(value => $thisletter,
+                selected => $selected,
+                lettername => $letters->{$thisletter},
+            );
+    push @letterloop, \%row;
+}
+$template->param(letterloop => address@hidden);
+
 if ($op eq 'addsubscription') {
     my @irregular = $query->param('irregular');
     my $irregular_count = @irregular;
@@ -232,8 +244,9 @@
     my $callnumber = $query->param('callnumber');
     my $notes = $query->param('notes');
     my $hemisphere = $query->param('hemisphere') || 1;
+       my $letter = $query->param('letter');
     ### BugFIX : hdl doesnot know what innerloops or letter stand for but it 
seems necessary. So he adds them.
-    my ($innerloop1,$innerloop2,$innerloop3,$letter);
+    my ($innerloop1,$innerloop2,$innerloop3);
        my $subscriptionid = 
NewSubscription($auser,$aqbooksellerid,$cost,$aqbudgetid,$biblionumber,
                                        
$startdate,$periodicity,$dow,$numberlength,$weeklength,$monthlength,
                                        
$add1,$every1,$whenmorethan1,$setto1,$lastvalue1,$innerloop1,

Index: subscription-detail.pl
===================================================================
RCS file: /sources/koha/koha/serials/subscription-detail.pl,v
retrieving revision 1.3.2.2
retrieving revision 1.3.2.3
diff -u -b -r1.3.2.2 -r1.3.2.3
--- subscription-detail.pl      2 Oct 2006 09:15:44 -0000       1.3.2.2
+++ subscription-detail.pl      30 Oct 2006 10:22:46 -0000      1.3.2.3
@@ -23,7 +23,7 @@
        $add1,$every1,$whenmorethan1,$setto1,$lastvalue1,$innerloop1,
        $add2,$every2,$whenmorethan2,$setto2,$lastvalue2,$innerloop2,
        $add3,$every3,$whenmorethan3,$setto3,$lastvalue3,$innerloop3,
-       $numberingmethod, $status, $biblionumber, $bibliotitle, $callnumber, 
$notes, $hemisphere);
+    $numberingmethod, $status, $biblionumber, $bibliotitle, $callnumber, 
$notes, $hemisphere,$letter);
 
 $subscriptionid = $query->param('subscriptionid');
 
@@ -35,7 +35,6 @@
     }
     $irregularity =~ s/\|$//;
 
-    
        $auser = $query->param('user');
        $librarian => $query->param('librarian'),
        $cost = $query->param('cost');
@@ -80,13 +79,13 @@
         $callnumber = $query->param('callnumber');
        $notes = $query->param('notes');
         $hemisphere = $query->param('hemisphere');
-
+    $letter = $query->param('letter');
        &ModSubscription($auser,$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, $hemisphere, $subscriptionid);
+                    $numberingmethod, $status, $biblionumber, $callnumber, 
$notes, $letter, $hemisphere, $subscriptionid);
 }
 
 if ($op eq 'del') {
@@ -174,6 +173,7 @@
         callnumber => $subs->{callnumber},
        notes => $subs->{notes},
        subscriptionid => $subs->{subscriptionid},
+    letter => $subs->{letter},
        serialslist => address@hidden,
        totalissues => $totalissues,
         hemisphere => $hemisphere,

Index: alt_subscription-add.pl
===================================================================
RCS file: alt_subscription-add.pl
diff -N alt_subscription-add.pl
--- alt_subscription-add.pl     11 Aug 2006 16:33:53 -0000      1.2
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,260 +0,0 @@
-#!/usr/bin/perl
-
-
-use strict;
-use CGI;
-use C4::Koha;
-use C4::Auth;
-use C4::Date;
-use C4::Output;
-use C4::Acquisition;
-use C4::Interface::CGI::Output;
-use C4::Context;
-use HTML::Template;
-use C4::Serials;
-use Date::Manip;
-
-my $query = new CGI;
-my $op = $query->param('op');
-my $dbh = C4::Context->dbh;
-my ($subscriptionid,$auser,$librarian,$cost,$aqbooksellerid, 
$aqbooksellername,$aqbudgetid, $bookfundid, $startdate, $periodicity,
-       $firstacquidate, $dow, $irregularity, $numberpattern, $numberlength, 
$weeklength, $monthlength, $sublength,
-       $add1,$every1,$whenmorethan1,$setto1,$lastvalue1,$innerloop1,
-       $add2,$every2,$whenmorethan2,$setto2,$lastvalue2,$innerloop2,
-       $add3,$every3,$whenmorethan3,$setto3,$lastvalue3,$innerloop3,
-       $numberingmethod, $status, $biblionumber, 
-       $bibliotitle, $callnumber, $notes, $hemisphere);
-
-       my @budgets;
-my ($template, $loggedinuser, $cookie)
-= get_template_and_user({template_name => "serials/alt_subscription-add.tmpl",
-                               query => $query,
-                               type => "intranet",
-                               authnotrequired => 0,
-                               flagsrequired => {catalogue => 1},
-                               debug => 1,
-                               });
-
-
-my $weekarrayjs='';
-my $count = 0;
-my ($year, $month, $day) = UnixDate("today", "%Y", "%m", "%d");
-my $firstday = Date_DayOfYear($month,$day,$year);
-my $wkno = Date_WeekOfYear($month,$day,$year,1); # week starting monday
-my $weekno = $wkno;
-for(my $i=$firstday;$i<($firstday+365);$i=$i+7){
-        $count = $i;
-        if($wkno > 52){$year++; $wkno=1;}
-        if($count>365){$count=$i-365;}    
-        my ($y,$m,$d) = Date_NthDayOfYear($year,$count);
-        my $output = "$y-$m-$d";
-        $weekarrayjs .= "'Wk $wkno: ".format_date($output)."',";
-        $wkno++;    
-}
-chop($weekarrayjs);
-# warn $weekarrayjs;
-
-my $sub_on;
-my @subscription_types = (
-            'issues', 'weeks', 'months'
-        ); 
-my @sub_type_data;
-if ($op eq 'mod') {
-       my $subscriptionid = $query->param('subscriptionid');
-       my $subs = &GetSubscription($subscriptionid);
-       $auser = $subs->{'user'};
-       $librarian => $subs->{'librarian'},
-       $cost = $subs->{'cost'};
-       $aqbooksellerid = $subs->{'aqbooksellerid'};
-       $aqbooksellername = $subs->{'aqbooksellername'};
-       $startdate = $subs->{'startdate'};
-       $firstacquidate = $subs->{'firstacquidate'};    
-       $periodicity = $subs->{'periodicity'};
-       $dow = $subs->{'dow'};
-        $irregularity = $subs->{'irregularity'};
-        $numberpattern = $subs->{'numberpattern'};
-       $numberlength = $subs->{'numberlength'};
-       $weeklength = $subs->{'weeklength'};
-       $monthlength = $subs->{'monthlength'};
-
-        if($monthlength > 0){
-           $sublength = $monthlength;
-           $sub_on = $subscription_types[2];
-       } elsif ($weeklength>0){
-           $sublength = $weeklength;
-           $sub_on = $subscription_types[1];
-       } else {
-           $sublength = $numberlength;
-           $sub_on = $subscription_types[0];
-       }
-        
-
-        while (@subscription_types) {
-           my $sub_type = shift @subscription_types;
-           my %row = ( 'name' => $sub_type );
-           if ( $sub_on eq $sub_type ) {
-            $row{'selected'} = ' selected';
-           } else {
-            $row{'selected'} = '';
-           }
-           push( @sub_type_data, \%row );
-        }
-    
-       $add1 = $subs->{'add1'};
-       $every1 = $subs->{'every1'};
-       $whenmorethan1 = $subs->{'whenmorethan1'};
-       $setto1 = $subs->{'setto1'};
-       $lastvalue1 = $subs->{'lastvalue1'};
-       $innerloop1 = $subs->{'innerloop1'};
-       $add2 = $subs->{'add2'};
-       $every2 = $subs->{'every2'};
-       $whenmorethan2 = $subs->{'whenmorethan2'};
-       $setto2 = $subs->{'setto2'};
-       $lastvalue2 = $subs->{'lastvalue2'};
-       $innerloop2 = $subs->{'innerloop2'};
-       $add3 = $subs->{'add3'};
-       $every3 = $subs->{'every3'};
-       $whenmorethan3 = $subs->{'whenmorethan3'};
-       $setto3 = $subs->{'setto3'};
-       $lastvalue3 = $subs->{'lastvalue3'};
-       $innerloop3 = $subs->{'innerloop3'};
-       $numberingmethod = $subs->{'numberingmethod'};
-       $status = $subs->{status};
-       $biblionumber = $subs->{'biblionumber'};
-       $bibliotitle = $subs->{'bibliotitle'};
-        $callnumber = $subs->{'callnumber'};
-       $notes = $subs->{'notes'};
-        $hemisphere = $subs->{'hemisphere'};
-       $template->param(
-               $op => 1,
-               user => $auser,
-               librarian => $librarian,
-               aqbooksellerid => $aqbooksellerid,
-               aqbooksellername => $aqbooksellername,
-               cost => $cost,
-               aqbudgetid => $aqbudgetid,
-               bookfundid => $bookfundid,
-               startdate => format_date($startdate),
-               firstacquidate => format_date($firstacquidate),     
-               periodicity => $periodicity,
-               dow => $dow,
-               irregularity => $irregularity,
-               numberpattern => $numberpattern,
-               sublength => $sublength,
-               subtype => address@hidden,
-               add1 => $add1,
-               every1 => $every1,
-               whenmorethan1 => $whenmorethan1,
-               setto1 => $setto1,
-               lastvalue1 => $lastvalue1,
-               innerloop1 => $innerloop1,
-               add2 => $add2,
-               every2 => $every2,
-               whenmorethan2 => $whenmorethan2,
-               setto2 => $setto2,
-               lastvalue2 => $lastvalue2,
-               innerloop2 => $innerloop2,
-               add3 => $add3,
-               every3 => $every3,
-               whenmorethan3 => $whenmorethan3,
-               setto3 => $setto3,
-               lastvalue3 => $lastvalue3,
-               innerloop3 => $innerloop3,
-               numberingmethod => $numberingmethod,
-               status => $status,
-               biblionumber => $biblionumber,
-               bibliotitle => $bibliotitle,
-               callnumber => $callnumber,
-               notes => $notes,
-               subscriptionid => $subscriptionid,
-               weekarrayjs => $weekarrayjs,
-               weekno => $weekno,
-               hemisphere => $hemisphere,
-               );
-
-       $template->param(
-                               "periodicity$periodicity" => 1,
-                               "dow$dow" => 1,
-                               "numberpattern$numberpattern" => 1,
-                               );
-}
-
-if ($op eq 'addsubscription') {
-        my @irregular = $query->param('irregular');
-        my $irregular_count = @irregular;
-        for(my $i =0;$i<$irregular_count;$i++){
-            $irregularity .=$irregular[$i]."|";
-        }
-        $irregularity =~ s/\|$//;
-
-       my $auser = $query->param('user');
-       my $aqbooksellerid = $query->param('aqbooksellerid');
-       my $cost = $query->param('cost');
-       my $aqbudgetid = $query->param('aqbudgetid'); 
-       my $startdate = $query->param('startdate');
-       my $firstacquidate = $query->param('firstacquidate');    
-       my $periodicity = $query->param('periodicity');
-       my $dow = $query->param('dow');
-        # my $irregularity = $query->param('irregularity');
-       my $numberlength = 0;
-       my $weeklength = 0;
-       my $monthlength = 0;
-        my $numberpattern = $query->param('numbering_pattern');
-        my $sublength = $query->param('sublength');
-        my $subtype = $query->param('subtype');
-        if ($subtype eq 'months'){
-           $monthlength = $sublength;
-       } elsif ($subtype eq 'weeks'){
-           $weeklength = $sublength;
-       } else {
-           $numberlength = $sublength;
-       }
-
-       my $add1 = $query->param('add1');
-       my $every1 = $query->param('every1');
-       my $whenmorethan1 = $query->param('whenmorethan1');
-       my $setto1 = $query->param('setto1');
-       my $lastvalue1 = $query->param('lastvalue1');
-       my $add2 = $query->param('add2');
-       my $every2 = $query->param('every2');
-       my $whenmorethan2 = $query->param('whenmorethan2');
-       my $setto2 = $query->param('setto2');
-       my $lastvalue2 = $query->param('lastvalue2');
-       my $add3 = $query->param('add3');
-       my $every3 = $query->param('every3');
-       my $whenmorethan3 = $query->param('whenmorethan3');
-       my $setto3 = $query->param('setto3');
-       my $lastvalue3 = $query->param('lastvalue3');
-       my $numberingmethod = $query->param('numberingmethod');
-       my $status = 1;
-       my $biblionumber = $query->param('biblionumber');
-        my $callnumber = $query->param('callnumber');
-       my $notes = $query->param('notes');
-        my $hemisphere = $query->param('hemisphere') || 1;
-
-       my $subscriptionid = 
old_newsubscription($auser,$aqbooksellerid,$cost,$aqbudgetid,$biblionumber,
-                                       
$startdate,$periodicity,$firstacquidate,$dow,$irregularity,$numberpattern,$numberlength,$weeklength,$monthlength,
-                                       
$add1,$every1,$whenmorethan1,$setto1,$lastvalue1,
-                                       
$add2,$every2,$whenmorethan2,$setto2,$lastvalue2,
-                                       
$add3,$every3,$whenmorethan3,$setto3,$lastvalue3,
-                                       $numberingmethod, $status, $callnumber, 
$notes, $hemisphere
-                               );
-       print 
$query->redirect("/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=$subscriptionid");
-} else {
-
-        while (@subscription_types) {
-           my $sub_type = shift @subscription_types;
-           my %row = ( 'name' => $sub_type );
-           if ( $sub_on eq $sub_type ) {
-            $row{'selected'} = ' selected';
-           } else {
-            $row{'selected'} = '';
-           }
-           push( @sub_type_data, \%row );
-        }    
-    $template->param(subtype => address@hidden,
-                weekarrayjs => $weekarrayjs,
-                weekno => $weekno,
-       );
-       output_html_with_http_headers $query, $cookie, $template->output;
-}

Index: alt_subscription-detail.pl
===================================================================
RCS file: alt_subscription-detail.pl
diff -N alt_subscription-detail.pl
--- alt_subscription-detail.pl  20 Jul 2006 04:08:47 -0000      1.2
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,189 +0,0 @@
-#!/usr/bin/perl
-
-use strict;
-use CGI;
-use C4::Auth;
-use C4::Koha;
-use C4::Date;
-use C4::Serials;
-use C4::Output;
-use C4::Interface::CGI::Output;
-use C4::Context;
-use HTML::Template;
-use Date::Manip;
-
-my $query = new CGI;
-my $op = $query->param('op');
-my $dbh = C4::Context->dbh;
-my $sth;
-# my $id;
-my ($template, $loggedinuser, $cookie, $subs);
-my ($subscriptionid,$auser,$librarian,$cost,$aqbooksellerid, 
$aqbooksellername,$aqbudgetid, $bookfundid, $startdate, $periodicity,
-       $firstacquidate, $dow, $irregularity, $sublength, $subtype, 
$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, $bibliotitle, $callnumber, 
$notes, $hemisphere);
-
-$subscriptionid = $query->param('subscriptionid');
-
-if ($op eq 'modsubscription') {
-    my @irregular = $query->param('irregular');
-    my $irregular_count = @irregular;
-    for(my $i =0;$i<$irregular_count;$i++){
-       $irregularity .=$irregular[$i]."|";
-    }
-    $irregularity =~ s/\|$//;
-
-    
-       $auser = $query->param('user');
-       $librarian => $query->param('librarian'),
-       $cost = $query->param('cost');
-       $aqbooksellerid = $query->param('aqbooksellerid');
-       $biblionumber = $query->param('biblionumber');
-       $aqbudgetid = $query->param('aqbudgetid');
-       $startdate = format_date_in_iso($query->param('startdate'));
-       $firstacquidate = format_date_in_iso($query->param('firstacquidate'));  
  
-       $periodicity = $query->param('periodicity');
-       $dow = $query->param('dow');
-        $sublength = $query->param('sublength');
-        $subtype = $query->param('subtype');
-
-        if($subtype eq 'months'){
-           $monthlength = $sublength;
-       } elsif ($subtype eq 'weeks'){
-           $weeklength = $sublength;
-       } else {
-           $numberlength = $sublength;
-       }
-        $numberpattern = $query->param('numbering_pattern');
-       $add1 = $query->param('add1');
-       $every1 = $query->param('every1');
-       $whenmorethan1 = $query->param('whenmorethan1');
-       $setto1 = $query->param('setto1');
-       $lastvalue1 = $query->param('lastvalue1');
-       $innerloop1 = $query->param('innerloop1');
-       $add2 = $query->param('add2');
-       $every2 = $query->param('every2');
-       $whenmorethan2 = $query->param('whenmorethan2');
-       $setto2 = $query->param('setto2');
-       $lastvalue2 = $query->param('lastvalue2');
-       $innerloop2 = $query->param('innerloop2');
-       $add3 = $query->param('add3');
-       $every3 = $query->param('every3');
-       $whenmorethan3 = $query->param('whenmorethan3');
-       $setto3 = $query->param('setto3');
-       $lastvalue3 = $query->param('lastvalue3');
-       $innerloop3 = $query->param('innerloop3');
-       $numberingmethod = $query->param('numberingmethod');
-       $status = 1;
-        $callnumber = $query->param('callnumber');
-       $notes = $query->param('notes');
-        $hemisphere = $query->param('hemisphere');
-
-       &ModSubscription($auser,$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, $hemisphere, $subscriptionid);
-}
-
-if ($op eq 'del') {
-       &DelSubscription($subscriptionid);
-       print "Content-Type: text/html\n\n<META HTTP-EQUIV=Refresh CONTENT=\"0; 
URL=serials-home.pl\"></html>";
-       exit;
-
-}
-my $subs = &GetSubscription($subscriptionid);
-my ($routing, @routinglist) = getroutinglist($subscriptionid);
-my ($totalissues,@serialslist) = old_getserials($subscriptionid);
-$totalissues-- if $totalissues; # the -1 is to have 0 if this is a new 
subscription (only 1 issue)
-# the subscription must be deletable if there is NO issues for a reason or 
another (should not happend, but...)
-
-($template, $loggedinuser, $cookie)
-= get_template_and_user({template_name => 
"serials/alt_subscription-detail.tmpl",
-                               query => $query,
-                               type => "intranet",
-                               authnotrequired => 0,
-                               flagsrequired => {catalogue => 1},
-                               debug => 1,
-                               });
-
-my ($user, $cookie, $sessionID, $flags)
-       = checkauth($query, 0, {catalogue => 1}, "intranet");
-
-my $weekarrayjs='';
-my $count = 0;
-my ($year, $month, $day) = UnixDate("today", "%Y", "%m", "%d");
-my $firstday = Date_DayOfYear($month,$day,$year);
-my $wkno = Date_WeekOfYear($month,$day,$year,1); # week starting monday
-my $weekno = $wkno;
-for(my $i=$firstday;$i<($firstday+365);$i=$i+7){
-            $count = $i;
-            if($wkno > 52){$year++; $wkno=1;}
-            if($count>365){$count=$i-365;}
-            my ($y,$m,$d) = Date_NthDayOfYear($year,$count);
-            my $output = "$y-$m-$d";
-            $weekarrayjs .= "'Wk $wkno: ".format_date($output)."',";
-            $wkno++;
-    }
-chop($weekarrayjs);
-
-$template->param(
-        routing => $routing,
-       user => $subs->{auser},
-       librarian => $subs->{librarian},
-       aqbooksellerid => $subs->{aqbooksellerid},
-       aqbooksellername => $subs->{aqbooksellername},
-       cost => $subs->{cost},
-       aqbudgetid => $subs->{aqbudgetid},
-       bookfundid => $subs->{bookfundid},
-       startdate => format_date($subs->{startdate}),
-       firstacquidate => format_date($subs->{firstacquidate}),    
-       periodicity => $subs->{periodicity},
-       dow => $subs->{dow},
-        irregularity => $subs->{irregularity},
-       numberlength => $subs->{numberlength},
-       weeklength => $subs->{weeklength},
-       monthlength => $subs->{monthlength},
-        numberpattern => $subs->{numberpattern},
-       add1 => $subs->{add1},
-       every1 => $subs->{every1},
-       whenmorethan1 => $subs->{whenmorethan1},
-       innerloop1 => $subs->{innerloop1},
-       setto1 => $subs->{setto1},
-       lastvalue1 => $subs->{lastvalue1},
-       add2 => $subs->{add2},
-       every2 => $subs->{every2},
-       whenmorethan2 => $subs->{whenmorethan2},
-       setto2 => $subs->{setto2},
-       lastvalue2 => $subs->{lastvalue2},
-       innerloop2 => $subs->{innerloop2},
-       add3 => $subs->{add3},
-       every3 => $subs->{every3},
-       whenmorethan3 => $subs->{whenmorethan3},
-       setto3 => $subs->{setto3},
-       lastvalue3 => $subs->{lastvalue3},
-       innerloop3 => $subs->{innerloop3},
-        weekarrayjs => $weekarrayjs,
-       numberingmethod => $subs->{numberingmethod},
-       status => $subs->{status},
-       biblionumber => $subs->{biblionumber},
-       bibliotitle => $subs->{bibliotitle},
-        callnumber => $subs->{callnumber},
-       notes => $subs->{notes},
-       subscriptionid => $subs->{subscriptionid},
-       serialslist => address@hidden,
-       totalissues => $totalissues,
-        hemisphere => $hemisphere,
-       );
-$template->param(
-                       "periodicity$subs->{periodicity}" => 1,
-                       "arrival$subs->{dow}" => 1,
-                        "numberpattern$subs->{numberpattern}" => 1,
-                       intranetstylesheet => 
C4::Context->preference("intranetstylesheet"),
-                       intranetcolorstylesheet => 
C4::Context->preference("intranetcolorstylesheet"), 
-                       );
-
-output_html_with_http_headers $query, $cookie, $template->output;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]