+++ /dev/null
-#!/usr/bin/perl
-
-# written 20/02/2002 by paul.poulain@free.fr
-
-# 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
-
-
-=head1 NAME
-
-aqbookfund.pl
-
-=head1 DESCRIPTION
-
-script to administer the aqbudget table.
-
-=head1 CGI PARAMETERS
-
-=over 4
-
-=item op
-this script use an C<$op> to know what to do.
-C<op> can be equal to:
-* empty or none of the above values, then
- - the default screen is build (with all records, or filtered datas).
- - the user can clic on add, modify or delete record.
-* add_form, then
- - if primkey exists, this is a modification,so we read the $primkey record
- - builds the add/modify form
-* add_validate, then
- - the user has just send datas, so we create/modify the record
-* delete_confirm, then
- - we delete the record having primkey=$primkey
-
-=cut
-
-use strict;
-# use warnings; FIXME
-use CGI;
-use List::Util qw/min/;
-use C4::Branch; # GetBranches
-use C4::Auth;
-use C4::Koha;
-use C4::Context;
-use C4::Bookfund;
-use C4::Output;
-use C4::Dates;
-use C4::Debug;
-
-my $input = new CGI;
-my $script_name = "/cgi-bin/koha/admin/aqbookfund.pl";
-my $bookfundid = $input->param('bookfundid');
-my $branchcodeid = $input->param('branchcode') || '';
-my $op = $input->param('op') || '';
-my $pagesize = 10;
-
-$bookfundid = uc $bookfundid if $bookfundid;
-
-my ($template, $borrowernumber, $cookie) = get_template_and_user(
- { template_name => "admin/aqbookfund.tmpl",
- query => $input,
- type => "intranet",
- authnotrequired => 0,
- flagsrequired => { parameters => 1 },
- debug => 1,
- }
-);
-
-$template->param(
- action => $script_name,
- script_name => $script_name,
- ($op||'else') => 1,
-);
-
-my $branches = GetBranches;
-
-#-----############# ADD_FORM ##################################
-# called by default. Used to create form to add or modify a record
-if ($op eq 'add_form') {
- #---- if primkey exists, it's a modify action, so read values to modify...
- my $dataaqbookfund;
- if ($bookfundid) {
- $dataaqbookfund = GetBookFund($bookfundid, $branchcodeid);
- $template->param('header-is-modify-p' => 1);
- $template->param('current_branch' => $branchcodeid);
- } else {
- $template->param('header-is-add-p' => 1);
- }
- $template->param(
- 'use-header-flags-p' => 1,
- add_or_modify => $bookfundid ? 1 : 0,
- bookfundid => $bookfundid,
- bookfundname => $dataaqbookfund->{'bookfundname'}
- );
-
- my @branchloop;
- foreach my $branchcode (sort keys %{$branches}) {
- push @branchloop, {
- branchcode => $branchcode,
- branchname => $branches->{$branchcode}->{branchname},
- selected => (defined $bookfundid and defined $dataaqbookfund->{branchcode}
- and $dataaqbookfund->{branchcode} eq $branchcode) ? 1 : 0,
- };
- }
-
- $template->param(branches => \@branchloop);
-
-} # END $OP eq ADD_FORM
-
-#-----############# ADD_VALIDATE ##################################
-# called by add_form, used to insert/modify data in DB
-elsif ($op eq 'add_validate') {
- my $bookfundname = $input->param('bookfundname');
- my $branchcode = $input->param('branchcode') || undef;
- my $number = Countbookfund($bookfundid,$branchcodeid);
- if ($number == 0 ) {
- NewBookFund(
- $bookfundid,
- $input->param('bookfundname'),
- $input->param('branchcode')||''
- );
- }
- print $input->redirect('aqbookfund.pl'); # FIXME: unnecessary redirect
- exit;
-# END $OP eq ADD_VALIDATE
-}
-
-#-----############# MOD_VALIDATE ##################################
-# called by add_form, used to insert/modify data in DB
-elsif ($op eq 'mod_validate') {
- my $bookfundname = $input->param('bookfundname');
- my $branchcode = $input->param('branchcode' ) || undef;
- my $current_branch = $input->param('current_branch') || undef;
- $debug and warn "$bookfundid, $bookfundname, $branchcode";
-
- my $number = Countbookfund($bookfundid,$branchcodeid);
- if ($number < 2) {
- $debug and warn "name :$bookfundname branch:$branchcode";
- ModBookFund($bookfundname,$bookfundid,$current_branch, $branchcode);
- }
- print $input->redirect('aqbookfund.pl'); # FIXME: unnecessary redirect
- exit;
-}
-
-#-----############# DELETE_CONFIRM ##################################
-# called by default form, used to confirm deletion of data in DB
-elsif ($op eq 'delete_confirm') {
- my $data = GetBookFund($bookfundid,$branchcodeid);
- $template->param(bookfundid => $bookfundid);
- $template->param(bookfundname => $data->{'bookfundname'});
- $template->param(branchcode => $data->{'branchcode'});
-}
-# called by delete_confirm, used to effectively confirm deletion of data in DB
-elsif ($op eq 'delete_confirmed') {
- DelBookFund($bookfundid, $branchcodeid);
-}
-else { # DEFAULT
- my ($sth);
- # filters
- my @branchloop;
- foreach my $branchcode (sort keys %{$branches}) {
- my $row = {
- code => $branchcode,
- name => $branches->{$branchcode}->{branchname},
- };
- if (defined $input->param('filter_branchcode')
- and $input->param('filter_branchcode') eq $branchcode) {
- $row->{selected} = 1;
- }
- push @branchloop, $row;
- }
-
- my @bookfundids_loop;
- $sth = GetBookFundsId();
-
- while (my $row = $sth->fetchrow_hashref) {
- if (defined $input->param('filter_bookfundid') and $input->param('filter_bookfundid') eq $row->{bookfundid}){
- $row->{selected} = 1;
- }
- push @bookfundids_loop, $row;
- }
-
- $template->param(
- filter_bookfundids => \@bookfundids_loop,
- filter_branches => \@branchloop,
- filter_bookfundname => $input->param('filter_bookfundname') || undef,
- );
-
- # searching the bookfunds corresponding to our filtering rules
- my @results = SearchBookFund(
- $input->param('filter'),
- $input->param('filter_bookfundid'),
- $input->param('filter_bookfundname'),
- $input->param('filter_branchcode'),
- );
-
- # does the book funds have budgets?
- my @loop_id;
- $sth = GetBookFundsId();
- while (my $row = $sth->fetchrow){
- push @loop_id, $row;
- }
-
- my ($id,%nb_budgets_of);
- foreach $id (@loop_id){
- my $number = Countbookfund($id);
- $nb_budgets_of{$id} = $number;
- }
-
- # pagination informations
- my $page = $input->param('page') || 1;
- my @loop;
-
- my $first = ($page - 1) * $pagesize;
-
- # if we are on the last page, the number of the last word to display
- # must not exceed the length of the results array
- my $last = min(
- $first + $pagesize - 1,
- scalar(@results) - 1,
- );
-
- foreach my $result (@results[$first .. $last]) {
- push @loop, {
- %{$result},
- branchname => $branches->{ $result->{branchcode} }->{branchname},
- has_budgets => defined $nb_budgets_of{ $result->{bookfundid} },
- };
- }
-
- $template->param(
- bookfund => \@loop,
- pagination_bar => pagination_bar(
- $script_name,
- getnbpages(scalar @results, $pagesize),
- $page,
- 'page'
- )
- );
-}
-
-output_html_with_http_headers $input, $cookie, $template->output;
+++ /dev/null
-#!/usr/bin/perl
-
-#script to administer the aqbudget table
-#written 20/02/2002 by paul.poulain@free.fr
-# This software is placed under the gnu General Public License, v2 (http://www.gnu.org/licenses/gpl.html)
-
-# ALGO :
-# this script use an $op to know what to do.
-# if $op is empty or none of the above values,
-# - the default screen is build (with all records, or filtered datas).
-# - the user can clic on add, modify or delete record.
-# if $op=add_form
-# - if primkey exists, this is a modification,so we read the $primkey record
-# - builds the add/modify form
-# if $op=add_validate
-# - the user has just send datas, so we create/modify the record
-# if $op=delete_form
-# - we show the record having primkey=$primkey and ask for deletion validation form
-# if $op=delete_confirm
-# - we delete the record having primkey=$primkey
-
-
-# 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 warnings; FIXME
-use CGI;
-use C4::Branch; # GetBranches
-use List::Util qw/min/;
-use C4::Dates qw/format_date format_date_in_iso/;
-use C4::Auth;
-use C4::Acquisition;
-use C4::Context;
-use C4::Output;
-use C4::Koha;
-
-my $input = new CGI;
-my $script_name="/cgi-bin/koha/admin/aqbudget.pl";
-my $bookfundid = $input->param('bookfundid');
-my $aqbudgetid = $input->param('aqbudgetid');
-my $branchcodeid = $input->param('branchcode');
-my $op = $input->param('op') || '';
-my $pagesize = 20;
-
-my ($template, $borrowernumber, $cookie)
- = get_template_and_user(
- {template_name => "admin/aqbudget.tmpl",
- query => $input,
- type => "intranet",
- authnotrequired => 0,
- flagsrequired => {parameters => 1},
- debug => 1,
- }
- );
-
-$template->param(
- action => $script_name,
- DHTMLcalendar_dateformat => C4::Dates->DHTMLcalendar(),
- script_name => $script_name,
- $op || 'else' => 1,
-);
-
-my $dbh = C4::Context->dbh;
-my $sthtemp = $dbh->prepare("Select flags, branchcode from borrowers where borrowernumber = ?");
-$sthtemp->execute($borrowernumber);
-my ($flags, $homebranch)=$sthtemp->fetchrow;
-
-################## ADD_FORM ##################################
-# called by default. Used to create form to add or modify a record
-if ($op eq 'add_form') {
- my ($query, $dataaqbudget, $dataaqbookfund, $sth);
- #---- if primkey exists, it's a modify action, so read values to modify...
- if ($aqbudgetid) {
- $query = '
-SELECT aqbudgetid,
- bookfundname,
- aqbookfund.bookfundid,
- startdate,
- enddate,
- budgetamount,
- aqbudget.branchcode
- FROM aqbudget
- INNER JOIN aqbookfund ON (aqbudget.bookfundid = aqbookfund.bookfundid)
- WHERE aqbudgetid = ? AND
- (aqbookfund.branchcode = aqbudget.branchcode OR
- (aqbudget.branchcode IS NULL and aqbookfund.branchcode=""))
-';
- $sth=$dbh->prepare($query);
- $sth->execute($aqbudgetid);
- $dataaqbudget=$sth->fetchrow_hashref;
- }
-
- $query = '
-SELECT aqbookfund.branchcode,
- branches.branchname,
- aqbookfund.bookfundname
- FROM aqbookfund
- LEFT JOIN branches ON aqbookfund.branchcode = branches.branchcode
- WHERE bookfundid = ? AND aqbookfund.branchcode=?
-';
- $sth=$dbh->prepare($query);
- $sth->execute(
- defined $aqbudgetid ? $dataaqbudget->{bookfundid} : $bookfundid,
- $branchcodeid
- );
- $dataaqbookfund=$sth->fetchrow_hashref;
-
- if (defined $aqbudgetid) {
- $template->param(
- bookfundid => $dataaqbudget->{'bookfundid'},
- branchcode => $dataaqbudget->{'branchcode'},
- bookfundname => $dataaqbudget->{'bookfundname'}
- );
- }
- else {
- $template->param(
- bookfundid => $bookfundid,
- branchcode => $dataaqbookfund->{'branchcode'},
- bookfundname => $dataaqbookfund->{bookfundname},
- );
- }
-
- # Available branches
- my @branches = ();
-
- $query = '
-SELECT branchcode,
- branchname
- FROM branches
- ORDER BY branchname
-';
- $sth=$dbh->prepare($query);
- $sth->execute();
- while (my $row = $sth->fetchrow_hashref) {
- my $branch = $row;
-
- if (defined $dataaqbookfund->{branchcode}) {
- $branch->{selected} =
- $dataaqbookfund->{branchcode} eq $row->{branchcode} ? 1 : 0;
- }
- elsif (defined $aqbudgetid) {
- $branch->{selected} =
- $dataaqbudget->{branchcode} eq $row->{branchcode} ? 1 : 0;
- }
- push @branches, $branch;
- }
-
- $template->param(
- dateformat => C4::Dates->new()->visual(),
- aqbudgetid => $dataaqbudget->{'aqbudgetid'},
- startdate => format_date($dataaqbudget->{'startdate'}),
- enddate => format_date($dataaqbudget->{'enddate'}),
- budgetamount => $dataaqbudget->{'budgetamount'},
- branches => \@branches,
- );
-
- if ( $dataaqbookfund->{branchcode}) {
- $template->param(
- disable_branchselection => 1,
- branch => $dataaqbookfund->{branchcode},
- );
- }
- # END $OP eq ADD_FORM
-################## ADD_VALIDATE ##################################
-# called by add_form, used to insert/modify data in DB
-} elsif ($op eq 'add_validate') {
- my ($query, $sth);
-
- if (defined $aqbudgetid) {
- $query = '
-UPDATE aqbudget
- SET bookfundid = ?,
- startdate = ?,
- enddate = ?,
- budgetamount = ?,
- branchcode = ?
- WHERE aqbudgetid = ?
-';
- $sth=$dbh->prepare($query);
- $sth->execute(
- $input->param('bookfundid'),
- format_date_in_iso($input->param('startdate')),
- format_date_in_iso($input->param('enddate')),
- $input->param('budgetamount'),
- $input->param('branch') || '',
- $aqbudgetid,
- );
- }
- else {
- $query = '
-INSERT
- INTO aqbudget
- (bookfundid, startdate, enddate, budgetamount, branchcode)
- VALUES
- (?, ?, ?, ?, ?)
-';
- $sth=$dbh->prepare($query);
- $sth->execute(
- $input->param('bookfundid'),
- format_date_in_iso($input->param('startdate')),
- format_date_in_iso($input->param('enddate')),
- $input->param('budgetamount'),
- $input->param('branch') || '',
- );
- }
-
- print $input->redirect("aqbudget.pl"); # FIXME: unnecessary redirect
- exit;
-# END $OP eq ADD_VALIDATE
-################## DELETE_CONFIRM ##################################
-# called by default form, used to confirm deletion of data in DB
-} elsif ($op eq 'delete_confirm') {
- my $sth=$dbh->prepare("select aqbudgetid,bookfundid,startdate,enddate,budgetamount,branchcode from aqbudget where aqbudgetid=?");
- $sth->execute($aqbudgetid);
- my $data=$sth->fetchrow_hashref;
- $template->param(bookfundid => $bookfundid);
- $template->param(aqbudgetid => $data->{'aqbudgetid'});
- $template->param(startdate => format_date($data->{'startdate'}));
- $template->param(enddate => format_date($data->{'enddate'}));
- $template->param(budgetamount => $data->{'budgetamount'});
- # END $OP eq DELETE_CONFIRM
-################## DELETE_CONFIRMED ##################################
-# called by delete_confirm, used to effectively confirm deletion of data in DB
-} elsif ($op eq 'delete_confirmed') {
- my $aqbudgetid=uc($input->param('aqbudgetid'));
- my $sth=$dbh->prepare("delete from aqbudget where aqbudgetid=?");
- $sth->execute($aqbudgetid);
- print $input->redirect("aqbookfund.pl");
- exit;
- # END $OP eq DELETE_CONFIRMED
-################## DEFAULT ##################################
-} else { # DEFAULT
- my ($query, $sth);
-
- # create a look-up table for bookfund names from bookfund ids,
- # instead of having on query per budget
- my %bookfundname_of = ();
- $query = '
-SELECT bookfundid, bookfundname
- FROM aqbookfund
-';
- $sth=$dbh->prepare($query);
- $sth->execute;
- while (my $row = $sth->fetchrow_hashref) {
- $bookfundname_of{ $row->{bookfundid} } = $row->{bookfundname};
- }
-
- # filters
- my $branches = GetBranches();
- my @branchloop;
- foreach my $branchcode (sort keys %{$branches}) {
- my $row = {
- code => $branchcode,
- name => $branches->{$branchcode}->{branchname},
- };
-
- if (defined $input->param('filter_branchcode')
- and $input->param('filter_branchcode') eq $branchcode) {
- $row->{selected} = 1;
- }
- push @branchloop, $row;
- }
-
- my @bookfundids_loop;
- $query = '
-SELECT bookfundid
- FROM aqbookfund
-';
- $sth = $dbh->prepare($query);
- $sth->execute();
- while (my $row = $sth->fetchrow_hashref) {
- if (defined $input->param('filter_bookfundid')
- and $input->param('filter_bookfundid') eq $row->{bookfundid}) {
- $row->{selected} = 1;
- }
- push @bookfundids_loop, $row;
- }
-
- $template->param(
- filter_bookfundids => \@bookfundids_loop,
- filter_branches => \@branchloop,
- filter_amount => $input->param('filter_amount') || undef,
- filter_startdate => $input->param('filter_startdate') || undef,
- filter_enddate => $input->param('filter_enddate') || undef,
- );
-
- my %sign_label_of = (
- '=' => 'equal',
- '>=' => 'superior',
- '<=' => 'inferior',
- );
-
- foreach my $field (qw/startdate enddate amount/) {
- my $param = 'filter_'.$field.'_sign';
-
- foreach my $sign (keys %sign_label_of) {
- if ($input->param($param) eq $sign) {
- $template->param(
- $param.'_'.$sign_label_of{$sign}.'_selected' => 1,
- );
- }
- }
- }
-
- # Search all available budgets
- $query = '
-SELECT aqbudgetid,
- bookfundid,
- startdate,
- enddate,
- budgetamount,
- branchcode
- FROM aqbudget
- WHERE 1 = 1';
-
- my @bindings;
-
- if ($input->param('filter_bookfundid')) {
- $query.= '
- AND bookfundid = ?
-';
- push @bindings, $input->param('filter_bookfundid');
- }
- if ($input->param('filter_branchcode')) {
- $query.= '
- AND branchcode = ?
-';
- push @bindings, $input->param('filter_branchcode');
- }
- if ($input->param('filter_startdate')) {
- $query.= '
- AND startdate '.$input->param('filter_startdate_sign').' ?
-';
- push @bindings, format_date_in_iso($input->param('filter_startdate'));
- }
- if ($input->param('filter_enddate')) {
- $query.= '
- AND enddate '.$input->param('filter_enddate_sign').' ?
-';
- push @bindings, format_date_in_iso($input->param('filter_enddate'));
- }
- if ($input->param('filter_amount')) {
- $query.= '
- AND budgetamount '.$input->param('filter_amount_sign').' ?
-';
- # the amount must be a quantity, with 2 digits after the decimal
- # separator
- $input->param('filter_amount') =~ m{(\d* (?:\.\d{,2})? )}xms;
- my ($amount) = $1;
- push @bindings, $amount;
- }
-
- $query.= '
- ORDER BY bookfundid, aqbudgetid
-';
- $sth = $dbh->prepare($query);
- $sth->execute(@bindings);
- my @results;
- while (my $row = $sth->fetchrow_hashref){
- push @results, $row;
- }
-
- # filter budgets depending on the pagination
- my $page = $input->param('page') || 1;
- my $first = ($page - 1) * $pagesize;
-
- # if we are on the last page, the number of the last word to display
- # must not exceed the length of the results array
- my $last = min(
- $first + $pagesize - 1,
- scalar @results - 1,
- );
-
- my @loop;
- foreach my $result (@results[$first .. $last]) {
- push @loop, {
- %{$result},
- bookfundname => $bookfundname_of{ $result->{'bookfundid'} },
- branchname => $branches->{ $result->{branchcode} }->{branchname},
- startdate => format_date($result->{startdate}),
- enddate => format_date($result->{enddate}),
- };
- }
-
- $template->param(
- budget => \@loop,
- pagination_bar => pagination_bar(
- $script_name,
- getnbpages(scalar @results, $pagesize),
- $page,
- 'page'
- )
- );
-} #---- END $OP eq DEFAULT
-output_html_with_http_headers $input, $cookie, $template->output;
-
+++ /dev/null
-<!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
-<title>Koha › Administration › Funds and Budgets</title>
-<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
-<script type="text/javascript">
-//<![CDATA[
-<!-- TMPL_IF name="add_form" -->
- function toUC(f) {
- f.value=f.value.toUpperCase();
- return true;
- }
-
- function Check(f) {
- var _alertString="";
- var alertString2;
- if (f.bookfundid.value.length==0) {
- _alertString += "- bookfundid missing\n";
- }
- if (f.bookfundname.value.length==0) {
- _alertString += "- bookfundname missing\n";
- }
- if (_alertString.length==0) {
- document.Aform.submit();
- } else {
- alertString2 = "Form not submitted because of the following problem(s)\n";
- alertString2 += "------------------------------------------------------------------------------------\n\n";
- alertString2 += _alertString;
- alert(alertString2);
- }
- }
-<!-- /TMPL_IF -->
- $(document).ready(function() {
- new YAHOO.widget.Button("newfund");
- });
-//]]>
-</script>
-</head>
-<body>
-<!-- TMPL_INCLUDE NAME="header.inc" -->
-<!-- TMPL_INCLUDE NAME="bookfund-admin-search.inc" -->
-
-<div id="breadcrumbs">
- <a href="/cgi-bin/koha/mainpage.pl">Home</a>
-› <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
-› <a href="/cgi-bin/koha/admin/aqbookfund.pl">Funds and Budgets</a>
-<!-- TMPL_IF name="add_form" -->› Add fund<!-- /TMPL_IF -->
-</div>
-
-<div id="doc3" class="yui-t2">
- <div id="bd">
- <div id="yui-main">
- <div class="yui-b">
-
-<!-- TMPL_IF name="else" -->
-<div id="toolbar">
- <ul class="toolbar">
- <li><a id="newfund" href="/cgi-bin/koha/admin/aqbookfund.pl?op=add_form">New Fund</a></li>
-</ul></div>
-<h1>Funds and budgets administration</h1>
- <!-- TMPL_IF NAME="bookfund" -->
-<form action="aqbudget.pl" method="post">
-<table>
- <tr>
- <th>Code</th>
- <th>Name</th>
- <th>Library</th>
- <th colspan="3">Actions</th>
- </tr>
-
- <!-- TMPL_LOOP name="bookfund" -->
- <!-- TMPL_UNLESS NAME="__odd__" -->
- <tr class="highlight">
- <!-- TMPL_ELSE -->
- <tr>
- <!-- /TMPL_UNLESS -->
- <td><!-- TMPL_VAR name="bookfundid" --></td>
- <td><!-- TMPL_VAR name="bookfundname" --></td>
- <td><!-- TMPL_VAR name="branchname" DEFAULT="" --></td>
- <td>
- <a href="<!-- TMPL_VAR name="script_name" -->?op=add_form&bookfundid=<!-- TMPL_VAR name="bookfundid" -->&branchcode=<!-- TMPL_VAR name="branchcode" -->">Edit</a></td><td>
- <a href="<!-- TMPL_VAR name="script_name" -->?op=delete_confirm&bookfundid=<!-- TMPL_VAR name="bookfundid" -->&branchcode=<!-- TMPL_VAR name="branchcode" -->">Delete</a></td><td>
- <a href="aqbudget.pl?op=add_form&bookfundid=<!-- TMPL_VAR name="bookfundid" -->&branchcode=<!-- TMPL_VAR name="branchcode" -->">Add budget</a>
- <!-- TMPL_IF NAME="has_budgets" -->
- <a href="aqbudget.pl?filter_bookfundid=<!-- TMPL_VAR name="bookfundid" -->">Show budgets</a>
- <!-- /TMPL_IF -->
- </td>
- </tr>
- <!-- /TMPL_LOOP --> <!-- bookfund -->
-</table>
-</form>
-
-<div class="paginationBar"><!-- TMPL_VAR NAME="pagination_bar" --></div>
- <!-- /TMPL_IF --> <!-- bookfund -->
-
-<p>
- <a href="aqbudget.pl">Show all budgets</a>
-</p>
-
-<!-- /TMPL_IF --> <!-- else -->
-
-<!-- TMPL_IF name="add_form" -->
-<form action="<!-- TMPL_VAR name="action" -->" name="Aform" method="post">
- <input type="hidden" name="checked" value="0" />
-
-<!-- TMPL_IF name="header-is-modify-p" -->
- <input type="hidden" name="op" value="mod_validate" />
- <input type="hidden" name="current_branch" value="<!-- TMPL_VAR name="current_branch" -->"/>
-<!-- TMPL_ELSIF name="header-is-add-p" -->
- <input type="hidden" name="op" value="add_validate" />
-<!-- /TMPL_IF -->
-
- <fieldset class="rows">
- <legend><!-- TMPL_IF name="header-is-modify-p" -->Modify book fund<!-- TMPL_ELSIF name="header-is-add-p" -->Add book fund<!-- /TMPL_IF -->
- </legend>
-
- <ol>
- <!-- TMPL_IF name="add_or_modify" -->
- <li><span class="label">Fund: </span>
- <input type="hidden" name="bookfundid" id="bookfundid" value="<!-- TMPL_VAR name="bookfundid" -->" />
- <!-- TMPL_VAR name="bookfundid" -->
- </li>
- <!-- TMPL_ELSE -->
- <li><label for="bookfundid">Fund: </label>
- <input type="text" name="bookfundid" id="bookfundid" size="5" maxlength="5" onblur="toUC(this)" />
- </li>
- <!-- /TMPL_IF --> <!-- add_or_modify -->
-
- <li><label for="bookfundname">Name: </label>
- <input type="text" name="bookfundname" id="bookfundname" size="40" maxlength="80" value="<!-- TMPL_VAR name="bookfundname" escape="HTML" -->" />
- </li>
-
- <li><label for="branchcode">Library: </label>
- <select name="branchcode" id="branchcode">
- <option value="">----</option>
- <!-- TMPL_LOOP NAME="branches" -->
- <!-- TMPL_IF NAME="selected" -->
- <option value="<!-- TMPL_VAR NAME="branchcode" -->" selected="selected"><!-- TMPL_VAR NAME="branchname" --></option>
- <!-- TMPL_ELSE -->
- <option value="<!-- TMPL_VAR NAME="branchcode" -->"><!-- TMPL_VAR NAME="branchname" --></option>
- <!-- /TMPL_IF -->
- <!-- /TMPL_LOOP -->
- </select>
- </li>
- </ol>
-
- </fieldset>
-
- <fieldset class="action">
- <input type="button" value="Submit" onclick="Check(this.form); return false;" />
- <a class="cancel" href="/cgi-bin/koha/admin/aqbookfund.pl">Cancel</a>
- </fieldset>
-</form>
-<!-- /TMPL_IF --> <!-- add_form -->
-
-<!-- TMPL_IF name="add_validate" -->
-<h3>Fund added</h3>
-<p>
- <a href="<!-- TMPL_VAR name="action" -->">Return to fund list</a>
-</p>
-<!-- TMPL_ELSIF name="mod_validate" -->
-<h3>Fund modified</h3>
-<p>
- <a href="<!-- TMPL_VAR name="action" -->">Return to fund list</a>
-</p>
-<!-- TMPL_ELSIF name="delete_confirm" -->
-<div class="dialog alert">
-<h3>Confirm Deletion of Fund <em><!-- TMPL_VAR name="bookfundid" --></em></h3>
-<form action="<!-- TMPL_VAR name="action" -->" method="post">
- <input type="hidden" name="op" value="delete_confirmed" />
- <input type="hidden" name="bookfundid" value="<!-- TMPL_VAR name="bookfundid" -->" />
- <input type="hidden" name="branchcode" value="<!-- TMPL_VAR name="branchcode" -->" />
- <table>
- <tr>
- <th scope="row">Fund: </th><td>
- <!-- TMPL_VAR name="bookfundid" --></td></tr>
- <tr>
- <th scope="row">Library: </th><td>
- <!-- TMPL_VAR name="branchcode" --></td></tr>
- <tr>
- <th scope="row">Name: </th><td>
- <!-- TMPL_VAR name="bookfundname" --></td></tr>
- <tr>
- <th scope="row">Group: </th><td>
- <!-- TMPL_VAR name="bookfundgroup" --></td></tr>
- </table>
- <input type="submit" class="approve" value="Yes, Delete this Fund" />
-</form>
-<form action="/cgi-bin/koha/admin/aqbookfund.pl" method="get"><input type="submit" class="deny" value="No, Do not Delete" /></form>
-</div>
-
-<!-- TMPL_ELSIF name="delete_confirmed" -->
-<div class="dialog message"><h3>Data Deleted</h3>
-<form action="<!-- TMPL_VAR name="action" -->" method="get">
- <input type="submit" class="approve" value="OK" />
-</form></div>
-<!-- /TMPL_IF --> <!-- delete_confirmed -->
-
-</div>
-</div>
-<div class="yui-b">
-<!-- TMPL_INCLUDE NAME="admin-menu.inc" -->
-</div>
-</div>
-<!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->
+++ /dev/null
-<!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
-<title>Koha › Administration › <!-- TMPL_IF NAME="else" -->Budgets<!-- /TMPL_IF --><!-- TMPL_IF name="add_form" -->Budgets › <!-- TMPL_IF NAME="aqbudgetid" -->Modify<!-- TMPL_ELSE -->Add<!-- /TMPL_IF --> Budget<!-- /TMPL_IF --><!-- TMPL_IF NAME="add_validate" -->Budgets › Budget Data Recorded<!-- /TMPL_IF --><!-- TMPL_IF name="delete_confirmed" -->Budgets › Budget Deleted<!-- /TMPL_IF --><!-- TMPL_IF name="delete_confirm" -->Budgets › Delete Budget?<!-- /TMPL_IF --></title>
-<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
-<!-- TMPL_INCLUDE NAME="calendar.inc" -->
-<!-- TMPL_IF name="add_form" -->
-<script type="text/javascript">
-//<![CDATA[
- //
- function isNotNull(f,noalert) {
- if (f.value.length ==0) {
- return false;
- }
- return true;
- }
- //
- function toUC(f) {
- var x=f.value.toUpperCase();
- f.value=x;
- return true;
- }
- //
- function isNum(v,maybenull) {
- var n = new Number(v.value);
- if (isNaN(n)) {
- return false;
- }
- if (maybenull==0 && v.value=='') {
- return false;
- }
- return true;
- }
- //
- function isDate(f) {
- var t = Date.parse(f.value);
- if (isNaN(t)) {
- return false;
- }
- }
- //
- function Check(f) {
- var ok=1;
- var _alertString="";
- var alertString2;
- if (f.bookfundid.value.length==0) {
- _alertString += "- bookfundid missing\n";
- }
- if (!(isNotNull(window.document.Aform.budgetamount,1))) {
- _alertString += "- Budget missing\n";
- }
- if (_alertString.length==0) {
- document.Aform.submit();
- } else {
- alertString2 = "Form not submitted because of the following problem(s)\n";
- alertString2 += "------------------------------------------------------------------------------------\n\n";
- alertString2 += _alertString;
- alert(alertString2);
- }
- }
-//]]>
-</script>
-<!-- /TMPL_IF -->
-</head>
-<body>
-<!-- TMPL_INCLUDE NAME="header.inc" -->
-<!-- TMPL_INCLUDE NAME="bookfund-admin-search.inc" -->
-
-<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> › <!-- TMPL_IF NAME="else" -->Budgets<!-- /TMPL_IF --><!-- TMPL_IF name="add_form" --><a href="/cgi-bin/koha/admin/aqbudget.pl">Budgets</a> › <!-- TMPL_IF NAME="aqbudgetid" -->Modify<!-- TMPL_ELSE -->Add<!-- /TMPL_IF --> Budget<!-- /TMPL_IF --><!-- TMPL_IF NAME="add_validate" --><a href="/cgi-bin/koha/admin/aqbudget.pl">Budgets</a> › Budget Data Recorded<!-- /TMPL_IF --><!-- TMPL_IF name="delete_confirmed" --><a href="/cgi-bin/koha/admin/aqbudget.pl">Budgets</a> › Budget Deleted<!-- /TMPL_IF --><!-- TMPL_IF name="delete_confirm" --><a href="/cgi-bin/koha/admin/aqbudget.pl">Budgets</a> › Delete Budget?<!-- /TMPL_IF --></div>
-
-<div id="doc3" class="yui-t2">
-
- <div id="bd">
- <div id="yui-main">
- <div class="yui-b">
-
-
-<!-- TMPL_IF NAME="add_validate" -->
- <div class="dialog message">
- <h3>Budget Data Recorded</h3>
- <form action="<!-- TMPL_VAR name="script_name" -->" method="get"><input type="submit" class="approve" value="OK" /></form></div>
-<!-- /TMPL_IF --> <!-- add_validate -->
-
-<!-- TMPL_IF name="delete_confirmed" -->
- <div class="dialog message"><h3>Budget deleted</h3>
- <form action="<!-- TMPL_VAR name="script_name" -->" method="get"><input type="submit" class="approve" value="OK" /></form></div>
-<!-- /TMPL_IF --> <!-- delete_confirmed -->
-
-
-<!-- TMPL_IF name="else" -->
-<h1>Budgets</h1>
-<form action="/cgi-bin/koha/admin/aqbudget.pl" method="post">
-<fieldset class="rows"><legend>Search Budgets</legend><ol>
- <li><label for="filter_bookfundid"> Fund:</label>
- <select name="filter_bookfundid" id="filter_bookfundid">
- <option value="">----</option>
- <!-- TMPL_LOOP name="filter_bookfundids" -->
- <!-- TMPL_IF NAME="selected" -->
- <option value="<!-- TMPL_VAR name="bookfundid" -->" selected="selected"><!-- TMPL_VAR name="bookfundid" --></option>
- <!-- TMPL_ELSE -->
- <option value="<!-- TMPL_VAR name="bookfundid" -->"><!-- TMPL_VAR name="bookfundid" --></option>
- <!-- /TMPL_IF -->
- <!-- /TMPL_LOOP -->
- </select>
- </li>
- <li><label for="filter_branchcode">Library:</label>
- <select name="filter_branchcode" id="filter_branchcode">
- <option value="">----</option>
- <!-- TMPL_LOOP name="filter_branches" -->
- <!-- TMPL_IF NAME="selected" -->
- <option value="<!-- TMPL_VAR name="code" -->" selected="selected"><!-- TMPL_VAR name="name" --></option>
- <!-- TMPL_ELSE -->
- <option value="<!-- TMPL_VAR name="code" -->"><!-- TMPL_VAR name="name" --></option>
- <!-- /TMPL_IF -->
- <!-- /TMPL_LOOP -->
- </select>
- </li>
- <li><label for="filter_startdate_sign"> Start date:</label>
- <select name="filter_startdate_sign" id="filter_startdate_sign">
- <!-- TMPL_IF NAME="filter_startdate_sign_equal_selected" -->
- <option value="=" selected="selected">=</option>
- <!-- TMPL_ELSE -->
- <option value="=">=</option>
- <!-- /TMPL_IF -->
-
- <!-- TMPL_IF NAME="filter_startdate_sign_superior_selected" -->
- <option value=">=" selected="selected">>=</option>
- <!-- TMPL_ELSE -->
- <option value=">=">>=</option>
- <!-- /TMPL_IF -->
-
- <!-- TMPL_IF NAME="filter_startdate_sign_inferior_selected" -->
- <option value="<=" selected="selected"><=</option>
- <!-- TMPL_ELSE -->
- <option value="<="><=</option>
- <!-- /TMPL_IF -->
- </select>
- <input type="text" size="10" id="filter_startdate" name="filter_startdate" value="<!-- TMPL_VAR Name="filter_startdate" -->" />
- <img src="<!-- TMPL_VAR Name="themelang" -->/lib/calendar/cal.gif" id="filter_startdate_button" alt="Show Calendar" />
- <script type="text/javascript">
-//<![CDATA[
- Calendar.setup(
- {
- inputField : "filter_startdate",
- ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
- button : "filter_startdate_button"
- }
- );
- //]]>
-</script>
- </li>
- <li><label for="filter_enddate_sign"> End date:</label>
- <select name="filter_enddate_sign" id="filter_enddate_sign">
- <!-- TMPL_IF NAME="filter_enddate_sign_equal_selected" -->
- <option value="=" selected="selected">=</option>
- <!-- TMPL_ELSE -->
- <option value="=">=</option>
- <!-- /TMPL_IF -->
-
- <!-- TMPL_IF NAME="filter_enddate_sign_superior_selected" -->
- <option value=">=" selected="selected">>=</option>
- <!-- TMPL_ELSE -->
- <option value=">=">>=</option>
- <!-- /TMPL_IF -->
-
- <!-- TMPL_IF NAME="filter_enddate_sign_inferior_selected" -->
- <option value="<=" selected="selected"><=</option>
- <!-- TMPL_ELSE -->
- <option value="<="><=</option>
- <!-- /TMPL_IF -->
- </select>
- <input type="text" size="10" id="filter_enddate" name="filter_enddate" value="<!-- TMPL_VAR Name="filter_enddate" -->" />
- <img src="<!-- TMPL_VAR Name="themelang" -->/lib/calendar/cal.gif" id="filter_enddate_button" alt="Show Calendar" />
- <script type="text/javascript">
-//<![CDATA[
- Calendar.setup(
- {
- inputField : "filter_enddate",
- ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
- button : "filter_enddate_button"
- }
- );
- //]]>
-</script>
- </li>
- <li><label for="filter_amount_sign"> Budget amount:</label>
- <select name="filter_amount_sign" id="filter_amount_sign">
- <!-- TMPL_IF NAME="filter_amount_sign_equal_selected" -->
- <option value="=" selected="selected">=</option>
- <!-- TMPL_ELSE -->
- <option value="=">=</option>
- <!-- /TMPL_IF -->
-
- <!-- TMPL_IF NAME="filter_amount_sign_superior_selected" -->
- <option value=">=" selected="selected">>=</option>
- <!-- TMPL_ELSE -->
- <option value=">=">>=</option>
- <!-- /TMPL_IF -->
-
- <!-- TMPL_IF NAME="filter_amount_sign_inferior_selected" -->
- <option value="<=" selected="selected"><=</option>
- <!-- TMPL_ELSE -->
- <option value="<="><=</option>
- <!-- /TMPL_IF -->
- </select>
- <input type="text" name="filter_amount" value="<!-- TMPL_VAR NAME="filter_amount" -->" size="8" />
- </li>
- </ol></fieldset>
- <fieldset class="action"><input type="submit" name="filter" value="Search" /></fieldset>
- </form>
-
-<table>
- <tr>
- <th>Fund</th>
- <th>Library</th>
- <th>Start date</th>
- <th>End date</th>
- <th>Budget amount</th>
- <th colspan="2">Actions</th>
- </tr>
-
- <!-- TMPL_LOOP name="budget" -->
- <!-- TMPL_UNLESS name="__odd__" -->
- <tr class="highlight">
- <!-- TMPL_ELSE -->
- <tr>
- <!-- /TMPL_IF -->
- <td><!-- TMPL_VAR NAME="bookfundid" --></td>
- <td><!-- TMPL_VAR NAME="branchname" --></td>
- <td><!-- TMPL_VAR NAME="startdate" --></td>
- <td><!-- TMPL_VAR NAME="enddate" --></td>
- <td><!-- TMPL_VAR NAME="budgetamount" --></td>
- <td>
- <a href="/cgi-bin/koha/admin/aqbudget.pl?op=add_form&aqbudgetid=<!-- TMPL_VAR NAME="aqbudgetid" -->">Edit</a></td><td>
- <a href="/cgi-bin/koha/admin/aqbudget.pl?op=delete_confirm&aqbudgetid=<!-- TMPL_VAR NAME="aqbudgetid" -->">Delete</a>
- </td>
- </tr>
- <!-- /TMPL_LOOP --> <!-- budget -->
-</table>
-
-<div class="paginationBar"><!-- TMPL_VAR NAME="pagination_bar" --></div>
-<!-- /TMPL_IF --> <!-- else -->
-
-<!-- TMPL_IF name="add_form" -->
-
-<form action="/cgi-bin/koha/admin/aqbudget.pl" name="Aform" method="post">
- <fieldset class="rows">
- <legend><!-- TMPL_IF NAME="aqbudgetid" -->Modify<!-- TMPL_ELSE -->Add<!-- /TMPL_IF --> budget</legend>
- <input type="hidden" name="op" value="add_validate" />
- <input type="hidden" name="checked" value="0" />
-
-
- <ol> <li>
- <span class="label">Fund: </span>
- <input type="hidden" name="bookfundid" value="<!-- TMPL_VAR NAME="bookfundid" -->" />
- <!-- TMPL_VAR NAME="bookfundname" -->
- </li>
-
- <li>
- <label for="startdate">Start date (<!-- TMPL_VAR NAME="dateformat" -->): </label>
- <input type="text" size="8" maxlength="10" id="startdate" name="startdate" value="<!-- TMPL_VAR Name="startdate" -->" />
- <img src="<!-- TMPL_VAR Name="themelang" -->/lib/calendar/cal.gif" id="startdate_button" alt="Show Calendar" />
- <script type="text/javascript">
-//<![CDATA[
- Calendar.setup(
- {
- inputField : "startdate",
- ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
- button : "startdate_button"
- }
- );
- //]]>
-</script>
-
- </li>
- <li>
- <label for="enddate">End date (<!-- TMPL_VAR NAME="dateformat" -->): </label>
- <input type="text" size="8" maxlength="10" id="enddate" name="enddate" value="<!-- TMPL_VAR Name="enddate" -->" />
- <img src="<!-- TMPL_VAR Name="themelang" -->/lib/calendar/cal.gif" id="enddate_button" alt="Show Calendar" />
- <script type="text/javascript">
-//<![CDATA[
- Calendar.setup(
- {
- inputField : "enddate",
- ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
- button : "enddate_button"
- }
- );
- //]]>
-</script>
-
- </li>
- <li>
- <label for="budgetamount">Budget amount: </label>
- <input type="text" name="budgetamount" id="budgetamount" value="<!-- TMPL_VAR NAME="budgetamount" -->" size="8" />
-
- </li>
- <li>
- <label for="branch">Library: </label>
-
- <!-- TMPL_IF NAME="disable_branchselection" -->
- <!-- Pierrick's note: I've found that a disabled select was not -->
- <!-- giving its value to Perl :-/ So I use a hidden field trick -->
- <input type="hidden" name="branch" id="branch" value="<!-- TMPL_VAR NAME="branch" -->" />
- <select name="branch" disabled="disabled">
- <!-- TMPL_ELSE -->
- <select name="branch" id="branch">
- <!-- /TMPL_IF -->
-
- <option value="">----</option>
- <!-- TMPL_LOOP NAME="branches" -->
- <!-- TMPL_IF NAME="selected" -->
- <option value="<!-- TMPL_VAR NAME="branchcode" -->" selected="selected"><!-- TMPL_VAR NAME="branchname" --></option>
- <!-- TMPL_ELSE -->
- <option value="<!-- TMPL_VAR NAME="branchcode" -->"><!-- TMPL_VAR NAME="branchname" --></option>
- <!-- /TMPL_IF -->
- <!-- /TMPL_LOOP -->
- </select>
-
- </li></ol>
-
-
- <!-- TMPL_IF NAME="aqbudgetid" -->
- <input type="hidden" name="aqbudgetid" value="<!-- TMPL_VAR NAME="aqbudgetid" -->" />
- <!-- /TMPL_IF -->
-
- </fieldset>
- <fieldset class="action">
- <input type="button" value="Submit" onclick="Check(this.form)" /> <a class="cancel" href="/cgi-bin/koha/admin/aqbudget.pl">Cancel</a>
- </fieldset>
-</form>
-<!-- /TMPL_IF --> <!-- add_form -->
-
-<!-- TMPL_IF name="delete_confirm" -->
- <div class="dialog alert"> <h3>Delete Budget?</h3>
-
- <table>
- <tr>
- <th scope="row">Start date: </th>
- <td><!-- TMPL_VAR NAME="startdate" --></td>
- </tr>
-
- <tr>
- <th scope="row">End date: </th>
- <td><!-- TMPL_VAR NAME="enddate" --></td>
- </tr>
-
- <tr>
- <th scope="row">Budget Amount: </th>
- <td><!-- TMPL_VAR NAME="budgetamount" --></td>
- </tr>
- </table>
-
-<form action="<!-- TMPL_VAR NAME="action" -->" method="post">
-<input type="hidden" name="op" value="delete_confirmed" />
-<input type="hidden" name="aqbudgetid" value="<!-- TMPL_VAR NAME="aqbudgetid" -->" />
-<input type="submit" value="Delete this budget" class="approve" /></form>
-<form action="<!-- TMPL_VAR NAME="action" -->" method="get">
-<input type="submit" class="deny" value="No, Do Not Delete" /></form></div>
-
-<!-- /TMPL_IF -->
-
-</div>
-</div>
-<div class="yui-b">
-<!-- TMPL_INCLUDE NAME="admin-menu.inc" -->
-</div>
-</div>
-<!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->