[Koha-patches] [PATCH] Removing bookcount.pl and redirecting links to issuehistory.pl

Owen Leonard oleonard at myacpl.org
Fri Aug 29 16:05:31 CEST 2008


---
 circ/bookcount.pl                                  |  213 --------------------
 .../prog/en/modules/catalogue/issuehistory.tmpl    |   19 +--
 .../prog/en/modules/catalogue/moredetail.tmpl      |    2 +-
 .../prog/en/modules/circ/bookcount.tmpl            |   71 -------
 4 files changed, 7 insertions(+), 298 deletions(-)
 delete mode 100755 circ/bookcount.pl
 delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/circ/bookcount.tmpl

diff --git a/circ/bookcount.pl b/circ/bookcount.pl
deleted file mode 100755
index eeeff41..0000000
--- a/circ/bookcount.pl
+++ /dev/null
@@ -1,213 +0,0 @@
-#!/usr/bin/perl
-
-
-#written 7/3/2002 by Finlay
-#script to display reports
-
-# 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::Circulation;
-use C4::Output;
-use C4::Koha;
-use C4::Auth;
-use C4::Branch; # GetBranches
-use C4::Biblio; # GetBiblioItemData
-use C4::Dates qw/format_date/;
-
-my $input        = new CGI;
-my $itm          = $input->param('itm');
-my $bi           = $input->param('bi');
-my $biblionumber = $input->param('biblionumber');
-my $branches     = GetBranches;
-
-my $idata = itemdatanum($itm);
-my $data  = GetBiblioItemData($bi);
-
-my $homebranch    = $branches->{ $idata->{'homebranch'} }->{'branchname'};
-my $holdingbranch = $branches->{ $idata->{'holdingbranch'} }->{'branchname'};
-
-my ( $lastmove, $message ) = lastmove($itm);
-
-my $lastdate;
-my $count;
-if ( not $lastmove ) {
-    $lastdate = $message;
-    $count = issuessince( $itm, 0 );
-}
-else {
-    $lastdate = $lastmove->{'datearrived'};
-    $count = issuessince( $itm, $lastdate );
-}
-
-# make the page ...
-
-my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
-    {
-        template_name   => "circ/bookcount.tmpl",
-        query           => $input,
-        type            => "intranet",
-        authnotrequired => 0,
-        flagsrequired   => { circulate => 1 },
-        debug           => 1,
-    }
-);
-
-my @branchloop;
-
-foreach my $branchcode ( keys %$branches ) {
-    my %linebranch;
-    $linebranch{issues} = issuesat( $itm, $branchcode );
-    my $date = lastseenat( $itm, $branchcode );
-    $linebranch{seen}       = slashdate($date);
-    $linebranch{branchname} = $branches->{$branchcode}->{'branchname'};
-    push( @branchloop, \%linebranch );
-}
-
-$template->param(
-    biblionumber            => $biblionumber,
-    title                   => $data->{'title'},
-    author                  => $data->{'author'},
-    barcode                 => $idata->{'barcode'},
-    biblioitemnumber        => $bi,
-    homebranch              => $homebranch,
-    holdingbranch           => $holdingbranch,
-    lastdate                => format_date($lastdate),
-    count                   => $count,
-    branchloop              => \@branchloop,
-);
-
-output_html_with_http_headers $input, $cookie, $template->output;
-
-
-sub itemdatanum {
-    my ($itemnumber) = @_;
-    my $dbh          = C4::Context->dbh;
-    my $sth          = $dbh->prepare("select * from items where itemnumber=?");
-    $sth->execute($itemnumber);
-    my $data = $sth->fetchrow_hashref;
-    $sth->finish;
-    return ($data);
-}
-
-sub lastmove {
-    my ($itemnumber) = @_;
-    my $dbh          = C4::Context->dbh;
-    my $sth          =
-      $dbh->prepare(
-"select max(branchtransfers.datearrived) from branchtransfers where branchtransfers.itemnumber=?"
-      );
-    $sth->execute($itemnumber);
-    my ($date) = $sth->fetchrow_array;
-    return ( 0, "Item has no branch transfers record" ) if not $date;
-    $sth =
-      $dbh->prepare(
-"Select * from branchtransfers where branchtransfers.itemnumber=? and branchtransfers.datearrived=?"
-      );
-    $sth->execute( $itemnumber, $date );
-    my ($data) = $sth->fetchrow_hashref;
-    return ( 0, "Item has no branch transfers record" ) if not $data;
-    $sth->finish;
-    return ( $data, "" );
-}
-
-sub issuessince {
-    my ( $itemnumber, $date ) = @_;
-    my $dbh = C4::Context->dbh;
-    my $sth =
-      $dbh->prepare("SELECT SUM(count) FROM (
-                        SELECT COUNT(*) AS count FROM issues WHERE itemnumber = ? and timestamp > ?
-                        UNION ALL
-                        SELECT COUNT(*) AS count FROM old_issues WHERE itemnumber = ? and timestamp > ?
-                     ) tmp");
-    $sth->execute( $itemnumber, $date, $itemnumber, $date );
-    my $count = $sth->fetchrow_arrayref->[0];
-    $sth->finish;
-    return ( $count );
-}
-
-sub issuesat {
-    my ( $itemnumber, $brcd ) = @_;
-    my $dbh = C4::Context->dbh;
-    my $sth =
-      $dbh->prepare("SELECT SUM(count) FROM (
-                        SELECT COUNT(*) AS count FROM issues WHERE itemnumber = ? and branchcode = ?
-                        UNION ALL
-                        SELECT COUNT(*) AS count FROM old_issues WHERE itemnumber = ? and branchcode = ?
-                     ) tmp");
-    $sth->execute( $itemnumber, $brcd, $itemnumber, $brcd );
-    my ($count) = $sth->fetchrow_array;
-    $sth->finish;
-    return ($count);
-}
-
-sub lastseenat {
-    my ( $itm, $brc ) = @_;
-    my $dbh = C4::Context->dbh;
-    my $sth =
-      $dbh->prepare("SELECT MAX(tstamp) FROM (
-                        SELECT MAX(timestamp) AS tstamp FROM issues WHERE itemnumber = ? and branchcode = ?
-                        UNION ALL
-                        SELECT MAX(timestamp) AS tstamp FROM old_issues WHERE itemnumber = ? and branchcode = ?
-                     ) tmp");
-    $sth->execute( $itm, $brc, $itm, $brc );
-    my ($date1) = $sth->fetchrow_array;
-    $sth->finish;
-    $sth =
-      $dbh->prepare(
-"Select max(datearrived) from branchtransfers where itemnumber=? and tobranch = ?"
-      );
-    $sth->execute( $itm, $brc );
-    my ($date2) = $sth->fetchrow_array;
-    $sth->finish;
-
-    #FIXME: MJR thinks unsafe
-    $date1 =~ s/-//g;
-    $date1 =~ s/://g;
-    $date1 =~ s/ //g;
-    $date2 =~ s/-//g;
-    $date2 =~ s/://g;
-    $date2 =~ s/ //g;
-    my $date;
-    if ( $date1 < $date2 ) {
-        $date = $date2;
-    }
-    else {
-        $date = $date1;
-    }
-    return ($date);
-}
-
-#####################################################
-# write date....
-sub slashdate {
-    my ($date) = @_;
-    if ( not $date ) {
-        return "never";
-    }
-    my ( $yr, $mo, $da, $hr, $mi ) = (
-        substr( $date, 0,  4 ),
-        substr( $date, 4,  2 ),
-        substr( $date, 6,  2 ),
-        substr( $date, 8,  2 ),
-        substr( $date, 10, 2 )
-    );
-    return "$hr:$mi  " . format_date("$yr-$mo-$da");
-}
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/issuehistory.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/issuehistory.tmpl
index d3ed281..ad4b610 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/issuehistory.tmpl
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/issuehistory.tmpl
@@ -7,7 +7,7 @@
 <!-- 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/catalogue/search.pl">Catalog</a>  &rsaquo; Checkout History for <i><!-- TMPL_VAR NAME="title" --></i></div>
