@@ -167,17 +167,17 @@ discard block |
||
| 167 | 167 | 'label' => array('type' => 'varchar(128)', 'label' => 'Label', 'enabled' => 1, 'position' => 30, 'notnull' => 0, 'visible' => -1, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'showoncombobox' => 2, 'validate' => 1, 'comment' => "contains hash of file content"), |
| 168 | 168 | 'share' => array('type' => 'varchar(128)', 'label' => 'Share', 'enabled' => 1, 'position' => 40, 'notnull' => 0, 'visible' => -1, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'showoncombobox' => 2, 'validate' => 1, 'comment' => "contains hash for file sharing"), |
| 169 | 169 | 'entity' => array('type' => 'integer', 'label' => 'Entity', 'default' => '1', 'enabled' => 1, 'visible' => -2, 'notnull' => -1, 'position' => 50, 'index' => 1), |
| 170 | - 'filepath' => array('type' => 'varchar(255)', 'label' => 'FilePath', 'enabled' => 1, 'position' => 60, 'notnull' => 0, 'visible' => 0, 'searchall' => 0, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'showoncombobox' => 2, 'validate' => 1,'comment' => "relative to dolibarr document dir. Example module/def"), |
|
| 171 | - 'filename' => array('type' => 'varchar(255)', 'label' => 'FileName', 'enabled' => 1, 'position' => 70, 'notnull' => 0, 'visible' => 1, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'showoncombobox' => 2, 'validate' => 1,'comment' => "file name only without any directory"), |
|
| 172 | - 'src_object_type' => array('type' => 'varchar(64)', 'label' => 'SourceType', 'enabled' => 1, 'position' => 80, 'notnull' => 0, 'visible' => 0, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'showoncombobox' => 2, 'validate' => 1,'comment' => "Source object type ('proposal', 'invoice', ...)"), |
|
| 170 | + 'filepath' => array('type' => 'varchar(255)', 'label' => 'FilePath', 'enabled' => 1, 'position' => 60, 'notnull' => 0, 'visible' => 0, 'searchall' => 0, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'showoncombobox' => 2, 'validate' => 1, 'comment' => "relative to dolibarr document dir. Example module/def"), |
|
| 171 | + 'filename' => array('type' => 'varchar(255)', 'label' => 'FileName', 'enabled' => 1, 'position' => 70, 'notnull' => 0, 'visible' => 1, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'showoncombobox' => 2, 'validate' => 1, 'comment' => "file name only without any directory"), |
|
| 172 | + 'src_object_type' => array('type' => 'varchar(64)', 'label' => 'SourceType', 'enabled' => 1, 'position' => 80, 'notnull' => 0, 'visible' => 0, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'showoncombobox' => 2, 'validate' => 1, 'comment' => "Source object type ('proposal', 'invoice', ...)"), |
|
| 173 | 173 | 'src_object_id' => array('type' => 'integer', 'label' => 'SourceID', 'default' => '1', 'enabled' => 1, 'visible' => 0, 'notnull' => 1, 'position' => 90, 'index' => 1, 'comment' => "Source object id"), |
| 174 | - 'fullpath_orig' => array('type' => 'varchar(750)', 'label' => 'FullPathOrig', 'enabled' => 1, 'position' => 100, 'notnull' => 0, 'visible' => 0, 'searchall' => 0, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'showoncombobox' => 2, 'validate' => 1,'comment' => "full path of original filename, when file is uploaded from a local computer"), |
|
| 174 | + 'fullpath_orig' => array('type' => 'varchar(750)', 'label' => 'FullPathOrig', 'enabled' => 1, 'position' => 100, 'notnull' => 0, 'visible' => 0, 'searchall' => 0, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'showoncombobox' => 2, 'validate' => 1, 'comment' => "full path of original filename, when file is uploaded from a local computer"), |
|
| 175 | 175 | 'description' => array('type' => 'text', 'label' => 'Description', 'enabled' => 1, 'visible' => 0, 'position' => 110), |
| 176 | - 'keywords' => array('type' => 'varchar(750)', 'label' => 'Keywords', 'enabled' => 1, 'position' => 120, 'notnull' => 0, 'visible' => 1, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'showoncombobox' => 2, 'validate' => 1,'comment' => "list of keywords, separated with comma. Must be limited to most important keywords."), |
|
| 177 | - 'content' => array('type' => 'html', 'label' => 'Content', 'enabled' => 'getDolGlobalString("MAIN_SAVE_FILE_CONTENT_AS_TEXT")', 'position' => 120, 'notnull' => 0, 'visible' => 1, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'csslist' => 'tdoverflowmax200', 'help' => "Text content of file", 'showoncombobox' => 2, 'validate' => 1,'comment' => "Text content if option to store txt content was set."), |
|
| 176 | + 'keywords' => array('type' => 'varchar(750)', 'label' => 'Keywords', 'enabled' => 1, 'position' => 120, 'notnull' => 0, 'visible' => 1, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'showoncombobox' => 2, 'validate' => 1, 'comment' => "list of keywords, separated with comma. Must be limited to most important keywords."), |
|
| 177 | + 'content' => array('type' => 'html', 'label' => 'Content', 'enabled' => 'getDolGlobalString("MAIN_SAVE_FILE_CONTENT_AS_TEXT")', 'position' => 120, 'notnull' => 0, 'visible' => 1, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'csslist' => 'tdoverflowmax200', 'help' => "Text content of file", 'showoncombobox' => 2, 'validate' => 1, 'comment' => "Text content if option to store txt content was set."), |
|
| 178 | 178 | 'cover' => array('type' => 'text', 'label' => 'Cover', 'enabled' => 1, 'visible' => 0, 'position' => 130, 'comment' => "is this file a file to use for a cover"), |
| 179 | 179 | 'position' => array('type' => 'integer', 'label' => 'Position', 'default' => '1', 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 140, 'index' => 1, 'comment' => "position of file among others"), |
| 180 | - 'gen_or_uploaded' => array('type' => 'varchar(12)', 'label' => 'GenOrUpload', 'enabled' => 1, 'position' => 150, 'notnull' => 0, 'visible' => -1, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'showoncombobox' => 2, 'validate' => 1,'comment' => "'generated' or 'uploaded'"), |
|
| 180 | + 'gen_or_uploaded' => array('type' => 'varchar(12)', 'label' => 'GenOrUpload', 'enabled' => 1, 'position' => 150, 'notnull' => 0, 'visible' => -1, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'showoncombobox' => 2, 'validate' => 1, 'comment' => "'generated' or 'uploaded'"), |
|
| 181 | 181 | 'extraparams' => array('type' => 'varchar(255)', 'label' => 'ExtraParams', 'enabled' => 1, 'position' => 160, 'notnull' => 0, 'visible' => 1, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'showoncombobox' => 2, 'validate' => 1, 'comment' => "for stocking other parameters with json format"), |
| 182 | 182 | 'date_c' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => 1, 'visible' => -1, 'position' => 170), |
| 183 | 183 | 'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 175), |
@@ -948,7 +948,7 @@ discard block |
||
| 948 | 948 | if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) { |
| 949 | 949 | return ['optimize' => $langs->trans("ShowFile")]; |
| 950 | 950 | } |
| 951 | - $datas['picto'] = img_picto('', $this->picto, '', 0, 0, 0, '', 'paddingrightonly') . '<u>' . $langs->trans("File") . '</u>'; |
|
| 951 | + $datas['picto'] = img_picto('', $this->picto, '', 0, 0, 0, '', 'paddingrightonly').'<u>'.$langs->trans("File").'</u>'; |
|
| 952 | 952 | if (!empty($this->filename)) { |
| 953 | 953 | $datas['name'] = '<br><b>'.$langs->trans('Name').':</b> '.basename($this->filename); |
| 954 | 954 | } |
@@ -1044,7 +1044,7 @@ discard block |
||
| 1044 | 1044 | $result .= $linkstart.$this->filename.$linkend; |
| 1045 | 1045 | |
| 1046 | 1046 | global $action; |
| 1047 | - $hookmanager->initHooks(array($this->element . 'dao')); |
|
| 1047 | + $hookmanager->initHooks(array($this->element.'dao')); |
|
| 1048 | 1048 | $parameters = array('id' => $this->id, 'getnomurl' => &$result); |
| 1049 | 1049 | $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks |
| 1050 | 1050 | if ($reshook > 0) { |
@@ -1080,8 +1080,8 @@ discard block |
||
| 1080 | 1080 | $sql .= ", '".$this->db->escape($this->ip)."'"; |
| 1081 | 1081 | if (!getDolGlobalString('MAIN_COMPANY_PERENTITY_SHARED')) { |
| 1082 | 1082 | $sql .= ", ".(empty($this->vat_reverse_charge) ? '0' : '1'); |
| 1083 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_buy) . "'"; |
|
| 1084 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_sell) . "'"; |
|
| 1083 | + $sql .= ", '".$this->db->escape($this->accountancy_code_buy)."'"; |
|
| 1084 | + $sql .= ", '".$this->db->escape($this->accountancy_code_sell)."'"; |
|
| 1085 | 1085 | } |
| 1086 | 1086 | $sql .= ")"; |
| 1087 | 1087 | |
@@ -1134,7 +1134,7 @@ discard block |
||
| 1134 | 1134 | } |
| 1135 | 1135 | |
| 1136 | 1136 | if ($ret >= 0) { |
| 1137 | - if (! $notrigger) { |
|
| 1137 | + if (!$notrigger) { |
|
| 1138 | 1138 | // Call trigger |
| 1139 | 1139 | $result = $this->call_trigger('COMPANY_CREATE', $user); |
| 1140 | 1140 | if ($result < 0) { |
@@ -1212,7 +1212,7 @@ discard block |
||
| 1212 | 1212 | $this->setUpperOrLowerCase(); |
| 1213 | 1213 | $contact->phone_pro = $this->phone; |
| 1214 | 1214 | if (getDolGlobalString('CONTACTS_DEFAULT_ROLES')) { |
| 1215 | - $contact->roles = explode(',', getDolGlobalString('CONTACTS_DEFAULT_ROLES')); |
|
| 1215 | + $contact->roles = explode(',', getDolGlobalString('CONTACTS_DEFAULT_ROLES')); |
|
| 1216 | 1216 | } |
| 1217 | 1217 | |
| 1218 | 1218 | $contactId = $contact->create($user, $notrigger); |
@@ -1385,7 +1385,7 @@ discard block |
||
| 1385 | 1385 | if ($this->id_prof_exists($keymin, $vallabel, ($this->id > 0 ? $this->id : 0))) { |
| 1386 | 1386 | $langs->loadLangs(array("errors", 'compta')); |
| 1387 | 1387 | $error++; |
| 1388 | - $this->errors[] = $langs->trans('CustomerAccountancyCodeShort') . " " . $langs->trans("ErrorProdIdAlreadyExist", $vallabel) . ' (' . $langs->trans("ForbiddenBySetupRules") . ')'; |
|
| 1388 | + $this->errors[] = $langs->trans('CustomerAccountancyCodeShort')." ".$langs->trans("ErrorProdIdAlreadyExist", $vallabel).' ('.$langs->trans("ForbiddenBySetupRules").')'; |
|
| 1389 | 1389 | } |
| 1390 | 1390 | } |
| 1391 | 1391 | |
@@ -1393,7 +1393,7 @@ discard block |
||
| 1393 | 1393 | if (getDolGlobalString('SOCIETE_ACCOUNTANCY_CODE_CUSTOMER_MANDATORY') && (!isset($vallabel) || trim($vallabel) === '')) { |
| 1394 | 1394 | $langs->loadLangs(array("errors", 'compta')); |
| 1395 | 1395 | $error++; |
| 1396 | - $this->errors[] = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv('CustomerAccountancyCodeShort')) . ' (' . $langs->trans("ForbiddenBySetupRules") . ')'; |
|
| 1396 | + $this->errors[] = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv('CustomerAccountancyCodeShort')).' ('.$langs->trans("ForbiddenBySetupRules").')'; |
|
| 1397 | 1397 | } |
| 1398 | 1398 | } elseif ($key == 'ACCOUNTANCY_CODE_SUPPLIER' && !empty($this->fournisseur)) { |
| 1399 | 1399 | // Check for unicity |
@@ -1401,7 +1401,7 @@ discard block |
||
| 1401 | 1401 | if ($this->id_prof_exists($keymin, $vallabel, ($this->id > 0 ? $this->id : 0))) { |
| 1402 | 1402 | $langs->loadLangs(array("errors", 'compta')); |
| 1403 | 1403 | $error++; |
| 1404 | - $this->errors[] = $langs->trans('SupplierAccountancyCodeShort') . " " . $langs->trans("ErrorProdIdAlreadyExist", $vallabel) . ' (' . $langs->trans("ForbiddenBySetupRules") . ')'; |
|
| 1404 | + $this->errors[] = $langs->trans('SupplierAccountancyCodeShort')." ".$langs->trans("ErrorProdIdAlreadyExist", $vallabel).' ('.$langs->trans("ForbiddenBySetupRules").')'; |
|
| 1405 | 1405 | } |
| 1406 | 1406 | } |
| 1407 | 1407 | |
@@ -1409,7 +1409,7 @@ discard block |
||
| 1409 | 1409 | if (getDolGlobalString('SOCIETE_ACCOUNTANCY_CODE_SUPPLIER_MANDATORY') && (!isset($vallabel) || trim($vallabel) === '')) { |
| 1410 | 1410 | $langs->loadLangs(array("errors", 'compta')); |
| 1411 | 1411 | $error++; |
| 1412 | - $this->errors[] = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv('SupplierAccountancyCodeShort')) . ' (' . $langs->trans("ForbiddenBySetupRules") . ')'; |
|
| 1412 | + $this->errors[] = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv('SupplierAccountancyCodeShort')).' ('.$langs->trans("ForbiddenBySetupRules").')'; |
|
| 1413 | 1413 | } |
| 1414 | 1414 | } |
| 1415 | 1415 | } |
@@ -1451,17 +1451,17 @@ discard block |
||
| 1451 | 1451 | $now = dol_now(); |
| 1452 | 1452 | |
| 1453 | 1453 | // Clean parameters |
| 1454 | - $this->id = $id; |
|
| 1455 | - $this->entity = ((isset($this->entity) && is_numeric($this->entity)) ? $this->entity : $conf->entity); |
|
| 1454 | + $this->id = $id; |
|
| 1455 | + $this->entity = ((isset($this->entity) && is_numeric($this->entity)) ? $this->entity : $conf->entity); |
|
| 1456 | 1456 | $this->name = $this->name ? trim($this->name) : trim((string) $this->nom); |
| 1457 | 1457 | $this->nom = $this->name; // For backward compatibility |
| 1458 | - $this->name_alias = trim((string) $this->name_alias); |
|
| 1458 | + $this->name_alias = trim((string) $this->name_alias); |
|
| 1459 | 1459 | $this->ref_ext = (empty($this->ref_ext) ? '' : trim($this->ref_ext)); |
| 1460 | 1460 | $this->address = trim((string) $this->address); |
| 1461 | 1461 | $this->zip = trim((string) $this->zip); |
| 1462 | 1462 | $this->town = trim((string) $this->town); |
| 1463 | - $this->state_id = (is_numeric($this->state_id)) ? (int) $this->state_id : 0; |
|
| 1464 | - $this->country_id = ($this->country_id > 0) ? $this->country_id : 0; |
|
| 1463 | + $this->state_id = (is_numeric($this->state_id)) ? (int) $this->state_id : 0; |
|
| 1464 | + $this->country_id = ($this->country_id > 0) ? $this->country_id : 0; |
|
| 1465 | 1465 | $this->phone = trim((string) $this->phone); |
| 1466 | 1466 | $this->phone = preg_replace("/\s/", "", $this->phone); |
| 1467 | 1467 | $this->phone = preg_replace("/\./", "", $this->phone); |
@@ -1471,7 +1471,7 @@ discard block |
||
| 1471 | 1471 | $this->fax = trim((string) $this->fax); |
| 1472 | 1472 | $this->fax = preg_replace("/\s/", "", $this->fax); |
| 1473 | 1473 | $this->fax = preg_replace("/\./", "", $this->fax); |
| 1474 | - $this->email = trim((string) $this->email); |
|
| 1474 | + $this->email = trim((string) $this->email); |
|
| 1475 | 1475 | $this->url = $this->url ? clean_url($this->url, 0) : ''; |
| 1476 | 1476 | $this->note_private = (empty($this->note_private) ? '' : trim($this->note_private)); |
| 1477 | 1477 | $this->note_public = (empty($this->note_public) ? '' : trim($this->note_public)); |
@@ -1481,14 +1481,14 @@ discard block |
||
| 1481 | 1481 | $this->idprof4 = trim((string) $this->idprof4); |
| 1482 | 1482 | $this->idprof5 = (!empty($this->idprof5) ? trim($this->idprof5) : ''); |
| 1483 | 1483 | $this->idprof6 = (!empty($this->idprof6) ? trim($this->idprof6) : ''); |
| 1484 | - $this->prefix_comm = trim((string) $this->prefix_comm); |
|
| 1484 | + $this->prefix_comm = trim((string) $this->prefix_comm); |
|
| 1485 | 1485 | $this->outstanding_limit = price2num($this->outstanding_limit); |
| 1486 | 1486 | $this->order_min_amount = price2num($this->order_min_amount); |
| 1487 | 1487 | $this->supplier_order_min_amount = price2num($this->supplier_order_min_amount); |
| 1488 | 1488 | |
| 1489 | 1489 | $this->tva_assuj = (is_numeric($this->tva_assuj)) ? (int) trim((string) $this->tva_assuj) : 0; |
| 1490 | 1490 | $this->tva_intra = dol_sanitizeFileName($this->tva_intra, ''); |
| 1491 | - $this->vat_reverse_charge = empty($this->vat_reverse_charge) ? 0 : 1; |
|
| 1491 | + $this->vat_reverse_charge = empty($this->vat_reverse_charge) ? 0 : 1; |
|
| 1492 | 1492 | if (empty($this->status)) { |
| 1493 | 1493 | $this->status = 0; |
| 1494 | 1494 | } |
@@ -1640,7 +1640,7 @@ discard block |
||
| 1640 | 1640 | $sql .= ",tva_assuj = ".($this->tva_assuj != '' ? "'".$this->db->escape($this->tva_assuj)."'" : "null"); |
| 1641 | 1641 | $sql .= ",tva_intra = '".$this->db->escape($this->tva_intra)."'"; |
| 1642 | 1642 | if (!getDolGlobalString('MAIN_COMPANY_PERENTITY_SHARED')) { |
| 1643 | - $sql .= ",vat_reverse_charge = " . ($this->vat_reverse_charge != '' ? "'" . $this->db->escape($this->vat_reverse_charge) . "'" : 0); |
|
| 1643 | + $sql .= ",vat_reverse_charge = ".($this->vat_reverse_charge != '' ? "'".$this->db->escape($this->vat_reverse_charge)."'" : 0); |
|
| 1644 | 1644 | } |
| 1645 | 1645 | $sql .= ",status = ".((int) $this->status); |
| 1646 | 1646 | |
@@ -1701,8 +1701,8 @@ discard block |
||
| 1701 | 1701 | $sql .= ",supplier_order_min_amount= ".($this->supplier_order_min_amount != '' ? $this->supplier_order_min_amount : 'null'); |
| 1702 | 1702 | $sql .= ",fk_prospectlevel='".$this->db->escape($this->fk_prospectlevel)."'"; |
| 1703 | 1703 | if (!getDolGlobalString('MAIN_COMPANY_PERENTITY_SHARED')) { |
| 1704 | - $sql .= ", accountancy_code_buy = '" . $this->db->escape($this->accountancy_code_buy) . "'"; |
|
| 1705 | - $sql .= ", accountancy_code_sell= '" . $this->db->escape($this->accountancy_code_sell) . "'"; |
|
| 1704 | + $sql .= ", accountancy_code_buy = '".$this->db->escape($this->accountancy_code_buy)."'"; |
|
| 1705 | + $sql .= ", accountancy_code_sell= '".$this->db->escape($this->accountancy_code_sell)."'"; |
|
| 1706 | 1706 | if ($customer) { |
| 1707 | 1707 | $sql .= ", accountancy_code_customer_general = ".(!empty($this->accountancy_code_customer_general) ? "'".$this->db->escape($this->accountancy_code_customer_general)."'" : "null"); |
| 1708 | 1708 | $sql .= ", code_compta = ".(!empty($this->code_compta_client) ? "'".$this->db->escape($this->code_compta_client)."'" : "null"); |
@@ -2100,7 +2100,7 @@ discard block |
||
| 2100 | 2100 | $this->vat_reverse_charge = 0; |
| 2101 | 2101 | } |
| 2102 | 2102 | |
| 2103 | - $this->status = $obj->status; |
|
| 2103 | + $this->status = $obj->status; |
|
| 2104 | 2104 | |
| 2105 | 2105 | // Local Taxes |
| 2106 | 2106 | $this->localtax1_assuj = $obj->localtax1_assuj; |
@@ -2127,7 +2127,7 @@ discard block |
||
| 2127 | 2127 | |
| 2128 | 2128 | $this->mode_reglement_id = $obj->mode_reglement; |
| 2129 | 2129 | $this->cond_reglement_id = $obj->cond_reglement; |
| 2130 | - $this->deposit_percent = $obj->deposit_percent; |
|
| 2130 | + $this->deposit_percent = $obj->deposit_percent; |
|
| 2131 | 2131 | $this->transport_mode_id = $obj->transport_mode; |
| 2132 | 2132 | $this->mode_reglement_supplier_id = $obj->mode_reglement_supplier; |
| 2133 | 2133 | $this->cond_reglement_supplier_id = $obj->cond_reglement_supplier; |
@@ -2697,10 +2697,10 @@ discard block |
||
| 2697 | 2697 | $reparray[$i]['firstname'] = $obj->firstname; |
| 2698 | 2698 | $reparray[$i]['email'] = $obj->email; |
| 2699 | 2699 | $reparray[$i]['phone'] = $obj->office_phone; |
| 2700 | - $reparray[$i]['office_phone'] = $obj->office_phone; // Pro phone |
|
| 2700 | + $reparray[$i]['office_phone'] = $obj->office_phone; // Pro phone |
|
| 2701 | 2701 | $reparray[$i]['office_fax'] = $obj->office_fax; |
| 2702 | - $reparray[$i]['user_mobile'] = $obj->user_mobile; // Pro mobile |
|
| 2703 | - $reparray[$i]['personal_mobile'] = $obj->personal_mobile; // Personal mobile |
|
| 2702 | + $reparray[$i]['user_mobile'] = $obj->user_mobile; // Pro mobile |
|
| 2703 | + $reparray[$i]['personal_mobile'] = $obj->personal_mobile; // Personal mobile |
|
| 2704 | 2704 | $reparray[$i]['job'] = $obj->job; |
| 2705 | 2705 | $reparray[$i]['statut'] = $obj->status; // deprecated |
| 2706 | 2706 | $reparray[$i]['status'] = $obj->status; |
@@ -2913,7 +2913,7 @@ discard block |
||
| 2913 | 2913 | $datas['status'] = ' '.$this->getLibStatut(5); |
| 2914 | 2914 | } |
| 2915 | 2915 | if (isset($this->client) && isset($this->fournisseur)) { |
| 2916 | - $datas['type'] = ' ' . $this->getTypeUrl(1); |
|
| 2916 | + $datas['type'] = ' '.$this->getTypeUrl(1); |
|
| 2917 | 2917 | } |
| 2918 | 2918 | $datas['name'] = '<br><b>'.$langs->trans('Name').':</b> '.dol_escape_htmltag(dol_string_nohtmltag($this->name)); |
| 2919 | 2919 | if (!empty($this->name_alias) && empty($noaliasinname)) { |
@@ -2981,9 +2981,9 @@ discard block |
||
| 2981 | 2981 | } |
| 2982 | 2982 | // show categories for this record only in ajax to not overload lists |
| 2983 | 2983 | if (!$nofetch && isModEnabled('category') && $this->client) { |
| 2984 | - require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
| 2984 | + require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
|
| 2985 | 2985 | $form = new Form($this->db); |
| 2986 | - $datas['categories_customer'] = '<br>' . $form->showCategories($this->id, Categorie::TYPE_CUSTOMER, 1, 1); |
|
| 2986 | + $datas['categories_customer'] = '<br>'.$form->showCategories($this->id, Categorie::TYPE_CUSTOMER, 1, 1); |
|
| 2987 | 2987 | } |
| 2988 | 2988 | if (!empty($this->code_fournisseur) && $this->fournisseur) { |
| 2989 | 2989 | $datas['suppliercode'] = '<br><b>'.$langs->trans('SupplierCode').':</b> '.$this->code_fournisseur; |
@@ -2994,9 +2994,9 @@ discard block |
||
| 2994 | 2994 | } |
| 2995 | 2995 | // show categories for this record only in ajax to not overload lists |
| 2996 | 2996 | if (!$nofetch && isModEnabled('category') && $this->fournisseur) { |
| 2997 | - require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
| 2997 | + require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
|
| 2998 | 2998 | $form = new Form($this->db); |
| 2999 | - $datas['categories_supplier'] = '<br>' . $form->showCategories($this->id, Categorie::TYPE_SUPPLIER, 1, 1); |
|
| 2999 | + $datas['categories_supplier'] = '<br>'.$form->showCategories($this->id, Categorie::TYPE_SUPPLIER, 1, 1); |
|
| 3000 | 3000 | } |
| 3001 | 3001 | |
| 3002 | 3002 | $datas['divclose'] = '</div>'; |
@@ -3536,7 +3536,7 @@ discard block |
||
| 3536 | 3536 | { |
| 3537 | 3537 | // phpcs:enable |
| 3538 | 3538 | require_once DOL_DOCUMENT_ROOT.'/societe/class/companybankaccount.class.php'; |
| 3539 | - $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."societe_rib WHERE type = 'ban' AND default_rib = 1 AND fk_soc = ". (int) $this->id; |
|
| 3539 | + $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."societe_rib WHERE type = 'ban' AND default_rib = 1 AND fk_soc = ".(int) $this->id; |
|
| 3540 | 3540 | $resql = $this->db->query($sql); |
| 3541 | 3541 | if (!$resql) { |
| 3542 | 3542 | $this->error = $this->db->lasterror(); |
@@ -3926,7 +3926,7 @@ discard block |
||
| 3926 | 3926 | global $langs; |
| 3927 | 3927 | |
| 3928 | 3928 | if ($company_id > 0) { |
| 3929 | - $sql = "SELECT parent FROM " . MAIN_DB_PREFIX . "societe WHERE rowid = ".((int) $company_id); |
|
| 3929 | + $sql = "SELECT parent FROM ".MAIN_DB_PREFIX."societe WHERE rowid = ".((int) $company_id); |
|
| 3930 | 3930 | $resql = $this->db->query($sql); |
| 3931 | 3931 | if ($resql) { |
| 3932 | 3932 | if ($obj = $this->db->fetch_object($resql)) { |
@@ -4542,7 +4542,7 @@ discard block |
||
| 4542 | 4542 | $country_code = $country_label = ''; |
| 4543 | 4543 | if (getDolGlobalString('MAIN_INFO_SOCIETE_COUNTRY')) { |
| 4544 | 4544 | $tmp = explode(':', getDolGlobalString('MAIN_INFO_SOCIETE_COUNTRY')); |
| 4545 | - $country_id = (is_numeric($tmp[0])) ? (int) $tmp[0] : 0; |
|
| 4545 | + $country_id = (is_numeric($tmp[0])) ? (int) $tmp[0] : 0; |
|
| 4546 | 4546 | if (!empty($tmp[1])) { // If $conf->global->MAIN_INFO_SOCIETE_COUNTRY is "id:code:label" |
| 4547 | 4547 | $country_code = $tmp[1]; |
| 4548 | 4548 | $country_label = $tmp[2]; |
@@ -5417,7 +5417,7 @@ discard block |
||
| 5417 | 5417 | if (method_exists($this, 'getLibStatut')) { |
| 5418 | 5418 | $return .= '<br><div class="info-box-status">'.$this->getLibStatut(3).'</div>'; |
| 5419 | 5419 | } |
| 5420 | - $return .= '</div>'; // end info-box-content |
|
| 5420 | + $return .= '</div>'; // end info-box-content |
|
| 5421 | 5421 | $return .= '</div>'; |
| 5422 | 5422 | $return .= '</div>'; |
| 5423 | 5423 | |
@@ -5521,7 +5521,7 @@ discard block |
||
| 5521 | 5521 | global $conf, $langs, $hookmanager, $user, $action; |
| 5522 | 5522 | |
| 5523 | 5523 | $error = 0; |
| 5524 | - $soc_origin = new Societe($this->db); // The thirdparty that we will delete |
|
| 5524 | + $soc_origin = new Societe($this->db); // The thirdparty that we will delete |
|
| 5525 | 5525 | |
| 5526 | 5526 | dol_syslog("mergeCompany merge thirdparty id=".$soc_origin_id." (will be deleted) into the thirdparty id=".$this->id); |
| 5527 | 5527 | |
@@ -88,21 +88,21 @@ discard block |
||
| 88 | 88 | { |
| 89 | 89 | // To provide debug information on line number processed |
| 90 | 90 | global $count; |
| 91 | - if (empty($count)) $count=1; |
|
| 91 | + if (empty($count)) $count = 1; |
|
| 92 | 92 | else $count++; |
| 93 | 93 | |
| 94 | - if (empty($this->savxml)) $this->savxml = $this->xml; // Sav content of line at first line merged, so we will reuse original for next steps |
|
| 94 | + if (empty($this->savxml)) $this->savxml = $this->xml; // Sav content of line at first line merged, so we will reuse original for next steps |
|
| 95 | 95 | $this->xml = $this->savxml; |
| 96 | - $tmpvars = $this->vars; // Store into $tmpvars so we won't modify this->vars when completing data with empty values |
|
| 96 | + $tmpvars = $this->vars; // Store into $tmpvars so we won't modify this->vars when completing data with empty values |
|
| 97 | 97 | |
| 98 | 98 | // Search all tags fou into condition to complete $tmpvars, so we will proceed all tests even if not defined |
| 99 | - $reg='@\[!--\sIF\s([{}a-zA-Z0-9\.\,_]+)\s--\]@smU'; |
|
| 99 | + $reg = '@\[!--\sIF\s([{}a-zA-Z0-9\.\,_]+)\s--\]@smU'; |
|
| 100 | 100 | $matches = array(); |
| 101 | 101 | preg_match_all($reg, $this->xml, $matches, PREG_SET_ORDER); |
| 102 | 102 | //var_dump($tmpvars);exit; |
| 103 | 103 | foreach ($matches as $match) { // For each match, if there is no entry into this->vars, we add it |
| 104 | - if (! empty($match[1]) && ! isset($tmpvars[$match[1]])) { |
|
| 105 | - $tmpvars[$match[1]] = ''; // Not defined, so we set it to '', we just need entry into this->vars for next loop |
|
| 104 | + if (!empty($match[1]) && !isset($tmpvars[$match[1]])) { |
|
| 105 | + $tmpvars[$match[1]] = ''; // Not defined, so we set it to '', we just need entry into this->vars for next loop |
|
| 106 | 106 | } |
| 107 | 107 | } |
| 108 | 108 | |
@@ -114,13 +114,13 @@ discard block |
||
| 114 | 114 | // Remove the IF tag |
| 115 | 115 | $this->xml = str_replace('[!-- IF '.$key.' --]', '', $this->xml); |
| 116 | 116 | // Remove everything between the ELSE tag (if it exists) and the ENDIF tag |
| 117 | - $reg = '@(\[!--\sELSE\s' . preg_quote($key, '@') . '\s--\](.*))?\[!--\sENDIF\s' . preg_quote($key, '@') . '\s--\]@smU'; // U modifier = all quantifiers are non-greedy |
|
| 117 | + $reg = '@(\[!--\sELSE\s'.preg_quote($key, '@').'\s--\](.*))?\[!--\sENDIF\s'.preg_quote($key, '@').'\s--\]@smU'; // U modifier = all quantifiers are non-greedy |
|
| 118 | 118 | $this->xml = preg_replace($reg, '', $this->xml); |
| 119 | 119 | } |
| 120 | 120 | // Else the value is false, then two cases: no ELSE and we're done, or there is at least one place where there is an ELSE clause, then we replace it |
| 121 | 121 | else { |
| 122 | 122 | // Find all conditional blocks for this variable: from IF to ELSE and to ENDIF |
| 123 | - $reg = '@\[!--\sIF\s' . preg_quote($key, '@') . '\s--\](.*)(\[!--\sELSE\s' . preg_quote($key, '@') . '\s--\](.*))?\[!--\sENDIF\s' . preg_quote($key, '@') . '\s--\]@smU'; // U modifier = all quantifiers are non-greedy |
|
| 123 | + $reg = '@\[!--\sIF\s'.preg_quote($key, '@').'\s--\](.*)(\[!--\sELSE\s'.preg_quote($key, '@').'\s--\](.*))?\[!--\sENDIF\s'.preg_quote($key, '@').'\s--\]@smU'; // U modifier = all quantifiers are non-greedy |
|
| 124 | 124 | preg_match_all($reg, $this->xml, $matches, PREG_SET_ORDER); |
| 125 | 125 | foreach ($matches as $match) { // For each match, if there is an ELSE clause, we replace the whole block by the value in the ELSE clause |
| 126 | 126 | if (!empty($match[3])) $this->xml = str_replace($match[0], $match[3], $this->xml); |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | $this->xmlParsed .= str_replace(array_keys($tmpvars), array_values($tmpvars), $this->xml); |
| 134 | 134 | if ($this->hasChildren()) { |
| 135 | 135 | foreach ($this->children as $child) { |
| 136 | - $this->xmlParsed = str_replace($child->xml, ($child->xmlParsed=="")?$child->merge():$child->xmlParsed, $this->xmlParsed); |
|
| 136 | + $this->xmlParsed = str_replace($child->xml, ($child->xmlParsed == "") ? $child->merge() : $child->xmlParsed, $this->xmlParsed); |
|
| 137 | 137 | $child->xmlParsed = ''; |
| 138 | 138 | } |
| 139 | 139 | } |
@@ -143,9 +143,9 @@ discard block |
||
| 143 | 143 | $this->xmlParsed = $this->macroReplace($this->xmlParsed); |
| 144 | 144 | $this->file->open($this->odf->getTmpfile()); |
| 145 | 145 | foreach ($this->images as $imageKey => $imageValue) { |
| 146 | - if ($this->file->getFromName('Pictures/' . $imageValue) === false) { |
|
| 146 | + if ($this->file->getFromName('Pictures/'.$imageValue) === false) { |
|
| 147 | 147 | // Add the image inside the ODT document |
| 148 | - $this->file->addFile($imageKey, 'Pictures/' . $imageValue); |
|
| 148 | + $this->file->addFile($imageKey, 'Pictures/'.$imageValue); |
|
| 149 | 149 | // Add the image to the Manifest (which maintains a list of images, necessary to avoid "Corrupt ODT file. Repair?" when opening the file with LibreOffice) |
| 150 | 150 | $this->odf->addImageToManifest($imageValue); |
| 151 | 151 | } |
@@ -176,16 +176,16 @@ discard block |
||
| 176 | 176 | $dateinonemontharray = dol_get_next_month($hoy['mon'], $hoy['year']); |
| 177 | 177 | $nextMonth = $dateinonemontharray['month']; |
| 178 | 178 | |
| 179 | - $patterns=array( '/__CURRENTDAY__/u','/__CURENTWEEKDAY__/u', |
|
| 180 | - '/__CURRENTMONTH__/u','/__CURRENTMONTHLONG__/u', |
|
| 181 | - '/__NEXTMONTH__/u','/__NEXTMONTHLONG__/u', |
|
| 182 | - '/__CURRENTYEAR__/u','/__NEXTYEAR__/u' ); |
|
| 183 | - $values=array( $hoy['mday'], $langs->transnoentitiesnoconv($hoy['wday']), |
|
| 179 | + $patterns = array('/__CURRENTDAY__/u', '/__CURENTWEEKDAY__/u', |
|
| 180 | + '/__CURRENTMONTH__/u', '/__CURRENTMONTHLONG__/u', |
|
| 181 | + '/__NEXTMONTH__/u', '/__NEXTMONTHLONG__/u', |
|
| 182 | + '/__CURRENTYEAR__/u', '/__NEXTYEAR__/u'); |
|
| 183 | + $values = array($hoy['mday'], $langs->transnoentitiesnoconv($hoy['wday']), |
|
| 184 | 184 | $hoy['mon'], monthArray($langs)[$hoy['mon']], |
| 185 | 185 | $nextMonth, monthArray($langs)[$nextMonth], |
| 186 | - $hoy['year'], $hoy['year']+1 ); |
|
| 186 | + $hoy['year'], $hoy['year'] + 1); |
|
| 187 | 187 | |
| 188 | - $text=preg_replace($patterns, $values, $text); |
|
| 188 | + $text = preg_replace($patterns, $values, $text); |
|
| 189 | 189 | |
| 190 | 190 | return $text; |
| 191 | 191 | } |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | */ |
| 224 | 224 | public function setVars($key, $value, $encode = true, $charset = 'ISO-8859') |
| 225 | 225 | { |
| 226 | - $tag = $this->odf->getConfig('DELIMITER_LEFT') . $key . $this->odf->getConfig('DELIMITER_RIGHT'); |
|
| 226 | + $tag = $this->odf->getConfig('DELIMITER_LEFT').$key.$this->odf->getConfig('DELIMITER_RIGHT'); |
|
| 227 | 227 | |
| 228 | 228 | if (strpos($this->xml, $tag) === false) { |
| 229 | 229 | //throw new SegmentException("var $key not found in {$this->getName()}"); |
@@ -277,7 +277,7 @@ discard block |
||
| 277 | 277 | if (array_key_exists($prop, $this->children)) { |
| 278 | 278 | return $this->children[$prop]; |
| 279 | 279 | } else { |
| 280 | - throw new SegmentException('child ' . $prop . ' does not exist'); |
|
| 280 | + throw new SegmentException('child '.$prop.' does not exist'); |
|
| 281 | 281 | } |
| 282 | 282 | } |
| 283 | 283 | /** |
@@ -198,7 +198,7 @@ discard block |
||
| 198 | 198 | } |
| 199 | 199 | if (GETPOSTISSET('supplier_invoice_id')) { |
| 200 | 200 | $object->fields['supplier_invoice_id'] = array('type' => 'integer:FactureFournisseur:fourn/class/fournisseur.facture.class.php:1:entity IN (__SHARED_ENTITIES__)', 'label' => 'SupplierInvoice', 'enabled' => '1', 'noteditable' => 1, 'position' => 280, 'notnull' => 0, 'visible' => 1, 'index' => 1, 'validate' => '1',); |
| 201 | - print '<input type="hidden" name="supplier_invoice_id" value="' . GETPOSTINT('supplier_invoice_id') . '">'; |
|
| 201 | + print '<input type="hidden" name="supplier_invoice_id" value="'.GETPOSTINT('supplier_invoice_id').'">'; |
|
| 202 | 202 | } |
| 203 | 203 | |
| 204 | 204 | print dol_get_fiche_head(array(), ''); |
@@ -299,7 +299,7 @@ discard block |
||
| 299 | 299 | array('type' => 'checkbox', 'name' => 'disposal_depreciated', 'label' => $langs->trans("AssetDisposalDepreciated"), 'value' => $disposal_depreciated), |
| 300 | 300 | array('type' => 'checkbox', 'name' => 'disposal_subject_to_vat', 'label' => $langs->trans("AssetDisposalSubjectToVat"), 'value' => $disposal_subject_to_vat), |
| 301 | 301 | ); |
| 302 | - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('AssetDisposal'), $langs->trans('AssetConfirmDisposalAsk', $object->ref . ' - ' . $object->label), 'confirm_disposal', $formquestion, 'yes', 1); |
|
| 302 | + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('AssetDisposal'), $langs->trans('AssetConfirmDisposalAsk', $object->ref.' - '.$object->label), 'confirm_disposal', $formquestion, 'yes', 1); |
|
| 303 | 303 | } elseif ($action == 'reopen') { |
| 304 | 304 | // Re-open |
| 305 | 305 | // Create an array for form |
@@ -343,7 +343,7 @@ discard block |
||
| 343 | 343 | print '<table class="border centpercent tableforfield">'."\n"; |
| 344 | 344 | |
| 345 | 345 | // Common attributes |
| 346 | - $keyforbreak='date_acquisition'; // We change column just before this field |
|
| 346 | + $keyforbreak = 'date_acquisition'; // We change column just before this field |
|
| 347 | 347 | //unset($object->fields['fk_project']); // Hide field already shown in banner |
| 348 | 348 | //unset($object->fields['fk_soc']); // Hide field already shown in banner |
| 349 | 349 | include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php'; |
@@ -361,7 +361,7 @@ discard block |
||
| 361 | 361 | |
| 362 | 362 | // Buttons for actions |
| 363 | 363 | if ($action != 'presend' && $action != 'editline') { |
| 364 | - print '<div class="tabsAction">' . "\n"; |
|
| 364 | + print '<div class="tabsAction">'."\n"; |
|
| 365 | 365 | $parameters = array(); |
| 366 | 366 | $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook |
| 367 | 367 | if ($reshook < 0) { |
@@ -371,26 +371,26 @@ discard block |
||
| 371 | 371 | if (empty($reshook)) { |
| 372 | 372 | // Send |
| 373 | 373 | if (empty($user->socid)) { |
| 374 | - print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=presend&mode=init&token=' . newToken() . '#formmailbeforetitle'); |
|
| 374 | + print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&mode=init&token='.newToken().'#formmailbeforetitle'); |
|
| 375 | 375 | } |
| 376 | 376 | |
| 377 | 377 | if ($object->status == $object::STATUS_DRAFT) { |
| 378 | - print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=edit&token=' . newToken(), '', $permissiontoadd); |
|
| 378 | + print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit&token='.newToken(), '', $permissiontoadd); |
|
| 379 | 379 | } |
| 380 | 380 | |
| 381 | 381 | // Clone |
| 382 | 382 | //print dolGetButtonAction($langs->trans('ToClone'), '', 'default', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=clone&token=' . newToken(), '', false && $permissiontoadd); |
| 383 | 383 | |
| 384 | 384 | if ($object->status == $object::STATUS_DRAFT) { |
| 385 | - print dolGetButtonAction($langs->trans('AssetDisposal'), '', 'default', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=disposal&token=' . newToken(), '', $permissiontoadd); |
|
| 385 | + print dolGetButtonAction($langs->trans('AssetDisposal'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=disposal&token='.newToken(), '', $permissiontoadd); |
|
| 386 | 386 | } else { |
| 387 | - print dolGetButtonAction($langs->trans('ReOpen'), '', 'default', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=reopen&token=' . newToken(), '', $permissiontoadd); |
|
| 387 | + print dolGetButtonAction($langs->trans('ReOpen'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=reopen&token='.newToken(), '', $permissiontoadd); |
|
| 388 | 388 | } |
| 389 | 389 | |
| 390 | 390 | // Delete (need delete permission, or if draft, just need create/modify permission) |
| 391 | - print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=delete&token=' . newToken(), '', $permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd)); |
|
| 391 | + print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=delete&token='.newToken(), '', $permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd)); |
|
| 392 | 392 | } |
| 393 | - print '</div>' . "\n"; |
|
| 393 | + print '</div>'."\n"; |
|
| 394 | 394 | } |
| 395 | 395 | |
| 396 | 396 | // Select mail models is same action as presend |
@@ -27,8 +27,8 @@ |
||
| 27 | 27 | // Load Dolibarr environment |
| 28 | 28 | require '../main.inc.php'; |
| 29 | 29 | |
| 30 | -require_once DOL_DOCUMENT_ROOT . '/eventorganization/class/conferenceorboothattendee.class.php'; |
|
| 31 | -require_once DOL_DOCUMENT_ROOT . '/eventorganization/lib/eventorganization_conferenceorbooth.lib.php'; |
|
| 30 | +require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorboothattendee.class.php'; |
|
| 31 | +require_once DOL_DOCUMENT_ROOT.'/eventorganization/lib/eventorganization_conferenceorbooth.lib.php'; |
|
| 32 | 32 | |
| 33 | 33 | /** |
| 34 | 34 | * @var Conf $conf |
@@ -544,7 +544,7 @@ discard block |
||
| 544 | 544 | $this->ref_supplier = $obj->ref_supplier; |
| 545 | 545 | $this->socid = $obj->fk_soc; |
| 546 | 546 | $this->fourn_id = $obj->fk_soc; |
| 547 | - $this->statut = $obj->status; // deprecated |
|
| 547 | + $this->statut = $obj->status; // deprecated |
|
| 548 | 548 | $this->status = $obj->status; |
| 549 | 549 | $this->billed = $obj->billed; |
| 550 | 550 | $this->user_author_id = $obj->user_author_id; |
@@ -575,7 +575,7 @@ discard block |
||
| 575 | 575 | $this->fk_project = $obj->fk_project; |
| 576 | 576 | $this->cond_reglement_id = $obj->fk_cond_reglement; |
| 577 | 577 | $this->cond_reglement_code = $obj->cond_reglement_code; |
| 578 | - $this->cond_reglement = $obj->cond_reglement_label; // deprecated |
|
| 578 | + $this->cond_reglement = $obj->cond_reglement_label; // deprecated |
|
| 579 | 579 | $this->cond_reglement_label = $obj->cond_reglement_label; |
| 580 | 580 | $this->cond_reglement_doc = $obj->cond_reglement_doc; |
| 581 | 581 | $this->fk_account = $obj->fk_account; |
@@ -708,10 +708,10 @@ discard block |
||
| 708 | 708 | $sqlsearchpackage .= ' WHERE entity IN ('.getEntity('product_fournisseur_price').")"; |
| 709 | 709 | $sqlsearchpackage .= " AND fk_product = ".((int) $objp->fk_product); |
| 710 | 710 | $sqlsearchpackage .= " AND ref_fourn = '".$this->db->escape($objp->ref_supplier)."'"; |
| 711 | - $sqlsearchpackage .= " AND quantity <= ".((float) $objp->qty); // required to be qualified |
|
| 712 | - $sqlsearchpackage .= " AND (packaging IS NULL OR packaging = 0 OR packaging <= ".((float) $objp->qty).")"; // required to be qualified |
|
| 711 | + $sqlsearchpackage .= " AND quantity <= ".((float) $objp->qty); // required to be qualified |
|
| 712 | + $sqlsearchpackage .= " AND (packaging IS NULL OR packaging = 0 OR packaging <= ".((float) $objp->qty).")"; // required to be qualified |
|
| 713 | 713 | $sqlsearchpackage .= " AND fk_soc = ".((int) $this->socid); |
| 714 | - $sqlsearchpackage .= " ORDER BY packaging ASC"; // Take the smaller package first |
|
| 714 | + $sqlsearchpackage .= " ORDER BY packaging ASC"; // Take the smaller package first |
|
| 715 | 715 | $sqlsearchpackage .= " LIMIT 1"; |
| 716 | 716 | |
| 717 | 717 | $resqlsearchpackage = $this->db->query($sqlsearchpackage); |
@@ -739,7 +739,7 @@ discard block |
||
| 739 | 739 | $line->multicurrency_total_tva = $objp->multicurrency_total_tva; |
| 740 | 740 | $line->multicurrency_total_ttc = $objp->multicurrency_total_ttc; |
| 741 | 741 | |
| 742 | - $line->info_bits = $objp->info_bits; |
|
| 742 | + $line->info_bits = $objp->info_bits; |
|
| 743 | 743 | $line->special_code = $objp->special_code; |
| 744 | 744 | $line->fk_parent_line = $objp->fk_parent_line; |
| 745 | 745 | |
@@ -866,7 +866,7 @@ discard block |
||
| 866 | 866 | if (!$error) { |
| 867 | 867 | $result = 1; |
| 868 | 868 | $this->status = self::STATUS_VALIDATED; |
| 869 | - $this->statut = self::STATUS_VALIDATED; // deprecated |
|
| 869 | + $this->statut = self::STATUS_VALIDATED; // deprecated |
|
| 870 | 870 | $this->ref = $num; |
| 871 | 871 | } |
| 872 | 872 | |
@@ -1109,7 +1109,7 @@ discard block |
||
| 1109 | 1109 | } |
| 1110 | 1110 | |
| 1111 | 1111 | global $action; |
| 1112 | - $hookmanager->initHooks(array($this->element . 'dao')); |
|
| 1112 | + $hookmanager->initHooks(array($this->element.'dao')); |
|
| 1113 | 1113 | $parameters = array('id' => $this->id, 'getnomurl' => &$result); |
| 1114 | 1114 | $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks |
| 1115 | 1115 | if ($reshook > 0) { |
@@ -1600,7 +1600,7 @@ discard block |
||
| 1600 | 1600 | } |
| 1601 | 1601 | |
| 1602 | 1602 | // We set order into draft status |
| 1603 | - $this->statut = self::STATUS_DRAFT; // deprecated |
|
| 1603 | + $this->statut = self::STATUS_DRAFT; // deprecated |
|
| 1604 | 1604 | $this->status = self::STATUS_DRAFT; |
| 1605 | 1605 | |
| 1606 | 1606 | $sql = "INSERT INTO ".$this->db->prefix()."commande_fournisseur ("; |
@@ -1686,10 +1686,10 @@ discard block |
||
| 1686 | 1686 | $line->date_end, |
| 1687 | 1687 | $line->array_options, |
| 1688 | 1688 | $line->fk_unit, |
| 1689 | - $line->multicurrency_subprice, // pu_ht_devise |
|
| 1690 | - $line->origin, // origin |
|
| 1691 | - $line->origin_id, // origin_id |
|
| 1692 | - $line->rang, // rang |
|
| 1689 | + $line->multicurrency_subprice, // pu_ht_devise |
|
| 1690 | + $line->origin, // origin |
|
| 1691 | + $line->origin_id, // origin_id |
|
| 1692 | + $line->rang, // rang |
|
| 1693 | 1693 | $line->special_code |
| 1694 | 1694 | ); |
| 1695 | 1695 | if ($result < 0) { |
@@ -2063,7 +2063,7 @@ discard block |
||
| 2063 | 2063 | $this->db->begin(); |
| 2064 | 2064 | |
| 2065 | 2065 | $product_type = $type; |
| 2066 | - $label = ''; // deprecated |
|
| 2066 | + $label = ''; // deprecated |
|
| 2067 | 2067 | |
| 2068 | 2068 | if ($fk_product > 0) { |
| 2069 | 2069 | if (getDolGlobalInt('SUPPLIER_ORDER_WITH_PREDEFINED_PRICES_ONLY') == 1) { // Not the common case |
@@ -2125,7 +2125,7 @@ discard block |
||
| 2125 | 2125 | if ($qty < $prod->packaging) { |
| 2126 | 2126 | $qty = $prod->packaging; |
| 2127 | 2127 | } else { |
| 2128 | - if (!empty($prod->packaging) && (fmod((float) $qty, $prod->packaging) > 0.000001)) { |
|
| 2128 | + if (!empty($prod->packaging) && (fmod((float) $qty, $prod->packaging) > 0.000001)) { |
|
| 2129 | 2129 | $coeff = intval((float) $qty / $prod->packaging) + 1; |
| 2130 | 2130 | $qty = (float) $prod->packaging * $coeff; |
| 2131 | 2131 | setEventMessages($langs->trans('QtyRecalculatedWithPackaging'), null, 'mesgs'); |
@@ -2206,7 +2206,7 @@ discard block |
||
| 2206 | 2206 | $this->line->total_localtax2 = (float) $total_localtax2; |
| 2207 | 2207 | $this->line->total_ttc = (float) $total_ttc; |
| 2208 | 2208 | $this->line->product_type = $type; |
| 2209 | - $this->line->special_code = (!empty($special_code) ? $special_code : 0); |
|
| 2209 | + $this->line->special_code = (!empty($special_code) ? $special_code : 0); |
|
| 2210 | 2210 | $this->line->origin = $origin; |
| 2211 | 2211 | $this->line->origin_id = $origin_id; |
| 2212 | 2212 | $this->line->fk_unit = $fk_unit; |
@@ -2217,8 +2217,8 @@ discard block |
||
| 2217 | 2217 | // Multicurrency |
| 2218 | 2218 | $this->line->fk_multicurrency = $this->fk_multicurrency; |
| 2219 | 2219 | $this->line->multicurrency_code = $this->multicurrency_code; |
| 2220 | - $this->line->multicurrency_subprice = (float) $pu_ht_devise; |
|
| 2221 | - $this->line->multicurrency_total_ht = (float) $multicurrency_total_ht; |
|
| 2220 | + $this->line->multicurrency_subprice = (float) $pu_ht_devise; |
|
| 2221 | + $this->line->multicurrency_total_ht = (float) $multicurrency_total_ht; |
|
| 2222 | 2222 | $this->line->multicurrency_total_tva = (float) $multicurrency_total_tva; |
| 2223 | 2223 | $this->line->multicurrency_total_ttc = (float) $multicurrency_total_ttc; |
| 2224 | 2224 | |
@@ -3415,7 +3415,7 @@ discard block |
||
| 3415 | 3415 | global $conf, $langs; |
| 3416 | 3416 | |
| 3417 | 3417 | if (!dol_strlen($modele)) { |
| 3418 | - $modele = ''; // No doc template/generation by default |
|
| 3418 | + $modele = ''; // No doc template/generation by default |
|
| 3419 | 3419 | |
| 3420 | 3420 | if (!empty($this->model_pdf)) { |
| 3421 | 3421 | $modele = $this->model_pdf; |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | |
| 111 | 111 | $out .= '<div class="centpercent nobordernopadding valignmiddle"><div class="inline-block marginrightonly">'; |
| 112 | 112 | if ($maxmin > 0) { |
| 113 | - $out .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
| 113 | + $out .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
| 114 | 114 | } |
| 115 | 115 | $out .= '<input type="file" class="flat minwidth100 maxwidthinputfileonsmartphone" name="'.$htmlname.'" id="'.$htmlname.'" accept="image/*">'; |
| 116 | 116 | $out .= '</div>'; |
@@ -240,7 +240,7 @@ discard block |
||
| 240 | 240 | $maxphptoshow = $maxfilesizearray['maxphptoshow']; |
| 241 | 241 | $maxphptoshowparam = $maxfilesizearray['maxphptoshowparam']; |
| 242 | 242 | if ($maxmin > 0) { |
| 243 | - $out .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
| 243 | + $out .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
| 244 | 244 | } |
| 245 | 245 | $out .= '<input class="flat minwidth400 maxwidth200onsmartphone" type="file"'; |
| 246 | 246 | $out .= ((getDolGlobalString('MAIN_DISABLE_MULTIPLE_FILEUPLOAD') || $disablemulti) ? ' name="userfile"' : ' name="userfile[]" multiple'); |
@@ -956,7 +956,7 @@ discard block |
||
| 956 | 956 | |
| 957 | 957 | // Loop on each file found |
| 958 | 958 | if (is_array($file_list)) { |
| 959 | - '@phan-var-force array<array{name:string,path:string,level1name:string,relativename:string,fullname:string,date:string,size:int,perm:int,type:string}> $file_list'; // phan limitations loose typing information with empty() tests, etc. Force again. |
|
| 959 | + '@phan-var-force array<array{name:string,path:string,level1name:string,relativename:string,fullname:string,date:string,size:int,perm:int,type:string}> $file_list'; // phan limitations loose typing information with empty() tests, etc. Force again. |
|
| 960 | 960 | // Defined relative dir to DOL_DATA_ROOT |
| 961 | 961 | $relativedir = ''; |
| 962 | 962 | if ($filedir) { |
@@ -975,7 +975,7 @@ discard block |
||
| 975 | 975 | } |
| 976 | 976 | } |
| 977 | 977 | |
| 978 | - require_once DOL_DOCUMENT_ROOT . '/ecm/class/ecmfiles.class.php'; |
|
| 978 | + require_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmfiles.class.php'; |
|
| 979 | 979 | |
| 980 | 980 | $i = 0; |
| 981 | 981 | foreach ($file_list as $file) { |
@@ -1241,7 +1241,7 @@ discard block |
||
| 1241 | 1241 | |
| 1242 | 1242 | $this->infofiles['nboffiles']++; |
| 1243 | 1243 | $this->infofiles['files'][] = $file['fullname']; |
| 1244 | - $ext = (string) pathinfo($file['name'], PATHINFO_EXTENSION); // pathinfo returns a string here (cast for static analysis) |
|
| 1244 | + $ext = (string) pathinfo($file['name'], PATHINFO_EXTENSION); // pathinfo returns a string here (cast for static analysis) |
|
| 1245 | 1245 | if (!array_key_exists($ext, $this->infofiles['extensions'])) { |
| 1246 | 1246 | $this->infofiles['extensions'][$ext] = 1; |
| 1247 | 1247 | } else { |
@@ -1525,7 +1525,7 @@ discard block |
||
| 1525 | 1525 | $modulepart = basename(dirname($file['path'])); |
| 1526 | 1526 | } |
| 1527 | 1527 | if (empty($relativepath)) { |
| 1528 | - $relativepath = preg_replace('/\/(.+)/', '', $filepath) . '/'; |
|
| 1528 | + $relativepath = preg_replace('/\/(.+)/', '', $filepath).'/'; |
|
| 1529 | 1529 | } |
| 1530 | 1530 | |
| 1531 | 1531 | $editline = 0; |
@@ -1804,7 +1804,7 @@ discard block |
||
| 1804 | 1804 | |
| 1805 | 1805 | if ($nboflines > 1 && is_object($object)) { |
| 1806 | 1806 | if (!empty($conf->use_javascript_ajax) && $permtoeditline) { |
| 1807 | - $table_element_line = 'ecm_files'; // used by ajaxrow.tpl.php |
|
| 1807 | + $table_element_line = 'ecm_files'; // used by ajaxrow.tpl.php |
|
| 1808 | 1808 | include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php'; |
| 1809 | 1809 | } |
| 1810 | 1810 | } |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | * \brief File of class to generate document from standard template |
| 34 | 34 | */ |
| 35 | 35 | |
| 36 | -require_once DOL_DOCUMENT_ROOT . '/core/modules/asset/modules_asset.php'; |
|
| 36 | +require_once DOL_DOCUMENT_ROOT.'/core/modules/asset/modules_asset.php'; |
|
| 37 | 37 | require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; |
| 38 | 38 | require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; |
| 39 | 39 | require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | $this->situationinvoice = false; |
| 133 | 133 | |
| 134 | 134 | if ($mysoc === null) { |
| 135 | - dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'. getCallerInfoString(), LOG_ERR); |
|
| 135 | + dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'.getCallerInfoString(), LOG_ERR); |
|
| 136 | 136 | return; |
| 137 | 137 | } |
| 138 | 138 | // Get source company |
@@ -237,7 +237,7 @@ discard block |
||
| 237 | 237 | |
| 238 | 238 | // Set path to the background PDF File |
| 239 | 239 | if (getDolGlobalString('MAIN_ADD_PDF_BACKGROUND')) { |
| 240 | - $pagecount = $pdf->setSourceFile($conf->mycompany->multidir_output[$object->entity].'/' . getDolGlobalString('MAIN_ADD_PDF_BACKGROUND')); |
|
| 240 | + $pagecount = $pdf->setSourceFile($conf->mycompany->multidir_output[$object->entity].'/'.getDolGlobalString('MAIN_ADD_PDF_BACKGROUND')); |
|
| 241 | 241 | $tplidx = $pdf->importPage(1); |
| 242 | 242 | } |
| 243 | 243 | |
@@ -678,7 +678,7 @@ discard block |
||
| 678 | 678 | // Pagefoot |
| 679 | 679 | $this->_pagefoot($pdf, $object, $outputlangs); |
| 680 | 680 | if (method_exists($pdf, 'AliasNbPages')) { |
| 681 | - $pdf->AliasNbPages(); // @phan-suppress-current-line PhanUndeclaredMethod |
|
| 681 | + $pdf->AliasNbPages(); // @phan-suppress-current-line PhanUndeclaredMethod |
|
| 682 | 682 | } |
| 683 | 683 | |
| 684 | 684 | $pdf->Close(); |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | * \brief File of class to build ODT documents for assets |
| 29 | 29 | */ |
| 30 | 30 | |
| 31 | -require_once DOL_DOCUMENT_ROOT . '/core/modules/asset/modules_asset.php'; |
|
| 31 | +require_once DOL_DOCUMENT_ROOT.'/core/modules/asset/modules_asset.php'; |
|
| 32 | 32 | require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; |
| 33 | 33 | require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; |
| 34 | 34 | require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | $this->option_draft_watermark = 0; // Support add of a watermark on drafts |
| 85 | 85 | |
| 86 | 86 | if ($mysoc === null) { |
| 87 | - dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'. getCallerInfoString(), LOG_ERR); |
|
| 87 | + dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'.getCallerInfoString(), LOG_ERR); |
|
| 88 | 88 | return; |
| 89 | 89 | } |
| 90 | 90 | // Get source company |
@@ -282,7 +282,7 @@ discard block |
||
| 282 | 282 | dol_mkdir($conf->asset->dir_temp); |
| 283 | 283 | if (!is_writable($conf->asset->dir_temp)) { |
| 284 | 284 | $this->error = $langs->transnoentities("ErrorFailedToWriteInTempDirectory", $conf->asset->dir_temp); |
| 285 | - dol_syslog('Error in write_file: ' . $this->error, LOG_ERR); |
|
| 285 | + dol_syslog('Error in write_file: '.$this->error, LOG_ERR); |
|
| 286 | 286 | return -1; |
| 287 | 287 | } |
| 288 | 288 | |