+++ /dev/null
-#!/usr/bin/perl
-
-use strict;
-use CGI;
-use C4::Auth;
-use C4::Output;
-use C4::Interface::CGI::Output;
-use C4::Database;
-use HTML::Template;
-use C4::Acquisition;
-my $query = new CGI;
-my ($template, $loggedinuser, $cookie)
- = get_template_and_user({template_name => "bull/search-supply.tmpl",
- query => $query,
- type => "intranet",
- authnotrequired => 0,
- flagsrequired => {acquisition => 1},
- debug => 1,
- });
-
-#FIXME : Is this page still used ????
-# looks like no.
-
-# budget
-my $dbh = C4::Context->dbh;
-my $sthtemp = $dbh->prepare("Select flags, branchcode from borrowers where borrowernumber = ?");
-$sthtemp->execute($loggedinuser);
-my ($flags, $homebranch)=$sthtemp->fetchrow;
-my ($count,@results)=bookfunds($homebranch);
-my $classlist='';
-my $total=0;
-my $totspent=0;
-my $totcomtd=0;
-my $totavail=0;
-my @loop_budget = ();
-for (my $i=0;$i<$count;$i++){
- my ($spent,$comtd)=bookfundbreakdown($results[$i]->{'bookfundid'});
- my $avail=$results[$i]->{'budgetamount'}-($spent+$comtd);
- my %line;
- $line{bookfundname} = $results[$i]->{'bookfundname'};
- $line{budgetamount} = $results[$i]->{'budgetamount'};
- $line{spent} = sprintf ("%.2f", $spent);
- $line{comtd} = sprintf ("%.2f",$comtd);
- $line{avail} = sprintf ("%.2f",$avail);
- push @loop_budget, \%line;
- $total+=$results[$i]->{'budgetamount'};
- $totspent+=$spent;
- $totcomtd+=$comtd;
- $totavail+=$avail;
-}
-#currencies
-my ($count,$rates)=getcurrencies();
-my @loop_currency = ();
-for (my $i=0;$i<$count;$i++){
- my %line;
- $line{currency} = $rates->[$i]->{'currency'};
- $line{rate} = $rates->[$i]->{'rate'};
- push @loop_currency, \%line;
-}
-$template->param(classlist => $classlist,
- type => 'intranet',
- loop_budget => \@loop_budget,
- loop_currency => \@loop_currency,
- total => sprintf("%.2f",$total),
- totspent => sprintf("%.2f",$totspent),
- totcomtd => sprintf("%.2f",$totcomtd),
- totavail => sprintf("%.2f",$totavail));
-
-output_html_with_http_headers $query, $cookie, $template->output;
+++ /dev/null
-#!/usr/bin/perl
-
-use strict;
-use CGI;
-use C4::Auth;
-use C4::Bull;
-use C4::Output;
-use C4::Interface::CGI::Output;
-use C4::Context;
-use HTML::Template;
-
-my $query = new CGI;
-my $title = $query->param('title');
-my $ISSN = $query->param('ISSN');
-my $biblionumber = $query->param('biblionumber');
-my @subscriptions = getsubscriptions($title,$ISSN,$biblionumber);
-my ($template, $loggedinuser, $cookie)
-= get_template_and_user({template_name => "bull/bull-home.tmpl",
- query => $query,
- type => "intranet",
- authnotrequired => 0,
- flagsrequired => {catalogue => 1},
- debug => 1,
- });
-
-$template->param(
- subscriptions => \@subscriptions,
- title => $title,
- ISSN => $ISSN,
- );
-output_html_with_http_headers $query, $cookie, $template->output;
+++ /dev/null
-#!/usr/bin/perl
-
-# Copyright 2000-2002 Katipo Communications
-#
-# This file is part of Koha.
-#
-# Koha is free software; you can redistribute it and/or modify it under the
-# terms of the GNU General Public License as published by the Free Software
-# Foundation; either version 2 of the License, or (at your option) any later
-# version.
-#
-# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
-# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
-# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along with
-# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
-# Suite 330, Boston, MA 02111-1307 USA
-
-use strict;
-use CGI;
-use C4::Date;
-use C4::Auth;
-use C4::Context;
-use C4::Output;
-use C4::Interface::CGI::Output;
-use C4::Search;
-use HTML::Template;
-
-sub StringSearch {
- my ($searchstring)=@_;
- my $dbh = C4::Context->dbh;
- $searchstring=~ s/\'/\\\'/g;
- my @data=split(' ',$searchstring);
- my $count=@data;
- my $sth=$dbh->prepare("Select surname,firstname from borrowers where (surname like ?) order by surname");
- $sth->execute("$data[0]%");
- my @results;
- my $cnt=0;
- while (my $data=$sth->fetchrow_hashref){
- push(@results,$data);
- $cnt ++;
- }
- $sth->finish;
- return($cnt,\@results);
-}
-
-my $input = new CGI;
-my $searchfield=$input->param('searchfield');
-defined $searchfield or $searchfield='';
-my $distributedto=$input->param('distributedto');
-my $subscriptionid = $input->param('subscriptionid');
-$searchfield=~ s/\,//g;
-my $SaveList=$input->param('SaveList');
-my $dbh = C4::Context->dbh;
-
-unless ($distributedto) {
- # read the previous distributedto
- my $sth = $dbh->prepare('select distributedto from subscription where subscriptionid=?');
- $sth->execute($subscriptionid);
- ($distributedto) = $sth->fetchrow;
-}
-
-if ($SaveList) {
- my $sth = $dbh->prepare("update subscription set distributedto=? where subscriptionid=?");
- $sth->execute($distributedto,$subscriptionid);
-}
-my ($template, $borrowernumber, $cookie)
- = get_template_and_user({template_name => "bull/distributedto.tmpl",
- query => $input,
- type => "intranet",
- authnotrequired => 0,
- flagsrequired => {cataloguing => 1},
- debug => 1,
- });
-
-my $env;
-my $count=0;
-my $results;
-($count,$results)=StringSearch($searchfield) if $searchfield;
-my $toggle="0";
-my @loop_data =();
-for (my $i=0; $i < $count; $i++){
- if ($i % 2){
- $toggle=1;
- } else {
- $toggle=0;
- }
- my %row_data;
- $row_data{toggle} = $toggle;
- $row_data{firstname} = $results->[$i]{'firstname'};
- $row_data{surname} = $results->[$i]{'surname'};
- push(@loop_data, \%row_data);
-}
-$template->param(borlist => \@loop_data,
- searchfield => $searchfield,
- distributedto => $distributedto,
- SaveList => $SaveList,
- subscriptionid => $subscriptionid,
- );
-output_html_with_http_headers $input, $cookie, $template->output;
-
+++ /dev/null
-#!/usr/bin/perl
-
-use strict;
-use CGI;
-use C4::Auth;
-use C4::Bull;
-use C4::Acquisition;
-use C4::Output;
-use C4::Interface::CGI::Output;
-use C4::Context;
-use HTML::Template;
-
-my $query = new CGI;
-# my $title = $query->param('title');
-# my $ISSN = $query->param('ISSN');
-# my @subscriptions = getsubscriptions($title,$ISSN);
-
-my $supplierid = $query->param('supplierid');
-my %supplierlist = getSupplierListWithLateIssues;
-my @select_supplier;
-push @select_supplier,"";
-foreach my $supplierid (keys %supplierlist){
- push @select_supplier, $supplierid
-}
-my $CGIsupplier=CGI::scrolling_list( -name => 'supplierid',
- -values => \@select_supplier,
- -default => $supplierid,
- -labels => \%supplierlist,
- -size => 1,
- -multiple => 0 );
-
-my @lateissues;
-@lateissues = GetLateIssues($supplierid) if $supplierid;
-my @supplierinfo;
-my $nothing;
-($nothing,@supplierinfo)=bookseller($supplierid) if $supplierid;
-
-my ($template, $loggedinuser, $cookie)
-= get_template_and_user({template_name => "bull/lateissues.tmpl",
- query => $query,
- type => "intranet",
- authnotrequired => 0,
- flagsrequired => {catalogue => 1},
- debug => 1,
- });
-
-$template->param(
- CGIsupplier => $CGIsupplier,
- lateissues => \@lateissues,
- phone => $supplierinfo[0]->{phone},
- booksellerfax => $supplierinfo[0]->{booksellerfax},
- bookselleremail => $supplierinfo[0]->{bookselleremail},
- );
-output_html_with_http_headers $query, $cookie, $template->output;
+++ /dev/null
-#!/usr/bin/perl
-
-# $Id$
-
-#script to show suppliers and orders
-#written by chris@katipo.co.nz 23/2/2000
-
-
-# Copyright 2000-2002 Katipo Communications
-#
-# This file is part of Koha.
-#
-# Koha is free software; you can redistribute it and/or modify it under the
-# terms of the GNU General Public License as published by the Free Software
-# Foundation; either version 2 of the License, or (at your option) any later
-# version.
-#
-# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
-# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
-# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along with
-# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
-# Suite 330, Boston, MA 02111-1307 USA
-
-use strict;
-use C4::Auth;
-use C4::Biblio;
-use C4::Output;
-use CGI;
-use C4::Interface::CGI::Output;
-use C4::Database;
-use HTML::Template;
-use C4::Acquisition;
-use C4::Date;
-
-my $query=new CGI;
-my ($template, $loggedinuser, $cookie)
- = get_template_and_user({template_name => "bull/order.tmpl",
- query => $query,
- type => "intranet",
- authnotrequired => 0,
- flagsrequired => {acquisition => 1},
- debug => 1,
- });
-
-my $supplier=$query->param('supplier');
-my ($count,@suppliers)=bookseller($supplier);
-
-#build reult page
-my $toggle=0;
-my @loop_suppliers;
-for (my $i=0; $i<$count; $i++) {
- my ($ordcount,$orders)=getorders($suppliers[$i]->{'id'});
- my %line;
- if ($toggle==0){
- $line{even}=1;
- $toggle=1;
- } else {
- $line{even}=0;
- $toggle=0;
- }
- $line{aqbooksellerid} =$suppliers[$i]->{'id'};
- $line{name} = $suppliers[$i]->{'name'};
- $line{active} = $suppliers[$i]->{'active'};
- my @loop_basket;
- for (my $i2=0;$i2<$ordcount;$i2++){
- my %inner_line;
- $inner_line{basketno} =$orders->[$i2]->{'basketno'};
- $inner_line{total} =$orders->[$i2]->{'count(*)'};
- $inner_line{authorisedby} = $orders->[$i2]->{'authorisedby'};
- $inner_line{creationdate} = format_date($orders->[$i2]->{'creationdate'});
- $inner_line{closedate} = format_date($orders->[$i2]->{'closedate'});
- push @loop_basket, \%inner_line;
- }
- $line{loop_basket} = \@loop_basket;
- push @loop_suppliers, \%line;
-}
-$template->param(loop_suppliers => \@loop_suppliers,
- supplier => $supplier,
- count => $count);
-
-output_html_with_http_headers $query, $cookie, $template->output;
+++ /dev/null
-#!/usr/bin/perl
-
-
-use strict;
-use CGI;
-use C4::Koha;
-use C4::Auth;
-use C4::Date;
-use C4::Output;
-use C4::Bull;
-use C4::Acquisition;
-use C4::Interface::CGI::Output;
-use C4::Context;
-use HTML::Template;
-use C4::Bull;
-use C4::Letters;
-
-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,
- $dow, $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, $notes, $letter);
-
- my @budgets;
-my ($template, $loggedinuser, $cookie)
-= get_template_and_user({template_name => "bull/subscription-add.tmpl",
- query => $query,
- type => "intranet",
- authnotrequired => 0,
- flagsrequired => {catalogue => 1},
- debug => 1,
- });
-
-
-#FIXME : If Budgets are never used, then these lines are useless.
-$dbh = C4::Context->dbh;
-my $sthtemp = $dbh->prepare("Select flags, branchcode from borrowers where borrowernumber = ?");
-$sthtemp->execute($loggedinuser);
-my ($flags, $homebranch)=$sthtemp->fetchrow;
-#FIXME : END added by hdl on July,14 2005
-
-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'};
- $bookfundid = $subs->{'bookfundid'};
- $aqbudgetid = $subs->{'aqbudgetid'};
- defined $aqbudgetid or $aqbudgetid='';
- $startdate = $subs->{'startdate'};
- $periodicity = $subs->{'periodicity'};
- $dow = $subs->{'dow'};
- $numberlength = $subs->{'numberlength'};
- $weeklength = $subs->{'weeklength'};
- $monthlength = $subs->{'monthlength'};
- $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'},
- $notes = $subs->{'notes'};
- $letter = $subs->{'letter'};
- defined $letter or $letter='';
- $template->param(
- $op => 1,
- user => $auser,
- librarian => $librarian,
- aqbooksellerid => $aqbooksellerid,
- aqbooksellername => $aqbooksellername,
- cost => $cost,
- aqbudgetid => $aqbudgetid,
- bookfundid => $bookfundid,
- startdate => format_date($startdate),
- periodicity => $periodicity,
- dow => $dow,
- numberlength => $numberlength,
- weeklength => $weeklength,
- monthlength => $monthlength,
- 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,
- notes => $notes,
- letter => $letter,
- subscriptionid => $subscriptionid,
- );
- $template->param(
- "periodicity$periodicity" => 1,
- "dow$dow" => 1,
- );
-}
-##FIXME : Looks like never used.
-(my $temp,@budgets) = bookfunds($homebranch);
-# find default value & set it for the template
-for (my $i=0;$i<$#budgets;$i++) {
- if ($budgets[$i]->{'aqbudgetid'} eq $aqbudgetid) {
- $budgets[$i]->{'selected'}=1;
- }
-}
-$template->param(budgets => \@budgets);
-#FIXME : END Added by hdl on July, 14 2005
-
-my @letterlist = GetLetterList('serial');
-for (my $i=0;$i<=$#letterlist;$i++) {
- $letterlist[$i]->{'selected'} =1 if $letterlist[$i]->{'code'} eq $letter;
-}
-$template->param(letters => \@letterlist);
-
-if ($op eq 'addsubscription') {
- 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 $periodicity = $query->param('periodicity');
- my $dow = $query->param('dow');
- my $numberlength = $query->param('numberlength');
- my $weeklength = $query->param('weeklength');
- my $monthlength = $query->param('monthlength');
- 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 $notes = $query->param('notes');
- my $letter = $query->param('letter');
- my $subscriptionid = newsubscription($auser,$aqbooksellerid,$cost,$aqbudgetid,$biblionumber,
- $startdate,$periodicity,$dow,$numberlength,$weeklength,$monthlength,
- $add1,$every1,$whenmorethan1,$setto1,$lastvalue1,
- $add2,$every2,$whenmorethan2,$setto2,$lastvalue2,
- $add3,$every3,$whenmorethan3,$setto3,$lastvalue3,
- $numberingmethod, $status, $notes, $letter
- );
- print $query->redirect("/cgi-bin/koha/bull/subscription-detail.pl?subscriptionid=$subscriptionid");
-} else {
- output_html_with_http_headers $query, $cookie, $template->output;
-}
+++ /dev/null
-#!/usr/bin/perl
-# WARNING: 4-character tab stops here
-
-# Copyright 2000-2002 Katipo Communications
-#
-# This file is part of Koha.
-#
-# Koha is free software; you can redistribute it and/or modify it under the
-# terms of the GNU General Public License as published by the Free Software
-# Foundation; either version 2 of the License, or (at your option) any later
-# version.
-#
-# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
-# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
-# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along with
-# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
-# Suite 330, Boston, MA 02111-1307 USA
-
-use strict;
-require Exporter;
-use CGI;
-use C4::Koha;
-use C4::Auth;
-use HTML::Template;
-use C4::Context;
-use C4::Output;
-use C4::Interface::CGI::Output;
-use C4::SearchMarc;
-
-my $query=new CGI;
-my $type=$query->param('type');
-my $op = $query->param('op');
-my $dbh = C4::Context->dbh;
-
-my $startfrom=$query->param('startfrom');
-$startfrom=0 if(!defined $startfrom);
-my ($template, $loggedinuser, $cookie);
-my $resultsperpage;
-
-if ($op eq "do_search") {
- my @marclist = $query->param('marclist');
- my @and_or = $query->param('and_or');
- my @excluding = $query->param('excluding');
- my @operator = $query->param('operator');
- my @value = $query->param('value');
-
- $resultsperpage= $query->param('resultsperpage');
- $resultsperpage = 19 if(!defined $resultsperpage);
- my $orderby = $query->param('orderby');
-
- # builds tag and subfield arrays
- my @tags;
-
- foreach my $marc (@marclist) {
- if ($marc) {
- my ($tag,$subfield) = MARCfind_marc_from_kohafield($dbh,$marc);
- if ($tag) {
- push @tags,$dbh->quote("$tag$subfield");
- } else {
- push @tags, $dbh->quote(substr($marc,0,4));
- }
- } else {
- push @tags, "";
- }
- }
- my ($results,$total) = catalogsearch($dbh, \@tags,\@and_or,
- \@excluding, \@operator, \@value,
- $startfrom*$resultsperpage, $resultsperpage,$orderby);
-
- ($template, $loggedinuser, $cookie)
- = get_template_and_user({template_name => "bull/result.tmpl",
- query => $query,
- type => "intranet",
- authnotrequired => 0,
- flagsrequired => {borrowers => 1},
- flagsrequired => {catalogue => 1},
- debug => 1,
- });
-
- # multi page display gestion
- my $displaynext=0;
- my $displayprev=$startfrom;
- if(($total - (($startfrom+1)*($resultsperpage))) > 0 ){
- $displaynext = 1;
- }
-
- my @field_data = ();
-
-
- for(my $i = 0 ; $i <= $#marclist ; $i++)
- {
- push @field_data, { term => "marclist", val=>$marclist[$i] };
- push @field_data, { term => "and_or", val=>$and_or[$i] };
- push @field_data, { term => "excluding", val=>$excluding[$i] };
- push @field_data, { term => "operator", val=>$operator[$i] };
- push @field_data, { term => "value", val=>$value[$i] };
- }
-
- my @numbers = ();
-
- if ($total>$resultsperpage)
- {
- for (my $i=1; $i<$total/$resultsperpage+1; $i++)
- {
- if ($i<16)
- {
- my $highlight=0;
- ($startfrom==($i-1)) && ($highlight=1);
- push @numbers, { number => $i,
- highlight => $highlight ,
- searchdata=> \@field_data,
- startfrom => ($i-1)};
- }
- }
- }
-
- my $from = $startfrom*$resultsperpage+1;
- my $to;
-
- if($total < (($startfrom+1)*$resultsperpage))
- {
- $to = $total;
- } else {
- $to = (($startfrom+1)*$resultsperpage);
- }
- $template->param(result => $results,
- startfrom=> $startfrom,
- displaynext=> $displaynext,
- displayprev=> $displayprev,
- resultsperpage => $resultsperpage,
- startfromnext => $startfrom+1,
- startfromprev => $startfrom-1,
- searchdata=>\@field_data,
- total=>$total,
- from=>$from,
- to=>$to,
- numbers=>\@numbers,
- );
-} else {
- ($template, $loggedinuser, $cookie)
- = get_template_and_user({template_name => "bull/search.tmpl",
- query => $query,
- type => "intranet",
- authnotrequired => 0,
- flagsrequired => {catalogue => 1},
- debug => 1,
- });
- my $sth=$dbh->prepare("Select itemtype,description from itemtypes order by description");
- $sth->execute;
- my @itemtype;
- my %itemtypes;
- push @itemtype, "";
- $itemtypes{''} = "";
- while (my ($value,$lib) = $sth->fetchrow_array) {
- push @itemtype, $value;
- $itemtypes{$value}=$lib;
- }
-
- my $CGIitemtype=CGI::scrolling_list( -name => 'value',
- -values => \@itemtype,
- -labels => \%itemtypes,
- -size => 1,
- -multiple => 0 );
- $sth->finish;
-
- $template->param(
- CGIitemtype => $CGIitemtype,
- );
-}
-
-
-# Print the page
-output_html_with_http_headers $query, $cookie, $template->output;
-
-# Local Variables:
-# tab-width: 4
-# End:
+++ /dev/null
-#!/usr/bin/perl
-
-use strict;
-use CGI;
-use C4::Auth;
-use C4::Koha;
-use C4::Date;
-use C4::Bull;
-use C4::Output;
-use C4::Interface::CGI::Output;
-use C4::Context;
-use HTML::Template;
-
-my $query = new CGI;
-my $op = $query->param('op') || '';
-my $dbh = C4::Context->dbh;
-my $sth;
-# my $id;
-my ($template, $loggedinuser, $cookie, $subs, $user, $sessionID, $flags);
-my ($subscriptionid,$auser,$librarian,$cost,$aqbooksellerid, $aqbooksellername,$aqbudgetid, $bookfundid, $startdate, $periodicity,
- $dow, $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, $notes,$letter);
-
-$subscriptionid = $query->param('subscriptionid');
-
-if ($op eq 'modsubscription') {
- $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'));
- $periodicity = $query->param('periodicity');
- $dow = $query->param('dow');
- $numberlength = $query->param('numberlength');
- $weeklength = $query->param('weeklength');
- $monthlength = $query->param('monthlength');
- $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;
- $notes = $query->param('notes');
- $letter = $query->param('letter');
-
- &modsubscription($auser,$aqbooksellerid,$cost,$aqbudgetid,$startdate,
- $periodicity,$dow,$numberlength,$weeklength,$monthlength,
- $add1,$every1,$whenmorethan1,$setto1,$lastvalue1,$innerloop1,
- $add2,$every2,$whenmorethan2,$setto2,$lastvalue2,$innerloop2,
- $add3,$every3,$whenmorethan3,$setto3,$lastvalue3,$innerloop3,
- $numberingmethod, $status, $biblionumber, $notes, $letter, $subscriptionid);
-}
-
-if ($op eq 'del') {
- &delsubscription($subscriptionid);
- print "Content-Type: text/html\n\n<META HTTP-EQUIV=Refresh CONTENT=\"0; URL=../bull-home.pl\"></html>";
- exit;
-
-}
-$subs = &getsubscription($subscriptionid);
-# html'ize distributedto
-$subs->{distributedto}=~ s/\n/<br \/>/g;
-my ($totalissues,@serialslist) = getserials($subscriptionid);
-$totalissues-- if $totalissues; # the -1 is to have 0 if this is a new subscription (only 1 issue)
-
-($template, $loggedinuser, $cookie)
-= get_template_and_user({template_name => "bull/subscription-detail.tmpl",
- query => $query,
- type => "intranet",
- authnotrequired => 0,
- flagsrequired => {catalogue => 1},
- debug => 1,
- });
-
-($user, $cookie, $sessionID, $flags) = checkauth($query, 0, {catalogue => 1}, "intranet");
-
-$template->param(
- 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}),
- periodicity => $subs->{periodicity},
- dow => $subs->{dow},
- numberlength => $subs->{numberlength},
- weeklength => $subs->{weeklength},
- monthlength => $subs->{monthlength},
- 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},
- numberingmethod => $subs->{numberingmethod},
- status => $subs->{status},
- biblionumber => $subs->{biblionumber},
- bibliotitle => $subs->{bibliotitle},
- notes => $subs->{notes},
- letter => $subs->{letter},
- distributedto => $subs->{distributedto},
- subscriptionid => $subs->{subscriptionid},
- serialslist => \@serialslist,
- totalissues => $totalissues,
- );
-$template->param(
- "periodicity$subs->{periodicity}" => 1,
- "arrival$subs->{dow}" => 1,
- );
-
-output_html_with_http_headers $query, $cookie, $template->output;
+++ /dev/null
-#!/usr/bin/perl
-
-use strict;
-use CGI;
-use C4::Auth;
-use C4::Bull;
-use C4::Output;
-use C4::Interface::CGI::Output;
-use C4::Context;
-use HTML::Template;
-
-my $query = new CGI;
-my $op = $query->param('op');
-my $dbh = C4::Context->dbh;
-my $sth;
-my $id;
-my ($template, $loggedinuser, $cookie, $subs);
-
-if ($op eq 'modsubscription') {
- &modsubscription($query->param('suscr'),$query->param('user'),$query->param('cost'),
- $query->param('supplier'),$query->param('budget'),$query->param('begin'),
- $query->param('frequency'),$query->param('arrival'),$query->param('numberlength'),
- $query->param('weeklength'),$query->param('monthlength'),
- $query->param('X'),$query->param('Xstate'),$query->param('Xfreq'),$query->param('Xstep'),
- $query->param('Y'),$query->param('Ystate'),$query->param('Yfreq'),$query->param('Ystep'),
- $query->param('Z'),$query->param('Zstate'),$query->param('Zfreq'),$query->param('Zstep'),
- $query->param('sequence'),$query->param('arrivalplanified'),1,
- $query->param('biblioid'),$query->param('notes')
- );
-
- ($template, $loggedinuser, $cookie)
- = get_template_and_user({template_name => "bull/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");
- warn "user =>".$query->param('user'),
- "librarian =>".$query->param('user'),
- "aqbooksellerid =>". $query->param('supplier'),
- "cost =>". $query->param('cost'),
- "aqbudgetid =>". $query->param('budget'),
- "startdate =>". $query->param('begin'),
- "frequency =>". $query->param('frequency'),
- "arrival =>". $query->param('dow'),
- "numberlength =>". $query->param('numberlength'),
- "weeklength =>". $query->param('weeklength'),
- "monthlength =>". $query->param('monthlength'),
- "seqnum1 =>". $query->param('X'),
- "startseqnum1 =>". $query->param('X'),
- "seqtype1 =>". $query->param('Xstate'),
- "freq1 =>". $query->param('Xfreq'),
- "step1 =>". $query->param('Xstep'),
- "seqnum2 =>". $query->param('Y'),
- "startseqnum2 =>". $query->param('Y'),
- "seqtype2 =>". $query->param('Ystate'),
- "freq2 =>". $query->param('Yfreq'),
- "step2 =>". $query->param('Ystep'),
- "seqnum3 =>". $query->param('Z'),
- "startseqnum3 =>". $query->param('Z'),
- "seqtype3 =>". $query->param('Zstate'),
- "freq3 =>". $query->param('Zfreq'),
- "step3 =>". $query->param('Zstep'),
- "sequence =>". $query->param('sequence'),
- "arrivalplanified =>". $query->param('arrivalplanified'),
- "status =>". $query->param('status'),
- "biblioid =>". $query->param('perioid'),
- "notes =>". $query->param('notes'),
- "suscr =>". $query->param('id');
- $template->param(
- user => $query->param('user'),
- librarian => $query->param('user'),
- aqbooksellerid => $query->param('supplier'),
- cost => $query->param('cost'),
- aqbudgetid => $query->param('budget'),
- startdate => $query->param('begin'),
- frequency => $query->param('frequency'),
- arrival => $query->param('dow'),
- numberlength => $query->param('numberlength'),
- weeklength => $query->param('weeklength'),
- monthlength => $query->param('monthlength'),
- seqnum1 => $query->param('X'),
- startseqnum1 => $query->param('X'),
- seqtype1 => $query->param('Xstate'),
- freq1 => $query->param('Xfreq'),
- step1 => $query->param('Xstep'),
- seqnum2 => $query->param('Y'),
- startseqnum2 => $query->param('Y'),
- seqtype2 => $query->param('Ystate'),
- freq2 => $query->param('Yfreq'),
- step2 => $query->param('Ystep'),
- seqnum3 => $query->param('Z'),
- startseqnum3 => $query->param('Z'),
- seqtype3 => $query->param('Zstate'),
- freq3 => $query->param('Zfreq'),
- step3 => $query->param('Zstep'),
- sequence => $query->param('sequence'),
- arrivalplanified => $query->param('arrivalplanified'),
- status => $query->param('status'),
- biblioid => $query->param('perioid'),
- notes => $query->param('notes'),
- suscr => $query->param('id'));
-
-
- $template->param(
- "frequency$query->param('frequency')" => 1,
- "Xstate".$query->param('Xstate') => 1,
- "Ystate".$query->param('Ystate') => 1,
- "Zstate".$query->param('Zstate') => 1,
- "arrival".query->param('$dow') => 1,
- );
-
- } else {
- $sth = $dbh->prepare('select * from subscription where subscriptionid = ?');
- $id = $query->param('suscr');
- $sth->execute($id);
- $subs = $sth->fetchrow_hashref;
- $sth->finish;
-
- ($template, $loggedinuser, $cookie)
- = get_template_and_user({template_name => "bull/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");
- $template->param(user => $user);
- $template->param(librarian => $subs->{'librarian'},
- aqbooksellerid => $subs->{'aqbooksellerid'},
- cost => $subs->{'cost'},
- aqbudgetid => $subs->{'aqbudgetid'},
- startdate => $subs->{'startdate'},
- frequency => $subs->{'periodicity'},
- arrival => $subs->{'dow'},
- numberlength => $subs->{'numberlength'},
- weeklength => $subs->{'weeklength'},
- monthlength => $subs->{'monthlength'},
- seqnum1 => $subs->{'seqnum1'},
- startseqnum1 => $subs->{'startseqnum1'},
- seqtype1 => $subs->{'seqtype1'},
- freq1 => $subs->{'freq1'},
- step1 => $subs->{'step1'},
- seqnum2 => $subs->{'seqnum2'},
- startseqnum2 => $subs->{'startseqnum2'},
- seqtype2 => $subs->{'seqtype2'},
- freq2 => $subs->{'freq2'},
- step2 => $subs->{'step2'},
- seqnum3 => $subs->{'seqnum3'},
- startseqnum3 => $subs->{'startseqnum3'},
- seqtype3 => $subs->{'seqtype3'},
- freq3 => $subs->{'freq3'},
- step3 => $subs->{'step3'},
- sequence => $subs->{'numberingmethod'},
- arrivalplanified => $subs->{'arrivalplanified'},
- status => $subs->{'status'},
- biblioid => $subs->{'perioid'},
- notes => $subs->{'notes'},
- suscr => $id,
- );
-
- $template->param(
- "frequency$subs->{'periodicity'}" => 1,
- "Xstate$subs->{'seqtype1'}" => 1,
- "Ystate$subs->{'seqtype2'}" => 1,
- "Zstate$subs->{'seqtype3'}" => 1,
- "arrival$subs->{'dow'}" => 1,
- );
-
-}
-
-output_html_with_http_headers $query, $cookie, $template->output;