|
@@ -101,6 +101,7 @@ class ApiProductListHelper
|
|
|
if (!$ids_only) {
|
|
if (!$ids_only) {
|
|
|
$product_static = new ApiProductListProduct($this->db);
|
|
$product_static = new ApiProductListProduct($this->db);
|
|
|
if ($product_static->fetch($obj->rowid)) {
|
|
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) {
|
|
if ($includestockdata && DolibarrApiAccess::$user->rights->stock->lire) {
|
|
|
$product_static->load_stock();
|
|
$product_static->load_stock();
|
|
|
|
|
|
|
@@ -153,7 +154,17 @@ class ApiProductListHelper
|
|
|
return $obj_ret;
|
|
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){
|
|
private function checkAvailableSpaces($product_id){
|
|
|
global $conf;
|
|
global $conf;
|
|
|
$bookingApi = new BookingApi($this->db);
|
|
$bookingApi = new BookingApi($this->db);
|