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

(-)a/C4/Auth.pm (-1 / +1 lines)
Lines 665-671 sub checkauth { Link Here
665
                $session->param('surname'),      $session->param('branch'),
665
                $session->param('surname'),      $session->param('branch'),
666
                $session->param('branchname'),   $session->param('flags'),
666
                $session->param('branchname'),   $session->param('flags'),
667
                $session->param('emailaddress'), $session->param('branchprinter'),
667
                $session->param('emailaddress'), $session->param('branchprinter'),
668
                $session->param('persona')
668
                $session->param('persona'),      $type
669
            );
669
            );
670
            C4::Context::set_shelves_userenv('bar',$session->param('barshelves'));
670
            C4::Context::set_shelves_userenv('bar',$session->param('barshelves'));
671
            C4::Context::set_shelves_userenv('pub',$session->param('pubshelves'));
671
            C4::Context::set_shelves_userenv('pub',$session->param('pubshelves'));
(-)a/C4/Branch.pm (-15 / +58 lines)
Lines 42-47 BEGIN { Link Here
42
		&GetCategoryTypes
42
		&GetCategoryTypes
43
		&GetBranchCategories
43
		&GetBranchCategories
44
		&GetBranchesInCategory
44
		&GetBranchesInCategory
45
        &GetCategoriesForBranch
45
		&ModBranchCategoryInfo
46
		&ModBranchCategoryInfo
46
        &GetIndependentGroupModificationRights
47
        &GetIndependentGroupModificationRights
47
		&DelBranch
48
		&DelBranch
Lines 445-450 sub GetBranchesInCategory { Link Here
445
	return( \@branches );
446
	return( \@branches );
446
}
447
}
447
448
449
=head2 GetCategoriesForBranch
450
451
    my @categories = GetCategoriesForBranch({
452
        branchcode   => $branchcode,
453
        categorytype => 'independent_group' 
454
    });
455
456
    Called in a list context, returns an array of branch category codes
457
    that branch is part of.
458
    
459
    Called in a scalar context, returns an array ref.
