moving itemslost to reports from tools
authorJoshua Ferraro <jmf@liblime.com>
Wed, 19 Sep 2007 01:23:32 +0000 (20:23 -0500)
committerChris Cormack <crc@liblime.com>
Wed, 19 Sep 2007 01:47:48 +0000 (20:47 -0500)
Signed-off-by: Chris Cormack <crc@liblime.com>
koha-tmpl/intranet-tmpl/prog/en/includes/reports-menu.inc
koha-tmpl/intranet-tmpl/prog/en/includes/tools-menu.inc
koha-tmpl/intranet-tmpl/prog/en/modules/reports/itemslost.tmpl [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/en/modules/reports/reports-home.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/tools/itemslost.tmpl [deleted file]
koha-tmpl/intranet-tmpl/prog/en/modules/tools/tools-home.tmpl
reports/itemslost.pl [new file with mode: 0755]
tools/itemslost.pl [deleted file]

index 21b1eba..7579d61 100644 (file)
@@ -23,7 +23,8 @@
 
        <strong>Other</strong>
        <ul>
+               <li><a href="/cgi-bin/koha/reports/itemslost.pl">Items lost</a></li>
                <li><a href="/cgi-bin/koha/reports/manager.pl?report_name=itemtypes">Catalogue by itemtype</a></li>
                <li><a href="/cgi-bin/koha/reports/manager.pl?report_name=issues_by_borrower_category">Checkouts by patron category</a></li>
                <li><a href="/cgi-bin/koha/reports/issues_avg_stats.pl">Average loan time</a></li>
-       </ul>
\ No newline at end of file
+       </ul>
index e27a085..bcc4c81 100644 (file)
@@ -4,7 +4,6 @@
        <li><a href="/cgi-bin/koha/tools/koha-news.pl">News</a></li>
        <li><a href="/cgi-bin/koha/tools/inventory.pl">Inventory/stocktaking</a></li>
        <li><a href="/cgi-bin/koha/tools/cleanborrowers.pl">Clean borrowers</a></li>
-       <li><a href="/cgi-bin/koha/tools/itemslost.pl">Items lost</a></li>
        <li><a href="/cgi-bin/koha/tools/export.pl">Export</a></li>
        <li><a href="/cgi-bin/koha/tools/import.pl">Import</a></li>
        <li><a href="/cgi-bin/koha/tools/letter.pl">Notices</a></li>
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/itemslost.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/itemslost.tmpl
new file mode 100644 (file)
index 0000000..5dafcb7
--- /dev/null
@@ -0,0 +1,95 @@
+<!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
+<title>Koha &rsaquo; Reports &rsaquo; Lost Items</title>
+<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
+</head>
+<body>
+<!-- TMPL_INCLUDE NAME="header.inc" -->
+<!-- TMPL_INCLUDE NAME="cat-search.inc" -->
+
+<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/reports/reports-home.pl">Reports</a> &rsaquo; Lost Items</div>
+
+<div id="doc3" class="yui-t2">
+   
+   <div id="bd">
+       <div id="yui-main">
+       <div class="yui-b">
+
+<h1>Lost Items</h1>
+
+<div class="results">
+    <!-- TMPL_IF NAME="total" -->
+        <!-- TMPL_VAR NAME="total" --> lost item(s) found.
+    <!-- TMPL_ELSE-->
+        No lost items found.
+    <!-- /TMPL_IF -->
+</div>
+
+<form name="f" action="/cgi-bin/koha/reports/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="OK" />
+    <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" -->
+                <!-- TMPL_IF NAME="selected" --><option value="<!-- TMPL_VAR NAME="value" -->" selected="selected"><!-- TMPL_VAR NAME="branchname" --></option>
+                               <!-- TMPL_ELSE -->
+                               <option value="<!-- TMPL_VAR NAME="value" -->"><!-- TMPL_VAR NAME="branchname" --></option>
+                               <!-- /TMPL_IF -->
+            <!-- /TMPL_LOOP -->
+            </select></td>
+        <td><select name="itemtypesfilter">
+                <option value="">All</option>
+                <!-- TMPL_LOOP name="itemtypeloop" -->
+                <!-- TMPL_IF NAME="selected" --><option value="<!-- TMPL_VAR NAME="value" -->" selected="selected"><!-- TMPL_VAR NAME="description" --></option>
+                               <!-- TMPL_ELSE -->
+                               <option value="<!-- TMPL_VAR NAME="value" -->"><!-- TMPL_VAR NAME="description" --></option>
+                               <!-- /TMPL_IF -->
+                <!-- /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>
+
+</div>
+</div>
+<div class="yui-b">
+<!-- TMPL_INCLUDE NAME="reports-menu.inc" -->
+</div>
+</div>
+<!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->
index d554373..d981e24 100644 (file)
@@ -39,6 +39,8 @@
 
        <h2>Other</h2>
        <ul>
+               <dt><a href="/cgi-bin/koha/reports/itemslost.pl">Items lost</a></dt>
+       <dd>Show lost items</dd>
                <li><a href="/cgi-bin/koha/reports/manager.pl?report_name=itemtypes">Catalogue by itemtype</a></li>
                <li><a href="/cgi-bin/koha/reports/manager.pl?report_name=issues_by_borrower_category">Checkouts by patron category</a></li>
                <li><a href="/cgi-bin/koha/reports/issues_avg_stats.pl">Average loan time</a></li>
@@ -48,4 +50,4 @@
 </div>
 
 </div>
-<!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->
\ No newline at end of file
+<!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/itemslost.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/itemslost.tmpl
deleted file mode 100644 (file)
index ed89ab5..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-<!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
-<title>Koha &rsaquo; Tools &rsaquo; Lost Items</title>
-<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
-</head>
-<body>
-<!-- TMPL_INCLUDE NAME="header.inc" -->
-<!-- TMPL_INCLUDE NAME="cat-search.inc" -->
-
-<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/reports/tools-home.pl">Tools</a> &rsaquo; Lost Items</div>
-
-<div id="doc3" class="yui-t2">
-   
-   <div id="bd">
-       <div id="yui-main">
-       <div class="yui-b">
-
-<h1>Lost Items</h1>
-
-<div class="results">
-    <!-- TMPL_IF NAME="total" -->
-        <!-- TMPL_VAR NAME="total" --> lost item(s) found.
-    <!-- TMPL_ELSE-->
-        No lost items found.
-    <!-- /TMPL_IF -->
-</div>
-
-<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="OK" />
-    <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" -->
-                <!-- TMPL_IF NAME="selected" --><option value="<!-- TMPL_VAR NAME="value" -->" selected="selected"><!-- TMPL_VAR NAME="branchname" --></option>
-                               <!-- TMPL_ELSE -->
-                               <option value="<!-- TMPL_VAR NAME="value" -->"><!-- TMPL_VAR NAME="branchname" --></option>
-                               <!-- /TMPL_IF -->
-            <!-- /TMPL_LOOP -->
-            </select></td>
-        <td><select name="itemtypesfilter">
-                <option value="">All</option>
-                <!-- TMPL_LOOP name="itemtypeloop" -->
-                <!-- TMPL_IF NAME="selected" --><option value="<!-- TMPL_VAR NAME="value" -->" selected="selected"><!-- TMPL_VAR NAME="description" --></option>
-                               <!-- TMPL_ELSE -->
-                               <option value="<!-- TMPL_VAR NAME="value" -->"><!-- TMPL_VAR NAME="description" --></option>
-                               <!-- /TMPL_IF -->
-                <!-- /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>
-
-</div>
-</div>
-<div class="yui-b">
-<!-- TMPL_INCLUDE NAME="tools-menu.inc" -->
-</div>
-</div>
-<!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->
index dd76adf..fc0ca61 100644 (file)
@@ -44,9 +44,6 @@
     <dt><a href="/cgi-bin/koha/tools/cleanborrowers.pl">Clean borrowers</a></dt>
     <dd>Delete old borrowers and anonymize circulation history (deletes borrower reading history)</dd>
 
-    <dt><a href="/cgi-bin/koha/tools/itemslost.pl">Items lost</a></dt>
-    <dd>Show lost items</dd>
-
     <dt><a href="/cgi-bin/koha/tools/viewlog.pl">Log viewer</a></dt>
     <dd>Browse the system logs</dd>
 </dl>
diff --git a/reports/itemslost.pl b/reports/itemslost.pl
new file mode 100755 (executable)
index 0000000..3844dd6
--- /dev/null
@@ -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$
+
+=head1 itemslost
+
+This script displays lost items.
+
+=cut
+
+use strict;
+use CGI;
+use C4::Auth;
+use C4::Output;
+use C4::Biblio;    # GetLostItems
+use C4::Koha;                  # GetItemTypes
+use C4::Branch; # GetBranches
+
+my $query = new CGI;
+my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
+    {
+        template_name   => "reports/itemslost.tmpl",
+        query           => $query,
+        type            => "intranet",
+        authnotrequired => 0,
+        flagsrequired   => { reportss => 1 },
+        debug           => 1,
+    }
+);
+
+my $params = $query->Vars;
+
+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;
diff --git a/tools/itemslost.pl b/tools/itemslost.pl
deleted file mode 100755 (executable)
index 6fa0272..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-#!/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$
-
-=head1 itemslost
-
-This script displays lost items.
-
-=cut
-
-use strict;
-use CGI;
-use C4::Auth;
-use C4::Output;
-use C4::Biblio;    # GetLostItems
-use C4::Koha;                  # GetItemTypes
-use C4::Branch; # GetBranches
-
-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;
-
-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;