Cleanup transferstoreceive.pl and .tmpl
Removed unused variables. Replaced EXPR. Inserted hidden span to correct tablesorter behavior on title field. Without this patch because of the link href in the cell, the sort would end up being effectively on biblionumber, not title. Mostly whitespace edits in template. Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
This commit is contained in:
parent
6d75e726d5
commit
3c9ed58cba
2 changed files with 67 additions and 75 deletions
|
@ -19,10 +19,11 @@
|
||||||
# Suite 330, Boston, MA 02111-1307 USA
|
# Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
|
use warnings;
|
||||||
use CGI;
|
use CGI;
|
||||||
use C4::Context;
|
use C4::Context;
|
||||||
use C4::Output;
|
use C4::Output;
|
||||||
use C4::Branch;
|
use C4::Branch; # GetBranches
|
||||||
use C4::Auth;
|
use C4::Auth;
|
||||||
use C4::Dates qw/format_date/;
|
use C4::Dates qw/format_date/;
|
||||||
use C4::Biblio;
|
use C4::Biblio;
|
||||||
|
@ -38,8 +39,6 @@ use C4::Koha;
|
||||||
use C4::Reserves;
|
use C4::Reserves;
|
||||||
|
|
||||||
my $input = new CGI;
|
my $input = new CGI;
|
||||||
|
|
||||||
my $theme = $input->param('theme'); # only used if allowthemeoverride is set
|
|
||||||
my $itemnumber = $input->param('itemnumber');
|
my $itemnumber = $input->param('itemnumber');
|
||||||
|
|
||||||
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
|
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
|
||||||
|
@ -79,9 +78,8 @@ foreach my $br ( keys %$branches ) {
|
||||||
C4::Context->preference('TransfersMaxDaysWarning'));
|
C4::Context->preference('TransfersMaxDaysWarning'));
|
||||||
my $calcDate = Date_to_Days( $sent_year, $sent_month, $sent_day );
|
my $calcDate = Date_to_Days( $sent_year, $sent_month, $sent_day );
|
||||||
my $today = Date_to_Days(&Today);
|
my $today = Date_to_Days(&Today);
|
||||||
my $warning = ( $today > $calcDate );
|
|
||||||
|
|
||||||
if ( $warning > 0 ) {
|
if ($today > $calcDate) {
|
||||||
$getransf{'messcompa'} = 1;
|
$getransf{'messcompa'} = 1;
|
||||||
}
|
}
|
||||||
my $gettitle = GetBiblioFromItemNumber( $num->{'itemnumber'} );
|
my $gettitle = GetBiblioFromItemNumber( $num->{'itemnumber'} );
|
||||||
|
@ -93,19 +91,15 @@ foreach my $br ( keys %$branches ) {
|
||||||
$getransf{$_} = $gettitle->{$_};
|
$getransf{$_} = $gettitle->{$_};
|
||||||
}
|
}
|
||||||
|
|
||||||
# we check if we have a reserv for this transfer
|
# we check if we have a reserv for this transfer
|
||||||
my @checkreserv = GetReservesFromItemnumber($num->{'itemnumber'} );
|
my @checkreserv = GetReservesFromItemnumber($num->{'itemnumber'} );
|
||||||
if ( $checkreserv[0] ) {
|
if ( $checkreserv[0] ) {
|
||||||
my $getborrower =
|
my $getborrower = GetMemberDetails( $checkreserv[1] );
|
||||||
GetMemberDetails( $checkreserv[1] );
|
$getransf{'borrowernum'} = $getborrower->{'borrowernumber'};
|
||||||
$getransf{'borrowernum'} = $getborrower->{'borrowernumber'};
|
$getransf{'borrowername'} = $getborrower->{'surname'};
|
||||||
$getransf{'borrowername'} = $getborrower->{'surname'};
|
|
||||||
$getransf{'borrowerfirstname'} = $getborrower->{'firstname'};
|
$getransf{'borrowerfirstname'} = $getborrower->{'firstname'};
|
||||||
if ( $getborrower->{'emailaddress'} ) {
|
$getransf{'borrowermail'} = $getborrower->{'emailaddress'} if $getborrower->{'emailaddress'};
|
||||||
$getransf{'borrowermail'} = $getborrower->{'emailaddress'};
|
$getransf{'borrowerphone'} = $getborrower->{'phone'};
|
||||||
}
|
|
||||||
$getransf{'borrowerphone'} = $getborrower->{'phone'};
|
|
||||||
|
|
||||||
}
|
}
|
||||||
push( @transferloop, \%getransf );
|
push( @transferloop, \%getransf );
|
||||||
}
|
}
|
||||||
|
@ -119,7 +113,7 @@ foreach my $br ( keys %$branches ) {
|
||||||
$template->param(
|
$template->param(
|
||||||
branchesloop => \@branchesloop,
|
branchesloop => \@branchesloop,
|
||||||
show_date => format_date(C4::Dates->today('iso')),
|
show_date => format_date(C4::Dates->today('iso')),
|
||||||
dateformat => C4::Context->preference("dateformat"),
|
'dateformat_' . (C4::Context->preference("dateformat") || '') => 1,
|
||||||
);
|
);
|
||||||
|
|
||||||
output_html_with_http_headers $input, $cookie, $template->output;
|
output_html_with_http_headers $input, $cookie, $template->output;
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<title>Koha › Circulation › Transfers to your library</title>
|
<title>Koha › Circulation › Transfers to your library</title>
|
||||||
<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
|
<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
|
||||||
<script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
|
<script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
|
||||||
<script type="text/JavaScript" language="JavaScript">
|
<script type="text/javascript" language="JavaScript">
|
||||||
//<![CDATA[
|
//<![CDATA[
|
||||||
$.tablesorter.addParser({
|
$.tablesorter.addParser({
|
||||||
id: 'articles',
|
id: 'articles',
|
||||||
|
@ -10,16 +10,16 @@ $.tablesorter.addParser({
|
||||||
format: function(s) { return s.toLowerCase().replace(/^(the|an|a) /,''); },
|
format: function(s) { return s.toLowerCase().replace(/^(the|an|a) /,''); },
|
||||||
type: 'text'
|
type: 'text'
|
||||||
});
|
});
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
<!-- TMPL_LOOP NAME="branchesloop" -->
|
<!-- TMPL_LOOP NAME="branchesloop" -->
|
||||||
$.tablesorter.defaults.widgets = ['zebra'];
|
$.tablesorter.defaults.widgets = ['zebra'];
|
||||||
$("#transferst<!-- TMPL_VAR NAME="branchcode" -->").tablesorter({<!-- TMPL_IF EXPR="dateformat eq 'metric'" -->
|
$("#transferst<!-- TMPL_VAR NAME="branchcode" -->").tablesorter({<!-- TMPL_IF ="dateformat_metric" -->
|
||||||
dateFormat: 'uk',<!-- /TMPL_IF -->
|
dateFormat: 'uk',<!-- /TMPL_IF -->
|
||||||
sortList: [[1,0]],
|
sortList: [[1,0]],
|
||||||
headers: { 1: { sorter: 'articles' },4:{sorter:false}}
|
headers: { 1: { sorter: 'articles' },4:{sorter:false}}
|
||||||
});
|
});
|
||||||
<!-- /TMPL_LOOP -->
|
<!-- /TMPL_LOOP -->
|
||||||
});
|
});
|
||||||
//]]>
|
//]]>
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
|
@ -35,63 +35,61 @@ $.tablesorter.addParser({
|
||||||
<div id="yui-main">
|
<div id="yui-main">
|
||||||
<div class="yui-g">
|
<div class="yui-g">
|
||||||
|
|
||||||
|
|
||||||
<h1>Transfers made to your library on : <!-- TMPL_VAR NAME="show_date" --></h1>
|
<h1>Transfers made to your library on : <!-- TMPL_VAR NAME="show_date" --></h1>
|
||||||
<!-- TMPL_IF name="branchesloop" -->
|
<!-- TMPL_IF name="branchesloop" -->
|
||||||
<p>Your library is the destination for the following transfer(s)</p>
|
<p>Your library is the destination for the following transfer(s)</p>
|
||||||
<div id="resultlist">
|
<div id="resultlist">
|
||||||
<!-- TMPL_LOOP NAME="branchesloop" -->
|
<!-- TMPL_LOOP NAME="branchesloop" -->
|
||||||
<!-- TMPL_IF NAME="branchcode" -->
|
<!-- TMPL_IF NAME="branchcode" -->
|
||||||
<table style="width: 100%" id="transferst<!-- TMPL_VAR NAME="branchcode" -->">
|
<table style="width: 100%" id="transferst<!-- TMPL_VAR NAME="branchcode" -->">
|
||||||
<caption>Coming from <!-- TMPL_VAR NAME="branchname" --></caption>
|
<caption>Coming from <!-- TMPL_VAR NAME="branchname" --></caption>
|
||||||
<thead><tr>
|
<thead><tr>
|
||||||
<th>Date of transfer</th>
|
<th>Date of transfer</th>
|
||||||
<th>Title</th>
|
<th>Title</th>
|
||||||
<th>Reserved by </th>
|
<th>Reserved by </th>
|
||||||
<th>Location</th>
|
<th>Location</th>
|
||||||
</tr></thead>
|
</tr></thead>
|
||||||
<tbody><!-- TMPL_LOOP NAME="reserv" -->
|
<tbody><!-- TMPL_LOOP NAME="reserv" -->
|
||||||
<!-- TMPL_IF NAME="messcompa" -->
|
<!-- TMPL_IF NAME="messcompa" -->
|
||||||
<tr class="problem">
|
<tr class="problem">
|
||||||
<!-- TMPL_ELSE -->
|
<!-- TMPL_ELSE -->
|
||||||
<tr>
|
<tr>
|
||||||
<!-- /TMPL_IF -->
|
<!-- /TMPL_IF -->
|
||||||
<td><p><!-- TMPL_VAR NAME="datetransfer" --></p> <!-- TMPL_IF NAME="messcompa" --> check this transfer<!-- /TMPL_IF --></td>
|
<td><p><!-- TMPL_VAR NAME="datetransfer" --></p> <!-- TMPL_IF NAME="messcompa" -->check this transfer<!-- /TMPL_IF --></td>
|
||||||
<td><!-- TMPL_IF name="BiblioDefaultViewmarc" -->
|
<td><span style="display:none;"><!-- TMPL_VAR NAME="title" escape="html" --></span><!-- invisible title for tablesorter -->
|
||||||
|
<!-- TMPL_IF name="BiblioDefaultViewmarc" -->
|
||||||
<a href="/cgi-bin/koha/catalogue/MARCdetail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" ESCAPE="URL" -->"><!-- TMPL_VAR NAME="title" escape="html" --></a>
|
<a href="/cgi-bin/koha/catalogue/MARCdetail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" ESCAPE="URL" -->"><!-- TMPL_VAR NAME="title" escape="html" --></a>
|
||||||
<!-- TMPL_ELSIF NAME="BiblioDefaultViewisbd" -->
|
<!-- TMPL_ELSIF NAME="BiblioDefaultViewisbd" -->
|
||||||
<a href="/cgi-bin/koha/catalogue/ISBDdetail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" ESCAPE="URL" -->"><!-- TMPL_VAR NAME="title" escape="html" --></a>
|
<a href="/cgi-bin/koha/catalogue/ISBDdetail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" ESCAPE="URL" -->"><!-- TMPL_VAR NAME="title" escape="html" --></a>
|
||||||
<!-- TMPL_ELSE -->
|
<!-- TMPL_ELSE -->
|
||||||
<a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" ESCAPE="URL" -->"><!-- TMPL_VAR NAME="title" escape="html" --> <!-- TMPL_VAR NAME="subtitle" --></a><!-- /TMPL_IF -->
|
<a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" ESCAPE="URL" -->"><!-- TMPL_VAR NAME="title" escape="html" --> <!-- TMPL_VAR NAME="subtitle" --></a><!-- /TMPL_IF -->
|
||||||
(<b><!-- TMPL_VAR NAME="itemtype" --> </b>)
|
(<b><!-- TMPL_VAR NAME="itemtype" --></b>)
|
||||||
<br />Barcode : <!-- TMPL_VAR NAME="barcode" -->
|
<br />Barcode: <!-- TMPL_VAR NAME="barcode" -->
|
||||||
</td>
|
</td>
|
||||||
<td><!-- TMPL_IF NAME="borrowername" -->
|
<td><!-- TMPL_IF NAME="borrowername" -->
|
||||||
<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=<!--TMPL_VAR Name="borrowernum"-->">
|
<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=<!--TMPL_VAR Name="borrowernum"-->">
|
||||||
<!-- TMPL_VAR NAME="borrowername" --> <!-- TMPL_VAR NAME="borrowerfirstname" -->
|
<!-- TMPL_VAR NAME="borrowername" --> <!-- TMPL_VAR NAME="borrowerfirstname" -->
|
||||||
|
</a>
|
||||||
|
<br /><!-- TMPL_VAR NAME="borrowerphone" --><br />
|
||||||
|
<!-- TMPL_IF NAME="borrowermail" -->
|
||||||
|
<a href="mailto:<!-- TMPL_VAR NAME="email" -->?subject=Reservation: <!-- TMPL_VAR NAME="title" -->">
|
||||||
|
<!-- TMPL_VAR NAME="borrowermail" -->
|
||||||
</a>
|
</a>
|
||||||
<br /><!-- TMPL_VAR NAME="borrowerphone" --><br />
|
<!--/TMPL_IF-->
|
||||||
<!-- TMPL_IF NAME="borrowermail" -->
|
|
||||||
<a href="mailto:<!-- TMPL_VAR NAME="email" -->?subject=Reservation: <!-- TMPL_VAR NAME="title" -->">
|
|
||||||
<!-- TMPL_VAR NAME="borrowermail" -->
|
|
||||||
</a>
|
|
||||||
<!--/TMPL_IF-->
|
|
||||||
<!-- TMPL_ELSE -->
|
<!-- TMPL_ELSE -->
|
||||||
<p>
|
<p>None</p>
|
||||||
None
|
<!-- /TMPL_IF -->
|
||||||
</p>
|
</td>
|
||||||
<!-- /TMPL_IF -->
|
<td><!-- TMPL_VAR NAME="homebranch" --> <!-- TMPL_VAR NAME="itemcallnumber" --></td>
|
||||||
</td>
|
</tr>
|
||||||
<td><!-- TMPL_VAR NAME="homebranch" --> <!-- TMPL_VAR NAME="itemcallnumber" --></td>
|
<!-- /TMPL_LOOP --></tbody>
|
||||||
</tr>
|
</table>
|
||||||
<!-- /TMPL_LOOP --> </tbody>
|
<!-- /TMPL_IF -->
|
||||||
</table>
|
<!-- /TMPL_LOOP -->
|
||||||
<!-- /TMPL_IF -->
|
</div>
|
||||||
<!-- /TMPL_LOOP -->
|
<!-- TMPL_ELSE -->
|
||||||
</div>
|
<p>No transfers to receive</p>
|
||||||
<!-- TMPL_ELSE -->
|
<!-- /TMPL_IF -->
|
||||||
<p>No transfers to receive</p>
|
|
||||||
<!-- /TMPL_IF -->
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue