From 98697031ab8b33bc570099beb70ed2a28aa20a35 Mon Sep 17 00:00:00 2001 From: nathangray Date: Wed, 24 Mar 2021 15:11:57 -0600 Subject: [PATCH] Resources: Allow 0 quantity & usable --- resources/inc/class.resources_ui.inc.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/resources/inc/class.resources_ui.inc.php b/resources/inc/class.resources_ui.inc.php index 34581bb7f2..8b98eaffea 100755 --- a/resources/inc/class.resources_ui.inc.php +++ b/resources/inc/class.resources_ui.inc.php @@ -517,8 +517,11 @@ class resources_ui $content['picture_original'] = $content['picture_src'] == 'own_src'? 'webdav.php/apps/resources/'.$content['res_id'].'/.picture.jpg': $this->bo->get_picture($content['res_id'],true); - $content['quantity'] = $content['quantity'] ? $content['quantity'] : 1; - $content['useable'] = $content['useable'] ? $content['useable'] : 1; + if(!$content['res_id']) + { + $content['quantity'] = $content['quantity'] ? $content['quantity'] : 1; + $content['useable'] = $content['useable'] ? $content['useable'] : 1; + } $content['accessory_of'] = $content['accessory_of'] ? $content['accessory_of'] : $accessory_of; if($content['res_id'] && $content['accessory_of'] == -1)