@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | require_once DOL_DOCUMENT_ROOT.'/core/lib/security.lib.php'; |
| 56 | 56 | require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; |
| 57 | 57 | require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; |
| 58 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/public.lib.php'; |
|
| 58 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/public.lib.php'; |
|
| 59 | 59 | require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; |
| 60 | 60 | |
| 61 | 61 | |
@@ -185,7 +185,7 @@ discard block |
||
| 185 | 185 | $ok = false; |
| 186 | 186 | if (getDolGlobalString('MAIN_SECURITY_ENABLECAPTCHA_RECRUITMENT') && is_object($captchaobj)) { |
| 187 | 187 | if (method_exists($captchaobj, 'validateCodeAfterLoginSubmit')) { |
| 188 | - $ok = $captchaobj->validateCodeAfterLoginSubmit(); // @phan-suppress-current-line PhanUndeclaredMethod |
|
| 188 | + $ok = $captchaobj->validateCodeAfterLoginSubmit(); // @phan-suppress-current-line PhanUndeclaredMethod |
|
| 189 | 189 | } else { |
| 190 | 190 | print 'Error, the captcha handler '.get_class($captchaobj).' does not have any method validateCodeAfterLoginSubmit()'; |
| 191 | 191 | } |
@@ -198,8 +198,8 @@ discard block |
||
| 198 | 198 | } |
| 199 | 199 | if (!$error) { |
| 200 | 200 | $sql = "SELECT rrc.rowid FROM ".MAIN_DB_PREFIX."recruitment_recruitmentcandidature as rrc"; |
| 201 | - $sql .= " WHERE rrc.email = '". $db->escape($email)."'"; |
|
| 202 | - $sql .= " AND rrc.entity IN (". getEntity($object->element, 0).")"; |
|
| 201 | + $sql .= " WHERE rrc.email = '".$db->escape($email)."'"; |
|
| 202 | + $sql .= " AND rrc.entity IN (".getEntity($object->element, 0).")"; |
|
| 203 | 203 | $resql = $db->query($sql); |
| 204 | 204 | if ($resql) { |
| 205 | 205 | $num = $db->num_rows($resql); |
@@ -264,7 +264,7 @@ discard block |
||
| 264 | 264 | if (!$error) { |
| 265 | 265 | $db->commit(); |
| 266 | 266 | setEventMessages($langs->trans("RecruitmentCandidatureSaved"), null); |
| 267 | - header("Location: " . $backtopage); |
|
| 267 | + header("Location: ".$backtopage); |
|
| 268 | 268 | exit; |
| 269 | 269 | } else { |
| 270 | 270 | $db->rollback(); |
@@ -290,7 +290,7 @@ discard block |
||
| 290 | 290 | |
| 291 | 291 | $head = ''; |
| 292 | 292 | if (getDolGlobalString('MAIN_RECRUITMENT_CSS_URL')) { |
| 293 | - $head = '<link rel="stylesheet" type="text/css" href="' . getDolGlobalString('MAIN_RECRUITMENT_CSS_URL').'?lang='.$langs->defaultlang.'">'."\n"; |
|
| 293 | + $head = '<link rel="stylesheet" type="text/css" href="'.getDolGlobalString('MAIN_RECRUITMENT_CSS_URL').'?lang='.$langs->defaultlang.'">'."\n"; |
|
| 294 | 294 | } |
| 295 | 295 | |
| 296 | 296 | $conf->dol_hide_topmenu = 1; |
@@ -363,7 +363,7 @@ discard block |
||
| 363 | 363 | |
| 364 | 364 | if (getDolGlobalString('RECRUITMENT_IMAGE_PUBLIC_INTERFACE')) { |
| 365 | 365 | print '<div class="backimagepublicrecruitment">'; |
| 366 | - print '<img id="idRECRUITMENT_IMAGE_PUBLIC_INTERFACE" src="' . getDolGlobalString('RECRUITMENT_IMAGE_PUBLIC_INTERFACE').'">'; |
|
| 366 | + print '<img id="idRECRUITMENT_IMAGE_PUBLIC_INTERFACE" src="'.getDolGlobalString('RECRUITMENT_IMAGE_PUBLIC_INTERFACE').'">'; |
|
| 367 | 367 | print '</div>'; |
| 368 | 368 | } |
| 369 | 369 | |
@@ -377,7 +377,7 @@ discard block |
||
| 377 | 377 | if (preg_match('/^\((.*)\)$/', $conf->global->RECRUITMENT_NEWFORM_TEXT, $reg)) { |
| 378 | 378 | $text .= $langs->trans($reg[1])."<br>\n"; |
| 379 | 379 | } else { |
| 380 | - $text .= getDolGlobalString('RECRUITMENT_NEWFORM_TEXT') . "<br>\n"; |
|
| 380 | + $text .= getDolGlobalString('RECRUITMENT_NEWFORM_TEXT')."<br>\n"; |
|
| 381 | 381 | } |
| 382 | 382 | $text = '<tr><td align="center"><br>'.$text.'<br></td></tr>'."\n"; |
| 383 | 383 | } |
@@ -488,7 +488,7 @@ discard block |
||
| 488 | 488 | |
| 489 | 489 | // Other attributes |
| 490 | 490 | $object = new RecruitmentCandidature($db); |
| 491 | - $parameters['tpl_context'] = 'public'; // define template context to public |
|
| 491 | + $parameters['tpl_context'] = 'public'; // define template context to public |
|
| 492 | 492 | $parameters['tdclass'] = 'left'; |
| 493 | 493 | $extrafields->fetch_name_optionals_label("recruitment_recruitmentcandidature"); |
| 494 | 494 | include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php'; |
@@ -501,7 +501,7 @@ discard block |
||
| 501 | 501 | if (getDolGlobalString('MAIN_SECURITY_ENABLECAPTCHA_RECRUITMENT') && is_object($captchaobj)) { |
| 502 | 502 | print '<tr><td class="titlefield"><label><span class="fieldrequired">'.$langs->trans($captchaobj->getFieldInputTitle()).'</span></label></td><td><br>'; |
| 503 | 503 | if (method_exists($captchaobj, 'getCaptchaCodeForForm')) { |
| 504 | - print $captchaobj->getCaptchaCodeForForm(''); // @phan-suppress-current-line PhanUndeclaredMethod |
|
| 504 | + print $captchaobj->getCaptchaCodeForForm(''); // @phan-suppress-current-line PhanUndeclaredMethod |
|
| 505 | 505 | } else { |
| 506 | 506 | print 'Error, the captcha handler '.get_class($captchaobj).' does not have any method getCaptchaCodeForForm()'; |
| 507 | 507 | } |
@@ -131,9 +131,9 @@ discard block |
||
| 131 | 131 | $more = array(); |
| 132 | 132 | $i = 0; |
| 133 | 133 | foreach ($conf->file->dol_document_root as $dir) { |
| 134 | - $newdir = $dir . getDolGlobalString('MAIN_FORCELANGDIR'); // For example $conf->global->MAIN_FORCELANGDIR is '/mymodule' meaning we search files into '/mymodule/langs/xx_XX' |
|
| 134 | + $newdir = $dir.getDolGlobalString('MAIN_FORCELANGDIR'); // For example $conf->global->MAIN_FORCELANGDIR is '/mymodule' meaning we search files into '/mymodule/langs/xx_XX' |
|
| 135 | 135 | if (!in_array($newdir, $this->dir)) { |
| 136 | - $more['module_' . $i] = $newdir; |
|
| 136 | + $more['module_'.$i] = $newdir; |
|
| 137 | 137 | $i++; // We add the forced dir into the array $more. Just after, we add entries into $more to list of lang dir $this->dir. |
| 138 | 138 | } |
| 139 | 139 | } |
@@ -163,13 +163,13 @@ discard block |
||
| 163 | 163 | if (isset($longforshort[strtolower($langpart[0])]) && !in_array($codetouse, $longforshortexcep)) { |
| 164 | 164 | $srclang = $longforshort[strtolower($langpart[0])]; |
| 165 | 165 | } elseif (!is_numeric($langpart[1])) { // Second part YY may be a numeric with some Chrome browser |
| 166 | - $srclang = strtolower($langpart[0]) . "_" . strtoupper($langpart[1]); |
|
| 167 | - $longforlong = array('no_nb' => 'nb_NO'); // When lang and code are inverted by browser |
|
| 166 | + $srclang = strtolower($langpart[0])."_".strtoupper($langpart[1]); |
|
| 167 | + $longforlong = array('no_nb' => 'nb_NO'); // When lang and code are inverted by browser |
|
| 168 | 168 | if (isset($longforlong[strtolower($srclang)])) { |
| 169 | 169 | $srclang = $longforlong[strtolower($srclang)]; |
| 170 | 170 | } |
| 171 | 171 | } else { |
| 172 | - $srclang = strtolower($langpart[0]) . "_" . strtoupper($langpart[0]); |
|
| 172 | + $srclang = strtolower($langpart[0])."_".strtoupper($langpart[0]); |
|
| 173 | 173 | } |
| 174 | 174 | } else { // If it's for a codetouse that is a short code xx |
| 175 | 175 | // Array to convert short lang code into long code. |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | if (isset($longforshort[strtolower($langpart[0])])) { |
| 183 | 183 | $srclang = $longforshort[strtolower($langpart[0])]; |
| 184 | 184 | } elseif (!empty($langpart[0])) { |
| 185 | - $srclang = strtolower($langpart[0]) . "_" . strtoupper($langpart[0]); |
|
| 185 | + $srclang = strtolower($langpart[0])."_".strtoupper($langpart[0]); |
|
| 186 | 186 | } else { |
| 187 | 187 | $srclang = 'en_US'; |
| 188 | 188 | } |
@@ -262,7 +262,7 @@ discard block |
||
| 262 | 262 | |
| 263 | 263 | // Check parameters |
| 264 | 264 | if (empty($domain)) { |
| 265 | - dol_print_error(null, get_class($this) . "::Load ErrorWrongParameters"); |
|
| 265 | + dol_print_error(null, get_class($this)."::Load ErrorWrongParameters"); |
|
| 266 | 266 | return -1; |
| 267 | 267 | } |
| 268 | 268 | if ($this->defaultlang === 'none_NONE') { |
@@ -309,18 +309,18 @@ discard block |
||
| 309 | 309 | } |
| 310 | 310 | |
| 311 | 311 | if (empty($langofdir)) { // This may occurs when load is called without setting the language and without providing a value for forcelangdir |
| 312 | - dol_syslog("Error: " . get_class($this) . "::load was called for domain=" . $domain . " but language was not set yet with langs->setDefaultLang(). Nothing will be loaded.", LOG_WARNING); |
|
| 312 | + dol_syslog("Error: ".get_class($this)."::load was called for domain=".$domain." but language was not set yet with langs->setDefaultLang(). Nothing will be loaded.", LOG_WARNING); |
|
| 313 | 313 | return -1; |
| 314 | 314 | } |
| 315 | 315 | |
| 316 | 316 | $usecachekey = ''; |
| 317 | 317 | foreach ($this->dir as $searchdir) { |
| 318 | 318 | // Directory of translation files |
| 319 | - $file_lang = $searchdir . ($modulename ? '/' . $modulename : '') . "/langs/" . $langofdir . "/" . $newdomain . ".lang"; |
|
| 319 | + $file_lang = $searchdir.($modulename ? '/'.$modulename : '')."/langs/".$langofdir."/".$newdomain.".lang"; |
|
| 320 | 320 | $file_lang_osencoded = dol_osencode($file_lang); |
| 321 | 321 | |
| 322 | 322 | //$filelangexists = is_file($file_lang_osencoded); |
| 323 | - $filelangexists = @is_file($file_lang_osencoded); // avoid [php:warn] |
|
| 323 | + $filelangexists = @is_file($file_lang_osencoded); // avoid [php:warn] |
|
| 324 | 324 | |
| 325 | 325 | //dol_syslog(get_class($this).'::Load Try to read for alt='.$alt.' langofdir='.$langofdir.' domain='.$domain.' newdomain='.$newdomain.' modulename='.$modulename.' file_lang='.$file_lang." => filelangexists=".$filelangexists); |
| 326 | 326 | //print 'Try to read for alt='.$alt.' langofdir='.$langofdir.' domain='.$domain.' newdomain='.$newdomain.' modulename='.$modulename.' this->_tab_loaded[newdomain]='.$this->_tab_loaded[$newdomain].' file_lang='.$file_lang." => filelangexists=".$filelangexists."\n"; |
@@ -333,7 +333,7 @@ discard block |
||
| 333 | 333 | $usecachekey = ''; |
| 334 | 334 | // Using a memcached server |
| 335 | 335 | if (isModEnabled('memcached') && getDolGlobalString('MEMCACHED_SERVER')) { |
| 336 | - $usecachekey = $newdomain . '_' . $langkey . '_' . md5($file_lang); // Should not contains special chars |
|
| 336 | + $usecachekey = $newdomain.'_'.$langkey.'_'.md5($file_lang); // Should not contains special chars |
|
| 337 | 337 | } elseif (getDolGlobalInt('MAIN_OPTIMIZE_SPEED') & 0x02) { |
| 338 | 338 | // Using cache with shmop. Speed gain: 40ms - Memory overusage: 200ko (Size of session cache file) |
| 339 | 339 | $usecachekey = $newdomain; |
@@ -341,7 +341,7 @@ discard block |
||
| 341 | 341 | |
| 342 | 342 | if ($usecachekey) { |
| 343 | 343 | //dol_syslog('Translate::Load we will cache result into usecachekey '.$usecachekey); |
| 344 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/memory.lib.php'; |
|
| 344 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php'; |
|
| 345 | 345 | $tmparray = dol_getcache($usecachekey); |
| 346 | 346 | if (is_array($tmparray) && count($tmparray)) { |
| 347 | 347 | $this->tab_translate += $tmparray; // Faster than array_merge($tmparray,$this->tab_translate). Note: If a value already exists into tab_translate, value into tmparaay is not added. |
@@ -403,7 +403,7 @@ discard block |
||
| 403 | 403 | if ($alt == 0) { |
| 404 | 404 | // This function MUST NOT contains call to syslog |
| 405 | 405 | //dol_syslog("Translate::Load loading alternate translation file (to complete ".$this->defaultlang."/".$newdomain.".lang file)", LOG_DEBUG); |
| 406 | - $langofdir = strtolower($langarray[0]) . '_' . strtoupper($langarray[0]); |
|
| 406 | + $langofdir = strtolower($langarray[0]).'_'.strtoupper($langarray[0]); |
|
| 407 | 407 | if ($langofdir == 'el_EL') { |
| 408 | 408 | $langofdir = 'el_GR'; // main parent for el_CY is not 'el_EL' but 'el_GR' |
| 409 | 409 | } |
@@ -435,7 +435,7 @@ discard block |
||
| 435 | 435 | // This part is deprecated and replaced with table llx_overwrite_trans |
| 436 | 436 | // Kept for backward compatibility. |
| 437 | 437 | if (empty($loadfromfileonly)) { |
| 438 | - $overwritekey = 'MAIN_OVERWRITE_TRANS_' . $this->defaultlang; |
|
| 438 | + $overwritekey = 'MAIN_OVERWRITE_TRANS_'.$this->defaultlang; |
|
| 439 | 439 | if (getDolGlobalString($overwritekey)) { // Overwrite translation with key1:newstring1,key2:newstring2 |
| 440 | 440 | // Overwrite translation with param MAIN_OVERWRITE_TRANS_xx_XX |
| 441 | 441 | $tmparray = explode(',', getDolGlobalString($overwritekey)); |
@@ -452,7 +452,7 @@ discard block |
||
| 452 | 452 | if ($usecachekey && count($tabtranslatedomain)) { |
| 453 | 453 | $ressetcache = dol_setcache($usecachekey, $tabtranslatedomain); |
| 454 | 454 | if ($ressetcache < 0) { |
| 455 | - $error = 'Failed to set cache for usecachekey=' . $usecachekey . ' result=' . $ressetcache; |
|
| 455 | + $error = 'Failed to set cache for usecachekey='.$usecachekey.' result='.$ressetcache; |
|
| 456 | 456 | dol_syslog($error, LOG_ERR); |
| 457 | 457 | } |
| 458 | 458 | } |
@@ -505,7 +505,7 @@ discard block |
||
| 505 | 505 | $langofdir = $this->defaultlang; |
| 506 | 506 | |
| 507 | 507 | if (empty($langofdir)) { // This may occurs when load is called without setting the language and without providing a value for forcelangdir |
| 508 | - dol_syslog("Error: " . get_class($this) . "::loadFromDatabase was called but language was not set yet with langs->setDefaultLang(). Nothing will be loaded.", LOG_WARNING); |
|
| 508 | + dol_syslog("Error: ".get_class($this)."::loadFromDatabase was called but language was not set yet with langs->setDefaultLang(). Nothing will be loaded.", LOG_WARNING); |
|
| 509 | 509 | return -1; |
| 510 | 510 | } |
| 511 | 511 | |
@@ -516,7 +516,7 @@ discard block |
||
| 516 | 516 | $usecachekey = ''; |
| 517 | 517 | // Using a memcached server |
| 518 | 518 | if (isModEnabled('memcached') && getDolGlobalString('MEMCACHED_SERVER')) { |
| 519 | - $usecachekey = $newdomain . '_' . $langofdir; // Should not contains special chars |
|
| 519 | + $usecachekey = $newdomain.'_'.$langofdir; // Should not contains special chars |
|
| 520 | 520 | } elseif (getDolGlobalInt('MAIN_OPTIMIZE_SPEED') & 0x02) { |
| 521 | 521 | // Using cache with shmop. Speed gain: 40ms - Memory overusage: 200ko (Size of session cache file) |
| 522 | 522 | $usecachekey = $newdomain; |
@@ -524,7 +524,7 @@ discard block |
||
| 524 | 524 | |
| 525 | 525 | if ($usecachekey) { |
| 526 | 526 | //dol_syslog('Translate::Load we will cache result into usecachekey '.$usecachekey); |
| 527 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/memory.lib.php'; |
|
| 527 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php'; |
|
| 528 | 528 | $tmparray = dol_getcache($usecachekey); |
| 529 | 529 | if (is_array($tmparray) && count($tmparray)) { |
| 530 | 530 | $this->tab_translate += $tmparray; // Faster than array_merge($tmparray,$this->tab_translate). Note: If a value already exists into tab_translate, value into tmparaay is not added. |
@@ -574,7 +574,7 @@ discard block |
||
| 574 | 574 | if ($usecachekey && count($tabtranslatedomain)) { |
| 575 | 575 | $ressetcache = dol_setcache($usecachekey, $tabtranslatedomain); |
| 576 | 576 | if ($ressetcache < 0) { |
| 577 | - $error = 'Failed to set cache for usecachekey=' . $usecachekey . ' result=' . $ressetcache; |
|
| 577 | + $error = 'Failed to set cache for usecachekey='.$usecachekey.' result='.$ressetcache; |
|
| 578 | 578 | dol_syslog($error, LOG_ERR); |
| 579 | 579 | } |
| 580 | 580 | } |
@@ -668,12 +668,12 @@ discard block |
||
| 668 | 668 | $str = $this->tab_translate[$key]; |
| 669 | 669 | |
| 670 | 670 | // Make some string replacement after translation |
| 671 | - $replacekey = 'MAIN_REPLACE_TRANS_' . $this->defaultlang; |
|
| 671 | + $replacekey = 'MAIN_REPLACE_TRANS_'.$this->defaultlang; |
|
| 672 | 672 | if (getDolGlobalString($replacekey)) { // Replacement translation variable with string1:newstring1;string2:newstring2 |
| 673 | 673 | $tmparray = explode(';', getDolGlobalString($replacekey)); |
| 674 | 674 | foreach ($tmparray as $tmp) { |
| 675 | 675 | $tmparray2 = explode(':', $tmp); |
| 676 | - $str = preg_replace('/' . preg_quote($tmparray2[0], '/') . '/', $tmparray2[1], $str); |
|
| 676 | + $str = preg_replace('/'.preg_quote($tmparray2[0], '/').'/', $tmparray2[1], $str); |
|
| 677 | 677 | } |
| 678 | 678 | } |
| 679 | 679 | |
@@ -786,12 +786,12 @@ discard block |
||
| 786 | 786 | $str = $this->tab_translate[$key]; |
| 787 | 787 | |
| 788 | 788 | // Make some string replacement after translation |
| 789 | - $replacekey = 'MAIN_REPLACE_TRANS_' . $this->defaultlang; |
|
| 789 | + $replacekey = 'MAIN_REPLACE_TRANS_'.$this->defaultlang; |
|
| 790 | 790 | if (getDolGlobalString($replacekey)) { // Replacement translation variable with string1:newstring1;string2:newstring2 |
| 791 | 791 | $tmparray = explode(';', getDolGlobalString($replacekey)); |
| 792 | 792 | foreach ($tmparray as $tmp) { |
| 793 | 793 | $tmparray2 = explode(':', $tmp); |
| 794 | - $str = preg_replace('/' . preg_quote($tmparray2[0], '/') . '/', $tmparray2[1], $str); |
|
| 794 | + $str = preg_replace('/'.preg_quote($tmparray2[0], '/').'/', $tmparray2[1], $str); |
|
| 795 | 795 | } |
| 796 | 796 | } |
| 797 | 797 | |
@@ -899,7 +899,7 @@ discard block |
||
| 899 | 899 | $this->load("languages"); |
| 900 | 900 | |
| 901 | 901 | // We scan directory langs to detect available languages |
| 902 | - $handle = opendir($langdir . "/langs"); |
|
| 902 | + $handle = opendir($langdir."/langs"); |
|
| 903 | 903 | $langs_available = array(); |
| 904 | 904 | while ($dir = trim(readdir($handle))) { |
| 905 | 905 | $regs = array(); |
@@ -949,9 +949,9 @@ discard block |
||
| 949 | 949 | } |
| 950 | 950 | |
| 951 | 951 | if ($usecode == 1 || getDolGlobalString('MAIN_SHOW_LANGUAGE_CODE')) { |
| 952 | - $langs_available[$dir] = $dir . ': ' . dol_trunc($this->trans('Language_' . $dir), $maxlength); |
|
| 952 | + $langs_available[$dir] = $dir.': '.dol_trunc($this->trans('Language_'.$dir), $maxlength); |
|
| 953 | 953 | } else { |
| 954 | - $langs_available[$dir] = $this->trans('Language_' . $dir); |
|
| 954 | + $langs_available[$dir] = $this->trans('Language_'.$dir); |
|
| 955 | 955 | } |
| 956 | 956 | if ($mainlangonly) { |
| 957 | 957 | $langs_available[$dir] = str_replace(' (United States)', '', $langs_available[$dir]); |
@@ -975,7 +975,7 @@ discard block |
||
| 975 | 975 | // phpcs:enable |
| 976 | 976 | // Test si fichier dans repertoire de la langue |
| 977 | 977 | foreach ($this->dir as $searchdir) { |
| 978 | - if (is_readable(dol_osencode($searchdir . "/langs/" . $this->defaultlang . "/" . $filename))) { |
|
| 978 | + if (is_readable(dol_osencode($searchdir."/langs/".$this->defaultlang."/".$filename))) { |
|
| 979 | 979 | return true; |
| 980 | 980 | } |
| 981 | 981 | |
@@ -983,7 +983,7 @@ discard block |
||
| 983 | 983 | $filenamealt = null; |
| 984 | 984 | // Test si fichier dans repertoire de la langue alternative |
| 985 | 985 | if ($this->defaultlang != "en_US") { |
| 986 | - $filenamealt = $searchdir . "/langs/en_US/" . $filename; |
|
| 986 | + $filenamealt = $searchdir."/langs/en_US/".$filename; |
|
| 987 | 987 | } |
| 988 | 988 | //else $filenamealt = $searchdir."/langs/fr_FR/".$filename; |
| 989 | 989 | if ($filenamealt !== null && is_readable(dol_osencode($filenamealt))) { |
@@ -1024,8 +1024,8 @@ discard block |
||
| 1024 | 1024 | } |
| 1025 | 1025 | |
| 1026 | 1026 | $fonc = 'numberwords'; |
| 1027 | - if (file_exists($newdir . '/functions_' . $fonc . '.lib.php')) { |
|
| 1028 | - include_once $newdir . '/functions_' . $fonc . '.lib.php'; |
|
| 1027 | + if (file_exists($newdir.'/functions_'.$fonc.'.lib.php')) { |
|
| 1028 | + include_once $newdir.'/functions_'.$fonc.'.lib.php'; |
|
| 1029 | 1029 | if (function_exists('numberwords_getLabelFromNumber')) { |
| 1030 | 1030 | $newnumber = numberwords_getLabelFromNumber($this, $number, $isamount); |
| 1031 | 1031 | break; |
@@ -1078,13 +1078,13 @@ discard block |
||
| 1078 | 1078 | } |
| 1079 | 1079 | |
| 1080 | 1080 | // Not found in loaded language file nor in cache. So we will take the label into database. |
| 1081 | - $sql = "SELECT " . $fieldlabel . " as label"; |
|
| 1082 | - $sql .= " FROM " . $db->prefix() . $tablename; |
|
| 1083 | - $sql .= " WHERE " . $fieldkey . " = '" . $db->escape($keyforselect ? $keyforselect : $key) . "'"; |
|
| 1081 | + $sql = "SELECT ".$fieldlabel." as label"; |
|
| 1082 | + $sql .= " FROM ".$db->prefix().$tablename; |
|
| 1083 | + $sql .= " WHERE ".$fieldkey." = '".$db->escape($keyforselect ? $keyforselect : $key)."'"; |
|
| 1084 | 1084 | if ($filteronentity) { |
| 1085 | - $sql .= " AND entity IN (" . getEntity($tablename) . ')'; |
|
| 1085 | + $sql .= " AND entity IN (".getEntity($tablename).')'; |
|
| 1086 | 1086 | } |
| 1087 | - dol_syslog(get_class($this) . '::getLabelFromKey', LOG_DEBUG); |
|
| 1087 | + dol_syslog(get_class($this).'::getLabelFromKey', LOG_DEBUG); |
|
| 1088 | 1088 | $resql = $db->query($sql); |
| 1089 | 1089 | if ($resql) { |
| 1090 | 1090 | $obj = $db->fetch_object($resql); |
@@ -1117,9 +1117,9 @@ discard block |
||
| 1117 | 1117 | $symbol = $this->getCurrencySymbol($currency_code); |
| 1118 | 1118 | |
| 1119 | 1119 | if (in_array($currency_code, array('USD'))) { |
| 1120 | - return $symbol . $amount; |
|
| 1120 | + return $symbol.$amount; |
|
| 1121 | 1121 | } else { |
| 1122 | - return $amount . $symbol; |
|
| 1122 | + return $amount.$symbol; |
|
| 1123 | 1123 | } |
| 1124 | 1124 | } |
| 1125 | 1125 | |
@@ -1140,7 +1140,7 @@ discard block |
||
| 1140 | 1140 | |
| 1141 | 1141 | if (isset($this->cache_currencies[$currency_code]) && !empty($this->cache_currencies[$currency_code]['unicode']) && is_array($this->cache_currencies[$currency_code]['unicode'])) { // @phan-suppress-current-line PhanTypeMismatchProperty |
| 1142 | 1142 | foreach ($this->cache_currencies[$currency_code]['unicode'] as $unicode) { |
| 1143 | - $currency_sign .= mb_convert_encoding("&#" . $unicode . ";", "UTF-8", 'HTML-ENTITIES'); |
|
| 1143 | + $currency_sign .= mb_convert_encoding("&#".$unicode.";", "UTF-8", 'HTML-ENTITIES'); |
|
| 1144 | 1144 | } |
| 1145 | 1145 | } |
| 1146 | 1146 | } |
@@ -1166,14 +1166,14 @@ discard block |
||
| 1166 | 1166 | } |
| 1167 | 1167 | |
| 1168 | 1168 | $sql = "SELECT code_iso, label, unicode"; |
| 1169 | - $sql .= " FROM " . $db->prefix() . "c_currencies"; |
|
| 1169 | + $sql .= " FROM ".$db->prefix()."c_currencies"; |
|
| 1170 | 1170 | $sql .= " WHERE active = 1"; |
| 1171 | 1171 | if (!empty($currency_code)) { |
| 1172 | - $sql .= " AND code_iso = '" . $db->escape($currency_code) . "'"; |
|
| 1172 | + $sql .= " AND code_iso = '".$db->escape($currency_code)."'"; |
|
| 1173 | 1173 | } |
| 1174 | 1174 | //$sql.= " ORDER BY code_iso ASC"; // Not required, a sort is done later |
| 1175 | 1175 | |
| 1176 | - dol_syslog(get_class($this) . '::loadCacheCurrencies', LOG_DEBUG); |
|
| 1176 | + dol_syslog(get_class($this).'::loadCacheCurrencies', LOG_DEBUG); |
|
| 1177 | 1177 | $resql = $db->query($sql); |
| 1178 | 1178 | if ($resql) { |
| 1179 | 1179 | $this->load("dict"); |
@@ -1190,8 +1190,8 @@ discard block |
||
| 1190 | 1190 | $obj = $db->fetch_object($resql); |
| 1191 | 1191 | if ($obj) { |
| 1192 | 1192 | // If a translation exists, we use it lese we use the default label |
| 1193 | - $this->cache_currencies[$obj->code_iso]['label'] = ($obj->code_iso && $this->trans("Currency" . $obj->code_iso) != "Currency" . $obj->code_iso ? $this->trans("Currency" . $obj->code_iso) : ($obj->label != '-' ? $obj->label : '')); |
|
| 1194 | - $this->cache_currencies[$obj->code_iso]['unicode'] = (array) json_decode((empty($obj->unicode) ? '' : $obj->unicode), true); // @phan-suppress-current-line PhanTypeMismatchProperty |
|
| 1193 | + $this->cache_currencies[$obj->code_iso]['label'] = ($obj->code_iso && $this->trans("Currency".$obj->code_iso) != "Currency".$obj->code_iso ? $this->trans("Currency".$obj->code_iso) : ($obj->label != '-' ? $obj->label : '')); |
|
| 1194 | + $this->cache_currencies[$obj->code_iso]['unicode'] = (array) json_decode((empty($obj->unicode) ? '' : $obj->unicode), true); // @phan-suppress-current-line PhanTypeMismatchProperty |
|
| 1195 | 1195 | $label[$obj->code_iso] = $this->cache_currencies[$obj->code_iso]['label']; |
| 1196 | 1196 | } |
| 1197 | 1197 | $i++; |
@@ -1224,8 +1224,8 @@ discard block |
||
| 1224 | 1224 | $substitutionarray = array(); |
| 1225 | 1225 | |
| 1226 | 1226 | foreach ($this->tab_translate as $code => $label) { |
| 1227 | - $substitutionarray['lang_' . $code] = $label; |
|
| 1228 | - $substitutionarray['__(' . $code . ')__'] = $label; |
|
| 1227 | + $substitutionarray['lang_'.$code] = $label; |
|
| 1228 | + $substitutionarray['__('.$code.')__'] = $label; |
|
| 1229 | 1229 | } |
| 1230 | 1230 | |
| 1231 | 1231 | return $substitutionarray; |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | { |
| 116 | 116 | $valid_nature = array(1, 2, 3, 4, 5, 8, 9); |
| 117 | 117 | if (!in_array((int) $this->nature, $valid_nature)) { |
| 118 | - $this->error = get_class($this)."::Create Error invalid field nature '" . strval($this->nature) . "'"; |
|
| 118 | + $this->error = get_class($this)."::Create Error invalid field nature '".strval($this->nature)."'"; |
|
| 119 | 119 | dol_syslog($this->error, LOG_ERR); |
| 120 | 120 | return -1; |
| 121 | 121 | } |
@@ -123,23 +123,23 @@ discard block |
||
| 123 | 123 | $sql = "INSERT INTO ".MAIN_DB_PREFIX."accounting_journal"; |
| 124 | 124 | $sql .= " (entity, code, label, nature, active)"; |
| 125 | 125 | $sql .= " VALUES (" |
| 126 | - . ((int) $this->entity) .",'" |
|
| 127 | - . $this->db->escape($this->code) ."','" |
|
| 128 | - . $this->db->escape($this->label) ."'," |
|
| 129 | - . ((int) $this->nature) ."," |
|
| 130 | - . ((int) $this->active) .")"; |
|
| 126 | + . ((int) $this->entity).",'" |
|
| 127 | + . $this->db->escape($this->code)."','" |
|
| 128 | + . $this->db->escape($this->label)."'," |
|
| 129 | + . ((int) $this->nature)."," |
|
| 130 | + . ((int) $this->active).")"; |
|
| 131 | 131 | |
| 132 | 132 | dol_syslog(get_class($this)."::create", LOG_DEBUG); |
| 133 | 133 | $resql = $this->db->query($sql); |
| 134 | 134 | if (!$resql) { |
| 135 | - $this->error = get_class($this)."::Create Error: " . $this->db->lasterror(); |
|
| 135 | + $this->error = get_class($this)."::Create Error: ".$this->db->lasterror(); |
|
| 136 | 136 | dol_syslog($this->error, LOG_ERR); |
| 137 | 137 | return -1; |
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | $id = $this->db->last_insert_id(MAIN_DB_PREFIX."accounting_journal"); |
| 141 | 141 | if ($id <= 0) { |
| 142 | - $this->error = get_class($this)."::Create Error " . $id . ": " . $this->db->lasterror(); |
|
| 142 | + $this->error = get_class($this)."::Create Error ".$id.": ".$this->db->lasterror(); |
|
| 143 | 143 | dol_syslog($this->error, LOG_ERR); |
| 144 | 144 | return -2; |
| 145 | 145 | } |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | $this->rowid = $obj->rowid; |
| 182 | 182 | |
| 183 | 183 | $this->code = $obj->code; |
| 184 | - $this->ref = $obj->code; |
|
| 184 | + $this->ref = $obj->code; |
|
| 185 | 185 | $this->label = $obj->label; |
| 186 | 186 | $this->nature = $obj->nature; |
| 187 | 187 | $this->active = $obj->active; |
@@ -408,10 +408,10 @@ discard block |
||
| 408 | 408 | return array(); |
| 409 | 409 | } |
| 410 | 410 | |
| 411 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php'; |
|
| 412 | - require_once DOL_DOCUMENT_ROOT . '/asset/class/asset.class.php'; |
|
| 413 | - require_once DOL_DOCUMENT_ROOT . '/asset/class/assetaccountancycodes.class.php'; |
|
| 414 | - require_once DOL_DOCUMENT_ROOT . '/asset/class/assetdepreciationoptions.class.php'; |
|
| 411 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; |
|
| 412 | + require_once DOL_DOCUMENT_ROOT.'/asset/class/asset.class.php'; |
|
| 413 | + require_once DOL_DOCUMENT_ROOT.'/asset/class/assetaccountancycodes.class.php'; |
|
| 414 | + require_once DOL_DOCUMENT_ROOT.'/asset/class/assetdepreciationoptions.class.php'; |
|
| 415 | 415 | |
| 416 | 416 | $langs->loadLangs(array("assets")); |
| 417 | 417 | |
@@ -427,22 +427,22 @@ discard block |
||
| 427 | 427 | $sql .= "SELECT ad.fk_asset AS rowid, a.ref AS asset_ref, a.label AS asset_label, a.acquisition_value_ht AS asset_acquisition_value_ht"; |
| 428 | 428 | $sql .= ", a.disposal_date AS asset_disposal_date, a.disposal_amount_ht AS asset_disposal_amount_ht, a.disposal_subject_to_vat AS asset_disposal_subject_to_vat"; |
| 429 | 429 | $sql .= ", ad.rowid AS depreciation_id, ad.depreciation_mode, ad.ref AS depreciation_ref, ad.depreciation_date, ad.depreciation_ht, ad.accountancy_code_debit, ad.accountancy_code_credit"; |
| 430 | - $sql .= " FROM " . MAIN_DB_PREFIX . "asset_depreciation as ad"; |
|
| 431 | - $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "asset as a ON a.rowid = ad.fk_asset"; |
|
| 432 | - $sql .= " WHERE a.entity IN (" . getEntity('asset', 0) . ')'; // We don't share object for accountancy, we use source object sharing |
|
| 430 | + $sql .= " FROM ".MAIN_DB_PREFIX."asset_depreciation as ad"; |
|
| 431 | + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."asset as a ON a.rowid = ad.fk_asset"; |
|
| 432 | + $sql .= " WHERE a.entity IN (".getEntity('asset', 0).')'; // We don't share object for accountancy, we use source object sharing |
|
| 433 | 433 | $sql .= " AND a.status > 0"; |
| 434 | 434 | if ($in_bookkeeping == 'already') { |
| 435 | - $sql .= " AND EXISTS (SELECT iab.fk_docdet FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping AS iab WHERE iab.fk_docdet = ad.rowid AND doc_type = 'asset')"; |
|
| 435 | + $sql .= " AND EXISTS (SELECT iab.fk_docdet FROM ".MAIN_DB_PREFIX."accounting_bookkeeping AS iab WHERE iab.fk_docdet = ad.rowid AND doc_type = 'asset')"; |
|
| 436 | 436 | } elseif ($in_bookkeeping == 'notyet') { |
| 437 | - $sql .= " AND NOT EXISTS (SELECT iab.fk_docdet FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping AS iab WHERE iab.fk_docdet = ad.rowid AND doc_type = 'asset')"; |
|
| 437 | + $sql .= " AND NOT EXISTS (SELECT iab.fk_docdet FROM ".MAIN_DB_PREFIX."accounting_bookkeeping AS iab WHERE iab.fk_docdet = ad.rowid AND doc_type = 'asset')"; |
|
| 438 | 438 | } |
| 439 | 439 | $sql .= " AND ad.ref != ''"; // not reversal lines |
| 440 | 440 | if ($date_start && $date_end) { |
| 441 | - $sql .= " AND ad.depreciation_date >= '" . $this->db->idate($date_start) . "' AND ad.depreciation_date <= '" . $this->db->idate($date_end) . "'"; |
|
| 441 | + $sql .= " AND ad.depreciation_date >= '".$this->db->idate($date_start)."' AND ad.depreciation_date <= '".$this->db->idate($date_end)."'"; |
|
| 442 | 442 | } |
| 443 | 443 | // Define begin binding date |
| 444 | 444 | if (getDolGlobalString('ACCOUNTING_DATE_START_BINDING')) { |
| 445 | - $sql .= " AND ad.depreciation_date >= '" . $this->db->idate(getDolGlobalInt('ACCOUNTING_DATE_START_BINDING')) . "'"; |
|
| 445 | + $sql .= " AND ad.depreciation_date >= '".$this->db->idate(getDolGlobalInt('ACCOUNTING_DATE_START_BINDING'))."'"; |
|
| 446 | 446 | } |
| 447 | 447 | $sql .= " ORDER BY ad.depreciation_date"; |
| 448 | 448 | |
@@ -528,7 +528,7 @@ discard block |
||
| 528 | 528 | if ($type == 'view') { |
| 529 | 529 | $account_to_show = length_accountg($account); |
| 530 | 530 | if (($account_to_show == "") || $account_to_show == 'NotDefined') { |
| 531 | - $account_to_show = '<span class="error">' . $langs->trans("AssetInAccountNotDefined") . '</span>'; |
|
| 531 | + $account_to_show = '<span class="error">'.$langs->trans("AssetInAccountNotDefined").'</span>'; |
|
| 532 | 532 | } |
| 533 | 533 | |
| 534 | 534 | $blocks[] = array( |
@@ -536,7 +536,7 @@ discard block |
||
| 536 | 536 | 'piece' => $element_link, |
| 537 | 537 | 'account_accounting' => $account_to_show, |
| 538 | 538 | 'subledger_account' => '', |
| 539 | - 'label_operation' => $label_operation . ' - ' . $depreciation_ref, |
|
| 539 | + 'label_operation' => $label_operation.' - '.$depreciation_ref, |
|
| 540 | 540 | 'debit' => $mt < 0 ? price(-$mt) : '', |
| 541 | 541 | 'credit' => $mt >= 0 ? price($mt) : '', |
| 542 | 542 | ); |
@@ -555,7 +555,7 @@ discard block |
||
| 555 | 555 | 'subledger_label' => '', |
| 556 | 556 | 'numero_compte' => $account, |
| 557 | 557 | 'label_compte' => $account_infos['label'], |
| 558 | - 'label_operation' => $element_name_formatted_0 . ' - ' . $depreciation_ref, |
|
| 558 | + 'label_operation' => $element_name_formatted_0.' - '.$depreciation_ref, |
|
| 559 | 559 | 'montant' => $mt, |
| 560 | 560 | 'sens' => $mt < 0 ? 'D' : 'C', |
| 561 | 561 | 'debit' => $mt < 0 ? -$mt : 0, |
@@ -570,12 +570,12 @@ discard block |
||
| 570 | 570 | } |
| 571 | 571 | } else { // $type == 'csv' |
| 572 | 572 | $blocks[] = array( |
| 573 | - $depreciation_date, // Date |
|
| 574 | - $element_static->ref, // Piece |
|
| 575 | - $account_infos['code_formatted_1'], // AccountAccounting |
|
| 576 | - $element_name_formatted_0 . ' - ' . $depreciation_ref, // LabelOperation |
|
| 577 | - $mt < 0 ? price(-$mt) : '', // Debit |
|
| 578 | - $mt >= 0 ? price($mt) : '', // Credit |
|
| 573 | + $depreciation_date, // Date |
|
| 574 | + $element_static->ref, // Piece |
|
| 575 | + $account_infos['code_formatted_1'], // AccountAccounting |
|
| 576 | + $element_name_formatted_0.' - '.$depreciation_ref, // LabelOperation |
|
| 577 | + $mt < 0 ? price(-$mt) : '', // Debit |
|
| 578 | + $mt >= 0 ? price($mt) : '', // Credit |
|
| 579 | 579 | ); |
| 580 | 580 | } |
| 581 | 581 | } |
@@ -597,7 +597,7 @@ discard block |
||
| 597 | 597 | |
| 598 | 598 | // Get accountancy codes |
| 599 | 599 | //--------------------------- |
| 600 | - require_once DOL_DOCUMENT_ROOT . '/asset/class/assetaccountancycodes.class.php'; |
|
| 600 | + require_once DOL_DOCUMENT_ROOT.'/asset/class/assetaccountancycodes.class.php'; |
|
| 601 | 601 | $accountancy_codes = new AssetAccountancyCodes($this->db); |
| 602 | 602 | $result = $accountancy_codes->fetchAccountancyCodes($element_static->id); |
| 603 | 603 | if ($result < 0) { |
@@ -648,7 +648,7 @@ discard block |
||
| 648 | 648 | if ($type == 'view') { |
| 649 | 649 | $account_to_show = length_accountg($account); |
| 650 | 650 | if (($account_to_show == "") || $account_to_show == 'NotDefined') { |
| 651 | - $account_to_show = '<span class="error">' . $langs->trans("AssetInAccountNotDefined") . '</span>'; |
|
| 651 | + $account_to_show = '<span class="error">'.$langs->trans("AssetInAccountNotDefined").'</span>'; |
|
| 652 | 652 | } |
| 653 | 653 | |
| 654 | 654 | $blocks[] = array( |
@@ -656,7 +656,7 @@ discard block |
||
| 656 | 656 | 'piece' => $element_link, |
| 657 | 657 | 'account_accounting' => $account_to_show, |
| 658 | 658 | 'subledger_account' => '', |
| 659 | - 'label_operation' => $label_operation . ' - ' . $disposal_ref, |
|
| 659 | + 'label_operation' => $label_operation.' - '.$disposal_ref, |
|
| 660 | 660 | 'debit' => $mt < 0 ? price(-$mt) : '', |
| 661 | 661 | 'credit' => $mt >= 0 ? price($mt) : '', |
| 662 | 662 | ); |
@@ -675,7 +675,7 @@ discard block |
||
| 675 | 675 | 'subledger_label' => '', |
| 676 | 676 | 'numero_compte' => $account, |
| 677 | 677 | 'label_compte' => $account_infos['label'], |
| 678 | - 'label_operation' => $element_name_formatted_0 . ' - ' . $disposal_ref, |
|
| 678 | + 'label_operation' => $element_name_formatted_0.' - '.$disposal_ref, |
|
| 679 | 679 | 'montant' => $mt, |
| 680 | 680 | 'sens' => $mt < 0 ? 'D' : 'C', |
| 681 | 681 | 'debit' => $mt < 0 ? -$mt : 0, |
@@ -690,12 +690,12 @@ discard block |
||
| 690 | 690 | } |
| 691 | 691 | } else { // $type == 'csv' |
| 692 | 692 | $blocks[] = array( |
| 693 | - $disposal_date, // Date |
|
| 694 | - $element_static->ref, // Piece |
|
| 695 | - $account_infos['code_formatted_1'], // AccountAccounting |
|
| 696 | - $element_name_formatted_0 . ' - ' . $disposal_ref, // LabelOperation |
|
| 697 | - $mt < 0 ? price(-$mt) : '', // Debit |
|
| 698 | - $mt >= 0 ? price($mt) : '', // Credit |
|
| 693 | + $disposal_date, // Date |
|
| 694 | + $element_static->ref, // Piece |
|
| 695 | + $account_infos['code_formatted_1'], // AccountAccounting |
|
| 696 | + $element_name_formatted_0.' - '.$disposal_ref, // LabelOperation |
|
| 697 | + $mt < 0 ? price(-$mt) : '', // Debit |
|
| 698 | + $mt >= 0 ? price($mt) : '', // Credit |
|
| 699 | 699 | ); |
| 700 | 700 | } |
| 701 | 701 | } |
@@ -759,7 +759,7 @@ discard block |
||
| 759 | 759 | public function writeIntoBookkeeping(User $user, &$journal_data = array(), $max_nb_errors = 10) |
| 760 | 760 | { |
| 761 | 761 | global $conf, $langs, $hookmanager; |
| 762 | - require_once DOL_DOCUMENT_ROOT . '/accountancy/class/bookkeeping.class.php'; |
|
| 762 | + require_once DOL_DOCUMENT_ROOT.'/accountancy/class/bookkeeping.class.php'; |
|
| 763 | 763 | |
| 764 | 764 | $error = 0; |
| 765 | 765 | |
@@ -859,7 +859,7 @@ discard block |
||
| 859 | 859 | $error++; |
| 860 | 860 | $error_for_line++; |
| 861 | 861 | $journal_data[$element_id]['error'] = 'amountsnotbalanced'; |
| 862 | - $this->errors[] = 'Try to insert a non balanced transaction in book for ' . json_encode($element['blocks']) . '. Canceled. Surely a bug.'; |
|
| 862 | + $this->errors[] = 'Try to insert a non balanced transaction in book for '.json_encode($element['blocks']).'. Canceled. Surely a bug.'; |
|
| 863 | 863 | } |
| 864 | 864 | |
| 865 | 865 | if (!$error_for_line) { |
@@ -957,12 +957,12 @@ discard block |
||
| 957 | 957 | } |
| 958 | 958 | |
| 959 | 959 | if (!empty($header)) { |
| 960 | - $out .= '"' . implode('"' . $sep . '"', $header) . '"' . "\n"; |
|
| 960 | + $out .= '"'.implode('"'.$sep.'"', $header).'"'."\n"; |
|
| 961 | 961 | } |
| 962 | 962 | foreach ($journal_data as $element_id => $element) { |
| 963 | 963 | foreach ($element['blocks'] as $lines) { |
| 964 | 964 | foreach ($lines as $line) { |
| 965 | - $out .= '"' . implode('"' . $sep . '"', $line) . '"' . "\n"; |
|
| 965 | + $out .= '"'.implode('"'.$sep.'"', $line).'"'."\n"; |
|
| 966 | 966 | } |
| 967 | 967 | } |
| 968 | 968 | } |
@@ -980,8 +980,8 @@ discard block |
||
| 980 | 980 | public function getAccountingAccountInfos($account) |
| 981 | 981 | { |
| 982 | 982 | if (!isset(self::$accounting_account_cached[$account])) { |
| 983 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php'; |
|
| 984 | - require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php'; |
|
| 983 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; |
|
| 984 | + require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php'; |
|
| 985 | 985 | $accountingaccount = new AccountingAccount($this->db); |
| 986 | 986 | $result = $accountingaccount->fetch(0, $account, true); |
| 987 | 987 | if ($result > 0) { |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | } |
| 70 | 70 | $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : $context_default; |
| 71 | 71 | |
| 72 | -$search_doc_date = GETPOSTDATE('doc_date', 'getpost'); // deprecated. Can use 'search_date_start/end' |
|
| 72 | +$search_doc_date = GETPOSTDATE('doc_date', 'getpost'); // deprecated. Can use 'search_date_start/end' |
|
| 73 | 73 | |
| 74 | 74 | $search_date_startyear = GETPOSTINT('search_date_startyear'); |
| 75 | 75 | $search_date_startmonth = GETPOSTINT('search_date_startmonth'); |
@@ -170,9 +170,9 @@ discard block |
||
| 170 | 170 | $sql = "SELECT date_start, date_end"; |
| 171 | 171 | $sql .= " FROM ".MAIN_DB_PREFIX."accounting_fiscalyear "; |
| 172 | 172 | if (getDolGlobalInt('ACCOUNTANCY_FISCALYEAR_DEFAULT')) { |
| 173 | - $sql .= " WHERE rowid = " . getDolGlobalInt('ACCOUNTANCY_FISCALYEAR_DEFAULT'); |
|
| 173 | + $sql .= " WHERE rowid = ".getDolGlobalInt('ACCOUNTANCY_FISCALYEAR_DEFAULT'); |
|
| 174 | 174 | } else { |
| 175 | - $sql .= " WHERE date_start < '" . $db->idate(dol_now()) . "' and date_end > '" . $db->idate(dol_now()) . "'"; |
|
| 175 | + $sql .= " WHERE date_start < '".$db->idate(dol_now())."' and date_end > '".$db->idate(dol_now())."'"; |
|
| 176 | 176 | } |
| 177 | 177 | $sql .= $db->plimit(1); |
| 178 | 178 | $res = $db->query($sql); |
@@ -316,7 +316,7 @@ discard block |
||
| 316 | 316 | $search_date_due_start = ''; |
| 317 | 317 | // Due date end |
| 318 | 318 | $search_date_due_end_day = ''; |
| 319 | - $search_date_due_end_month = ''; |
|
| 319 | + $search_date_due_end_month = ''; |
|
| 320 | 320 | $search_date_due_end_year = ''; |
| 321 | 321 | $search_date_due_end = ''; |
| 322 | 322 | $search_lettering_code = ''; |
@@ -368,7 +368,7 @@ discard block |
||
| 368 | 368 | } else { |
| 369 | 369 | $filter['t.numero_compte>='] = $search_accountancy_code_start; |
| 370 | 370 | } |
| 371 | - $param .= '&search_accountancy_code_start=' . urlencode($search_accountancy_code_start); |
|
| 371 | + $param .= '&search_accountancy_code_start='.urlencode($search_accountancy_code_start); |
|
| 372 | 372 | } |
| 373 | 373 | if (!empty($search_accountancy_code_end)) { |
| 374 | 374 | if ($type == 'sub') { |
@@ -376,7 +376,7 @@ discard block |
||
| 376 | 376 | } else { |
| 377 | 377 | $filter['t.numero_compte<='] = $search_accountancy_code_end; |
| 378 | 378 | } |
| 379 | - $param .= '&search_accountancy_code_end=' . urlencode($search_accountancy_code_end); |
|
| 379 | + $param .= '&search_accountancy_code_end='.urlencode($search_accountancy_code_end); |
|
| 380 | 380 | } |
| 381 | 381 | if (!empty($search_label_account)) { |
| 382 | 382 | $filter['t.label_compte'] = $search_label_account; |
@@ -468,7 +468,7 @@ discard block |
||
| 468 | 468 | } else { |
| 469 | 469 | $object->fetchAllByAccount($sortorder, $sortfield, 0, 0, $filter); |
| 470 | 470 | } |
| 471 | - require_once DOL_DOCUMENT_ROOT . '/core/modules/accountancy/doc/pdf_ledger.modules.php'; |
|
| 471 | + require_once DOL_DOCUMENT_ROOT.'/core/modules/accountancy/doc/pdf_ledger.modules.php'; |
|
| 472 | 472 | $pdf = new pdf_ledger($db); |
| 473 | 473 | $pdf->fromDate = $search_date_start; |
| 474 | 474 | $pdf->toDate = $search_date_end; |
@@ -613,7 +613,7 @@ discard block |
||
| 613 | 613 | } |
| 614 | 614 | |
| 615 | 615 | if (!$error) { |
| 616 | - header('Location: ' . $_SERVER['PHP_SELF'] . '?noreset=1' . $param); |
|
| 616 | + header('Location: '.$_SERVER['PHP_SELF'].'?noreset=1'.$param); |
|
| 617 | 617 | exit(); |
| 618 | 618 | } |
| 619 | 619 | } elseif ($massaction == 'letteringmanual' && $permissiontoadd) { |
@@ -623,7 +623,7 @@ discard block |
||
| 623 | 623 | setEventMessages('', $lettering->errors, 'errors'); |
| 624 | 624 | } else { |
| 625 | 625 | setEventMessages($langs->trans($result == 0 ? 'AccountancyNoLetteringModified' : 'AccountancyOneLetteringModifiedSuccessfully'), array(), 'mesgs'); |
| 626 | - header('Location: ' . $_SERVER['PHP_SELF'] . '?noreset=1' . $param); |
|
| 626 | + header('Location: '.$_SERVER['PHP_SELF'].'?noreset=1'.$param); |
|
| 627 | 627 | exit(); |
| 628 | 628 | } |
| 629 | 629 | } elseif ($type == 'sub' && $massaction == 'letteringpartial') { |
@@ -633,7 +633,7 @@ discard block |
||
| 633 | 633 | setEventMessages('', $lettering->errors, 'errors'); |
| 634 | 634 | } else { |
| 635 | 635 | setEventMessages($langs->trans($result == 0 ? 'AccountancyNoLetteringModified' : 'AccountancyOneLetteringModifiedSuccessfully'), array(), 'mesgs'); |
| 636 | - header('Location: ' . $_SERVER['PHP_SELF'] . '?noreset=1' . $param); |
|
| 636 | + header('Location: '.$_SERVER['PHP_SELF'].'?noreset=1'.$param); |
|
| 637 | 637 | exit(); |
| 638 | 638 | } |
| 639 | 639 | } elseif ($action == 'unletteringauto' && $confirm == "yes" && $permissiontoadd) { |
@@ -654,7 +654,7 @@ discard block |
||
| 654 | 654 | } |
| 655 | 655 | |
| 656 | 656 | if (!$error) { |
| 657 | - header('Location: ' . $_SERVER['PHP_SELF'] . '?noreset=1' . $param); |
|
| 657 | + header('Location: '.$_SERVER['PHP_SELF'].'?noreset=1'.$param); |
|
| 658 | 658 | exit(); |
| 659 | 659 | } |
| 660 | 660 | } elseif ($action == 'unletteringmanual' && $confirm == "yes" && $permissiontoadd) { |
@@ -664,7 +664,7 @@ discard block |
||
| 664 | 664 | setEventMessages('', $lettering->errors, 'errors'); |
| 665 | 665 | } else { |
| 666 | 666 | setEventMessages($langs->trans($result == 0 ? 'AccountancyNoUnletteringModified' : 'AccountancyOneUnletteringModifiedSuccessfully'), array(), 'mesgs'); |
| 667 | - header('Location: ' . $_SERVER['PHP_SELF'] . '?noreset=1' . $param); |
|
| 667 | + header('Location: '.$_SERVER['PHP_SELF'].'?noreset=1'.$param); |
|
| 668 | 668 | exit(); |
| 669 | 669 | } |
| 670 | 670 | } |
@@ -759,7 +759,7 @@ discard block |
||
| 759 | 759 | } else { |
| 760 | 760 | $subledger_start_account = $subledger_end_account = ''; |
| 761 | 761 | } |
| 762 | - print '<a class="a-mesure-disabled marginleftonly marginrightonly reposition" href="' . $_SERVER["PHP_SELF"] . '?mode=customer&socid='.$socid.'&type=sub&search_accountancy_code_start='.$subledger_start_account.'&search_accountancy_code_end='.$subledger_end_account.'">'; |
|
| 762 | + print '<a class="a-mesure-disabled marginleftonly marginrightonly reposition" href="'.$_SERVER["PHP_SELF"].'?mode=customer&socid='.$socid.'&type=sub&search_accountancy_code_start='.$subledger_start_account.'&search_accountancy_code_end='.$subledger_end_account.'">'; |
|
| 763 | 763 | } else { |
| 764 | 764 | print '<span class="a-mesure marginleftonly marginrightonly">'; |
| 765 | 765 | } |
@@ -779,7 +779,7 @@ discard block |
||
| 779 | 779 | } else { |
| 780 | 780 | $subledger_start_account = $subledger_end_account = ''; |
| 781 | 781 | } |
| 782 | - print '<a class="a-mesure-disabled marginleftonly marginrightonly reposition" href="' . $_SERVER["PHP_SELF"] . '?mode=supplier&socid='.$socid.'&type=sub&search_accountancy_code_start='.$subledger_start_account.'&search_accountancy_code_end='.$subledger_end_account.'">'; |
|
| 782 | + print '<a class="a-mesure-disabled marginleftonly marginrightonly reposition" href="'.$_SERVER["PHP_SELF"].'?mode=supplier&socid='.$socid.'&type=sub&search_accountancy_code_start='.$subledger_start_account.'&search_accountancy_code_end='.$subledger_end_account.'">'; |
|
| 783 | 783 | } else { |
| 784 | 784 | print '<span class="a-mesure marginleftonly marginrightonly">'; |
| 785 | 785 | } |
@@ -824,7 +824,7 @@ discard block |
||
| 824 | 824 | $result = $object->fetchAllByAccount($sortorder, $sortfield, $limit, $offset, $filter, 'AND', 0); |
| 825 | 825 | } |
| 826 | 826 | //$num = count($object->lines); |
| 827 | - $num = $result; // $result is total nb of lines, or limit + 1, but $object->lines is always limited to $limit |
|
| 827 | + $num = $result; // $result is total nb of lines, or limit + 1, but $object->lines is always limited to $limit |
|
| 828 | 828 | |
| 829 | 829 | if ($result < 0) { |
| 830 | 830 | setEventMessages($object->error, $object->errors, 'errors'); |
@@ -840,13 +840,13 @@ discard block |
||
| 840 | 840 | // List of mass actions available |
| 841 | 841 | $arrayofmassactions = array(); |
| 842 | 842 | if (getDolGlobalInt('ACCOUNTING_ENABLE_LETTERING') && $user->hasRight('accounting', 'mouvements', 'creer')) { |
| 843 | - $arrayofmassactions['letteringauto'] = img_picto('', 'check', 'class="pictofixedwidth"') . $langs->trans('LetteringAuto'); |
|
| 844 | - $arrayofmassactions['preunletteringauto'] = img_picto('', 'uncheck', 'class="pictofixedwidth"') . $langs->trans('UnletteringAuto'); |
|
| 845 | - $arrayofmassactions['letteringmanual'] = img_picto('', 'check', 'class="pictofixedwidth"') . $langs->trans('LetteringManual'); |
|
| 843 | + $arrayofmassactions['letteringauto'] = img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans('LetteringAuto'); |
|
| 844 | + $arrayofmassactions['preunletteringauto'] = img_picto('', 'uncheck', 'class="pictofixedwidth"').$langs->trans('UnletteringAuto'); |
|
| 845 | + $arrayofmassactions['letteringmanual'] = img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans('LetteringManual'); |
|
| 846 | 846 | if ($type == 'sub') { |
| 847 | - $arrayofmassactions['letteringpartial'] = img_picto('', 'check', 'class="pictofixedwidth"') . $langs->trans('LetteringPartial'); |
|
| 847 | + $arrayofmassactions['letteringpartial'] = img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans('LetteringPartial'); |
|
| 848 | 848 | } |
| 849 | - $arrayofmassactions['preunletteringmanual'] = img_picto('', 'uncheck', 'class="pictofixedwidth"') . $langs->trans('UnletteringManual'); |
|
| 849 | + $arrayofmassactions['preunletteringmanual'] = img_picto('', 'uncheck', 'class="pictofixedwidth"').$langs->trans('UnletteringManual'); |
|
| 850 | 850 | } |
| 851 | 851 | if ($user->hasRight('accounting', 'mouvements', 'creer')) { |
| 852 | 852 | $arrayofmassactions['preclonebookkeepingwriting'] = img_picto('', 'clone', 'class="pictofixedwidth"').$langs->trans("Clone"); |
@@ -875,7 +875,7 @@ discard block |
||
| 875 | 875 | print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">'; |
| 876 | 876 | print '<input type="hidden" name="type" value="'.$type.'">'; |
| 877 | 877 | if (!empty($socid)) { |
| 878 | - print '<input type="hidden" name="socid" value="' . $socid . '">'; |
|
| 878 | + print '<input type="hidden" name="socid" value="'.$socid.'">'; |
|
| 879 | 879 | } |
| 880 | 880 | print '<input type="hidden" name="sortfield" value="'.$sortfield.'">'; |
| 881 | 881 | print '<input type="hidden" name="sortorder" value="'.$sortorder.'">'; |
@@ -892,16 +892,16 @@ discard block |
||
| 892 | 892 | if (empty($reshook)) { |
| 893 | 893 | // Remove navigation buttons if in thirdparty tab mode, except for PDF printing |
| 894 | 894 | if (empty($socid)) { |
| 895 | - $newcardbutton = dolGetButtonTitle($langs->trans('ViewFlatList'), '', 'fa fa-list paddingleft imgforviewmode', DOL_URL_ROOT . '/accountancy/bookkeeping/list.php?' . $param); |
|
| 895 | + $newcardbutton = dolGetButtonTitle($langs->trans('ViewFlatList'), '', 'fa fa-list paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/list.php?'.$param); |
|
| 896 | 896 | if ($type == 'sub') { |
| 897 | - $newcardbutton .= dolGetButtonTitle($langs->trans('GroupByAccountAccounting'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT . '/accountancy/bookkeeping/listbyaccount.php?' . $url_param, '', 1, array('morecss' => 'marginleftonly')); |
|
| 898 | - $newcardbutton .= dolGetButtonTitle($langs->trans('GroupBySubAccountAccounting'), '', 'fa fa-align-left vmirror paddingleft imgforviewmode', DOL_URL_ROOT . '/accountancy/bookkeeping/listbyaccount.php?type=sub&' . $url_param, '', 1, array('morecss' => 'marginleftonly btnTitleSelected')); |
|
| 897 | + $newcardbutton .= dolGetButtonTitle($langs->trans('GroupByAccountAccounting'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?'.$url_param, '', 1, array('morecss' => 'marginleftonly')); |
|
| 898 | + $newcardbutton .= dolGetButtonTitle($langs->trans('GroupBySubAccountAccounting'), '', 'fa fa-align-left vmirror paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?type=sub&'.$url_param, '', 1, array('morecss' => 'marginleftonly btnTitleSelected')); |
|
| 899 | 899 | } else { |
| 900 | - $newcardbutton .= dolGetButtonTitle($langs->trans('GroupByAccountAccounting'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT . '/accountancy/bookkeeping/listbyaccount.php?' . $url_param, '', 1, array('morecss' => 'marginleftonly btnTitleSelected')); |
|
| 901 | - $newcardbutton .= dolGetButtonTitle($langs->trans('GroupBySubAccountAccounting'), '', 'fa fa-align-left vmirror paddingleft imgforviewmode', DOL_URL_ROOT . '/accountancy/bookkeeping/listbyaccount.php?type=sub&' . $url_param, '', 1, array('morecss' => 'marginleftonly')); |
|
| 900 | + $newcardbutton .= dolGetButtonTitle($langs->trans('GroupByAccountAccounting'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?'.$url_param, '', 1, array('morecss' => 'marginleftonly btnTitleSelected')); |
|
| 901 | + $newcardbutton .= dolGetButtonTitle($langs->trans('GroupBySubAccountAccounting'), '', 'fa fa-align-left vmirror paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?type=sub&'.$url_param, '', 1, array('morecss' => 'marginleftonly')); |
|
| 902 | 902 | } |
| 903 | 903 | } |
| 904 | - $newcardbutton .= dolGetButtonTitle($langs->trans('ExportToPdf'), '', 'fa fa-file-pdf paddingleft', $_SERVER['PHP_SELF'] . '?action=exporttopdf'.(!empty($type) ? '&type=sub' : '').'&' . $url_param, '', 1, array('morecss' => 'marginleftonly')); |
|
| 904 | + $newcardbutton .= dolGetButtonTitle($langs->trans('ExportToPdf'), '', 'fa fa-file-pdf paddingleft', $_SERVER['PHP_SELF'].'?action=exporttopdf'.(!empty($type) ? '&type=sub' : '').'&'.$url_param, '', 1, array('morecss' => 'marginleftonly')); |
|
| 905 | 905 | |
| 906 | 906 | $newcardbutton .= dolGetButtonTitleSeparator(); |
| 907 | 907 | |
@@ -925,7 +925,7 @@ discard block |
||
| 925 | 925 | print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmMassDeleteBookkeepingWriting"), $langs->trans("ConfirmMassDeleteBookkeepingWritingQuestion", count($toselect)), "deletebookkeepingwriting", null, '', 0, 200, 500, 1); |
| 926 | 926 | } elseif ($massaction == 'preassignaccountbookkeepingwriting') { |
| 927 | 927 | $input = $formaccounting->select_account('', 'account', 1); |
| 928 | - $formquestion = array(array('type' => 'other', 'name' => 'account', 'label' => '<span class="fieldrequired">' . $langs->trans("AccountAccountingShort") . '</span>', 'value' => $input),); |
|
| 928 | + $formquestion = array(array('type' => 'other', 'name' => 'account', 'label' => '<span class="fieldrequired">'.$langs->trans("AccountAccountingShort").'</span>', 'value' => $input),); |
|
| 929 | 929 | print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("confirmMassAssignAccountBookkeepingWritingConfirm"), $langs->trans("ConfirmMassAssignAccountBookkeepingWritingQuestion", count($toselect)), "assignaccountbookkeepingwriting", $formquestion, '', 0, 200, 500, 1); |
| 930 | 930 | } elseif ($massaction == 'preclonebookkeepingwriting') { |
| 931 | 931 | $input1 = $form->selectDate('', 'massdate', 0, 0, 0, "create_mvt", 1, 1); |
@@ -934,7 +934,7 @@ discard block |
||
| 934 | 934 | array( |
| 935 | 935 | 'type' => 'other', |
| 936 | 936 | 'name' => 'massdate', |
| 937 | - 'label' => '<span class="fieldrequired">' . $langs->trans("Docdate") . '</span>', |
|
| 937 | + 'label' => '<span class="fieldrequired">'.$langs->trans("Docdate").'</span>', |
|
| 938 | 938 | 'value' => $input1 |
| 939 | 939 | ) |
| 940 | 940 | ); |
@@ -943,7 +943,7 @@ discard block |
||
| 943 | 943 | $formquestion[] = array( |
| 944 | 944 | 'type' => 'text', |
| 945 | 945 | 'name' => 'code_journal', |
| 946 | - 'label' => '<span class="fieldrequired">' . $langs->trans("Codejournal") . '</span>', |
|
| 946 | + 'label' => '<span class="fieldrequired">'.$langs->trans("Codejournal").'</span>', |
|
| 947 | 947 | 'value' => $input2 |
| 948 | 948 | ); |
| 949 | 949 | } |
@@ -958,7 +958,7 @@ discard block |
||
| 958 | 958 | ); |
| 959 | 959 | } elseif ($massaction == 'prereturnaccountbookkeepingwriting') { |
| 960 | 960 | $input1 = $form->selectDate('', 'massdate', 0, 0, 0, "create_mvt", 1, 1); |
| 961 | - $formquestion = array(array('type' => 'other', 'name' => 'massdate', 'label' => '<span class="fieldrequired">' . $langs->trans("Docdate") . '</span>', 'value' => $input1)); |
|
| 961 | + $formquestion = array(array('type' => 'other', 'name' => 'massdate', 'label' => '<span class="fieldrequired">'.$langs->trans("Docdate").'</span>', 'value' => $input1)); |
|
| 962 | 962 | print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmMassReturnAccountBookkeepingWriting"), $langs->trans("ConfirmMassReturnAccountBookkeepingWritingQuestion", count($toselect)), "returnaccountbookkeepingwriting", $formquestion, '', 0, 200, 500, 1); |
| 963 | 963 | } |
| 964 | 964 | |
@@ -1010,8 +1010,8 @@ discard block |
||
| 1010 | 1010 | } |
| 1011 | 1011 | |
| 1012 | 1012 | if (empty($socid)) { |
| 1013 | - $moreforfilter .= ' <a id="previous_account" accesskey="p" title="' . $conf->browser->stringforfirstkey . ' p" class="classfortooltip" href="#"><i class="fa fa-chevron-left"></i></a>'; |
|
| 1014 | - $moreforfilter .= ' <a id="next_account" accesskey="n" title="' . $conf->browser->stringforfirstkey . ' n" class="classfortooltip" href="#"><i class="fa fa-chevron-right"></i></a>'; |
|
| 1013 | + $moreforfilter .= ' <a id="previous_account" accesskey="p" title="'.$conf->browser->stringforfirstkey.' p" class="classfortooltip" href="#"><i class="fa fa-chevron-left"></i></a>'; |
|
| 1014 | + $moreforfilter .= ' <a id="next_account" accesskey="n" title="'.$conf->browser->stringforfirstkey.' n" class="classfortooltip" href="#"><i class="fa fa-chevron-right"></i></a>'; |
|
| 1015 | 1015 | $moreforfilter .= <<<SCRIPT |
| 1016 | 1016 | <script type="text/javascript"> |
| 1017 | 1017 | jQuery(document).ready(function() { |
@@ -1042,7 +1042,7 @@ discard block |
||
| 1042 | 1042 | |
| 1043 | 1043 | if (empty($socid)) { |
| 1044 | 1044 | $moreforfilter .= '<div class="divsearchfield">'; |
| 1045 | - $moreforfilter .= $langs->trans('AccountingCategory') . ': '; |
|
| 1045 | + $moreforfilter .= $langs->trans('AccountingCategory').': '; |
|
| 1046 | 1046 | $moreforfilter .= '<div class="nowrap inline-block">'; |
| 1047 | 1047 | $moreforfilter .= $formaccounting->select_accounting_category($search_account_category, 'search_account_category', 1, 0, 0, 0); |
| 1048 | 1048 | $moreforfilter .= '</div>'; |
@@ -1229,9 +1229,9 @@ discard block |
||
| 1229 | 1229 | |
| 1230 | 1230 | $displayed_account_number = null; // Start with undefined to be able to distinguish with empty |
| 1231 | 1231 | |
| 1232 | -$objectstatic = null; // Init for static analysis |
|
| 1233 | -$objectlink = ''; // Init for static analysis |
|
| 1234 | -$result = -1; // Init for static analysis |
|
| 1232 | +$objectstatic = null; // Init for static analysis |
|
| 1233 | +$objectlink = ''; // Init for static analysis |
|
| 1234 | +$result = -1; // Init for static analysis |
|
| 1235 | 1235 | |
| 1236 | 1236 | // Loop on record |
| 1237 | 1237 | // -------------------------------------------------------------------- |
@@ -1247,12 +1247,12 @@ discard block |
||
| 1247 | 1247 | $totalarray['val']['totalbalance'] = 0; |
| 1248 | 1248 | |
| 1249 | 1249 | // Init for static analysis |
| 1250 | -$colspan = 0; // colspan before field 'label of operation' |
|
| 1251 | -$colspanend = 0; // colspan after debit/credit |
|
| 1250 | +$colspan = 0; // colspan before field 'label of operation' |
|
| 1251 | +$colspanend = 0; // colspan after debit/credit |
|
| 1252 | 1252 | $accountg = '-'; |
| 1253 | 1253 | |
| 1254 | -$colspan = 0; // colspan before field 'label of operation' |
|
| 1255 | -$colspanend = 3; // colspan after debit/credit |
|
| 1254 | +$colspan = 0; // colspan before field 'label of operation' |
|
| 1255 | +$colspanend = 3; // colspan after debit/credit |
|
| 1256 | 1256 | if (!empty($arrayfields['t.piece_num']['checked'])) { $colspan++; } |
| 1257 | 1257 | if (!empty($arrayfields['t.code_journal']['checked'])) { $colspan++; } |
| 1258 | 1258 | if (!empty($arrayfields['t.doc_date']['checked'])) { $colspan++; } |
@@ -1276,8 +1276,8 @@ discard block |
||
| 1276 | 1276 | } |
| 1277 | 1277 | //if (empty($accountg)) $accountg = '-'; |
| 1278 | 1278 | |
| 1279 | - $colspan = 0; // colspan before field 'label of operation' |
|
| 1280 | - $colspanend = 0; // colspan after debit/credit |
|
| 1279 | + $colspan = 0; // colspan before field 'label of operation' |
|
| 1280 | + $colspanend = 0; // colspan after debit/credit |
|
| 1281 | 1281 | if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { |
| 1282 | 1282 | $colspan++; |
| 1283 | 1283 | } |
@@ -1330,9 +1330,9 @@ discard block |
||
| 1330 | 1330 | if (isset($displayed_account_number)) { |
| 1331 | 1331 | print '<tr class="liste_total">'; |
| 1332 | 1332 | if ($type == 'sub') { |
| 1333 | - print '<td class="right" colspan="' . $colspan . '">' . $langs->trans("TotalForAccount") . ' ' . length_accounta($displayed_account_number) . ':</td>'; |
|
| 1333 | + print '<td class="right" colspan="'.$colspan.'">'.$langs->trans("TotalForAccount").' '.length_accounta($displayed_account_number).':</td>'; |
|
| 1334 | 1334 | } else { |
| 1335 | - print '<td class="right" colspan="' . $colspan . '">' . $langs->trans("TotalForAccount") . ' ' . length_accountg($displayed_account_number) . ':</td>'; |
|
| 1335 | + print '<td class="right" colspan="'.$colspan.'">'.$langs->trans("TotalForAccount").' '.length_accountg($displayed_account_number).':</td>'; |
|
| 1336 | 1336 | } |
| 1337 | 1337 | print '<td class="nowrap right">'.price(price2num($sous_total_debit, 'MT')).'</td>'; |
| 1338 | 1338 | print '<td class="nowrap right">'.price(price2num($sous_total_credit, 'MT')).'</td>'; |
@@ -1371,9 +1371,9 @@ discard block |
||
| 1371 | 1371 | print length_accounta($line->subledger_account); |
| 1372 | 1372 | } else { |
| 1373 | 1373 | // Should not happen: subledger account must be null or a non empty value |
| 1374 | - print '<span class="error">' . $langs->trans("Unknown"); |
|
| 1374 | + print '<span class="error">'.$langs->trans("Unknown"); |
|
| 1375 | 1375 | if ($line->subledger_label) { |
| 1376 | - print ' (' . $line->subledger_label . ')'; |
|
| 1376 | + print ' ('.$line->subledger_label.')'; |
|
| 1377 | 1377 | $htmltext = 'EmptyStringForSubledgerAccountButSubledgerLabelDefined'; |
| 1378 | 1378 | } else { |
| 1379 | 1379 | $htmltext = 'EmptyStringForSubledgerAccountAndSubledgerLabel'; |
@@ -1383,9 +1383,9 @@ discard block |
||
| 1383 | 1383 | } |
| 1384 | 1384 | } else { |
| 1385 | 1385 | if ($line->numero_compte != "" && $line->numero_compte != '-1') { |
| 1386 | - print length_accountg($line->numero_compte) . ' : ' . $object->get_compte_desc($line->numero_compte); |
|
| 1386 | + print length_accountg($line->numero_compte).' : '.$object->get_compte_desc($line->numero_compte); |
|
| 1387 | 1387 | } else { |
| 1388 | - print '<span class="error">' . $langs->trans("Unknown") . '</span>'; |
|
| 1388 | + print '<span class="error">'.$langs->trans("Unknown").'</span>'; |
|
| 1389 | 1389 | } |
| 1390 | 1390 | } |
| 1391 | 1391 | print '</td>'; |
@@ -1406,7 +1406,7 @@ discard block |
||
| 1406 | 1406 | if (in_array($line->id, $arrayofselected)) { |
| 1407 | 1407 | $selected = 1; |
| 1408 | 1408 | } |
| 1409 | - print '<input id="cb' . $line->id . '" class="flat checkforselect" type="checkbox" name="toselect[]" value="' . $line->id . '"' . ($selected ? ' checked="checked"' : '') . ' />'; |
|
| 1409 | + print '<input id="cb'.$line->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$line->id.'"'.($selected ? ' checked="checked"' : '').' />'; |
|
| 1410 | 1410 | } |
| 1411 | 1411 | print '</td>'; |
| 1412 | 1412 | if (!$i) { |
@@ -1501,7 +1501,7 @@ discard block |
||
| 1501 | 1501 | } elseif ($line->doc_type == 'bank') { |
| 1502 | 1502 | print $objectstatic->getNomUrl(1); |
| 1503 | 1503 | $bank_ref = strstr($line->doc_ref, '-'); |
| 1504 | - print " " . $bank_ref; |
|
| 1504 | + print " ".$bank_ref; |
|
| 1505 | 1505 | } else { |
| 1506 | 1506 | print $line->doc_ref; |
| 1507 | 1507 | } |
@@ -1614,7 +1614,7 @@ discard block |
||
| 1614 | 1614 | if (in_array($line->id, $arrayofselected)) { |
| 1615 | 1615 | $selected = 1; |
| 1616 | 1616 | } |
| 1617 | - print '<input id="cb' . $line->id . '" class="flat checkforselect" type="checkbox" name="toselect[]" value="' . $line->id . '"' . ($selected ? ' checked="checked"' : '') . ' />'; |
|
| 1617 | + print '<input id="cb'.$line->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$line->id.'"'.($selected ? ' checked="checked"' : '').' />'; |
|
| 1618 | 1618 | } |
| 1619 | 1619 | print '</td>'; |
| 1620 | 1620 | if (!$i) { |
@@ -1675,7 +1675,7 @@ discard block |
||
| 1675 | 1675 | } |
| 1676 | 1676 | |
| 1677 | 1677 | // Show total line |
| 1678 | -$trforbreaknobg = 1; // used in list_print_total.tpl.php |
|
| 1678 | +$trforbreaknobg = 1; // used in list_print_total.tpl.php |
|
| 1679 | 1679 | include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php'; |
| 1680 | 1680 | |
| 1681 | 1681 | // If no record found |
@@ -60,8 +60,8 @@ discard block |
||
| 60 | 60 | $confirm = GETPOST('confirm', 'alpha'); |
| 61 | 61 | $cancel = GETPOST('cancel', 'aZ09'); |
| 62 | 62 | $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : str_replace('_', '', basename(dirname(__FILE__)).basename(__FILE__, '.php')); // To manage different context of search |
| 63 | -$backtopage = GETPOST('backtopage', 'alpha'); // if not set, a default page will be used |
|
| 64 | -$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); // if not set, $backtopage will be used |
|
| 63 | +$backtopage = GETPOST('backtopage', 'alpha'); // if not set, a default page will be used |
|
| 64 | +$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); // if not set, $backtopage will be used |
|
| 65 | 65 | $qty = GETPOSTINT('qty'); |
| 66 | 66 | $fk_product = GETPOSTINT('fk_product'); |
| 67 | 67 | $fk_warehouse_source = GETPOSTINT('fk_warehouse_source'); |
@@ -432,7 +432,7 @@ discard block |
||
| 432 | 432 | $date_prevue_depart = $object->date_prevue_depart; |
| 433 | 433 | $date_prevue_depart_plus_delai = $date_prevue_depart; |
| 434 | 434 | if ($object->lead_time_for_warning > 0) { |
| 435 | - $date_prevue_depart_plus_delai = strtotime(date('Y-m-d', $date_prevue_depart) . ' + '.$object->lead_time_for_warning.' day'); |
|
| 435 | + $date_prevue_depart_plus_delai = strtotime(date('Y-m-d', $date_prevue_depart).' + '.$object->lead_time_for_warning.' day'); |
|
| 436 | 436 | } |
| 437 | 437 | if (!empty($date_prevue_depart) && $date_prevue_depart_plus_delai < strtotime(date('Y-m-d'))) { |
| 438 | 438 | print "$('.valuefield.fieldname_date_prevue_depart').append('"; |
@@ -507,28 +507,28 @@ discard block |
||
| 507 | 507 | |
| 508 | 508 | // Part to edit record |
| 509 | 509 | if (($id || $ref) && $action == 'edit') { |
| 510 | - print load_fiche_titre($langs->trans("StockTransfer"), '', 'object_' . $object->picto); |
|
| 510 | + print load_fiche_titre($langs->trans("StockTransfer"), '', 'object_'.$object->picto); |
|
| 511 | 511 | |
| 512 | - print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">'; |
|
| 513 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
| 512 | + print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">'; |
|
| 513 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
| 514 | 514 | print '<input type="hidden" name="action" value="update">'; |
| 515 | - print '<input type="hidden" name="id" value="' . $object->id . '">'; |
|
| 515 | + print '<input type="hidden" name="id" value="'.$object->id.'">'; |
|
| 516 | 516 | if ($backtopage) { |
| 517 | - print '<input type="hidden" name="backtopage" value="' . $backtopage . '">'; |
|
| 517 | + print '<input type="hidden" name="backtopage" value="'.$backtopage.'">'; |
|
| 518 | 518 | } |
| 519 | 519 | if ($backtopageforcancel) { |
| 520 | - print '<input type="hidden" name="backtopageforcancel" value="' . $backtopageforcancel . '">'; |
|
| 520 | + print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">'; |
|
| 521 | 521 | } |
| 522 | 522 | |
| 523 | 523 | print dol_get_fiche_head(); |
| 524 | 524 | |
| 525 | - print '<table class="border centpercent tableforfieldedit">' . "\n"; |
|
| 525 | + print '<table class="border centpercent tableforfieldedit">'."\n"; |
|
| 526 | 526 | |
| 527 | 527 | // Common attributes |
| 528 | - include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_edit.tpl.php'; |
|
| 528 | + include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_edit.tpl.php'; |
|
| 529 | 529 | |
| 530 | 530 | // Other attributes |
| 531 | - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_edit.tpl.php'; |
|
| 531 | + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_edit.tpl.php'; |
|
| 532 | 532 | |
| 533 | 533 | print '</table>'; |
| 534 | 534 | |
@@ -564,28 +564,28 @@ discard block |
||
| 564 | 564 | $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneAsk', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); |
| 565 | 565 | } elseif ($action == 'destock') { // Destock confirmation |
| 566 | 566 | // Create an array for form |
| 567 | - $formquestion = array( 'text' => '', |
|
| 567 | + $formquestion = array('text' => '', |
|
| 568 | 568 | 0 => array('type' => 'text', 'name' => 'label', 'label' => $langs->trans("Label"), 'value' => $langs->trans('ConfirmDestock', $object->ref), 'size' => 40), |
| 569 | 569 | 1 => array('type' => 'text', 'name' => 'inventorycode', 'label' => $langs->trans("InventoryCode"), 'value' => dol_print_date(dol_now(), '%y%m%d%H%M%S'), 'size' => 25) |
| 570 | 570 | ); |
| 571 | 571 | $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DestockAllProduct'), '', 'confirm_destock', $formquestion, 'yes', 1); |
| 572 | 572 | } elseif ($action == 'destockcancel') { // Destock confirmation cancel |
| 573 | 573 | // Create an array for form |
| 574 | - $formquestion = array( 'text' => '', |
|
| 574 | + $formquestion = array('text' => '', |
|
| 575 | 575 | 0 => array('type' => 'text', 'name' => 'label', 'label' => $langs->trans("Label"), 'value' => $langs->trans('ConfirmDestockCancel', $object->ref), 'size' => 40), |
| 576 | 576 | 1 => array('type' => 'text', 'name' => 'inventorycode', 'label' => $langs->trans("InventoryCode"), 'value' => dol_print_date(dol_now(), '%y%m%d%H%M%S'), 'size' => 25) |
| 577 | 577 | ); |
| 578 | 578 | $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DestockAllProductCancel'), '', 'confirm_destockcancel', $formquestion, 'yes', 1); |
| 579 | 579 | } elseif ($action == 'addstock') { // Addstock confirmation |
| 580 | 580 | // Create an array for form |
| 581 | - $formquestion = array( 'text' => '', |
|
| 581 | + $formquestion = array('text' => '', |
|
| 582 | 582 | 0 => array('type' => 'text', 'name' => 'label', 'label' => $langs->trans("Label").' :', 'value' => $langs->trans('ConfirmAddStock', $object->ref), 'size' => 40), |
| 583 | 583 | 1 => array('type' => 'text', 'name' => 'inventorycode', 'label' => $langs->trans("InventoryCode"), 'value' => dol_print_date(dol_now(), '%y%m%d%H%M%S'), 'size' => 25) |
| 584 | 584 | ); |
| 585 | 585 | $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('AddStockAllProduct'), '', 'confirm_addstock', $formquestion, 'yes', 1); |
| 586 | 586 | } elseif ($action == 'addstockcancel') { // Addstock confirmation cancel |
| 587 | 587 | // Create an array for form |
| 588 | - $formquestion = array( 'text' => '', |
|
| 588 | + $formquestion = array('text' => '', |
|
| 589 | 589 | 0 => array('type' => 'text', 'name' => 'label', 'label' => $langs->trans("Label").' :', 'value' => $langs->trans('ConfirmAddStockCancel', $object->ref), 'size' => 40), |
| 590 | 590 | 1 => array('type' => 'text', 'name' => 'inventorycode', 'label' => $langs->trans("InventoryCode"), 'value' => dol_print_date(dol_now(), '%y%m%d%H%M%S'), 'size' => 25) |
| 591 | 591 | ); |
@@ -881,13 +881,13 @@ discard block |
||
| 881 | 881 | print '<input type="submit" class="button buttongen marginbottomonly" id="cancellinebutton" name="cancel" value="'.$langs->trans("Cancel").'"></td>'; |
| 882 | 882 | } else { |
| 883 | 883 | print '<td class="right">'; |
| 884 | - print '<a class="editfielda reposition" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=editline&lineid=' . $line->id . '#line_' . $line->id . '">'; |
|
| 885 | - print img_edit() . '</a>'; |
|
| 884 | + print '<a class="editfielda reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=editline&lineid='.$line->id.'#line_'.$line->id.'">'; |
|
| 885 | + print img_edit().'</a>'; |
|
| 886 | 886 | print '</td>'; |
| 887 | 887 | print '<td class="right">'; |
| 888 | 888 | // Ensure the delete line link embeds a CSRF token. |
| 889 | - $deleteLineUrl = $_SERVER["PHP_SELF"] . '?id=' . $id . '&action=deleteline&lineid=' . $line->id . '&token=' . newToken(); |
|
| 890 | - print '<a href="' . $deleteLineUrl . '">' . img_delete($langs->trans("Remove")) . '</a>'; |
|
| 889 | + $deleteLineUrl = $_SERVER["PHP_SELF"].'?id='.$id.'&action=deleteline&lineid='.$line->id.'&token='.newToken(); |
|
| 890 | + print '<a href="'.$deleteLineUrl.'">'.img_delete($langs->trans("Remove")).'</a>'; |
|
| 891 | 891 | print '</td>'; |
| 892 | 892 | } |
| 893 | 893 | |
@@ -991,7 +991,7 @@ discard block |
||
| 991 | 991 | print '<td></td>'; |
| 992 | 992 | |
| 993 | 993 | // Button to add line |
| 994 | - print '<td class="right" colspan="2"><input type="submit" class="button" name="addline" value="' . dol_escape_htmltag($langs->trans('Add')) . '"></td>'; |
|
| 994 | + print '<td class="right" colspan="2"><input type="submit" class="button" name="addline" value="'.dol_escape_htmltag($langs->trans('Add')).'"></td>'; |
|
| 995 | 995 | |
| 996 | 996 | // Grad and drop lines |
| 997 | 997 | print '<td></td>'; |
@@ -1095,9 +1095,9 @@ discard block |
||
| 1095 | 1095 | // Documents |
| 1096 | 1096 | if ($includedocgeneration) { |
| 1097 | 1097 | $objref = dol_sanitizeFileName($object->ref); |
| 1098 | - $relativepath = $objref . '/' . $objref . '.pdf'; |
|
| 1098 | + $relativepath = $objref.'/'.$objref.'.pdf'; |
|
| 1099 | 1099 | $filedir = $conf->stocktransfer->dir_output.'/'.$object->element.'/'.$objref; |
| 1100 | - $urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id; |
|
| 1100 | + $urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id; |
|
| 1101 | 1101 | $genallowed = $permissiontoread; // If you can read, you can build the PDF to read content |
| 1102 | 1102 | $delallowed = $permissiontoadd; // If you can create/edit, you can remove a file on card |
| 1103 | 1103 | print $formfile->showdocuments('stocktransfer:StockTransfer', $object->element.'/'.$objref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', $langs->defaultlang); |
@@ -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); |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | session_set_cookie_params($sessioncookieparams); |
| 138 | 138 | } |
| 139 | 139 | session_name($sessionname); |
| 140 | - dol_session_start(); // This call the open and read of session handler |
|
| 140 | + dol_session_start(); // This call the open and read of session handler |
|
| 141 | 141 | //exit; // this exist generates a call to write and close |
| 142 | 142 | } |
| 143 | 143 | |
@@ -174,12 +174,12 @@ discard block |
||
| 174 | 174 | if (!$ok) { |
| 175 | 175 | if (session_id() && isset($_SESSION["dol_login"]) && !in_array($_SESSION["dol_login"], explode(';', getDolGlobalString('MAIN_ONLY_LOGIN_ALLOWED')))) { |
| 176 | 176 | print 'Sorry, your application is offline.'."\n"; |
| 177 | - 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"; |
|
| 178 | - $nexturl = dolBuildUrl(DOL_URL_ROOT . '/user/logout.php', [], true); |
|
| 177 | + 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"; |
|
| 178 | + $nexturl = dolBuildUrl(DOL_URL_ROOT.'/user/logout.php', [], true); |
|
| 179 | 179 | print 'Please try later or <a href="'.$nexturl.'">click here to disconnect and change login user</a>...'."\n"; |
| 180 | 180 | } else { |
| 181 | - print 'Sorry, your application is offline. Only administrator users (' . str_replace(';', ', ', getDolGlobalString('MAIN_ONLY_LOGIN_ALLOWED')).') is allowed to connect for the moment.'."\n"; |
|
| 182 | - $nexturl = dolBuildUrl(DOL_URL_ROOT . '/'); |
|
| 181 | + print 'Sorry, your application is offline. Only administrator users ('.str_replace(';', ', ', getDolGlobalString('MAIN_ONLY_LOGIN_ALLOWED')).') is allowed to connect for the moment.'."\n"; |
|
| 182 | + $nexturl = dolBuildUrl(DOL_URL_ROOT.'/'); |
|
| 183 | 183 | print 'Please try later or <a href="'.$nexturl.'">click here to change login user</a>...'."\n"; |
| 184 | 184 | } |
| 185 | 185 | exit; |
@@ -410,7 +410,7 @@ discard block |
||
| 410 | 410 | 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"; |
| 411 | 411 | 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"; |
| 412 | 412 | if (getDolGlobalString('MAIN_SECURITY_CSRF_WITH_TOKEN')) { |
| 413 | - print " instead of " . getDolGlobalString('MAIN_SECURITY_CSRF_WITH_TOKEN'); |
|
| 413 | + print " instead of ".getDolGlobalString('MAIN_SECURITY_CSRF_WITH_TOKEN'); |
|
| 414 | 414 | } |
| 415 | 415 | print " into setup).\n"; |
| 416 | 416 | } |
@@ -438,7 +438,7 @@ discard block |
||
| 438 | 438 | unset($_GET['action']); |
| 439 | 439 | unset($_GET['confirmmassaction']); |
| 440 | 440 | unset($_GET['massaction']); |
| 441 | - unset($_GET['token']); // TODO Make a redirect if we have a token in url to remove it ? |
|
| 441 | + unset($_GET['token']); // TODO Make a redirect if we have a token in url to remove it ? |
|
| 442 | 442 | if (isset($savid)) { |
| 443 | 443 | $_POST['id'] = ((int) $savid); |
| 444 | 444 | } |
@@ -460,18 +460,18 @@ discard block |
||
| 460 | 460 | foreach ($disabled_modules as $module) { |
| 461 | 461 | if ($module) { |
| 462 | 462 | if (empty($conf->$module)) { |
| 463 | - $conf->$module = new stdClass(); // To avoid warnings |
|
| 463 | + $conf->$module = new stdClass(); // To avoid warnings |
|
| 464 | 464 | } |
| 465 | 465 | |
| 466 | - $conf->$module->enabled = false; // Old usage |
|
| 466 | + $conf->$module->enabled = false; // Old usage |
|
| 467 | 467 | unset($conf->modules[$module]); |
| 468 | 468 | |
| 469 | 469 | foreach ($modulepartkeys as $modulepartkey) { |
| 470 | 470 | unset($conf->modules_parts[$modulepartkey][$module]); |
| 471 | 471 | } |
| 472 | 472 | if ($module == 'fournisseur') { // Special case |
| 473 | - $conf->supplier_order->enabled = 0; // Old usage |
|
| 474 | - $conf->supplier_invoice->enabled = 0; // Old usage |
|
| 473 | + $conf->supplier_order->enabled = 0; // Old usage |
|
| 474 | + $conf->supplier_invoice->enabled = 0; // Old usage |
|
| 475 | 475 | unset($conf->modules['supplier_order']); |
| 476 | 476 | unset($conf->modules['supplier_invoice']); |
| 477 | 477 | } |
@@ -568,7 +568,7 @@ discard block |
||
| 568 | 568 | if ($dol_use_jmobile) { |
| 569 | 569 | $query += ['dol_use_jmobile='.$dol_use_jmobile]; |
| 570 | 570 | } |
| 571 | - header("Location: " . dolBuildUrl(DOL_URL_ROOT . '/public/demo/index.php', $query)); |
|
| 571 | + header("Location: ".dolBuildUrl(DOL_URL_ROOT.'/public/demo/index.php', $query)); |
|
| 572 | 572 | exit; |
| 573 | 573 | } |
| 574 | 574 | } |
@@ -616,12 +616,12 @@ discard block |
||
| 616 | 616 | if (is_object($captchaobj) && method_exists($captchaobj, 'validateCodeAfterLoginSubmit')) { |
| 617 | 617 | $ok = $captchaobj->validateCodeAfterLoginSubmit(); // @phan-suppress-current-line PhanUndeclaredMethod |
| 618 | 618 | } else { |
| 619 | - $_SESSION["dol_loginmesg"] = 'Error, the captcha handler '.get_class($captchaobj).' does not have any method validateCodeAfterLoginSubmit()'; |
|
| 619 | + $_SESSION["dol_loginmesg"] = 'Error, the captcha handler '.get_class($captchaobj).' does not have any method validateCodeAfterLoginSubmit()'; |
|
| 620 | 620 | $test = false; |
| 621 | 621 | $error++; |
| 622 | 622 | } |
| 623 | 623 | } else { |
| 624 | - $_SESSION["dol_loginmesg"] = 'Error, the captcha handler class '.$classname.' was not found after the include'; |
|
| 624 | + $_SESSION["dol_loginmesg"] = 'Error, the captcha handler class '.$classname.' was not found after the include'; |
|
| 625 | 625 | $test = false; |
| 626 | 626 | $error++; |
| 627 | 627 | } |
@@ -665,7 +665,7 @@ discard block |
||
| 665 | 665 | |
| 666 | 666 | $allowedmethodtopostusername = 3; |
| 667 | 667 | if (defined('MAIN_AUTHENTICATION_POST_METHOD')) { |
| 668 | - $allowedmethodtopostusername = constant('MAIN_AUTHENTICATION_POST_METHOD'); // Note a value of 2 is not compatible with some authentication methods that put username as GET parameter |
|
| 668 | + $allowedmethodtopostusername = constant('MAIN_AUTHENTICATION_POST_METHOD'); // Note a value of 2 is not compatible with some authentication methods that put username as GET parameter |
|
| 669 | 669 | } |
| 670 | 670 | // TODO Remove use of $_COOKIE['login_dolibarr'] by replacing line with $usertotest = GETPOST("username", "alpha", $allowedmethodtopostusername); ? |
| 671 | 671 | $usertotest = (!empty($_COOKIE['login_dolibarr']) ? preg_replace('/[^a-zA-Z0-9_@\-\.]/', '', $_COOKIE['login_dolibarr']) : GETPOST("username", "alpha", $allowedmethodtopostusername)); |
@@ -814,7 +814,7 @@ discard block |
||
| 814 | 814 | } |
| 815 | 815 | |
| 816 | 816 | // Show login form |
| 817 | - dol_loginfunction($langs, $conf, (!empty($mysoc) ? $mysoc : '')); // This include http headers |
|
| 817 | + dol_loginfunction($langs, $conf, (!empty($mysoc) ? $mysoc : '')); // This include http headers |
|
| 818 | 818 | } |
| 819 | 819 | exit; |
| 820 | 820 | } |
@@ -875,7 +875,7 @@ discard block |
||
| 875 | 875 | if (GETPOST('lang', 'aZ09')) { |
| 876 | 876 | $paramsurl += ['lang' => (string) GETPOST('lang', 'aZ09')]; |
| 877 | 877 | } |
| 878 | - header('Location: '.dolBuildUrl(DOL_URL_ROOT . '/index.php', $paramsurl)); |
|
| 878 | + header('Location: '.dolBuildUrl(DOL_URL_ROOT.'/index.php', $paramsurl)); |
|
| 879 | 879 | exit; |
| 880 | 880 | } else { |
| 881 | 881 | // User is loaded, we may need to change language for him according to its choice |
@@ -1173,7 +1173,7 @@ discard block |
||
| 1173 | 1173 | } else { |
| 1174 | 1174 | // We may have NOLOGIN set, but NOREQUIREUSER not |
| 1175 | 1175 | if (!empty($user) && method_exists($user, 'loadDefaultValues') && !defined('NODEFAULTVALUES')) { |
| 1176 | - $user->loadDefaultValues(); // Load default values for everybody (works even if $user->id = 0 |
|
| 1176 | + $user->loadDefaultValues(); // Load default values for everybody (works even if $user->id = 0 |
|
| 1177 | 1177 | } |
| 1178 | 1178 | } |
| 1179 | 1179 | |
@@ -1236,7 +1236,7 @@ discard block |
||
| 1236 | 1236 | $conf->dol_optimize_smallscreen = 1; |
| 1237 | 1237 | |
| 1238 | 1238 | if (getDolGlobalInt('PRODUIT_DESC_IN_FORM') == 1) { |
| 1239 | - $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 |
|
| 1239 | + $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 |
|
| 1240 | 1240 | } |
| 1241 | 1241 | } |
| 1242 | 1242 | // 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 |
@@ -1792,9 +1792,9 @@ 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 ? '?' . $ext : '') . '">' . "\n"; // Forced JQuery |
|
| 1795 | + print '<link rel="stylesheet" type="text/css" href="'.JS_JQUERY_UI.'css/'.$jquerytheme.'/jquery-ui.min.css'.($ext ? '?'.$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 ? '?' . $ext : '') . '">' . "\n"; // JQuery |
|
| 1797 | + print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/css/'.$jquerytheme.'/jquery-ui.css'.($ext ? '?'.$ext : '').'">'."\n"; // JQuery |
|
| 1798 | 1798 | } |
| 1799 | 1799 | } |
| 1800 | 1800 | if (!defined('DISABLE_JQUERY_JNOTIFY')) { |
@@ -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 |
@@ -1901,9 +1901,9 @@ discard block |
||
| 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 ? '?' . $ext : '') . '"></script>' . "\n"; |
|
| 1904 | + print '<script nonce="'.getNonce().'" src="'.JS_JQUERY_UI.'jquery-ui.min.js'.($ext ? '?'.$ext : '').'"></script>'."\n"; |
|
| 1905 | 1905 | } else { |
| 1906 | - print '<script nonce="' . getNonce() . '" src="' . DOL_URL_ROOT . '/includes/jquery/js/jquery-ui.min.js' . ($ext ? '?' . $ext : '') . '"></script>' . "\n"; |
|
| 1906 | + print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/includes/jquery/js/jquery-ui.min.js'.($ext ? '?'.$ext : '').'"></script>'."\n"; |
|
| 1907 | 1907 | } |
| 1908 | 1908 | } |
| 1909 | 1909 | // jQuery jnotify |
@@ -1993,7 +1993,7 @@ discard block |
||
| 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 ? '&' . $ext : '') . '"></script>' . "\n"; |
|
| 1996 | + print '<script nonce="'.getNonce().'" src="'.DOL_URL_ROOT.'/core/js/lib_head.js.php?lang='.$langs->defaultlang.($ext ? '&'.$ext : '').'"></script>'."\n"; |
|
| 1997 | 1997 | } |
| 1998 | 1998 | |
| 1999 | 1999 | // Leaflet |
@@ -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 | |
@@ -3727,7 +3727,7 @@ discard block |
||
| 3727 | 3727 | $forceping = GETPOST('forceping', 'alpha'); |
| 3728 | 3728 | if (($_SERVER["PHP_SELF"] == DOL_URL_ROOT.'/index.php') || $forceping) { |
| 3729 | 3729 | //print '<!-- instance_unique_id='.$conf->file->instance_unique_id.' MAIN_FIRST_PING_OK_ID='.getDolGlobalString('MAIN_FIRST_PING_OK_ID').' -->'; |
| 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 | |
| 3732 | 3732 | if (!getDolGlobalString('MAIN_FIRST_PING_OK_DATE') |
| 3733 | 3733 | || (!empty($conf->file->instance_unique_id) && ($hash_unique_id != getDolGlobalString('MAIN_FIRST_PING_OK_ID')) && (getDolGlobalString('MAIN_FIRST_PING_OK_ID') != 'disabled')) |