bug 3263: Staff Search Results Interface Changes
Coding by Rick Welykochy <rick@praxis.com.au>
[1] Three new system preferences to enable particular
bib record views in the staff interface:
viewMARC
viewLabeledMARC
viewISBD
Implements enhancement 2642.
[2] New button in the regular and cataloging search results
pages in the staff interface to allow the operator to redo
the search against Z39.50 targets instead of the Koha database.
[3] Added copyright date and edition to cataloging and Z39.50 search results.
Implements enhancement 2640.
Feature sponsored by MassCat.
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
This commit is contained in:
parent
dbb7456021
commit
17ab0a7532
96
C4/Search.pm
96
C4/Search.pm
|
|
@ -19,7 +19,7 @@ use strict;
|
|||
# use warnings; # FIXME
|
||||
require Exporter;
|
||||
use C4::Context;
|
||||
use C4::Biblio; # GetMarcFromKohaField
|
||||
use C4::Biblio; # GetMarcFromKohaField, GetBiblioData
|
||||
use C4::Koha; # getFacets
|
||||
use Lingua::Stem;
|
||||
use C4::Search::PazPar2;
|
||||
|
|
@ -27,6 +27,7 @@ use XML::Simple;
|
|||
use C4::Dates qw(format_date);
|
||||
use C4::XSLT;
|
||||
use C4::Branch;
|
||||
use URI::Escape;
|
||||
|
||||
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS $DEBUG);
|
||||
|
||||
|
|
@ -1250,6 +1251,9 @@ sub searchResults {
|
|||
$oldbiblio->{normalized_oclc} = GetNormalizedOCLCNumber($marcrecord,$marcflavour);
|
||||
$oldbiblio->{normalized_isbn} = GetNormalizedISBN(undef,$marcrecord,$marcflavour);
|
||||
$oldbiblio->{content_identifier_exists} = 1 if ($oldbiblio->{normalized_isbn} or $oldbiblio->{normalized_oclc} or $oldbiblio->{normalized_ean} or $oldbiblio->{normalized_upc});
|
||||
|
||||
# edition information, if any
|
||||
$oldbiblio->{edition} = $oldbiblio->{editionstatement};
|
||||
$oldbiblio->{description} = $itemtypes{ $oldbiblio->{itemtype} }->{description};
|
||||
# Build summary if there is one (the summary is defined in the itemtypes table)
|
||||
# FIXME: is this used anywhere, I think it can be commented out? -- JF
|
||||
|
|
@ -2109,6 +2113,96 @@ sub NZorder {
|
|||
}
|
||||
}
|
||||
|
||||
=head2 enabled_staff_search_views
|
||||
|
||||
%hash = enabled_staff_search_views()
|
||||
|
||||
This function returns a hash that contains three flags obtained from the system
|
||||
preferences, used to determine whether a particular staff search results view
|
||||
is enabled.
|
||||
|
||||
=over 2
|
||||
|
||||
=item C<Output arg:>
|
||||
|
||||
* $hash{can_view_MARC} is true only if the MARC view is enabled
|
||||
* $hash{can_view_ISBD} is true only if the ISBD view is enabled
|
||||
* $hash{can_view_labeledMARC} is true only if the Labeled MARC view is enabled
|
||||
|
||||
=item C<usage in the script:>
|
||||
|
||||
=back
|
||||
|
||||
$template->param ( C4::Search::enabled_staff_search_views );
|
||||
|
||||
=cut
|
||||
|
||||
sub enabled_staff_search_views
|
||||
{
|
||||
return (
|
||||
can_view_MARC => C4::Context->preference('viewMARC'), # 1 if the staff search allows the MARC view
|
||||
can_view_ISBD => C4::Context->preference('viewISBD'), # 1 if the staff search allows the ISBD view
|
||||
can_view_labeledMARC => C4::Context->preference('viewLabeledMARC'), # 1 if the staff search allows the Labeled MARC view
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
=head2 z3950_search_args
|
||||
|
||||
$arrayref = z3950_search_args($matchpoints)
|
||||
|
||||
This function returns an array reference that contains the search parameters to be
|
||||
passed to the Z39.50 search script (z3950_search.pl). The array elements
|
||||
are hash refs whose keys are name, value and encvalue, and whose values are the
|
||||
name of a search parameter, the value of that search parameter and the URL encoded
|
||||
value of that parameter.
|
||||
|
||||
The search parameter names are lccn, isbn, issn, title, author, dewey and subject.
|
||||
|
||||
The search parameter values are obtained from the bibliographic record whose
|
||||
data is in a hash reference in $matchpoints, as returned by Biblio::GetBiblioData().
|
||||
|
||||
If $matchpoints is a scalar, it is assumed to be an unnamed query descriptor, e.g.
|
||||
a general purpose search argument. In this case, the returned array contains only
|
||||
entry: the key is 'title' and the value and encvalue are derived from $matchpoints.
|
||||
|
||||
If a search parameter value is undefined or empty, it is not included in the returned
|
||||
array.
|
||||
|
||||
The returned array reference may be passed directly to the template parameters.
|
||||
|
||||
=over 2
|
||||
|
||||
=item C<Output arg:>
|
||||
|
||||
* $array containing hash refs as described above
|
||||
|
||||
=item C<usage in the script:>
|
||||
|
||||
=back
|
||||
|
||||
$data = Biblio::GetBiblioData($bibno);
|
||||
$template->param ( MYLOOP => C4::Search::z3950_search_args($data) )
|
||||
|
||||
*OR*
|
||||
|
||||
$template->param ( MYLOOP => C4::Search::z3950_search_args($searchscalar) )
|
||||
|
||||
=cut
|
||||
|
||||
sub z3950_search_args {
|
||||
my $bibrec = shift;
|
||||
$bibrec = { title => $bibrec } if !ref $bibrec;
|
||||
my $array = [];
|
||||
for my $field (qw/ lccn isbn issn title author dewey subject /)
|
||||
{
|
||||
my $encvalue = URI::Escape::uri_escape_utf8($bibrec->{$field});
|
||||
push @$array, { name=>$field, value=>$bibrec->{$field}, encvalue=>$encvalue } if defined $bibrec->{$field};
|
||||
}
|
||||
return $array;
|
||||
}
|
||||
|
||||
|
||||
END { } # module clean-up code here (global destructor)
|
||||
|
||||
1;
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ use C4::Biblio;
|
|||
use C4::Items;
|
||||
use C4::Branch; # GetBranchDetail
|
||||
use C4::Serials; # CountSubscriptionFromBiblionumber
|
||||
|
||||
use C4::Search; # enabled_staff_search_views
|
||||
|
||||
#---- Internal function
|
||||
|
||||
|
|
@ -88,6 +88,8 @@ $template->param (
|
|||
ISBD => $res,
|
||||
biblionumber => $biblionumber,
|
||||
isbdview => 1,
|
||||
z3950_search_params => C4::Search::z3950_search_args(GetBiblioData($biblionumber)),
|
||||
C4::Search::enabled_staff_search_views,
|
||||
);
|
||||
|
||||
output_html_with_http_headers $query, $cookie, $template->output;
|
||||
|
|
|
|||
|
|
@ -55,6 +55,7 @@ use C4::Biblio;
|
|||
use C4::Items;
|
||||
use C4::Acquisition;
|
||||
use C4::Serials; #uses getsubscriptionsfrombiblionumber GetSubscriptionsFromBiblionumber
|
||||
use C4::Search; # enabled_staff_search_views
|
||||
|
||||
|
||||
my $query = new CGI;
|
||||
|
|
@ -316,6 +317,8 @@ $template->param (
|
|||
popup => $popup,
|
||||
hide_marc => C4::Context->preference('hide_marc'),
|
||||
marcview => 1,
|
||||
z3950_search_params => C4::Search::z3950_search_args($biblio),
|
||||
C4::Search::enabled_staff_search_views,
|
||||
);
|
||||
|
||||
output_html_with_http_headers $query, $cookie, $template->output;
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ use C4::Members;
|
|||
use C4::Serials;
|
||||
use C4::XISBN qw(get_xisbns get_biblionumber_from_isbn);
|
||||
use C4::External::Amazon;
|
||||
use C4::Search; # enabled_staff_search_views
|
||||
|
||||
# use Smart::Comments;
|
||||
|
||||
|
|
@ -195,6 +196,8 @@ $template->param(
|
|||
itemdata_enumchron => $itemfields{enumchron},
|
||||
itemdata_copynumber => $itemfields{copynumber},
|
||||
volinfo => $itemfields{enumchron} || $dat->{'serial'} ,
|
||||
z3950_search_params => C4::Search::z3950_search_args($dat),
|
||||
C4::Search::enabled_staff_search_views,
|
||||
);
|
||||
|
||||
my @results = ( $dat, );
|
||||
|
|
@ -202,6 +205,9 @@ foreach ( keys %{$dat} ) {
|
|||
$template->param( "$_" => defined $dat->{$_} ? $dat->{$_} : '' );
|
||||
}
|
||||
|
||||
# does not work: my %views_enabled = map { $_ => 1 } $template->query(loop => 'EnableViews');
|
||||
# method query not found?!?!
|
||||
|
||||
$template->param(
|
||||
itemloop => \@itemloop,
|
||||
biblionumber => $biblionumber,
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ use C4::Output;
|
|||
use C4::Circulation; # GetBiblioIssues
|
||||
use C4::Biblio; # GetBiblio GetBiblioFromItemNumber
|
||||
use C4::Dates qw/format_date/;
|
||||
use C4::Search; # enabled_staff_search_views
|
||||
|
||||
my $query = new CGI;
|
||||
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
|
||||
|
|
@ -70,6 +71,7 @@ $template->param(
|
|||
total => scalar @$issues,
|
||||
issues => $issues,
|
||||
issuehistoryview => 1,
|
||||
C4::Search::enabled_staff_search_views,
|
||||
);
|
||||
|
||||
output_html_with_http_headers $query, $cookie, $template->output;
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ use C4::Auth;
|
|||
use C4::Serials;
|
||||
use C4::Dates qw/format_date/;
|
||||
use C4::Circulation; # to use itemissues
|
||||
use C4::Search; # enabled_staff_search_views
|
||||
|
||||
my $query=new CGI;
|
||||
|
||||
|
|
@ -119,6 +120,7 @@ foreach my $item (@items){
|
|||
$template->param(count => $data->{'count'},
|
||||
subscriptionsnumber => $subscriptionsnumber,
|
||||
subscriptiontitle => $data->{title},
|
||||
C4::Search::enabled_staff_search_views,
|
||||
);
|
||||
$template->param(BIBITEM_DATA => \@results);
|
||||
$template->param(ITEM_DATA => \@items);
|
||||
|
|
@ -128,6 +130,7 @@ $template->param(biblionumber => $biblionumber);
|
|||
$template->param(biblioitemnumber => $bi);
|
||||
$template->param(itemnumber => $itemnumber);
|
||||
$template->param(ONLY_ONE => 1) if ( $itemnumber && $count != @items );
|
||||
$template->param(z3950_search_params => C4::Search::z3950_search_args(GetBiblioData($biblionumber)));
|
||||
|
||||
output_html_with_http_headers $query, $cookie, $template->output;
|
||||
|
||||
|
|
|
|||
|
|
@ -403,6 +403,25 @@ if ($params->{'limit-yr'}) {
|
|||
#FIXME: Should return a error to the user, incorect date format specified
|
||||
}
|
||||
|
||||
# convert indexes and operands to corresponding parameter names for the z3950 search
|
||||
# $ %z3950p will be a hash ref if the indexes are present (advacned search), otherwise undef
|
||||
my $z3950par;
|
||||
my $indexes2z3950 = {
|
||||
kw=>'title', au=>'author', 'au,phr'=>'author', nb=>'isbn', ns=>'issn',
|
||||
'lcn,phr'=>'dewey', su=>'subject', 'su,phr'=>'subject',
|
||||
ti=>'title', 'ti,phr'=>'title', se=>'title'
|
||||
};
|
||||
for (my $ii = 0; $ii < @operands; ++$ii)
|
||||
{
|
||||
my $name = $indexes2z3950->{$indexes[$ii]};
|
||||
if (defined $name && defined $operands[$ii])
|
||||
{
|
||||
$z3950par ||= {};
|
||||
$z3950par->{$name} = $operands[$ii] if !exists $z3950par->{$name};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# Params that can only have one value
|
||||
my $scan = $params->{'scan'};
|
||||
my $count = C4::Context->preference('numSearchResults') || 20;
|
||||
|
|
@ -494,10 +513,14 @@ for (my $i=0;$i<@servers;$i++) {
|
|||
## If there's just one result, redirect to the detail page
|
||||
if ($total == 1) {
|
||||
my $biblionumber=@newresults[0]->{biblionumber};
|
||||
if (C4::Context->preference('IntranetBiblioDefaultView') eq 'isbd') {
|
||||
my $defaultview = C4::Context->preference('IntranetBiblioDefaultView');
|
||||
my $views = { C4::Search::enabled_staff_search_views };
|
||||
if ($defaultview eq 'isbd' && $views->{can_view_ISBD}) {
|
||||
print $cgi->redirect("/cgi-bin/koha/catalogue/ISBDdetail.pl?biblionumber=$biblionumber");
|
||||
} elsif (C4::Context->preference('IntranetBiblioDefaultView') eq 'marc') {
|
||||
} elsif ($defaultview eq 'marc' && $views->{can_view_MARC}) {
|
||||
print $cgi->redirect("/cgi-bin/koha/catalogue/MARCdetail.pl?biblionumber=$biblionumber");
|
||||
} elsif ($defaultview eq 'labeled_marc' && $views->{can_view_labeledMARC}) {
|
||||
print $cgi->redirect("/cgi-bin/koha/catalogue/labeledMARCdetail.pl?biblionumber=$biblionumber");
|
||||
} else {
|
||||
print $cgi->redirect("/cgi-bin/koha/catalogue/detail.pl?biblionumber=$biblionumber");
|
||||
}
|
||||
|
|
@ -515,6 +538,7 @@ for (my $i=0;$i<@servers;$i++) {
|
|||
$template->param(query_cgi => $query_cgi);
|
||||
$template->param(query_desc => $query_desc);
|
||||
$template->param(limit_desc => $limit_desc);
|
||||
$template->param (z3950_search_params => C4::Search::z3950_search_args($query_desc));
|
||||
if ($query_desc || $limit_desc) {
|
||||
$template->param(searchdesc => 1);
|
||||
}
|
||||
|
|
@ -580,6 +604,7 @@ for (my $i=0;$i<@servers;$i++) {
|
|||
# no hits
|
||||
else {
|
||||
$template->param(searchdesc => 1,query_desc => $query_desc,limit_desc => $limit_desc);
|
||||
$template->param (z3950_search_params => C4::Search::z3950_search_args($z3950par || $query_desc));
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -113,6 +113,8 @@ for ( my $i = 0 ; $i <= $#resultsbr ; $i++ ) {
|
|||
$row_data{toggle} = $toggle;
|
||||
$row_data{id} = $resultsbr[$i]->{'id'};
|
||||
$row_data{isbn} = $resultsbr[$i]->{'isbn'};
|
||||
$row_data{copyrightdate} = $resultsbr[$i]->{'copyrightdate'};
|
||||
$row_data{editionstatement} = $resultsbr[$i]->{'editionstatement'};
|
||||
$row_data{file} = $resultsbr[$i]->{'file'};
|
||||
$row_data{title} = $resultsbr[$i]->{'title'};
|
||||
$row_data{author} = $resultsbr[$i]->{'author'};
|
||||
|
|
@ -123,6 +125,7 @@ $template->param(
|
|||
frameworkcodeloop => \@frameworkcodeloop,
|
||||
breeding_count => $countbr,
|
||||
breeding_loop => \@breeding_loop,
|
||||
z3950_search_params => C4::Search::z3950_search_args($query),
|
||||
);
|
||||
|
||||
output_html_with_http_headers $input, $cookie, $template->output;
|
||||
|
|
|
|||
|
|
@ -244,6 +244,8 @@ warn "query ".$query if $DEBUG;
|
|||
$row_data{lccn} = $oldbiblio->{lccn};
|
||||
$row_data{title} = $oldbiblio->{title};
|
||||
$row_data{author} = $oldbiblio->{author};
|
||||
$row_data{date} = $oldbiblio->{copyrightdate};
|
||||
$row_data{edition} = $oldbiblio->{editionstatement};
|
||||
$row_data{breedingid} = $breedingid;
|
||||
$row_data{biblionumber} = $biblionumber;
|
||||
push( @breeding_loop, \%row_data );
|
||||
|
|
|
|||
|
|
@ -115,4 +115,4 @@ div.subfield_line label {
|
|||
}
|
||||
#cataloguing_additem_newitem .input_marceditor {
|
||||
width : auto;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -844,6 +844,11 @@ fieldset.rows .inputnote {
|
|||
background-position : center left;
|
||||
background-repeat : no-repeat;
|
||||
}
|
||||
#z3950searcht table {
|
||||
/* doesn't have desired effect in catalogue/results.tmpl - I'll leave this here for now but there do seem to be casscading CSS errors in this and other CSS fiels - RICKW 20081118 */
|
||||
padding: 20px;
|
||||
border: none;
|
||||
}
|
||||
#printbiblio button, #printbiblio a, #printmenuc .first-child {
|
||||
padding-left : 34px;
|
||||
background-image: url("../../img/toolbar-print.gif");
|
||||
|
|
@ -1324,6 +1329,18 @@ overflow : hidden;
|
|||
float : right;
|
||||
}
|
||||
|
||||
#searchheader form.fz3950 {
|
||||
float : right;
|
||||
font-size : 125%;
|
||||
padding : 0 0 0 5em;
|
||||
}
|
||||
|
||||
#searchheader form.fz3950bigrpad {
|
||||
float : right;
|
||||
font-size : 125%;
|
||||
padding : 5px 25em 0 0;
|
||||
}
|
||||
|
||||
#search-facets ul {
|
||||
margin : 0;
|
||||
padding : .3em;
|
||||
|
|
@ -1642,3 +1659,22 @@ span.permissiondesc {
|
|||
margin-top : .5em;
|
||||
padding : .5em;
|
||||
}
|
||||
|
||||
.labeledmarc-table {
|
||||
border: 0;
|
||||
}
|
||||
|
||||
.labeledmarc-label {
|
||||
border: 0;
|
||||
padding: 5;
|
||||
font-size: 11pt;
|
||||
color: darkblue;
|
||||
}
|
||||
|
||||
.labeledmarc-value {
|
||||
border: 0;
|
||||
padding: 5;
|
||||
font-size: 10pt;
|
||||
color: black;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,10 +2,22 @@
|
|||
<ul>
|
||||
<!-- TMPL_IF NAME="detailview" --><li class="active"><!-- TMPL_ELSE --><li><!-- /TMPL_IF -->
|
||||
<a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=<!-- TMPL_IF NAME="object" --><!-- TMPL_VAR NAME="object" --><!-- TMPL_ELSE --><!-- TMPL_VAR NAME="biblionumber" --><!-- /TMPL_IF -->">Normal</a></li>
|
||||
|
||||
<!-- TMPL_IF NAME="can_view_MARC" -->
|
||||
<!-- TMPL_IF NAME="marcview" --><li class="active"><!-- TMPL_ELSE --><li><!-- /TMPL_IF -->
|
||||
<a href="/cgi-bin/koha/catalogue/MARCdetail.pl?biblionumber=<!-- TMPL_IF NAME="object" --><!-- TMPL_VAR NAME="object" --><!-- TMPL_ELSE --><!-- TMPL_VAR NAME="biblionumber" --><!-- /TMPL_IF -->">MARC</a></li>
|
||||
<!-- /TMPL_IF -->
|
||||
|
||||
<!-- TMPL_IF NAME="can_view_labeledMARC" -->
|
||||
<!-- TMPL_IF NAME="labeledmarcview" --><li class="active"><!-- TMPL_ELSE --><li><!-- /TMPL_IF -->
|
||||
<a href="/cgi-bin/koha/catalogue/labeledMARCdetail.pl?biblionumber=<!-- TMPL_IF NAME="object" --><!-- TMPL_VAR NAME="object" --><!-- TMPL_ELSE --><!-- TMPL_VAR NAME="biblionumber" --><!-- /TMPL_IF -->">Labeled MARC</a></li>
|
||||
<!-- /TMPL_IF -->
|
||||
|
||||
<!-- TMPL_IF NAME="can_view_ISBD" -->
|
||||
<!-- TMPL_IF NAME="isbdview" --><li class="active"><!-- TMPL_ELSE --><li><!-- /TMPL_IF -->
|
||||
<a href="/cgi-bin/koha/catalogue/ISBDdetail.pl?biblionumber=<!-- TMPL_IF NAME="object" --><!-- TMPL_VAR NAME="object" --><!-- TMPL_ELSE --><!-- TMPL_VAR NAME="biblionumber" --><!-- /TMPL_IF -->">ISBD</a></li>
|
||||
<!-- /TMPL_IF -->
|
||||
|
||||
<!-- TMPL_IF NAME="moredetailview" --><li class="active"><!-- TMPL_ELSE --><li><!-- /TMPL_IF -->
|
||||
<a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=<!-- TMPL_IF NAME="object" --><!-- TMPL_VAR NAME="object" --><!-- TMPL_ELSE --><!-- TMPL_VAR NAME="biblionumber" --><!-- /TMPL_IF -->">Items</a></li>
|
||||
<!-- TMPL_IF NAME="CAN_user_reserveforothers" -->
|
||||
|
|
|
|||
|
|
@ -3,6 +3,23 @@
|
|||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
|
||||
/* this function open a popup to search on z3950 server. */
|
||||
function PopupZ3950() {
|
||||
var strQuery = GetZ3950Terms();
|
||||
if(strQuery){
|
||||
window.open("/cgi-bin/koha/cataloguing/z3950_search.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->"+strQuery,"z3950search",'width=740,height=450,location=yes,toolbar=no,scrollbars=yes,resize=yes');
|
||||
}
|
||||
}
|
||||
|
||||
/* provide Z3950 search points */
|
||||
function GetZ3950Terms(){
|
||||
var strQuery="&frameworkcode=";
|
||||
<!-- TMPL_LOOP NAME='z3950_search_params' -->
|
||||
strQuery += "&" + "<!-- TMPL_VAR NAME="name" -->" + "=" + "<!-- TMPL_VAR NAME="encvalue" -->";
|
||||
<!-- /TMPL_LOOP -->
|
||||
return strQuery;
|
||||
}
|
||||
|
||||
function addToShelf() { window.open('/cgi-bin/koha/virtualshelves/addbybiblionumber.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->','Add_to_virtualshelf','width=500,height=400,toolbar=false,scrollbars=yes');
|
||||
}
|
||||
function printBiblio() {window.open('/cgi-bin/koha/catalogue/detailprint.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->','Print_Biblio','width=700,height=500,toolbar=false,scrollbars=yes');
|
||||
|
|
@ -41,6 +58,7 @@ function confirm_deletion() {
|
|||
$("#printbiblioc").empty();
|
||||
$("#export").remove();
|
||||
$("#addtoshelfc").before("<li id=\"savemenuc\"><\/li>");
|
||||
$("#z3950searchc").empty();
|
||||
yuiToolbar();
|
||||
});
|
||||
|
||||
|
|
@ -92,6 +110,14 @@ function confirm_deletion() {
|
|||
container: "newmenuc"
|
||||
});
|
||||
|
||||
new YAHOO.widget.Button({
|
||||
id: "z3950search",
|
||||
type: "button",
|
||||
label: _("z39.50 Search"),
|
||||
container: "z3950searchc",
|
||||
onclick: {fn:function(){PopupZ3950()}}
|
||||
});
|
||||
|
||||
var addtoshelfButton = new YAHOO.widget.Button({
|
||||
id: "addtoshelf",
|
||||
type: "button",
|
||||
|
|
@ -116,6 +142,8 @@ function confirm_deletion() {
|
|||
//]]>
|
||||
</script>
|
||||
|
||||
<form method="post" name="f" id="f" action="/cgi-bin/koha/cataloguing/addbiblio.pl" onsubmit="return Check();">
|
||||
|
||||
<ul class="toolbar">
|
||||
<!-- TMPL_IF NAME="CAN_user_editcatalogue" -->
|
||||
<li id="newmenuc"><a id="newbiblio" href="/cgi-bin/koha/cataloguing/addbiblio.pl">New Record</a></li>
|
||||
|
|
@ -132,4 +160,7 @@ function confirm_deletion() {
|
|||
<!-- TMPL_UNLESS name="bi_notforloan" -->
|
||||
<!-- TMPL_UNLESS NAME="norequests" --><li><a id="placehold" href="/cgi-bin/koha/reserve/request.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->">Place Hold</a></li><!-- /TMPL_UNLESS --><!-- /TMPL_UNLESS -->
|
||||
<!-- /TMPL_IF -->
|
||||
<li id="z3950searchc"><input type="button" id="z3950search" value="z39.50 Search" onclick="PopupZ3950(); return false;" /></li>
|
||||
</form>
|
||||
</ul></div>
|
||||
|
||||
|
|
|
|||
|
|
@ -9,11 +9,12 @@
|
|||
$(document).ready(function() {
|
||||
$("#newmenuc").empty();
|
||||
yuiToolbar();
|
||||
yuiZ3950button();
|
||||
});
|
||||
|
||||
// YUI Toolbar Functions
|
||||
|
||||
function yuiToolbar() {
|
||||
function yuiToolbar() {
|
||||
|
||||
<!-- TMPL_IF NAME="NOTMARC" -->
|
||||
new YAHOO.widget.Button("newrecord");
|
||||
|
|
@ -34,7 +35,31 @@
|
|||
});
|
||||
}
|
||||
|
||||
<!-- /TMPL_IF -->
|
||||
/* this function open a popup to search on z3950 server. */
|
||||
function PopupZ3950() {
|
||||
var strQuery = GetZ3950Terms();
|
||||
if(strQuery){
|
||||
window.open("/cgi-bin/koha/cataloguing/z3950_search.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->"+strQuery,"z3950search",'width=740,height=450,location=yes,toolbar=no,scrollbars=yes,resize=yes');
|
||||
}
|
||||
}
|
||||
/* provide Z3950 search points */
|
||||
function GetZ3950Terms(){
|
||||
var strQuery="&frameworkcode=";
|
||||
<!-- TMPL_LOOP NAME='z3950_search_params' -->
|
||||
strQuery += "&" + "<!-- TMPL_VAR NAME="name" -->" + "=" + "<!-- TMPL_VAR NAME="encvalue" -->";
|
||||
<!-- /TMPL_LOOP -->
|
||||
return strQuery;
|
||||
}
|
||||
/* prepare DOM for Z39.50 Search Button */
|
||||
function yuiZ3950button() {
|
||||
new YAHOO.widget.Button({
|
||||
id: "z3950search",
|
||||
type: "button",
|
||||
label: _("z39.50 Search"),
|
||||
container: "newmenuc",
|
||||
onclick: {fn:function(){PopupZ3950()}}
|
||||
});
|
||||
}
|
||||
//]]>
|
||||
</script>
|
||||
|
||||
|
|
@ -54,6 +79,8 @@
|
|||
</select>
|
||||
<input type="submit" value="Add Record Without Search" />
|
||||
</form>
|
||||
<a id="z3950search" onclick="PopupZ3950(); return false;">z39.50 Search</a>
|
||||
<!-- /TMPL_IF -->
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -20,12 +20,20 @@ function verify_images() {
|
|||
}
|
||||
});
|
||||
}
|
||||
<!-- /TMPL_IF -->
|
||||
|
||||
$(document).ready(function() {
|
||||
<!-- TMPL_IF NAME="AmazonContent" -->
|
||||
$('#sortbyform').find("input:submit").hide();
|
||||
$('#sort_by').change(function() {
|
||||
$('#sortbyform').submit();
|
||||
});
|
||||
<!-- /TMPL_IF -->
|
||||
$("#z3950searchc").empty();
|
||||
yuiZ3950button();
|
||||
});
|
||||
|
||||
<!-- TMPL_IF NAME="AmazonContent" -->
|
||||
$(window).load(function() {
|
||||
verify_images();
|
||||
});
|
||||
|
|
@ -79,6 +87,32 @@ function addToList () {
|
|||
window.open(url, 'Add_to_virtualshelf', 'width=500, height=400, toolbar=false, scrollbars=yes');
|
||||
return false;
|
||||
}
|
||||
|
||||
/* this function open a popup to search on z3950 server. */
|
||||
function PopupZ3950() {
|
||||
var strQuery = GetZ3950Terms();
|
||||
if(strQuery){
|
||||
window.open("/cgi-bin/koha/cataloguing/z3950_search.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->"+strQuery,"z3950search",'width=740,height=450,location=yes,toolbar=no,scrollbars=yes,resize=yes');
|
||||
}
|
||||
}
|
||||
/* provide Z3950 search points */
|
||||
function GetZ3950Terms(){
|
||||
var strQuery="&frameworkcode=";
|
||||
<!-- TMPL_LOOP NAME='z3950_search_params' -->
|
||||
strQuery += "&" + "<!-- TMPL_VAR NAME="name" -->" + "=" + "<!-- TMPL_VAR NAME="encvalue" -->";
|
||||
<!-- /TMPL_LOOP -->
|
||||
return strQuery;
|
||||
}
|
||||
/* prepare DOM for Z39.50 Search Button */
|
||||
function yuiZ3950button() {
|
||||
new YAHOO.widget.Button({
|
||||
id: "z3950search",
|
||||
type: "button",
|
||||
label: _("z39.50 Search"),
|
||||
container: "z3950searchc",
|
||||
onclick: {fn:function(){PopupZ3950()}}
|
||||
});
|
||||
}
|
||||
//]]>
|
||||
</script>
|
||||
</head>
|
||||
|
|
@ -112,6 +146,9 @@ function addToList () {
|
|||
|
||||
<!-- TMPL_IF NAME="total" -->
|
||||
<div id="searchheader">
|
||||
<form method="post" name="fz3950" class="fz3950">
|
||||
<span id="z3950searchc"><input type="button" id="z3950search" value="z39.50 Search" onclick="PopupZ3950(); return false;" /></span>
|
||||
</form>
|
||||
<form action="/cgi-bin/koha/catalogue/search.pl" method="get" id="sortbyform">
|
||||
<!-- TMPL_IF NAME="searchdesc" -->
|
||||
<!-- TMPL_LOOP NAME="QUERY_INPUTS"-->
|
||||
|
|
@ -144,6 +181,10 @@ function addToList () {
|
|||
</div>
|
||||
<!-- TMPL_IF NAME="stopwords_removed" --><div><p class="tip">Ignored the following common words: "<!-- TMPL_VAR NAME="stopwords_removed" -->"<p></div><!-- /TMPL_IF -->
|
||||
<!-- TMPL_ELSE -->
|
||||
<div id="searchheader">
|
||||
<form method="post" name="fz3950" class="fz3950bigrpad">
|
||||
<span id="z3950searchc"><input type="button" id="z3950search" value="z39.50 Search" onclick="PopupZ3950(); return false;" /></span>
|
||||
</form>
|
||||
<!-- TMPL_IF NAME="searchdesc" -->
|
||||
<h3>No results found</h3>
|
||||
<p>
|
||||
|
|
@ -155,6 +196,7 @@ function addToList () {
|
|||
You did not specify any search criteria.
|
||||
</p>
|
||||
<!-- /TMPL_IF -->
|
||||
</div>
|
||||
<!-- /TMPL_IF -->
|
||||
|
||||
<!-- TMPL_IF NAME="query_error" -->
|
||||
|
|
@ -290,6 +332,10 @@ function addToList () {
|
|||
<b><!-- TMPL_IF NAME="title" --><!-- TMPL_VAR NAME="title" --><!-- TMPL_ELSE -->No title<!-- /TMPL_IF --></b>
|
||||
</a> <!-- TMPL_VAR NAME="subtitle" -->
|
||||
<!-- TMPL_IF name="volume" -->,<!-- TMPL_VAR name="volume" --><!-- /TMPL_IF --> <!-- TMPL_IF name="volumeddesc" -->, <!-- TMPL_VAR name="volumeddesc" --><!-- /TMPL_IF -->
|
||||
<!-- TMPL_ELSIF NAME="BiblioDefaultViewlabeled_marc" -->
|
||||
<a class="title" href="/cgi-bin/koha/catalogue/labeledMARCdetail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" ESCAPE="URL" -->">
|
||||
<!-- TMPL_VAR NAME="title" -->
|
||||
</a> <!-- TMPL_VAR NAME="subtitle" --><!-- TMPL_IF name="volume" -->,<!-- TMPL_VAR name="volume" --><!-- /TMPL_IF --> <!-- TMPL_IF name="volumeddesc" -->, <!-- TMPL_VAR name="volumeddesc" --><!-- /TMPL_IF -->
|
||||
<!-- TMPL_ELSIF NAME="BiblioDefaultViewisbd" -->
|
||||
<a class="title" href="/cgi-bin/koha/catalogue/ISBDdetail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" ESCAPE="URL" -->">
|
||||
<!-- TMPL_IF NAME="title" --><!-- TMPL_VAR NAME="title" --><!-- TMPL_ELSE -->No title<!-- /TMPL_IF -->
|
||||
|
|
@ -328,6 +374,7 @@ function addToList () {
|
|||
<!-- /TMPL_IF -->
|
||||
|
||||
<!-- TMPL_IF name="publishercode" --><!-- TMPL_VAR name="publishercode" --><!-- /TMPL_IF -->
|
||||
<!-- TMPL_IF NAME="edition" -->Edition: <!-- TMPL_VAR NAME="edition" --><!-- /TMPL_IF -->
|
||||
Description:
|
||||
<!-- TMPL_IF name="place" --> ; <!-- TMPL_VAR name="place" --><!-- /TMPL_IF -->
|
||||
<!-- TMPL_IF name="publicationyear" -->, <!-- TMPL_VAR name="publicationyear" -->
|
||||
|
|
|
|||
|
|
@ -62,6 +62,8 @@
|
|||
<!-- TMPL_IF NAME="isbn" --> - <!-- TMPL_VAR NAME="isbn" --> <!-- /TMPL_IF -->
|
||||
<!-- TMPL_IF name="publicationyear" --> - <!-- TMPL_VAR name="publicationyear" --><!-- /TMPL_IF -->
|
||||
<!-- TMPL_IF name="publishercode" -->- <!-- TMPL_VAR name="publishercode" --><!-- /TMPL_IF -->
|
||||
<!-- TMPL_IF name="copyrightdate" --> - <!-- TMPL_VAR name="copyrightdate" --><!-- /TMPL_IF -->
|
||||
<!-- TMPL_IF NAME="edition" -->Edition: <!-- TMPL_VAR NAME="edition" --><!-- /TMPL_IF -->
|
||||
<!-- TMPL_IF name="place" --> ; <!-- TMPL_VAR name="place" --><!-- /TMPL_IF -->
|
||||
<!-- TMPL_IF name="pages" --> - <!-- TMPL_VAR name="pages" --><!-- /TMPL_IF -->
|
||||
<!-- TMPL_IF name="size" --> ; <!-- TMPL_VAR name="size" --><!-- /TMPL_IF -->
|
||||
|
|
@ -125,6 +127,8 @@
|
|||
<tr>
|
||||
<th>Title</th>
|
||||
<th>ISBN</th>
|
||||
<th>Date</th>
|
||||
<th>Edition</th>
|
||||
<th>coming from</th>
|
||||
<th>preview</th>
|
||||
<th> </th>
|
||||
|
|
@ -134,6 +138,8 @@
|
|||
<td><!-- TMPL_VAR NAME="title" escape="html" -->
|
||||
<!-- TMPL_VAR NAME="author" --></td>
|
||||
<td><!-- TMPL_VAR NAME="isbn" --></td>
|
||||
<td><!-- TMPL_VAR NAME="copyrightdate" --></td>
|
||||
<td><!-- TMPL_VAR NAME="edition" --></td>
|
||||
<td><!-- TMPL_VAR NAME="file" --></td>
|
||||
<td> <a href="/cgi-bin/koha/catalogue/showmarc.pl?importid=<!-- TMPL_VAR NAME="id" -->" title="MARC" rel="gb_page_center[600,500]">MARC</a> | <a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&importid=<!-- TMPL_VAR NAME="id" -->" title="MARC" rel="gb_page_center[600,500]">Card</a>
|
||||
</td>
|
||||
|
|
|
|||
|
|
@ -94,6 +94,8 @@ $(document).ready(function(){
|
|||
<th>Server</th>
|
||||
<th>Title</th>
|
||||
<th>Author</th>
|
||||
<th>Date</th>
|
||||
<th>Edition</th>
|
||||
<th>ISBN</th>
|
||||
<th>LCCN</th>
|
||||
<th colspan="2">Preview</th>
|
||||
|
|
@ -106,6 +108,8 @@ $(document).ready(function(){
|
|||
<td><!-- TMPL_VAR name="server" --></td>
|
||||
<td><!-- TMPL_VAR NAME="title" escape="html" --></td>
|
||||
<td><!-- TMPL_VAR NAME="author" --></td>
|
||||
<td><!-- TMPL_VAR NAME="date" --></td>
|
||||
<td><!-- TMPL_VAR NAME="edition" --></td>
|
||||
<td><!-- TMPL_VAR NAME="isbn" --></td>
|
||||
<td><!-- TMPL_VAR NAME="lccn" --></td>
|
||||
<td><a href="/cgi-bin/koha/catalogue/showmarc.pl?importid=<!-- TMPL_VAR NAME="breedingid" -->" title="MARC" rel="gb_page_center[600,500]">MARC</a></td><td><a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&importid=<!-- TMPL_VAR NAME="breedingid" -->" title="MARC" rel="gb_page_center[600,500]">Card</a></td>
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ use C4::Koha;
|
|||
use C4::Circulation;
|
||||
use C4::Dates qw/format_date/;
|
||||
use C4::Members;
|
||||
use C4::Search; # enabled_staff_search_views
|
||||
|
||||
my $dbh = C4::Context->dbh;
|
||||
my $sth;
|
||||
|
|
@ -526,6 +527,7 @@ foreach my $biblionumber (@biblionumbers) {
|
|||
holdsview => 1,
|
||||
borrower_branchname => $branches->{$borrowerinfo->{'branchcode'}}->{'branchname'},
|
||||
borrower_branchcode => $borrowerinfo->{'branchcode'},
|
||||
C4::Search::enabled_staff_search_views,
|
||||
);
|
||||
|
||||
$biblioloopiter{biblionumber} = $biblionumber;
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ use C4::Items;
|
|||
use C4::Branch;
|
||||
use C4::Debug;
|
||||
# use Data::Dumper;
|
||||
use C4::Search; # enabled_staff_search_views
|
||||
|
||||
use vars qw($debug $cgi_debug);
|
||||
|
||||
|
|
@ -98,6 +99,7 @@ $template->param(
|
|||
DHTMLcalendar_dateformat => C4::Dates->DHTMLcalendar(),
|
||||
dateformat => C4::Dates->new()->format(),
|
||||
debug => $debug,
|
||||
C4::Search::enabled_staff_search_views,
|
||||
);
|
||||
#
|
||||
#### This code was never really used - maybe some day some will fix it ###
|
||||
|
|
|
|||
Loading…
Reference in New Issue