Bugzilla – Attachment 1416 Details for
Bug 3555
Default branch when IndependantBranches activated
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
This sets the default branch to the logged user branch when IndependantBranches is active
0001--3.0.x-bug-3555-This-sets-the-default-branch-to-t.patch (text/plain), 2.75 KB, created by
Chris Cormack
on 2009-08-26 13:34:00 UTC
(
hide
)
Description:
This sets the default branch to the logged user branch when IndependantBranches is active
Filename:
MIME Type:
Creator:
Chris Cormack
Created:
2009-08-26 13:34:00 UTC
Size:
2.75 KB
patch
obsolete
>From 5df3550faf111cd6a987148c03566f96a8a7ab82 Mon Sep 17 00:00:00 2001 >From: =?utf-8?q?Jean-Andr=C3=A9=20Santoni?= <jeanandre.santoni@biblibre.com> >Date: Wed, 26 Aug 2009 15:26:56 +0200 >Subject: [PATCH] [3.0.x](bug #3555) This sets the default branch to the logged user branch when IndependantBranches is active > >In the advanced search form, when IndependantBranches is activated, the default >branch should be set to the logged user branch. >--- > catalogue/search.pl | 7 ++++++- > .../prog/en/modules/catalogue/advsearch.tmpl | 4 ++++ > 2 files changed, 10 insertions(+), 1 deletions(-) > >diff --git a/catalogue/search.pl b/catalogue/search.pl >index 503ed4f..d3217f8 100755 >--- a/catalogue/search.pl >+++ b/catalogue/search.pl >@@ -208,8 +208,13 @@ if (C4::Context->preference("marcflavour") eq "UNIMARC" ) { > 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) { >- push @branch_loop, {value => "$branch_hash" , branchname => $branches->{$branch_hash}->{'branchname'}, }; >+ # 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}; > } > > my $categories = GetBranchCategories(undef,'searchdomain'); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/advsearch.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/advsearch.tmpl >index 4d3aaad..3465c82 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/advsearch.tmpl >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/advsearch.tmpl >@@ -257,7 +257,11 @@ > <label for="branchloop">Individual Libraries:</label><select name="limit" id="branchloop" onchange='if(this.value != ""){document.getElementById("categoryloop").disabled=true;} else {document.getElementById("categoryloop").disabled=false;}'> > <option value="">All Libraries</option> > <!-- TMPL_LOOP NAME="branchloop" --> >+ <!-- TMPL_IF NAME="selected" --> >+ <option value="branch:<!-- TMPL_VAR NAME="value" -->" selected="selected"><!-- TMPL_VAR NAME="branchname" --></option> >+ <!-- TMPL_ELSE --> > <option value="branch:<!-- TMPL_VAR NAME="value" -->"><!-- TMPL_VAR NAME="branchname" --></option> >+ <!-- /TMPL_IF --> > <!-- /TMPL_LOOP --> > </select> > <!-- <input type="hidden" name="limit" value="branch: MAIN" /> --> >-- >1.6.0.4 >
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 3555
: 1416