Bugzilla – Attachment 3045 Details for
Bug 4103
Intranet search page should always defaults 'Individual Libraries' to all for superlibrarian
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Proposed patch for testing and signing off
0001-Bug-4103-In-Pro-Adv-Search-superlibrarian-search-alw.patch (text/plain), 2.05 KB, created by
Frédéric Demians
on 2011-02-01 08:13:52 UTC
(
hide
)
Description:
Proposed patch for testing and signing off
Filename:
MIME Type:
Creator:
Frédéric Demians
Created:
2011-02-01 08:13:52 UTC
Size:
2.05 KB
patch
obsolete
>From e43a743bdbb1863c161d0d50c2edfcdd76472bf0 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Demians?= <f.demians@tamil.fr> >Date: Wed, 3 Feb 2010 21:09:29 +0100 >Subject: [PATCH] Bug 4103 In Pro Adv Search, superlibrarian search always all libraries > >Now, when 'independantbranches' syspref is activated, 'Individual Libraries' >combo list is set by default to the current user branch. It shouldn't be the >case for superlibrarian user who is supposed to manage all libraries. >--- > catalogue/search.pl | 22 +++++++++++++--------- > 1 files changed, 13 insertions(+), 9 deletions(-) > >diff --git a/catalogue/search.pl b/catalogue/search.pl >index 8cb737d..b0fea2a 100755 >--- a/catalogue/search.pl >+++ b/catalogue/search.pl >@@ -207,16 +207,20 @@ if (C4::Context->preference("marcflavour") eq "UNIMARC" ) { > > # load the branches > my $branches = GetBranches(); >-my @branch_loop; > >-# we need to know the borrower branch code to set a default branch >-my $borrowerbranchcode = C4::Context->userenv->{'branch'}; >- >-for my $branch_hash (sort { $branches->{$a}->{branchname} cmp $branches->{$b}->{branchname} } keys %$branches) { >- # if independantbranches is activated, set the default branch to the borrower branch >- my $selected = (C4::Context->preference("independantbranches") and ($borrowerbranchcode eq $branch_hash)) ? 1 : undef; >- push @branch_loop, {value => "$branch_hash" , branchname => $branches->{$branch_hash}->{'branchname'}, selected => $selected}; >-} >+# Populate branch_loop with all branches sorted by their name. If >+# independantbranches is activated, set the default branch to the borrower >+# branch, except for superlibrarian who need to search all libraries. >+my $user = C4::Context->userenv; >+my @branch_loop = map { >+ { >+ value => $_, >+ branchname => $branches->{$_}->{branchname}, >+ selected => $user->{branch} eq $_ && C4::Branch::onlymine(), >+ } >+} sort { >+ $branches->{$a}->{branchname} cmp $branches->{$b}->{branchname} >+} keys %$branches; > > my $categories = GetBranchCategories(undef,'searchdomain'); > >-- >1.7.3.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 4103
: 3045