szollosil 1 rok pred
rodič
commit
fc405a7f34

+ 12 - 1
custom/bbus/class/apiproductlisthelper.class.php

@@ -101,6 +101,7 @@ class ApiProductListHelper
 				if (!$ids_only) {
 					$product_static = new ApiProductListProduct($this->db);
 					if ($product_static->fetch($obj->rowid)) {
+                        $product_static->isEvent = $this->checkIsEvent($product_static->array_options['options_basic_service']);
 						if ($includestockdata && DolibarrApiAccess::$user->rights->stock->lire) {
 							$product_static->load_stock();
 
@@ -153,7 +154,17 @@ class ApiProductListHelper
         return $obj_ret;
     }
 
-	
+	private function checkIsEvent($basic_service){
+		$sql = "SELECT is_event FROM llx_bbus_basicservices WHERE rowid = {$basic_service}";
+		$result = $this->db->query($sql);
+		if($this->db->num_rows($result) > 0){
+			while($row = $this->db->fetch_object($result)){
+				return $row->is_event;
+			}
+		}
+		return false;
+	}
+
 	private function checkAvailableSpaces($product_id){
 		global $conf;
 		$bookingApi = new BookingApi($this->db);