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

(-)a/C4/Circulation.pm (-13 / +21 lines)
Lines 1351-1363 sub GetBranchBorrowerCircRule { Link Here
1351
Retrieves circulation rule attributes that apply to the given
1351
Retrieves circulation rule attributes that apply to the given
1352
branch and item type, regardless of patron category.
1352
branch and item type, regardless of patron category.
1353
1353
1354
The return value is a hashref containing the following key:
1354
The return value is a hashref containing the following keys:
1355
1355
1356
holdallowed => Hold policy for this branch and itemtype. Possible values:
1356
holdallowed => Hold policy for this branch and itemtype. Possible values:
1357
  0: No holds allowed.
1357
  0: No holds allowed.
1358
  1: Holds allowed only by patrons that have the same homebranch as the item.
1358
  1: Holds allowed only by patrons that have the same homebranch as the item.
1359
  2: Holds allowed from any patron.
1359
  2: Holds allowed from any patron.
1360
1360
1361
returnbranch => branch to which to return item.  Possible values:
1362
  noreturn: do not return, let item remain where checked in (floating collections)
1363
  homebranch: return to item's home branch
1364
1361
This searches branchitemrules in the following order:
1365
This searches branchitemrules in the following order:
1362
1366
1363
  * Same branchcode and itemtype
1367
  * Same branchcode and itemtype
Lines 1365-1371 This searches branchitemrules in the following order: Link Here
1365
  * branchcode '*', same itemtype
1369
  * branchcode '*', same itemtype
1366
  * branchcode and itemtype '*'
1370
  * branchcode and itemtype '*'
1367
1371
1368
Neither C<$branchcode> nor C<$categorycode> should be '*'.
1372
Neither C<$branchcode> nor C<$itemtype> should be '*'.
1369
1373
1370
=cut
1374
=cut
1371
1375
Lines 1375-1407 sub GetBranchItemRule { Link Here
1375
    my $result = {};
1379
    my $result = {};
1376
1380
1377
    my @attempts = (
1381
    my @attempts = (
1378
        ['SELECT holdallowed
1382
        ['SELECT holdallowed, returnbranch
1379
            FROM branch_item_rules
1383
            FROM branch_item_rules
1380
            WHERE branchcode = ?
1384
            WHERE branchcode = ?
1381
              AND itemtype = ?', $branchcode, $itemtype],
1385
              AND itemtype = ?', $branchcode, $itemtype],
1382
        ['SELECT holdallowed
1386
        ['SELECT holdallowed, returnbranch
1383
            FROM default_branch_circ_rules
1387
            FROM default_branch_circ_rules
1384
            WHERE branchcode = ?', $branchcode],
1388
            WHERE branchcode = ?', $branchcode],
1385
        ['SELECT holdallowed
1389
        ['SELECT holdallowed, returnbranch
1386
            FROM default_branch_item_rules
1390
            FROM default_branch_item_rules
1387
            WHERE itemtype = ?', $itemtype],
1391
            WHERE itemtype = ?', $itemtype],
1388
        ['SELECT holdallowed
1392
        ['SELECT holdallowed, returnbranch
1389
            FROM default_circ_rules'],
1393
            FROM default_circ_rules'],
1390
    );
1394
    );
1391
1395
1392
    foreach my $attempt (@attempts) {
1396
    foreach my $attempt (@attempts) {
1393
        my ($query, @bind_params) = @{$attempt};
1397
        my ($query, @bind_params) = @{$attempt};
1398
        my $search_result = $dbh->selectrow_hashref ( $query , {}, @bind_params );
1394
1399
1395
        # Since branch/category and branch/itemtype use the same per-branch
1400
        # Since branch/category and branch/itemtype use the same per-branch
1396
        # defaults tables, we have to check that the key we want is set, not
1401
        # defaults tables, we have to check that the key we want is set, not
1397
        # just that a row was returned
1402
        # just that a row was returned
1398
        return $result if ( defined( $result->{'holdallowed'} = $dbh->selectrow_array( $query, {}, @bind_params ) ) );
1403
        $result->{'holdallowed'}  = $search_result->{'holdallowed'}  unless ( defined $result->{'holdallowed'} );
1404
        $result->{'returnbranch'} = $search_result->{'returnbranch'} unless ( defined $result->{'returnbranch'} );
1399
    }
1405
    }
1400
    
1406
    
1401
    # built-in default circulation rule
1407
    # built-in default circulation rule
1402
    return {
1408
    $result->{'holdallowed'} = 2 unless ( defined $result->{'holdallowed'} );
1403
        holdallowed => 2,
1409
    $result->{'returnbranch'} = 'homebranch' unless ( defined $result->{'returnbranch'} );
1404
    };
1410
1411
    return $result;
1405
}
1412
}
1406
1413
1407
=head2 AddReturn
1414
=head2 AddReturn
Lines 1518-1526 sub AddReturn { Link Here
1518
    my $item = GetItem($itemnumber) or die "GetItem($itemnumber) failed";
1525
    my $item = GetItem($itemnumber) or die "GetItem($itemnumber) failed";
1519
        # full item data, but no borrowernumber or checkout info (no issue)
1526
        # full item data, but no borrowernumber or checkout info (no issue)
1520
        # we know GetItem should work because GetItemnumberFromBarcode worked
1527
        # we know GetItem should work because GetItemnumberFromBarcode worked
1521
    my $hbr      = C4::Context->preference("HomeOrHoldingBranchReturn") || "homebranch";
1528
    my $hbr      = GetBranchItemRule($item->{'homebranch'}, $item->{'itype'})->{'returnbranch'} || "homebranch";
1522
    $hbr = $item->{$hbr} || '';
1529
        # get the proper branch to which to return the item
1523
        # item must be from items table -- issues table has branchcode and issuingbranch, not homebranch nor holdingbranch
1530
    $hbr = $item->{$hbr} || $branch ;
1531
        # if $hbr was "noreturn" or any other non-item table value, then it should 'float' (i.e. stay at this branch)
1524
1532
1525
    my $borrowernumber = $borrower->{'borrowernumber'} || undef;    # we don't know if we had a borrower or not
1533
    my $borrowernumber = $borrower->{'borrowernumber'} || undef;    # we don't know if we had a borrower or not
1526
1534
(-)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