@@ -163,17 +163,17 @@ discard block |
||
| 163 | 163 | '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"), |
| 164 | 164 | '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"), |
| 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', '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', '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', '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', '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', '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', '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', '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', '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', 'showoncombobox' => 2, 'validate' => 1,'comment' => "list of keywords, separated with comma. Must be limited to most important keywords."), |
|
| 173 | - '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."), |
|
| 172 | + '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."), |
|
| 173 | + '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."), |
|
| 174 | 174 | 'cover' => array('type' => 'text', 'label' => 'Cover', 'enabled' => 1, 'visible' => 0, 'position' => 130, 'comment' => "is this file a file to use for a cover"), |
| 175 | 175 | 'position' => array('type' => 'integer', 'label' => 'Position', 'default' => '1', 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 140, 'index' => 1, 'comment' => "position of file among others"), |
| 176 | - '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'"), |
|
| 176 | + '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'"), |
|
| 177 | 177 | '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"), |
| 178 | 178 | 'date_c' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => 1, 'visible' => -1, 'position' => 170), |
| 179 | 179 | 'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 175), |
@@ -462,27 +462,27 @@ discard block |
||
| 462 | 462 | $sql .= " AND t.filename = '".$this->db->escape($filename)."'"; |
| 463 | 463 | } |
| 464 | 464 | if (isset($entity)) { |
| 465 | - $sql .= " AND t.entity = " . (int) $entity; |
|
| 465 | + $sql .= " AND t.entity = ".(int) $entity; |
|
| 466 | 466 | } else { |
| 467 | - $sql .= " AND t.entity = " . $conf->entity; // unique key include the entity so each company has its own index |
|
| 467 | + $sql .= " AND t.entity = ".$conf->entity; // unique key include the entity so each company has its own index |
|
| 468 | 468 | } |
| 469 | 469 | $filterfound++; |
| 470 | 470 | } |
| 471 | 471 | if (!empty($ref)) { // hash of file path |
| 472 | 472 | $sql .= " AND t.ref = '".$this->db->escape($ref)."'"; |
| 473 | 473 | if (isset($entity)) { |
| 474 | - $sql .= " AND t.entity = " . (int) $entity; |
|
| 474 | + $sql .= " AND t.entity = ".(int) $entity; |
|
| 475 | 475 | } else { |
| 476 | - $sql .= " AND t.entity = " . $conf->entity; // unique key include the entity so each company has its own index |
|
| 476 | + $sql .= " AND t.entity = ".$conf->entity; // unique key include the entity so each company has its own index |
|
| 477 | 477 | } |
| 478 | 478 | $filterfound++; |
| 479 | 479 | } |
| 480 | 480 | if (!empty($hashoffile)) { // hash of content |
| 481 | 481 | $sql .= " AND t.label = '".$this->db->escape($hashoffile)."'"; |
| 482 | 482 | if (isset($entity)) { |
| 483 | - $sql .= " AND t.entity = " . (int) $entity; |
|
| 483 | + $sql .= " AND t.entity = ".(int) $entity; |
|
| 484 | 484 | } else { |
| 485 | - $sql .= " AND t.entity = " . $conf->entity; // unique key include the entity so each company has its own index |
|
| 485 | + $sql .= " AND t.entity = ".$conf->entity; // unique key include the entity so each company has its own index |
|
| 486 | 486 | } |
| 487 | 487 | $filterfound++; |
| 488 | 488 | } |
@@ -498,9 +498,9 @@ discard block |
||
| 498 | 498 | if ($src_object_type && $src_object_id) { |
| 499 | 499 | $sql .= " AND t.src_object_type = '".$this->db->escape($src_object_type)."' AND t.src_object_id = ".((int) $src_object_id); |
| 500 | 500 | if (isset($entity)) { |
| 501 | - $sql .= " AND t.entity = " . (int) $entity; |
|
| 501 | + $sql .= " AND t.entity = ".(int) $entity; |
|
| 502 | 502 | } else { |
| 503 | - $sql .= " AND t.entity = " . $conf->entity; // unique key include the entity so each company has its own index |
|
| 503 | + $sql .= " AND t.entity = ".$conf->entity; // unique key include the entity so each company has its own index |
|
| 504 | 504 | } |
| 505 | 505 | $filterfound++; |
| 506 | 506 | } |
@@ -971,7 +971,7 @@ discard block |
||
| 971 | 971 | if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) { |
| 972 | 972 | return ['optimize' => $langs->trans("ShowFile")]; |
| 973 | 973 | } |
| 974 | - $datas['picto'] = img_picto('', $this->picto, '', 0, 0, 0, '', 'paddingrightonly') . '<u>' . $langs->trans("File") . '</u>'; |
|
| 974 | + $datas['picto'] = img_picto('', $this->picto, '', 0, 0, 0, '', 'paddingrightonly').'<u>'.$langs->trans("File").'</u>'; |
|
| 975 | 975 | if (!empty($this->filename)) { |
| 976 | 976 | $datas['name'] = '<br><b>'.$langs->trans('Name').':</b> '.basename($this->filename); |
| 977 | 977 | } |
@@ -1084,7 +1084,7 @@ discard block |
||
| 1084 | 1084 | $result .= $linkstart.$this->filename.$linkend; |
| 1085 | 1085 | |
| 1086 | 1086 | global $action; |
| 1087 | - $hookmanager->initHooks(array($this->element . 'dao')); |
|
| 1087 | + $hookmanager->initHooks(array($this->element.'dao')); |
|
| 1088 | 1088 | $parameters = array('id' => $this->id, 'getnomurl' => &$result); |
| 1089 | 1089 | $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks |
| 1090 | 1090 | if ($reshook > 0) { |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | return false; |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | - $providerset = getDolGlobalString('MAIN_INFO_ITPROVIDER_NAME'); // Can be 'myself' |
|
| 86 | + $providerset = getDolGlobalString('MAIN_INFO_ITPROVIDER_NAME'); // Can be 'myself' |
|
| 87 | 87 | |
| 88 | 88 | if (empty($providerset)) { |
| 89 | 89 | return false; |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | return false; |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | - return true; // all conditions are ok to become a LNE certified version |
|
| 124 | + return true; // all conditions are ok to become a LNE certified version |
|
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | |
@@ -156,13 +156,13 @@ discard block |
||
| 156 | 156 | { |
| 157 | 157 | global $conf, $db; |
| 158 | 158 | |
| 159 | - $result = true; // by default restrictions are on, so we can't disable them |
|
| 159 | + $result = true; // by default restrictions are on, so we can't disable them |
|
| 160 | 160 | |
| 161 | 161 | // For the moment, we don't need this. We already have a feature that does not allow to disable the LNE rstriction by |
| 162 | 162 | // adding an inalterable event in the log. |
| 163 | 163 | if (!isModEnabled('blockedlog')) { |
| 164 | 164 | $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."blockedlog"; |
| 165 | - $sql .= " WHERE entity = ".((int) $conf->entity); // Sharing entity in blocked is disallowed |
|
| 165 | + $sql .= " WHERE entity = ".((int) $conf->entity); // Sharing entity in blocked is disallowed |
|
| 166 | 166 | if ($ignoresystem) { |
| 167 | 167 | $sql .= " AND action NOT IN ('MODULE_SET', 'MODULE_RESET')"; |
| 168 | 168 | } |
@@ -523,7 +523,7 @@ discard block |
||
| 523 | 523 | 'linkedObjectsIds', |
| 524 | 524 | 'linkedObjects', |
| 525 | 525 | 'fk_delivery_address', |
| 526 | - 'projet', // There is already ->fk_project |
|
| 526 | + 'projet', // There is already ->fk_project |
|
| 527 | 527 | 'restrictiononfksoc', |
| 528 | 528 | 'specimen', |
| 529 | 529 | ); |
@@ -874,18 +874,18 @@ discard block |
||
| 874 | 874 | if ($resql) { |
| 875 | 875 | $obj = $this->db->fetch_object($resql); |
| 876 | 876 | if ($obj) { |
| 877 | - $this->id = $obj->rowid; |
|
| 878 | - $this->entity = $obj->entity; |
|
| 877 | + $this->id = $obj->rowid; |
|
| 878 | + $this->entity = $obj->entity; |
|
| 879 | 879 | |
| 880 | - $this->date_creation = $this->db->jdate($obj->date_creation); // TODO Use gmt ? |
|
| 881 | - $this->date_modification = $this->db->jdate($obj->tms); // TODO Use gmt ? |
|
| 880 | + $this->date_creation = $this->db->jdate($obj->date_creation); // TODO Use gmt ? |
|
| 881 | + $this->date_modification = $this->db->jdate($obj->tms); // TODO Use gmt ? |
|
| 882 | 882 | |
| 883 | 883 | $this->amounts = (float) $obj->amounts; |
| 884 | 884 | $this->action = $obj->action; |
| 885 | 885 | $this->element = $obj->element; |
| 886 | 886 | |
| 887 | 887 | $this->fk_object = $obj->fk_object; |
| 888 | - $this->date_object = $this->db->jdate($obj->date_object); // TODO Use gmt ? |
|
| 888 | + $this->date_object = $this->db->jdate($obj->date_object); // TODO Use gmt ? |
|
| 889 | 889 | $this->ref_object = $obj->ref_object; |
| 890 | 890 | |
| 891 | 891 | $this->fk_user = $obj->fk_user; |
@@ -1014,14 +1014,14 @@ discard block |
||
| 1014 | 1014 | |
| 1015 | 1015 | $this->object_version = DOL_VERSION; |
| 1016 | 1016 | // The object_format define the formatting rules into buildKeyForSignature and buildFirstPartOfKeyForSignature and buildFinalSignatureHash |
| 1017 | - $this->object_format = 'V1'; // TODO Switch to V2 when v2 support is complete |
|
| 1017 | + $this->object_format = 'V1'; // TODO Switch to V2 when v2 support is complete |
|
| 1018 | 1018 | |
| 1019 | 1019 | try { |
| 1020 | 1020 | $previoushash = $this->getPreviousHash(1, 0); // This get last record and lock database until insert is done and transaction closed |
| 1021 | 1021 | |
| 1022 | - $concatenatedata = $this->buildKeyForSignature(); // All the information for the hash (meta data + data saved) |
|
| 1022 | + $concatenatedata = $this->buildKeyForSignature(); // All the information for the hash (meta data + data saved) |
|
| 1023 | 1023 | |
| 1024 | - $this->signature = $this->buildFinalSignatureHash($previoushash.$concatenatedata); // Build the hmac signature |
|
| 1024 | + $this->signature = $this->buildFinalSignatureHash($previoushash.$concatenatedata); // Build the hmac signature |
|
| 1025 | 1025 | } catch (Exception $e) { |
| 1026 | 1026 | $this->error = $e->getMessage(); |
| 1027 | 1027 | |
@@ -1032,7 +1032,7 @@ discard block |
||
| 1032 | 1032 | } |
| 1033 | 1033 | |
| 1034 | 1034 | // For debug: |
| 1035 | - $this->debuginfo = $this->buildFirstPartOfKeyForSignature(); // Note used |
|
| 1035 | + $this->debuginfo = $this->buildFirstPartOfKeyForSignature(); // Note used |
|
| 1036 | 1036 | |
| 1037 | 1037 | if ($forcesignature) { |
| 1038 | 1038 | $this->signature = $forcesignature; |
@@ -1055,7 +1055,7 @@ discard block |
||
| 1055 | 1055 | $sql .= " fk_user,"; |
| 1056 | 1056 | $sql .= " user_fullname,"; |
| 1057 | 1057 | $sql .= " entity,"; |
| 1058 | - $sql .= " debuginfo"; // Only stored |
|
| 1058 | + $sql .= " debuginfo"; // Only stored |
|
| 1059 | 1059 | $sql .= ") VALUES ("; |
| 1060 | 1060 | $sql .= "'".$this->db->idate($this->date_creation)."',"; |
| 1061 | 1061 | $sql .= "'".$this->db->escape($this->action)."',"; |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | $previoushash = ''; |
| 160 | 160 | $firstid = ''; |
| 161 | 161 | |
| 162 | - if (! (GETPOSTINT('yeartoexport') > 0)) { |
|
| 162 | + if (!(GETPOSTINT('yeartoexport') > 0)) { |
|
| 163 | 163 | setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Year")), null, "errors"); |
| 164 | 164 | $error++; |
| 165 | 165 | } else { |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | } |
| 193 | 193 | } |
| 194 | 194 | |
| 195 | - if (! $error) { |
|
| 195 | + if (!$error) { |
|
| 196 | 196 | // We record the export as a new line into the unalterable logs |
| 197 | 197 | require_once DOL_DOCUMENT_ROOT.'/blockedlog/class/blockedlog.class.php'; |
| 198 | 198 | $b = new BlockedLog($db); |
@@ -272,13 +272,13 @@ discard block |
||
| 272 | 272 | $block_static->entity = $obj->entity; |
| 273 | 273 | |
| 274 | 274 | |
| 275 | - $block_static->date_creation = $db->jdate($obj->date_creation); // TODO Use gmt |
|
| 275 | + $block_static->date_creation = $db->jdate($obj->date_creation); // TODO Use gmt |
|
| 276 | 276 | |
| 277 | - $block_static->amounts = (float) $obj->amounts; // Database store value with 8 digits, we cut ending 0 them with (flow) |
|
| 277 | + $block_static->amounts = (float) $obj->amounts; // Database store value with 8 digits, we cut ending 0 them with (flow) |
|
| 278 | 278 | $block_static->vat = $obj->vat; |
| 279 | 279 | |
| 280 | 280 | $block_static->action = $obj->action; |
| 281 | - $block_static->date_object = $db->jdate($obj->date_object); // TODO Use gmt ? |
|
| 281 | + $block_static->date_object = $db->jdate($obj->date_object); // TODO Use gmt ? |
|
| 282 | 282 | $block_static->ref_object = $obj->ref_object; |
| 283 | 283 | |
| 284 | 284 | $block_static->user_fullname = $obj->user_fullname; |
@@ -288,14 +288,14 @@ discard block |
||
| 288 | 288 | // Old hash + Previous fields concatenated = signature |
| 289 | 289 | $block_static->signature = $obj->signature; |
| 290 | 290 | |
| 291 | - $block_static->element = $obj->element; // Not in signature |
|
| 292 | - $block_static->fk_object = $obj->fk_object; // Not in signature |
|
| 291 | + $block_static->element = $obj->element; // Not in signature |
|
| 292 | + $block_static->fk_object = $obj->fk_object; // Not in signature |
|
| 293 | 293 | |
| 294 | - $block_static->fk_user = $obj->fk_user; // Not in signature |
|
| 294 | + $block_static->fk_user = $obj->fk_user; // Not in signature |
|
| 295 | 295 | |
| 296 | - $block_static->date_modification = $db->jdate($obj->tms); // Not in signature |
|
| 297 | - $block_static->object_version = $obj->object_version; // Not in signature |
|
| 298 | - $block_static->object_format = $obj->object_format; // Not in signature |
|
| 296 | + $block_static->date_modification = $db->jdate($obj->tms); // Not in signature |
|
| 297 | + $block_static->object_version = $obj->object_version; // Not in signature |
|
| 298 | + $block_static->object_format = $obj->object_format; // Not in signature |
|
| 299 | 299 | |
| 300 | 300 | $block_static->certified = ($obj->certified == 1); |
| 301 | 301 | |
@@ -731,7 +731,7 @@ discard block |
||
| 731 | 731 | // Link to debug information object |
| 732 | 732 | if (getDolGlobalString('MAIN_FEATURES_LEVEL') > 0) { // If in experimental or develop mode, we add some debug information. It may help developers to find origin of bugs. |
| 733 | 733 | print '<td class="tdoverflowmax150"'.(preg_match('/<a/', $object_link) ? '' : 'title="'.dol_escape_htmltag(dol_string_nohtmltag($object_link.($object_link_title ? ' - '.$object_link_title : ''))).'"').'>'; |
| 734 | - print '<!-- object_link -->'; // $object_link can be a '<a href' link or a text |
|
| 734 | + print '<!-- object_link -->'; // $object_link can be a '<a href' link or a text |
|
| 735 | 735 | print $object_link; |
| 736 | 736 | print '</td>'; |
| 737 | 737 | } |
@@ -308,7 +308,7 @@ discard block |
||
| 308 | 308 | $conf->global->SYSLOG_FILE = constant('SYSLOG_FILE'); |
| 309 | 309 | } |
| 310 | 310 | |
| 311 | - $conf->global->MAIN_ENABLE_LOG_TO_HTML = 1; // Add also log into conf->logbuffer. |
|
| 311 | + $conf->global->MAIN_ENABLE_LOG_TO_HTML = 1; // Add also log into conf->logbuffer. |
|
| 312 | 312 | |
| 313 | 313 | $versiontoarray = array(); |
| 314 | 314 | $versionranarray = array(); |
@@ -771,7 +771,7 @@ discard block |
||
| 771 | 771 | |
| 772 | 772 | if (!$error) { |
| 773 | 773 | // Set constant to ask to remake a new ping to inform about upgrade (if ping was already done and OK) |
| 774 | - $sql = 'UPDATE '.MAIN_DB_PREFIX."const SET VALUE = 'torefresh' WHERE name = 'MAIN_FIRST_PING_OK_ID'"; // This should be useless now because constant is uniqueid+' v'+version |
|
| 774 | + $sql = 'UPDATE '.MAIN_DB_PREFIX."const SET VALUE = 'torefresh' WHERE name = 'MAIN_FIRST_PING_OK_ID'"; // This should be useless now because constant is uniqueid+' v'+version |
|
| 775 | 775 | $db->query($sql, 1); |
| 776 | 776 | } |
| 777 | 777 | |
@@ -4369,7 +4369,7 @@ discard block |
||
| 4369 | 4369 | |
| 4370 | 4370 | if (!is_object($user)) { |
| 4371 | 4371 | include_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; |
| 4372 | - $user = new User($db); // To avoid error during migration |
|
| 4372 | + $user = new User($db); // To avoid error during migration |
|
| 4373 | 4373 | } |
| 4374 | 4374 | |
| 4375 | 4375 | dolibarr_install_syslog("upgrade2::migrate_reload_modules force=".$force.", listofmodule=".implode(',', array_keys($listofmodule)), LOG_NOTICE); |
@@ -4540,7 +4540,7 @@ discard block |
||
| 4540 | 4540 | |
| 4541 | 4541 | if (!is_object($user)) { |
| 4542 | 4542 | include_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; |
| 4543 | - $user = new User($db); // To avoid error during migration |
|
| 4543 | + $user = new User($db); // To avoid error during migration |
|
| 4544 | 4544 | } |
| 4545 | 4545 | |
| 4546 | 4546 | print '<tr><td colspan="4">'; |
@@ -4551,7 +4551,7 @@ discard block |
||
| 4551 | 4551 | $resql = $db->query($sql); |
| 4552 | 4552 | |
| 4553 | 4553 | if ($resql) { |
| 4554 | - $modulepart="product_batch"; |
|
| 4554 | + $modulepart = "product_batch"; |
|
| 4555 | 4555 | |
| 4556 | 4556 | $lot = new Productlot($db); |
| 4557 | 4557 | |
@@ -4565,7 +4565,7 @@ discard block |
||
| 4565 | 4565 | |
| 4566 | 4566 | if ($dir) { |
| 4567 | 4567 | $lot->id = $obj->rowid; |
| 4568 | - $lot->ref = $obj->id; // No ref for the moment |
|
| 4568 | + $lot->ref = $obj->id; // No ref for the moment |
|
| 4569 | 4569 | $lot->batch = $obj->batch; |
| 4570 | 4570 | $lot->entity = $obj->entity; |
| 4571 | 4571 | $lot->fk_product = $obj->fk_product; |
@@ -4573,10 +4573,10 @@ discard block |
||
| 4573 | 4573 | $savref = $lot->ref; |
| 4574 | 4574 | |
| 4575 | 4575 | $lot->ref = $obj->batch; |
| 4576 | - $origin = $dir . '/' . get_exdir(0, 0, 0, 1, $lot, $modulepart); |
|
| 4576 | + $origin = $dir.'/'.get_exdir(0, 0, 0, 1, $lot, $modulepart); |
|
| 4577 | 4577 | |
| 4578 | - $lot->ref = $savref; // So restore the id |
|
| 4579 | - $destin = $dir . '/' . get_exdir(0, 0, 0, 1, $lot, $modulepart); |
|
| 4578 | + $lot->ref = $savref; // So restore the id |
|
| 4579 | + $destin = $dir.'/'.get_exdir(0, 0, 0, 1, $lot, $modulepart); |
|
| 4580 | 4580 | |
| 4581 | 4581 | //var_dump($origin.' -> '.$destin.' '.$lot->batch.' dir origin is '.dol_is_dir($origin));exit; |
| 4582 | 4582 | |
@@ -5263,7 +5263,7 @@ discard block |
||
| 5263 | 5263 | $error++; |
| 5264 | 5264 | } |
| 5265 | 5265 | |
| 5266 | - $current_contract = $obj->cid; |
|
| 5266 | + $current_contract = $obj->cid; |
|
| 5267 | 5267 | } |
| 5268 | 5268 | } else { |
| 5269 | 5269 | $error++; |
@@ -5298,7 +5298,7 @@ discard block |
||
| 5298 | 5298 | print '<tr class="trforrunsql"><td colspan="4">'; |
| 5299 | 5299 | print '<b>'.$langs->trans('InvoiceExportModelsMigration')."</b>: \n"; |
| 5300 | 5300 | |
| 5301 | - if (! $migrationNeeded) { |
|
| 5301 | + if (!$migrationNeeded) { |
|
| 5302 | 5302 | print $langs->trans("AlreadyDone"); |
| 5303 | 5303 | print '</td></tr>'; |
| 5304 | 5304 | dolibarr_set_const($db, 'MIGRATION_FLAG_INVOICE_MODELS_V20', 1, 'chaine', 0, 'To flag the upgrade of invoice template has been set', 0); |
@@ -5312,7 +5312,7 @@ discard block |
||
| 5312 | 5312 | |
| 5313 | 5313 | $resql1 = $db->query($sql1); |
| 5314 | 5314 | |
| 5315 | - if (! $resql1) { |
|
| 5315 | + if (!$resql1) { |
|
| 5316 | 5316 | dol_print_error($db); |
| 5317 | 5317 | $db->rollback(); |
| 5318 | 5318 | print '</td></tr>'; |
@@ -5329,7 +5329,7 @@ discard block |
||
| 5329 | 5329 | |
| 5330 | 5330 | $resql2 = $db->query($sql2); |
| 5331 | 5331 | |
| 5332 | - if (! $resql2) { |
|
| 5332 | + if (!$resql2) { |
|
| 5333 | 5333 | dol_print_error($db); |
| 5334 | 5334 | $db->rollback(); |
| 5335 | 5335 | print '</td></tr>'; |
@@ -5386,7 +5386,7 @@ discard block |
||
| 5386 | 5386 | |
| 5387 | 5387 | $resql = $db->query($sql); |
| 5388 | 5388 | |
| 5389 | - require_once DOL_DOCUMENT_ROOT . '/accountancy/class/bookkeeping.class.php'; |
|
| 5389 | + require_once DOL_DOCUMENT_ROOT.'/accountancy/class/bookkeeping.class.php'; |
|
| 5390 | 5390 | $bookkeeping = new BookKeeping($db); |
| 5391 | 5391 | if ($resql) { |
| 5392 | 5392 | while ($obj = $db->fetch_object($resql)) { |
@@ -5528,7 +5528,7 @@ discard block |
||
| 5528 | 5528 | $hmac_encoded_secret_key = getDolGlobalString('BLOCKEDLOG_HMAC_KEY'); |
| 5529 | 5529 | if (empty($hmac_encoded_secret_key)) { |
| 5530 | 5530 | // Add key |
| 5531 | - $hmac_secret_key = 'BLOCKEDLOGHMAC'.getRandomPassword(true); // This is using random_int for 32 chars |
|
| 5531 | + $hmac_secret_key = 'BLOCKEDLOGHMAC'.getRandomPassword(true); // This is using random_int for 32 chars |
|
| 5532 | 5532 | |
| 5533 | 5533 | $result = dolibarr_set_const($db, 'BLOCKEDLOG_HMAC_KEY', $hmac_secret_key, 'chaine', 0, 'The secret key for HMAC used for blockedlog record', 0); |
| 5534 | 5534 | |
@@ -5545,7 +5545,7 @@ discard block |
||
| 5545 | 5545 | // Decode the HMAC key |
| 5546 | 5546 | $hmac_secret_key = dolDecrypt($hmac_encoded_secret_key); |
| 5547 | 5547 | |
| 5548 | - if (! preg_match('/^BLOCKEDLOGHMAC/', $hmac_secret_key)) { |
|
| 5548 | + if (!preg_match('/^BLOCKEDLOGHMAC/', $hmac_secret_key)) { |
|
| 5549 | 5549 | print 'Error: Failed to decode the crypted value of the parameter BLOCKEDLOG_HMAC_KEY using the $dolibarr_main_crypt_key. A value was found in config parameters in database but decoding failed. May be the database data were restored onto another environment and the coding/decoding key $dolibarr_main_dolcrypt_key was not restored with the same value in conf.php file.'; |
| 5550 | 5550 | print 'Restore the value of $dolibarr_main_crypt_key that was used for encryption in database and restart the migration.'; |
| 5551 | 5551 | print 'If you don\'t use the Unalterable Log module, you can also remove the BLOCKEDLOG_HMAC_KEY entry from llx_const table. If you use the Unalterable Log, this is not possible because this will invalidate all past record.'; |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | //@ini_set('memory_limit', '128M'); // This may be useless if memory is hard limited by your PHP |
| 43 | 43 | |
| 44 | 44 | // For optional tuning. Enabled if environment variable MAIN_SHOW_TUNING_INFO is defined. |
| 45 | -$micro_start_time = 0; // Used as global var into printCommonFooter() |
|
| 45 | +$micro_start_time = 0; // Used as global var into printCommonFooter() |
|
| 46 | 46 | if (!empty($_SERVER['MAIN_SHOW_TUNING_INFO'])) { |
| 47 | 47 | list($usec, $sec) = explode(" ", microtime()); |
| 48 | 48 | $micro_start_time = ((float) $usec + (float) $sec); |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | session_set_cookie_params($sessioncookieparams); |
| 132 | 132 | } |
| 133 | 133 | session_name($sessionname); |
| 134 | - dol_session_start(); // This call the open and read of session handler |
|
| 134 | + dol_session_start(); // This call the open and read of session handler |
|
| 135 | 135 | //exit; // this exist generates a call to write and close |
| 136 | 136 | } |
| 137 | 137 | |
@@ -176,12 +176,12 @@ discard block |
||
| 176 | 176 | if (!$ok) { |
| 177 | 177 | if (session_id() && isset($_SESSION["dol_login"]) && !in_array($_SESSION["dol_login"], explode(';', getDolGlobalString('MAIN_ONLY_LOGIN_ALLOWED')))) { |
| 178 | 178 | print 'Sorry, your application is offline.'."\n"; |
| 179 | - print 'You are logged with user "'.$_SESSION["dol_login"].'" and only administrator users (' . str_replace(';', ', ', getDolGlobalString('MAIN_ONLY_LOGIN_ALLOWED')).') is allowed to connect for the moment.'."\n"; |
|
| 180 | - $nexturl = dolBuildUrl(DOL_URL_ROOT . '/user/logout.php', [], true); |
|
| 179 | + print 'You are logged with user "'.$_SESSION["dol_login"].'" and only administrator users ('.str_replace(';', ', ', getDolGlobalString('MAIN_ONLY_LOGIN_ALLOWED')).') is allowed to connect for the moment.'."\n"; |
|
| 180 | + $nexturl = dolBuildUrl(DOL_URL_ROOT.'/user/logout.php', [], true); |
|
| 181 | 181 | print 'Please try later or <a href="'.$nexturl.'">click here to disconnect and change login user</a>...'."\n"; |
| 182 | 182 | } else { |
| 183 | - print 'Sorry, your application is offline. Only administrator users (' . str_replace(';', ', ', getDolGlobalString('MAIN_ONLY_LOGIN_ALLOWED')).') is allowed to connect for the moment.'."\n"; |
|
| 184 | - $nexturl = dolBuildUrl(DOL_URL_ROOT . '/'); |
|
| 183 | + print 'Sorry, your application is offline. Only administrator users ('.str_replace(';', ', ', getDolGlobalString('MAIN_ONLY_LOGIN_ALLOWED')).') is allowed to connect for the moment.'."\n"; |
|
| 184 | + $nexturl = dolBuildUrl(DOL_URL_ROOT.'/'); |
|
| 185 | 185 | print 'Please try later or <a href="'.$nexturl.'">click here to change login user</a>...'."\n"; |
| 186 | 186 | } |
| 187 | 187 | exit; |
@@ -396,7 +396,7 @@ discard block |
||
| 396 | 396 | print "Access to this page this way (POST method or GET with a sensible value for 'action' parameter) is refused by CSRF protection in main.inc.php. Token not provided.\n"; |
| 397 | 397 | print "If you access your server behind a proxy using url rewriting and the parameter is provided by caller, you might check that all HTTP header are propagated (or add the line \$dolibarr_nocsrfcheck=1 into your conf.php file or MAIN_SECURITY_CSRF_WITH_TOKEN to 0"; |
| 398 | 398 | if (getDolGlobalString('MAIN_SECURITY_CSRF_WITH_TOKEN')) { |
| 399 | - print " instead of " . getDolGlobalString('MAIN_SECURITY_CSRF_WITH_TOKEN'); |
|
| 399 | + print " instead of ".getDolGlobalString('MAIN_SECURITY_CSRF_WITH_TOKEN'); |
|
| 400 | 400 | } |
| 401 | 401 | print " into setup).\n"; |
| 402 | 402 | } |
@@ -424,7 +424,7 @@ discard block |
||
| 424 | 424 | unset($_GET['action']); |
| 425 | 425 | unset($_GET['confirmmassaction']); |
| 426 | 426 | unset($_GET['massaction']); |
| 427 | - unset($_GET['token']); // TODO Make a redirect if we have a token in url to remove it ? |
|
| 427 | + unset($_GET['token']); // TODO Make a redirect if we have a token in url to remove it ? |
|
| 428 | 428 | if (isset($savid)) { |
| 429 | 429 | $_POST['id'] = ((int) $savid); |
| 430 | 430 | } |
@@ -446,18 +446,18 @@ discard block |
||
| 446 | 446 | foreach ($disabled_modules as $module) { |
| 447 | 447 | if ($module) { |
| 448 | 448 | if (empty($conf->$module)) { |
| 449 | - $conf->$module = new stdClass(); // To avoid warnings |
|
| 449 | + $conf->$module = new stdClass(); // To avoid warnings |
|
| 450 | 450 | } |
| 451 | 451 | |
| 452 | - $conf->$module->enabled = false; // Old usage |
|
| 452 | + $conf->$module->enabled = false; // Old usage |
|
| 453 | 453 | unset($conf->modules[$module]); |
| 454 | 454 | |
| 455 | 455 | foreach ($modulepartkeys as $modulepartkey) { |
| 456 | 456 | unset($conf->modules_parts[$modulepartkey][$module]); |
| 457 | 457 | } |
| 458 | 458 | if ($module == 'fournisseur') { // Special case |
| 459 | - $conf->supplier_order->enabled = 0; // Old usage |
|
| 460 | - $conf->supplier_invoice->enabled = 0; // Old usage |
|
| 459 | + $conf->supplier_order->enabled = 0; // Old usage |
|
| 460 | + $conf->supplier_invoice->enabled = 0; // Old usage |
|
| 461 | 461 | unset($conf->modules['supplier_order']); |
| 462 | 462 | unset($conf->modules['supplier_invoice']); |
| 463 | 463 | } |
@@ -554,7 +554,7 @@ discard block |
||
| 554 | 554 | if ($dol_use_jmobile) { |
| 555 | 555 | $query += ['dol_use_jmobile='.$dol_use_jmobile]; |
| 556 | 556 | } |
| 557 | - header("Location: " . dolBuildUrl(DOL_URL_ROOT . '/public/demo/index.php', $query)); |
|
| 557 | + header("Location: ".dolBuildUrl(DOL_URL_ROOT.'/public/demo/index.php', $query)); |
|
| 558 | 558 | exit; |
| 559 | 559 | } |
| 560 | 560 | } |
@@ -602,12 +602,12 @@ discard block |
||
| 602 | 602 | if (is_object($captchaobj) && method_exists($captchaobj, 'validateCodeAfterLoginSubmit')) { |
| 603 | 603 | $ok = $captchaobj->validateCodeAfterLoginSubmit(); // @phan-suppress-current-line PhanUndeclaredMethod |
| 604 | 604 | } else { |
| 605 | - $_SESSION["dol_loginmesg"] = 'Error, the captcha handler '.get_class($captchaobj).' does not have any method validateCodeAfterLoginSubmit()'; |
|
| 605 | + $_SESSION["dol_loginmesg"] = 'Error, the captcha handler '.get_class($captchaobj).' does not have any method validateCodeAfterLoginSubmit()'; |
|
| 606 | 606 | $test = false; |
| 607 | 607 | $error++; |
| 608 | 608 | } |
| 609 | 609 | } else { |
| 610 | - $_SESSION["dol_loginmesg"] = 'Error, the captcha handler class '.$classname.' was not found after the include'; |
|
| 610 | + $_SESSION["dol_loginmesg"] = 'Error, the captcha handler class '.$classname.' was not found after the include'; |
|
| 611 | 611 | $test = false; |
| 612 | 612 | $error++; |
| 613 | 613 | } |
@@ -651,7 +651,7 @@ discard block |
||
| 651 | 651 | |
| 652 | 652 | $allowedmethodtopostusername = 3; |
| 653 | 653 | if (defined('MAIN_AUTHENTICATION_POST_METHOD')) { |
| 654 | - $allowedmethodtopostusername = constant('MAIN_AUTHENTICATION_POST_METHOD'); // Note a value of 2 is not compatible with some authentication methods that put username as GET parameter |
|
| 654 | + $allowedmethodtopostusername = constant('MAIN_AUTHENTICATION_POST_METHOD'); // Note a value of 2 is not compatible with some authentication methods that put username as GET parameter |
|
| 655 | 655 | } |
| 656 | 656 | // TODO Remove use of $_COOKIE['login_dolibarr'] by replacing line with $usertotest = GETPOST("username", "alpha", $allowedmethodtopostusername); ? |
| 657 | 657 | $usertotest = (!empty($_COOKIE['login_dolibarr']) ? preg_replace('/[^a-zA-Z0-9_@\-\.]/', '', $_COOKIE['login_dolibarr']) : GETPOST("username", "alpha", $allowedmethodtopostusername)); |
@@ -800,7 +800,7 @@ discard block |
||
| 800 | 800 | } |
| 801 | 801 | |
| 802 | 802 | // Show login form |
| 803 | - dol_loginfunction($langs, $conf, (!empty($mysoc) ? $mysoc : '')); // This include http headers |
|
| 803 | + dol_loginfunction($langs, $conf, (!empty($mysoc) ? $mysoc : '')); // This include http headers |
|
| 804 | 804 | } |
| 805 | 805 | exit; |
| 806 | 806 | } |
@@ -861,7 +861,7 @@ discard block |
||
| 861 | 861 | if (GETPOST('lang', 'aZ09')) { |
| 862 | 862 | $paramsurl += ['lang' => (string) GETPOST('lang', 'aZ09')]; |
| 863 | 863 | } |
| 864 | - header('Location: '.dolBuildUrl(DOL_URL_ROOT . '/index.php', $paramsurl)); |
|
| 864 | + header('Location: '.dolBuildUrl(DOL_URL_ROOT.'/index.php', $paramsurl)); |
|
| 865 | 865 | exit; |
| 866 | 866 | } else { |
| 867 | 867 | // User is loaded, we may need to change language for him according to its choice |
@@ -1158,7 +1158,7 @@ discard block |
||
| 1158 | 1158 | } else { |
| 1159 | 1159 | // We may have NOLOGIN set, but NOREQUIREUSER not |
| 1160 | 1160 | if (!empty($user) && method_exists($user, 'loadDefaultValues') && !defined('NODEFAULTVALUES')) { |
| 1161 | - $user->loadDefaultValues(); // Load default values for everybody (works even if $user->id = 0 |
|
| 1161 | + $user->loadDefaultValues(); // Load default values for everybody (works even if $user->id = 0 |
|
| 1162 | 1162 | } |
| 1163 | 1163 | } |
| 1164 | 1164 | |
@@ -1221,7 +1221,7 @@ discard block |
||
| 1221 | 1221 | $conf->dol_optimize_smallscreen = 1; |
| 1222 | 1222 | |
| 1223 | 1223 | if (getDolGlobalInt('PRODUIT_DESC_IN_FORM') == 1) { |
| 1224 | - $conf->global->PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE = 0; // This was set to PRODUIT_DESC_IN_FORM and is forced to 0 if smartphone in this case |
|
| 1224 | + $conf->global->PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE = 0; // This was set to PRODUIT_DESC_IN_FORM and is forced to 0 if smartphone in this case |
|
| 1225 | 1225 | } |
| 1226 | 1226 | } |
| 1227 | 1227 | // Replace themes bugged with jmobile with eldy |
@@ -1324,7 +1324,7 @@ discard block |
||
| 1324 | 1324 | define('ROWS_9', 8); |
| 1325 | 1325 | } |
| 1326 | 1326 | |
| 1327 | -$heightforframes = 52; // Used by frames.php page |
|
| 1327 | +$heightforframes = 52; // Used by frames.php page |
|
| 1328 | 1328 | |
| 1329 | 1329 | // Init menu manager |
| 1330 | 1330 | if (!defined('NOREQUIREMENU')) { |
@@ -1364,7 +1364,7 @@ discard block |
||
| 1364 | 1364 | |
| 1365 | 1365 | if (!empty(GETPOST('seteventmessages', 'alpha'))) { |
| 1366 | 1366 | $message = GETPOST('seteventmessages', 'alpha'); |
| 1367 | - $messages = explode(',', $message); |
|
| 1367 | + $messages = explode(',', $message); |
|
| 1368 | 1368 | foreach ($messages as $key => $msg) { |
| 1369 | 1369 | $tmp = explode(':', $msg); |
| 1370 | 1370 | setEventMessages($tmp[0], null, !empty($tmp[1]) ? $tmp[1] : 'mesgs'); |
@@ -1703,7 +1703,7 @@ discard block |
||
| 1703 | 1703 | } |
| 1704 | 1704 | |
| 1705 | 1705 | if (getDolGlobalString('THEME_ELDY_TOPMENU_BACK1')) { |
| 1706 | - print '<meta name="theme-color" content="rgb(' . getDolGlobalString('THEME_ELDY_TOPMENU_BACK1').')">'."\n"; |
|
| 1706 | + print '<meta name="theme-color" content="rgb('.getDolGlobalString('THEME_ELDY_TOPMENU_BACK1').')">'."\n"; |
|
| 1707 | 1707 | } |
| 1708 | 1708 | |
| 1709 | 1709 | // Auto refresh page |
@@ -1752,7 +1752,7 @@ discard block |
||
| 1752 | 1752 | |
| 1753 | 1753 | $themeparam = '?lang='.$langs->defaultlang.'&theme='.$conf->theme.(GETPOST('optioncss', 'aZ09') ? '&optioncss='.GETPOST('optioncss', 'aZ09', 1) : '').(empty($user->id) ? '' : ('&userid='.$user->id)).'&entity='.$conf->entity; |
| 1754 | 1754 | |
| 1755 | - $themeparam .= '&' .$ext . '&revision='.getDolGlobalInt("MAIN_IHM_PARAMS_REV"); |
|
| 1755 | + $themeparam .= '&'.$ext.'&revision='.getDolGlobalInt("MAIN_IHM_PARAMS_REV"); |
|
| 1756 | 1756 | if (GETPOSTISSET('dol_hide_topmenu')) { |
| 1757 | 1757 | $themeparam .= '&dol_hide_topmenu='.GETPOSTINT('dol_hide_topmenu'); |
| 1758 | 1758 | } |
@@ -1792,24 +1792,24 @@ discard block |
||
| 1792 | 1792 | $jquerytheme = getDolGlobalString('MAIN_USE_JQUERY_THEME'); |
| 1793 | 1793 | } |
| 1794 | 1794 | if (constant('JS_JQUERY_UI')) { |
| 1795 | - print '<link rel="stylesheet" type="text/css" href="' . JS_JQUERY_UI . 'css/' . $jquerytheme . '/jquery-ui.min.css?' . $ext . '">' . "\n"; // Forced JQuery |
|
| 1795 | + print '<link rel="stylesheet" type="text/css" href="'.JS_JQUERY_UI.'css/'.$jquerytheme.'/jquery-ui.min.css?'.$ext.'">'."\n"; // Forced JQuery |
|
| 1796 | 1796 | } else { |
| 1797 | - print '<link rel="stylesheet" type="text/css" href="' . DOL_URL_ROOT . '/includes/jquery/css/' . $jquerytheme . '/jquery-ui.css?' . $ext . '">' . "\n"; // JQuery |
|
| 1797 | + print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/css/'.$jquerytheme.'/jquery-ui.css?'.$ext.'">'."\n"; // JQuery |
|
| 1798 | 1798 | } |
| 1799 | 1799 | } |
| 1800 | 1800 | if (!defined('DISABLE_JQUERY_JNOTIFY')) { |
| 1801 | - print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/plugins/jnotify/jquery.jnotify-alt.min.css?' . $ext . '">'."\n"; // JNotify |
|
| 1801 | + print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/plugins/jnotify/jquery.jnotify-alt.min.css?'.$ext.'">'."\n"; // JNotify |
|
| 1802 | 1802 | } |
| 1803 | 1803 | if (!defined('DISABLE_SELECT2') && (getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') || defined('REQUIRE_JQUERY_MULTISELECT'))) { // jQuery plugin "mutiselect", "multiple-select", "select2"... |
| 1804 | 1804 | $tmpplugin = !getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') ? constant('REQUIRE_JQUERY_MULTISELECT') : getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT'); |
| 1805 | - print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/plugins/'.$tmpplugin.'/dist/css/'.$tmpplugin.'.css?' . $ext . '">'."\n"; |
|
| 1805 | + print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/plugins/'.$tmpplugin.'/dist/css/'.$tmpplugin.'.css?'.$ext.'">'."\n"; |
|
| 1806 | 1806 | } |
| 1807 | 1807 | } |
| 1808 | 1808 | |
| 1809 | 1809 | if (!defined('DISABLE_FONT_AWSOME')) { |
| 1810 | 1810 | print '<!-- Includes CSS for font awesome -->'."\n"; |
| 1811 | 1811 | $fontawesome_directory = getDolGlobalString('MAIN_FONTAWESOME_DIRECTORY', '/theme/common/fontawesome-5'); |
| 1812 | - print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.$fontawesome_directory.'/css/all.min.css?' . $ext . '">'."\n"; |
|
| 1812 | + print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.$fontawesome_directory.'/css/all.min.css?'.$ext.'">'."\n"; |
|
| 1813 | 1813 | } |
| 1814 | 1814 | |
| 1815 | 1815 | // Output style sheets (optioncss='print' or ''). Note: $conf->css looks like '/theme/eldy/style.css.php' |
@@ -1827,7 +1827,7 @@ discard block |
||
| 1827 | 1827 | |
| 1828 | 1828 | if (!defined('DISABLE_CSS_DEFAULT_THEME')) { |
| 1829 | 1829 | print '<!-- Includes CSS for Dolibarr theme -->'."\n"; |
| 1830 | - print '<link rel="stylesheet" type="text/css" href="' . $themepath . $themeparam . '">' . "\n"; |
|
| 1830 | + print '<link rel="stylesheet" type="text/css" href="'.$themepath.$themeparam.'">'."\n"; |
|
| 1831 | 1831 | } |
| 1832 | 1832 | |
| 1833 | 1833 | // To fix old chrome bug |
@@ -1839,8 +1839,8 @@ discard block |
||
| 1839 | 1839 | |
| 1840 | 1840 | // LEAFLET AND GEOMAN |
| 1841 | 1841 | if (getDolGlobalString('MAIN_USE_GEOPHP')) { |
| 1842 | - print '<link rel="stylesheet" href="'.DOL_URL_ROOT.'/includes/leaflet/leaflet.css?' . $ext . "\">\n"; |
|
| 1843 | - print '<link rel="stylesheet" href="'.DOL_URL_ROOT.'/includes/leaflet/leaflet-geoman.css?' . $ext . "\">\n"; |
|
| 1842 | + print '<link rel="stylesheet" href="'.DOL_URL_ROOT.'/includes/leaflet/leaflet.css?'.$ext."\">\n"; |
|
| 1843 | + print '<link rel="stylesheet" href="'.DOL_URL_ROOT.'/includes/leaflet/leaflet-geoman.css?'.$ext."\">\n"; |
|
| 1844 | 1844 | } |
| 1845 | 1845 | |
| 1846 | 1846 | // CSS forced by modules (relative url starting with /) |
@@ -1887,7 +1887,7 @@ discard block |
||
| 1887 | 1887 | // Custom CSS |
| 1888 | 1888 | if (getDolGlobalString('MAIN_IHM_CUSTOM_CSS')) { |
| 1889 | 1889 | // If a custom CSS was set, we add link to the custom css php file |
| 1890 | - print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/theme/custom.css.php?' . $ext . '&revision='.getDolGlobalInt("MAIN_IHM_PARAMS_REV").'">'."\n"; |
|
| 1890 | + print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/theme/custom.css.php?'.$ext.'&revision='.getDolGlobalInt("MAIN_IHM_PARAMS_REV").'">'."\n"; |
|
| 1891 | 1891 | } |
| 1892 | 1892 | |
| 1893 | 1893 | // Output standard javascript links |
@@ -1895,36 +1895,36 @@ discard block |
||
| 1895 | 1895 | // JQuery. Must be before other includes |
| 1896 | 1896 | print '<!-- Includes JS for JQuery -->'."\n"; |
| 1897 | 1897 | if (defined('JS_JQUERY') && constant('JS_JQUERY')) { |
| 1898 | - print '<script nonce="'.getNonce().'" src="'.JS_JQUERY.'jquery.min.js?' . $ext . '"></script>'."\n"; |
|
| 1898 | + print '<script nonce="'.getNonce().'" src="'.JS_JQUERY.'jquery.min.js?'.$ext.'"></script>'."\n"; |
|
| 1899 | 1899 | } else { |
| 1900 | - print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/jquery/js/jquery.min.js?' . $ext . '"></script>'."\n"; |
|
| 1900 | + print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/jquery/js/jquery.min.js?'.$ext.'"></script>'."\n"; |
|
| 1901 | 1901 | } |
| 1902 | 1902 | if (!defined('DISABLE_JQUERY_UI')) { |
| 1903 | 1903 | if (defined('JS_JQUERY_UI') && constant('JS_JQUERY_UI')) { |
| 1904 | - print '<script nonce="' . getNonce() . '" src="' . JS_JQUERY_UI . 'jquery-ui.min.js?' . $ext . '"></script>' . "\n"; |
|
| 1904 | + print '<script nonce="'.getNonce().'" src="'.JS_JQUERY_UI.'jquery-ui.min.js?'.$ext.'"></script>'."\n"; |
|
| 1905 | 1905 | } else { |
| 1906 | - print '<script nonce="' . getNonce() . '" src="' . DOL_URL_ROOT . '/includes/jquery/js/jquery-ui.min.js?' . $ext . '"></script>' . "\n"; |
|
| 1906 | + print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/jquery/js/jquery-ui.min.js?'.$ext.'"></script>'."\n"; |
|
| 1907 | 1907 | } |
| 1908 | 1908 | } |
| 1909 | 1909 | // jQuery jnotify |
| 1910 | 1910 | if (!getDolGlobalString('MAIN_DISABLE_JQUERY_JNOTIFY') && !defined('DISABLE_JQUERY_JNOTIFY')) { |
| 1911 | - print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/jnotify/jquery.jnotify.min.js?' . $ext . '"></script>'."\n"; |
|
| 1911 | + print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/jnotify/jquery.jnotify.min.js?'.$ext.'"></script>'."\n"; |
|
| 1912 | 1912 | } |
| 1913 | 1913 | // Table drag and drop lines |
| 1914 | 1914 | if (empty($disableforlogin) && !defined('DISABLE_JQUERY_TABLEDND')) { |
| 1915 | - print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/tablednd/jquery.tablednd.min.js?' . $ext . '"></script>'."\n"; |
|
| 1915 | + print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/tablednd/jquery.tablednd.min.js?'.$ext.'"></script>'."\n"; |
|
| 1916 | 1916 | } |
| 1917 | 1917 | // Chart |
| 1918 | 1918 | if (empty($disableforlogin) && (!getDolGlobalString('MAIN_JS_GRAPH') || getDolGlobalString('MAIN_JS_GRAPH') == 'chart') && !defined('DISABLE_JS_GRAPH')) { |
| 1919 | - print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/nnnick/chartjs/dist/chart.min.js?' . $ext . '"></script>'."\n"; |
|
| 1919 | + print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/nnnick/chartjs/dist/chart.min.js?'.$ext.'"></script>'."\n"; |
|
| 1920 | 1920 | } |
| 1921 | 1921 | |
| 1922 | 1922 | // jQuery jeditable for Edit In Place features |
| 1923 | 1923 | if (getDolGlobalString('MAIN_USE_JQUERY_JEDITABLE') && !defined('DISABLE_JQUERY_JEDITABLE')) { |
| 1924 | 1924 | print '<!-- JS to manage editInPlace feature -->'."\n"; |
| 1925 | - print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/jeditable/jquery.jeditable.js?' . $ext . '"></script>'."\n"; |
|
| 1926 | - print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/jeditable/jquery.jeditable.ui-datepicker.js?' . $ext . '"></script>'."\n"; |
|
| 1927 | - print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/jeditable/jquery.jeditable.ui-autocomplete.js?' . $ext . '"></script>'."\n"; |
|
| 1925 | + print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/jeditable/jquery.jeditable.js?'.$ext.'"></script>'."\n"; |
|
| 1926 | + print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/jeditable/jquery.jeditable.ui-datepicker.js?'.$ext.'"></script>'."\n"; |
|
| 1927 | + print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/jeditable/jquery.jeditable.ui-autocomplete.js?'.$ext.'"></script>'."\n"; |
|
| 1928 | 1928 | print '<script>'."\n"; |
| 1929 | 1929 | print 'var urlSaveInPlace = \''.DOL_URL_ROOT.'/core/ajax/saveinplace.php\';'."\n"; |
| 1930 | 1930 | print 'var urlLoadInPlace = \''.DOL_URL_ROOT.'/core/ajax/loadinplace.php\';'."\n"; |
@@ -1935,16 +1935,16 @@ discard block |
||
| 1935 | 1935 | print 'var indicatorInPlace = \'<img src="'.DOL_URL_ROOT."/theme/".$conf->theme."/img/working.gif".'">\';'."\n"; |
| 1936 | 1936 | print 'var withInPlace = 300;'; // width in pixel for default string edit |
| 1937 | 1937 | print '</script>'."\n"; |
| 1938 | - print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/core/js/editinplace.js?' . $ext . '"></script>'."\n"; |
|
| 1939 | - print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/jeditable/jquery.jeditable.ckeditor.js?' . $ext . '"></script>'."\n"; |
|
| 1938 | + print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/core/js/editinplace.js?'.$ext.'"></script>'."\n"; |
|
| 1939 | + print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/jeditable/jquery.jeditable.ckeditor.js?'.$ext.'"></script>'."\n"; |
|
| 1940 | 1940 | } |
| 1941 | 1941 | if (!defined('DISABLE_SELECT2') && (getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') || defined('REQUIRE_JQUERY_MULTISELECT'))) { |
| 1942 | 1942 | // jQuery plugin "mutiselect", "multiple-select", "select2", ... |
| 1943 | 1943 | $tmpplugin = !getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT') ? constant('REQUIRE_JQUERY_MULTISELECT') : getDolGlobalString('MAIN_USE_JQUERY_MULTISELECT'); |
| 1944 | - print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/'.$tmpplugin.'/dist/js/'.$tmpplugin.'.full.min.js?' . $ext . '"></script>'."\n"; // We include full because we need the support of containerCssClass |
|
| 1944 | + print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/'.$tmpplugin.'/dist/js/'.$tmpplugin.'.full.min.js?'.$ext.'"></script>'."\n"; // We include full because we need the support of containerCssClass |
|
| 1945 | 1945 | } |
| 1946 | 1946 | if (!defined('DISABLE_MULTISELECT')) { // jQuery plugin "mutiselect" to select with checkboxes. Can be removed once we have an enhanced search tool |
| 1947 | - print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/multiselect/jquery.multi-select.js?' . $ext . '"></script>'."\n"; |
|
| 1947 | + print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/multiselect/jquery.multi-select.js?'.$ext.'"></script>'."\n"; |
|
| 1948 | 1948 | } |
| 1949 | 1949 | } |
| 1950 | 1950 | |
@@ -1961,11 +1961,11 @@ discard block |
||
| 1961 | 1961 | print '<script nonce="'.getNonce().'">'; |
| 1962 | 1962 | print '/* enable ckeditor by main.inc.php */'; |
| 1963 | 1963 | print 'var CKEDITOR_BASEPATH = \''.dol_escape_js($pathckeditor).'\';'."\n"; |
| 1964 | - print 'var ckeditorConfig = \''.dol_escape_js(dol_buildpath($themesubdir.'/theme/'.$conf->theme.'/ckeditor/config.js?' . $ext, 1)).'\';'."\n"; // $themesubdir='' in standard usage |
|
| 1964 | + print 'var ckeditorConfig = \''.dol_escape_js(dol_buildpath($themesubdir.'/theme/'.$conf->theme.'/ckeditor/config.js?'.$ext, 1)).'\';'."\n"; // $themesubdir='' in standard usage |
|
| 1965 | 1965 | print 'var ckeditorFilebrowserBrowseUrl = \''.DOL_URL_ROOT.'/core/filemanagerdol/browser/default/browser.php?Connector='.DOL_URL_ROOT.'/core/filemanagerdol/connectors/php/connector.php\';'."\n"; |
| 1966 | 1966 | print 'var ckeditorFilebrowserImageBrowseUrl = \''.DOL_URL_ROOT.'/core/filemanagerdol/browser/default/browser.php?Type=Image&Connector='.DOL_URL_ROOT.'/core/filemanagerdol/connectors/php/connector.php\';'."\n"; |
| 1967 | 1967 | print '</script>'."\n"; |
| 1968 | - print '<script src="'.$pathckeditor.$jsckeditor. '?' . $ext . '"></script>'."\n"; |
|
| 1968 | + print '<script src="'.$pathckeditor.$jsckeditor.'?'.$ext.'"></script>'."\n"; |
|
| 1969 | 1969 | print '<script>'; |
| 1970 | 1970 | if (GETPOST('mode', 'aZ09') == 'Full_inline') { |
| 1971 | 1971 | print 'CKEDITOR.disableAutoInline = false;'."\n"; |
@@ -1986,20 +1986,20 @@ discard block |
||
| 1986 | 1986 | } |
| 1987 | 1987 | if ($enablebrowsernotif) { |
| 1988 | 1988 | print '<!-- Includes JS of Dolibarr (browser layout = '.$conf->browser->layout.')-->'."\n"; |
| 1989 | - print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/core/js/lib_notification.js.php?lang='.$langs->defaultlang. '&' . $ext . '"></script>'."\n"; |
|
| 1989 | + print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/core/js/lib_notification.js.php?lang='.$langs->defaultlang.'&'.$ext.'"></script>'."\n"; |
|
| 1990 | 1990 | } |
| 1991 | 1991 | } |
| 1992 | 1992 | |
| 1993 | 1993 | // Global js function |
| 1994 | 1994 | print '<!-- Includes JS of Dolibarr -->'."\n"; |
| 1995 | 1995 | if (!defined('DISABLE_LIB_HEAD_JS')) { |
| 1996 | - print '<script nonce="' . getNonce() . '" src="' . DOL_URL_ROOT . '/core/js/lib_head.js.php?lang=' . $langs->defaultlang . '&' . $ext . '"></script>' . "\n"; |
|
| 1996 | + print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/core/js/lib_head.js.php?lang='.$langs->defaultlang.'&'.$ext.'"></script>'."\n"; |
|
| 1997 | 1997 | } |
| 1998 | 1998 | |
| 1999 | 1999 | // Leaflet |
| 2000 | 2000 | if (getDolGlobalString('MAIN_USE_GEOPHP')) { |
| 2001 | - print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/leaflet/leaflet.js?' . $ext . '"></script>'."\n"; |
|
| 2002 | - print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/leaflet/leaflet-geoman.min.js?' . $ext . '"></script>'."\n"; |
|
| 2001 | + print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/leaflet/leaflet.js?'.$ext.'"></script>'."\n"; |
|
| 2002 | + print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/leaflet/leaflet-geoman.min.js?'.$ext.'"></script>'."\n"; |
|
| 2003 | 2003 | } |
| 2004 | 2004 | |
| 2005 | 2005 | // JS forced by modules (relative url starting with /) |
@@ -2036,7 +2036,7 @@ discard block |
||
| 2036 | 2036 | if (getDolGlobalString('ALLOW_THEME_JS')) { |
| 2037 | 2037 | $theme_js = dol_buildpath('/theme/'.$conf->theme.'/'.$conf->theme.'.js', 0); |
| 2038 | 2038 | if (file_exists($theme_js)) { |
| 2039 | - print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/'.$conf->theme.'.js?' . $ext . '"></script>'."\n"; |
|
| 2039 | + print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/'.$conf->theme.'.js?'.$ext.'"></script>'."\n"; |
|
| 2040 | 2040 | } |
| 2041 | 2041 | } |
| 2042 | 2042 | |
@@ -2044,7 +2044,7 @@ discard block |
||
| 2044 | 2044 | print $head."\n"; |
| 2045 | 2045 | } |
| 2046 | 2046 | if (getDolGlobalString('MAIN_HTML_HEADER')) { |
| 2047 | - print getDolGlobalString('MAIN_HTML_HEADER') . "\n"; |
|
| 2047 | + print getDolGlobalString('MAIN_HTML_HEADER')."\n"; |
|
| 2048 | 2048 | } |
| 2049 | 2049 | |
| 2050 | 2050 | $parameters = array(); |
@@ -2172,7 +2172,7 @@ discard block |
||
| 2172 | 2172 | |
| 2173 | 2173 | $toprightmenu .= '</div>'; |
| 2174 | 2174 | |
| 2175 | - $toprightmenu .= '</div>'."\n"; // end div class="login_block_tools" |
|
| 2175 | + $toprightmenu .= '</div>'."\n"; // end div class="login_block_tools" |
|
| 2176 | 2176 | |
| 2177 | 2177 | |
| 2178 | 2178 | // Add block for other tools |
@@ -2193,7 +2193,7 @@ discard block |
||
| 2193 | 2193 | |
| 2194 | 2194 | // Link to module builder |
| 2195 | 2195 | if (isModEnabled('modulebuilder')) { |
| 2196 | - $text = '<a href="' . dolBuildUrl(DOL_URL_ROOT . '/modulebuilder/index.php', ['mainmenu' => 'home', 'leftmenu' => 'admintools']) .'" target="modulebuilder">'; |
|
| 2196 | + $text = '<a href="'.dolBuildUrl(DOL_URL_ROOT.'/modulebuilder/index.php', ['mainmenu' => 'home', 'leftmenu' => 'admintools']).'" target="modulebuilder">'; |
|
| 2197 | 2197 | //$text.= img_picto(":".$langs->trans("ModuleBuilder"), 'printer_top.png', 'class="printer"'); |
| 2198 | 2198 | $text .= '<span class="fa fa-bug atoplogin valignmiddle"></span>'; |
| 2199 | 2199 | $text .= '</a>'; |
@@ -2473,7 +2473,7 @@ discard block |
||
| 2473 | 2473 | } |
| 2474 | 2474 | |
| 2475 | 2475 | if (empty($urllogout)) { |
| 2476 | - $urllogout = dolBuildUrl(DOL_URL_ROOT . '/user/logout.php', [], true); |
|
| 2476 | + $urllogout = dolBuildUrl(DOL_URL_ROOT.'/user/logout.php', [], true); |
|
| 2477 | 2477 | } |
| 2478 | 2478 | |
| 2479 | 2479 | // Defined the links for bottom of card |
@@ -2882,7 +2882,7 @@ discard block |
||
| 2882 | 2882 | $langs->load(explode('@', $item['name'])[1]); |
| 2883 | 2883 | $dropDownQuickAddHtml .= ' |
| 2884 | 2884 | <a class="dropdown-item quickadd-item" href="'.DOL_URL_ROOT.$item['url'].'" title="'.$langs->trans(explode('@', $item['title'])[0]).'"> |
| 2885 | - '. img_picto('', $item['picto'], 'style="width:18px;"') . ' ' . $langs->trans(explode('@', $item['name'])[0]) . '</a> |
|
| 2885 | + '. img_picto('', $item['picto'], 'style="width:18px;"').' '.$langs->trans(explode('@', $item['name'])[0]).'</a> |
|
| 2886 | 2886 | '; |
| 2887 | 2887 | } |
| 2888 | 2888 | |
@@ -2987,7 +2987,7 @@ discard block |
||
| 2987 | 2987 | */ |
| 2988 | 2988 | function top_menu_search() |
| 2989 | 2989 | { |
| 2990 | - global $langs, $conf, $db, $user, $hookmanager; // used by htdocs/core/ajax/selectsearchbox.php |
|
| 2990 | + global $langs, $conf, $db, $user, $hookmanager; // used by htdocs/core/ajax/selectsearchbox.php |
|
| 2991 | 2991 | |
| 2992 | 2992 | $html = ''; |
| 2993 | 2993 | |
@@ -3675,7 +3675,7 @@ discard block |
||
| 3675 | 3675 | |
| 3676 | 3676 | if (!empty($conf->use_javascript_ajax)) { |
| 3677 | 3677 | print "\n".'<!-- Includes JS Footer of Dolibarr -->'."\n"; |
| 3678 | - print '<script src="'.DOL_URL_ROOT.'/core/js/lib_foot.js.php?lang='.$langs->defaultlang . '&' . $ext .'"></script>'."\n"; |
|
| 3678 | + print '<script src="'.DOL_URL_ROOT.'/core/js/lib_foot.js.php?lang='.$langs->defaultlang.'&'.$ext.'"></script>'."\n"; |
|
| 3679 | 3679 | } |
| 3680 | 3680 | |
| 3681 | 3681 | // JS wrapper to add log when clicking on download or preview |
@@ -3727,7 +3727,7 @@ discard block |
||
| 3727 | 3727 | $forceping = GETPOST('forceping', 'alpha'); |
| 3728 | 3728 | |
| 3729 | 3729 | if (($_SERVER["PHP_SELF"] == DOL_URL_ROOT.'/index.php') || $forceping) { |
| 3730 | - $hash_unique_id = dol_hash('dolibarr'.$conf->file->instance_unique_id, 'sha256'); // Note: if the global salt changes, this hash changes too so ping may be counted twice. We don't mind. It is for statistics purpose only. |
|
| 3730 | + $hash_unique_id = dol_hash('dolibarr'.$conf->file->instance_unique_id, 'sha256'); // Note: if the global salt changes, this hash changes too so ping may be counted twice. We don't mind. It is for statistics purpose only. |
|
| 3731 | 3731 | $constanttosavelastko = 'MAIN_LAST_PING_KO_DATE'; |
| 3732 | 3732 | $constanttosavefirstok = 'MAIN_FIRST_PING_OK_DATE'; |
| 3733 | 3733 | $constanttosavefirstokid = 'MAIN_FIRST_PING_OK_ID'; |
@@ -3766,7 +3766,7 @@ discard block |
||
| 3766 | 3766 | } elseif (!isRegistrationRecorded()) { |
| 3767 | 3767 | print "\n<!-- NO JS CODE TO ENABLE the registration. Registration data not saved -->\n"; |
| 3768 | 3768 | } else { |
| 3769 | - $hash_unique_id = dol_hash('dolibarr'.$conf->file->instance_unique_id, 'sha256'); // Note: if the global salt changes, this hash changes too so ping may be counted twice. We don't mind. It is for statistics purpose only. |
|
| 3769 | + $hash_unique_id = dol_hash('dolibarr'.$conf->file->instance_unique_id, 'sha256'); // Note: if the global salt changes, this hash changes too so ping may be counted twice. We don't mind. It is for statistics purpose only. |
|
| 3770 | 3770 | $constanttosavelastko = 'MAIN_LAST_REGISTRATION_KO_DATE'; |
| 3771 | 3771 | $constanttosavefirstok = 'MAIN_FIRST_REGISTRATION_OK_DATE'; |
| 3772 | 3772 | $constanttosavefirstokid = 'MAIN_FIRST_REGISTRATION_OK_ID'; |
@@ -497,9 +497,9 @@ discard block |
||
| 497 | 497 | if (!empty($object->date_rappro)) { // Note: date_rappro is not found on Dolibarr classes |
| 498 | 498 | print ' - '; |
| 499 | 499 | print '<div class="valignmiddle inline-block">'; |
| 500 | - print dol_print_date($object->date_rappro, 'dayhour', 'tzserver'); // @phan-suppress-current-line PhanUndeclaredProperty |
|
| 500 | + print dol_print_date($object->date_rappro, 'dayhour', 'tzserver'); // @phan-suppress-current-line PhanUndeclaredProperty |
|
| 501 | 501 | if ($deltadateforuser) { |
| 502 | - print ' <span class="opacitymedium">'.$langs->trans("CurrentHour").'</span> / '.dol_print_date($object->date_rappro, "dayhour", 'tzuserrel').' <span class="opacitymedium">'.$langs->trans("ClientHour").'</span>'; // @phan-suppress-current-line PhanUndeclaredProperty |
|
| 502 | + print ' <span class="opacitymedium">'.$langs->trans("CurrentHour").'</span> / '.dol_print_date($object->date_rappro, "dayhour", 'tzuserrel').' <span class="opacitymedium">'.$langs->trans("ClientHour").'</span>'; // @phan-suppress-current-line PhanUndeclaredProperty |
|
| 503 | 503 | } |
| 504 | 504 | print '</div>'; |
| 505 | 505 | } |
@@ -1021,13 +1021,13 @@ discard block |
||
| 1021 | 1021 | } |
| 1022 | 1022 | } else { // if reset is for a specific month in year, we need year |
| 1023 | 1023 | if (preg_match('/^(.*)\{(m+)\}\{(y+)\}/i', $maskwithonlyymcode, $reg)) { |
| 1024 | - $posy = 3; //index in regex |
|
| 1024 | + $posy = 3; //index in regex |
|
| 1025 | 1025 | $posm = 2; |
| 1026 | 1026 | } elseif (preg_match('/^(.*)\{(y+)\}\{(m+)\}/i', $maskwithonlyymcode, $reg)) { |
| 1027 | - $posy = 2; //index in regex |
|
| 1027 | + $posy = 2; //index in regex |
|
| 1028 | 1028 | $posm = 3; |
| 1029 | 1029 | } elseif (preg_match('/^(.*)\{(y+)\}/i', $maskwithonlyymcode, $reg)) { |
| 1030 | - $posy = 2; //index in regex |
|
| 1030 | + $posy = 2; //index in regex |
|
| 1031 | 1031 | $posm = 0; |
| 1032 | 1032 | } else { |
| 1033 | 1033 | return 'ErrorCantUseRazIfNoYearInMask'; |
@@ -1129,7 +1129,7 @@ discard block |
||
| 1129 | 1129 | $maskLike = preg_replace('/\{yyyy\}/i', $yearcomp, $maskLike); |
| 1130 | 1130 | $maskLike = preg_replace('/\{yy\}/i', $yearcomp, $maskLike); |
| 1131 | 1131 | $maskLike = preg_replace('/\{y\}/i', $yearcomp, $maskLike); |
| 1132 | - $maskLike = preg_replace('/\{mm\}/i', '__', $maskLike); // we can't include the month in the filter |
|
| 1132 | + $maskLike = preg_replace('/\{mm\}/i', '__', $maskLike); // we can't include the month in the filter |
|
| 1133 | 1133 | } else { |
| 1134 | 1134 | $maskLike = preg_replace('/\{yyyy\}/i', '____', $maskLike); |
| 1135 | 1135 | $maskLike = preg_replace('/\{yy\}/i', '__', $maskLike); |
@@ -1160,14 +1160,14 @@ discard block |
||
| 1160 | 1160 | $counter = 0; |
| 1161 | 1161 | $sql = "SELECT MAX(".$sqlstring.") as val"; |
| 1162 | 1162 | $sql .= " FROM ".MAIN_DB_PREFIX.$db->sanitize($table); |
| 1163 | - $sql .= " WHERE ".$db->sanitize($field)." LIKE '".$db->escape($maskLike) . (getDolGlobalString('SEARCH_FOR_NEXT_VAL_ON_START_ONLY') ? "%" : "") . "'"; |
|
| 1163 | + $sql .= " WHERE ".$db->sanitize($field)." LIKE '".$db->escape($maskLike).(getDolGlobalString('SEARCH_FOR_NEXT_VAL_ON_START_ONLY') ? "%" : "")."'"; |
|
| 1164 | 1164 | $sql .= " AND ".$db->sanitize($field)." NOT LIKE '(PROV%)'"; |
| 1165 | 1165 | |
| 1166 | 1166 | // To ensure that all variables within the MAX() brackets are integers |
| 1167 | 1167 | // This avoid bad detection of max when data are noised with non numeric values at the position of the numero |
| 1168 | 1168 | if (getDolGlobalInt('MAIN_NUMBERING_FILTER_ON_INT_ONLY')) { |
| 1169 | 1169 | // @phan-suppress-next-line PhanPluginSuspiciousParamPosition |
| 1170 | - $sql .= " AND ". $db->regexpsql($sqlstring, '^[0-9]+$', 1); |
|
| 1170 | + $sql .= " AND ".$db->regexpsql($sqlstring, '^[0-9]+$', 1); |
|
| 1171 | 1171 | } |
| 1172 | 1172 | |
| 1173 | 1173 | if ($bentityon) { // only if entity enable |
@@ -1229,7 +1229,7 @@ discard block |
||
| 1229 | 1229 | $ref = ''; |
| 1230 | 1230 | $sql = "SELECT ".$db->sanitize($field)." as ref"; |
| 1231 | 1231 | $sql .= " FROM ".MAIN_DB_PREFIX.$db->sanitize($table); |
| 1232 | - $sql .= " WHERE ".$db->sanitize($field)." LIKE '".$db->escape($maskLike) . (getDolGlobalString('SEARCH_FOR_NEXT_VAL_ON_START_ONLY') ? "%" : "") . "'"; |
|
| 1232 | + $sql .= " WHERE ".$db->sanitize($field)." LIKE '".$db->escape($maskLike).(getDolGlobalString('SEARCH_FOR_NEXT_VAL_ON_START_ONLY') ? "%" : "")."'"; |
|
| 1233 | 1233 | $sql .= " AND ".$db->sanitize($field)." NOT LIKE '%PROV%'"; |
| 1234 | 1234 | if ($bentityon) { // only if entity enable |
| 1235 | 1235 | $sql .= " AND entity IN (".getEntity($sharetable).")"; |
@@ -1292,7 +1292,7 @@ discard block |
||
| 1292 | 1292 | // Get counter in database |
| 1293 | 1293 | $maskrefclient_sql = "SELECT MAX(".$maskrefclient_sqlstring.") as val"; |
| 1294 | 1294 | $maskrefclient_sql .= " FROM ".MAIN_DB_PREFIX.$table; |
| 1295 | - $maskrefclient_sql .= " WHERE ".$db->sanitize($field)." LIKE '".$db->escape($maskrefclient_maskLike) . (getDolGlobalString('SEARCH_FOR_NEXT_VAL_ON_START_ONLY') ? "%" : "") . "'"; |
|
| 1295 | + $maskrefclient_sql .= " WHERE ".$db->sanitize($field)." LIKE '".$db->escape($maskrefclient_maskLike).(getDolGlobalString('SEARCH_FOR_NEXT_VAL_ON_START_ONLY') ? "%" : "")."'"; |
|
| 1296 | 1296 | if ($bentityon) { // only if entity enable |
| 1297 | 1297 | $maskrefclient_sql .= " AND entity IN (".getEntity($sharetable).")"; |
| 1298 | 1298 | } elseif (!empty($forceentity)) { |
@@ -2967,7 +2967,7 @@ discard block |
||
| 2967 | 2967 | $string = trim($string); |
| 2968 | 2968 | |
| 2969 | 2969 | // If string does not start and end with parenthesis, we return $string as is. |
| 2970 | - if (! preg_match('/^\(.*\)$/', $string)) { |
|
| 2970 | + if (!preg_match('/^\(.*\)$/', $string)) { |
|
| 2971 | 2971 | return $string; |
| 2972 | 2972 | } |
| 2973 | 2973 | |
@@ -3005,15 +3005,15 @@ discard block |
||
| 3005 | 3005 | function getArrayOfEmojiBis() |
| 3006 | 3006 | { |
| 3007 | 3007 | $arrayofcommonemoji = array( |
| 3008 | - 'misc' => array('2600', '26FF'), // Miscellaneous Symbols |
|
| 3009 | - 'ding' => array('2700', '27BF'), // Dingbats |
|
| 3010 | - '????' => array('9989', '9989'), // Variation Selectors |
|
| 3011 | - 'vars' => array('FE00', 'FE0F'), // Variation Selectors |
|
| 3012 | - 'pict' => array('1F300', '1F5FF'), // Miscellaneous Symbols and Pictographs |
|
| 3013 | - 'emot' => array('1F600', '1F64F'), // Emoticons |
|
| 3014 | - 'tran' => array('1F680', '1F6FF'), // Transport and Map Symbols |
|
| 3015 | - 'flag' => array('1F1E0', '1F1FF'), // Flags (note: may be 1F1E6 instead of 1F1E0) |
|
| 3016 | - 'supp' => array('1F900', '1F9FF'), // Supplemental Symbols and Pictographs |
|
| 3008 | + 'misc' => array('2600', '26FF'), // Miscellaneous Symbols |
|
| 3009 | + 'ding' => array('2700', '27BF'), // Dingbats |
|
| 3010 | + '????' => array('9989', '9989'), // Variation Selectors |
|
| 3011 | + 'vars' => array('FE00', 'FE0F'), // Variation Selectors |
|
| 3012 | + 'pict' => array('1F300', '1F5FF'), // Miscellaneous Symbols and Pictographs |
|
| 3013 | + 'emot' => array('1F600', '1F64F'), // Emoticons |
|
| 3014 | + 'tran' => array('1F680', '1F6FF'), // Transport and Map Symbols |
|
| 3015 | + 'flag' => array('1F1E0', '1F1FF'), // Flags (note: may be 1F1E6 instead of 1F1E0) |
|
| 3016 | + 'supp' => array('1F900', '1F9FF'), // Supplemental Symbols and Pictographs |
|
| 3017 | 3017 | ); |
| 3018 | 3018 | |
| 3019 | 3019 | return $arrayofcommonemoji; |
@@ -3129,7 +3129,7 @@ discard block |
||
| 3129 | 3129 | global $dolibarr_distrib; |
| 3130 | 3130 | global $db, $conf; |
| 3131 | 3131 | |
| 3132 | - $hash_unique_id = dol_hash('dolibarr'.$conf->file->instance_unique_id, 'sha256'); // Note: if the global salt changes, this hash changes too so ping may be counted twice. We don't mind. It is for statistics and inventory purpose only. |
|
| 3132 | + $hash_unique_id = dol_hash('dolibarr'.$conf->file->instance_unique_id, 'sha256'); // Note: if the global salt changes, this hash changes too so ping may be counted twice. We don't mind. It is for statistics and inventory purpose only. |
|
| 3133 | 3133 | |
| 3134 | 3134 | // Disable ping if $constanttosavelastpingko is set and is recent (this month) |
| 3135 | 3135 | if (getDolGlobalString($constanttosavelastko) && substr(getDolGlobalString($constanttosavelastko), 0, 6) == dol_print_date(dol_now(), '%Y%m') && !$forceping) { |