1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
store_docs_barcode.php
См. документацию.
1<?php
2
4
6
8{
9 protected static function checkFields($action, &$arFields)
10 {
11 if ((($action == 'ADD') || is_set($arFields, "BARCODE")) && ($arFields["BARCODE"] == ''))
12 {
13 $GLOBALS["APPLICATION"]->ThrowException(GetMessage("CP_EMPTY_BARCODE"));
14 return false;
15 }
16
17 return true;
18 }
19
20 public static function update($id, $arFields)
21 {
22 $id=intval($id);
23
24 foreach(GetModuleEvents("catalog", "OnBeforeCatalogStoreDocsBarcodeUpdate", true) as $arEvent)
25 if(ExecuteModuleEventEx($arEvent, array($id, &$arFields)) === false)
26 return false;
27
28 if($id < 0 || !self::checkFields('UPDATE', $arFields))
29 return false;
30 global $DB;
31 $strUpdate = $DB->PrepareUpdate("b_catalog_docs_barcode", $arFields);
32 $strSql = "UPDATE b_catalog_docs_barcode SET ".$strUpdate." WHERE ID = ".$id;
33 if(!$DB->Query($strSql, true))
34 return false;
35
36 foreach(GetModuleEvents("catalog", "OnStoreDocsBarcodeUpdate", true) as $arEvent)
37 ExecuteModuleEventEx($arEvent, array($id, $arFields));
38 return true;
39 }
40
41 public static function delete($id)
42 {
43 global $DB;
44 $id = intval($id);
45 if ($id > 0)
46 {
47 foreach(GetModuleEvents("catalog", "OnBeforeCatalogStoreDocsBarcodeDelete", true) as $arEvent)
48 if(ExecuteModuleEventEx($arEvent, array($id)) === false)
49 return false;
50
51 $DB->Query("DELETE FROM b_catalog_docs_barcode WHERE ID = ".$id." ", true);
52
53 foreach (GetModuleEvents("catalog", "OnCatalogStoreDocsBarcodeDelete", true) as $arEvent)
54 ExecuteModuleEventEx($arEvent, array($id));
55 return true;
56 }
57 return false;
58 }
59
67 public static function OnBeforeDocumentDelete($id): bool
68 {
69 $id = (int)$id;
71
72 foreach(GetModuleEvents('catalog', 'OnDocumentBarcodeDelete', true) as $arEvent)
73 {
74 ExecuteModuleEventEx($arEvent, [$id]);
75 }
76
77 return true;
78 }
79}
static update($id, $arFields)
Определения store_docs_barcode.php:20
static checkFields($action, &$arFields)
Определения store_docs_barcode.php:9
static OnBeforeDocumentDelete($id)
Определения store_docs_barcode.php:67
$arFields
Определения dblapprove.php:5
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
global $DB
Определения cron_frame.php:29
ExecuteModuleEventEx($arEvent, $arParams=[])
Определения tools.php:5214
GetModuleEvents($MODULE_ID, $MESSAGE_ID, $bReturnArray=false)
Определения tools.php:5177
IncludeModuleLangFile($filepath, $lang=false, $bReturnArray=false)
Определения tools.php:3778
is_set($a, $k=false)
Определения tools.php:2133
GetMessage($name, $aReplace=null)
Определения tools.php:3397
$GLOBALS['____1690880296']
Определения license.php:1
$action
Определения file_dialog.php:21