460
461
=cut
462
463
sub GetCategoriesForBranch {
464
    my ( $params ) = @_;
465
    my $branchcode = $params->{branchcode};
466
    my $categorytype = $params->{categorytype} || '%';
467
468
    carp("Missing branchcode parameter!") unless ( $branchcode );
469
470
    my $sql = q{
471
        SELECT categorycode FROM branchrelations
472
        JOIN branchcategories USING ( categorycode )
473
        WHERE branchcode   = ?
474
          AND categorytype = ?
475
    };
476
477
    my $categories = C4::Context->dbh->selectcol_arrayref( $sql, {}, ( $branchcode, $categorytype ) );
478
479
    return wantarray() ? $categories : @$categories;
480
}
481
448
=head2 GetIndependentGroupModificationRights
482
=head2 GetIndependentGroupModificationRights
449
483
450
    GetIndependentGroupModificationRights(
484
    GetIndependentGroupModificationRights(
Lines 491-515 sub GetIndependentGroupModificationRights { Link Here
491
    my $stringify    = $params->{stringify};
525
    my $stringify    = $params->{stringify};
492
526
493
    $this_branch ||= C4::Context->userenv->{branch};
527
    $this_branch ||= C4::Context->userenv->{branch};
528
    $this_branch ||= $ENV{BRANCHCODE};
494
529
495
    carp("No branch found!") unless ($this_branch);
530
    return 1 if ( $this_branch && $this_branch eq $other_branch );
496
531
497
    return 1 if ( $this_branch eq $other_branch );
532
    my $allow_all = 0;
498
533
    $allow_all = 1 if C4::Context->IsSuperLibrarian();
499
    my $sql = q{
534
    $allow_all = 1 if C4::Context->userenv->{type} eq 'opac' && !$ENV{BRANCHCODE};
500
        SELECT DISTINCT(branchcode) 
501
        FROM branchrelations
502
        JOIN branchcategories USING ( categorycode )
503
        WHERE categorycode IN (
504
            SELECT categorycode 
505
            FROM branchrelations 
506
            WHERE branchcode = ?
507
        )
508
        AND branchcategories.categorytype = 'independent_group'
509
    };
510
535
536
    my $sql;
511
    my @params;
537
    my @params;
512
    push( @params, $this_branch );
538
    if ( $allow_all ) {
539
        $sql = q{
540
            SELECT branchcode FROM branches WHERE 1
541
        }
542
    } else {
543
        $sql = q{
544
            SELECT DISTINCT(branchcode) 
545
            FROM branchrelations
546
            JOIN branchcategories USING ( categorycode )
547
            WHERE categorycode IN (
548
                SELECT categorycode 
549
                FROM branchrelations 
550
                WHERE branchcode = ?
551
            )
552
            AND branchcategories.categorytype = 'independent_group'
553
        };
554
        push( @params, $this_branch );
555
    }
513
556
514
    if ($other_branch) {
557
    if ($other_branch) {
515
        $sql .= q{ AND branchcode = ? };
558
        $sql .= q{ AND branchcode = ? };
(-)a/C4/Context.pm (-14 / +22 lines)
Lines 1104-1126 set_userenv is called in Auth.pm Link Here
1104
1104
1105
#'
1105
#'
1106
sub set_userenv {
1106
sub set_userenv {
1107
    my ($usernum, $userid, $usercnum, $userfirstname, $usersurname, $userbranch, $branchname, $userflags, $emailaddress, $branchprinter, $persona)= @_;
1107
    my (
1108
    my $var=$context->{"activeuser"} || '';
1108
        $usernum,      $userid,        $usercnum,   $userfirstname,
1109
        $usersurname,  $userbranch,    $branchname, $userflags,
1110
        $emailaddress, $branchprinter, $persona,    $type
1111
    ) = @_;
1112
1113
    my $var = $context->{"activeuser"} || '';
1114
1109
    my $cell = {
1115
    my $cell = {
1110
        "number"     => $usernum,
1116
        "number"        => $usernum,
1111
        "id"         => $userid,
1117
        "id"            => $userid,
1112
        "cardnumber" => $usercnum,
1118
        "cardnumber"    => $usercnum,
1113
        "firstname"  => $userfirstname,
1119
        "firstname"     => $userfirstname,
1114
        "surname"    => $usersurname,
1120
        "surname"       => $usersurname,
1115
        #possibly a law problem
1121
        "branch"        => $userbranch,
1116
        "branch"     => $userbranch,
1122
        "branchname"    => $branchname,
1117
        "branchname" => $branchname,
1123
        "flags"         => $userflags,
1118
        "flags"      => $userflags,
1124
        "emailaddress"  => $emailaddress,
1119
        "emailaddress"     => $emailaddress,
1125
        "branchprinter" => $branchprinter,
1120
        "branchprinter"    => $branchprinter,
1126
        "persona"       => $persona,
1121
        "persona"    => $persona,
1127
        "type"          => $type,
1122
    };
1128
    };
1129
1123
    $context->{userenv}->{$var} = $cell;
1130
    $context->{userenv}->{$var} = $cell;
1131
1124
    return $cell;
1132
    return $cell;
1125
}
1133
}
1126
1134
(-)a/C4/Items.pm (-1 / +9 lines)
Lines 1202-1207 If this is set, it is set to C<One Order>. Link Here
1202
1202
1203
sub GetItemsInfo {
1203
sub GetItemsInfo {
1204
    my ( $biblionumber ) = @_;
1204
    my ( $biblionumber ) = @_;
1205
1206
    my $IndependentBranchesRecordsAndItems =
1207
      C4::Context->preference('IndependentBranchesRecordsAndItems')
1208
      && !C4::Context->IsSuperLibrarian();
1209
1205
    my $dbh   = C4::Context->dbh;
1210
    my $dbh   = C4::Context->dbh;
1206
    # note biblioitems.* must be avoided to prevent large marc and marcxml fields from killing performance.
1211
    # note biblioitems.* must be avoided to prevent large marc and marcxml fields from killing performance.
1207
    my $query = "
1212
    my $query = "
Lines 1231-1237 sub GetItemsInfo { Link Here
1231
     LEFT JOIN biblioitems ON biblioitems.biblioitemnumber = items.biblioitemnumber
1236
     LEFT JOIN biblioitems ON biblioitems.biblioitemnumber = items.biblioitemnumber
1232
     LEFT JOIN itemtypes   ON   itemtypes.itemtype         = "
1237
     LEFT JOIN itemtypes   ON   itemtypes.itemtype         = "
1233
     . (C4::Context->preference('item-level_itypes') ? 'items.itype' : 'biblioitems.itemtype');
1238
     . (C4::Context->preference('item-level_itypes') ? 'items.itype' : 'biblioitems.itemtype');
1234
    $query .= " WHERE items.biblionumber = ? ORDER BY home.branchname, items.enumchron, LPAD( items.copynumber, 8, '0' ), items.dateaccessioned DESC" ;
1239
    $query .= " WHERE items.biblionumber = ? ";
1240
    $query .= " AND items.homebranch IN ( " . GetIndependentGroupModificationRights({ stringify => 1}) . " ) " if ( $IndependentBranchesRecordsAndItems );
1241
    $query .= " ORDER BY home.branchname, items.enumchron, LPAD( items.copynumber, 8, '0' ), items.dateaccessioned DESC" ;
1242
1235
    my $sth = $dbh->prepare($query);
1243
    my $sth = $dbh->prepare($query);
1236
    $sth->execute($biblionumber);
1244
    $sth->execute($biblionumber);
1237
    my $i = 0;
1245
    my $i = 0;
(-)a/C4/Koha.pm (-37 / +37 lines)
Lines 36-78 BEGIN { Link Here
36
    $VERSION = 3.07.00.049;
36
    $VERSION = 3.07.00.049;
37
	require Exporter;
37
	require Exporter;
38
	@ISA    = qw(Exporter);
38
	@ISA    = qw(Exporter);
39
	@EXPORT = qw(
39
    @EXPORT = qw(
40
		&slashifyDate
40
      &slashifyDate
41
		&subfield_is_koha_internal_p
41
      &subfield_is_koha_internal_p
42
		&GetPrinters &GetPrinter
42
      &GetPrinters &GetPrinter
43
		&GetItemTypes &getitemtypeinfo
43
      &GetItemTypes &getitemtypeinfo
44
		&GetCcodes
44
      &GetCcodes
45
		&GetSupportName &GetSupportList
45
      &GetSupportName &GetSupportList
46
		&get_itemtypeinfos_of
46
      &get_itemtypeinfos_of
47
		&getframeworks &getframeworkinfo
47
      &getframeworks &getframeworkinfo
48
		&getauthtypes &getauthtype
48
      &getauthtypes &getauthtype
49
		&getallthemes
49
      &getallthemes
50
		&getFacets
50
      &getFacets
51
		&displayServers
51
      &displayServers
52
		&getnbpages
52
      &getnbpages
53
		&get_infos_of
53
      &get_infos_of
54
		&get_notforloan_label_of
54
      &get_notforloan_label_of
55
		&getitemtypeimagedir
55
      &getitemtypeimagedir
56
		&getitemtypeimagesrc
56
      &getitemtypeimagesrc
57
		&getitemtypeimagelocation
57
      &getitemtypeimagelocation
58
		&GetAuthorisedValues
58
      &GetAuthorisedValues
59
		&GetAuthorisedValueCategories
59
      &GetAuthorisedValueCategories
60
                &IsAuthorisedValueCategory
60
      &IsAuthorisedValueCategory
61
		&GetKohaAuthorisedValues
61
      &GetKohaAuthorisedValues
62
		&GetKohaAuthorisedValuesFromField
62
      &GetKohaAuthorisedValuesFromField
63
    &GetKohaAuthorisedValueLib
63
      &GetKohaAuthorisedValueLib
64
    &GetAuthorisedValueByCode
64
      &GetAuthorisedValueByCode
65
    &GetKohaImageurlFromAuthorisedValues
65
      &GetKohaImageurlFromAuthorisedValues
66
		&GetAuthValCode
66
      &GetAuthValCode
67
        &AddAuthorisedValue
67
      &AddAuthorisedValue
68
		&GetNormalizedUPC
68
      &GetNormalizedUPC
69
		&GetNormalizedISBN
69
      &GetNormalizedISBN
70
		&GetNormalizedEAN
70
      &GetNormalizedEAN
71
		&GetNormalizedOCLCNumber
71
      &GetNormalizedOCLCNumber
72
        &xml_escape
72
      &xml_escape
73
73
74
		$DEBUG
74
      $DEBUG
75
	);
75
    );
76
	$DEBUG = 0;
76
	$DEBUG = 0;
77
@EXPORT_OK = qw( GetDailyQuote );
77
@EXPORT_OK = qw( GetDailyQuote );
78
}
78
}
(-)a/C4/Search.pm (+34 lines)
Lines 36-41 use URI::Escape; Link Here
36
use Business::ISBN;
36
use Business::ISBN;
37
use MARC::Record;
37
use MARC::Record;
38
use MARC::Field;
38
use MARC::Field;
39
use List::MoreUtils qw(none);
39
use utf8;
40
use utf8;
40
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS $DEBUG);
41
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS $DEBUG);
41
42
Lines 1828-1841 sub searchResults { Link Here
1828
        my $maxitems = $maxitems_pref ? $maxitems_pref - 1 : 1;
1829
        my $maxitems = $maxitems_pref ? $maxitems_pref - 1 : 1;
1829
        my @hiddenitems; # hidden itemnumbers based on OpacHiddenItems syspref
1830
        my @hiddenitems; # hidden itemnumbers based on OpacHiddenItems syspref
1830
1831
1832
        my $IndependentBranchesRecordsAndItems;
1833
        if ( $search_context eq 'opac' ) {
1834
            # For the OPAC, if IndependentBranchesRecordsAndItems is enabled, 
1835
            # and BRANCHCODE has been set in the httpd conf,
1836
            # we need to filter the items
1837
            $IndependentBranchesRecordsAndItems =
1838
              C4::Context->preference('IndependentBranchesRecordsAndItems')
1839
              && $ENV{BRANCHCODE};
1840
        }
1841
        else {
1842
            # For the intranet, if IndependentBranchesRecordsAndItems is enabled,
1843
            # and the user is not a superlibrarian,
1844
            # we need to filter the items
1845
            $IndependentBranchesRecordsAndItems =
1846
              C4::Context->preference('IndependentBranchesRecordsAndItems')
1847
              && !C4::Context->IsSuperLibrarian();
1848
        }
1849
        my @allowed_branches = $IndependentBranchesRecordsAndItems ? GetIndependentGroupModificationRights() : undef;
1850
1831
        # loop through every item
1851
        # loop through every item
1852
        my $index = -1;
1832
        foreach my $field (@fields) {
1853
        foreach my $field (@fields) {
1854
            $index++;
1833
            my $item;
1855
            my $item;
1834
1856
1835
            # populate the items hash
1857
            # populate the items hash
1836
            foreach my $code ( keys %subfieldstosearch ) {
1858
            foreach my $code ( keys %subfieldstosearch ) {
1837
                $item->{$code} = $field->subfield( $subfieldstosearch{$code} );
1859
                $item->{$code} = $field->subfield( $subfieldstosearch{$code} );
1838
            }
1860
            }
1861
1862
            # if IndependentBranchesRecordsAndItems is enabled, and this record
1863
            # isn't allowed to be viewed, remove it from the items list and go
1864
            # right to the next item.
1865
            if ( $IndependentBranchesRecordsAndItems ) {
1866
                if ( none { $_ eq $item->{homebranch} } @allowed_branches ) {
1867
                    splice(@fields, $index, 1);
1868
                    $items_count--;
1869
                    next;
1870
                }
1871
            }
1872
1839
            $item->{description} = $itemtypes{ $item->{itype} }{description};
1873
            $item->{description} = $itemtypes{ $item->{itype} }{description};
1840
1874
1841
	        # OPAC hidden items
1875
	        # OPAC hidden items
(-)a/catalogue/search.pl (-15 / +37 lines)
Lines 135-140 Not yet completed... Link Here
135
use strict;            # always use
135
use strict;            # always use
136
#use warnings; FIXME - Bug 2505
136
#use warnings; FIXME - Bug 2505
137
137
138
use List::MoreUtils qw(any);
139
138
## STEP 1. Load things that are used in both search page and
140
## STEP 1. Load things that are used in both search page and
139
# results page and decide which template to load, operations 
141
# results page and decide which template to load, operations 
140
# to perform, etc.
142
# to perform, etc.
Lines 179-187 else { Link Here
179
    flagsrequired   => { catalogue => 1 },
181
    flagsrequired   => { catalogue => 1 },
180
    }
182
    }
181
);
183
);
184
182
if (C4::Context->preference("marcflavour") eq "UNIMARC" ) {
185
if (C4::Context->preference("marcflavour") eq "UNIMARC" ) {
183
    $template->param('UNIMARC' => 1);
186
    $template->param('UNIMARC' => 1);
184
}
187
}
188
185
if (C4::Context->preference("IntranetNumbersPreferPhrase")) {
189
if (C4::Context->preference("IntranetNumbersPreferPhrase")) {
186
    $template->param('numbersphr' => 1);
190
    $template->param('numbersphr' => 1);
187
}
191
}
Lines 226-245 my $branches = GetBranches(); Link Here
226
# Populate branch_loop with all branches sorted by their name.  If
230
# Populate branch_loop with all branches sorted by their name.  If
227
# independantbranches is activated, set the default branch to the borrower
231
# independantbranches is activated, set the default branch to the borrower
228
# branch, except for superlibrarian who need to search all libraries.
232
# branch, except for superlibrarian who need to search all libraries.
229
my $user = C4::Context->userenv;
233
$template->param(
230
my @branch_loop = map {
234
    branchloop       => GetBranchesLoop(),
231
     {
235
    searchdomainloop => GetBranchCategories( undef, 'searchdomain' ),
232
        value      => $_,
236
);
233
        branchname => $branches->{$_}->{branchname},
234
        selected   => $user->{branch} eq $_ && C4::Branch::onlymine(),
235
     }
236
} sort {
237
    $branches->{$a}->{branchname} cmp $branches->{$b}->{branchname}
238
} keys %$branches;
239
240
my $categories = GetBranchCategories(undef,'searchdomain');
241
242
$template->param(branchloop => \@branch_loop, searchdomainloop => $categories);
243
237
244
# load the Type stuff
238
# load the Type stuff
245
my $itemtypes = GetItemTypes;
239
my $itemtypes = GetItemTypes;
Lines 411-417 my @operands = $cgi->param('q'); Link Here
411
# limits are use to limit to results to a pre-defined category such as branch or language
405
# limits are use to limit to results to a pre-defined category such as branch or language
412
my @limits = $cgi->param('limit');
406
my @limits = $cgi->param('limit');
413
407
414
if($params->{'multibranchlimit'}) {
408
if ( C4::Context->preference('IndependentBranchesRecordsAndItems') ) {
409
    # Get list of branches this branch can access
410
    my @branches = GetIndependentGroupModificationRights();
411
412
    # Strip out any branch search limits that are not in the list of allowable branches
413
    my $has_valid_branch_limits; # If at least one allowable branch limit is passed, 
414
                                 # use the valid ones, otherwise make it an "all branches"
415
                                 # search with the allowed branches
416
417
    my @new_limits;
418
    foreach my $limit ( @limits ) {
419
        if ( $limit =~ /^branch:/ ) {
420
            my ( undef, $branch ) = split(':', $limit);
421
            push( @new_limits, $limit ) if any { $_ eq $branch } @branches;
422
            $has_valid_branch_limits = 1;
423
        } else {
424
            push( @new_limits, $limit );
425
        }
426
    }
427
    @limits = @new_limits;
428
429
    # If the limits contain any branch limits, if not, do a search on all allowable branches
430
    unless ($has_valid_branch_limits) {
431
        my $new_branch_limit =
432
          '(' . join( " or ", map { "branch: $_ " } @branches ) . ')';
433
        push( @limits, $new_branch_limit );
434
    }
435
}
436
elsif( $params->{'multibranchlimit'} ) {
415
    push @limits, '('.join( " or ", map { "branch: $_ " } @{ GetBranchesInCategory( $params->{'multibranchlimit'} ) } ).')';
437
    push @limits, '('.join( " or ", map { "branch: $_ " } @{ GetBranchesInCategory( $params->{'multibranchlimit'} ) } ).')';
416
}
438
}
417
439
(-)a/cataloguing/additem.pl (-18 / +20 lines)
Lines 666-671 if ( C4::Context->preference('EasyAnalyticalRecords') ) { Link Here
666
    }
666
    }
667
}
667
}
668
668
669
my $IndependentBranches = !C4::Context->IsSuperLibrarian()
670
  && C4::Context->preference('IndependentBranches');
671
my $IndependentBranchesRecordsAndItems = $IndependentBranches
672
  && C4::Context->preference('IndependentBranchesRecordsAndItems');
669
673
670
foreach my $field (@fields) {
674
foreach my $field (@fields) {
671
    next if ( $field->tag() < 10 );
675
    next if ( $field->tag() < 10 );
Lines 691-703 foreach my $field (@fields) { Link Here
691
695
692
        if (   $field->tag eq $branchtagfield
696
        if (   $field->tag eq $branchtagfield
693
            && $subfieldcode eq $branchtagsubfield
697
            && $subfieldcode eq $branchtagsubfield
694
            && C4::Context->preference("IndependentBranches") )
698
            && $IndependentBranches )
695
        {
699
        {
696
            #verifying rights
700
            #verifying rights
697
            my $userenv = C4::Context->userenv();
698
            unless (
701
            unless (
699
                $userenv->{'flags'} % 2 == 1
702
                GetIndependentGroupModificationRights(
700
                || GetIndependentGroupModificationRights(
701
                    { for => $subfieldvalue }
703
                    { for => $subfieldvalue }
702
                )
704
                )
703
              )
705
              )
Lines 705-728 foreach my $field (@fields) { Link Here
705
                $this_row{'nomod'} = 1;
707
                $this_row{'nomod'} = 1;
706
            }
708
            }
707
        }
709
        }
708
        $this_row{itemnumber} = $subfieldvalue if ($field->tag() eq $itemtagfield && $subfieldcode eq $itemtagsubfield);
709
710
710
	if ( C4::Context->preference('EasyAnalyticalRecords') ) {
711
        $this_row{itemnumber} = $subfieldvalue if ($field->tag() eq $itemtagfield && $subfieldcode eq $itemtagsubfield);
711
	    foreach my $hostitemnumber (@hostitemnumbers){
712
		if ($this_row{itemnumber} eq $hostitemnumber){
713
			$this_row{hostitemflag} = 1;
714
			$this_row{hostbiblionumber}= GetBiblionumberFromItemnumber($hostitemnumber);
715
			last;
716
		}
717
	    }
718
712
719
#	    my $countanalytics=GetAnalyticsCount($this_row{itemnumber});
713
        if ( C4::Context->preference('EasyAnalyticalRecords') ) {
720
#           if ($countanalytics > 0){
714
            foreach my $hostitemnumber (@hostitemnumbers) {
721
#                $this_row{countanalytics} = $countanalytics;
715
                if ( $this_row{itemnumber} eq $hostitemnumber ) {
722
#           }
716
                    $this_row{hostitemflag} = 1;
723
	}
717
                    $this_row{hostbiblionumber} =
718
                      GetBiblionumberFromItemnumber($hostitemnumber);
719
                    last;
720
                }
721
            }
722
        }
724
723
725
    }
724
    }
725
726
    next if ( $this_row{'nomod'} && $IndependentBranchesRecordsAndItems );
727
726
    if (%this_row) {
728
    if (%this_row) {
727
        push(@big_array, \%this_row);
729
        push(@big_array, \%this_row);
728
    }
730
    }
(-)a/installer/data/mysql/updatedatabase.pl (+21 lines)
Lines 6853-6858 if ( CheckVersion($DBversion) ) { Link Here
6853
    SetVersion ($DBversion);
6853
    SetVersion ($DBversion);
6854
}
6854
}
6855
6855
6856
$DBversion = "3.11.00.XXX";
6857
if ( CheckVersion($DBversion) ) {
6858
    print "Upgrade to $DBversion done (IndependentBranches)\n";
6859
    $dbh->do("
6860
        INSERT INTO systempreferences (
6861
            variable,
6862
            value,
6863
            options,
6864
            explanation,
6865
            type
6866
        ) VALUES (
6867
            'IndependentBranchesRecordsAndItems',
6868
            '0',
6869
            '',
6870
            'If on, the staff interface search will hide all records that do not contain an item owned by the logged in branch, and hide the items themselves.',
6871
            'YesNo'
6872
        )
6873
    ");
6874
    SetVersion ($DBversion);
6875
}
6876
6856
=head1 FUNCTIONS
6877
=head1 FUNCTIONS
6857
6878
6858
=head2 TableExists($table)
6879
=head2 TableExists($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-search.inc (-28 / +36 lines)
Lines 1-33 Link Here
1
<div class="gradient">
1
<div class="gradient">
2
<h1 id="logo"><a href="/cgi-bin/koha/mainpage.pl">[% LibraryName %]</a></h1><!-- Begin Catalogue Resident Search Box -->
2
    <h1 id="logo"><a href="/cgi-bin/koha/mainpage.pl">[% LibraryName %]</a></h1><!-- Begin Catalogue Resident Search Box -->
3
<div id="header_search">
3
    <div id="header_search">
4
4
5
[% INCLUDE 'patron-search-box.inc' %]
5
        [% INCLUDE 'patron-search-box.inc' %]
6
6
7
[% IF ( CAN_user_circulate ) %]
7
        [% IF ( CAN_user_circulate ) %]
8
<div id="checkin_search" class="residentsearch">
8
            <div id="checkin_search" class="residentsearch">
9
    <p class="tip">Scan a barcode to check in:</p>
9
                <p class="tip">Scan a barcode to check in:</p>
10
    <form method="post" action="/cgi-bin/koha/circ/returns.pl" autocomplete="off">
10
                <form method="post" action="/cgi-bin/koha/circ/returns.pl" autocomplete="off">
11
        <input name="barcode" id="ret_barcode" size="40" />
11
                    <input name="barcode" id="ret_barcode" size="40" />
12
        <input value="Submit" class="submit" type="submit" />
12
                    <input value="Submit" class="submit" type="submit" />
13
    </form>
13
                </form>
14
</div>
14
            </div>
15
	[% END %]
15
        [% END %]
16
	[% IF ( CAN_user_catalogue ) %]
16
17
	<div id="catalog_search" class="residentsearch">
17
        [% IF ( CAN_user_catalogue ) %]
18
	<p class="tip">Enter search keywords:</p>
18
            <div id="catalog_search" class="residentsearch">
19
		<form action="/cgi-bin/koha/catalogue/search.pl"  method="get" id="cat-search-block">
19
            <p class="tip">Enter search keywords:</p>
20
			 <input type="text" name="q" id="search-form" size="40" value="" title="Enter the terms you wish to search for." class="form-text" />
20
                <form action="/cgi-bin/koha/catalogue/search.pl"  method="get" id="cat-search-block">
21
				<input type="submit" class="submit" value="Submit" />
21
                    <input type="text" name="q" id="search-form" size="40" value="" title="Enter the terms you wish to search for." class="form-text" />
22
		</form>
22
                    <input type="submit" class="submit" value="Submit" />
23
	</div>
23
                </form>
24
	[% END %]
24
            </div>
25
	
25
        [% END %]
26
			<ul>
26
27
            [% IF ( CAN_user_circulate ) %]<li><a href="#circ_search">Check out</a></li>[% END %]
27
28
    [% IF ( CAN_user_circulate ) %]<li><a href="#checkin_search">Check in</a></li>[% END %]
28
        <ul>
29
            [% IF ( CAN_user_catalogue ) %]<li class="ui-tabs-selected"><a href="#catalog_search">Search the catalog</a></li>[% END %]
29
            [% IF ( CAN_user_circulate ) %]
30
			</ul>	
30
                <li><a href="#circ_search">Check out</a></li>
31
</div><!-- /header_search -->
31
            [% END %]
32
            [% IF ( CAN_user_circulate ) %]
33
                <li><a href="#checkin_search">Check in</a></li>
34
            [% END %]
35
            [% IF ( CAN_user_catalogue ) %]
36
                <li class="ui-tabs-selected"><a href="#catalog_search">Search the catalog</a></li>
37
            [% END %]
38
        </ul>
39
    </div><!-- /header_search -->
32
</div><!-- /gradient -->
40
</div><!-- /gradient -->
33
<!-- End Catalogue Resident Search Box -->
41
<!-- End Catalogue Resident Search Box -->
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/admin.pref (+7 lines)
Lines 70-75 Administration: Link Here
70
                  yes: Prevent
70
                  yes: Prevent
71
                  no: "Don't prevent"
71
                  no: "Don't prevent"
72
            - staff (but not superlibrarians) from modifying objects (holds, items, patrons, etc.) belonging to other libraries.
72
            - staff (but not superlibrarians) from modifying objects (holds, items, patrons, etc.) belonging to other libraries.
73
        -
74
            - pref: IndependentBranchesRecordsAndItems
75
              default: 0
76
              choices:
77
                  yes: Prevent
78
                  no: "Don't prevent"
79
            - staff from seeing items owned by other libraries, and records without any items the library.
73
    CAS Authentication:
80
    CAS Authentication:
74
        -
81
        -
75
            - pref: casAuthentication
82
            - pref: casAuthentication
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/advsearch.tt (-27 / +33 lines)
Lines 1-3 Link Here
1
[% USE Koha %]
1
[% INCLUDE 'doc-head-open.inc' %]
2
[% INCLUDE 'doc-head-open.inc' %]
2
<title>Koha &rsaquo; Catalog &rsaquo; Advanced search</title>
3
<title>Koha &rsaquo; Catalog &rsaquo; Advanced search</title>
3
[% INCLUDE 'doc-head-close.inc' %]
4
[% INCLUDE 'doc-head-close.inc' %]
Lines 229-262 Link Here
229
[% END %]
230
[% END %]
230
231
231
<!-- AVAILABILITY LIMITS -->
232
<!-- AVAILABILITY LIMITS -->
232
    <fieldset id="availability"><legend>Location and availability</legend>
233
<fieldset id="availability"><legend>Location and availability</legend>
233
<fieldset id="currently-avail">
234
    <fieldset id="currently-avail">
234
        <p><label for="available-items">Only items currently available</label> <input type="checkbox" id="available-items" name="limit" value="available" /></p>
235
            <p><label for="available-items">Only items currently available</label> <input type="checkbox" id="available-items" name="limit" value="available" /></p>
235
</fieldset>
236
    </fieldset>
236
237
237
<fieldset id="select-libs">
238
    <fieldset id="select-libs">
238
        <p><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;}'>
239
            <p>
239
        <option value="">All libraries</option>
240
                <label for="branchloop">Individual libraries:</label>
240
        [% FOREACH branchloo IN branchloop %]
241
                <select name="limit" id="branchloop" onchange='if(this.value != ""){document.getElementById("categoryloop").disabled=true;} else {document.getElementById("categoryloop").disabled=false;}'>
241
        [% IF ( branchloo.selected ) %]
242
                    <option value="">All libraries</option>
242
        <option value="branch:[% branchloo.value %]" selected="selected">[% branchloo.branchname %]</option>
243
                    [% FOREACH branchloo IN branchloop %]
243
        [% ELSE %]
244
                        [% IF ( branchloo.selected ) %]
244
        <option value="branch:[% branchloo.value %]">[% branchloo.branchname %]</option>
245
                            <option value="branch:[% branchloo.value %]" selected="selected">[% branchloo.branchname %]</option>
245
        [% END %]
246
                        [% ELSE %]
246
        [% END %]
247
                            <option value="branch:[% branchloo.value %]">[% branchloo.branchname %]</option>
247
        </select></p>
248
                        [% END %]
248
    <!-- <input type="hidden" name="limit" value="branch: MAIN" /> -->
249
                    [% END %]
249
        [% IF ( searchdomainloop ) %]
250
                </select>
250
    <p>OR</p> <!-- should addjs to grey out group pulldown if a library is selected. -->
251
            </p>
251
        <p><label for="categoryloop">Groups of libraries: </label><select name="multibranchlimit" id="categoryloop">
252
252
        <option value=""> -- none -- </option>
253
            [% IF searchdomainloop && !Koha.Preference('IndependentBranchesRecordsAndItems') %]
253
        [% FOREACH searchdomainloo IN searchdomainloop %]
254
                <p>OR</p> <!-- should addjs to grey out group pulldown if a library is selected. -->
254
        <option value="[% searchdomainloo.categorycode %]">[% searchdomainloo.categoryname %]</option>
255
                <p>
255
        [% END %]
256
                    <label for="categoryloop">Groups of libraries: </label>
256
        </select></p>
257
                    <select name="multibranchlimit" id="categoryloop">
257
    [% END %]
258
                        <option value=""> -- none -- </option>
258
</fieldset>
259
                        [% FOREACH searchdomainloo IN searchdomainloop %]
260
                            <option value="[% searchdomainloo.categorycode %]">[% searchdomainloo.categoryname %]</option>
261
                        [% END %]
262
                    </select>
263
                </p>
264
            [% END %]
259
    </fieldset>
265
    </fieldset>
266
</fieldset>
260
<!-- /AVAILABILITY LIMITS -->
267
<!-- /AVAILABILITY LIMITS -->
261
268
262
<!-- RANK LIMITS -->
269
<!-- RANK LIMITS -->
263
- 

Return to bug 10278