[Koha-bugs] [Bug 22833] Block suspend and cancel on holds

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Wed Feb 12 09:44:44 CET 2020


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22833

--- Comment #17 from Stina Hallin <stina.hallin at ub.lu.se> ---
Here's the description of itemtypes:
+---------------------+---------------+------+-----+---------+-------+
| Field               | Type          | Null | Key | Default | Extra |
+---------------------+---------------+------+-----+---------+-------+
| itemtype            | varchar(10)   | NO   | PRI |         |       |
| description         | longtext      | YES  |     | NULL    |       |
| rentalcharge        | decimal(28,6) | YES  |     | NULL    |       |
| rentalcharge_daily  | decimal(28,6) | YES  |     | NULL    |       |
| rentalcharge_hourly | decimal(28,6) | YES  |     | NULL    |       |
| defaultreplacecost  | decimal(28,6) | YES  |     | NULL    |       |
| processfee          | decimal(28,6) | YES  |     | NULL    |       |
| notforloan          | smallint(6)   | YES  |     | NULL    |       |
| imageurl            | varchar(200)  | YES  |     | NULL    |       |
| summary             | mediumtext    | YES  |     | NULL    |       |
| checkinmsg          | varchar(255)  | YES  |     | NULL    |       |
| checkinmsgtype      | char(16)      | NO   |     | message |       |
| sip_media_type      | varchar(3)    | YES  |     | NULL    |       |
| hideinopac          | tinyint(1)    | NO   |     | 0       |       |
| searchcategory      | varchar(80)   | YES  |     | NULL    |       |
| can_suspend_hold    | tinyint(1)    | NO   |     | 1       |       |
| can_cancel_hold     | tinyint(1)    | NO   |     | 1       |       |
+---------------------+---------------+------+-----+---------+-------+

We discussed it here, and have a suggestion for solution. 
Replace:
my $can_suspend_hold = $input->param('can_suspend_hold');
my $can_cancel_hold  = $input->param('can_cancel_hold');

with:
my $can_suspend_hold = $input->param('can_suspend_hold') // 0;
my $can_cancel_hold  = $input->param('can_cancel_hold') // 0;

And replace:
[% IF ( HOLD.is_cancelable_from_opac ) %]

with:
[% IF ( HOLD.is_cancelable_from_opac && ItemTypes.CanCancelHold(
HOLD.biblio.biblioitem.itemtype )) %]

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list