+<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/catalogue/search.pl">Catalog</a> &rsaquo; <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->"><!-- TMPL_VAR NAME="title" --></a> &rsaquo; Checkout History</div>
 
 <div id="doc3" class="yui-t2">
    
@@ -15,18 +15,17 @@
 	<div id="yui-main">
 	<div class="yui-b">
 
-<h1>Checkout history for <!-- TMPL_VAR NAME="title" --> <!-- TMPL_IF NAME="author" -->(<!-- TMPL_VAR NAME="author" -->)<!-- /TMPL_IF --> </h1>
+<h1>Checkout history for <em><!-- TMPL_VAR NAME="title" --></em> <!-- TMPL_IF NAME="author" -->(<!-- TMPL_VAR NAME="author" -->)<!-- /TMPL_IF --> </h1>
 
 <div class="searchresults">
     <!-- TMPL_IF NAME="issues" -->
         <p><b>Has been checked out <!-- TMPL_VAR NAME="total" --> times</b></p>
         <table>
             <tr><th>Date</th>
-            <th>Surname</th>
-            <th>Firstname</th>
+            <th>Name</th>
             <th>Barcode</th>
             <th>Library</th>
-            <th>Issuing Library</th>
+            <th>Circulating Library</th>
             <th>Renew</th>
             <th>Date due</th>
             <th>Return date</th></tr>
