[Koha-cvs] koha koha-tmpl/intranet-tmpl/prog/en/tools/tool... [rel_3_0]

Antoine Farnault antoine at koha-fr.org
Wed Nov 29 12:56:14 CET 2006


CVSROOT:	/sources/koha
Module name:	koha
Branch:		rel_3_0
Changes by:	Antoine Farnault <toins>	06/11/29 11:56:14

Modified files:
	koha-tmpl/intranet-tmpl/prog/en/tools: tools-home.tmpl 
	tools          : tools-home.pl 
Added files:
	koha-tmpl/intranet-tmpl/prog/en/tools: itemslost.tmpl 
	tools          : itemslost.pl 

Log message:
	new script: itemslost.pl (SAN OP #108)

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/koha-tmpl/intranet-tmpl/prog/en/tools/tools-home.tmpl?cvsroot=koha&only_with_tag=rel_3_0&r1=1.1.2.2&r2=1.1.2.3
http://cvs.savannah.gnu.org/viewcvs/koha/koha-tmpl/intranet-tmpl/prog/en/tools/itemslost.tmpl?cvsroot=koha&only_with_tag=rel_3_0&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/tools/tools-home.pl?cvsroot=koha&only_with_tag=rel_3_0&r1=1.1.2.1&r2=1.1.2.2
http://cvs.savannah.gnu.org/viewcvs/koha/tools/itemslost.pl?cvsroot=koha&only_with_tag=rel_3_0&rev=1.1.2.1

Patches:
Index: koha-tmpl/intranet-tmpl/prog/en/tools/tools-home.tmpl
===================================================================
RCS file: /sources/koha/koha/koha-tmpl/intranet-tmpl/prog/en/tools/tools-home.tmpl,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -b -r1.1.2.2 -r1.1.2.3
--- koha-tmpl/intranet-tmpl/prog/en/tools/tools-home.tmpl	16 Nov 2006 10:06:59 -0000	1.1.2.2
+++ koha-tmpl/intranet-tmpl/prog/en/tools/tools-home.tmpl	29 Nov 2006 11:56:13 -0000	1.1.2.3
@@ -43,6 +43,10 @@
 	<th><a href="/cgi-bin/koha/tools/cleanborrowers.pl">Clean borrowers</a></th>
 	<td>Delete some old private data/reading history relative to borrowers.</td>
 </tr>
+<tr>
+    <th><a href="/cgi-bin/koha/tools/itemslost.pl">Items lost</a></th>
+    <td>Show lost items</td>
+</tr>
 </table>
 
 

Index: tools/tools-home.pl
===================================================================
RCS file: /sources/koha/koha/tools/tools-home.pl,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -b -r1.1.2.1 -r1.1.2.2
--- tools/tools-home.pl	10 Nov 2006 09:08:38 -0000	1.1.2.1
+++ tools/tools-home.pl	29 Nov 2006 11:56:13 -0000	1.1.2.2
@@ -18,19 +18,18 @@
 use strict;
 use CGI;
 use C4::Auth;
-use C4::Output;
 use C4::Interface::CGI::Output;
-use C4::Database;
-use HTML::Template;
 
 my $query = new CGI;
-my ($template, $loggedinuser, $cookie)
-    = get_template_and_user({template_name => "tools/tools-home.tmpl",
+my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
+    {
+        template_name   => "tools/tools-home.tmpl",
 			     query => $query,
 			     type => "intranet",
 			     authnotrequired => 0,
-			     flagsrequired => {tools => 1},
+        flagsrequired   => { tools => 1 },
 			     debug => 1,
-			     });
+    }
+);
 
 output_html_with_http_headers $query, $cookie, $template->output;

