%PDF- %PDF-
Server IP : 37.220.80.31 / Your IP : 52.15.239.254 Web Server : Apache/2.4.52 (Ubuntu) System : Linux 3051455-guretool.twc1.net 5.15.0-107-generic #117-Ubuntu SMP Fri Apr 26 12:26:49 UTC 2024 x86_64 User : www-root ( 1010) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/www-root/data/www/dev.artlot24.ru/bitrix/modules/sale/general/ |
Upload File : |
<?php IncludeModuleLangFile(__FILE__); class CAllSaleOrderPropsGroup { public static function GetByID($ID) { global $DB; $ID = intval($ID); $strSql = "SELECT * ". "FROM b_sale_order_props_group ". "WHERE ID = ".$ID.""; $db_res = $DB->Query($strSql, false, "File: ".__FILE__."<br>Line: ".__LINE__); if ($res = $db_res->Fetch()) { return $res; } return False; } public static function CheckFields($ACTION, &$arFields, $ID = 0) { global $DB, $USER; if (is_set($arFields, "PERSON_TYPE_ID") && $ACTION!="ADD") UnSet($arFields["PERSON_TYPE_ID"]); if ((is_set($arFields, "PERSON_TYPE_ID") || $ACTION=="ADD") && intval($arFields["PERSON_TYPE_ID"]) <= 0) { $GLOBALS["APPLICATION"]->ThrowException(GetMessage("SKGOPG_EMPTY_PERS_TYPE"), "ERROR_NO_PERSON_TYPE"); return false; } if ((is_set($arFields, "NAME") || $ACTION=="ADD") && $arFields["NAME"] == '') { $GLOBALS["APPLICATION"]->ThrowException(GetMessage("SKGOPG_EMPTY_GROUP"), "ERROR_NO_NAME"); return false; } if (is_set($arFields, "PERSON_TYPE_ID")) { if (!($arPersonType = CSalePersonType::GetByID($arFields["PERSON_TYPE_ID"]))) { $GLOBALS["APPLICATION"]->ThrowException(str_replace("#ID#", $arFields["PERSON_TYPE_ID"], GetMessage("SKGOPG_NO_PERS_TYPE")), "ERROR_NO_PERSON_TYPE"); return false; } } return True; } public static function Update($ID, $arFields) { global $DB; $ID = intval($ID); if (!CSaleOrderPropsGroup::CheckFields("UPDATE", $arFields, $ID)) return false; $strUpdate = $DB->PrepareUpdate("b_sale_order_props_group", $arFields); $strSql = "UPDATE b_sale_order_props_group SET ".$strUpdate." WHERE ID = ".$ID.""; $DB->Query($strSql, false, "File: ".__FILE__."<br>Line: ".__LINE__); return $ID; } public static function Delete($ID) { global $DB; $ID = intval($ID); $db_orderProps = CSaleOrderProps::GetList(($by="PROPS_GROUP_ID"), ($order="ASC"), Array("PROPS_GROUP_ID"=>$ID)); while ($arOrderProps = $db_orderProps->Fetch()) { $DB->Query("DELETE FROM b_sale_order_props_variant WHERE ORDER_PROPS_ID = ".$arOrderProps["ID"]."", true); $DB->Query("UPDATE b_sale_order_props_value SET ORDER_PROPS_ID = NULL WHERE ORDER_PROPS_ID = ".$arOrderProps["ID"]."", true); $DB->Query("DELETE FROM b_sale_order_props_relation WHERE PROPERTY_ID = ".$arOrderProps["ID"]."", true); } $DB->Query("UPDATE b_sale_order_props SET PROPS_GROUP_ID = NULL WHERE PROPS_GROUP_ID = ".$ID."", true); CSaleOrderUserProps::ClearEmpty(); return $DB->Query("DELETE FROM b_sale_order_props_group WHERE ID = ".$ID."", true); } }