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

(-)a/admin/smart-rules.pl (-1 / +2 lines)
Lines 30-35 use Koha::DateUtils; Link Here
30
use Koha::Database;
30
use Koha::Database;
31
use Koha::IssuingRule;
31
use Koha::IssuingRule;
32
use Koha::IssuingRules;
32
use Koha::IssuingRules;
33
use Koha::Libraries;
33
34
34
my $input = CGI->new;
35
my $input = CGI->new;
35
my $dbh = C4::Context->dbh;
36
my $dbh = C4::Context->dbh;
Lines 49-55 my $type=$input->param('type'); Link Here
49
50
50
my $branch;
51
my $branch;
51
if ( C4::Context->preference('DefaultToLoggedInLibraryCircRules') ) {
52
if ( C4::Context->preference('DefaultToLoggedInLibraryCircRules') ) {
52
    $branch = $input->param('branch') || GetBranchesCount() == 1 ? undef : C4::Branch::mybranch();
53
    $branch = $input->param('branch') || Koha::Libraries->search->count() == 1 ? undef : C4::Branch::mybranch();
53
}
54
}
54
else {
55
else {
55
    $branch = $input->param('branch') || ( C4::Branch::onlymine() ? ( C4::Branch::mybranch() || '*' ) : '*' );
56
    $branch = $input->param('branch') || ( C4::Branch::onlymine() ? ( C4::Branch::mybranch() || '*' ) : '*' );
(-)a/tools/overduerules.pl (-2 / +2 lines)
Lines 28-33 use C4::Branch; Link Here
28
use C4::Letters;
28
use C4::Letters;
29
use C4::Members;
29
use C4::Members;
30
use C4::Overdues;
30
use C4::Overdues;
31
use Koha::Libraries;
31
32
32
our $input = new CGI;
33
our $input = new CGI;
33
my $dbh = C4::Context->dbh;
34
my $dbh = C4::Context->dbh;
Lines 76-82 my $branch = $input->param('branch'); Link Here
76
$branch =
77
$branch =
77
    defined $branch                                                    ? $branch
78
    defined $branch                                                    ? $branch
78
  : C4::Context->preference('DefaultToLoggedInLibraryOverdueTriggers') ? C4::Branch::mybranch()
79
  : C4::Context->preference('DefaultToLoggedInLibraryOverdueTriggers') ? C4::Branch::mybranch()
79
  : GetBranchesCount() == 1                                            ? undef
80
  : Koha::Libraries->search->count() == 1                              ? undef
80
  :                                                                      undef;
81
  :                                                                      undef;
81
$branch ||= q{};
82
$branch ||= q{};
82
$branch = q{} if $branch eq 'NO_LIBRARY_SET';
83
$branch = q{} if $branch eq 'NO_LIBRARY_SET';
83
- 

Return to bug 15295