Index: koha-tmpl/intranet-tmpl/prog/en/tools/itemslost.tmpl
===================================================================
RCS file: koha-tmpl/intranet-tmpl/prog/en/tools/itemslost.tmpl
diff -N koha-tmpl/intranet-tmpl/prog/en/tools/itemslost.tmpl
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ koha-tmpl/intranet-tmpl/prog/en/tools/itemslost.tmpl	29 Nov 2006 11:56:13 -0000	1.1.2.1
@@ -0,0 +1,121 @@
+<!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->Koha -- System Administration<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
+
+<!-- TMPL_INCLUDE NAME="menus.inc" -->
+<!-- TMPL_INCLUDE NAME="menu-tools.inc" -->
+
+<h1>Items lost</h1>
+
+<b>
+    <!-- TMPL_IF NAME="total" -->
+        <!-- TMPL_VAR NAME="total" --> lost item found.
+    <!-- TMPL_ELSE-->
+        No lost item found...
+    <!-- /TMPL_IF -->
+</b>
+<br />
+<br />
+<form name="f" action="/cgi-bin/koha/tools/itemslost.pl" method="POST">
+    <label for="orderbyfilter">Set result order by</label>
+    <select id="orderbyfilter" name="orderbyfilter">
+        <option value=""> --- </option>
+        <option value="homebranch">Branch</option>
+        <option value="itemtype">Itemtypes</option>
+        <option value="barcode">Barcode</option>
+        <option value="price">price</option>
+    </select>
+    <input type="submit" value=" GET " />
+    <input type="hidden" name="get_items" value="1" />
+    <table>
+    <tr>
+        <th>
+            Barcode
+        </th>
+        <th>
+            Date last seen
+        </th>
+        <th>
+            Price
+        </th>
+        <th>
+            Branch
+        </th>
+        <th>
+            Itemtype
+        </th>
+        <th>
+            Holdingbranch
+        </th>
+        <th>
+            Location
+        </th>
+    </tr>
+    <tr>
+        <td>
+            <input type="text" name="barcodefilter" size="6"/>
+        </td>
+        <td>
+            <!-- datelastseen -->
+        </td>
+        <td>
+            <!-- price -->
+        </td>
+        <td>
+            <select name="branchfilter">
+                <option value="">All</option>
+            <!-- TMPL_LOOP name="branchloop" -->
+                <option value="<!-- TMPL_VAR name="value" -->" <!-- TMPL_IF name="selected" -->selected<!-- /TMPL_IF -->><!-- TMPL_VAR name="branchname" --></option>
+            <!-- /TMPL_LOOP -->
+            </select>
+        </td>
+        <td>
+            <select name="itemtypesfilter">
+                <option value="">All</option>
+                <!-- TMPL_LOOP name="itemtypeloop" -->
+                <option value="<!-- TMPL_VAR name="value" -->" <!-- TMPL_IF name="selected" -->selected<!-- /TMPL_IF -->><!-- TMPL_VAR name="description" --></option>
+                <!-- /TMPL_LOOP -->
+            </select>
+        </td>
+        <td>
+            <!-- holdingbranch -->
+        </td>
+        <td>
+            <!-- location -->
+        </td>
+    </tr>
+     <!-- TMPL_LOOP NAME="itemsloop"-->
+        <tr>
+            <td>
+                <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber"-->" title="<!-- TMPL_VAR NAME="itemnotes"-->">
+                    <!-- TMPL_VAR NAME="barcode"-->
+                </a>
+            </td>
+            <td>
+                <!-- TMPL_VAR NAME="datelastseen"-->
+            </td>
+            <td>
+                <!-- TMPL_VAR NAME="price" -->
+            </td>
+            <td>
+                <!-- TMPL_VAR NAME="homebranch" -->
+            </td>
+            <td>
+                <!-- TMPL_VAR NAME="itemtype" -->
+            </td>
+            <td>
+                <!-- TMPL_VAR NAME="holdingbranch"-->
+            </td>
+            <td>
+                <!-- TMPL_VAR NAME="location"-->
+            </td>
+        </tr>
+    <!-- /TMPL_LOOP -->
+    </table>
+</form>
+
+<script type="text/javascript" language="JavaScript">
+// <![CDATA[
+    
+     // ]]>
+</script>
+
+<!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->

Index: tools/itemslost.pl
===================================================================
RCS file: tools/itemslost.pl
diff -N tools/itemslost.pl
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ tools/itemslost.pl	29 Nov 2006 11:56:13 -0000	1.1.2.1
@@ -0,0 +1,97 @@
+#!/usr/bin/perl
+
+# 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
+
+#$Id: itemslost.pl,v 1.1.2.1 2006/11/29 11:56:13 toins Exp $
+
+=head1 itemslost
+
+This script displays lost items.
+
+=cut
+
+use strict;
+use CGI;
+use C4::Auth;
+use C4::Interface::CGI::Output;
+use C4::Circulation::Circ2;    # GetLostItems
+use C4::Koha;                  # GetBranches GetBranch GetItemTypes
+
+my $query = new CGI;
+my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
+    {
+        template_name   => "tools/itemslost.tmpl",
+        query           => $query,
+        type            => "intranet",
+        authnotrequired => 0,
+        flagsrequired   => { tools => 1 },
+        debug           => 1,
+    }
+);
+
+my $params = $query->Vars;
+warn "params=>" . Data::Dumper::Dumper($params);
+
+if ( $params->{'get_items'} ) {
+    my $orderbyfilter   = $params->{'orderbyfilter'}   || undef;
+    my $branchfilter    = $params->{'branchfilter'}    || undef;
+    my $barcodefilter   = $params->{'barcodefilter'}   || undef;
+    my $itemtypesfilter = $params->{'itemtypesfilter'} || undef;
+
+    my %where;
+    $where{homebranch} = $branchfilter    if defined $branchfilter;
+    $where{barcode}    = $barcodefilter   if defined $barcodefilter;
+    $where{itemtype}   = $itemtypesfilter if defined $itemtypesfilter;
+
+    my $items = GetLostItems( \%where, $orderbyfilter );
+    $template->param(
+        total     => scalar @$items,
+        itemsloop => $items
+    );
+}
+
+# getting all branches.
+my $branches = GetBranches;
+my $branch   = C4::Context->userenv->{"branchname"};
+my @branchloop;
+foreach my $thisbranch ( keys %$branches ) {
+    my $selected = 1 if $thisbranch eq $branch;
+    my %row = (
+        value      => $thisbranch,
+        selected   => $selected,
+        branchname => $branches->{$thisbranch}->{'branchname'},
+    );
+    push @branchloop, \%row;
+}
+
+# getting all itemtypes
+my $itemtypes = &GetItemTypes();
+my @itemtypesloop;
+foreach my $thisitemtype ( sort keys %$itemtypes ) {
+    my %row = (
+        value       => $thisitemtype,
+        description => $itemtypes->{$thisitemtype}->{'description'},
+    );
+    push @itemtypesloop, \%row;
+}
+
+$template->param(
+    branchloop   => \@branchloop,
+    itemtypeloop => \@itemtypesloop,
+);
+
+# writing the template
+output_html_with_http_headers $query, $cookie, $template->output;





More information about the Koha-cvs mailing list