}
});
}
-$(window).load(function() {
- verify_images();
-});
-<!-- /TMPL_IF -->
-
var q_array = new Array(); // will hold search terms, if present
$(window).load(function() {
return false;
} else if($("#addto").find("option:selected").attr("value") == "newlist"){
if (vShelfAdd()) {
- Dopop('/cgi-bin/koha/virtualshelves/addbybiblionumber.pl?newshelf=1&confirm=1&' + vShelfAdd());
+ Dopop('/cgi-bin/koha/virtualshelves/addbybiblionumber.pl?newshelf=1&' + vShelfAdd());
}
return false;
}
</h4>
<!-- /TMPL_UNLESS -->
-<!-- TMPL_IF NAME="CGIvirtualshelves" --><form name="f1" method="post" action="/cgi-bin/koha/virtualshelves/addbybiblionumber.pl">
+<!-- TMPL_IF NAME="CGIvirtualshelves" --><!-- TMPL_UNLESS NAME="newshelf" --><form name="f1" method="post" action="/cgi-bin/koha/virtualshelves/addbybiblionumber.pl">
<!-- TMPL_UNLESS NAME="biblionumbers" -->
<input type="hidden" name="biblionumber" value="<!-- TMPL_VAR NAME="biblionumber" -->" />
<!-- TMPL_ELSE -->
<input type="hidden" name="biblionumbers" value="<!-- TMPL_VAR NAME="biblionumbers" -->" />
<!-- /TMPL_UNLESS -->
+ <input type="hidden" name="confirmed" value="1" /></fieldset>
<fieldset class="rows">
<legend>Select an existing list</legend>
<ol>
<li><label>Choose list</label><!-- TMPL_VAR NAME="CGIvirtualshelves" --></li>
</ol>
+ <!-- TMPL_LOOP NAME="biblios" --><input type="hidden" name="biblionumber" value="<!-- TMPL_VAR NAME="biblionumber" -->"><!-- /TMPL_LOOP -->
<!-- TMPL_UNLESS NAME="biblionumbers" -->
<input type="hidden" name="biblionumber" value="<!-- TMPL_VAR NAME="biblionumber" -->" />
<!-- TMPL_ELSE -->
<fieldset class="action"><input type="submit" value="Save" class="submit" /></fieldset>
</fieldset>
</form>
-<h4>...or...</h4><!-- /TMPL_IF -->
-
+<h4>...or...</h4><!-- /TMPL_UNLESS --><!-- /TMPL_IF -->
+<!-- TMPL_UNLESS NAME="shelfnumber" -->
<form name="f2" method="post" action="/cgi-bin/koha/virtualshelves/addbybiblionumber.pl">
<fieldset class="rows"><legend>Add to a new list:</legend>
<ol><li>
<label for="newvirtualshelf">
List name:
</label>
+ <!-- TMPL_LOOP NAME="biblios" --><input type="hidden" name="biblionumber" value="<!-- TMPL_VAR NAME="biblionumber" -->"><!-- /TMPL_LOOP -->
<!-- TMPL_UNLESS NAME="biblionumbers" -->
<input type="hidden" name="biblionumber" id="biblionumber" value="<!-- TMPL_VAR NAME="biblionumber" -->" />
<!-- TMPL_ELSE -->
<input type="hidden" name="biblionumbers" id="biblionumbers" value="<!-- TMPL_VAR NAME="biblionumbers" -->" />
<!-- /TMPL_UNLESS -->
<input type="text" name="newvirtualshelf" id="newvirtualshelf" size="40" />
+ <input type="hidden" name="confirmed" value="1" />
</li>
<li>
<label for="category">Category:</label>
<select name="category" id="category">
<option value="1">Private</option>
<option value="2">Public</option>
- <option value="3">Free</option>
+ <option value="3">Free</option>
</select>
</li></ol>
<fieldset class="action"><input type="submit" value="Save" class="submit" /></fieldset> </fieldset>
</form>
+<!-- /TMPL_UNLESS -->
<!-- /TMPL_IF -->
</div>
if this script has to add a shelf, it add one with this category.
+=item newshelf
+
+ if this parameter exists, then we create a new shelf
+
=back
=cut
my $shelfnumber = $query->param('shelfnumber');
my $newvirtualshelf = $query->param('newvirtualshelf');
+my $newshelf = $query->param('newshelf');
my $category = $query->param('category');
my $sortfield = $query->param('sortfield');
my $confirmed = $query->param('confirmed') || 0;
@biblionumbers = (@biblionumber);
}
-$shelfnumber = AddShelf( $newvirtualshelf, $loggedinuser, $category, $sortfield )
- if $newvirtualshelf;
+$shelfnumber = AddShelf( $newvirtualshelf, $loggedinuser, $category, $sortfield ) if $newvirtualshelf;
if ( $shelfnumber || ( $shelfnumber == -1 ) ) { # the shelf already exist.
if ($confirmed == 1) {
push( @shelvesloop, $shelf->{shelfnumber} );
$shelvesloop{$shelf->{shelfnumber}} = $shelf->{shelfname};
}
+
if(@shelvesloop gt 0){
my $CGIvirtualshelves = CGI::scrolling_list
(
CGIvirtualshelves => $CGIvirtualshelves,
);
}
-
- unless ($biblionumbers) {
+ my @biblios;
+ for my $bib (@biblionumber) {
+ my $data = GetBiblioData( $bib );
+ push(@biblios,
+ { biblionumber => $bib,
+ title => $data->{'title'},
+ author => $data->{'author'},
+ } );
+ }
+ $template->param(
+ newshelf => $newshelf,
+ biblios=>\@biblios,
+ multiple => (scalar(@biblionumber) > 1),
+ total => scalar(@biblionumber),
+ );
+
+ unless (@biblionumbers) {
my ( $bibliocount, @biblios ) = GetBiblio($biblionumber);
$template->param