koha-cvs
[Top][All Lists]
Advanced

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

[Koha-cvs] koha C4/Circulation/Circ2.pm C4/Koha.pm C4/Sear... [rel_3_0]


From: LAURIN arnaud
Subject: [Koha-cvs] koha C4/Circulation/Circ2.pm C4/Koha.pm C4/Sear... [rel_3_0]
Date: Fri, 20 Oct 2006 10:35:06 +0000

CVSROOT:        /sources/koha
Module name:    koha
Branch:         rel_3_0
Changes by:     LAURIN arnaud <alaurin> 06/10/20 10:35:06

Modified files:
        C4/Circulation : Circ2.pm 
        C4             : Koha.pm Search.pm 
        koha-tmpl/intranet-tmpl/prog/en/includes: menu-circ.inc 
                                                  menus.inc 
        updater        : updatedatabase 
Added files:
        circ           : branchoverdues.pl 
        koha-tmpl/intranet-tmpl/prog/en/circ: branchoverdues.tmpl 

Log message:
        new program : branchoverdues.pl
        
        with this program, the librararians will can check , and specify the 
method of notification of documents in overdue
         
        little explanation :
        
                - At first, the datas come from accountlines, generated by 
accounlines (type 'FU')
                - There is three levels of notification (come from overduerules 
....)
                - there is four methods of notification :
                        - letter (for us, use an openoffice program ....)
                        - Mail (use a batch program)
                        - Phone (simple Method, if this method is selected, we 
consider that the borrower as been notified)
                        - Considered Lost (For us the third level)
        
                - At this time we have some parameters hardcoded (Must be 
improve later)
        
                - the choice of methods is hardcoded :
                        - for the first overduelevel : three methods : 
mail,letter,phone
                        -For the second overduelevel :only one method : letter
                        - For the Third Overdue level : only one method : 
Considered Lost
        
        this program will be heavy tested next week ....

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/C4/Circulation/Circ2.pm?cvsroot=koha&only_with_tag=rel_3_0&r1=1.114.2.8&r2=1.114.2.9
http://cvs.savannah.gnu.org/viewcvs/koha/C4/Koha.pm?cvsroot=koha&only_with_tag=rel_3_0&r1=1.40.2.15&r2=1.40.2.16
http://cvs.savannah.gnu.org/viewcvs/koha/C4/Search.pm?cvsroot=koha&only_with_tag=rel_3_0&r1=1.120.2.9&r2=1.120.2.10
http://cvs.savannah.gnu.org/viewcvs/koha/circ/branchoverdues.pl?cvsroot=koha&only_with_tag=rel_3_0&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/koha-tmpl/intranet-tmpl/prog/en/circ/branchoverdues.tmpl?cvsroot=koha&only_with_tag=rel_3_0&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/koha-tmpl/intranet-tmpl/prog/en/includes/menu-circ.inc?cvsroot=koha&only_with_tag=rel_3_0&r1=1.2.2.2&r2=1.2.2.3
http://cvs.savannah.gnu.org/viewcvs/koha/koha-tmpl/intranet-tmpl/prog/en/includes/menus.inc?cvsroot=koha&only_with_tag=rel_3_0&r1=1.6.2.12&r2=1.6.2.13
http://cvs.savannah.gnu.org/viewcvs/koha/updater/updatedatabase?cvsroot=koha&only_with_tag=rel_3_0&r1=1.157.2.12&r2=1.157.2.13

Patches:
Index: C4/Circulation/Circ2.pm
===================================================================
RCS file: /sources/koha/koha/C4/Circulation/Circ2.pm,v
retrieving revision 1.114.2.8
retrieving revision 1.114.2.9
diff -u -b -r1.114.2.8 -r1.114.2.9
--- C4/Circulation/Circ2.pm     17 Oct 2006 09:54:42 -0000      1.114.2.8
+++ C4/Circulation/Circ2.pm     20 Oct 2006 10:35:05 -0000      1.114.2.9
@@ -3,7 +3,7 @@
 
 package C4::Circulation::Circ2;
 
-# $Id: Circ2.pm,v 1.114.2.8 2006/10/17 09:54:42 toins Exp $
+# $Id: Circ2.pm,v 1.114.2.9 2006/10/20 10:35:05 alaurin Exp $
 
 #package to deal with Returns
 #written 3/11/99 by address@hidden
@@ -96,6 +96,9 @@
                &GetTransfersFromBib
                &getBranchIp
                &dotranfer
+               &GetOverduesForBranch
+               &AddNotifyLine
+               &RemoveNotifyLine
         );
 # &GetBranches &getprinters &getbranch &getprinter => moved to C4::Koha.pm
 
@@ -2169,6 +2172,90 @@
        return (@tranferts);
 }
 
