/** * Get lock fields for a record. * * @param $p_itemtype Table id. * @param $p_items_id Line id. * TODO: check rights * *@return array of locked fields **/ static function getLockFields($p_itemtype, $p_items_id) { global $DB; $db_lock = $DB->fetch_assoc(PluginFusioninventoryLock::getLock($p_itemtype, $p_items_id)); $lock_fields = $db_lock["fields"]; $lock = importArrayFromDB($lock_fields); return $lock; }
/** * Get lock fields for a record. * * @param $p_table Table name. * @param $p_items_id Line id. * TODO: check rights * * @return array of locked fields **/ static function getLockFields($p_table, $p_items_id) { global $DB; $db_lock = $DB->fetch_assoc(PluginFusioninventoryLock::getLock($p_table, $p_items_id)); $lock_fields = $db_lock["tablefields"]; $lock = importArrayFromDB($lock_fields); if ($p_items_id != 0) { $db_lock = $DB->fetch_assoc(PluginFusioninventoryLock::getLock($p_table, 0)); $lock_fields = $db_lock["tablefields"]; $lockItemtype = importArrayFromDB($lock_fields); $lock = array_merge($lock, $lockItemtype); } return $lock; }