Bugzilla – Attachment 13834 Details for
Bug 7674
Separate tabs for my holdings and others holdings
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED-OFF] Bug 7674: Add 2 sysprefs to indicate the branch we want to separate on
Bug-7674-Add-2-sysprefs-to-indicate-the-branch-we-.patch (text/plain), 9.45 KB, created by
Julian Maurice
on 2012-12-03 08:15:07 UTC
(
hide
)
Description:
[SIGNED-OFF] Bug 7674: Add 2 sysprefs to indicate the branch we want to separate on
Filename:
MIME Type:
Creator:
Julian Maurice
Created:
2012-12-03 08:15:07 UTC
Size:
9.45 KB
patch
obsolete
>From 2219fbbd1bb9e7828f38edb4172131cd8f9aa6ab Mon Sep 17 00:00:00 2001 >From: Julian Maurice <julian.maurice@biblibre.com> >Date: Fri, 2 Nov 2012 11:03:20 +0100 >Subject: [PATCH] Bug 7674: Add 2 sysprefs to indicate the branch we want to separate on > >The 2 sysprefs are SeparateHoldingsBranch and OpacSeparateHoldingsBranch >and permit to chose between home branch and holding branch. > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > catalogue/detail.pl | 9 +++-- > installer/data/mysql/sysprefs.sql | 2 + > installer/data/mysql/updatedatabase.pl | 31 +++++++++---------- > .../en/modules/admin/preferences/cataloguing.pref | 17 +++++------ > .../prog/en/modules/admin/preferences/opac.pref | 11 +++++++ > opac/opac-detail.pl | 5 ++- > 6 files changed, 44 insertions(+), 31 deletions(-) > >diff --git a/catalogue/detail.pl b/catalogue/detail.pl >index 204fea3..b20e4c5 100755 >--- a/catalogue/detail.pl >+++ b/catalogue/detail.pl >@@ -188,9 +188,9 @@ my $currentbranch = C4::Context->userenv ? C4::Context->userenv->{branch} : unde > if ($currentbranch and C4::Context->preference('SeparateHoldings')) { > $template->param(SeparateHoldings => 1); > } >+my $separatebranch = C4::Context->preference('SeparateHoldingsBranch') || 'homebranch'; > foreach my $item (@items) { >- >- my $homebranchcode = $item->{homebranch}; >+ my $itembranchcode = $item->{$separatebranch}; > $item->{homebranch} = GetBranchName($item->{homebranch}); > > # can place holds defaults to yes >@@ -273,8 +273,9 @@ foreach my $item (@items) { > if (defined($item->{'materials'}) && $item->{'materials'} =~ /\S/){ > $materials_flag = 1; > >- if ($currentbranch and $currentbranch ne "NO_LIBRARY_SET" and C4::Context->preference('SeparateHoldings')) { >- if ($homebranchcode and $homebranchcode eq $currentbranch) { >+ if ($currentbranch and $currentbranch ne "NO_LIBRARY_SET" >+ and C4::Context->preference('SeparateHoldings')) { >+ if ($itembranchcode and $itembranchcode eq $currentbranch) { > push @itemloop, $item; > } else { > push @otheritemloop, $item; >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index af7ad8e..e7a5da3 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -389,4 +389,6 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' > INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('alphabet','A B C D E F G H I J K L M N O P Q R S T U V W X Y Z','Alphabet than can be expanded into browse links, e.g. on Home > Patrons',NULL,'free'); > INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('RefundLostItemFeeOnReturn', '1', 'If enabled, the lost item fee charged to a borrower will be refunded when the lost item is returned.', NULL, 'YesNo'); > INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('SeparateHoldings', '0', 'Separate current branch holdings from other holdings', NULL, 'YesNo'); >+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('SeparateHoldingsBranch', 'homebranch', 'Branch used to separate holdings', 'homebranch|holdingbranch', 'Choice'); > INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacSeparateHoldings', '0', 'Separate current branch holdings from other holdings (OPAC)', NULL, 'YesNo'); >+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacSeparateHoldingsBranch', 'homebranch', 'Branch used to separate holdings (OPAC)', 'homebranch|holdingbranch', 'Choice'); >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index 4fc8bf1..0a69eef 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -5926,22 +5926,6 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { > SetVersion ($DBversion); > } > >-$DBversion = "XXX"; >-if (C4::Context->preference("Version") < TransformToNum($DBversion)) { >- $dbh->do(" >- INSERT INTO systempreferences (variable,value,explanation,options,type) >- VALUES('SeparateHoldings', '0', 'Separate current branch holdings from other holdings', NULL, 'YesNo'); >- "); >- $dbh->do(" >- INSERT INTO systempreferences (variable,value,explanation,options,type) >- VALUES('OpacSeparateHoldings', '0', 'Separate current branch holdings from other holdings (OPAC)', NULL, 'YesNo'); >- "); >- >- print "Upgrade to $DBversion done (Add systempreferences SeparateHoldings and OpacSeparateHoldings) \n"; >- SetVersion ($DBversion); >-} >- >- > $DBversion = "3.09.00.053"; > if (C4::Context->preference("Version") < TransformToNum($DBversion)) { > $dbh->do( >@@ -6128,6 +6112,21 @@ if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { > SetVersion($DBversion); > } > >+$DBversion = "XXX"; >+if (C4::Context->preference("Version") < TransformToNum($DBversion)) { >+ $dbh->do(" >+ INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES >+ ('SeparateHoldings', '0', 'Separate current branch holdings from other holdings', NULL, 'YesNo'), >+ ('SeparateHoldingsBranch', 'homebranch', 'Branch used to separate holdings', 'homebranch|holdingbranch', 'Choice'), >+ ('OpacSeparateHoldings', '0', 'Separate current branch holdings from other holdings (OPAC)', NULL, 'YesNo'), >+ ('OpacSeparateHoldingsBranch', 'homebranch', 'Branch used to separate holdings (OPAC)', 'homebranch|holdingbranch', 'Choice') >+ "); >+ >+ print "Upgrade to $DBversion done (Add systempreferences SeparateHoldings, SeparateHoldingsBranch, OpacSeparateHoldings and OpacSeparateHoldingsBranch) \n"; >+ SetVersion ($DBversion); >+} >+ >+ > =head1 FUNCTIONS > > =head2 TableExists($table) >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref >index 098f498..f2a16c6 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref >@@ -159,12 +159,11 @@ Cataloging: > - > - pref: SeparateHoldings > choices: >- yes: "Separate" >- no: "Don't separate" >- - current branch holdings from other holdings at staff interface. >- - >- - pref: OpacSeparateHoldings >- choices: >- yes: "Separate" >- no: "Don't separate" >- - current branch holdings from other holdings at OPAC. >+ yes: Separate >+ no: Don't separate >+ - 'items display into two tabs. First tab contains items whose' >+ - pref: SeparateHoldingsBranch >+ choices: >+ homebranch: 'home branch' >+ holdingbranch: 'holding branch' >+ - 'is the branch of user logged in. The other tab contains other items.' >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref >index 2866f8d..d2ab656 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref >@@ -258,6 +258,17 @@ OPAC: > - '<br />Note: Available options are: BIBTEX (<code>bibtex</code>), Dublin Core (<code>dc</code>),' > - 'MARCXML (<code>marcxml</code>), MARC-8 encoded MARC (<code>marc8</code>), Unicode/UTF-8 encoded MARC (<code>utf8</code>),' > - 'Unicode/UTF-8 encoded MARC without local use -9xx, x9x, xx9- fields and subfields (<code>marcstd</code>), MODS (<code>mods</code>), RIS (<code>ris</code>)' >+ - >+ - pref: OpacSeparateHoldings >+ choices: >+ yes: Separate >+ no: Don't separate >+ - 'items display into two tabs. First tab contains items whose' >+ - pref: OpacSeparateHoldingsBranch >+ choices: >+ homebranch: 'home branch' >+ holdingbranch: 'holding branch' >+ - 'is the branch of user logged in. The other tab contains other items.' > Features: > - > - pref: opacuserlogin >diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl >index c0483a3..c4760c0 100755 >--- a/opac/opac-detail.pl >+++ b/opac/opac-detail.pl >@@ -517,6 +517,7 @@ my $currentbranch = C4::Context->userenv ? C4::Context->userenv->{branch} : unde > if ($currentbranch and C4::Context->preference('OpacSeparateHoldings')) { > $template->param(SeparateHoldings => 1); > } >+my $separatebranch = C4::Context->preference('OpacSeparateHoldingsBranch'); > for my $itm (@items) { > $itm->{holds_count} = $item_reserves{ $itm->{itemnumber} }; > $itm->{priority} = $priority{ $itm->{itemnumber} }; >@@ -567,9 +568,9 @@ for my $itm (@items) { > $itm->{transfertfrom} = $branches->{$transfertfrom}{branchname}; > $itm->{transfertto} = $branches->{$transfertto}{branchname}; > } >- my $homebranch = $itm->{homebranch}; >+ my $itembranch = $itm->{$separatebranch}; > if ($currentbranch and C4::Context->preference('OpacSeparateHoldings')) { >- if ($homebranch and $homebranch eq $currentbranch) { >+ if ($itembranch and $itembranch eq $currentbranch) { > push @itemloop, $itm; > } else { > push @otheritemloop, $itm; >-- >1.7.2.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 7674
:
12416
|
12417
|
12418
|
12433
|
12749
|
12750
|
13002
|
13003
|
13189
|
13190
|
13191
|
13204
|
13205
|
13206
|
13207
|
13215
|
13832
|
13833
|
13834
|
13835
|
13990
|
13991
|
13992
|
13993
|
14082
|
14111
|
14528
|
16493
|
16502