+=head2 GetOverduesForBranch
+Sql request for display all information for branchoverdues.pl
+2 possibilities : with or without departement .
+display is filtered by branch
+=cut
+
+sub GetOverduesForBranch {
+       my($branch,$departement) = @_;
+       if (not $departement){
+               my $dbh = C4::Context->dbh;
+               my $sth=$dbh->prepare("
+               SELECT borrowers.surname , borrowers.firstname , biblio.title , 
itemtypes.description ,  issues . date_due  ,  issues . returndate  ,  branches 
. branchname  ,  items . barcode  ,  borrowers . phone  ,  borrowers . email  , 
 items . itemcallnumber  ,  borrowers . borrowernumber  ,  items . itemnumber  
,  biblio . biblionumber  ,  issues . branchcode  ,  accountlines . notify_id  
,  accountlines . notify_level  ,  items . location  ,  accountlines . 
amountoutstanding  FROM  issues   issues  ,  borrowers   borrowers  ,  biblio   
biblio  ,  biblioitems   biblioitems  ,  itemtypes   itemtypes  ,  items   
items  ,  branches   branches  ,  accountlines   accountlines  WHERE ((( issues 
. returndate  is null) AND ( accountlines . amountoutstanding  != '0.000000') 
AND ( accountlines . accounttype  = 'FU'))) AND (( issues . borrowernumber = 
accountlines . borrowernumber ) AND ( issues . itemnumber = accountlines . 
itemnumber ) AND ( borrowers . borrowernumber = issues . borrowernumber ) AND ( 
biblio . biblionumber = biblioitems . biblionumber ) AND ( biblioitems . 
biblionumber = items . biblionumber ) AND ( itemtypes . itemtype = biblioitems 
. itemtype ) AND ( items . itemnumber = issues . itemnumber ) AND ( branches . 
branchcode = issues . branchcode ) ) AND (issues.branchcode = ?)
+AND NOT EXISTS (SELECT * FROM  notifys  WHERE ( accountlines . notify_id  =  
notifys . notify_id ) AND ( accountlines . notify_level  =  notifys . 
notify_level ) AND ( accountlines . itemnumber  =  notifys . itemnumber ) )
+ORDER BY  borrowers . surname 
+               ");
+               $sth->execute($branch);
+               my @getoverdues;
+               my $i=0;
+               while (my $data=$sth->fetchrow_hashref){
+                       $getoverdues[$i]=$data;
+                       $i++;
+               }
+               $sth->finish;
+               return(@getoverdues);
+       }
+       else {
+               my $dbh = C4::Context->dbh;
+               my $sth=$dbh->prepare("
+               SELECT  borrowers . surname  ,  borrowers . firstname  ,  
biblio . title  ,  itemtypes . description  ,  issues . date_due  ,  issues . 
returndate  ,  branches . branchname  ,  items . barcode  ,  borrowers . phone  
,  borrowers . email  ,  items . itemcallnumber  ,  borrowers . borrowernumber  
,  items . itemnumber  ,  biblio . biblionumber  ,  issues . branchcode  ,  
accounlines . notify_id  ,  accounlines . notify_level  ,  items . location  ,  
accounlines . amountoutstanding  FROM  issues   issues  ,  borrowers   
borrowers  ,  biblio   biblio  ,  biblioitems   biblioitems  ,  itemtypes   
itemtypes  ,  items   items  ,  branches   branches  ,  accountlines   
accounlines  WHERE ((( issues . returndate  is null) AND ( accounlines . 
amountoutstanding  != '0.000000') AND ( accounlines . accounttype  = 'FU'))) 
AND (( issues . borrowernumber = accounlines . borrowernumber ) AND ( issues . 
itemnumber = accounlines . itemnumber ) AND ( borrowers . borrowernumber = 
issues . borrowernumber ) AND ( biblio . biblionumber = biblioitems . 
biblionumber ) AND ( biblioitems . biblionumber = items . biblionumber ) AND ( 
itemtypes . itemtype = biblioitems . itemtype ) AND ( items . itemnumber = 
issues . itemnumber ) AND ( branches . branchcode = issues . branchcode ) ) AND 
(issues.branchcode = ? AND items.location = ?)
+AND NOT EXISTS (SELECT * FROM  notifys  WHERE ( accounlines . notify_id  =  
notifys . notify_id ) AND ( accounlines . notify_level  =  notifys . 
notify_level ) AND ( accounlines . itemnumber  =  notifys . itemnumber ) )
+ORDER BY  borrowers . surname 
+               ");
+               $sth->execute($branch,$departement);
+               my @getoverdues;
+               my $i=0;
+               while (my $data=$sth->fetchrow_hashref){
+                       $getoverdues[$i]=$data;
+                       $i++;
+               }
+               $sth->finish;
+               return(@getoverdues);
+       }       
+}
+
+=head2 AddNotifyLine
+Creat a line into notify, if the method is phone, the notification_send_date 
is implemented to
+=cut
+
+sub AddNotifyLine {
+       my($bornum,$itemnumber,$overduelevel,$method,$notifyId) = @_;
+       if ( $method eq "phone") {
+               my $dbh = C4::Context->dbh;
+               my $sth=$dbh->prepare("INSERT INTO notifys 
(borrowernumber,itemnumber,notify_date,notify_send_date,notify_level,method,notify_id)
+               VALUES (?,?,now(),now(),?,?,?)");
+               
$sth->execute($bornum,$itemnumber,$overduelevel,$method,$notifyId);
+               $sth->finish;
+       }
+       else { 
+               my $dbh = C4::Context->dbh;
+               my $sth=$dbh->prepare("INSERT INTO notifys 
(borrowernumber,itemnumber,notify_date,notify_level,method,notify_id)
+               VALUES (?,?,now(),?,?,?)");
+               
$sth->execute($bornum,$itemnumber,$overduelevel,$method,$notifyId);
+               $sth->finish;
+       }
+       return 1;
+}
+
+=head2 RemoveNotifyLine
+Cancel a notification
+=cut
+
+sub RemoveNotifyLine {
+       my($bornum,$itemnumber,$notify_date) = @_;
+       my $dbh = C4::Context->dbh;
+       my $sth=$dbh->prepare("DELETE FROM notifys 
+               WHERE
+               borrowernumber=?
+               AND itemnumber=?
+               AND notify_date=?");
+       $sth->execute($bornum,$itemnumber,$notify_date);
+       $sth->finish;
+       return 1;
+}
+
 1;
 __END__
 

Index: C4/Koha.pm
===================================================================
RCS file: /sources/koha/koha/C4/Koha.pm,v
retrieving revision 1.40.2.15
retrieving revision 1.40.2.16
diff -u -b -r1.40.2.15 -r1.40.2.16
--- C4/Koha.pm  19 Oct 2006 09:00:53 -0000      1.40.2.15
+++ C4/Koha.pm  20 Oct 2006 10:35:05 -0000      1.40.2.16
@@ -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: Koha.pm,v 1.40.2.15 2006/10/19 09:00:53 toins Exp $
+# $Id: Koha.pm,v 1.40.2.16 2006/10/20 10:35:05 alaurin Exp $
 
 use strict;
 require Exporter;
@@ -25,7 +25,7 @@
 use C4::Output;
 use vars qw($VERSION @ISA @EXPORT);
 
-$VERSION = do { my @v = '$Revision: 1.40.2.15 $' =~ /\d+/g; shift(@v) . "." . 
join("_", map {sprintf "%03d", $_ } @v); };
+$VERSION = do { my @v = '$Revision: 1.40.2.16 $' =~ /\d+/g; shift(@v) . "." . 
join("_", map {sprintf "%03d", $_ } @v); };
 
 =head1 NAME
 
@@ -76,6 +76,8 @@
             &get_infos_of
             &get_branchinfos_of
             &get_notforloan_label_of
+            &GetDepartements
+            &GetDepartementLib
             &getitemtypeimagedir
             &getitemtypeimagesrc
             $DEBUG);
@@ -1294,6 +1296,33 @@
     return @languages_options;
 }
 
+
+sub GetDepartements {
+       my $dbh = C4::Context->dbh;
+       my $sth=$dbh->prepare("SELECT authorised_value,lib FROM 
authorised_values WHERE category='DPT'
+       ");
+       $sth->execute;
+       my @getdepartements;
+       my $i=0;
+       while (my $data=$sth->fetchrow_hashref){
+               $getdepartements[$i]=$data;
+               $i++;
+       }
+       $sth->finish;
+       return(@getdepartements);
+       }
+       
+sub GetDepartementLib {
+       my($authorisedvalue) = @_;
+       my $dbh = C4::Context->dbh;
+       my $sth=$dbh->prepare("SELECT lib,authorised_value FROM 
authorised_values WHERE category='DPT' AND authorised_value=?
+       ");
+       $sth->execute($authorisedvalue);
+       my (@lib)=$sth->fetchrow_array;
+       $sth->finish;
+       return(@lib);
+       }
+       
 1;
 __END__
 

Index: C4/Search.pm
===================================================================
RCS file: /sources/koha/koha/C4/Search.pm,v
retrieving revision 1.120.2.9
retrieving revision 1.120.2.10
diff -u -b -r1.120.2.9 -r1.120.2.10
--- C4/Search.pm        16 Oct 2006 12:12:30 -0000      1.120.2.9
+++ C4/Search.pm        20 Oct 2006 10:35:05 -0000      1.120.2.10
@@ -40,7 +40,7 @@
 use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
 
 # set the version for version checking
-$VERSION = do { my @v = '$Revision: 1.120.2.9 $' =~ /\d+/g;
+$VERSION = do { my @v = '$Revision: 1.120.2.10 $' =~ /\d+/g;
           shift(@v) . "." . join("_", map {sprintf "%03d", $_ } @v); };
 
 =head1 NAME
@@ -2248,7 +2248,7 @@
     #called from request.pl
     my ($biblioitemnumber)address@hidden;
     my $dbh = C4::Context->dbh;
-    my $sth=$dbh->prepare("SELECT barcode, itemlost, 
holdingbranch,onloan,itemnumber  FROM items
+    my $sth=$dbh->prepare("SELECT barcode, itemlost, homebranch, 
holdingbranch,itemnumber  FROM items
                            WHERE biblioitemnumber = ?
                              AND (wthdrawn <> 1 OR wthdrawn IS NULL)");
     $sth->execute($biblioitemnumber);

Index: koha-tmpl/intranet-tmpl/prog/en/includes/menu-circ.inc
===================================================================
RCS file: 
/sources/koha/koha/koha-tmpl/intranet-tmpl/prog/en/includes/menu-circ.inc,v
retrieving revision 1.2.2.2
retrieving revision 1.2.2.3
diff -u -b -r1.2.2.2 -r1.2.2.3
--- koha-tmpl/intranet-tmpl/prog/en/includes/menu-circ.inc      26 Sep 2006 
13:13:35 -0000      1.2.2.2
+++ koha-tmpl/intranet-tmpl/prog/en/includes/menu-circ.inc      20 Oct 2006 
10:35:05 -0000      1.2.2.3
@@ -6,6 +6,7 @@
     <a href="/cgi-bin/koha/circ/branchreserves.pl">Waiting reserves</a>
     <a href="/cgi-bin/koha/circ/waitingreservestransfers.pl">Transfers to 
do</a>
     <a href="/cgi-bin/koha/circ/currenttransfers.pl">Transfers to recieve</a>
+    <a href="/cgi-bin/koha/circ/branchoverdues.pl">Check overdues</a>
 </div>
 
 <div id="main">
\ No newline at end of file

Index: koha-tmpl/intranet-tmpl/prog/en/includes/menus.inc
===================================================================
RCS file: 
/sources/koha/koha/koha-tmpl/intranet-tmpl/prog/en/includes/menus.inc,v
retrieving revision 1.6.2.12
retrieving revision 1.6.2.13
diff -u -b -r1.6.2.12 -r1.6.2.13
--- koha-tmpl/intranet-tmpl/prog/en/includes/menus.inc  18 Oct 2006 08:04:19 
-0000      1.6.2.12
+++ koha-tmpl/intranet-tmpl/prog/en/includes/menus.inc  20 Oct 2006 10:35:05 
-0000      1.6.2.13
@@ -20,6 +20,7 @@
        </li>
         <li><a href="/cgi-bin/koha/circ/reserve.pl">Reserve List</a></li>
         <li><a href="/cgi-bin/koha/circ/branchtransfers.pl">Transfers</a></li>
+        <li><a href="/cgi-bin/koha/circ/branchoverdues.pl">Check 
overdues</a></li>
      </ul>
      </li>
      <!-- /TMPL_IF -->

Index: updater/updatedatabase
===================================================================
RCS file: /sources/koha/koha/updater/updatedatabase,v
retrieving revision 1.157.2.12
retrieving revision 1.157.2.13
diff -u -b -r1.157.2.12 -r1.157.2.13
--- updater/updatedatabase      19 Oct 2006 09:04:07 -0000      1.157.2.12
+++ updater/updatedatabase      20 Oct 2006 10:35:05 -0000      1.157.2.13
@@ -1,6 +1,6 @@
 #!/usr/bin/perl
 
-# $Id: updatedatabase,v 1.157.2.12 2006/10/19 09:04:07 toins Exp $
+# $Id: updatedatabase,v 1.157.2.13 2006/10/20 10:35:05 alaurin Exp $
 
 # Database Updater
 # This script checks for required updates to the database.
@@ -195,7 +195,6 @@
                          `notify_send_date` date default NULL,
                          `notify_level` int(1) NOT NULL default '0',
                          `method` varchar(20) NOT NULL default '',
-                         KEY `borrowernumber` (`borrowernumber`,`itemnumber`)
                     )",
 
    charges     => "(
@@ -409,6 +408,13 @@
                        default => '0',
                        extra   => '',
                },
+               {
+                       field   => 'accountno',
+                        type    => 'int(11)',
+                       null    => 'NOT NULL',
+                      extra   => 'auto_increment',
+              },
+                                                                               
                                                                                
                        
        ],
        
        borrowers => [
@@ -1854,6 +1860,31 @@
 exit;
 
 # $Log: updatedatabase,v $
+# Revision 1.157.2.13  2006/10/20 10:35:05  alaurin
+# new program : branchoverdues.pl
+#
+# with this program, the librararians will can check , and specify the method 
of notification of documents in overdue
+#
+# little explanation :
+#
+#      - At first, the datas come from accountlines, generated by accounlines 
(type 'FU')
+#      - There is three levels of notification (come from overduerules ....)
+#      - there is four methods of notification :
+#              - letter (for us, use an openoffice program ....)
+#              - Mail (use a batch program)
+#              - Phone (simple Method, if this method is selected, we consider 
that the borrower as been notified)
+#              - Considered Lost (For us the third level)
+#
+#      - At this time we have some parameters hardcoded (Must be improve later)
+#
+#      - the choice of methods is hardcoded :
+#              - for the first overduelevel : three methods : mail,letter,phone
+#              -For the second overduelevel :only one method : letter
+#              - For the Third Overdue level : only one method : Considered 
Lost
+#
+#
+# this program will be heavy tested next week ....
+#
 # Revision 1.157.2.12  2006/10/19 09:04:07  toins
 # itemtypes.itemtype is a primary key.
 #

Index: circ/branchoverdues.pl
===================================================================
RCS file: circ/branchoverdues.pl
diff -N circ/branchoverdues.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ circ/branchoverdues.pl      20 Oct 2006 10:35:05 -0000      1.1.2.1
@@ -0,0 +1,175 @@
+#!/usr/bin/perl
+
+# $Id: branchoverdues.pl,v 1.1.2.1 2006/10/20 10:35:05 alaurin Exp $
+#
+# 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 DBI;
+use HTML::Template;
+use C4::Auth;
+use C4::Date;
+use C4::Circulation::Circ2;
+use Date::Manip;
+use C4::Reserves2;
+use C4::Search;
+use C4::Koha;
+use C4::Date;
+use Mail::Sendmail;  # comment out if not doing e-mail notices
+use Getopt::Long;
+#use C4::Calendar;
+use Date::Calc;
+
+
+# this module is a new interface, allow to the librarian to check all items on 
overdues (based on the acountlines type 'FU' )
+# this interface is filtered by branches (automaticly), and by departement 
(optional) ....
+#  all informations are stocked in the notifys BDD
+
+# FIXME for this time, we have only four methods to notify :
+#      - mail : work with a batch programm
+#      - letter : for us, the letters are generated by an open-office program
+#      - phone : Simple method, when the method 'phone' is selected, we 
consider, that the borrower as been notified, and the notify send date is 
implemented
+#      - considered lost : for us if the document is on the third 
overduelevel, 
+
+
+# FIXME the methods are actually hardcoded for the levels : (maybe can be 
improved by a new possibility in overduerule)
+
+#      level 1 : three methods are possible : - mail, letter, phone
+#      level 2 : only one method is possible : - letter
+#      level 3 : only methode is possible  : - Considered Lost
+
+
+#      the documents displayed on this interface, are checked on three points
+#      - 1) the document must be on accountlines (Type 'FU')
+#      - 2) item issues is not returned
+#      - 3) this item as not been already notify
+
+
+# -----------------------------------------------------------
+
+my $input = new CGI;
+my $departement=$input->param('departement');
+
+
+my $theme = $input->param('theme'); # only used if allowthemeoverride is set
+
+my ($template, $loggedinuser, $cookie)
+      = get_template_and_user({template_name => "circ/branchoverdues.tmpl",
+                                        query => $input,
+                                        type => "intranet",
+                                        authnotrequired => 0,
+                                        flagsrequired => {borrowers => 1},
+                                        debug => 1,
+                                        });
+
+my $default = C4::Context->userenv->{'branch'};
+
+# Initate localtime
+my @datearr = localtime(time());
+my $todaysdate = (1900+$datearr[5]).'-'.sprintf ("%0.2d", 
($datearr[4]+1)).'-'.sprintf ("%0.2d", $datearr[3]);
+
+
+  # Deal with the vars recept from the template
+my $bornum=$input->param('bornum');
+my $itemnumber=$input->param('itemnumber');
+my $method=$input->param('method');
+my $overduelevel=$input->param('overduelevel');
+my $notifyId=$input->param('notifyId');
+
+# now create the line in bdd (notifys)
+ if($input->param('action') eq 'add'){
+       my $addnotify = 
AddNotifyLine($bornum,$itemnumber,$overduelevel,$method,$notifyId);
+ }
+ 
+#  possibility to remove notify line
+ if($input->param('action') eq 'remove'){
+       my $notify_date=$input->param('notify_date');
+        my $removenotify = RemoveNotifyLine($bornum,$itemnumber,$notify_date);
+ }
+
+my @overduesloop;
+my @todayoverduesloop;
+my $counter=0;
+my $today=ParseDate("today");
+my @getoverdues = GetOverduesForBranch($default,$departement);
+
+# filter by departement
+if ($departement){
+       my ($departementlib,$departementValue) = 
GetDepartementLib($departement);
+       $template->param(departement => $departementlib,
+                       departementValue => $departementValue,                  
+                       );
+}
+else {
+       # initiate the selector of departements .....
+       my @getdepartements=GetDepartements();
+       my @departementsloop;
+               foreach my $dpt(@getdepartements){
+               my %departement;
+               $departement{'authorised_value'} = $dpt->{'authorised_value'};
+               $departement{'lib'} = $dpt->{'lib'};
+               push(@departementsloop, \%departement);
+               }
+       $template->param( departementsloop  => address@hidden,);
+}
+
+# now display infos
+ foreach my $num (@getoverdues) {
+       
+               my %overdueforbranch;
+               $overdueforbranch{'date_due'} = format_date($num->{'date_due'});
+               $overdueforbranch{'title'} = $num->{'title'};
+               $overdueforbranch{'description'} = $num->{'description'};
+               $overdueforbranch{'barcode'} = $num->{'barcode'};
+               $overdueforbranch{'biblionumber'} = $num->{'biblionumber'};
+               $overdueforbranch{'borrowersurname'} = $num->{'surname'};
+               $overdueforbranch{'borrowerfirstname'} = $num->{'firstname'};
+               $overdueforbranch{'borrowerphone'} = $num->{'phone'};
+               $overdueforbranch{'borroweremail'} = $num->{'email'};
+               $overdueforbranch{'itemcallnumber'} = $num->{'itemcallnumber'};
+               $overdueforbranch{'borrowernumber'} = $num->{'borrowernumber'};
+               $overdueforbranch{'itemnumber'} = $num->{'itemnumber'};
+                               
+#              now we add on the template, the differents values of 
notify_level
+               if ($num->{'notify_level'} eq '1') {
+                       $overdueforbranch{'overdue1'} = 1;
+                       $overdueforbranch{'overdueLevel'} = 1;
+               }
+               
+               if ($num->{'notify_level'} eq '2') {
+                       $overdueforbranch{'overdue2'} = 1;
+                       $overdueforbranch{'overdueLevel'} = 2;
+               }
+               
+               if ($num->{'notify_level'} eq '3') {
+                       $overdueforbranch{'overdue3'} = 1;
+                       $overdueforbranch{'overdueLevel'} = 3;
+               }
+               $overdueforbranch{'notify_id'} = $num->{'notify_id'};
+                       
+       push(@overduesloop, \%overdueforbranch);
+ }
+# initiate the templates for the overdueloop
+ $template->param( overduesloop       => address@hidden,
+                       show_date       => format_date($todaysdate),
+                        );
+
+
+
+       print "Content-Type: text/html\n\n", $template->output;
\ No newline at end of file

Index: koha-tmpl/intranet-tmpl/prog/en/circ/branchoverdues.tmpl
===================================================================
RCS file: koha-tmpl/intranet-tmpl/prog/en/circ/branchoverdues.tmpl
diff -N koha-tmpl/intranet-tmpl/prog/en/circ/branchoverdues.tmpl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ koha-tmpl/intranet-tmpl/prog/en/circ/branchoverdues.tmpl    20 Oct 2006 
10:35:05 -0000      1.1.2.1
@@ -0,0 +1,180 @@
+<!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->Koha -- Circulation
+<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
+<!-- TMPL_INCLUDE NAME="menus.inc" -->
+<!-- TMPL_INCLUDE NAME="menu-circ.inc" -->
+
+<h1>Circulation: Branch Overdues</h1>
+
+<div id="mainbloc">
+<!-- selector of departement -->
+<fieldset id="branch_odues_select_departement">
+<!-- TMPL_IF NAME="departement" -->
+<legend>departement selected</legend>
+<form name="changedepartment" action="branchoverdues.pl">
+       <ul>
+               <li>
+                       You are working actually on the overdues for the 
departement : <b><!-- TMPL_VAR NAME="departement" --></b>
+       <input type="submit" name="changedepartement" class="button" 
value="change departement">
+               </li>
+       </ul>
+</form>
+<!-- TMPL_ELSE -->
+<legend>Select your departement</legend>
+<ul>
+       <li>
+               <form name="selectdepartement" action="branchoverdues.pl" 
method="post">
+               <select id="departement" name="departement">
+                       <option value="">All departements</option>
+                       <!-- TMPL_LOOP NAME="departementsloop" -->
+                               <option value="<!-- TMPL_VAR 
NAME="authorised_value" -->"><!-- TMPL_VAR NAME="lib" --></option>
+                       <!-- /TMPL_LOOP -->
+               </select>
+               <input type="submit" name="departement" class="button" 
value="change departement">
+               </form>
+       </li>
+</ul>
+<!-- /TMPL_IF -->
+</fieldset>
+
+       <fieldset id="branch_odues_global_odues">
+       <legend>Overdues of your library</legend>
+       <form name="sendnotify" action="branchoverdues.pl" method="post">
+       <!-- TMPL_IF name="overduesloop" -->
+               <table>
+               <tr>
+                       <th class="circulation">Date_due</th>
+                       <th class="circulation">Title</th>
+                       <th class="circulation">Borrower</th>
+                       <th class="circulation">Localisation</th>
+                       <th class="circulation">Overdue status</th>
+                       <th class="circulation">Notify by</th>
+               </tr>
+                       <!-- TMPL_LOOP NAME="overduesloop" -->
+                               <tr>
+                                       <td>
+                                               <p>
+                                               <!-- TMPL_VAR NAME="date_due" 
-->
+                                               </p>
+                                       </td>
+                                       <td>
+                                               <p>
+                                                       <a 
href="/cgi-bin/koha/MARCdetail.pl?bib=<!-- TMPL_VAR NAME="biblionumber" 
-->"><!-- TMPL_VAR NAME="title" --></a>
+                                                       &nbsp; (<b><!-- 
TMPL_VAR NAME="description" --></b>)
+                                                       <br />Barcode : <!-- 
TMPL_VAR NAME="barcode" -->
+                                               </p>
+                                       </td>
+                                       <td>
+                                               <p><a 
href="/cgi-bin/koha/members/moremember.pl?bornum=<!--TMPL_VAR 
Name="borrowernumber"-->"><!-- TMPL_VAR NAME="borrowersurname" --> &nbsp; <!-- 
TMPL_VAR NAME="borrowerfirstname" --></a><br /><!-- TMPL_VAR 
NAME="borrowerphone" --><br />
+                                       <!-- TMPL_IF NAME="borroweremail" --><a 
href="mailto:<!-- TMPL_VAR NAME="borroweremail" -->?subject=Overdue: <!-- 
TMPL_VAR NAME="title" -->">
+                                       <!-- TMPL_VAR NAME="borroweremail" 
--></a><!--/TMPL_IF-->
+                                               </p>
+                                       </td>
+                                       <td><p><!-- TMPL_VAR NAME="homebranch" 
--> <!-- TMPL_VAR NAME="itemcallnumber" --></p>
+                                       </td>
+                                       <td align="center">
+                                       <b>
+                                               <!-- TMPL_IF NAME="overdue1" -->
+                                                       first overdue
+                                               <!-- /TMPL_IF -->
+                                               <!-- TMPL_IF NAME="overdue2" -->
+                                                       second overdue
+                                               <!-- /TMPL_IF -->
+                                               <!-- TMPL_IF NAME="overdue3" -->
+                                                       Third overdue
+                                               <!-- /TMPL_IF -->
+                                       </b>
+                                       </td>
+                                       <td align="center">
+                                       <!-- TMPL_IF NAME="overdue1" -->
+                                               <!-- TMPL_IF 
NAME="borroweremail" -->
+                                                       <a 
href="branchoverdues.pl?action=add&bornum=<!-- TMPL_VAR 
NAME="borrowernumber"-->&itemnumber=<!-- TMPL_VAR NAME="itemnumber" 
-->&method=mail&departement=<!-- TMPL_VAR NAME="departementValue" 
-->&overduelevel=<!-- TMPL_VAR NAME="overdueLevel" -->&notifyId=<!-- TMPL_VAR 
NAME="notify_id" -->">mail</a>
+                                               <!-- TMPL_ELSE -->
+                                                       mail
+                                               <!-- /TMPL_IF -->
+                                                       &nbsp;|&nbsp;
+                                                       <a 
href="branchoverdues.pl?action=add&bornum=<!-- TMPL_VAR 
NAME="borrowernumber"-->&itemnumber=<!-- TMPL_VAR NAME="itemnumber" 
-->&method=phone&departement=<!-- TMPL_VAR NAME="departementValue" 
-->&overduelevel=<!-- TMPL_VAR NAME="overdueLevel" -->&notifyId=<!-- TMPL_VAR 
NAME="notify_id" -->
+                                                       ">phone</a>
+                                                       &nbsp;|&nbsp;
+                                                       <a 
href="branchoverdues.pl?action=add&bornum=<!-- TMPL_VAR 
NAME="borrowernumber"-->&itemnumber=<!-- TMPL_VAR NAME="itemnumber" 
-->&method=letter&departement=<!-- TMPL_VAR NAME="departementValue" 
-->&overduelevel=<!-- TMPL_VAR NAME="overdueLevel" -->
+                                                       &notifyId=<!-- TMPL_VAR 
NAME="notify_id" -->">letter</a>
+                                       <!-- /TMPL_IF -->
+                                       
+                                       <!-- TMPL_IF NAME="overdue2" -->
+                                               <a 
href="branchoverdues.pl?action=add&bornum=<!-- TMPL_VAR 
NAME="borrowernumber"-->&itemnumber=<!-- TMPL_VAR NAME="itemnumber" 
-->&method=letter&departement=<!-- TMPL_VAR NAME="departementValue" 
-->&overduelevel=<!-- TMPL_VAR NAME="overdueLevel" -->&notifyId=<!-- TMPL_VAR 
NAME="notify_id" -->">letter</a>
+                                       <!-- /TMPL_IF -->
+                                       
+                                       <!-- TMPL_IF NAME="overdue3" -->
+                                       <a 
href="branchoverdues.pl?action=add&bornum=<!-- TMPL_VAR 
NAME="borrowernumber"-->&itemnumber=<!-- TMPL_VAR NAME="itemnumber" 
-->&method=lost&departement=<!-- TMPL_VAR NAME="departementValue" 
-->&overduelevel=<!-- TMPL_VAR NAME="overdueLevel" -->
+                                       &notifyId=<!-- TMPL_VAR 
NAME="notify_id" -->">Considered lost</a>
+                                       <!-- /TMPL_IF -->
+                                       
+                                       </td>
+                               </tr>
+                       <!-- /TMPL_LOOP -->
+               </table>
+       <!-- TMPL_ELSE -->
+               There is no overdues for your library today
+       <!-- /TMPL_IF -->
+       </fieldset>
+<!-- TMPL_IF name="todayoverduesloop" -->
+       <fieldset id="branch_odues_today_odues">
+       <legend>Notifys of the day</legend>     
+               <table>
+               <tr>
+                       <th class="circulation">Date_due</th>
+                       <th class="circulation">Title</th>
+                       <th class="circulation">Borrower</th>
+                       <th class="circulation">Localisation</th>
+                       <th class="circulation">Overdue status</th>
+                       <th class="circulation">Notified by</th>
+                       <th class="circulation">Cancel</th>                     
+               </tr>
+                       <!-- TMPL_LOOP NAME="todayoverduesloop" -->
+                               <tr>
+                                       <td>
+                                               <p>
+                                               <!-- TMPL_VAR NAME="date_due" 
-->
+                                               </p>
+                                       </td>
+                                       <td>
+                                               <p>
+                                                       <a 
href="/cgi-bin/koha/MARCdetail.pl?bib=<!-- TMPL_VAR NAME="biblionumber" 
-->"><!-- TMPL_VAR NAME="title" --></a>
+                                                       &nbsp; (<b><!-- 
TMPL_VAR NAME="description" --></b>)
+                                                       <br />Barcode : <!-- 
TMPL_VAR NAME="barcode" -->
+                                               </p>
+                                       </td>
+                                       <td>
+                                               <p><a 
href="/cgi-bin/koha/members/moremember.pl?bornum=<!--TMPL_VAR 
Name="borrowernumber"-->"><!-- TMPL_VAR NAME="borrowersurname" --> &nbsp; <!-- 
TMPL_VAR NAME="borrowerfirstname" --></a><br /><!-- TMPL_VAR 
NAME="borrowerphone" --><br />
+                                       <!-- TMPL_IF NAME="borroweremail" --><a 
href="mailto:<!-- TMPL_VAR NAME="borroweremail" -->?subject=Overdue: <!-- 
TMPL_VAR NAME="title" -->">
+                                       <!-- TMPL_VAR NAME="borroweremail" 
--></a><!--/TMPL_IF-->
+                                               </p>
+                                       </td>
+                                       <td><p><!-- TMPL_VAR NAME="homebranch" 
--> <!-- TMPL_VAR NAME="itemcallnumber" --></p>
+                                       </td>
+                                       <td align="center">
+                                               <b>
+                                                       <!-- TMPL_IF 
NAME="overdue1" -->
+                                                               first overdue
+                                                       <!-- /TMPL_IF -->
+                                                       <!-- TMPL_IF 
NAME="overdue2" -->
+                                                               second overdue
+                                                       <!-- /TMPL_IF -->
+                                                       <!-- TMPL_IF 
NAME="overdue3" -->
+                                                               considered lost
+                                                       <!-- /TMPL_IF -->
+                                               </b>
+                                       </td>
+                                       <td align="center">
+                                               <b><!-- TMPL_VAR 
NAME="notify_method" --></b>
+                                       </td>
+                               
+                                       <td>
+                                       <a 
href="branchoverdues.pl?action=remove&bornum=<!-- TMPL_VAR 
NAME="borrowernumber"-->&itemnumber=<!-- TMPL_VAR NAME="itemnumber" 
-->&method=phone&departement=<!-- TMPL_VAR NAME="departementValue" 
-->&notify_date=<!-- TMPL_VAR NAME="notify_date" -->">cancel notification</a>
+                                       </td>
+                               </tr>
+                       <!-- /TMPL_LOOP -->
+               </table>
+       </fieldset>
+<!-- /TMPL_IF -->
+</div>
+<!-- TMPL_INCLUDE name="intranet-bottom.inc" -->




reply via email to

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