From srdjan at catalyst.net.nz Tue Jul 8 06:11:26 2014 From: srdjan at catalyst.net.nz (Srdjan) Date: Tue, 8 Jul 2014 16:11:26 +1200 Subject: [Koha-patches] [PATCH] bug_11213: Changed XSLTParse4Display() interface Message-ID: <1404792686-1166-1-git-send-email-srdjan@catalyst.net.nz> The list of biblio items is passed on now, instead of GetItemsInfo() being called. This is because the callers already have the list ready, so the GetItemsInfo() call is being duplicated unnecessarily. Search::searchResults() builds items list from XML, and that one is passed instead. * XSLT::XSLTParse4Display() - supply the items list as input param - removed hidden items list param - hidden should not be in the items list - changed buildKohaItemsNamespace() accordingly * Items - removed GetItemsLocationInfo() - added sort_by input param to GetItemsInfo() - VirtualShelves::Page::shelfpage() - replaced GetItemsLocationInfo() call with GetItemsInfo() call, passing order_by "cn_sort" * catalogue/detail.pl, opac/opac-detail.pl, shelfpage() - added items list to the XSLTParse4Display() call * Search::searchResults() - include all available info when building items lists - added combined items list (available, on loan, other) to the XSLTParse4Display() call To test: This change is a noop, so following screens need to be checked against any changes: * Intranet: - catalogue/search.pl (results) - catalogue/detail.pl - virtualshelves/shelves.pl * Opac - opac-search.pl (results, hidelostitems syspref on and off) - opac-detail.pl - opac-shelves.pl The display should stay the same before and after patch. The speed should increase though. --- C4/Items.pm | 92 ++++++++++++----------------------------------- C4/Search.pm | 19 +++------- C4/VirtualShelves/Page.pm | 8 ++--- C4/XSLT.pm | 23 ++++++------ catalogue/detail.pl | 12 +++---- opac/opac-detail.pl | 10 +++--- 6 files changed, 56 insertions(+), 108 deletions(-) diff --git a/C4/Items.pm b/C4/Items.pm index 1781880..8d79123 100644 --- a/C4/Items.pm +++ b/C4/Items.pm @@ -67,7 +67,6 @@ BEGIN { GetItemInfosOf GetItemsByBiblioitemnumber GetItemsInfo - GetItemsLocationInfo GetHostItemsInfo GetItemnumbersForBiblio get_itemnumbers_of @@ -1207,10 +1206,14 @@ sub GetItemsByBiblioitemnumber { =head2 GetItemsInfo - @results = GetItemsInfo($biblionumber); + @results = GetItemsInfo($biblionumber, $order_by); Returns information about items with the given biblionumber. +The list is ordered by home branch name and some complex criteria +within it (see the code), unless $order_by is specified. +Currently only "cn_sort" is supported. + C returns a list of references-to-hash. Each element contains a number of keys. Most of them are attributes from the C, C, C, and C tables in the @@ -1248,7 +1251,8 @@ If this is set, it is set to C. =cut sub GetItemsInfo { - my ( $biblionumber ) = @_; + my ( $biblionumber, $order_by ) = @_; + my $dbh = C4::Context->dbh; # note biblioitems.* must be avoided to prevent large marc and marcxml fields from killing performance. my $query = " @@ -1279,7 +1283,18 @@ sub GetItemsInfo { LEFT JOIN biblioitems ON biblioitems.biblioitemnumber = items.biblioitemnumber LEFT JOIN itemtypes ON itemtypes.itemtype = " . (C4::Context->preference('item-level_itypes') ? 'items.itype' : 'biblioitems.itemtype'); - $query .= " WHERE items.biblionumber = ? ORDER BY home.branchname, items.enumchron, LPAD( items.copynumber, 8, '0' ), items.dateaccessioned DESC" ; + $query .= " WHERE items.biblionumber = ? ORDER BY "; + my $order_by_cause = "home.branchname, items.enumchron, LPAD( items.copynumber, 8, '0' ), items.dateaccessioned DESC" ; + if ($order_by) { + if ($order_by eq 'cn_sort') { + $order_by_cause = "cn_sort ASC"; + } + else { + warn qq{Unsupported order by "$order_by"}; + } + } + $query .= $order_by_cause; + my $sth = $dbh->prepare($query); $sth->execute($biblionumber); my $i = 0; @@ -1341,6 +1356,10 @@ sub GetItemsInfo { if ( my $code = C4::Koha::GetAuthValCode( 'items.stack', $data->{frameworkcode} ) ) { $data->{stack} = C4::Koha::GetKohaAuthorisedValueLib( $code, $data->{stack} ); } + + $data->{location_intranet} = GetKohaAuthorisedValueLib('LOC', $data->{location}); + $data->{location_opac} = GetKohaAuthorisedValueLib('LOC', $data->{location}, 1); + # Find the last 3 people who borrowed this item. my $sth2 = $dbh->prepare("SELECT * FROM old_issues,borrowers WHERE itemnumber = ? @@ -1366,71 +1385,6 @@ sub GetItemsInfo { } } -=head2 GetItemsLocationInfo - - my @itemlocinfo = GetItemsLocationInfo($biblionumber); - -Returns the branch names, shelving location and itemcallnumber for each item attached to the biblio in question - -C returns a list of references-to-hash. Data returned: - -=over 2 - -=item C<$data-E{homebranch}> - -Branch Name of the item's homebranch - -=item C<$data-E{holdingbranch}> - -Branch Name of the item's holdingbranch - -=item C<$data-E{location}> - -Item's shelving location code - -=item C<$data-E{location_intranet}> - -The intranet description for the Shelving Location as set in authorised_values 'LOC' - -=item C<$data-E{location_opac}> - -The OPAC description for the Shelving Location as set in authorised_values 'LOC'. Falls back to intranet description if no OPAC -description is set. - -=item C<$data-E{itemcallnumber}> - -Item's itemcallnumber - -=item C<$data-E{cn_sort}> - -Item's call number normalized for sorting - -=back - -=cut - -sub GetItemsLocationInfo { - my $biblionumber = shift; - my @results; - - my $dbh = C4::Context->dbh; - my $query = "SELECT a.branchname as homebranch, b.branchname as holdingbranch, - location, itemcallnumber, cn_sort - FROM items, branches as a, branches as b - WHERE homebranch = a.branchcode AND holdingbranch = b.branchcode - AND biblionumber = ? - ORDER BY cn_sort ASC"; - my $sth = $dbh->prepare($query); - $sth->execute($biblionumber); - - while ( my $data = $sth->fetchrow_hashref ) { - $data->{location_intranet} = GetKohaAuthorisedValueLib('LOC', $data->{location}); - $data->{location_opac}= GetKohaAuthorisedValueLib('LOC', $data->{location}, 1); - push @results, $data; - } - return @results; -} - =head2 GetHostItemsInfo $hostiteminfo = GetHostItemsInfo($hostfield); diff --git a/C4/Search.pm b/C4/Search.pm index 86f2c59..466a10d 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -1872,7 +1872,6 @@ sub searchResults { my $items_count = scalar(@fields); my $maxitems_pref = C4::Context->preference('maxItemsinSearchResults'); my $maxitems = $maxitems_pref ? $maxitems_pref - 1 : 1; - my @hiddenitems; # hidden itemnumbers based on OpacHiddenItems syspref # loop through every item foreach my $field (@fields) { @@ -1894,7 +1893,6 @@ sub searchResults { # hidden based on OpacHiddenItems syspref my @hi = C4::Items::GetHiddenItemnumbers($item); if (scalar @hi) { - push @hiddenitems, @hi; $hideatopac_count++; next; } @@ -1911,18 +1909,16 @@ sub searchResults { $item->{'branchname'} = $branches{$item->{$otherbranch}}; } - my $prefix = $item->{$hbranch} . '--' . $item->{location} . $item->{itype} . $item->{itemcallnumber}; + my $prefix = $item->{$hbranch} . '--' . $item->{location} . $item->{itype} . $item->{itemcallnumber}; # For each grouping of items (onloan, available, unavailable), we build a key to store relevant info about that item my $userenv = C4::Context->userenv; if ( $item->{onloan} && !(C4::Members::GetHideLostItemsPreference($userenv->{'number'}) && $item->{itemlost}) ) { $onloan_count++; my $key = $prefix . $item->{onloan} . $item->{barcode}; + $onloan_items->{$key} = { %$item }; $onloan_items->{$key}->{due_date} = format_date($item->{onloan}); $onloan_items->{$key}->{count}++ if $item->{$hbranch}; - $onloan_items->{$key}->{branchname} = $item->{branchname}; $onloan_items->{$key}->{location} = $shelflocations->{ $item->{location} }; - $onloan_items->{$key}->{itemcallnumber} = $item->{itemcallnumber}; - $onloan_items->{$key}->{description} = $item->{description}; $onloan_items->{$key}->{imageurl} = getitemtypeimagelocation( $search_context, $itemtypes{ $item->{itype} }->{imageurl} ); # if something's checked out and lost, mark it as 'long overdue' if ( $item->{itemlost} ) { @@ -2002,25 +1998,20 @@ sub searchResults { $other_count++; my $key = $prefix . $item->{status}; - foreach (qw(withdrawn itemlost damaged branchname itemcallnumber)) { - $other_items->{$key}->{$_} = $item->{$_}; - } + $other_items->{$key} = { %$item }; $other_items->{$key}->{intransit} = ( $transfertwhen ne '' ) ? 1 : 0; $other_items->{$key}->{onhold} = ($reservestatus) ? 1 : 0; $other_items->{$key}->{notforloan} = GetAuthorisedValueDesc('','',$item->{notforloan},'','',$notforloan_authorised_value) if $notforloan_authorised_value and $item->{notforloan}; $other_items->{$key}->{count}++ if $item->{$hbranch}; $other_items->{$key}->{location} = $shelflocations->{ $item->{location} }; - $other_items->{$key}->{description} = $item->{description}; $other_items->{$key}->{imageurl} = getitemtypeimagelocation( $search_context, $itemtypes{ $item->{itype} }->{imageurl} ); } # item is available else { $can_place_holds = 1; $available_count++; + $available_items->{$prefix} = { %$item }; $available_items->{$prefix}->{count}++ if $item->{$hbranch}; - foreach (qw(branchname itemcallnumber description)) { - $available_items->{$prefix}->{$_} = $item->{$_}; - } $available_items->{$prefix}->{location} = $shelflocations->{ $item->{location} }; $available_items->{$prefix}->{imageurl} = getitemtypeimagelocation( $search_context, $itemtypes{ $item->{itype} }->{imageurl} ); } @@ -2052,7 +2043,7 @@ sub searchResults { warn $marcrecord->as_formatted if $DEBUG; my $interface = $search_context eq 'opac' ? 'OPAC' : ''; if (!$scan && C4::Context->preference($interface . "XSLTResultsDisplay")) { - $oldbiblio->{XSLTResultsRecord} = XSLTParse4Display($oldbiblio->{biblionumber}, $marcrecord, $interface."XSLTResultsDisplay", 1, \@hiddenitems); + $oldbiblio->{XSLTResultsRecord} = XSLTParse4Display($oldbiblio->{biblionumber}, $marcrecord, $interface."XSLTResultsDisplay", [@available_items_loop, @onloan_items_loop, @other_items_loop], 1); # the last parameter tells Koha to clean up the problematic ampersand entities that Zebra outputs } diff --git a/C4/VirtualShelves/Page.pm b/C4/VirtualShelves/Page.pm index 3c90afc..0fbf254 100644 --- a/C4/VirtualShelves/Page.pm +++ b/C4/VirtualShelves/Page.pm @@ -261,11 +261,13 @@ sub shelfpage { ( $items, $totitems ) = GetShelfContents( $shelfnumber, $shelflimit, $shelfoffset, $sortfield, $direction ); for my $this_item (@$items) { my $biblionumber = $this_item->{'biblionumber'}; + # Getting items infos for location display + my @items_infos = &GetItemsInfo( $this_item->{'biblionumber'}, "cn_sort" ); my $record = GetMarcBiblio($biblionumber); if (C4::Context->preference("OPACXSLTResultsDisplay") && $type eq 'opac') { - $this_item->{XSLTBloc} = XSLTParse4Display($biblionumber, $record, "OPACXSLTResultsDisplay"); + $this_item->{XSLTBloc} = XSLTParse4Display($biblionumber, $record, "OPACXSLTResultsDisplay", \@items_infos); } elsif (C4::Context->preference("XSLTResultsDisplay") && $type eq 'intranet') { - $this_item->{XSLTBloc} = XSLTParse4Display($biblionumber, $record, "XSLTResultsDisplay"); + $this_item->{XSLTBloc} = XSLTParse4Display($biblionumber, $record, "XSLTResultsDisplay", \@items_infos); } # the virtualshelfcontents table does not store these columns nor are they retrieved from the items @@ -281,8 +283,6 @@ sub shelfpage { $this_item->{'normalized_oclc'} = GetNormalizedOCLCNumber($record,$marcflavour); $this_item->{'normalized_isbn'} = GetNormalizedISBN(undef,$record,$marcflavour); if(!defined($this_item->{'size'})) { $this_item->{'size'} = "" }; #TT has problems with size - # Getting items infos for location display - my @items_infos = &GetItemsLocationInfo( $this_item->{'biblionumber'}); $this_item->{'itemsissued'} = CountItemsIssued( $this_item->{'biblionumber'} ); $this_item->{'ITEM_RESULTS'} = \@items_infos; if ( grep {$_ eq $biblionumber} @cart_list) { diff --git a/C4/XSLT.pm b/C4/XSLT.pm index bfacc65..850525a 100644 --- a/C4/XSLT.pm +++ b/C4/XSLT.pm @@ -156,8 +156,17 @@ sub _get_best_default_xslt_filename { return $xslfilename; } +=head2 XSLTParse4Display( $biblionumber, $orig_record, $xslsyspref, $items, $fixamps ) + + $items => an array of items rerords, as returned from eg. GetItemsInfo + +Returns XSLT block + +=cut + sub XSLTParse4Display { - my ( $biblionumber, $orig_record, $xslsyspref, $fixamps, $hidden_items ) = @_; + my ( $biblionumber, $orig_record, $xslsyspref, $items, $fixamps ) = @_; + my $xslfilename = C4::Context->preference($xslsyspref); if ( $xslfilename =~ /^\s*"?default"?\s*$/i ) { my $htdocs; @@ -195,7 +204,7 @@ sub XSLTParse4Display { # grab the XML, run it through our stylesheet, push it out to the browser my $record = transformMARCXML4XSLT($biblionumber, $orig_record); - my $itemsxml = buildKohaItemsNamespace($biblionumber, $hidden_items); + my $itemsxml = $items ? buildKohaItemsNamespace($biblionumber, $items) : ""; my $xmlrecord = $record->as_xml(C4::Context->preference('marcflavour')); my $sysxml = "\n"; foreach my $syspref ( qw/ hidelostitems OPACURLOpenInNewWindow @@ -236,13 +245,7 @@ Is only used in this module currently. =cut sub buildKohaItemsNamespace { - my ($biblionumber, $hidden_items) = @_; - - my @items = C4::Items::GetItemsInfo($biblionumber); - if ($hidden_items && @$hidden_items) { - my %hi = map {$_ => 1} @$hidden_items; - @items = grep { !$hi{$_->{itemnumber}} } @items; - } + my ($biblionumber, $items) = @_; my $shelflocations = GetKohaAuthorisedValues('items.location',GetFrameworkCode($biblionumber), 'opac'); my $ccodes = GetKohaAuthorisedValues('items.ccode',GetFrameworkCode($biblionumber), 'opac'); @@ -252,7 +255,7 @@ sub buildKohaItemsNamespace { my $location = ""; my $ccode = ""; my $xml = ''; - for my $item (@items) { + for my $item (@$items) { my $status; my ( $transfertwhen, $transfertfrom, $transfertto ) = C4::Circulation::GetTransfers($item->{itemnumber}); diff --git a/catalogue/detail.pl b/catalogue/detail.pl index 3f71a87..5459e39 100755 --- a/catalogue/detail.pl +++ b/catalogue/detail.pl @@ -84,12 +84,6 @@ my $fw = GetFrameworkCode($biblionumber); my $showallitems = $query->param('showallitems'); my $marcflavour = C4::Context->preference("marcflavour"); -# XSLT processing of some stuff -if (C4::Context->preference("XSLTDetailsDisplay") ) { - $template->param('XSLTDetailsDisplay' =>'1', - 'XSLTBloc' => XSLTParse4Display($biblionumber, $record, "XSLTDetailsDisplay") ); -} - $template->param( 'SpineLabelShowPrintOnBibDetails' => C4::Context->preference("SpineLabelShowPrintOnBibDetails") ); $template->param( ocoins => GetCOinSBiblio($record) ); @@ -137,6 +131,12 @@ if (@hostitems){ push (@items, at hostitems); } +# XSLT processing of some stuff +if (C4::Context->preference("XSLTDetailsDisplay") ) { + $template->param('XSLTDetailsDisplay' =>'1', + 'XSLTBloc' => XSLTParse4Display($biblionumber, $record, "XSLTDetailsDisplay", \@all_items) ); +} + my $dat = &GetBiblioData($biblionumber); #coping with subscriptions diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl index 224bf82..fd43641 100755 --- a/opac/opac-detail.pl +++ b/opac/opac-detail.pl @@ -140,11 +140,6 @@ SetUTF8Flag($record); my $marcflavour = C4::Context->preference("marcflavour"); my $ean = GetNormalizedEAN( $record, $marcflavour ); -# XSLT processing of some stuff -if (C4::Context->preference("OPACXSLTDetailsDisplay") ) { - $template->param( 'XSLTBloc' => XSLTParse4Display($biblionumber, $record, "OPACXSLTDetailsDisplay" ) ); -} - my $OpacBrowseResults = C4::Context->preference("OpacBrowseResults"); $template->{VARS}->{'OpacBrowseResults'} = $OpacBrowseResults; @@ -483,6 +478,11 @@ if ($hideitems) { @items = @all_items; } +# XSLT processing of some stuff +if (C4::Context->preference("OPACXSLTDetailsDisplay") ) { + $template->param( 'XSLTBloc' => XSLTParse4Display($biblionumber, $record, "OPACXSLTDetailsDisplay", \@items) ); +} + my $branches = GetBranches(); my $branch = ''; if (C4::Context->userenv){ -- 1.9.1 From srdjan at catalyst.net.nz Tue Jul 8 06:12:04 2014 From: srdjan at catalyst.net.nz (Srdjan) Date: Tue, 8 Jul 2014 16:12:04 +1200 Subject: [Koha-patches] [PATCH] bug_11213: whitespace correction Message-ID: <1404792724-1599-1-git-send-email-srdjan@catalyst.net.nz> --- C4/Search.pm | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/C4/Search.pm b/C4/Search.pm index 466a10d..27446e5 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -1914,12 +1914,13 @@ sub searchResults { my $userenv = C4::Context->userenv; if ( $item->{onloan} && !(C4::Members::GetHideLostItemsPreference($userenv->{'number'}) && $item->{itemlost}) ) { $onloan_count++; - my $key = $prefix . $item->{onloan} . $item->{barcode}; + my $key = $prefix . $item->{onloan} . $item->{barcode}; $onloan_items->{$key} = { %$item }; - $onloan_items->{$key}->{due_date} = format_date($item->{onloan}); - $onloan_items->{$key}->{count}++ if $item->{$hbranch}; - $onloan_items->{$key}->{location} = $shelflocations->{ $item->{location} }; - $onloan_items->{$key}->{imageurl} = getitemtypeimagelocation( $search_context, $itemtypes{ $item->{itype} }->{imageurl} ); + $onloan_items->{$key}->{due_date} = format_date($item->{onloan}); + $onloan_items->{$key}->{count}++ + if $item->{$hbranch}; + $onloan_items->{$key}->{location} = $shelflocations->{ $item->{location} }; + $onloan_items->{$key}->{imageurl} = getitemtypeimagelocation( $search_context, $itemtypes{ $item->{itype} }->{imageurl} ); # if something's checked out and lost, mark it as 'long overdue' if ( $item->{itemlost} ) { $onloan_items->{$prefix}->{longoverdue}++; @@ -2001,19 +2002,22 @@ sub searchResults { $other_items->{$key} = { %$item }; $other_items->{$key}->{intransit} = ( $transfertwhen ne '' ) ? 1 : 0; $other_items->{$key}->{onhold} = ($reservestatus) ? 1 : 0; - $other_items->{$key}->{notforloan} = GetAuthorisedValueDesc('','',$item->{notforloan},'','',$notforloan_authorised_value) if $notforloan_authorised_value and $item->{notforloan}; - $other_items->{$key}->{count}++ if $item->{$hbranch}; - $other_items->{$key}->{location} = $shelflocations->{ $item->{location} }; - $other_items->{$key}->{imageurl} = getitemtypeimagelocation( $search_context, $itemtypes{ $item->{itype} }->{imageurl} ); + $other_items->{$key}->{notforloan} = GetAuthorisedValueDesc('','',$item->{notforloan},'','',$notforloan_authorised_value) + if $notforloan_authorised_value and $item->{notforloan}; + $other_items->{$key}->{count}++ + if $item->{$hbranch}; + $other_items->{$key}->{location} = $shelflocations->{ $item->{location} }; + $other_items->{$key}->{imageurl} = getitemtypeimagelocation( $search_context, $itemtypes{ $item->{itype} }->{imageurl} ); } # item is available else { $can_place_holds = 1; $available_count++; $available_items->{$prefix} = { %$item }; - $available_items->{$prefix}->{count}++ if $item->{$hbranch}; - $available_items->{$prefix}->{location} = $shelflocations->{ $item->{location} }; - $available_items->{$prefix}->{imageurl} = getitemtypeimagelocation( $search_context, $itemtypes{ $item->{itype} }->{imageurl} ); + $available_items->{$prefix}->{count}++ + if $item->{$hbranch}; + $available_items->{$prefix}->{location} = $shelflocations->{ $item->{location} }; + $available_items->{$prefix}->{imageurl} = getitemtypeimagelocation( $search_context, $itemtypes{ $item->{itype} }->{imageurl} ); } } } # notforloan, item level and biblioitem level -- 1.9.1 From srdjan at catalyst.net.nz Tue Jul 8 06:12:18 2014 From: srdjan at catalyst.net.nz (Srdjan) Date: Tue, 8 Jul 2014 16:12:18 +1200 Subject: [Koha-patches] [PATCH] bug_11213: Include XSLT processing for searchResults() test Message-ID: <1404792738-1781-1-git-send-email-srdjan@catalyst.net.nz> * Added template paths to temp test dir, so XSLT templates can be picked up --- C4/XSLT.pm | 1 + t/db_dependent/Search.t | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/C4/XSLT.pm b/C4/XSLT.pm index 850525a..e6a4fb9 100644 --- a/C4/XSLT.pm +++ b/C4/XSLT.pm @@ -25,6 +25,7 @@ use strict; use warnings; use C4::Context; +use C4::Templates; use C4::Branch; use C4::Items; use C4::Koha; diff --git a/t/db_dependent/Search.t b/t/db_dependent/Search.t index cadfedb..ca07048 100644 --- a/t/db_dependent/Search.t +++ b/t/db_dependent/Search.t @@ -125,6 +125,8 @@ $contextmodule->mock('preference', sub { return ''; } elsif ($pref eq 'AlternateHoldingsField') { return '490av'; + } elsif ($pref =~ m/XSLTResultsDisplay/) { + return 'default'; } elsif ($pref eq 'AuthoritySeparator') { return '--'; } elsif ($pref eq 'DisplayLibraryFacets') { @@ -191,6 +193,15 @@ sub mock_marcfromkohafield { sub run_marc21_search_tests { my $indexing_mode = shift; $datadir = tempdir(); + # Unix friendly, but so is the zebra_config.pl command below... + my $tpl_dir = File::Spec->rel2abs( dirname(__FILE__) ) . "/../../koha-tmpl"; + my $opac_dir = "$datadir/opac"; + mkdir $opac_dir; + symlink "$tpl_dir/opac-tmpl", "$opac_dir/templates"; + my $intranet_dir = "$datadir/intranet"; + mkdir $intranet_dir; + symlink "$tpl_dir/intranet-tmpl", "$intranet_dir/templates"; + system(dirname(__FILE__) . "/zebra_config.pl $datadir marc21 $indexing_mode"); mock_marcfromkohafield('marc21'); -- 1.9.1 From srdjan at catalyst.net.nz Tue Jul 8 06:12:28 2014 From: srdjan at catalyst.net.nz (Srdjan) Date: Tue, 8 Jul 2014 16:12:28 +1200 Subject: [Koha-patches] [PATCH] bug_11213: C4::VirtualShelves::Page::shelf_contents() Message-ID: <1404792748-1896-1-git-send-email-srdjan@catalyst.net.nz> * Extracted shelf items processing from shelfpage() into a separate sub shelf_contents() in order to be able to test it * Added tests for shelf_contents() with XSLT --- C4/VirtualShelves/Page.pm | 105 +++++++++++++++++++++-------------- t/db_dependent/VirtualShelves_Page.t | 43 +++++++++++++- 2 files changed, 106 insertions(+), 42 deletions(-) diff --git a/C4/VirtualShelves/Page.pm b/C4/VirtualShelves/Page.pm index 0fbf254..0d771b8 100644 --- a/C4/VirtualShelves/Page.pm +++ b/C4/VirtualShelves/Page.pm @@ -73,7 +73,6 @@ sub shelfpage { my $itemoff = ( $query->param('itemoff') ? $query->param('itemoff') : 1 ); my $displaymode = ( $query->param('display') ? $query->param('display') : 'publicshelves' ); my ( $shelflimit, $shelfoffset, $shelveslimit, $shelvesoffset ); - my $marcflavour = C4::Context->preference("marcflavour"); # get biblionumbers stored in the cart my @cart_list; @@ -250,7 +249,6 @@ sub shelfpage { #check that the user can view the shelf if ( ShelfPossibleAction( $loggedinuser, $shelfnumber, 'view' ) ) { my $items; - my $tag_quantity; my $sortfield = ( $sorton ? $sorton : 'title' ); $sortfield = $query->param('sort') || $sortfield; ## Passed in sorting overrides default sorting my $direction = $query->param('direction') || 'asc'; @@ -258,45 +256,15 @@ sub shelfpage { sort => $sortfield, direction => $direction, ); - ( $items, $totitems ) = GetShelfContents( $shelfnumber, $shelflimit, $shelfoffset, $sortfield, $direction ); - for my $this_item (@$items) { - my $biblionumber = $this_item->{'biblionumber'}; - # Getting items infos for location display - my @items_infos = &GetItemsInfo( $this_item->{'biblionumber'}, "cn_sort" ); - my $record = GetMarcBiblio($biblionumber); - if (C4::Context->preference("OPACXSLTResultsDisplay") && $type eq 'opac') { - $this_item->{XSLTBloc} = XSLTParse4Display($biblionumber, $record, "OPACXSLTResultsDisplay", \@items_infos); - } elsif (C4::Context->preference("XSLTResultsDisplay") && $type eq 'intranet') { - $this_item->{XSLTBloc} = XSLTParse4Display($biblionumber, $record, "XSLTResultsDisplay", \@items_infos); - } - - # the virtualshelfcontents table does not store these columns nor are they retrieved from the items - # and itemtypes tables, so I'm commenting them out for now to quiet the log -crn - #$this_item->{imageurl} = $imgdir."/".$itemtypes->{ $this_item->{itemtype} }->{'imageurl'}; - #$this_item->{'description'} = $itemtypes->{ $this_item->{itemtype} }->{'description'}; - $this_item->{'dateadded'} = format_date( $this_item->{'dateadded'} ); - $this_item->{'imageurl'} = getitemtypeinfo( $this_item->{'itemtype'}, $type )->{'imageurl'}; - $this_item->{'coins'} = GetCOinSBiblio( $record ); - $this_item->{'subtitle'} = GetRecordValue('subtitle', $record, GetFrameworkCode($this_item->{'biblionumber'})); - $this_item->{'normalized_upc'} = GetNormalizedUPC( $record,$marcflavour); - $this_item->{'normalized_ean'} = GetNormalizedEAN( $record,$marcflavour); - $this_item->{'normalized_oclc'} = GetNormalizedOCLCNumber($record,$marcflavour); - $this_item->{'normalized_isbn'} = GetNormalizedISBN(undef,$record,$marcflavour); - if(!defined($this_item->{'size'})) { $this_item->{'size'} = "" }; #TT has problems with size - $this_item->{'itemsissued'} = CountItemsIssued( $this_item->{'biblionumber'} ); - $this_item->{'ITEM_RESULTS'} = \@items_infos; - if ( grep {$_ eq $biblionumber} @cart_list) { - $this_item->{'incart'} = 1; - } - - if (C4::Context->preference('TagsEnabled') and $tag_quantity = C4::Context->preference('TagsShowOnList')) { - $this_item->{'TagLoop'} = get_tags({ - biblionumber=>$this_item->{'biblionumber'}, approved=>1, 'sort'=>'-weight', - limit=>$tag_quantity - }); - } - - } + ( $items, $totitems ) = shelf_contents({ + shelfnumber => $shelfnumber, + shelflimit => $shelflimit, + shelfoffset => $shelfoffset, + sortfield => $sortfield, + direction => $direction, + type => $type, + cart_list => \@cart_list, + }); if($type eq 'intranet'){ # Build drop-down list for 'Add To:' menu... my ($totalref, $pubshelves, $barshelves)= @@ -499,6 +467,61 @@ sub shelfpage { output_html_with_http_headers $query, $cookie, $template->output; } +sub shelf_contents { + my ( $params ) = @_; + my $shelfnumber = $params->{shelfnumber}; + my $shelflimit = $params->{shelflimit}; + my $shelfoffset = $params->{shelfoffset}; + my $sortfield = $params->{sortfield}; + my $direction = $params->{direction}; + my $type = $params->{type}; + my $cart_list = $params->{cart_list}; + + my $marcflavour = C4::Context->preference("marcflavour"); + my $tag_quantity = C4::Context->preference('TagsEnabled') + ? C4::Context->preference('TagsShowOnList') + : undef; + my ( $items, $totitems ) = GetShelfContents( $shelfnumber, $shelflimit, $shelfoffset, $sortfield, $direction ); + for my $this_item (@$items) { + my $biblionumber = $this_item->{'biblionumber'}; + # Getting items infos for location display + my @items_infos = &GetItemsInfo( $this_item->{'biblionumber'}, "cn_sort" ); + my $record = GetMarcBiblio($biblionumber); + if (C4::Context->preference("OPACXSLTResultsDisplay") && $type eq 'opac') { + $this_item->{XSLTBloc} = XSLTParse4Display($biblionumber, $record, "OPACXSLTResultsDisplay", \@items_infos); + } elsif (C4::Context->preference("XSLTResultsDisplay") && $type eq 'intranet') { + $this_item->{XSLTBloc} = XSLTParse4Display($biblionumber, $record, "XSLTResultsDisplay", \@items_infos); + } + + # the virtualshelfcontents table does not store these columns nor are they retrieved from the items + # and itemtypes tables, so I'm commenting them out for now to quiet the log -crn + #$this_item->{imageurl} = $imgdir."/".$itemtypes->{ $this_item->{itemtype} }->{'imageurl'}; + #$this_item->{'description'} = $itemtypes->{ $this_item->{itemtype} }->{'description'}; + $this_item->{'dateadded'} = format_date( $this_item->{'dateadded'} ); + $this_item->{'imageurl'} = getitemtypeinfo( $this_item->{'itemtype'}, $type )->{'imageurl'}; + $this_item->{'coins'} = GetCOinSBiblio( $record ); + $this_item->{'subtitle'} = GetRecordValue('subtitle', $record, GetFrameworkCode($this_item->{'biblionumber'})); + $this_item->{'normalized_upc'} = GetNormalizedUPC( $record,$marcflavour); + $this_item->{'normalized_ean'} = GetNormalizedEAN( $record,$marcflavour); + $this_item->{'normalized_oclc'} = GetNormalizedOCLCNumber($record,$marcflavour); + $this_item->{'normalized_isbn'} = GetNormalizedISBN(undef,$record,$marcflavour); + if(!defined($this_item->{'size'})) { $this_item->{'size'} = "" }; #TT has problems with size + $this_item->{'itemsissued'} = CountItemsIssued( $this_item->{'biblionumber'} ); + $this_item->{'ITEM_RESULTS'} = \@items_infos; + if ( grep {$_ eq $biblionumber} @$cart_list) { + $this_item->{'incart'} = 1; + } + + if ($tag_quantity) { + $this_item->{'TagLoop'} = get_tags({ + biblionumber=>$this_item->{'biblionumber'}, approved=>1, 'sort'=>'-weight', + limit=>$tag_quantity + }); + } + } + return ( $items, $totitems ); +} + 1; __END__ diff --git a/t/db_dependent/VirtualShelves_Page.t b/t/db_dependent/VirtualShelves_Page.t index 236d147..dfe4b62 100755 --- a/t/db_dependent/VirtualShelves_Page.t +++ b/t/db_dependent/VirtualShelves_Page.t @@ -6,9 +6,50 @@ use strict; use warnings; -use Test::More tests => 1; +use Test::More tests => 3; + +use C4::Context; BEGIN { use_ok('C4::VirtualShelves::Page'); } +my $dbh = C4::Context->dbh; +# Start transaction +$dbh->{AutoCommit} = 0; +$dbh->{RaiseError} = 1; + +C4::Context->set_preference('XSLTResultsDisplay', 'default'); +C4::Context->set_preference('OPACXSLTResultsDisplay', 'default'); +C4::Context->clear_syspref_cache(); + +my $query = qq{ + SELECT vs.shelfnumber, vs.shelfname,vs.owner, + bo.surname,bo.firstname,vs.category,vs.sortfield, + count(vc.biblionumber) as count + FROM virtualshelves vs + JOIN borrowers bo ON vs.owner=bo.borrowernumber + JOIN virtualshelfcontents vc USING (shelfnumber) + GROUP BY vs.shelfnumber + LIMIT 1 +}; +my $shelf = $dbh->selectrow_hashref($query); + +my %params = ( + shelfnumber => $shelf->{shelfnumber}, + shelflimit => 1, + shelfoffset => 0, + sortfield => $shelf->{sortfield}, + direction => 'asc', + type => 'opac', + cart_list => [], +); +my ( $items, $totitems ) = C4::VirtualShelves::Page::shelf_contents(\%params); +ok( $items->[0]{XSLTBloc}, "opac items XSLT"); + +$params{type} = 'intranet'; +( $items, $totitems ) = C4::VirtualShelves::Page::shelf_contents(\%params); +ok( $items->[0]{XSLTBloc}, "intranet items XSLT"); + +# Cleanup +$dbh->rollback; -- 1.9.1 From srdjan at catalyst.net.nz Tue Jul 8 06:12:38 2014 From: srdjan at catalyst.net.nz (Srdjan) Date: Tue, 8 Jul 2014 16:12:38 +1200 Subject: [Koha-patches] [PATCH] bug_11213: Use branch codes from the database rather than hardcoded CPL and MPL Message-ID: <1404792758-2057-1-git-send-email-srdjan@catalyst.net.nz> --- t/db_dependent/Items.t | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/t/db_dependent/Items.t b/t/db_dependent/Items.t index f5561fc..3183ba4 100755 --- a/t/db_dependent/Items.t +++ b/t/db_dependent/Items.t @@ -30,6 +30,8 @@ BEGIN { } my $dbh = C4::Context->dbh; +my $branches = GetBranches; +my ($branch1, $branch2) = keys %$branches; subtest 'General Add, Get and Del tests' => sub { @@ -43,7 +45,7 @@ subtest 'General Add, Get and Del tests' => sub { my ($bibnum, $bibitemnum) = get_biblio(); # Add an item. - my ($item_bibnum, $item_bibitemnum, $itemnumber) = AddItem({ homebranch => 'CPL', holdingbranch => 'CPL' } , $bibnum); + my ($item_bibnum, $item_bibitemnum, $itemnumber) = AddItem({ homebranch => $branch1, holdingbranch => $branch1 } , $bibnum); cmp_ok($item_bibnum, '==', $bibnum, "New item is linked to correct biblionumber."); cmp_ok($item_bibitemnum, '==', $bibitemnum, "New item is linked to correct biblioitemnumber."); @@ -80,14 +82,14 @@ subtest 'GetHiddenItemnumbers tests' => sub { # Add two items my ($item1_bibnum, $item1_bibitemnum, $item1_itemnumber) = AddItem( - { homebranch => 'CPL', - holdingbranch => 'CPL', + { homebranch => $branch1, + holdingbranch => $branch1, withdrawn => 1 }, $biblionumber ); my ($item2_bibnum, $item2_bibitemnum, $item2_itemnumber) = AddItem( - { homebranch => 'MPL', - holdingbranch => 'MPL', + { homebranch => $branch2, + holdingbranch => $branch2, withdrawn => 0 }, $biblionumber ); @@ -128,7 +130,7 @@ subtest 'GetHiddenItemnumbers tests' => sub { # Two variables, a value each $opachiddenitems = " withdrawn: [1] - homebranch: [MPL] + homebranch: [$branch2] "; C4::Context->set_preference( 'OpacHiddenItems', $opachiddenitems ); @hidden = GetHiddenItemnumbers( @items ); -- 1.9.1 From srdjan at catalyst.net.nz Tue Jul 8 06:12:53 2014 From: srdjan at catalyst.net.nz (Srdjan) Date: Tue, 8 Jul 2014 16:12:53 +1200 Subject: [Koha-patches] [PATCH] bug_11213: GetItemsInfo() test Message-ID: <1404792773-2264-1-git-send-email-srdjan@catalyst.net.nz> --- t/db_dependent/Items.t | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/t/db_dependent/Items.t b/t/db_dependent/Items.t index 3183ba4..1802085 100755 --- a/t/db_dependent/Items.t +++ b/t/db_dependent/Items.t @@ -35,7 +35,7 @@ my ($branch1, $branch2) = keys %$branches; subtest 'General Add, Get and Del tests' => sub { - plan tests => 6; + plan tests => 8; # Start transaction $dbh->{AutoCommit} = 0; @@ -49,6 +49,11 @@ subtest 'General Add, Get and Del tests' => sub { cmp_ok($item_bibnum, '==', $bibnum, "New item is linked to correct biblionumber."); cmp_ok($item_bibitemnum, '==', $bibitemnum, "New item is linked to correct biblioitemnumber."); + # Get items. + my @items_infos = GetItemsInfo( $bibnum, "cn_sort" ); + cmp_ok(scalar(@items_infos), '==', 1, "One item for biblionumber."); + cmp_ok($items_infos[0]{biblionumber}, '==', $bibnum, "Item has correct biblionumber."); + # Get item. my $getitem = GetItem($itemnumber); cmp_ok($getitem->{'itemnumber'}, '==', $itemnumber, "Retrieved item has correct itemnumber."); -- 1.9.1 From srdjan at catalyst.net.nz Tue Jul 8 06:13:07 2014 From: srdjan at catalyst.net.nz (Srdjan) Date: Tue, 8 Jul 2014 16:13:07 +1200 Subject: [Koha-patches] [PATCH] bug_11213: Added XSLTParse4Display() to Items test Message-ID: <1404792787-2440-1-git-send-email-srdjan@catalyst.net.nz> --- t/db_dependent/Items.t | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/t/db_dependent/Items.t b/t/db_dependent/Items.t index 1802085..3aa6822 100755 --- a/t/db_dependent/Items.t +++ b/t/db_dependent/Items.t @@ -21,6 +21,7 @@ use Modern::Perl; use MARC::Record; use C4::Biblio; use C4::Branch; +use C4::XSLT; use Koha::Database; use Test::More tests => 5; @@ -35,7 +36,7 @@ my ($branch1, $branch2) = keys %$branches; subtest 'General Add, Get and Del tests' => sub { - plan tests => 8; + plan tests => 10; # Start transaction $dbh->{AutoCommit} = 0; @@ -54,6 +55,16 @@ subtest 'General Add, Get and Del tests' => sub { cmp_ok(scalar(@items_infos), '==', 1, "One item for biblionumber."); cmp_ok($items_infos[0]{biblionumber}, '==', $bibnum, "Item has correct biblionumber."); + C4::Context->set_preference('XSLTResultsDisplay', 'default'); + C4::Context->set_preference('OPACXSLTResultsDisplay', 'default'); + C4::Context->clear_syspref_cache(); + my $record = GetMarcBiblio($bibnum); + my $html = XSLTParse4Display($bibnum, $record, "OPACXSLTResultsDisplay", \@items_infos); + ok($html, "XSLTParse4Display( OPACXSLTResultsDisplay )"); + $html = XSLTParse4Display($bibnum, $record, "XSLTResultsDisplay", \@items_infos); + ok($html, "XSLTParse4Display( XSLTResultsDisplay )"); + + # Get item. my $getitem = GetItem($itemnumber); cmp_ok($getitem->{'itemnumber'}, '==', $itemnumber, "Retrieved item has correct itemnumber."); -- 1.9.1 From srdjan at catalyst.net.nz Tue Jul 8 06:15:25 2014 From: srdjan at catalyst.net.nz (Srdjan) Date: Tue, 8 Jul 2014 16:15:25 +1200 Subject: [Koha-patches] [PATCH] bug_11213: Check for $item->{itype} presence to avoid warning Message-ID: <1404792925-3830-1-git-send-email-srdjan@catalyst.net.nz> --- C4/XSLT.pm | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/C4/XSLT.pm b/C4/XSLT.pm index e6a4fb9..3fc4b1e 100644 --- a/C4/XSLT.pm +++ b/C4/XSLT.pm @@ -263,8 +263,16 @@ sub buildKohaItemsNamespace { my $reservestatus = C4::Reserves::GetReserveStatus( $item->{itemnumber} ); - if ( $itemtypes->{ $item->{itype} }->{notforloan} || $item->{notforloan} || $item->{onloan} || $item->{withdrawn} || $item->{itemlost} || $item->{damaged} || - (defined $transfertwhen && $transfertwhen ne '') || $item->{itemnotforloan} || (defined $reservestatus && $reservestatus eq "Waiting") ){ + if ( ($item->{itype} && $itemtypes->{ $item->{itype} }->{notforloan}) + || $item->{notforloan} + || $item->{onloan} + || $item->{withdrawn} + || $item->{itemlost} + || $item->{damaged} + || (defined $transfertwhen && $transfertwhen ne '') + || $item->{itemnotforloan} + || (defined $reservestatus && $reservestatus eq "Waiting") + ){ if ( $item->{notforloan} < 0) { $status = "On order"; } -- 1.9.1 From srdjan at catalyst.net.nz Thu Jul 10 07:29:32 2014 From: srdjan at catalyst.net.nz (Srdjan) Date: Thu, 10 Jul 2014 17:29:32 +1200 Subject: [Koha-patches] [PATCH] Use branch codes from the database rather than hardcoded CPL and MPL Message-ID: <1404970172-28133-1-git-send-email-srdjan@catalyst.net.nz> http://bugs.koha-community.org/show_bug.cgi?id=5304 --- t/db_dependent/Items.t | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/t/db_dependent/Items.t b/t/db_dependent/Items.t index f5561fc..ad52278 100755 --- a/t/db_dependent/Items.t +++ b/t/db_dependent/Items.t @@ -30,6 +30,8 @@ BEGIN { } my $dbh = C4::Context->dbh; +my $branches = GetBranches; +my ($branch1, $branch2) = keys %$branches; subtest 'General Add, Get and Del tests' => sub { @@ -43,7 +45,7 @@ subtest 'General Add, Get and Del tests' => sub { my ($bibnum, $bibitemnum) = get_biblio(); # Add an item. - my ($item_bibnum, $item_bibitemnum, $itemnumber) = AddItem({ homebranch => 'CPL', holdingbranch => 'CPL' } , $bibnum); + my ($item_bibnum, $item_bibitemnum, $itemnumber) = AddItem({ homebranch => $branch1, holdingbranch => $branch1 } , $bibnum); cmp_ok($item_bibnum, '==', $bibnum, "New item is linked to correct biblionumber."); cmp_ok($item_bibitemnum, '==', $bibitemnum, "New item is linked to correct biblioitemnumber."); @@ -80,14 +82,14 @@ subtest 'GetHiddenItemnumbers tests' => sub { # Add two items my ($item1_bibnum, $item1_bibitemnum, $item1_itemnumber) = AddItem( - { homebranch => 'CPL', - holdingbranch => 'CPL', + { homebranch => $branch1, + holdingbranch => $branch1, withdrawn => 1 }, $biblionumber ); my ($item2_bibnum, $item2_bibitemnum, $item2_itemnumber) = AddItem( - { homebranch => 'MPL', - holdingbranch => 'MPL', + { homebranch => $branch2, + holdingbranch => $branch2, withdrawn => 0 }, $biblionumber ); @@ -128,7 +130,7 @@ subtest 'GetHiddenItemnumbers tests' => sub { # Two variables, a value each $opachiddenitems = " withdrawn: [1] - homebranch: [MPL] + homebranch: [$branch2] "; C4::Context->set_preference( 'OpacHiddenItems', $opachiddenitems ); @hidden = GetHiddenItemnumbers( @items ); @@ -151,23 +153,21 @@ subtest 'GetItemsInfo tests' => sub { $dbh->{AutoCommit} = 0; $dbh->{RaiseError} = 1; - my $homebranch = 'CPL'; - my $holdingbranch = 'MPL'; - # Add a biblio - my $biblionumber = get_biblio(); + my ($biblionumber, $biblioitemnumber) = get_biblio(); + # Add an item my ($item_bibnum, $item_bibitemnum, $itemnumber) = AddItem({ - homebranch => $homebranch, - holdingbranch => $holdingbranch + homebranch => $branch1, + holdingbranch => $branch2 }, $biblionumber ); - my $branch = GetBranchDetail( $homebranch ); + my $branch = GetBranchDetail( $branch1 ); $branch->{ opac_info } = "homebranch OPAC info"; ModBranch($branch); - $branch = GetBranchDetail( $holdingbranch ); + $branch = GetBranchDetail( $branch2 ); $branch->{ opac_info } = "holdingbranch OPAC info"; ModBranch($branch); -- 1.9.1 From srdjan at catalyst.net.nz Thu Jul 10 07:30:28 2014 From: srdjan at catalyst.net.nz (Srdjan) Date: Thu, 10 Jul 2014 17:30:28 +1200 Subject: [Koha-patches] [PATCH] bug_5304: GetItemsInfo() - moved issues and serials query from the results loop to the main query Message-ID: <1404970228-28450-1-git-send-email-srdjan@catalyst.net.nz> --- C4/Items.pm | 66 ++++++++++++++++++++++--------------------------------------- 1 file changed, 24 insertions(+), 42 deletions(-) diff --git a/C4/Items.pm b/C4/Items.pm index 1781880..c323308 100644 --- a/C4/Items.pm +++ b/C4/Items.pm @@ -1266,6 +1266,14 @@ sub GetItemsInfo { biblioitems.lccn, biblioitems.url, items.notforloan as itemnotforloan, + issues.borrowernumber, + issues.date_due as datedue, + borrowers.cardnumber, + borrowers.surname, + borrowers.firstname, + borrowers.branchcode as bcode, + serial.serialseq, + serial.publisheddate, itemtypes.description, itemtypes.notforloan as notforloan_per_itemtype, holding.branchurl, @@ -1277,6 +1285,10 @@ sub GetItemsInfo { LEFT JOIN branches AS home ON items.homebranch=home.branchcode LEFT JOIN biblio ON biblio.biblionumber = items.biblionumber LEFT JOIN biblioitems ON biblioitems.biblioitemnumber = items.biblioitemnumber + LEFT JOIN issues USING (itemnumber) + LEFT JOIN borrowers USING (borrowernumber) + LEFT JOIN serialitems USING (itemnumber) + LEFT JOIN serial USING (serialid) LEFT JOIN itemtypes ON itemtypes.itemtype = " . (C4::Context->preference('item-level_itypes') ? 'items.itype' : 'biblioitems.itemtype'); $query .= " WHERE items.biblionumber = ? ORDER BY home.branchname, items.enumchron, LPAD( items.copynumber, 8, '0' ), items.dateaccessioned DESC" ; @@ -1286,44 +1298,14 @@ sub GetItemsInfo { my @results; my $serial; - my $isth = $dbh->prepare( - "SELECT issues.*,borrowers.cardnumber,borrowers.surname,borrowers.firstname,borrowers.branchcode as bcode - FROM issues LEFT JOIN borrowers ON issues.borrowernumber=borrowers.borrowernumber - WHERE itemnumber = ?" - ); - my $ssth = $dbh->prepare("SELECT serialseq,publisheddate from serialitems left join serial on serialitems.serialid=serial.serialid where serialitems.itemnumber=? "); - while ( my $data = $sth->fetchrow_hashref ) { - my $datedue = ''; - $isth->execute( $data->{'itemnumber'} ); - if ( my $idata = $isth->fetchrow_hashref ) { - $data->{borrowernumber} = $idata->{borrowernumber}; - $data->{cardnumber} = $idata->{cardnumber}; - $data->{surname} = $idata->{surname}; - $data->{firstname} = $idata->{firstname}; - $data->{lastreneweddate} = $idata->{lastreneweddate}; - $datedue = $idata->{'date_due'}; - if (C4::Context->preference("IndependentBranches")){ - my $userenv = C4::Context->userenv; - unless ( C4::Context->IsSuperLibrarian() ) { - $data->{'NOTSAMEBRANCH'} = 1 if ($idata->{'bcode'} ne $userenv->{branch}); + my $userenv = C4::Context->userenv; + my $want_not_same_branch = C4::Context->preference("IndependentBranches") && !C4::Context->IsSuperLibrarian(); + while ( my $data = $sth->fetchrow_hashref ) { + if ( $data->{borrowernumber} && $want_not_same_branch) { + $data->{'NOTSAMEBRANCH'} = $data->{'bcode'} ne $userenv->{branch}; } - } - } - if ( $data->{'serial'}) { - $ssth->execute($data->{'itemnumber'}) ; - ($data->{'serialseq'} , $data->{'publisheddate'}) = $ssth->fetchrow_array(); - $serial = 1; - } - #get branch information..... - my $bsth = $dbh->prepare( - "SELECT * FROM branches WHERE branchcode = ? - " - ); - $bsth->execute( $data->{'holdingbranch'} ); - if ( my $bdata = $bsth->fetchrow_hashref ) { - $data->{'branchname'} = $bdata->{'branchname'}; - } - $data->{'datedue'} = $datedue; + + $serial ||= $data->{'serial'}; # get notforloan complete status if applicable if ( my $code = C4::Koha::GetAuthValCode( 'items.notforloan', $data->{frameworkcode} ) ) { @@ -1341,6 +1323,7 @@ sub GetItemsInfo { if ( my $code = C4::Koha::GetAuthValCode( 'items.stack', $data->{frameworkcode} ) ) { $data->{stack} = C4::Koha::GetKohaAuthorisedValueLib( $code, $data->{stack} ); } + # Find the last 3 people who borrowed this item. my $sth2 = $dbh->prepare("SELECT * FROM old_issues,borrowers WHERE itemnumber = ? @@ -1359,11 +1342,10 @@ sub GetItemsInfo { $results[$i] = $data; $i++; } - if($serial) { - return( sort { ($b->{'publisheddate'} || $b->{'enumchron'}) cmp ($a->{'publisheddate'} || $a->{'enumchron'}) } @results ); - } else { - return (@results); - } + + return $serial + ? sort { ($b->{'publisheddate'} || $b->{'enumchron'}) cmp ($a->{'publisheddate'} || $a->{'enumchron'}) } @results + : @results; } =head2 GetItemsLocationInfo -- 1.9.1 From tomascohen at gmail.com Fri Jul 11 15:17:42 2014 From: tomascohen at gmail.com (Tomas Cohen Arazi) Date: Fri, 11 Jul 2014 10:17:42 -0300 Subject: [Koha-patches] [PATCH 1/2] Bug 12558: DBIx::Class schema update 07/2014 Message-ID: <1405084663-10283-1-git-send-email-tomascohen@gmail.com> Needed DBIx::Class schema update to keep sync with current kohastructure.sql. Signed-off-by: Tomas Cohen Arazi --- Koha/Schema/Result/Accountline.pm | 8 +-- Koha/Schema/Result/Aqbasket.pm | 14 ++-- Koha/Schema/Result/Aqinvoice.pm | 6 +- Koha/Schema/Result/Aqorder.pm | 8 +-- Koha/Schema/Result/AqordersTransfer.pm | 8 +-- Koha/Schema/Result/AuthorisedValuesBranch.pm | 8 +-- Koha/Schema/Result/Borrower.pm | 8 +-- Koha/Schema/Result/BorrowerAttributeTypesBranch.pm | 8 +-- Koha/Schema/Result/CategoriesBranch.pm | 8 +-- Koha/Schema/Result/ClassSource.pm | 6 +- Koha/Schema/Result/CollectionsTracking.pm | 77 ++++++++++++++++++++++ Koha/Schema/Result/CourseInstructor.pm | 6 +- Koha/Schema/Result/CourseReserve.pm | 6 +- Koha/Schema/Result/CreatorBatch.pm | 8 +-- Koha/Schema/Result/ImportRecord.pm | 12 ++-- Koha/Schema/Result/ImportRecordMatch.pm | 77 ++++++++++++++++++++++ Koha/Schema/Result/Issue.pm | 8 +-- Koha/Schema/Result/Item.pm | 8 +-- Koha/Schema/Result/MessageQueue.pm | 6 +- Koha/Schema/Result/OldIssue.pm | 12 ++-- Koha/Schema/Result/OldReserve.pm | 16 ++--- Koha/Schema/Result/Review.pm | 6 +- Koha/Schema/Result/Subscription.pm | 8 +-- Koha/Schema/Result/Virtualshelfcontent.pm | 8 +-- Koha/Schema/Result/Virtualshelfshare.pm | 8 +-- Koha/Schema/Result/Virtualshelve.pm | 8 +-- Koha/Schema/Result/Z3950server.pm | 8 +-- 27 files changed, 259 insertions(+), 105 deletions(-) create mode 100644 Koha/Schema/Result/CollectionsTracking.pm create mode 100644 Koha/Schema/Result/ImportRecordMatch.pm diff --git a/Koha/Schema/Result/Accountline.pm b/Koha/Schema/Result/Accountline.pm index 3b977fa..e83ef40 100644 --- a/Koha/Schema/Result/Accountline.pm +++ b/Koha/Schema/Result/Accountline.pm @@ -208,14 +208,14 @@ __PACKAGE__->belongs_to( { is_deferrable => 1, join_type => "LEFT", - on_delete => "CASCADE", - on_update => "CASCADE", + on_delete => "SET NULL", + on_update => "SET NULL", }, ); -# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-10-14 20:56:21 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:VLEuOBmnS+xgk7LXAqxtLw +# Created by DBIx::Class::Schema::Loader v0.07039 @ 2014-07-11 09:26:55 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:jUiCeLLPg5228rNEBW0w2g # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/Koha/Schema/Result/Aqbasket.pm b/Koha/Schema/Result/Aqbasket.pm index 7b5f5fe..fbf1185 100644 --- a/Koha/Schema/Result/Aqbasket.pm +++ b/Koha/Schema/Result/Aqbasket.pm @@ -203,7 +203,7 @@ __PACKAGE__->belongs_to( { is_deferrable => 1, join_type => "LEFT", - on_delete => "CASCADE", + on_delete => "RESTRICT", on_update => "CASCADE", }, ); @@ -220,7 +220,7 @@ __PACKAGE__->belongs_to( "booksellerid", "Koha::Schema::Result::Aqbookseller", { id => "booksellerid" }, - { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, + { is_deferrable => 1, on_delete => "RESTRICT", on_update => "CASCADE" }, ); =head2 branch @@ -238,7 +238,7 @@ __PACKAGE__->belongs_to( { is_deferrable => 1, join_type => "LEFT", - on_delete => "CASCADE", + on_delete => "SET NULL", on_update => "CASCADE", }, ); @@ -258,8 +258,8 @@ __PACKAGE__->belongs_to( { is_deferrable => 1, join_type => "LEFT", - on_delete => "CASCADE", - on_update => "CASCADE", + on_delete => "RESTRICT", + on_update => "RESTRICT", }, ); @@ -274,8 +274,8 @@ Composing rels: L -> borrowernumber __PACKAGE__->many_to_many("borrowernumbers", "aqbasketusers", "borrowernumber"); -# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-10-31 16:31:18 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:TCssMGPEqtE0MZ5INCufoA +# Created by DBIx::Class::Schema::Loader v0.07039 @ 2014-07-11 09:26:55 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:pT+YFf9nfD/dmBuE4RNCFw # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/Koha/Schema/Result/Aqinvoice.pm b/Koha/Schema/Result/Aqinvoice.pm index c063d30..ce68093 100644 --- a/Koha/Schema/Result/Aqinvoice.pm +++ b/Koha/Schema/Result/Aqinvoice.pm @@ -150,14 +150,14 @@ __PACKAGE__->belongs_to( { is_deferrable => 1, join_type => "LEFT", - on_delete => "CASCADE", + on_delete => "SET NULL", on_update => "CASCADE", }, ); -# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-10-14 20:56:21 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:nV0lYm2w4xX8cwVmTVF3YQ +# Created by DBIx::Class::Schema::Loader v0.07039 @ 2014-07-11 09:26:55 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:3se4f767VfvBKaZ8tlXwHQ # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/Koha/Schema/Result/Aqorder.pm b/Koha/Schema/Result/Aqorder.pm index a4bb26c..b47a569 100644 --- a/Koha/Schema/Result/Aqorder.pm +++ b/Koha/Schema/Result/Aqorder.pm @@ -421,7 +421,7 @@ __PACKAGE__->belongs_to( { is_deferrable => 1, join_type => "LEFT", - on_delete => "CASCADE", + on_delete => "SET NULL", on_update => "CASCADE", }, ); @@ -441,7 +441,7 @@ __PACKAGE__->belongs_to( { is_deferrable => 1, join_type => "LEFT", - on_delete => "CASCADE", + on_delete => "SET NULL", on_update => "CASCADE", }, ); @@ -467,8 +467,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07025 @ 2014-04-19 15:25:43 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:XGQHKw2/pml/kFe89vbvXw +# Created by DBIx::Class::Schema::Loader v0.07039 @ 2014-07-11 09:26:55 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:u5KHnXS5hMmqpqufIEkPig # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/Koha/Schema/Result/AqordersTransfer.pm b/Koha/Schema/Result/AqordersTransfer.pm index 0a4ec88..68008ba 100644 --- a/Koha/Schema/Result/AqordersTransfer.pm +++ b/Koha/Schema/Result/AqordersTransfer.pm @@ -101,7 +101,7 @@ __PACKAGE__->belongs_to( { is_deferrable => 1, join_type => "LEFT", - on_delete => "CASCADE", + on_delete => "SET NULL", on_update => "CASCADE", }, ); @@ -121,14 +121,14 @@ __PACKAGE__->belongs_to( { is_deferrable => 1, join_type => "LEFT", - on_delete => "CASCADE", + on_delete => "SET NULL", on_update => "CASCADE", }, ); -# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-10-14 20:56:21 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:1WX3cQyoYmNmPed+OqdUNA +# Created by DBIx::Class::Schema::Loader v0.07039 @ 2014-07-11 09:26:55 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Z6+vESlzZKjZloNvrEHpxA # You can replace this text with custom code or comments, and it will be preserved on regeneration diff --git a/Koha/Schema/Result/AuthorisedValuesBranch.pm b/Koha/Schema/Result/AuthorisedValuesBranch.pm index 0c6e2d9..35bb493 100644 --- a/Koha/Schema/Result/AuthorisedValuesBranch.pm +++ b/Koha/Schema/Result/AuthorisedValuesBranch.pm @@ -63,7 +63,7 @@ __PACKAGE__->belongs_to( is_deferrable => 1, join_type => "LEFT", on_delete => "CASCADE", - on_update => "CASCADE", + on_update => "RESTRICT", }, ); @@ -83,13 +83,13 @@ __PACKAGE__->belongs_to( is_deferrable => 1, join_type => "LEFT", on_delete => "CASCADE", - on_update => "CASCADE", + on_update => "RESTRICT", }, ); -# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-10-14 20:56:21 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:k6hCbzMVZ1VRsubvdrZMYQ +# Created by DBIx::Class::Schema::Loader v0.07039 @ 2014-07-11 09:26:55 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:FlVw5Eu4bXF2ygD0QkwwCg # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/Koha/Schema/Result/Borrower.pm b/Koha/Schema/Result/Borrower.pm index 3d9f9ae..b1f9e6f 100644 --- a/Koha/Schema/Result/Borrower.pm +++ b/Koha/Schema/Result/Borrower.pm @@ -708,7 +708,7 @@ __PACKAGE__->belongs_to( "branchcode", "Koha::Schema::Result::Branch", { branchcode => "branchcode" }, - { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, + { is_deferrable => 1, on_delete => "RESTRICT", on_update => "RESTRICT" }, ); =head2 categorycode @@ -723,7 +723,7 @@ __PACKAGE__->belongs_to( "categorycode", "Koha::Schema::Result::Category", { categorycode => "categorycode" }, - { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, + { is_deferrable => 1, on_delete => "RESTRICT", on_update => "RESTRICT" }, ); =head2 course_instructors @@ -1072,8 +1072,8 @@ Composing rels: L -> course __PACKAGE__->many_to_many("courses", "course_instructors", "course"); -# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-10-31 16:31:19 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:z4kW3xYX1CyrwvGdZu32nA +# Created by DBIx::Class::Schema::Loader v0.07039 @ 2014-07-11 09:26:55 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:5cfpOojccKCoVRMj+0mWHg # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/Koha/Schema/Result/BorrowerAttributeTypesBranch.pm b/Koha/Schema/Result/BorrowerAttributeTypesBranch.pm index 362b5cc..2345170 100644 --- a/Koha/Schema/Result/BorrowerAttributeTypesBranch.pm +++ b/Koha/Schema/Result/BorrowerAttributeTypesBranch.pm @@ -64,7 +64,7 @@ __PACKAGE__->belongs_to( is_deferrable => 1, join_type => "LEFT", on_delete => "CASCADE", - on_update => "CASCADE", + on_update => "RESTRICT", }, ); @@ -84,13 +84,13 @@ __PACKAGE__->belongs_to( is_deferrable => 1, join_type => "LEFT", on_delete => "CASCADE", - on_update => "CASCADE", + on_update => "RESTRICT", }, ); -# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-10-14 20:56:21 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:/ppDBtfKZvUNcERWFbLuuw +# Created by DBIx::Class::Schema::Loader v0.07039 @ 2014-07-11 09:26:55 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:MA/VDd/K/RTgZ9TLy0K1gw # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/Koha/Schema/Result/CategoriesBranch.pm b/Koha/Schema/Result/CategoriesBranch.pm index 584c177..2a0959e 100644 --- a/Koha/Schema/Result/CategoriesBranch.pm +++ b/Koha/Schema/Result/CategoriesBranch.pm @@ -64,7 +64,7 @@ __PACKAGE__->belongs_to( is_deferrable => 1, join_type => "LEFT", on_delete => "CASCADE", - on_update => "CASCADE", + on_update => "RESTRICT", }, ); @@ -84,13 +84,13 @@ __PACKAGE__->belongs_to( is_deferrable => 1, join_type => "LEFT", on_delete => "CASCADE", - on_update => "CASCADE", + on_update => "RESTRICT", }, ); -# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-10-14 20:56:21 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:9fXKFDUQsOx+uqF+slRhSw +# Created by DBIx::Class::Schema::Loader v0.07039 @ 2014-07-11 09:26:55 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:5NpXKN72zzNcHauiDZfdEA # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/Koha/Schema/Result/ClassSource.pm b/Koha/Schema/Result/ClassSource.pm index a0b27cd..c6de4c4 100644 --- a/Koha/Schema/Result/ClassSource.pm +++ b/Koha/Schema/Result/ClassSource.pm @@ -94,12 +94,12 @@ __PACKAGE__->belongs_to( "class_sort_rule", "Koha::Schema::Result::ClassSortRule", { class_sort_rule => "class_sort_rule" }, - { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, + { is_deferrable => 1, on_delete => "RESTRICT", on_update => "RESTRICT" }, ); -# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-10-14 20:56:21 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:OPkfouKUejU6oCgy58yt6Q +# Created by DBIx::Class::Schema::Loader v0.07039 @ 2014-07-11 09:26:55 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:2O58Q7wdbfAl6xmiW02PAA # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/Koha/Schema/Result/CollectionsTracking.pm b/Koha/Schema/Result/CollectionsTracking.pm new file mode 100644 index 0000000..c25bb06 --- /dev/null +++ b/Koha/Schema/Result/CollectionsTracking.pm @@ -0,0 +1,77 @@ +use utf8; +package Koha::Schema::Result::CollectionsTracking; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY THE FIRST PART OF THIS FILE + +=head1 NAME + +Koha::Schema::Result::CollectionsTracking + +=cut + +use strict; +use warnings; + +use base 'DBIx::Class::Core'; + +=head1 TABLE: C + +=cut + +__PACKAGE__->table("collections_tracking"); + +=head1 ACCESSORS + +=head2 collections_tracking_id + + data_type: 'integer' + is_auto_increment: 1 + is_nullable: 0 + +=head2 colid + + data_type: 'integer' + default_value: 0 + is_nullable: 0 + +collections.colId + +=head2 itemnumber + + data_type: 'integer' + default_value: 0 + is_nullable: 0 + +items.itemnumber + +=cut + +__PACKAGE__->add_columns( + "collections_tracking_id", + { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, + "colid", + { data_type => "integer", default_value => 0, is_nullable => 0 }, + "itemnumber", + { data_type => "integer", default_value => 0, is_nullable => 0 }, +); + +=head1 PRIMARY KEY + +=over 4 + +=item * L + +=back + +=cut + +__PACKAGE__->set_primary_key("collections_tracking_id"); + + +# Created by DBIx::Class::Schema::Loader v0.07039 @ 2014-07-11 09:26:55 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:aV5bgiXNrskXo+q+WLuwPg + + +# You can replace this text with custom code or comments, and it will be preserved on regeneration +1; diff --git a/Koha/Schema/Result/CourseInstructor.pm b/Koha/Schema/Result/CourseInstructor.pm index c1d183c..1049475 100644 --- a/Koha/Schema/Result/CourseInstructor.pm +++ b/Koha/Schema/Result/CourseInstructor.pm @@ -87,12 +87,12 @@ __PACKAGE__->belongs_to( "course", "Koha::Schema::Result::Course", { course_id => "course_id" }, - { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, + { is_deferrable => 1, on_delete => "RESTRICT", on_update => "RESTRICT" }, ); -# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-10-14 20:56:21 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:dIemqF/uRWLNN4IMCHZxRA +# Created by DBIx::Class::Schema::Loader v0.07039 @ 2014-07-11 09:26:55 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:7vP3bJ0YA6LEepYOaNg++A # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/Koha/Schema/Result/CourseReserve.pm b/Koha/Schema/Result/CourseReserve.pm index bb937b2..9cfdfab 100644 --- a/Koha/Schema/Result/CourseReserve.pm +++ b/Koha/Schema/Result/CourseReserve.pm @@ -121,12 +121,12 @@ __PACKAGE__->belongs_to( "course", "Koha::Schema::Result::Course", { course_id => "course_id" }, - { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, + { is_deferrable => 1, on_delete => "RESTRICT", on_update => "RESTRICT" }, ); -# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-10-14 20:56:21 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:9KuuUyFReuw+PAlLW84yXQ +# Created by DBIx::Class::Schema::Loader v0.07039 @ 2014-07-11 09:26:55 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:SSTJhsNOuUlxr/CsDs08pQ # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/Koha/Schema/Result/CreatorBatch.pm b/Koha/Schema/Result/CreatorBatch.pm index 3fdc97c..7049950 100644 --- a/Koha/Schema/Result/CreatorBatch.pm +++ b/Koha/Schema/Result/CreatorBatch.pm @@ -150,7 +150,7 @@ __PACKAGE__->belongs_to( "branch_code", "Koha::Schema::Result::Branch", { branchcode => "branch_code" }, - { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" }, ); =head2 item_number @@ -169,13 +169,13 @@ __PACKAGE__->belongs_to( is_deferrable => 1, join_type => "LEFT", on_delete => "CASCADE", - on_update => "CASCADE", + on_update => "RESTRICT", }, ); -# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-10-14 20:56:21 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:w5Nfrm8a8ajsC0bLBACaWg +# Created by DBIx::Class::Schema::Loader v0.07039 @ 2014-07-11 09:26:55 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:x9PaYKzfg8jT6zFP4IwhBA # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/Koha/Schema/Result/ImportRecord.pm b/Koha/Schema/Result/ImportRecord.pm index c010138..2d27bd8 100644 --- a/Koha/Schema/Result/ImportRecord.pm +++ b/Koha/Schema/Result/ImportRecord.pm @@ -254,24 +254,24 @@ __PACKAGE__->has_many( { cascade_copy => 0, cascade_delete => 0 }, ); -=head2 import_records_matches +=head2 import_record_matches Type: has_many -Related object: L +Related object: L =cut __PACKAGE__->has_many( - "import_records_matches", - "Koha::Schema::Result::ImportRecordMatches", + "import_record_matches", + "Koha::Schema::Result::ImportRecordMatch", { "foreign.import_record_id" => "self.import_record_id" }, { cascade_copy => 0, cascade_delete => 0 }, ); -# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-10-14 20:56:21 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:e71umJ0QmfPBvlxmzbClng +# Created by DBIx::Class::Schema::Loader v0.07039 @ 2014-07-11 09:26:55 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:jhzXlqw5mA1lGsI9SZEv/Q # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/Koha/Schema/Result/ImportRecordMatch.pm b/Koha/Schema/Result/ImportRecordMatch.pm new file mode 100644 index 0000000..0ea5d56 --- /dev/null +++ b/Koha/Schema/Result/ImportRecordMatch.pm @@ -0,0 +1,77 @@ +use utf8; +package Koha::Schema::Result::ImportRecordMatch; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY THE FIRST PART OF THIS FILE + +=head1 NAME + +Koha::Schema::Result::ImportRecordMatch + +=cut + +use strict; +use warnings; + +use base 'DBIx::Class::Core'; + +=head1 TABLE: C + +=cut + +__PACKAGE__->table("import_record_matches"); + +=head1 ACCESSORS + +=head2 import_record_id + + data_type: 'integer' + is_foreign_key: 1 + is_nullable: 0 + +=head2 candidate_match_id + + data_type: 'integer' + is_nullable: 0 + +=head2 score + + data_type: 'integer' + default_value: 0 + is_nullable: 0 + +=cut + +__PACKAGE__->add_columns( + "import_record_id", + { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, + "candidate_match_id", + { data_type => "integer", is_nullable => 0 }, + "score", + { data_type => "integer", default_value => 0, is_nullable => 0 }, +); + +=head1 RELATIONS + +=head2 import_record + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "import_record", + "Koha::Schema::Result::ImportRecord", + { import_record_id => "import_record_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07039 @ 2014-07-11 09:26:55 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:hJW36EeP+H8+0/Ij3iuIFw + + +# You can replace this text with custom code or comments, and it will be preserved on regeneration +1; diff --git a/Koha/Schema/Result/Issue.pm b/Koha/Schema/Result/Issue.pm index e1838b6..2b3e3fd 100644 --- a/Koha/Schema/Result/Issue.pm +++ b/Koha/Schema/Result/Issue.pm @@ -154,7 +154,7 @@ __PACKAGE__->belongs_to( { is_deferrable => 1, join_type => "LEFT", - on_delete => "CASCADE", + on_delete => "RESTRICT", on_update => "CASCADE", }, ); @@ -174,14 +174,14 @@ __PACKAGE__->belongs_to( { is_deferrable => 1, join_type => "LEFT", - on_delete => "CASCADE", + on_delete => "RESTRICT", on_update => "CASCADE", }, ); -# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-10-14 20:56:21 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ZEh31EKBmURMKxDxI+H3EA +# Created by DBIx::Class::Schema::Loader v0.07039 @ 2014-07-11 09:26:55 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:2SJJ3az4Ml9hKEQvNH3+Kw __PACKAGE__->belongs_to( "borrower", diff --git a/Koha/Schema/Result/Item.pm b/Koha/Schema/Result/Item.pm index fd50d15..67e1d7c 100644 --- a/Koha/Schema/Result/Item.pm +++ b/Koha/Schema/Result/Item.pm @@ -508,7 +508,7 @@ __PACKAGE__->belongs_to( { is_deferrable => 1, join_type => "LEFT", - on_delete => "CASCADE", + on_delete => "RESTRICT", on_update => "CASCADE", }, ); @@ -528,7 +528,7 @@ __PACKAGE__->belongs_to( { is_deferrable => 1, join_type => "LEFT", - on_delete => "CASCADE", + on_delete => "RESTRICT", on_update => "CASCADE", }, ); @@ -609,8 +609,8 @@ __PACKAGE__->might_have( ); -# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-12-19 06:29:02 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:h6fPG62SifJ5T8QKPZNBBw +# Created by DBIx::Class::Schema::Loader v0.07039 @ 2014-07-11 09:26:55 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Rc89LTrsDtt8Y6yXVUdhMA __PACKAGE__->belongs_to( "biblio", diff --git a/Koha/Schema/Result/MessageQueue.pm b/Koha/Schema/Result/MessageQueue.pm index 417cd78..6612db5 100644 --- a/Koha/Schema/Result/MessageQueue.pm +++ b/Koha/Schema/Result/MessageQueue.pm @@ -165,12 +165,12 @@ __PACKAGE__->belongs_to( "message_transport_type", "Koha::Schema::Result::MessageTransportType", { message_transport_type => "message_transport_type" }, - { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, + { is_deferrable => 1, on_delete => "RESTRICT", on_update => "CASCADE" }, ); -# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-10-14 20:56:21 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:+gmGYPCtwCYKHAzfd9xByQ +# Created by DBIx::Class::Schema::Loader v0.07039 @ 2014-07-11 09:26:55 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:YWxM2O2W/h34qqIOIpzOtw # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/Koha/Schema/Result/OldIssue.pm b/Koha/Schema/Result/OldIssue.pm index 4050f06..e6d664b 100644 --- a/Koha/Schema/Result/OldIssue.pm +++ b/Koha/Schema/Result/OldIssue.pm @@ -154,8 +154,8 @@ __PACKAGE__->belongs_to( { is_deferrable => 1, join_type => "LEFT", - on_delete => "CASCADE", - on_update => "CASCADE", + on_delete => "SET NULL", + on_update => "SET NULL", }, ); @@ -174,14 +174,14 @@ __PACKAGE__->belongs_to( { is_deferrable => 1, join_type => "LEFT", - on_delete => "CASCADE", - on_update => "CASCADE", + on_delete => "SET NULL", + on_update => "SET NULL", }, ); -# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-10-14 20:56:21 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:uPOxNROoMMRZ0qZsXsxEjA +# Created by DBIx::Class::Schema::Loader v0.07039 @ 2014-07-11 09:26:55 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:sgsDHihVYHrTycbaqoGbaQ # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/Koha/Schema/Result/OldReserve.pm b/Koha/Schema/Result/OldReserve.pm index 84ba18c..942480f 100644 --- a/Koha/Schema/Result/OldReserve.pm +++ b/Koha/Schema/Result/OldReserve.pm @@ -215,8 +215,8 @@ __PACKAGE__->belongs_to( { is_deferrable => 1, join_type => "LEFT", - on_delete => "CASCADE", - on_update => "CASCADE", + on_delete => "SET NULL", + on_update => "SET NULL", }, ); @@ -235,8 +235,8 @@ __PACKAGE__->belongs_to( { is_deferrable => 1, join_type => "LEFT", - on_delete => "CASCADE", - on_update => "CASCADE", + on_delete => "SET NULL", + on_update => "SET NULL", }, ); @@ -255,14 +255,14 @@ __PACKAGE__->belongs_to( { is_deferrable => 1, join_type => "LEFT", - on_delete => "CASCADE", - on_update => "CASCADE", + on_delete => "SET NULL", + on_update => "SET NULL", }, ); -# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-10-14 20:56:21 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:g/WiYGPOyzJGtMWiAHvIxA +# Created by DBIx::Class::Schema::Loader v0.07039 @ 2014-07-11 09:26:55 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:CMfQmK2sJxQB0FBb0X12ug # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/Koha/Schema/Result/Review.pm b/Koha/Schema/Result/Review.pm index 37b822d..64ee4ad 100644 --- a/Koha/Schema/Result/Review.pm +++ b/Koha/Schema/Result/Review.pm @@ -127,14 +127,14 @@ __PACKAGE__->belongs_to( { is_deferrable => 1, join_type => "LEFT", - on_delete => "CASCADE", + on_delete => "SET NULL", on_update => "CASCADE", }, ); -# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-10-14 20:56:21 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:/gg7wEkOzJ7yI3UXoDcQKA +# Created by DBIx::Class::Schema::Loader v0.07039 @ 2014-07-11 09:26:55 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:u+R08bCdVQA697aPo9zEUA # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/Koha/Schema/Result/Subscription.pm b/Koha/Schema/Result/Subscription.pm index 91e408c..62468a0 100644 --- a/Koha/Schema/Result/Subscription.pm +++ b/Koha/Schema/Result/Subscription.pm @@ -388,7 +388,7 @@ __PACKAGE__->belongs_to( { is_deferrable => 1, join_type => "LEFT", - on_delete => "CASCADE", + on_delete => "SET NULL", on_update => "CASCADE", }, ); @@ -408,7 +408,7 @@ __PACKAGE__->belongs_to( { is_deferrable => 1, join_type => "LEFT", - on_delete => "CASCADE", + on_delete => "SET NULL", on_update => "CASCADE", }, ); @@ -429,8 +429,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-10-30 02:42:01 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:JoTdms86n/xfPo8YUnDHUQ +# Created by DBIx::Class::Schema::Loader v0.07039 @ 2014-07-11 09:26:55 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:57kc1/B3eNKQXAk9tlOy0A # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/Koha/Schema/Result/Virtualshelfcontent.pm b/Koha/Schema/Result/Virtualshelfcontent.pm index dfb8d46..906a058 100644 --- a/Koha/Schema/Result/Virtualshelfcontent.pm +++ b/Koha/Schema/Result/Virtualshelfcontent.pm @@ -117,8 +117,8 @@ __PACKAGE__->belongs_to( { is_deferrable => 1, join_type => "LEFT", - on_delete => "CASCADE", - on_update => "CASCADE", + on_delete => "SET NULL", + on_update => "SET NULL", }, ); @@ -138,8 +138,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-10-14 20:56:21 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:nhcu0n7BoSNsoY76SYSYFw +# Created by DBIx::Class::Schema::Loader v0.07039 @ 2014-07-11 09:26:55 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ie3Gx+/HthZQ/4fHjcPF0w # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/Koha/Schema/Result/Virtualshelfshare.pm b/Koha/Schema/Result/Virtualshelfshare.pm index 93aa7dd..0adaf2b 100644 --- a/Koha/Schema/Result/Virtualshelfshare.pm +++ b/Koha/Schema/Result/Virtualshelfshare.pm @@ -101,8 +101,8 @@ __PACKAGE__->belongs_to( { is_deferrable => 1, join_type => "LEFT", - on_delete => "CASCADE", - on_update => "CASCADE", + on_delete => "SET NULL", + on_update => "SET NULL", }, ); @@ -122,8 +122,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-10-14 20:56:21 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Eu/4NPwsXI+UMs5QWVsUmA +# Created by DBIx::Class::Schema::Loader v0.07039 @ 2014-07-11 09:26:55 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:gle9hUqefRoNSilv0gFc1w # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/Koha/Schema/Result/Virtualshelve.pm b/Koha/Schema/Result/Virtualshelve.pm index fa4759d..1811b4c 100644 --- a/Koha/Schema/Result/Virtualshelve.pm +++ b/Koha/Schema/Result/Virtualshelve.pm @@ -135,8 +135,8 @@ __PACKAGE__->belongs_to( { is_deferrable => 1, join_type => "LEFT", - on_delete => "CASCADE", - on_update => "CASCADE", + on_delete => "SET NULL", + on_update => "SET NULL", }, ); @@ -171,8 +171,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-10-14 20:56:21 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:WdBpWgSdrE0l13vKgDRcGg +# Created by DBIx::Class::Schema::Loader v0.07039 @ 2014-07-11 09:26:55 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:xRDCzpS+CXPdp4Mlp2WP6A # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/Koha/Schema/Result/Z3950server.pm b/Koha/Schema/Result/Z3950server.pm index a185f57..8dbf566 100644 --- a/Koha/Schema/Result/Z3950server.pm +++ b/Koha/Schema/Result/Z3950server.pm @@ -94,7 +94,7 @@ __PACKAGE__->table("z3950servers"); data_type: 'enum' default_value: 'primary' - extra: {list => ["primary","secondary"]} + extra: {list => ["primary","secondary",""]} is_nullable: 0 =head2 type @@ -152,7 +152,7 @@ __PACKAGE__->add_columns( { data_type => "enum", default_value => "primary", - extra => { list => ["primary", "secondary"] }, + extra => { list => ["primary", "secondary", ""] }, is_nullable => 0, }, "type", @@ -188,8 +188,8 @@ __PACKAGE__->add_columns( __PACKAGE__->set_primary_key("id"); -# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-10-14 20:56:21 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:j/AgGQDMyR5wm1wooSYYDw +# Created by DBIx::Class::Schema::Loader v0.07039 @ 2014-07-11 09:26:55 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:BA+II2AVWOTLfgbko1GAOA # You can replace this text with custom content, and it will be preserved on regeneration -- 1.9.1 From tomascohen at gmail.com Fri Jul 11 15:17:43 2014 From: tomascohen at gmail.com (Tomas Cohen Arazi) Date: Fri, 11 Jul 2014 10:17:43 -0300 Subject: [Koha-patches] [PATCH 2/2] Bug 12558: Require DBIx::Schema::Loader v0.07039 or higher In-Reply-To: <1405084663-10283-1-git-send-email-tomascohen@gmail.com> References: <1405084663-10283-1-git-send-email-tomascohen@gmail.com> Message-ID: <1405084663-10283-2-git-send-email-tomascohen@gmail.com> This patch shifts required DBIx::Schema::Loader required version. Signed-off-by: Tomas Cohen Arazi --- C4/Installer/PerlDependencies.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/C4/Installer/PerlDependencies.pm b/C4/Installer/PerlDependencies.pm index e8cf6ff..bc3eb29 100644 --- a/C4/Installer/PerlDependencies.pm +++ b/C4/Installer/PerlDependencies.pm @@ -57,7 +57,7 @@ our $PERL_DEPS = { 'DBIx::Class::Schema::Loader' => { 'usage' => 'Core', 'required' => '1', - 'min_ver' => '0.07000' + 'min_ver' => '0.07039' }, 'Net::Z3950::ZOOM' => { 'usage' => 'Core', -- 1.9.1 From tomascohen at gmail.com Fri Jul 11 20:45:09 2014 From: tomascohen at gmail.com (Tomas Cohen Arazi) Date: Fri, 11 Jul 2014 15:45:09 -0300 Subject: [Koha-patches] [PATCH] Bug 12559: Wrong message if all cover images deleted Message-ID: <1405104309-15344-1-git-send-email-tomascohen@gmail.com> If a record contains a (one or more) local cover image and it is deleted, a wrong message is presented in the UI. To reproduce: - Have LocalCoverImages set to "Display" and AllowMultipleCovers set to "Allow". - Go to the detail page of a record that has no images attached. - The 'Images' tab conveniently shows the following message: "No images have been uploaded..." - Use the "upload" link to add a local cover to the record - Complete the process, and "view final record". - The 'Images' tab shows the added cover. - Delete the cover image using the link below the cover. => FAIL: 'Click on an image...' message still shows instead of 'No images have been...' To test: - Apply the patch - Repeat the previous steps => SUCCESS : 'No images have been...' Bonus points: previous code didn't show a message at all if the user didn't have permissions to upload local cover images. I've split the message in two: - 'No images have been...' (for everyone) - 'Please upload (link)...' (for those with the right permissions :-D Regards To+ Edit: I used JavaScript to inject the 'No images...' message to aid localization. It can be improved once we fix some stuff in the translation scripts to better support placeholders/variables in the templates. Sponsored-by: Universidad Nacional de Cordoba --- .../prog/en/modules/catalogue/detail.tt | 28 ++++++++++++++++++---- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt index fe8d32e..8cae1b4 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -63,6 +63,9 @@ function verify_images() { if ( this.deleted == 1 ) { $('#imagenumber-' + this.imagenumber).remove(); } + if ( $('ul.thumbnails > li').length == 0 ) { + showNoImageMessage(); + } }); }, error: function(data) { @@ -72,6 +75,20 @@ function verify_images() { } + function showNoImageMessage() { + + var no_images_msg = _("No images have been uploaded for this bibliographic record yet."); + no_images_msg = '

' + no_images_msg + '

'; + [% IF ( CAN_user_tools_upload_local_cover_images ) %] + var please_upload = _("Please %supload%s one.").format( + "", + ""); + no_images_msg += "

" + please_upload + '

'; + [% END %] + + $('#images').html(no_images_msg); + } + [% IF StaffDetailItemSelection %] function selectAllItems(div) { $("input[name='itemnumber'][type='checkbox']", div).attr('checked', 'checked'); @@ -141,7 +158,7 @@ function verify_images() { }); [% END %] - $(document).ready(function() { + $(document).ready(function() { $('#bibliodetails').tabs(); $('#search-form').focus(); $('.thumbnails > li > a > span.remove').click(function() { @@ -154,6 +171,10 @@ function verify_images() { return false; }); + [%# inject no images message %] + [% IF ( LocalCoverImages && ! localimages.0 ) %] + showNoImageMessage(); + [% END %] }); [% IF ( AmazonCoverImages ) %]$(window).load(function() { @@ -931,10 +952,7 @@ function verify_images() { [% END %] [% END %] -[% ELSE %] -[% IF ( CAN_user_tools_upload_local_cover_images ) %] -

No images have been uploaded for this bibliographic record yet. Please upload one.

-[% END %] +[%# ELSE - No image passed JavaScript takes care %] [% END %] [% END %] -- 1.9.1 From dpavlin at rot13.org Thu Jul 17 12:30:03 2014 From: dpavlin at rot13.org (Dobrica Pavlinusic) Date: Thu, 17 Jul 2014 12:30:03 +0200 Subject: [Koha-patches] [PATCH] Bug 12593 - search facets die with regex error if biblio has square brackets in fields Message-ID: <1405593003-29471-1-git-send-email-dpavlin@rot13.org> It's quite common to have [something] within facet data, and it produces following error: Unmatched [ in regex; marked by <-- HERE in m/^[ <-- HERE This problem was intoduced in Bug 12151 but is trivial to fix. --- C4/Search.pm | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/C4/Search.pm b/C4/Search.pm index 1b5c6fa..219de1e 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -532,7 +532,7 @@ sub getRecords { foreach my $field (@fields) { my $data = $field->as_string( $subfield_letters, $facet->{sep} ); - unless ( grep { /^$data$/ } @used_datas ) { + unless ( grep { /^\Q$data\E$/ } @used_datas ) { push @used_datas, $data; $facets_counter->{ $facet->{idx} }->{$data}++; } -- 1.7.2.5 From nengard at bywatersolutions.com Thu Jul 31 18:43:21 2014 From: nengard at bywatersolutions.com (Nicole C. Engard) Date: Thu, 31 Jul 2014 11:43:21 -0500 Subject: [Koha-patches] [PATCH] Bug 12685: Add help file for staff search history Message-ID: <1406825001-13523-1-git-send-email-nengard@bywatersolutions.com> This patch adds a missing help file for the staff search history page. To test: * Turn on EnableSearchHistory * Do a search in the catalog * Click your username in the top right and choose 'search history' * Click 'help' in the top right * Confirm that help file is there * note: link to manual won't work until after 2014-08-01 in the USA --- .../en/modules/help/catalogue/search-history.tt | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-) create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/help/catalogue/search-history.tt diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/help/catalogue/search-history.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/help/catalogue/search-history.tt new file mode 100644 index 0000000..d0f26b8 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/help/catalogue/search-history.tt @@ -0,0 +1,11 @@ +[% INCLUDE 'help-top.inc' %] + +

Search history

+ +

If you have your EnableSearchHistory preference set to keep your search history then you can access this information by clicking on your username in the top right of the staff client and choosing 'Search history'.

+ +

From this page you will see your bibliographic search history and your authority search history.

+ +

See the full documentation for Search History in the manual (online).

+ +[% INCLUDE 'help-bottom.inc' %] -- 1.7.2.3