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

(-)a/C4/Circulation.pm (-13 / +21 lines)
Lines 1376-1388 sub GetBranchBorrowerCircRule { Link Here
1376
Retrieves circulation rule attributes that apply to the given
1376
Retrieves circulation rule attributes that apply to the given
1377
branch and item type, regardless of patron category.
1377
branch and item type, regardless of patron category.
1378
1378
1379
The return value is a hashref containing the following key:
1379
The return value is a hashref containing the following keys:
1380
1380
1381
holdallowed => Hold policy for this branch and itemtype. Possible values:
1381
holdallowed => Hold policy for this branch and itemtype. Possible values:
1382
  0: No holds allowed.
1382
  0: No holds allowed.
1383
  1: Holds allowed only by patrons that have the same homebranch as the item.
1383
  1: Holds allowed only by patrons that have the same homebranch as the item.
1384
  2: Holds allowed from any patron.
1384
  2: Holds allowed from any patron.
1385
1385
1386
returnbranch => branch to which to return item.  Possible values:
1387
  noreturn: do not return, let item remain where checked in (floating collections)
1388
  homebranch: return to item's home branch
1389
1386
This searches branchitemrules in the following order:
1390
This searches branchitemrules in the following order:
1387
1391
1388
  * Same branchcode and itemtype
1392
  * Same branchcode and itemtype
Lines 1390-1396 This searches branchitemrules in the following order: Link Here
1390
  * branchcode '*', same itemtype
1394
  * branchcode '*', same itemtype
1391
  * branchcode and itemtype '*'
1395
  * branchcode and itemtype '*'
1392
1396
1393
Neither C<$branchcode> nor C<$categorycode> should be '*'.
1397
Neither C<$branchcode> nor C<$itemtype> should be '*'.
1394
1398
1395
=cut
1399
=cut
1396
1400
Lines 1400-1432 sub GetBranchItemRule { Link Here
1400
    my $result = {};
1404
    my $result = {};
1401
1405
1402
    my @attempts = (
1406
    my @attempts = (
1403
        ['SELECT holdallowed
1407
        ['SELECT holdallowed, returnbranch
1404
            FROM branch_item_rules
1408
            FROM branch_item_rules
1405
            WHERE branchcode = ?
1409
            WHERE branchcode = ?
1406
              AND itemtype = ?', $branchcode, $itemtype],
1410
              AND itemtype = ?', $branchcode, $itemtype],
1407
        ['SELECT holdallowed
1411
        ['SELECT holdallowed, returnbranch
1408
            FROM default_branch_circ_rules
1412
            FROM default_branch_circ_rules
1409
            WHERE branchcode = ?', $branchcode],
1413
            WHERE branchcode = ?', $branchcode],
1410
        ['SELECT holdallowed
1414
        ['SELECT holdallowed, returnbranch
1411
            FROM default_branch_item_rules
1415
            FROM default_branch_item_rules
1412
            WHERE itemtype = ?', $itemtype],
1416
            WHERE itemtype = ?', $itemtype],
1413
        ['SELECT holdallowed
1417
        ['SELECT holdallowed, returnbranch
1414
            FROM default_circ_rules'],
1418
            FROM default_circ_rules'],
1415
    );
1419
    );
1416
1420
1417
    foreach my $attempt (@attempts) {
1421
    foreach my $attempt (@attempts) {
1418
        my ($query, @bind_params) = @{$attempt};
1422
        my ($query, @bind_params) = @{$attempt};
1423
        my $search_result = $dbh->selectrow_hashref ( $query , {}, @bind_params );
1419
1424
1420
        # Since branch/category and branch/itemtype use the same per-branch
1425
        # Since branch/category and branch/itemtype use the same per-branch
1421
        # defaults tables, we have to check that the key we want is set, not
1426
        # defaults tables, we have to check that the key we want is set, not
1422
        # just that a row was returned
1427
        # just that a row was returned
1423
        return $result if ( defined( $result->{'holdallowed'} = $dbh->selectrow_array( $query, {}, @bind_params ) ) );
1428
        $result->{'holdallowed'}  = $search_result->{'holdallowed'}  unless ( defined $result->{'holdallowed'} );
1429
        $result->{'returnbranch'} = $search_result->{'returnbranch'} unless ( defined $result->{'returnbranch'} );
1424
    }
1430
    }
1425
    
1431
    
1426
    # built-in default circulation rule
1432
    # built-in default circulation rule
1427
    return {
1433
    $result->{'holdallowed'} = 2 unless ( defined $result->{'holdallowed'} );
1428
        holdallowed => 2,
1434
    $result->{'returnbranch'} = 'homebranch' unless ( defined $result->{'returnbranch'} );
1429
    };
1435
1436
    return $result;
1430
}
1437
}
1431
1438
1432
=head2 AddReturn
1439
=head2 AddReturn
Lines 1543-1551 sub AddReturn { Link Here
1543
    my $item = GetItem($itemnumber) or die "GetItem($itemnumber) failed";
1550
    my $item = GetItem($itemnumber) or die "GetItem($itemnumber) failed";
1544
        # full item data, but no borrowernumber or checkout info (no issue)
1551
        # full item data, but no borrowernumber or checkout info (no issue)
1545
        # we know GetItem should work because GetItemnumberFromBarcode worked
1552
        # we know GetItem should work because GetItemnumberFromBarcode worked
1546
    my $hbr      = C4::Context->preference("HomeOrHoldingBranchReturn") || "homebranch";
1553
    my $hbr      = GetBranchItemRule($item->{'homebranch'}, $item->{'itype'}) || "homebranch";
1547
    $hbr = $item->{$hbr} || '';
1554
        # get the proper branch to which to return the item
1548
        # item must be from items table -- issues table has branchcode and issuingbranch, not homebranch nor holdingbranch
1555
    $hbr = $item->{$hbr} || $branch ;
1556
        # if $hbr was "noreturn" or any other non-item table value, then it should 'float' (i.e. stay at this branch)
1549
1557
1550
    my $borrowernumber = $borrower->{'borrowernumber'} || undef;    # we don't know if we had a borrower or not
1558
    my $borrowernumber = $borrower->{'borrowernumber'} || undef;    # we don't know if we had a borrower or not
1551
1559
(-)a/admin/smart-rules.pl (-30 / +33 lines)
Lines 135-140 elsif ($op eq "set-branch-defaults") { Link Here
135
    my $categorycode  = $input->param('categorycode');
135
    my $categorycode  = $input->param('categorycode');
136
    my $maxissueqty   = $input->param('maxissueqty');
136
    my $maxissueqty   = $input->param('maxissueqty');
137
    my $holdallowed   = $input->param('holdallowed');
137
    my $holdallowed   = $input->param('holdallowed');
138
    my $returnbranch  = $input->param('returnbranch');
138
    $maxissueqty =~ s/\s//g;
139
    $maxissueqty =~ s/\s//g;
139
    $maxissueqty = undef if $maxissueqty !~ /^\d+/;
140
    $maxissueqty = undef if $maxissueqty !~ /^\d+/;
140
    $holdallowed =~ s/\s//g;
141
    $holdallowed =~ s/\s//g;
Lines 144-177 elsif ($op eq "set-branch-defaults") { Link Here
144
        my $sth_search = $dbh->prepare("SELECT count(*) AS total
145
        my $sth_search = $dbh->prepare("SELECT count(*) AS total
145
                                        FROM default_circ_rules");
146
                                        FROM default_circ_rules");
146
        my $sth_insert = $dbh->prepare("INSERT INTO default_circ_rules
147
        my $sth_insert = $dbh->prepare("INSERT INTO default_circ_rules
147
                                        (maxissueqty, holdallowed)
148
                                        (maxissueqty, holdallowed, returnbranch)
148
                                        VALUES (?, ?)");
149
                                        VALUES (?, ?, ?)");
149
        my $sth_update = $dbh->prepare("UPDATE default_circ_rules
150
        my $sth_update = $dbh->prepare("UPDATE default_circ_rules
150
                                        SET maxissueqty = ?, holdallowed = ?");
151
                                        SET maxissueqty = ?, holdallowed = ?, returnbranch = ?");
151
152
152
        $sth_search->execute();
153
        $sth_search->execute();
153
        my $res = $sth_search->fetchrow_hashref();
154
        my $res = $sth_search->fetchrow_hashref();
154
        if ($res->{total}) {
155
        if ($res->{total}) {
155
            $sth_update->execute($maxissueqty, $holdallowed);
156
            $sth_update->execute($maxissueqty, $holdallowed, $returnbranch);
156
        } else {
157
        } else {
157
            $sth_insert->execute($maxissueqty, $holdallowed);
158
            $sth_insert->execute($maxissueqty, $holdallowed, $returnbranch);
158
        }
159
        }
159
    } else {
160
    } else {
160
        my $sth_search = $dbh->prepare("SELECT count(*) AS total
161
        my $sth_search = $dbh->prepare("SELECT count(*) AS total
161
                                        FROM default_branch_circ_rules
162
                                        FROM default_branch_circ_rules
162
                                        WHERE branchcode = ?");
163
                                        WHERE branchcode = ?");
163
        my $sth_insert = $dbh->prepare("INSERT INTO default_branch_circ_rules
164
        my $sth_insert = $dbh->prepare("INSERT INTO default_branch_circ_rules
164
                                        (branchcode, maxissueqty, holdallowed)
165
                                        (branchcode, maxissueqty, holdallowed, returnbranch)
165
                                        VALUES (?, ?, ?)");
166
                                        VALUES (?, ?, ?, ?)");
166
        my $sth_update = $dbh->prepare("UPDATE default_branch_circ_rules
167
        my $sth_update = $dbh->prepare("UPDATE default_branch_circ_rules
167
                                        SET maxissueqty = ?, holdallowed = ?
168
                                        SET maxissueqty = ?, holdallowed = ?, returnbranch = ?
168
                                        WHERE branchcode = ?");
169
                                        WHERE branchcode = ?");
169
        $sth_search->execute($branch);
170
        $sth_search->execute($branch);
170
        my $res = $sth_search->fetchrow_hashref();
171
        my $res = $sth_search->fetchrow_hashref();
171
        if ($res->{total}) {
172
        if ($res->{total}) {
172
            $sth_update->execute($maxissueqty, $holdallowed, $branch);
173
            $sth_update->execute($maxissueqty, $holdallowed, $returnbranch, $branch);
173
        } else {
174
        } else {
174
            $sth_insert->execute($branch, $maxissueqty, $holdallowed);
175
            $sth_insert->execute($branch, $maxissueqty, $holdallowed, $returnbranch);
175
        }
176
        }
176
    }
177
    }
177
}
178
}
Lines 258-263 elsif ($op eq "add-branch-cat") { Link Here
258
elsif ($op eq "add-branch-item") {
259
elsif ($op eq "add-branch-item") {
259
    my $itemtype  = $input->param('itemtype');
260
    my $itemtype  = $input->param('itemtype');
260
    my $holdallowed   = $input->param('holdallowed');
261
    my $holdallowed   = $input->param('holdallowed');
262
    my $returnbranch  = $input->param('returnbranch');
261
    $holdallowed =~ s/\s//g;
263
    $holdallowed =~ s/\s//g;
262
    $holdallowed = undef if $holdallowed !~ /^\d+/;
264
    $holdallowed = undef if $holdallowed !~ /^\d+/;
263
265
Lines 266-299 elsif ($op eq "add-branch-item") { Link Here
266
            my $sth_search = $dbh->prepare("SELECT count(*) AS total
268
            my $sth_search = $dbh->prepare("SELECT count(*) AS total
267
                                            FROM default_circ_rules");
269
                                            FROM default_circ_rules");
268
            my $sth_insert = $dbh->prepare("INSERT INTO default_circ_rules
270
            my $sth_insert = $dbh->prepare("INSERT INTO default_circ_rules
269
                                            (holdallowed)
271
                                            (holdallowed, returnbranch)
270
                                            VALUES (?)");
272
                                            VALUES (?, ?)");
271
            my $sth_update = $dbh->prepare("UPDATE default_circ_rules
273
            my $sth_update = $dbh->prepare("UPDATE default_circ_rules
272
                                            SET holdallowed = ?");
274
                                            SET holdallowed = ?, returnbranch = ?");
273
275
274
            $sth_search->execute();
276
            $sth_search->execute();
275
            my $res = $sth_search->fetchrow_hashref();
277
            my $res = $sth_search->fetchrow_hashref();
276
            if ($res->{total}) {
278
            if ($res->{total}) {
277
                $sth_update->execute($holdallowed);
279
                $sth_update->execute($holdallowed, $returnbranch);
278
            } else {
280
            } else {
279
                $sth_insert->execute($holdallowed);
281
                $sth_insert->execute($holdallowed, $returnbranch);
280
            }
282
            }
281
        } else {
283
        } else {
282
            my $sth_search = $dbh->prepare("SELECT count(*) AS total
284
            my $sth_search = $dbh->prepare("SELECT count(*) AS total
283
                                            FROM default_branch_item_rules
285
                                            FROM default_branch_item_rules
284
                                            WHERE itemtype = ?");
286
                                            WHERE itemtype = ?");
285
            my $sth_insert = $dbh->prepare("INSERT INTO default_branch_item_rules
287
            my $sth_insert = $dbh->prepare("INSERT INTO default_branch_item_rules
286
                                            (itemtype, holdallowed)
288
                                            (itemtype, holdallowed, returnbranch)
287
                                            VALUES (?, ?)");
289
                                            VALUES (?, ?, ?)");
288
            my $sth_update = $dbh->prepare("UPDATE default_branch_item_rules
290
            my $sth_update = $dbh->prepare("UPDATE default_branch_item_rules
289
                                            SET holdallowed = ?
291
                                            SET holdallowed = ?, returnbranch = ?
290
                                            WHERE itemtype = ?");
292
                                            WHERE itemtype = ?");
291
            $sth_search->execute($itemtype);
293
            $sth_search->execute($itemtype);
292
            my $res = $sth_search->fetchrow_hashref();
294
            my $res = $sth_search->fetchrow_hashref();
293
            if ($res->{total}) {
295
            if ($res->{total}) {
294
                $sth_update->execute($holdallowed, $itemtype);
296
                $sth_update->execute($holdallowed, $returnbranch, $itemtype);
295
            } else {
297
            } else {
296
                $sth_insert->execute($itemtype, $holdallowed);
298
                $sth_insert->execute($itemtype, $holdallowed, $returnbranch);
297
            }
299
            }
298
        }
300
        }
299
    } elsif ($itemtype eq "*") {
301
    } elsif ($itemtype eq "*") {
Lines 301-317 elsif ($op eq "add-branch-item") { Link Here
301
                                        FROM default_branch_circ_rules
303
                                        FROM default_branch_circ_rules
302
                                        WHERE branchcode = ?");
304
                                        WHERE branchcode = ?");
303
        my $sth_insert = $dbh->prepare("INSERT INTO default_branch_circ_rules
305
        my $sth_insert = $dbh->prepare("INSERT INTO default_branch_circ_rules
304
                                        (branchcode, holdallowed)
306
                                        (branchcode, holdallowed, returnbranch)
305
                                        VALUES (?, ?)");
307
                                        VALUES (?, ?, ?)");
306
        my $sth_update = $dbh->prepare("UPDATE default_branch_circ_rules
308
        my $sth_update = $dbh->prepare("UPDATE default_branch_circ_rules
307
                                        SET holdallowed = ?
309
                                        SET holdallowed = ?, returnbranch = ?
308
                                        WHERE branchcode = ?");
310
                                        WHERE branchcode = ?");
309
        $sth_search->execute($branch);
311
        $sth_search->execute($branch);
310
        my $res = $sth_search->fetchrow_hashref();
312
        my $res = $sth_search->fetchrow_hashref();
311
        if ($res->{total}) {
313
        if ($res->{total}) {
312
            $sth_update->execute($holdallowed, $branch);
314
            $sth_update->execute($holdallowed, $returnbranch, $branch);
313
        } else {
315
        } else {
314
            $sth_insert->execute($branch, $holdallowed);
316
            $sth_insert->execute($branch, $holdallowed, $returnbranch);
315
        }
317
        }
316
    } else {
318
    } else {
317
        my $sth_search = $dbh->prepare("SELECT count(*) AS total
319
        my $sth_search = $dbh->prepare("SELECT count(*) AS total
Lines 319-337 elsif ($op eq "add-branch-item") { Link Here
319
                                        WHERE branchcode = ?
321
                                        WHERE branchcode = ?
320
                                        AND   itemtype = ?");
322
                                        AND   itemtype = ?");
321
        my $sth_insert = $dbh->prepare("INSERT INTO branch_item_rules
323
        my $sth_insert = $dbh->prepare("INSERT INTO branch_item_rules
322
                                        (branchcode, itemtype, holdallowed)
324
                                        (branchcode, itemtype, holdallowed, returnbranch)
323
                                        VALUES (?, ?, ?)");
325
                                        VALUES (?, ?, ?, ?)");
324
        my $sth_update = $dbh->prepare("UPDATE branch_item_rules
326
        my $sth_update = $dbh->prepare("UPDATE branch_item_rules
325
                                        SET holdallowed = ?
327
                                        SET holdallowed = ?, returnbranch = ?
326
                                        WHERE branchcode = ?
328
                                        WHERE branchcode = ?
327
                                        AND itemtype = ?");
329
                                        AND itemtype = ?");
328
330
329
        $sth_search->execute($branch, $itemtype);
331
        $sth_search->execute($branch, $itemtype);
330
        my $res = $sth_search->fetchrow_hashref();
332
        my $res = $sth_search->fetchrow_hashref();
331
        if ($res->{total}) {
333
        if ($res->{total}) {
332
            $sth_update->execute($holdallowed, $branch, $itemtype);
334
            $sth_update->execute($holdallowed, $returnbranch, $branch, $itemtype);
333
        } else {
335
        } else {
334
            $sth_insert->execute($branch, $itemtype, $holdallowed);
336
            $sth_insert->execute($branch, $itemtype, $holdallowed, $returnbranch);
335
        }
337
        }
336
    }
338
    }
337
}
339
}
Lines 484-489 if ($defaults) { Link Here
484
    $template->param(default_holdallowed_same => 1) if($defaults->{holdallowed} == 1);
486
    $template->param(default_holdallowed_same => 1) if($defaults->{holdallowed} == 1);
485
    $template->param(default_holdallowed_any => 1) if($defaults->{holdallowed} == 2);
487
    $template->param(default_holdallowed_any => 1) if($defaults->{holdallowed} == 2);
486
    $template->param(default_maxissueqty => $defaults->{maxissueqty});
488
    $template->param(default_maxissueqty => $defaults->{maxissueqty});
489
    $template->param(default_returnbranch => $defaults->{returnbranch});
487
}
490
}
488
491
489
$template->param(default_rules => ($defaults ? 1 : 0));
492
$template->param(default_rules => ($defaults ? 1 : 0));
(-)a/installer/data/mysql/atomicupdate/bug_7144-add-returnbranch-to-branch-item-issuing-rules.pl (+20 lines)
Line 0 Link Here
1
#! /usr/bin/perl
2
use strict;
3
use warnings;
4
use C4::Context;
5
my $dbh=C4::Context->dbh;
6
7
$dbh->do("ALTER TABLE default_circ_rules ADD 
8
		COLUMN `returnbranch` varchar(15) default NULL AFTER `holdallowed`");
9
$dbh->do("ALTER TABLE branch_item_rules ADD 
10
		COLUMN `returnbranch` varchar(15) default NULL AFTER `holdallowed`");
11
$dbh->do("ALTER TABLE default_branch_circ_rules ADD 
12
		COLUMN `returnbranch` varchar(15) default NULL AFTER `holdallowed`");
13
$dbh->do("ALTER TABLE default_branch_item_rules ADD 
14
		COLUMN `returnbranch` varchar(15) default NULL AFTER `holdallowed`");
15
16
# set the default rule to the current value of HomeOrHoldingBranchReturn (default to 'homebranch' if need be)
17
my $homeorholdingbranchreturn = C4::Context->prefernce('HomeOrHoldingBranchReturn') || 'homebranch';
18
$dbh->do("UPDATE default_circ_rules SET returnbranch = '$homeorholdingbranchreturn'");
19
20
print "Upgrade done (Adding 'returnbranch' to branch/item issuing rules tables)\n";
(-)a/installer/data/mysql/kohastructure.sql (+4 lines)
Lines 317-322 CREATE TABLE `branch_item_rules` ( Link Here
317
  `branchcode` varchar(10) NOT NULL,
317
  `branchcode` varchar(10) NOT NULL,
318
  `itemtype` varchar(10) NOT NULL,
318
  `itemtype` varchar(10) NOT NULL,
319
  `holdallowed` tinyint(1) default NULL,
319
  `holdallowed` tinyint(1) default NULL,
320
  `returnbranch` varchar(15) default NULL,
320
  PRIMARY KEY  (`itemtype`,`branchcode`),
321
  PRIMARY KEY  (`itemtype`,`branchcode`),
321
  KEY `branch_item_rules_ibfk_2` (`branchcode`),
322
  KEY `branch_item_rules_ibfk_2` (`branchcode`),
322
  CONSTRAINT `branch_item_rules_ibfk_1` FOREIGN KEY (`itemtype`) REFERENCES `itemtypes` (`itemtype`)
323
  CONSTRAINT `branch_item_rules_ibfk_1` FOREIGN KEY (`itemtype`) REFERENCES `itemtypes` (`itemtype`)
Lines 497-502 CREATE TABLE `default_branch_circ_rules` ( Link Here
497
  `branchcode` VARCHAR(10) NOT NULL,
498
  `branchcode` VARCHAR(10) NOT NULL,
498
  `maxissueqty` int(4) default NULL,
499
  `maxissueqty` int(4) default NULL,
499
  `holdallowed` tinyint(1) default NULL,
500
  `holdallowed` tinyint(1) default NULL,
501
  `returnbranch` varchar(15) default NULL,
500
  PRIMARY KEY (`branchcode`),
502
  PRIMARY KEY (`branchcode`),
501
  CONSTRAINT `default_branch_circ_rules_ibfk_1` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`)
503
  CONSTRAINT `default_branch_circ_rules_ibfk_1` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`)
502
    ON DELETE CASCADE ON UPDATE CASCADE
504
    ON DELETE CASCADE ON UPDATE CASCADE
Lines 509-514 DROP TABLE IF EXISTS `default_branch_item_rules`; Link Here
509
CREATE TABLE `default_branch_item_rules` (
511
CREATE TABLE `default_branch_item_rules` (
510
  `itemtype` varchar(10) NOT NULL,
512
  `itemtype` varchar(10) NOT NULL,
511
  `holdallowed` tinyint(1) default NULL,
513
  `holdallowed` tinyint(1) default NULL,
514
  `returnbranch` varchar(15) default NULL,
512
  PRIMARY KEY  (`itemtype`),
515
  PRIMARY KEY  (`itemtype`),
513
  CONSTRAINT `default_branch_item_rules_ibfk_1` FOREIGN KEY (`itemtype`) REFERENCES `itemtypes` (`itemtype`)
516
  CONSTRAINT `default_branch_item_rules_ibfk_1` FOREIGN KEY (`itemtype`) REFERENCES `itemtypes` (`itemtype`)
514
    ON DELETE CASCADE ON UPDATE CASCADE
517
    ON DELETE CASCADE ON UPDATE CASCADE
Lines 523-528 CREATE TABLE `default_circ_rules` ( Link Here
523
    `singleton` enum('singleton') NOT NULL default 'singleton',
526
    `singleton` enum('singleton') NOT NULL default 'singleton',
524
    `maxissueqty` int(4) default NULL,
527
    `maxissueqty` int(4) default NULL,
525
    `holdallowed` int(1) default NULL,
528
    `holdallowed` int(1) default NULL,
529
    `returnbranch` varchar(15) default NULL,
526
    PRIMARY KEY (`singleton`)
530
    PRIMARY KEY (`singleton`)
527
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
531
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
528
532
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt (-1 / +44 lines)
Lines 192-197 for="tobranch"><strong>Clone these rules to:</strong></label> <input type="hidde Link Here
192
                    <th>&nbsp;</th>
192
                    <th>&nbsp;</th>
193
                    <th>Total Current Checkouts Allowed</th>
193
                    <th>Total Current Checkouts Allowed</th>
194
                    <th>Hold Policy</th>
194
                    <th>Hold Policy</th>
195
                    <th>Return Policy</th>
195
                    <th>&nbsp;</th>
196
                    <th>&nbsp;</th>
196
                    <th>&nbsp;</th>
197
                    <th>&nbsp;</th>
197
                </tr>
198
                </tr>
Lines 223-228 for="tobranch"><strong>Clone these rules to:</strong></label> <input type="hidde Link Here
223
                            </option>
224
                            </option>
224
                        </select>
225
                        </select>
225
                    </td>
226
                    </td>
227
                    <td>
228
                        <select name="returnbranch">
229
                            [% IF ( default_returnbranch == 'homebranch' ) %]
230
                            <option value="homebranch" selected="selected">
231
                            [% ELSE %]
232
                            <option value="homebranch">
233
                            [% END %]
234
                                Item Returns Home
235
                            </option>
236
                            [% IF ( default_returnbranch == 'holdingbranch' ) %]
237
                            <option value="holdingbranch" selected="selected">
238
                            [% ELSE %]
239
                            <option value="holdingbranch">
240
                            [% END %]
241
                                Item Returns to Issuing Branch
242
                            </option>
243
                            [% IF ( default_returnbranch == 'noreturn' ) %]
244
                            <option value="noreturn" selected="selected">
245
                            [% ELSE %]
246
                            <option value="noreturn">
247
                            [% END %]
248
                                Item Floats
249
                            </option>
250
                        </select>
251
                    </td>
226
                    <td><input type="submit" value="Save" class="submit" /></td>
252
                    <td><input type="submit" value="Save" class="submit" /></td>
227
                    <td>
253
                    <td>
228
                        <a class="button" href="/cgi-bin/koha/admin/smart-rules.pl?op=delete-branch-cat&amp;categorycode=*&amp;branch=[% current_branch %]">Unset</a>
254
                        <a class="button" href="/cgi-bin/koha/admin/smart-rules.pl?op=delete-branch-cat&amp;categorycode=*&amp;branch=[% current_branch %]">Unset</a>
Lines 316-321 for="tobranch"><strong>Clone these rules to:</strong></label> <input type="hidde Link Here
316
                <tr>
342
                <tr>
317
                    <th>Item Type</th>
343
                    <th>Item Type</th>
318
                    <th>Hold Policy</th>
344
                    <th>Hold Policy</th>
345
                    <th>Return Policy</th>
319
                    <th>&nbsp;</th>
346
                    <th>&nbsp;</th>
320
                </tr>
347
                </tr>
321
                [% FOREACH branch_item_rule_loo IN branch_item_rule_loop %]
348
                [% FOREACH branch_item_rule_loo IN branch_item_rule_loop %]
Lines 338-343 for="tobranch"><strong>Clone these rules to:</strong></label> <input type="hidde Link Here
338
                                No Holds Allowed
365
                                No Holds Allowed
339
                            [% END %]
366
                            [% END %]
340
                        </td>
367
                        </td>
368
                        <td>[% IF ( branch_item_rule_loo.returnbranch == 'homebranch' ) %]
369
                                Item Returns Home
370
                            [% ELSIF ( branch_item_rule_loo.returnbranch == 'holdingbranch' ) %]
371
                                Item Returns to Issuing Branch
372
                            [% ELSIF ( branch_item_rule_loo.returnbranch == 'noreturn' ) %]
373
                                Item Floats
374
                            [% ELSE %]
375
                                Error - unknown option
376
                            [% END %]
377
                        </td>
341
                        <td>
378
                        <td>
342
                            <a class="button" href="/cgi-bin/koha/admin/smart-rules.pl?op=delete-branch-item&amp;itemtype=[% branch_item_rule_loo.itemtype %]&amp;branch=[% current_branch %]">Delete</a>
379
                            <a class="button" href="/cgi-bin/koha/admin/smart-rules.pl?op=delete-branch-item&amp;itemtype=[% branch_item_rule_loo.itemtype %]&amp;branch=[% current_branch %]">Delete</a>
343
                        </td>
380
                        </td>
Lines 358-363 for="tobranch"><strong>Clone these rules to:</strong></label> <input type="hidde Link Here
358
                            <option value="0">No Holds Allowed</option>
395
                            <option value="0">No Holds Allowed</option>
359
                        </select>
396
                        </select>
360
                    </td>
397
                    </td>
398
                    <td>
399
                        <select name="returnbranch">
400
                            <option value="homebranch">Item Returns Home</option>
401
                            <option value="holdingbranch">Item Returns to Issuing Branch</option>
402
                            <option value="noreturn">Item Floats</option>
403
                        </select>
404
                    </td>
361
                    <td><input type="submit" value="Add" class="submit" /></td>
405
                    <td><input type="submit" value="Add" class="submit" /></td>
362
                </tr>
406
                </tr>
363
            </table>
407
            </table>
364
- 

Return to bug 7144