View | Details | Raw Unified | Return to bug 3555
Collapse All | Expand All

(-)a/catalogue/search.pl (-1 / +6 lines)
Lines 208-215 if (C4::Context->preference("marcflavour") eq "UNIMARC" ) { Link Here
208
my $branches = GetBranches();
208
my $branches = GetBranches();
209
my @branch_loop;
209
my @branch_loop;
210
210
211
# we need to know the borrower branch code to set a default branch
212
my $borrowerbranchcode = C4::Context->userenv->{'branch'};
213
211
for my $branch_hash (sort { $branches->{$a}->{branchname} cmp $branches->{$b}->{branchname} } keys %$branches) {
214
for my $branch_hash (sort { $branches->{$a}->{branchname} cmp $branches->{$b}->{branchname} } keys %$branches) {
212
    push @branch_loop, {value => "$branch_hash" , branchname => $branches->{$branch_hash}->{'branchname'}, };
215
    # if independantbranches is activated, set the default branch to the borrower branch
216
    my $selected = (C4::Context->preference("independantbranches") and ($borrowerbranchcode eq $branch_hash)) ? 1 : undef;
217
    push @branch_loop, {value => "$branch_hash" , branchname => $branches->{$branch_hash}->{'branchname'}, selected => $selected};
213
}
218
}
214
219
215
my $categories = GetBranchCategories(undef,'searchdomain');
220
my $categories = GetBranchCategories(undef,'searchdomain');
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/advsearch.tmpl (-1 / +4 lines)
Lines 257-263 Link Here
257
        <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;}'>
257
        <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;}'>
258
        <option value="">All Libraries</option>
258
        <option value="">All Libraries</option>
259
        <!-- TMPL_LOOP NAME="branchloop" -->
259
        <!-- TMPL_LOOP NAME="branchloop" -->
260
        <!-- TMPL_IF NAME="selected" -->
261
        <option value="branch:<!-- TMPL_VAR NAME="value" -->" selected="selected"><!-- TMPL_VAR NAME="branchname" --></option>
262
        <!-- TMPL_ELSE -->
260
        <option value="branch:<!-- TMPL_VAR NAME="value" -->"><!-- TMPL_VAR NAME="branchname" --></option>
263
        <option value="branch:<!-- TMPL_VAR NAME="value" -->"><!-- TMPL_VAR NAME="branchname" --></option>
264
        <!-- /TMPL_IF -->
261
        <!-- /TMPL_LOOP -->
265
        <!-- /TMPL_LOOP -->
262
        </select>
266
        </select>
263
    <!-- <input type="hidden" name="limit" value="branch: MAIN" /> -->
267
    <!-- <input type="hidden" name="limit" value="branch: MAIN" /> -->
264
- 

Return to bug 3555