BUGFIX labels - Adding labels was failing because of faulty "type" selection.
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
This commit is contained in:
parent
a7b8359a45
commit
e5cd4004b5
2 changed files with 15 additions and 13 deletions
|
@ -30,7 +30,9 @@ function add_item(itemnum,batch_id,type_id){
|
|||
} else {
|
||||
getstr = "itemnumber="+itemnum;
|
||||
}
|
||||
var myurl = "label-manager.pl?op=add&batch_id="+batch_id+"&type="+type_id+"&"+getstr;
|
||||
var myurl = "label-manager.pl?op=add&batch_id="+batch_id+
|
||||
// "&type="+type_id+ // The template variable NAME="TYPE" is RESERVED ('opac' or 'intranet').
|
||||
"&"+getstr;
|
||||
window.opener.location.href = myurl;
|
||||
}
|
||||
function add_item3(i_itemnumber){
|
||||
|
@ -48,17 +50,17 @@ function add_item3(i_itemnumber){
|
|||
<div class="results">
|
||||
<!-- TMPL_IF EXPR="displayprev || displaynext" --><p>
|
||||
<!-- TMPL_IF NAME="displayprev" -->
|
||||
<a href="label-item-search.pl?startfrom=<!-- TMPL_VAR NAME="startfromprev" -->&<!-- TMPL_LOOP NAME=searchdata --><!-- TMPL_VAR NAME="term" -->=<!-- TMPL_VAR name="val" ESCAPE=URL -->&<!-- /TMPL_LOOP -->resultsperpage=<!-- TMPL_VAR NAME="resultsperpage" -->&type=intranet&op=do_search&batch_id=<!-- TMPL_VAR NAME="batch_id" -->"><<</a>
|
||||
<a href="label-item-search.pl?startfrom=<!-- TMPL_VAR NAME="startfromprev" -->&<!-- TMPL_LOOP NAME=searchdata --><!-- TMPL_VAR NAME="term" -->=<!-- TMPL_VAR name="val" ESCAPE=URL -->&<!-- /TMPL_LOOP -->resultsperpage=<!-- TMPL_VAR NAME="resultsperpage" -->&op=do_search&batch_id=<!-- TMPL_VAR NAME="batch_id" -->"><<</a>
|
||||
<!-- /TMPL_IF -->
|
||||
<!-- TMPL_LOOP NAME="numbers" -->
|
||||
<!-- TMPL_IF NAME="highlight" -->
|
||||
<span class="current"><!-- TMPL_VAR NAME="number" --></span>
|
||||
<!-- TMPL_ELSE -->
|
||||
<a href="label-item-search.pl?startfrom=<!-- TMPL_VAR NAME=startfrom -->&<!-- TMPL_LOOP NAME=searchdata --><!-- TMPL_VAR NAME="term" -->=<!-- TMPL_VAR name="val" ESCAPE=URL -->&<!-- /TMPL_LOOP -->resultsperpage=<!-- TMPL_VAR NAME="resultsperpage" -->&type=intranet&op=do_search&batch_id=<!-- TMPL_VAR NAME="batch_id" -->"><!-- TMPL_VAR NAME="number" --></a>
|
||||
<a href="label-item-search.pl?startfrom=<!-- TMPL_VAR NAME=startfrom -->&<!-- TMPL_LOOP NAME=searchdata --><!-- TMPL_VAR NAME="term" -->=<!-- TMPL_VAR name="val" ESCAPE=URL -->&<!-- /TMPL_LOOP -->resultsperpage=<!-- TMPL_VAR NAME="resultsperpage" -->&op=do_search&batch_id=<!-- TMPL_VAR NAME="batch_id" -->"><!-- TMPL_VAR NAME="number" --></a>
|
||||
<!-- /TMPL_IF -->
|
||||
<!-- /TMPL_LOOP -->
|
||||
<!-- TMPL_IF NAME="displaynext" -->
|
||||
<a href="label-item-search.pl?startfrom=<!-- TMPL_VAR NAME="startfromnext" -->&<!-- TMPL_LOOP NAME=searchdata --><!-- TMPL_VAR NAME="term" -->=<!-- TMPL_VAR name="val" ESCAPE=URL -->&<!-- /TMPL_LOOP -->&resultsperpage=<!-- TMPL_VAR NAME="resultsperpage" -->&type=intranet&op=do_search&batch_id=<!-- TMPL_VAR NAME="batch_id" -->">>></a>
|
||||
<a href="label-item-search.pl?startfrom=<!-- TMPL_VAR NAME="startfromnext" -->&<!-- TMPL_LOOP NAME=searchdata --><!-- TMPL_VAR NAME="term" -->=<!-- TMPL_VAR name="val" ESCAPE=URL -->&<!-- /TMPL_LOOP -->&resultsperpage=<!-- TMPL_VAR NAME="resultsperpage" -->&op=do_search&batch_id=<!-- TMPL_VAR NAME="batch_id" -->">>></a>
|
||||
<!-- /TMPL_IF -->
|
||||
</p><!-- /TMPL_IF -->
|
||||
<p>
|
||||
|
@ -98,7 +100,7 @@ function add_item3(i_itemnumber){
|
|||
<!-- TMPL_IF name="i_dateaccessioned" --><td align="center"><!-- TMPL_VAR name="i_dateaccessioned" --><br /></td><!-- /TMPL_IF -->
|
||||
<!-- TMPL_IF name="i_barcode" --><td align="center"><!-- TMPL_VAR name="i_barcode" --></td><!-- /TMPL_IF -->
|
||||
<!-- TMPL_IF name="i_itemnumber2" --><td align="center">
|
||||
<a onclick="add_item('<!-- TMPL_VAR NAME="i_itemnumber2" -->',<!-- TMPL_VAR NAME="batch_id" -->, '<!-- TMPL_VAR NAME="type" -->'); return false" href="/cgi-bin/koha/barcodes/label-manager.pl?itemnumber=<!-- TMPL_VAR NAME="i_itemnumber2" -->&batch_id=<!-- TMPL_VAR name="batch_id" -->&type=<!-- TMPL_VAR NAME="type" -->&op=add">Add</a></td>
|
||||
<a onclick="add_item('<!-- TMPL_VAR NAME="i_itemnumber2" -->',<!-- TMPL_VAR NAME="batch_id" -->, '<!-- TMPL_VAR NAME="type" -->'); return false" href="/cgi-bin/koha/barcodes/label-manager.pl?itemnumber=<!-- TMPL_VAR NAME="i_itemnumber2" -->&batch_id=<!-- TMPL_VAR name="batch_id" -->&op=add">Add</a></td>
|
||||
<!-- /TMPL_IF -->
|
||||
<!-- /NEW -->
|
||||
<!-- /TMPL_LOOP --><!-- item -->
|
||||
|
@ -109,17 +111,17 @@ function add_item3(i_itemnumber){
|
|||
<div class="results">
|
||||
<p>
|
||||
<!-- TMPL_IF NAME="displayprev" -->
|
||||
<a href="label-item-search.pl?startfrom=<!-- TMPL_VAR NAME="startfromprev" -->&<!-- TMPL_LOOP NAME=searchdata --><!-- TMPL_VAR NAME="term" -->=<!-- TMPL_VAR name="val" ESCAPE=URL -->&<!-- /TMPL_LOOP -->resultsperpage=<!-- TMPL_VAR NAME="resultsperpage" -->&type=intranet&op=do_search>&batch_id=<!-- TMPL_VAR NAME="batch_id" -->"><<</a>
|
||||
<a href="label-item-search.pl?startfrom=<!-- TMPL_VAR NAME="startfromprev" -->&<!-- TMPL_LOOP NAME=searchdata --><!-- TMPL_VAR NAME="term" -->=<!-- TMPL_VAR name="val" ESCAPE=URL -->&<!-- /TMPL_LOOP -->resultsperpage=<!-- TMPL_VAR NAME="resultsperpage" -->&op=do_search>&batch_id=<!-- TMPL_VAR NAME="batch_id" -->"><<</a>
|
||||
<!-- /TMPL_IF -->
|
||||
<!-- TMPL_LOOP NAME="numbers" -->
|
||||
<!-- TMPL_IF NAME="highlight" -->
|
||||
<span class="current"><!-- TMPL_VAR NAME="number" --></span>
|
||||
<!-- TMPL_ELSE -->
|
||||
<a href="label-item-search.pl?startfrom=<!-- TMPL_VAR NAME=startfrom -->&<!-- TMPL_LOOP NAME=searchdata --><!-- TMPL_VAR NAME="term" -->=<!-- TMPL_VAR name="val" ESCAPE=URL -->&<!-- /TMPL_LOOP -->resultsperpage=<!-- TMPL_VAR NAME="resultsperpage" -->&type=intranet&op=do_search&batch_id=<!-- TMPL_VAR NAME="batch_id" -->"><!-- TMPL_VAR NAME="number" --></a>
|
||||
<a href="label-item-search.pl?startfrom=<!-- TMPL_VAR NAME=startfrom -->&<!-- TMPL_LOOP NAME=searchdata --><!-- TMPL_VAR NAME="term" -->=<!-- TMPL_VAR name="val" ESCAPE=URL -->&<!-- /TMPL_LOOP -->resultsperpage=<!-- TMPL_VAR NAME="resultsperpage" -->&op=do_search&batch_id=<!-- TMPL_VAR NAME="batch_id" -->"><!-- TMPL_VAR NAME="number" --></a>
|
||||
<!-- /TMPL_IF -->
|
||||
<!-- /TMPL_LOOP -->
|
||||
<!-- TMPL_IF NAME="displaynext" -->
|
||||
<a href="label-item-search.pl?startfrom=<!-- TMPL_VAR NAME="startfromnext" -->&<!-- TMPL_LOOP NAME=searchdata --><!-- TMPL_VAR NAME="term" -->=<!-- TMPL_VAR name="val" ESCAPE=URL -->&<!-- /TMPL_LOOP -->&resultsperpage=<!-- TMPL_VAR NAME="resultsperpage" -->&type=intranet&op=do_search&batch_id=<!-- TMPL_VAR NAME="batch_id" -->">>></a>
|
||||
<a href="label-item-search.pl?startfrom=<!-- TMPL_VAR NAME="startfromnext" -->&<!-- TMPL_LOOP NAME=searchdata --><!-- TMPL_VAR NAME="term" -->=<!-- TMPL_VAR name="val" ESCAPE=URL -->&<!-- /TMPL_LOOP -->&resultsperpage=<!-- TMPL_VAR NAME="resultsperpage" -->&op=do_search&batch_id=<!-- TMPL_VAR NAME="batch_id" -->">>></a>
|
||||
<!-- /TMPL_IF -->
|
||||
</p>
|
||||
</div>
|
||||
|
|
|
@ -41,9 +41,9 @@ my $printingtype = $query->param('printingtype');
|
|||
my $guidebox = $query->param('guidebox');
|
||||
my $fontsize = $query->param('fontsize');
|
||||
my $formatstring = $query->param('formatstring');
|
||||
my $batch_type = $query->param('type') || 'labels';
|
||||
my @itemnumber;
|
||||
($query->param('type') eq 'labels') ? (@itemnumber = $query->param('itemnumber')) : (@itemnumber = $query->param('borrowernumber'));
|
||||
my $batch_type = $query->param('type');
|
||||
($batch_type eq 'labels') ? (@itemnumber = $query->param('itemnumber')) : (@itemnumber = $query->param('borrowernumber'));
|
||||
|
||||
# little block for displaying active layout/template/batch in templates
|
||||
# ----------
|
||||
|
@ -112,7 +112,7 @@ elsif ( $op eq 'add_layout' ) {
|
|||
# FIXME: The trinary conditionals here really need to be replaced with a more robust form of db abstraction -fbcit
|
||||
|
||||
elsif ( $op eq 'add' ) { # add item
|
||||
my $query2 = "INSERT INTO $batch_type ( " . (($batch_type eq 'labels') ? 'itemnumber' : 'borrowernumber') . ", batch_id ) values ( ?,? )";
|
||||
my $query2 = "INSERT INTO labels (itemnumber, batch_id) values ( ?,? )";
|
||||
my $sth2 = $dbh->prepare($query2);
|
||||
for my $inum (@itemnumber) {
|
||||
# warn "INSERTing " . (($batch_type eq 'labels') ? 'itemnumber' : 'borrowernumber') . ":$inum for batch $batch_id";
|
||||
|
@ -181,7 +181,7 @@ if (scalar @messages) {
|
|||
$template->param(message_loop => \@complex);
|
||||
}
|
||||
$template->param(
|
||||
type => $batch_type,
|
||||
type => $batch_type, # FIXME: type is an otherwise RESERVED template variable with 2 valid values: 'opac' and 'intranet'
|
||||
batch_id => $batch_id,
|
||||
batch_count => scalar @resultsloop,
|
||||
active_layout_name => $active_layout_name,
|
||||
|
|
Loading…
Reference in a new issue