From 0c020dd8bf6ec6419a05df887756abd3c32b9691 Mon Sep 17 00:00:00 2001 From: tipaul Date: Mon, 23 Apr 2007 16:42:59 +0000 Subject: [PATCH] renaming reserves & branchreserves to pendingreserves and waitingreserves --- circ/currenttransfers.pl | 143 ---------------- circ/pendingreserves.pl | 162 ++++++++++++++++++ ...greservestransfers.pl => transferstodo.pl} | 2 +- .../{branchreserves.pl => waitingreserves.pl} | 2 +- .../prog/en/circ/branchreserves.tmpl | 85 --------- .../prog/en/circ/currenttransfers.tmpl | 61 ------- .../{reserve.tmpl => pendingreserves.tmpl} | 0 ...ervestransfers.tmpl => transferstodo.tmpl} | 0 .../prog/en/circ/waitingreserves.tmpl | 85 +++++++++ .../prog/en/includes/menu-circ.inc | 10 +- 10 files changed, 254 insertions(+), 296 deletions(-) delete mode 100755 circ/currenttransfers.pl create mode 100755 circ/pendingreserves.pl rename circ/{waitingreservestransfers.pl => transferstodo.pl} (98%) rename circ/{branchreserves.pl => waitingreserves.pl} (98%) delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/circ/branchreserves.tmpl delete mode 100755 koha-tmpl/intranet-tmpl/prog/en/circ/currenttransfers.tmpl rename koha-tmpl/intranet-tmpl/prog/en/circ/{reserve.tmpl => pendingreserves.tmpl} (100%) rename koha-tmpl/intranet-tmpl/prog/en/circ/{waitingreservestransfers.tmpl => transferstodo.tmpl} (100%) create mode 100644 koha-tmpl/intranet-tmpl/prog/en/circ/waitingreserves.tmpl diff --git a/circ/currenttransfers.pl b/circ/currenttransfers.pl deleted file mode 100755 index 833cbc3f10..0000000000 --- a/circ/currenttransfers.pl +++ /dev/null @@ -1,143 +0,0 @@ -#!/usr/bin/perl - -# $Id$ - -# 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::Context; -use C4::Output; -use C4::Branch; -use C4::Auth; -use C4::Date; -use C4::Biblio; -use C4::Circulation; -use C4::Members; -use C4::Interface::CGI::Output; -use Date::Calc qw( - Today - Add_Delta_Days - Date_to_Days -); - -use C4::Koha; -use C4::Reserves; - -my $input = new CGI; - -my $theme = $input->param('theme'); # only used if allowthemeoverride is set -my $itemnumber = $input->param('itemnumber'); -my $todaysdate = join "-", &Today; - -# if we have a resturn of the form to delete the transfer, we launch the subrroutine -if ($itemnumber) { - C4::Circulation::Circ2::DeleteTransfer($itemnumber); -} - -my ( $template, $loggedinuser, $cookie ) = get_template_and_user( - { - template_name => "circ/currenttransfers.tmpl", - query => $input, - type => "intranet", - authnotrequired => 0, - flagsrequired => { circulate => 1 }, - debug => 1, - } -); - -# set the userenv branch -my $default = C4::Context->userenv->{'branch'}; - -# get the all the branches for reference -my $branches = GetBranches(); -my @branchesloop; -foreach my $br ( keys %$branches ) { - my @transferloop; - my %branchloop; - $branchloop{'branchname'} = $branches->{$br}->{'branchname'}; - $branchloop{'branchcode'} = $branches->{$br}->{'branchcode'}; - my @gettransfers = - GetTransfersFromTo( $branches->{$br}->{'branchcode'}, $default ); - - if (@gettransfers) { - foreach my $num (@gettransfers) { - my %getransf; - - my ( $sent_year, $sent_month, $sent_day ) = split "-", - $num->{'datesent'}; - $sent_day = ( split " ", $sent_day )[0]; - ( $sent_year, $sent_month, $sent_day ) = - Add_Delta_Days( $sent_year, $sent_month, $sent_day, - C4::Context->preference('TransfersMaxDaysWarning')); - my $calcDate = Date_to_Days( $sent_year, $sent_month, $sent_day ); - my $today = Date_to_Days(&Today); - my $warning = ( $today > $calcDate ); - - if ( $warning > 0 ) { - $getransf{'messcompa'} = 1; - } - my $gettitle = GetBiblioFromItemNumber( $num->{'itemnumber'} ); - my $itemtypeinfo = getitemtypeinfo( $gettitle->{'itemtype'} ); - - $getransf{'title'} = $gettitle->{'title'}; - $getransf{'datetransfer'} = format_date( $num->{'datesent'} ); - $getransf{'biblionumber'} = $gettitle->{'biblionumber'}; - $getransf{'itemnumber'} = $gettitle->{'itemnumber'}; - $getransf{'barcode'} = $gettitle->{'barcode'}; - $getransf{'itemtype'} = $itemtypeinfo->{'description'}; - $getransf{'homebranch'} = $gettitle->{'homebranch'}; - $getransf{'holdingbranch'} = $gettitle->{'holdingbranch'}; - $getransf{'itemcallnumber'} = $gettitle->{'itemcallnumber'}; - - # we check if we have a reserv for this transfer - my @checkreserv = GetReservations( $num->{'itemnumber'} ); - if ( $checkreserv[0] ) { - my $getborrower = - GetMemberDetails( $checkreserv[1] ); - $getransf{'borrowernum'} = $getborrower->{'borrowernumber'}; - $getransf{'borrowername'} = $getborrower->{'surname'}; - $getransf{'borrowerfirstname'} = $getborrower->{'firstname'}; - if ( $getborrower->{'emailaddress'} ) { - $getransf{'borrowermail'} = $getborrower->{'emailaddress'}; - } - $getransf{'borrowerphone'} = $getborrower->{'phone'}; - - } - push( @transferloop, \%getransf ); - } - - # If we have a return of reservloop we put it in the branchloop sequence - $branchloop{'reserv'} = \@transferloop; - } - else { - -# if we don't have a retrun from reservestobranch we unset branchname and branchcode - $branchloop{'branchname'} = 0; - $branchloop{'branchcode'} = 0; - } - push( @branchesloop, \%branchloop ); -} - -$template->param( - branchesloop => \@branchesloop, - show_date => format_date($todaysdate), -); - -output_html_with_http_headers $input, $cookie, $template->output; - diff --git a/circ/pendingreserves.pl b/circ/pendingreserves.pl new file mode 100755 index 0000000000..753b699ad8 --- /dev/null +++ b/circ/pendingreserves.pl @@ -0,0 +1,162 @@ +#!/usr/bin/perl + +# $Id$ + +# 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::Context; +use C4::Output; +use CGI; +use C4::Auth; +use C4::Date; +use C4::Interface::CGI::Output; + +my $input = new CGI; +my $order = $input->param('order'); +my $startdate=$input->param('from'); +my $enddate=$input->param('to'); + +my $theme = $input->param('theme'); # only used if allowthemeoverride is set + +my ( $template, $loggedinuser, $cookie ) = get_template_and_user( + { + template_name => "circ/pendingreserves.tmpl", + query => $input, + type => "intranet", + authnotrequired => 0, + flagsrequired => { circulate => 1 }, + debug => 1, + } +); + +my $duedate; +my $borrowernumber; +my $itemnum; +my $data1; +my $data2; +my $data3; +my $name; +my $phone; +my $email; +my $biblionumber; +my $title; +my $author; + +my @datearr = localtime( time() ); +my $todaysdate = + ( 1900 + $datearr[5] ) . '-' + . sprintf( "%0.2d", ( $datearr[4] + 1 ) ) . '-' + . sprintf( "%0.2d", $datearr[3] ); + +my $dbh = C4::Context->dbh; +my ($sqlorderby, $sqldatewhere) = ("",""); + +$sqldatewhere .= " && reservedate >= " . $dbh->quote($startdate) if ($startdate) ; +$sqldatewhere .= " && reservedate <= " . $dbh->quote($enddate) if ($enddate) ; + +if ($order eq "borrower") { + $sqlorderby = " order by borrower, reservedate"; +} elsif ($order eq "biblio") { + $sqlorderby = " order by biblio.title, priority,reservedate"; +} elsif ($order eq "priority") { + $sqlorderby = "order by priority DESC"; +} else { + $sqlorderby = " order by reservedate, borrower"; +} +my $strsth = +"SELECT reservedate, + reserves.borrowernumber as borrowernumber, + concat(firstname,' ',surname) as borrower, + borrowers.phone, + borrowers.email, + reserves.biblionumber, + reserves.branchcode as branch, + items.holdingbranch, + items.itemcallnumber, + items.itemnumber, + notes, + notificationdate, + reminderdate, + priority, + reserves.found, + biblio.title, + biblio.author + FROM reserves + LEFT JOIN items ON items.biblionumber=reserves.biblionumber, + borrowers,biblio + WHERE isnull(cancellationdate) + && reserves.borrowernumber=borrowers.borrowernumber + && reserves.biblionumber=biblio.biblionumber + && reserves.found is NULL + && items.holdingbranch=? + "; + +$strsth .= $sqlorderby; + +my $sth = $dbh->prepare($strsth); + +$sth->execute(C4::Context->userenv->{'branch'}); + +my @reservedata; +my $previous; +my $this; +while ( my $data = $sth->fetchrow_hashref ) { + $this=$data->{biblionumber}.":".$data->{borrowernumber}; + my @itemlist; + push( + @reservedata, + { + reservedate => $previous eq $this?"":format_date( $data->{reservedate} ), + priority => $previous eq $this?"":$data->{priority}, + name => $previous eq $this?"":$data->{borrower}, + title => $previous eq $this?"":$data->{title}, + author => $previous eq $this?"":$data->{author}, + borrowernumber => $previous eq $this?"":$data->{borrowernumber}, + itemnum => $previous eq $this?"":$data->{itemnumber}, + phone => $previous eq $this?"":$data->{phone}, + email => $previous eq $this?"":$data->{email}, + biblionumber => $previous eq $this?"":$data->{biblionumber}, + statusw => ( $data->{found} eq "w" ), + statusf => ( $data->{found} eq "f" ), + holdingbranch => $data->{holdingbranch}, + branch => $previous eq $this?"":$data->{branch}, + itemcallnumber => $data->{itemcallnumber}, + notes => $previous eq $this?"":$data->{notes}, + notificationdate => $previous eq $this?"":$data->{notificationdate}, + reminderdate => $previous eq $this?"":$data->{reminderdate} + } + ); + $previous=$this; +} + +$sth->finish; + +$template->param( + todaysdate => format_date($todaysdate), + from => $startdate, + to => $enddate, + reserveloop => \@reservedata, + intranetcolorstylesheet => + C4::Context->preference("intranetcolorstylesheet"), + intranetstylesheet => C4::Context->preference("intranetstylesheet"), + IntranetNav => C4::Context->preference("IntranetNav"), + "BiblioDefaultView".C4::Context->preference("BiblioDefaultView") => 1, +); + +output_html_with_http_headers $input, $cookie, $template->output; diff --git a/circ/waitingreservestransfers.pl b/circ/transferstodo.pl similarity index 98% rename from circ/waitingreservestransfers.pl rename to circ/transferstodo.pl index 221c29b433..bb2f8e0882 100755 --- a/circ/waitingreservestransfers.pl +++ b/circ/transferstodo.pl @@ -41,7 +41,7 @@ my $input = new CGI; my ( $template, $loggedinuser, $cookie ) = get_template_and_user( { - template_name => "circ/waitingreservestransfers.tmpl", + template_name => "circ/transferstodo.tmpl", query => $input, type => "intranet", authnotrequired => 0, diff --git a/circ/branchreserves.pl b/circ/waitingreserves.pl similarity index 98% rename from circ/branchreserves.pl rename to circ/waitingreserves.pl index 89a181095f..028f82dae7 100755 --- a/circ/branchreserves.pl +++ b/circ/waitingreserves.pl @@ -52,7 +52,7 @@ my $theme = $input->param('theme'); # only used if allowthemeoverride is set my ( $template, $loggedinuser, $cookie ) = get_template_and_user( { - template_name => "circ/branchreserves.tmpl", + template_name => "circ/waitingreserves.tmpl", query => $input, type => "intranet", authnotrequired => 0, diff --git a/koha-tmpl/intranet-tmpl/prog/en/circ/branchreserves.tmpl b/koha-tmpl/intranet-tmpl/prog/en/circ/branchreserves.tmpl deleted file mode 100644 index a1530f6e09..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/circ/branchreserves.tmpl +++ /dev/null @@ -1,85 +0,0 @@ - -Koha › Circulation - - - - -

Circulation: Branch Reserves

- -
-

Reserves of your library the :

- -
-

Reserve find for the document()must transfered

-

This documen is reserved by : at the library : , Please put this document in transfer . -

-
- -
-
- - -
-

This document is in Waiting status

-

This document () is reserved by : , - Please keep this document for the next reserve . -

-
- -
-
- - -
- - - - - - - - - - - - - - class="problem" > - - - - - - - -
Reserves of your library
Available sinceTitleBorrowerLocalisationAction

Reserve Over
-

- "> -   () -
Barcode : -

-
-

">  

- ?subject=Reservation: "> - -

-

-
- "> - "> - "> - "> - - "> - - - -
-
- - No reserve found. - -
- -
- diff --git a/koha-tmpl/intranet-tmpl/prog/en/circ/currenttransfers.tmpl b/koha-tmpl/intranet-tmpl/prog/en/circ/currenttransfers.tmpl deleted file mode 100755 index 36aa344bdf..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/circ/currenttransfers.tmpl +++ /dev/null @@ -1,61 +0,0 @@ - -Koha › Circulation - - - - -
-

Transfers made TO your library the :

-

You are the destination of this transfer

-
- - - - - - - - - - - - - - - class="problem" > - - - - - - - -
Coming from
Date of transferTitleReserved by LocalisationAction

