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 {
|
} else {
|
||||||
getstr = "itemnumber="+itemnum;
|
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;
|
window.opener.location.href = myurl;
|
||||||
}
|
}
|
||||||
function add_item3(i_itemnumber){
|
function add_item3(i_itemnumber){
|
||||||
|
@ -48,17 +50,17 @@ function add_item3(i_itemnumber){
|
||||||
<div class="results">
|
<div class="results">
|
||||||
<!-- TMPL_IF EXPR="displayprev || displaynext" --><p>
|
<!-- TMPL_IF EXPR="displayprev || displaynext" --><p>
|
||||||
<!-- TMPL_IF NAME="displayprev" -->
|
<!-- 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_IF -->
|
||||||
<!-- TMPL_LOOP NAME="numbers" -->
|
<!-- TMPL_LOOP NAME="numbers" -->
|
||||||
<!-- TMPL_IF NAME="highlight" -->
|
<!-- TMPL_IF NAME="highlight" -->
|
||||||
<span class="current"><!-- TMPL_VAR NAME="number" --></span>
|
<span class="current"><!-- TMPL_VAR NAME="number" --></span>
|
||||||
<!-- TMPL_ELSE -->
|
<!-- 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_IF -->
|
||||||
<!-- /TMPL_LOOP -->
|
<!-- /TMPL_LOOP -->
|
||||||
<!-- TMPL_IF NAME="displaynext" -->
|
<!-- 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 -->
|
<!-- /TMPL_IF -->
|
||||||
</p><!-- /TMPL_IF -->
|
</p><!-- /TMPL_IF -->
|
||||||
<p>
|
<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_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_barcode" --><td align="center"><!-- TMPL_VAR name="i_barcode" --></td><!-- /TMPL_IF -->
|
||||||
<!-- TMPL_IF name="i_itemnumber2" --><td align="center">
|
<!-- 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 -->
|
<!-- /TMPL_IF -->
|
||||||
<!-- /NEW -->
|
<!-- /NEW -->
|
||||||
<!-- /TMPL_LOOP --><!-- item -->
|
<!-- /TMPL_LOOP --><!-- item -->
|
||||||
|
@ -109,17 +111,17 @@ function add_item3(i_itemnumber){
|
||||||
<div class="results">
|
<div class="results">
|
||||||
<p>
|
<p>
|
||||||
<!-- TMPL_IF NAME="displayprev" -->
|
<!-- 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_IF -->
|
||||||
<!-- TMPL_LOOP NAME="numbers" -->
|
<!-- TMPL_LOOP NAME="numbers" -->
|
||||||
<!-- TMPL_IF NAME="highlight" -->
|
<!-- TMPL_IF NAME="highlight" -->
|
||||||
<span class="current"><!-- TMPL_VAR NAME="number" --></span>
|
<span class="current"><!-- TMPL_VAR NAME="number" --></span>
|
||||||
<!-- TMPL_ELSE -->
|
<!-- 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_IF -->
|
||||||
<!-- /TMPL_LOOP -->
|
<!-- /TMPL_LOOP -->
|
||||||
<!-- TMPL_IF NAME="displaynext" -->
|
<!-- 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 -->
|
<!-- /TMPL_IF -->
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -40,10 +40,10 @@ my $startlabel = $query->param('startlabel');
|
||||||
my $printingtype = $query->param('printingtype');
|
my $printingtype = $query->param('printingtype');
|
||||||
my $guidebox = $query->param('guidebox');
|
my $guidebox = $query->param('guidebox');
|
||||||
my $fontsize = $query->param('fontsize');
|
my $fontsize = $query->param('fontsize');
|
||||||
my $formatstring = $query->param('formatstring');
|
my $formatstring = $query->param('formatstring');
|
||||||
|
my $batch_type = $query->param('type') || 'labels';
|
||||||
my @itemnumber;
|
my @itemnumber;
|
||||||
($query->param('type') eq 'labels') ? (@itemnumber = $query->param('itemnumber')) : (@itemnumber = $query->param('borrowernumber'));
|
($batch_type eq 'labels') ? (@itemnumber = $query->param('itemnumber')) : (@itemnumber = $query->param('borrowernumber'));
|
||||||
my $batch_type = $query->param('type');
|
|
||||||
|
|
||||||
# little block for displaying active layout/template/batch in templates
|
# 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
|
# 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
|
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);
|
my $sth2 = $dbh->prepare($query2);
|
||||||
for my $inum (@itemnumber) {
|
for my $inum (@itemnumber) {
|
||||||
# warn "INSERTing " . (($batch_type eq 'labels') ? 'itemnumber' : 'borrowernumber') . ":$inum for batch $batch_id";
|
# 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(message_loop => \@complex);
|
||||||
}
|
}
|
||||||
$template->param(
|
$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_id => $batch_id,
|
||||||
batch_count => scalar @resultsloop,
|
batch_count => scalar @resultsloop,
|
||||||
active_layout_name => $active_layout_name,
|
active_layout_name => $active_layout_name,
|
||||||
|
|
Loading…
Reference in a new issue