@@ -39,16 +38,11 @@
                     <!-- /TMPL_IF --></td>
                 <td><!-- TMPL_IF NAME="surname" -->
                         <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=<!-- TMPL_VAR NAME="borrowernumber" -->">
-                            <!-- TMPL_VAR NAME="surname" -->
+                            <!-- TMPL_VAR NAME="surname" --><!-- TMPL_IF NAME="firstname" -->, <!-- firstname --><!-- TMPL_VAR NAME="firstname" --> <!-- /TMPL_IF -->
                         </a>
                     <!-- TMPL_ELSE -->
                         &nbsp;
                     <!-- /TMPL_IF --></td>
-                <td><!-- TMPL_IF NAME="firstname" -->
-                        <!-- TMPL_VAR NAME="firstname" -->
-                    <!-- TMPL_ELSE -->
-                        &nbsp;
-                    <!-- /TMPL_IF --></td>
                 <td><!-- TMPL_IF NAME="barcode" -->
                         <!-- TMPL_VAR NAME="barcode" -->
                     <!-- TMPL_ELSE -->
@@ -88,8 +82,7 @@
         <!-- /TMPL_LOOP -->
 		</table>
     <!-- TMPL_ELSE -->
-        <p>
-        <b><!-- TMPL_VAR NAME="title" -->(<!-- TMPL_VAR NAME="author" -->)</b> <span class="problem">has never been checked out.</span></p>
+        <div class="dialog message"><em><!-- TMPL_VAR NAME="title" --></em><!-- TMPL_IF NAME="author" -->, by <!-- TMPL_VAR NAME="author" --><!-- /TMPL_IF --> has never been checked out.</div>
         
     <!-- /TMPL_IF -->
 </div>
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tmpl
index 21b9957..11dc5cd 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tmpl
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tmpl
@@ -140,7 +140,7 @@
 
                 <li><span class="label">Total Renewals:</span> <!-- TMPL_VAR NAME="renewals" -->&nbsp;</li>
 
-                <li><span class="label">Total Checkouts:</span><!-- TMPL_IF NAME="issues" --><!-- TMPL_VAR NAME="issues" --><!-- TMPL_ELSE -->0<!-- /TMPL_IF -->  (<a href="/cgi-bin/koha/circ/bookcount.pl?&amp;biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->&amp;bi=<!-- TMPL_VAR NAME="biblioitemnumber" -->&amp;itm=<!-- TMPL_VAR NAME="itemnumber" -->">View Circulation History</a>)</li>
+                <li><span class="label">Total Checkouts:</span><!-- TMPL_IF NAME="issues" --><!-- TMPL_VAR NAME="issues" --><!-- TMPL_ELSE -->0<!-- /TMPL_IF -->  (<a href="/cgi-bin/koha/catalogue/issuehistory.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->">View Circulation History</a>)</li>
 
 
                 <li><span class="label">Last seen:</span> <!-- TMPL_VAR NAME="datelastseen" -->&nbsp;</li>
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/bookcount.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/bookcount.tmpl
deleted file mode 100644
index 7116629..0000000
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/bookcount.tmpl
+++ /dev/null
@@ -1,71 +0,0 @@
-<!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
-<title>Koha &rsaquo; Circulation &rsaquo; Circulation Statistics for <!-- TMPL_VAR Name="title" --></title>
-<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
-</head>
-<body>
-<!-- TMPL_INCLUDE NAME="header.inc" -->
-<!-- TMPL_INCLUDE NAME="circ-search.inc" -->
-
-<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/circ/circulation-home.pl">Circulation</a> &rsaquo; Circulation Statistics for <!-- TMPL_VAR Name="title" --></div>
-
-<div id="doc3" class="yui-t2">
-   
-   <div id="bd">
-	<div id="yui-main">
-	<div class="yui-b">
-
-
-<h1>
-<!-- TMPL_VAR Name="title" --> <!-- TMPL_IF NAME="author" -->(<!-- TMPL_VAR Name="author" -->)<!-- /TMPL_IF --></a></h1>
-<h2>Barcode <!-- TMPL_VAR Name="barcode" --></h2>
-<div class="tabitem">
-  <form action="/cgi-bin/koha/catalogue/detail.pl" method="get">
-    <input type="hidden" name="biblionumber" value="<!-- TMPL_VAR Name="biblionumber" -->" />
-    <input type="hidden" name="type" value="intra" />
-    <input type="submit" class="submit" value="Brief Display" />
-  </form>
-  <form action="/cgi-bin/koha/catalogue/moredetail.pl" method="get">
-    <input type="hidden" name="type" value="<!-- TMPL_VAR NAME="type" -->" />
-    <input type="hidden" name="item" value="<!-- TMPL_VAR NAME="itemnumber" -->" />
-    <input type="hidden" name="biblionumber" value="<!-- TMPL_VAR NAME="biblionumber" -->" />
-    <input type="hidden" name="bi" value="<!-- TMPL_VAR NAME="biblioitemnumber" -->" /> <input type="submit" class="submit" value="Item Details" />
-  </form>
-  <!-- TMPL_IF NAME="norequests" -->
-  <!-- TMPL_ELSE -->
-  <form action="/cgi-bin/koha/reserve/request.pl" method="get">
-    <input type="hidden" value="<!-- TMPL_VAR name="biblionumber" -->" name="biblionumber">
-    <input type="submit" value="Place Reserve" class="submit" />
-  </form>
-  <!-- /TMPL_IF -->
-</div>
-<table>
-		<tr><th>Home Library: </th><td> <!-- TMPL_VAR Name="homebranch" --> </td></tr>
-		<tr><th>Current Library: </th><td> <!-- TMPL_VAR Name="holdingbranch" --></td></tr>
-		<tr><th>Date arrived at current library: </th><td> <!-- TMPL_VAR Name="lastdate" --> </td></tr>
-		<tr><th>Number of issues since since the above date :</th><td> <!-- TMPL_VAR Name="count" --> </td></tr>
-</table>
-<table>
-			<tr>
-				<th>Library</th>
-				<th>No. of times checked out</th>
-				<th>Library last seen at</th>
-			</tr>
-			<!-- TMPL_LOOP Name="branchloop" -->
-				<tr>
-					<td class="data"><!-- TMPL_VAR Name="branchname" --> </td>
-					<td class="data"><!-- TMPL_VAR Name="issues" --> </td>
-					<td class="data"><!-- TMPL_VAR Name="seen" --> </td>
-				</tr>
-			<!-- /TMPL_LOOP -->
-		</table>
-		</td>
-	</tr>
-</table>
-
-</div>
-</div>
-<div class="yui-b">
-<!-- TMPL_INCLUDE NAME="circ-menu.inc" -->
-</div>
-</div>
-<!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->
-- 
1.5.5.GIT




More information about the Koha-patches mailing list