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

(-)a/C4/Reserves.pm (-1 / +1 lines)
Lines 1551-1557 sub IsAvailableForItemLevelRequest { Link Here
1551
        $notforloan_per_itemtype ||
1551
        $notforloan_per_itemtype ||
1552
        $item->{itemlost}        ||
1552
        $item->{itemlost}        ||
1553
        $item->{notforloan} > 0  ||
1553
        $item->{notforloan} > 0  ||
1554
        $item->{wthdrawn}        ||
1554
        $item->{withdrawn}        ||
1555
        ($item->{damaged} && !C4::Context->preference('AllowHoldsOnDamagedItems'));
1555
        ($item->{damaged} && !C4::Context->preference('AllowHoldsOnDamagedItems'));
1556
1556
1557
1557
(-)a/Koha/Schema/Result/Issuingrule.pm (-2 / +19 lines)
Lines 161-166 __PACKAGE__->table("issuingrules"); Link Here
161
  is_nullable: 1
161
  is_nullable: 1
162
  size: [28,6]
162
  size: [28,6]
163
163
164
=head2 onshelfholds
165
166
  data_type: 'tinyint'
167
  default_value: 0
168
  is_nullable: 0
169
170
=head2 opacitemholds
171
172
  data_type: 'char'
173
  default_value: 'N'
174
  is_nullable: 0
175
  size: 1
176
164
=cut
177
=cut
165
178
166
__PACKAGE__->add_columns(
179
__PACKAGE__->add_columns(
Lines 217-222 __PACKAGE__->add_columns( Link Here
217
  { data_type => "varchar", default_value => "", is_nullable => 0, size => 10 },
230
  { data_type => "varchar", default_value => "", is_nullable => 0, size => 10 },
218
  "overduefinescap",
231
  "overduefinescap",
219
  { data_type => "decimal", is_nullable => 1, size => [28, 6] },
232
  { data_type => "decimal", is_nullable => 1, size => [28, 6] },
233
  "onshelfholds",
234
  { data_type => "tinyint", default_value => 0, is_nullable => 0 },
235
  "opacitemholds",
236
  { data_type => "char", default_value => "N", is_nullable => 0, size => 1 },
220
);
237
);
221
238
222
=head1 PRIMARY KEY
239
=head1 PRIMARY KEY
Lines 236-243 __PACKAGE__->add_columns( Link Here
236
__PACKAGE__->set_primary_key("branchcode", "categorycode", "itemtype");
253
__PACKAGE__->set_primary_key("branchcode", "categorycode", "itemtype");
237
254
238
255
239
# Created by DBIx::Class::Schema::Loader v0.07039 @ 2014-09-17 21:06:58
256
# Created by DBIx::Class::Schema::Loader v0.07040 @ 2014-12-19 07:00:40
240
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:vmlv13CeQ99RO0VsviRABg
257
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:CE8yuYC5QgPHI2GOjiT28w
241
258
242
259
243
# You can replace this text with custom content, and it will be preserved on regeneration
260
# You can replace this text with custom content, and it will be preserved on regeneration
(-)a/admin/smart-rules.pl (-14 / +34 lines)
Lines 27-32 use C4::Koha; Link Here
27
use C4::Debug;
27
use C4::Debug;
28
use C4::Branch; # GetBranches
28
use C4::Branch; # GetBranches
29
use C4::Dates qw/format_date format_date_in_iso/;
29
use C4::Dates qw/format_date format_date_in_iso/;
30
use Koha::Database;
30
31
31
my $input = CGI->new;
32
my $input = CGI->new;
32
my $dbh = C4::Context->dbh;
33
my $dbh = C4::Context->dbh;
Lines 100-109 elsif ($op eq 'delete-branch-item') { Link Here
100
}
101
}
101
# save the values entered
102
# save the values entered
102
elsif ($op eq 'add') {
103
elsif ($op eq 'add') {
103
    my $sth_search = $dbh->prepare('SELECT COUNT(*) AS total FROM issuingrules WHERE branchcode=? AND categorycode=? AND itemtype=?');
104
    my $sth_insert = $dbh->prepare('INSERT INTO issuingrules (branchcode, categorycode, itemtype, maxissueqty, renewalsallowed, reservesallowed, norenewalbefore, auto_renew, reservesallowed, issuelength, lengthunit, hardduedate, hardduedatecompare, fine, finedays, maxsuspensiondays, firstremind, chargeperiod,rentaldiscount, onshelfholds, opacitemholds, overduefinescap) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)');
105
    my $sth_update=$dbh->prepare("UPDATE issuingrules SET fine=?, finedays=?, maxsuspensiondays=?, firstremind=?, chargeperiod=?, maxissueqty=?, renewalsallowed=?, renewalperiod=?, norenewalbefore=?, auto_renew=?, reservesallowed=?, issuelength=?, lengthunit=?, hardduedate=?, hardduedatecompare=?, rentaldiscount=?, onshelfholds=?, opacitemholds=?, overduefinescap=? WHERE branchcode=? AND categorycode=? AND itemtype=?");
106
    
107
    my $br = $branch; # branch
104
    my $br = $branch; # branch
108
    my $bor  = $input->param('categorycode'); # borrower category
105
    my $bor  = $input->param('categorycode'); # borrower category
109
    my $itemtype  = $input->param('itemtype');     # item type
106
    my $itemtype  = $input->param('itemtype');     # item type
Lines 133-146 elsif ($op eq 'add') { Link Here
133
    my $overduefinescap = $input->param('overduefinescap') || undef;
130
    my $overduefinescap = $input->param('overduefinescap') || undef;
134
    $debug and warn "Adding $br, $bor, $itemtype, $fine, $maxissueqty";
131
    $debug and warn "Adding $br, $bor, $itemtype, $fine, $maxissueqty";
135
132
136
    $sth_search->execute($br,$bor,$itemtype);
133
    my $schema = Koha::Database->new()->schema();
137
    my $res = $sth_search->fetchrow_hashref();
134
    my $rs = $schema->resultset('Issuingrule');
138
    if ($res->{total}) {
135
139
        $sth_update->execute($fine, $finedays, $maxsuspensiondays, $firstremind, $chargeperiod, $maxissueqty, $renewalsallowed, $renewalperiod, $norenewalbefore, $auto_renew, $reservesallowed, $issuelength,$lengthunit, $hardduedate,$hardduedatecompare,$rentaldiscount, $onshelfholds, $opacitemholds, $overduefinescap, $br,$bor,$itemtype);
136
    my $params = {
140
    } else {
137
        branchcode         => $br,
141
        $sth_insert->execute($br,$bor,$itemtype,$maxissueqty,$renewalsallowed, $renewalperiod, $norenewalbefore, $auto_renew, $reservesallowed,$issuelength,$lengthunit,$hardduedate,$hardduedatecompare,$fine,$finedays, $maxsuspensiondays, $firstremind,$chargeperiod,$rentaldiscount,$onshelfholds,$opacitemholds,$overduefinescap);
138
        categorycode       => $bor,
142
    }
139
        itemtype           => $itemtype,
143
} 
140
        fine               => $fine,
141
        finedays           => $finedays,
142
        maxsuspensiondays  => $maxsuspensiondays,
143
        firstremind        => $firstremind,
144
        chargeperiod       => $chargeperiod,
145
        maxissueqty        => $maxissueqty,
146
        renewalsallowed    => $renewalsallowed,
147
        renewalperiod      => $renewalperiod,
148
        norenewalbefore    => $norenewalbefore,
149
        auto_renew         => $auto_renew,
150
        reservesallowed    => $reservesallowed,
151
        issuelength        => $issuelength,
152
        lengthunit         => $lengthunit,
153
        hardduedate        => $hardduedate,
154
        hardduedatecompare => $hardduedatecompare,
155
        rentaldiscount     => $rentaldiscount,
156
        onshelfholds       => $onshelfholds,
157
        opacitemholds      => $opacitemholds,
158
        overduefinescap    => $overduefinescap,
159
    };
160
161
    $rs->update_or_create($params);
162
163
}
144
elsif ($op eq "set-branch-defaults") {
164
elsif ($op eq "set-branch-defaults") {
145
    my $categorycode  = $input->param('categorycode');
165
    my $categorycode  = $input->param('categorycode');
146
    my $maxissueqty   = $input->param('maxissueqty');
166
    my $maxissueqty   = $input->param('maxissueqty');
Lines 413-419 if ($branch eq "*") { Link Here
413
        SELECT default_borrower_circ_rules.*, categories.description AS humancategorycode
433
        SELECT default_borrower_circ_rules.*, categories.description AS humancategorycode
414
        FROM default_borrower_circ_rules
434
        FROM default_borrower_circ_rules
415
        JOIN categories USING (categorycode)
435
        JOIN categories USING (categorycode)
416
        
436
417
    ");
437
    ");
418
    $sth_branch_cat->execute();
438
    $sth_branch_cat->execute();
419
} else {
439
} else {
Lines 507-513 $template->param(categoryloop => \@category_loop, Link Here
507
                        branchloop => \@branchloop,
527
                        branchloop => \@branchloop,
508
                        humanbranch => ($branch ne '*' ? $branches->{$branch}->{branchname} : ''),
528
                        humanbranch => ($branch ne '*' ? $branches->{$branch}->{branchname} : ''),
509
                        current_branch => $branch,
529
                        current_branch => $branch,
510
                        definedbranch => scalar(@sorted_row_loop)>0 
530
                        definedbranch => scalar(@sorted_row_loop)>0
511
                        );
531
                        );
512
output_html_with_http_headers $input, $cookie, $template->output;
532
output_html_with_http_headers $input, $cookie, $template->output;
513
533
(-)a/opac/opac-detail.pl (-2 / +1 lines)
Lines 635-641 if ( not $viewallitems and @items > $max_items_to_display ) { Link Here
635
        && !$itemtypes->{$itm->{'itype'}}->{notforloan}
635
        && !$itemtypes->{$itm->{'itype'}}->{notforloan}
636
        && $itm->{'itemnumber'};
636
        && $itm->{'itemnumber'};
637
637
638
    $allow_onshelf_holds = C4::Reserves::OnShelfHoldsAllowed($itm, $borrower)
638
    $allow_onshelf_holds = C4::Reserves::OnShelfHoldsAllowed( $itm, $borrower )
639
      unless $allow_onshelf_holds;
639
      unless $allow_onshelf_holds;
640
640
641
    # get collection code description, too
641
    # get collection code description, too
642
- 

Return to bug 5786