@@ -576,7 +576,7 @@ discard block |
||
576 | 576 | return $this->LibStatut($this->status, $mode); |
577 | 577 | } |
578 | 578 | |
579 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
579 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
580 | 580 | /** |
581 | 581 | * Return the status |
582 | 582 | * |
@@ -587,7 +587,7 @@ discard block |
||
587 | 587 | */ |
588 | 588 | public function LibStatut($status, $mode = 0) |
589 | 589 | { |
590 | - // phpcs:enable |
|
590 | + // phpcs:enable |
|
591 | 591 | global $langs; |
592 | 592 | |
593 | 593 | if (empty($this->labelStatus) || empty($this->labelStatusShort)) { |
@@ -295,7 +295,7 @@ discard block |
||
295 | 295 | ); |
296 | 296 | } |
297 | 297 | |
298 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore |
|
298 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore |
|
299 | 299 | /** |
300 | 300 | * Clean sensible object datas |
301 | 301 | * |
@@ -304,30 +304,30 @@ discard block |
||
304 | 304 | */ |
305 | 305 | public function _cleanObjectDatas($object) |
306 | 306 | { |
307 | - // phpcs:disable |
|
308 | - $object = parent::_cleanObjectDatas($object); |
|
309 | - |
|
310 | - return $object; |
|
311 | - } |
|
312 | - |
|
313 | - /** |
|
314 | - * Validate fields before create or update object |
|
315 | - * |
|
316 | - * @param array $data Array of data to validate |
|
317 | - * @param array $fields Array of fields needed |
|
318 | - * @return array |
|
319 | - * |
|
320 | - * @throws RestException |
|
321 | - */ |
|
322 | - private function validate($data, $fields) |
|
323 | - { |
|
324 | - $hook = array(); |
|
325 | - foreach ($fields as $field) { |
|
326 | - if (!isset($data[$field])) { |
|
327 | - throw new RestException(400, $field." field missing"); |
|
328 | - } |
|
329 | - $hook[$field] = $data[$field]; |
|
330 | - } |
|
331 | - return $hook; |
|
332 | - } |
|
307 | + // phpcs:disable |
|
308 | + $object = parent::_cleanObjectDatas($object); |
|
309 | + |
|
310 | + return $object; |
|
311 | + } |
|
312 | + |
|
313 | + /** |
|
314 | + * Validate fields before create or update object |
|
315 | + * |
|
316 | + * @param array $data Array of data to validate |
|
317 | + * @param array $fields Array of fields needed |
|
318 | + * @return array |
|
319 | + * |
|
320 | + * @throws RestException |
|
321 | + */ |
|
322 | + private function validate($data, $fields) |
|
323 | + { |
|
324 | + $hook = array(); |
|
325 | + foreach ($fields as $field) { |
|
326 | + if (!isset($data[$field])) { |
|
327 | + throw new RestException(400, $field." field missing"); |
|
328 | + } |
|
329 | + $hook[$field] = $data[$field]; |
|
330 | + } |
|
331 | + return $hook; |
|
332 | + } |
|
333 | 333 | } |
@@ -324,7 +324,7 @@ |
||
324 | 324 | $hook = array(); |
325 | 325 | foreach ($fields as $field) { |
326 | 326 | if (!isset($data[$field])) { |
327 | - throw new RestException(400, $field." field missing"); |
|
327 | + throw new RestException(400, $field . " field missing"); |
|
328 | 328 | } |
329 | 329 | $hook[$field] = $data[$field]; |
330 | 330 | } |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | return $object; |
82 | 82 | } |
83 | 83 | |
84 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
84 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
85 | 85 | /** |
86 | 86 | * Set content of ->tpl array, to use into template |
87 | 87 | * |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | */ |
92 | 92 | public function assign_values(&$action, $id) |
93 | 93 | { |
94 | - // phpcs:enable |
|
94 | + // phpcs:enable |
|
95 | 95 | global $conf, $langs, $user, $canvas; |
96 | 96 | global $form, $formcompany, $objsoc; |
97 | 97 | |
@@ -275,7 +275,7 @@ discard block |
||
275 | 275 | } |
276 | 276 | } |
277 | 277 | |
278 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
278 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
279 | 279 | /** |
280 | 280 | * Assign POST values into object |
281 | 281 | * |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | */ |
284 | 284 | private function assign_post() |
285 | 285 | { |
286 | - // phpcs:enable |
|
286 | + // phpcs:enable |
|
287 | 287 | global $langs, $mysoc; |
288 | 288 | |
289 | 289 | $this->object->socid = GETPOSTINT("socid"); |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | return $out; |
75 | 75 | } |
76 | 76 | |
77 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
77 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
78 | 78 | /** |
79 | 79 | * Assign custom values for canvas |
80 | 80 | * |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | */ |
85 | 85 | public function assign_values(&$action, $id) |
86 | 86 | { |
87 | - // phpcs:enable |
|
87 | + // phpcs:enable |
|
88 | 88 | global $conf, $db, $langs, $user; |
89 | 89 | global $form; |
90 | 90 |
@@ -826,7 +826,7 @@ discard block |
||
826 | 826 | return $this->LibStatut($this->status, $mode); |
827 | 827 | } |
828 | 828 | |
829 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
829 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
830 | 830 | /** |
831 | 831 | * Return the label of a given status |
832 | 832 | * |
@@ -836,7 +836,7 @@ discard block |
||
836 | 836 | */ |
837 | 837 | public function LibStatut($status, $mode = 0) |
838 | 838 | { |
839 | - // phpcs:enable |
|
839 | + // phpcs:enable |
|
840 | 840 | global $langs; |
841 | 841 | |
842 | 842 | if (empty($this->labelStatus) || empty($this->labelStatusShort)) { |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | */ |
70 | 70 | public $fk_website; |
71 | 71 | |
72 | - public $fk_page; // If translation of another page |
|
72 | + public $fk_page; // If translation of another page |
|
73 | 73 | |
74 | 74 | public $pageurl; |
75 | 75 | public $aliasalt; |
@@ -134,8 +134,8 @@ discard block |
||
134 | 134 | */ |
135 | 135 | public $fk_object; |
136 | 136 | |
137 | - const STATUS_DRAFT = 0; // offline |
|
138 | - const STATUS_VALIDATED = 1; // online |
|
137 | + const STATUS_DRAFT = 0; // offline |
|
138 | + const STATUS_VALIDATED = 1; // online |
|
139 | 139 | |
140 | 140 | |
141 | 141 | /** |
@@ -339,7 +339,7 @@ discard block |
||
339 | 339 | return $this->_cleanObjectDatas($multicurrency); |
340 | 340 | } |
341 | 341 | |
342 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore |
|
342 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore |
|
343 | 343 | /** |
344 | 344 | * Clean sensible object datas |
345 | 345 | * |
@@ -348,7 +348,7 @@ discard block |
||
348 | 348 | */ |
349 | 349 | protected function _cleanObjectDatas($object) |
350 | 350 | { |
351 | - // phpcs:enable |
|
351 | + // phpcs:enable |
|
352 | 352 | $object = parent::_cleanObjectDatas($object); |
353 | 353 | |
354 | 354 | // Clear all fields out of interest |
@@ -365,7 +365,7 @@ discard block |
||
365 | 365 | return $object; |
366 | 366 | } |
367 | 367 | |
368 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore |
|
368 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore |
|
369 | 369 | /** |
370 | 370 | * Clean sensible MultiCurrencyRate object datas |
371 | 371 | * |
@@ -374,7 +374,7 @@ discard block |
||
374 | 374 | */ |
375 | 375 | protected function _cleanObjectDatasRate($object) |
376 | 376 | { |
377 | - // phpcs:enable |
|
377 | + // phpcs:enable |
|
378 | 378 | $object = parent::_cleanObjectDatas($object); |
379 | 379 | |
380 | 380 | // Clear all fields out of interest |
@@ -235,10 +235,10 @@ |
||
235 | 235 | $id = $ecmdirtmp->create($user); |
236 | 236 | if ($id > 0) { |
237 | 237 | $newdirsql = array('id' => $id, |
238 | - 'id_mere' => $ecmdirtmp->fk_parent, |
|
239 | - 'label' => $ecmdirtmp->label, |
|
240 | - 'description' => $ecmdirtmp->description, |
|
241 | - 'fullrelativename' => $relativepathmissing); |
|
238 | + 'id_mere' => $ecmdirtmp->fk_parent, |
|
239 | + 'label' => $ecmdirtmp->label, |
|
240 | + 'description' => $ecmdirtmp->description, |
|
241 | + 'fullrelativename' => $relativepathmissing); |
|
242 | 242 | $sqltree[] = $newdirsql; // We complete fulltree for following loops |
243 | 243 | //var_dump($sqltree); |
244 | 244 | $adirwascreated = 1; |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | if (empty($action) && $file_manager) { |
54 | 54 | $action = 'file_manager'; |
55 | 55 | } |
56 | -$pageid = GETPOSTINT('pageid'); |
|
56 | +$pageid = GETPOSTINT('pageid'); |
|
57 | 57 | |
58 | 58 | $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; |
59 | 59 | $sortfield = GETPOST('sortfield', 'aZ09comma'); |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | if ($sortorder) { |
120 | 120 | $backtopage .= '&sortorder=' . urlencode($sortorder); |
121 | 121 | } |
122 | -include DOL_DOCUMENT_ROOT . '/core/actions_linkedfiles.inc.php'; // This manage 'sendit', 'confirm_deletefile', 'renamefile' action when submitting new file. |
|
122 | +include DOL_DOCUMENT_ROOT . '/core/actions_linkedfiles.inc.php'; // This manage 'sendit', 'confirm_deletefile', 'renamefile' action when submitting new file. |
|
123 | 123 | |
124 | 124 | $backtopage = $savbacktopage; |
125 | 125 |
@@ -952,7 +952,7 @@ discard block |
||
952 | 952 | return $this->LibStatut($this->status, $mode); |
953 | 953 | } |
954 | 954 | |
955 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
955 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
956 | 956 | /** |
957 | 957 | * Return the status |
958 | 958 | * |
@@ -962,7 +962,7 @@ discard block |
||
962 | 962 | */ |
963 | 963 | public static function LibStatut($status, $mode = 0) |
964 | 964 | { |
965 | - // phpcs:enable |
|
965 | + // phpcs:enable |
|
966 | 966 | global $langs; |
967 | 967 | return ''; |
968 | 968 | } |
@@ -163,16 +163,16 @@ |
||
163 | 163 | 'label' => array('type' => 'varchar(128)', 'label' => 'Label', 'enabled' => 1, 'position' => 30, 'notnull' => 0, 'visible' => -1, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'help' => "Help text", 'showoncombobox' => 2, 'validate' => 1, 'comment' => "contains hash of file content"), |
164 | 164 | 'share' => array('type' => 'varchar(128)', 'label' => 'Share', 'enabled' => 1, 'position' => 40, 'notnull' => 0, 'visible' => -1, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'help' => "Help text", 'showoncombobox' => 2, 'validate' => 1, 'comment' => "contains hash for file sharing"), |
165 | 165 | 'entity' => array('type' => 'integer', 'label' => 'Entity', 'default' => '1', 'enabled' => 1, 'visible' => -2, 'notnull' => -1, 'position' => 50, 'index' => 1), |
166 | - 'filepath' => array('type' => 'varchar(255)', 'label' => 'FilePath', 'enabled' => 1, 'position' => 60, 'notnull' => 0, 'visible' => 0, 'searchall' => 0, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'help' => "Help text", 'showoncombobox' => 2, 'validate' => 1,'comment' => "relative to dolibarr document dir. Example module/def"), |
|
167 | - 'filename' => array('type' => 'varchar(255)', 'label' => 'FileName', 'enabled' => 1, 'position' => 70, 'notnull' => 0, 'visible' => 1, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'help' => "Help text", 'showoncombobox' => 2, 'validate' => 1,'comment' => "file name only without any directory"), |
|
168 | - 'src_object_type' => array('type' => 'varchar(64)', 'label' => 'SourceType', 'enabled' => 1, 'position' => 80, 'notnull' => 0, 'visible' => 0, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'help' => "Help text", 'showoncombobox' => 2, 'validate' => 1,'comment' => "Source object type ('proposal', 'invoice', ...)"), |
|
166 | + 'filepath' => array('type' => 'varchar(255)', 'label' => 'FilePath', 'enabled' => 1, 'position' => 60, 'notnull' => 0, 'visible' => 0, 'searchall' => 0, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'help' => "Help text", 'showoncombobox' => 2, 'validate' => 1, 'comment' => "relative to dolibarr document dir. Example module/def"), |
|
167 | + 'filename' => array('type' => 'varchar(255)', 'label' => 'FileName', 'enabled' => 1, 'position' => 70, 'notnull' => 0, 'visible' => 1, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'help' => "Help text", 'showoncombobox' => 2, 'validate' => 1, 'comment' => "file name only without any directory"), |
|
168 | + 'src_object_type' => array('type' => 'varchar(64)', 'label' => 'SourceType', 'enabled' => 1, 'position' => 80, 'notnull' => 0, 'visible' => 0, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'help' => "Help text", 'showoncombobox' => 2, 'validate' => 1, 'comment' => "Source object type ('proposal', 'invoice', ...)"), |
|
169 | 169 | 'src_object_id' => array('type' => 'integer', 'label' => 'SourceID', 'default' => '1', 'enabled' => 1, 'visible' => 0, 'notnull' => 1, 'position' => 90, 'index' => 1, 'comment' => "Source object id"), |
170 | - 'fullpath_orig' => array('type' => 'varchar(750)', 'label' => 'FullPathOrig', 'enabled' => 1, 'position' => 100, 'notnull' => 0, 'visible' => 0, 'searchall' => 0, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'help' => "Help text", 'showoncombobox' => 2, 'validate' => 1,'comment' => "full path of original filename, when file is uploaded from a local computer"), |
|
170 | + 'fullpath_orig' => array('type' => 'varchar(750)', 'label' => 'FullPathOrig', 'enabled' => 1, 'position' => 100, 'notnull' => 0, 'visible' => 0, 'searchall' => 0, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'help' => "Help text", 'showoncombobox' => 2, 'validate' => 1, 'comment' => "full path of original filename, when file is uploaded from a local computer"), |
|
171 | 171 | 'description' => array('type' => 'text', 'label' => 'Description', 'enabled' => 1, 'visible' => 0, 'position' => 110), |
172 | - 'keywords' => array('type' => 'varchar(750)', 'label' => 'Keywords', 'enabled' => 1, 'position' => 120, 'notnull' => 0, 'visible' => 1, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'help' => "Help text", 'showoncombobox' => 2, 'validate' => 1,'comment' => "list of keywords, separated with comma. Must be limited to most important keywords."), |
|
172 | + 'keywords' => array('type' => 'varchar(750)', 'label' => 'Keywords', 'enabled' => 1, 'position' => 120, 'notnull' => 0, 'visible' => 1, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'help' => "Help text", 'showoncombobox' => 2, 'validate' => 1, 'comment' => "list of keywords, separated with comma. Must be limited to most important keywords."), |
|
173 | 173 | 'cover' => array('type' => 'text', 'label' => 'Cover', 'enabled' => 1, 'visible' => 0, 'position' => 130, 'comment' => "is this file a file to use for a cover"), |
174 | 174 | 'position' => array('type' => 'integer', 'label' => 'Position', 'default' => '1', 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 140, 'index' => 1, 'comment' => "position of file among others"), |
175 | - 'gen_or_uploaded' => array('type' => 'varchar(12)', 'label' => 'GenOrUpload', 'enabled' => 1, 'position' => 150, 'notnull' => 0, 'visible' => -1, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'help' => "Help text", 'showoncombobox' => 2, 'validate' => 1,'comment' => "'generated' or 'uploaded'"), |
|
175 | + 'gen_or_uploaded' => array('type' => 'varchar(12)', 'label' => 'GenOrUpload', 'enabled' => 1, 'position' => 150, 'notnull' => 0, 'visible' => -1, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'help' => "Help text", 'showoncombobox' => 2, 'validate' => 1, 'comment' => "'generated' or 'uploaded'"), |
|
176 | 176 | 'extraparams' => array('type' => 'varchar(255)', 'label' => 'ExtraParams', 'enabled' => 1, 'position' => 160, 'notnull' => 0, 'visible' => 1, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'help' => "Help text", 'showoncombobox' => 2, 'validate' => 1, 'comment' => "for stocking other parameters with json format"), |
177 | 177 | 'date_c' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => 1, 'visible' => -1, 'position' => 170), |
178 | 178 | 'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 175), |
@@ -558,7 +558,7 @@ discard block |
||
558 | 558 | return $ret; |
559 | 559 | } |
560 | 560 | |
561 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
561 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
562 | 562 | /** |
563 | 563 | * Load this->motherof that is array(id_son=>id_parent, ...) |
564 | 564 | * |
@@ -566,7 +566,7 @@ discard block |
||
566 | 566 | */ |
567 | 567 | public function load_motherof() |
568 | 568 | { |
569 | - // phpcs:enable |
|
569 | + // phpcs:enable |
|
570 | 570 | global $conf; |
571 | 571 | |
572 | 572 | $this->motherof = array(); |
@@ -603,7 +603,7 @@ discard block |
||
603 | 603 | return $this->LibStatut($this->status, $mode); |
604 | 604 | } |
605 | 605 | |
606 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
606 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
607 | 607 | /** |
608 | 608 | * Return the status |
609 | 609 | * |
@@ -613,13 +613,13 @@ discard block |
||
613 | 613 | */ |
614 | 614 | public static function LibStatut($status, $mode = 0) |
615 | 615 | { |
616 | - // phpcs:enable |
|
616 | + // phpcs:enable |
|
617 | 617 | global $langs; |
618 | 618 | return ''; |
619 | 619 | } |
620 | 620 | |
621 | 621 | |
622 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
622 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
623 | 623 | /** |
624 | 624 | * Reconstruit l'arborescence des categories sous la forme d'un tableau à partir de la base de donnée |
625 | 625 | * Renvoi un tableau de tableau('id','id_mere',...) trie selon arbre et avec: |
@@ -641,7 +641,7 @@ discard block |
||
641 | 641 | */ |
642 | 642 | public function get_full_arbo($force = 0) |
643 | 643 | { |
644 | - // phpcs:enable |
|
644 | + // phpcs:enable |
|
645 | 645 | global $conf; |
646 | 646 | |
647 | 647 | if (empty($force) && !empty($this->full_arbo_loaded)) { |
@@ -789,7 +789,7 @@ discard block |
||
789 | 789 | } |
790 | 790 | } |
791 | 791 | |
792 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
792 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
793 | 793 | /** |
794 | 794 | * Call trigger based on this instance. |
795 | 795 | * We implement it here because this class doe not extend CommonObject. |
@@ -804,7 +804,7 @@ discard block |
||
804 | 804 | */ |
805 | 805 | public function call_trigger($triggerName, $user) |
806 | 806 | { |
807 | - // phpcs:enable |
|
807 | + // phpcs:enable |
|
808 | 808 | global $langs, $conf; |
809 | 809 | |
810 | 810 | include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; |