Bug 26302: (QA follow-up) Prefix prefs with OPAC
git grep -l "ResultsMaxItems" | xargs sed -i -e "/ResultsMaxItems/ s/ResultsMaxItems/OPACResultsMaxItems/g" And line: koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl: <xsl:variable name="OPACResultsMaxItems" select="number(marc:sysprefs/marc:syspref[@name='resultsMaxItems']+0)"/> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
parent
7b9f0106a3
commit
6d85e5c80b
|
|
@ -172,7 +172,7 @@ sub get_xslt_sysprefs {
|
|||
TrackClicks opacthemes IdRef OpacSuppression
|
||||
OPACResultsLibrary OPACShowOpenURL
|
||||
OpenURLResolverURL OpenURLImageLocation
|
||||
ResultsMaxItems ResultsMaxItemsUnavailable
|
||||
OPACResultsMaxItems OPACResultsMaxItemsUnavailable
|
||||
OpenURLText OPACShowMusicalInscripts OPACPlayMusicalInscripts / )
|
||||
{
|
||||
my $sp = C4::Context->preference( $syspref );
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@ $DBversion = 'XXX'; # will be replaced by the RM
|
|||
if( CheckVersion( $DBversion ) ) {
|
||||
$dbh->do(q|
|
||||
INSERT IGNORE INTO systempreferences (variable, value, options, explanation, type) VALUES
|
||||
('ResultsMaxItems','1','','Maximum number of available items displayed in search results','Integer'),
|
||||
('ResultsMaxItemsUnavailable','0','','Maximum number of unavailable items displayed in search results','Integer')
|
||||
('OPACResultsMaxItems','1','','Maximum number of available items displayed in search results','Integer'),
|
||||
('OPACResultsMaxItemsUnavailable','0','','Maximum number of unavailable items displayed in search results','Integer')
|
||||
|);
|
||||
NewVersion( $DBversion, 26302, "Add preferences ResultsMaxItems and ResultsMaxItemsUnavailable");
|
||||
NewVersion( $DBversion, 26302, "Add preferences OPACResultsMaxItems and OPACResultsMaxItemsUnavailable");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -574,8 +574,8 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `
|
|||
('RestrictedPageContent','',NULL,'HTML content of the restricted page','TextArea'),
|
||||
('RestrictedPageTitle','',NULL,'Title of the restricted page (breadcrumb and header)','Free'),
|
||||
('RestrictionBlockRenewing','0',NULL,'If patron is restricted, should renewal be allowed or blocked','YesNo'),
|
||||
('ResultsMaxItems','1','','Maximum number of available items displayed in search results','Integer'),
|
||||
('ResultsMaxItemsUnavailable','0','','Maximum number of unavailable items displayed in search results','Integer'),
|
||||
('OPACResultsMaxItems','1','','Maximum number of available items displayed in search results','Integer'),
|
||||
('OPACResultsMaxItemsUnavailable','0','','Maximum number of unavailable items displayed in search results','Integer'),
|
||||
('ReturnBeforeExpiry','0',NULL,'If ON, checkout will be prevented if returndate is after patron card expiry','YesNo'),
|
||||
('ReturnLog','1',NULL,'If ON, enables the circulation (returns) log','YesNo'),
|
||||
('ReturnpathDefault','',NULL,'Use this email address as return path or bounce address for undeliverable emails','Free'),
|
||||
|
|
|
|||
|
|
@ -345,9 +345,9 @@ OPAC:
|
|||
- "(Use | as delimiter.)"
|
||||
-
|
||||
- Show no more than
|
||||
- pref: ResultsMaxItems
|
||||
- pref: OPACResultsMaxItems
|
||||
- (available) individual items on the OPAC XSLT search results, and show no more than
|
||||
- pref: ResultsMaxItemsUnavailable
|
||||
- pref: OPACResultsMaxItemsUnavailable
|
||||
- "'really unavailable' individual items in categories like Checked out, Damaged, On Hold, etc."
|
||||
|
||||
Features:
|
||||
|
|
|
|||
|
|
@ -23,8 +23,8 @@
|
|||
<!-- Option: Display Alternate Graphic Representation (MARC 880) -->
|
||||
<xsl:variable name="display880" select="boolean(marc:datafield[@tag=880])"/>
|
||||
|
||||
<xsl:variable name="ResultsMaxItems" select="number(marc:sysprefs/marc:syspref[@name='resultsMaxItems']+0)"/>
|
||||
<xsl:variable name="ResultsMaxItemsUnavailable" select="number(marc:sysprefs/marc:syspref[@name='ResultsMaxItemsUnavailable']+0)"/>
|
||||
<xsl:variable name="OPACResultsMaxItems" select="number(marc:sysprefs/marc:syspref[@name='OPACResultsMaxItems']+0)"/>
|
||||
<xsl:variable name="OPACResultsMaxItemsUnavailable" select="number(marc:sysprefs/marc:syspref[@name='OPACResultsMaxItemsUnavailable']+0)"/>
|
||||
<xsl:variable name="UseControlNumber" select="marc:sysprefs/marc:syspref[@name='UseControlNumber']"/>
|
||||
<xsl:variable name="UseAuthoritiesForTracings" select="marc:sysprefs/marc:syspref[@name='UseAuthoritiesForTracings']"/>
|
||||
<xsl:variable name="OPACResultsLibrary" select="marc:sysprefs/marc:syspref[@name='OPACResultsLibrary']"/>
|
||||
|
|
@ -1284,7 +1284,7 @@
|
|||
<span class="ItemSummary">
|
||||
<xsl:call-template name="listCallNumbers">
|
||||
<xsl:with-param name="items" select="$available_items[items:resultbranch=$currentbranch]"/>
|
||||
<xsl:with-param name="max" select="$ResultsMaxItems"/>
|
||||
<xsl:with-param name="max" select="$OPACResultsMaxItems"/>
|
||||
<xsl:with-param name="status_text" select="$currentbranch"/>
|
||||
<xsl:with-param name="class_status" select="ItemBranch"/>
|
||||
<xsl:with-param name="OPACItemLocation" select="$OPACItemLocation"/>
|
||||
|
|
@ -1307,7 +1307,7 @@
|
|||
<span class="ItemSummary">
|
||||
<xsl:call-template name="listCallNumbers">
|
||||
<xsl:with-param name="items" select="$reference_items[items:resultbranch=$currentbranch and items:substatus=$current_substatus]"/>
|
||||
<xsl:with-param name="max" select="$ResultsMaxItems"/>
|
||||
<xsl:with-param name="max" select="$OPACResultsMaxItems"/>
|
||||
<xsl:with-param name="status_text" select="concat($currentbranch,': ',$current_substatus)"/>
|
||||
<xsl:with-param name="class_block" select="concat('notforloandesc_',$current_substatus)"/>
|
||||
<xsl:with-param name="class_status" select="ItemBranch"/>
|
||||
|
|
@ -1342,7 +1342,7 @@
|
|||
<xsl:variable name="current_substatus" select="items:substatus"/>
|
||||
<xsl:call-template name="listCallNumbers">
|
||||
<xsl:with-param name="items" select="$unavailable_items[items:resultbranch=$currentbranch and items:substatus=$current_substatus]"/>
|
||||
<xsl:with-param name="max" select="$ResultsMaxItemsUnavailable"/>
|
||||
<xsl:with-param name="max" select="$OPACResultsMaxItemsUnavailable"/>
|
||||
<xsl:with-param name="status_text">
|
||||
<xsl:value-of select="$currentbranch"/>
|
||||
<xsl:text>: </xsl:text>
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ subtest 'buildKohaItemsNamespace status tests' => sub {
|
|||
|
||||
t::lib::Mocks::mock_preference('Reference_NFL_Statuses', '1|2');
|
||||
t::lib::Mocks::mock_preference( 'OPACResultsLibrary', 'holdingbranch' );
|
||||
t::lib::Mocks::mock_preference( 'ResultsMaxItems', '2' );
|
||||
t::lib::Mocks::mock_preference( 'OPACResultsMaxItems', '2' );
|
||||
|
||||
my $itype = $builder->build_object({ class => 'Koha::ItemTypes' });
|
||||
my $itemtype = $builder->build_object({ class => 'Koha::ItemTypes' });
|
||||
|
|
|
|||
Loading…
Reference in New Issue