check this transfer
-

- "> -   ( ) -
Barcode : -

-
- -

">  

- ?subject=Reservation: "> - -

- -

- None -

- -

- "> - - --> -
-

- - -
-
- diff --git a/koha-tmpl/intranet-tmpl/prog/en/circ/reserve.tmpl b/koha-tmpl/intranet-tmpl/prog/en/circ/pendingreserves.tmpl similarity index 100% rename from koha-tmpl/intranet-tmpl/prog/en/circ/reserve.tmpl rename to koha-tmpl/intranet-tmpl/prog/en/circ/pendingreserves.tmpl diff --git a/koha-tmpl/intranet-tmpl/prog/en/circ/waitingreservestransfers.tmpl b/koha-tmpl/intranet-tmpl/prog/en/circ/transferstodo.tmpl similarity index 100% rename from koha-tmpl/intranet-tmpl/prog/en/circ/waitingreservestransfers.tmpl rename to koha-tmpl/intranet-tmpl/prog/en/circ/transferstodo.tmpl diff --git a/koha-tmpl/intranet-tmpl/prog/en/circ/waitingreserves.tmpl b/koha-tmpl/intranet-tmpl/prog/en/circ/waitingreserves.tmpl new file mode 100644 index 0000000000..0f6e451fec --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/circ/waitingreserves.tmpl @@ -0,0 +1,85 @@ + +Koha › Circulation + + + + +

Circulation: Branch Reserves

+ +
+

Reserves of your library the :

+ +
+

Reserve find for the document()must transfered

+

This documen is reserved by : at the library : , Please put this document in transfer . +

+
+ +
+
+ + +
+

This document is in Waiting status

+

This document () is reserved by : , + Please keep this document for the next reserve . +

+
+ +
+
+ + +
+ + + + + + + + + + + + + + class="problem" > + + + + + + + +
Reserves of your library
Available sinceTitleBorrowerLocalisationAction

Reserve Over
+

+ "> +   () +
Barcode : +

+
+

">  

+ ?subject=Reservation: "> + +

+

+
+ "> + "> + "> + "> + + "> + + + +
+
+ + No reserve found. + +
+ +
+ diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/menu-circ.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/menu-circ.inc index 90143c82f8..d2a6d43bd3 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/menu-circ.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/menu-circ.inc @@ -3,11 +3,11 @@ Returns Transfers Set branch - Pending - Waiting - Transfers to do - Transfersto receive - Overdues by branch/department + Pending reserves + Waiting reserves + Transfers to do + Transfers to receive + Overdues Daily reconciliation -- 2.20.1