From 754261ce56428c2ac3122f184d232f25cb5c4428 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 9484d58cf5..c324d250c9 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)