@@ -24,8 +24,8 @@ discard block |
||
24 | 24 | |
25 | 25 | // Load Dolibarr environment |
26 | 26 | require_once "../../main.inc.php"; |
27 | -require_once DOL_DOCUMENT_ROOT . "/core/lib/admin.lib.php"; |
|
28 | -require_once DOL_DOCUMENT_ROOT . "/webportal/lib/webportal.lib.php"; |
|
27 | +require_once DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php"; |
|
28 | +require_once DOL_DOCUMENT_ROOT."/webportal/lib/webportal.lib.php"; |
|
29 | 29 | |
30 | 30 | // Translations |
31 | 31 | $langs->loadLangs(array("admin", "webportal", "website")); |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | // Parameters |
37 | 37 | $action = GETPOST('action', 'aZ09'); |
38 | 38 | $backtopage = GETPOST('backtopage', 'alpha'); |
39 | -$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php |
|
39 | +$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php |
|
40 | 40 | |
41 | 41 | $value = GETPOST('value', 'alpha'); |
42 | 42 | $label = GETPOST('label', 'alpha'); |
@@ -54,12 +54,12 @@ discard block |
||
54 | 54 | $useFormSetup = 1; |
55 | 55 | |
56 | 56 | if (!class_exists('FormSetup')) { |
57 | - require_once DOL_DOCUMENT_ROOT . '/core/class/html.formsetup.class.php'; |
|
57 | + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formsetup.class.php'; |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | $formSetup = new FormSetup($db); |
61 | 61 | |
62 | -require_once __DIR__ . '/../class/webPortalTheme.class.php'; |
|
62 | +require_once __DIR__.'/../class/webPortalTheme.class.php'; |
|
63 | 63 | $webPortalTheme = new WebPortalTheme(); |
64 | 64 | |
65 | 65 | // Setup conf for secondary color |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | * Actions |
96 | 96 | */ |
97 | 97 | |
98 | -include DOL_DOCUMENT_ROOT . '/core/actions_setmoduleoptions.inc.php'; |
|
98 | +include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; |
|
99 | 99 | |
100 | 100 | // Force always edit mode |
101 | 101 | if (empty($action) || $action == 'update') { |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | llxHeader('', $langs->trans($title), $help_url); |
116 | 116 | |
117 | 117 | // Subheader |
118 | -$linkback = '<a href="' . ($backtopage ? $backtopage : DOL_URL_ROOT . '/admin/modules.php?restore_lastsearch_values=1') . '">' . $langs->trans("BackToModuleList") . '</a>'; |
|
118 | +$linkback = '<a href="'.($backtopage ? $backtopage : DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1').'">'.$langs->trans("BackToModuleList").'</a>'; |
|
119 | 119 | |
120 | 120 | print load_fiche_titre($langs->trans($title), $linkback, 'title_setup'); |
121 | 121 | |
@@ -132,10 +132,10 @@ discard block |
||
132 | 132 | } elseif (!empty($formSetup->items)) { |
133 | 133 | print $formSetup->generateOutput(); |
134 | 134 | print '<div class="tabsAction">'; |
135 | - print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?action=edit&token=' . newToken() . '">' . $langs->trans("Modify") . '</a>'; |
|
135 | + print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit&token='.newToken().'">'.$langs->trans("Modify").'</a>'; |
|
136 | 136 | print '</div>'; |
137 | 137 | } else { |
138 | - print '<br>' . $langs->trans("NothingToSetup"); |
|
138 | + print '<br>'.$langs->trans("NothingToSetup"); |
|
139 | 139 | } |
140 | 140 | |
141 | 141 |
@@ -24,8 +24,8 @@ discard block |
||
24 | 24 | |
25 | 25 | // Load Dolibarr environment |
26 | 26 | require_once "../../main.inc.php"; |
27 | -require_once DOL_DOCUMENT_ROOT . "/core/lib/admin.lib.php"; |
|
28 | -require_once DOL_DOCUMENT_ROOT . "/webportal/lib/webportal.lib.php"; |
|
27 | +require_once DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php"; |
|
28 | +require_once DOL_DOCUMENT_ROOT."/webportal/lib/webportal.lib.php"; |
|
29 | 29 | |
30 | 30 | // Translations |
31 | 31 | $langs->loadLangs(array("admin", "webportal", "website")); |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | // Parameters |
37 | 37 | $action = GETPOST('action', 'aZ09'); |
38 | 38 | $backtopage = GETPOST('backtopage', 'alpha'); |
39 | -$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php |
|
39 | +$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php |
|
40 | 40 | |
41 | 41 | $value = GETPOST('value', 'alpha'); |
42 | 42 | $label = GETPOST('label', 'alpha'); |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | $useFormSetup = 1; |
56 | 56 | |
57 | 57 | if (!class_exists('FormSetup')) { |
58 | - require_once DOL_DOCUMENT_ROOT . '/core/class/html.formsetup.class.php'; |
|
58 | + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formsetup.class.php'; |
|
59 | 59 | } |
60 | 60 | $formSetup = new FormSetup($db); |
61 | 61 | |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | $item->nameText = $langs->transnoentities('UrlPublicInterfaceLabelAdmin'); |
65 | 65 | $item->fieldAttr = array('placeholder' => 'https://'); |
66 | 66 | $item->helpText = $langs->transnoentities('UrlPublicInterfaceHelpAdmin'); |
67 | -require_once __DIR__ . '/../class/context.class.php'; |
|
67 | +require_once __DIR__.'/../class/context.class.php'; |
|
68 | 68 | //$context = Context::getInstance(); |
69 | 69 | //$item->fieldOutputOverride = '<a target="_blank" href="'.Context::getRootConfigUrl().'" >'.img_picto('', 'globe', 'class="pictofixedwidth"').Context::getRootConfigUrl().'</a>'; |
70 | 70 | |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | * Actions |
119 | 119 | */ |
120 | 120 | |
121 | -include DOL_DOCUMENT_ROOT . '/core/actions_setmoduleoptions.inc.php'; |
|
121 | +include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; |
|
122 | 122 | |
123 | 123 | if ($action == 'updateMask') { |
124 | 124 | $maskconst = GETPOST('maskconst', 'aZ09'); |
@@ -149,10 +149,10 @@ discard block |
||
149 | 149 | $filefound = 0; |
150 | 150 | $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']); |
151 | 151 | foreach ($dirmodels as $reldir) { |
152 | - $file = dol_buildpath($reldir . "core/modules/webportal/doc/pdf_" . $modele . "_" . strtolower($tmpobjectkey) . ".modules.php", 0); |
|
152 | + $file = dol_buildpath($reldir."core/modules/webportal/doc/pdf_".$modele."_".strtolower($tmpobjectkey).".modules.php", 0); |
|
153 | 153 | if (file_exists($file)) { |
154 | 154 | $filefound = 1; |
155 | - $classname = "pdf_" . $modele . "_" . strtolower($tmpobjectkey); |
|
155 | + $classname = "pdf_".$modele."_".strtolower($tmpobjectkey); |
|
156 | 156 | break; |
157 | 157 | } |
158 | 158 | } |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | $module = new $classname($db); |
164 | 164 | |
165 | 165 | if ($module->write_file($tmpobject, $langs) > 0) { |
166 | - header("Location: " . DOL_URL_ROOT . "/document.php?modulepart=webportal-" . strtolower($tmpobjectkey) . "&file=SPECIMEN.pdf"); |
|
166 | + header("Location: ".DOL_URL_ROOT."/document.php?modulepart=webportal-".strtolower($tmpobjectkey)."&file=SPECIMEN.pdf"); |
|
167 | 167 | return; |
168 | 168 | } else { |
169 | 169 | setEventMessages($module->error, null, 'errors'); |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | // TODO Check if numbering module chosen can be activated by calling method canBeActivated |
178 | 178 | $tmpobjectkey = GETPOST('object'); |
179 | 179 | if (!empty($tmpobjectkey)) { |
180 | - $constforval = 'WEBPORTAL_' . strtoupper($tmpobjectkey) . "_ADDON"; |
|
180 | + $constforval = 'WEBPORTAL_'.strtoupper($tmpobjectkey)."_ADDON"; |
|
181 | 181 | dolibarr_set_const($db, $constforval, $value, 'chaine', 0, '', $conf->entity); |
182 | 182 | } |
183 | 183 | } elseif ($action == 'set') { |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | if ($ret > 0) { |
189 | 189 | $tmpobjectkey = GETPOST('object'); |
190 | 190 | if (!empty($tmpobjectkey)) { |
191 | - $constforval = 'WEBPORTAL_' . strtoupper($tmpobjectkey) . '_ADDON_PDF'; |
|
191 | + $constforval = 'WEBPORTAL_'.strtoupper($tmpobjectkey).'_ADDON_PDF'; |
|
192 | 192 | if (getDolGlobalString($constforval) == "$value") { |
193 | 193 | dolibarr_del_const($db, $constforval, $conf->entity); |
194 | 194 | } |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | // Set or unset default model |
199 | 199 | $tmpobjectkey = GETPOST('object'); |
200 | 200 | if (!empty($tmpobjectkey)) { |
201 | - $constforval = 'WEBPORTAL_' . strtoupper($tmpobjectkey) . '_ADDON_PDF'; |
|
201 | + $constforval = 'WEBPORTAL_'.strtoupper($tmpobjectkey).'_ADDON_PDF'; |
|
202 | 202 | if (dolibarr_set_const($db, $constforval, $value, 'chaine', 0, '', $conf->entity)) { |
203 | 203 | // The constant that was read before the new set |
204 | 204 | // We therefore requires a variable to have a coherent view |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | } elseif ($action == 'unsetdoc') { |
215 | 215 | $tmpobjectkey = GETPOST('object'); |
216 | 216 | if (!empty($tmpobjectkey)) { |
217 | - $constforval = 'WEBPORTAL_' . strtoupper($tmpobjectkey) . '_ADDON_PDF'; |
|
217 | + $constforval = 'WEBPORTAL_'.strtoupper($tmpobjectkey).'_ADDON_PDF'; |
|
218 | 218 | dolibarr_del_const($db, $constforval, $conf->entity); |
219 | 219 | } |
220 | 220 | } |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | llxHeader('', $langs->trans($title), $help_url); |
238 | 238 | |
239 | 239 | // Subheader |
240 | -$linkback = '<a href="' . ($backtopage ? $backtopage : DOL_URL_ROOT . '/admin/modules.php?restore_lastsearch_values=1') . '">' . $langs->trans("BackToModuleList") . '</a>'; |
|
240 | +$linkback = '<a href="'.($backtopage ? $backtopage : DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1').'">'.$langs->trans("BackToModuleList").'</a>'; |
|
241 | 241 | |
242 | 242 | print load_fiche_titre($langs->trans($title), $linkback, 'title_setup'); |
243 | 243 | |
@@ -278,10 +278,10 @@ discard block |
||
278 | 278 | } elseif (!empty($formSetup->items)) { |
279 | 279 | print $formSetup->generateOutput(); |
280 | 280 | print '<div class="tabsAction">'; |
281 | - print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?action=edit&token=' . newToken() . '">' . $langs->trans("Modify") . '</a>'; |
|
281 | + print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit&token='.newToken().'">'.$langs->trans("Modify").'</a>'; |
|
282 | 282 | print '</div>'; |
283 | 283 | } else { |
284 | - print '<br>' . $langs->trans("NothingToSetup"); |
|
284 | + print '<br>'.$langs->trans("NothingToSetup"); |
|
285 | 285 | } |
286 | 286 | |
287 | 287 | |
@@ -303,26 +303,26 @@ discard block |
||
303 | 303 | |
304 | 304 | print '<table class="noborder centpercent">'; |
305 | 305 | print '<tr class="liste_titre">'; |
306 | - print '<td>' . $langs->trans("Name") . '</td>'; |
|
307 | - print '<td>' . $langs->trans("Description") . '</td>'; |
|
308 | - print '<td class="nowrap">' . $langs->trans("Example") . '</td>'; |
|
309 | - print '<td class="center" width="60">' . $langs->trans("Status") . '</td>'; |
|
310 | - print '<td class="center" width="16">' . $langs->trans("ShortInfo") . '</td>'; |
|
311 | - print '</tr>' . "\n"; |
|
306 | + print '<td>'.$langs->trans("Name").'</td>'; |
|
307 | + print '<td>'.$langs->trans("Description").'</td>'; |
|
308 | + print '<td class="nowrap">'.$langs->trans("Example").'</td>'; |
|
309 | + print '<td class="center" width="60">'.$langs->trans("Status").'</td>'; |
|
310 | + print '<td class="center" width="16">'.$langs->trans("ShortInfo").'</td>'; |
|
311 | + print '</tr>'."\n"; |
|
312 | 312 | |
313 | 313 | clearstatcache(); |
314 | 314 | |
315 | 315 | foreach ($dirmodels as $reldir) { |
316 | - $dir = dol_buildpath($reldir . "core/modules/" . $moduledir); |
|
316 | + $dir = dol_buildpath($reldir."core/modules/".$moduledir); |
|
317 | 317 | |
318 | 318 | if (is_dir($dir)) { |
319 | 319 | $handle = opendir($dir); |
320 | 320 | if (is_resource($handle)) { |
321 | 321 | while (($file = readdir($handle)) !== false) { |
322 | - if (strpos($file, 'mod_' . strtolower($myTmpObjectKey) . '_') === 0 && substr($file, dol_strlen($file) - 3, 3) == 'php') { |
|
322 | + if (strpos($file, 'mod_'.strtolower($myTmpObjectKey).'_') === 0 && substr($file, dol_strlen($file) - 3, 3) == 'php') { |
|
323 | 323 | $file = substr($file, 0, dol_strlen($file) - 4); |
324 | 324 | |
325 | - require_once $dir . '/' . $file . '.php'; |
|
325 | + require_once $dir.'/'.$file.'.php'; |
|
326 | 326 | |
327 | 327 | $module = new $file($db); |
328 | 328 | |
@@ -335,9 +335,9 @@ discard block |
||
335 | 335 | } |
336 | 336 | |
337 | 337 | if ($module->isEnabled()) { |
338 | - dol_include_once('/' . $moduledir . '/class/' . strtolower($myTmpObjectKey) . '.class.php'); |
|
338 | + dol_include_once('/'.$moduledir.'/class/'.strtolower($myTmpObjectKey).'.class.php'); |
|
339 | 339 | |
340 | - print '<tr class="oddeven"><td>' . $module->name . "</td><td>\n"; |
|
340 | + print '<tr class="oddeven"><td>'.$module->name."</td><td>\n"; |
|
341 | 341 | print $module->info(); |
342 | 342 | print '</td>'; |
343 | 343 | |
@@ -346,20 +346,20 @@ discard block |
||
346 | 346 | $tmp = $module->getExample(); |
347 | 347 | if (preg_match('/^Error/', $tmp)) { |
348 | 348 | $langs->load("errors"); |
349 | - print '<div class="error">' . $langs->trans($tmp) . '</div>'; |
|
349 | + print '<div class="error">'.$langs->trans($tmp).'</div>'; |
|
350 | 350 | } elseif ($tmp == 'NotConfigured') { |
351 | 351 | print $langs->trans($tmp); |
352 | 352 | } else { |
353 | 353 | print $tmp; |
354 | 354 | } |
355 | - print '</td>' . "\n"; |
|
355 | + print '</td>'."\n"; |
|
356 | 356 | |
357 | 357 | print '<td class="center">'; |
358 | - $constforvar = 'WEBPORTAL_' . strtoupper($myTmpObjectKey) . '_ADDON'; |
|
358 | + $constforvar = 'WEBPORTAL_'.strtoupper($myTmpObjectKey).'_ADDON'; |
|
359 | 359 | if (getDolGlobalString($constforvar) == $file) { |
360 | 360 | print img_picto($langs->trans("Activated"), 'switch_on'); |
361 | 361 | } else { |
362 | - print '<a href="' . $_SERVER["PHP_SELF"] . '?action=setmod&token=' . newToken() . '&object=' . strtolower($myTmpObjectKey) . '&value=' . urlencode($file) . '">'; |
|
362 | + print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&token='.newToken().'&object='.strtolower($myTmpObjectKey).'&value='.urlencode($file).'">'; |
|
363 | 363 | print img_picto($langs->trans("Disabled"), 'switch_off'); |
364 | 364 | print '</a>'; |
365 | 365 | } |
@@ -370,18 +370,18 @@ discard block |
||
370 | 370 | |
371 | 371 | // Info |
372 | 372 | $htmltooltip = ''; |
373 | - $htmltooltip .= '' . $langs->trans("Version") . ': <b>' . $module->getVersion() . '</b><br>'; |
|
373 | + $htmltooltip .= ''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>'; |
|
374 | 374 | |
375 | 375 | $nextval = $module->getNextValue($mytmpinstance); |
376 | 376 | if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval |
377 | - $htmltooltip .= '' . $langs->trans("NextValue") . ': '; |
|
377 | + $htmltooltip .= ''.$langs->trans("NextValue").': '; |
|
378 | 378 | if ($nextval) { |
379 | 379 | if (preg_match('/^Error/', $nextval) || $nextval == 'NotConfigured') { |
380 | 380 | $nextval = $langs->trans($nextval); |
381 | 381 | } |
382 | - $htmltooltip .= $nextval . '<br>'; |
|
382 | + $htmltooltip .= $nextval.'<br>'; |
|
383 | 383 | } else { |
384 | - $htmltooltip .= $langs->trans($module->error) . '<br>'; |
|
384 | + $htmltooltip .= $langs->trans($module->error).'<br>'; |
|
385 | 385 | } |
386 | 386 | } |
387 | 387 | |
@@ -412,9 +412,9 @@ discard block |
||
412 | 412 | // Load array def with activated templates |
413 | 413 | $def = array(); |
414 | 414 | $sql = "SELECT nom"; |
415 | - $sql .= " FROM " . $db->prefix() . "document_model"; |
|
416 | - $sql .= " WHERE type = '" . $db->escape($type) . "'"; |
|
417 | - $sql .= " AND entity = " . $conf->entity; |
|
415 | + $sql .= " FROM ".$db->prefix()."document_model"; |
|
416 | + $sql .= " WHERE type = '".$db->escape($type)."'"; |
|
417 | + $sql .= " AND entity = ".$conf->entity; |
|
418 | 418 | $resql = $db->query($sql); |
419 | 419 | if ($resql) { |
420 | 420 | $i = 0; |
@@ -430,19 +430,19 @@ discard block |
||
430 | 430 | |
431 | 431 | print "<table class=\"noborder\" width=\"100%\">\n"; |
432 | 432 | print "<tr class=\"liste_titre\">\n"; |
433 | - print '<td>' . $langs->trans("Name") . '</td>'; |
|
434 | - print '<td>' . $langs->trans("Description") . '</td>'; |
|
435 | - print '<td class="center" width="60">' . $langs->trans("Status") . "</td>\n"; |
|
436 | - print '<td class="center" width="60">' . $langs->trans("Default") . "</td>\n"; |
|
437 | - print '<td class="center" width="38">' . $langs->trans("ShortInfo") . '</td>'; |
|
438 | - print '<td class="center" width="38">' . $langs->trans("Preview") . '</td>'; |
|
433 | + print '<td>'.$langs->trans("Name").'</td>'; |
|
434 | + print '<td>'.$langs->trans("Description").'</td>'; |
|
435 | + print '<td class="center" width="60">'.$langs->trans("Status")."</td>\n"; |
|
436 | + print '<td class="center" width="60">'.$langs->trans("Default")."</td>\n"; |
|
437 | + print '<td class="center" width="38">'.$langs->trans("ShortInfo").'</td>'; |
|
438 | + print '<td class="center" width="38">'.$langs->trans("Preview").'</td>'; |
|
439 | 439 | print "</tr>\n"; |
440 | 440 | |
441 | 441 | clearstatcache(); |
442 | 442 | |
443 | 443 | foreach ($dirmodels as $reldir) { |
444 | 444 | foreach (array('', '/doc') as $valdir) { |
445 | - $realpath = $reldir . "core/modules/" . $moduledir . $valdir; |
|
445 | + $realpath = $reldir."core/modules/".$moduledir.$valdir; |
|
446 | 446 | $dir = dol_buildpath($realpath); |
447 | 447 | |
448 | 448 | if (is_dir($dir)) { |
@@ -456,11 +456,11 @@ discard block |
||
456 | 456 | |
457 | 457 | foreach ($filelist as $file) { |
458 | 458 | if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file)) { |
459 | - if (file_exists($dir . '/' . $file)) { |
|
459 | + if (file_exists($dir.'/'.$file)) { |
|
460 | 460 | $name = substr($file, 4, dol_strlen($file) - 16); |
461 | 461 | $classname = substr($file, 0, dol_strlen($file) - 12); |
462 | 462 | |
463 | - require_once $dir . '/' . $file; |
|
463 | + require_once $dir.'/'.$file; |
|
464 | 464 | $module = new $classname($db); |
465 | 465 | |
466 | 466 | $modulequalified = 1; |
@@ -484,40 +484,40 @@ discard block |
||
484 | 484 | |
485 | 485 | // Active |
486 | 486 | if (in_array($name, $def)) { |
487 | - print '<td class="center">' . "\n"; |
|
488 | - print '<a href="' . $_SERVER["PHP_SELF"] . '?action=del&token=' . newToken() . '&value=' . urlencode($name) . '">'; |
|
487 | + print '<td class="center">'."\n"; |
|
488 | + print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&token='.newToken().'&value='.urlencode($name).'">'; |
|
489 | 489 | print img_picto($langs->trans("Enabled"), 'switch_on'); |
490 | 490 | print '</a>'; |
491 | 491 | print '</td>'; |
492 | 492 | } else { |
493 | - print '<td class="center">' . "\n"; |
|
494 | - print '<a href="' . $_SERVER["PHP_SELF"] . '?action=set&token=' . newToken() . '&value=' . urlencode($name) . '&scan_dir=' . urlencode($module->scandir) . '&label=' . urlencode($module->name) . '">' . img_picto($langs->trans("Disabled"), 'switch_off') . '</a>'; |
|
493 | + print '<td class="center">'."\n"; |
|
494 | + print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&token='.newToken().'&value='.urlencode($name).'&scan_dir='.urlencode($module->scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>'; |
|
495 | 495 | print "</td>"; |
496 | 496 | } |
497 | 497 | |
498 | 498 | // Default |
499 | 499 | print '<td class="center">'; |
500 | - $constforvar = 'WEBPORTAL_' . strtoupper($myTmpObjectKey) . '_ADDON_PDF'; |
|
500 | + $constforvar = 'WEBPORTAL_'.strtoupper($myTmpObjectKey).'_ADDON_PDF'; |
|
501 | 501 | if (getDolGlobalString($constforvar) == $name) { |
502 | 502 | //print img_picto($langs->trans("Default"), 'on'); |
503 | 503 | // Even if choice is the default value, we allow to disable it. Replace this with previous line if you need to disable unset |
504 | - print '<a href="' . $_SERVER["PHP_SELF"] . '?action=unsetdoc&token=' . newToken() . '&object=' . urlencode(strtolower($myTmpObjectKey)) . '&value=' . urlencode($name) . '&scan_dir=' . urlencode($module->scandir) . '&label=' . urlencode($module->name) . '&type=' . urlencode($type) . '" alt="' . $langs->trans("Disable") . '">' . img_picto($langs->trans("Enabled"), 'on') . '</a>'; |
|
504 | + print '<a href="'.$_SERVER["PHP_SELF"].'?action=unsetdoc&token='.newToken().'&object='.urlencode(strtolower($myTmpObjectKey)).'&value='.urlencode($name).'&scan_dir='.urlencode($module->scandir).'&label='.urlencode($module->name).'&type='.urlencode($type).'" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"), 'on').'</a>'; |
|
505 | 505 | } else { |
506 | - print '<a href="' . $_SERVER["PHP_SELF"] . '?action=setdoc&token=' . newToken() . '&object=' . urlencode(strtolower($myTmpObjectKey)) . '&value=' . urlencode($name) . '&scan_dir=' . urlencode($module->scandir) . '&label=' . urlencode($module->name) . '" alt="' . $langs->trans("Default") . '">' . img_picto($langs->trans("Disabled"), 'off') . '</a>'; |
|
506 | + print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&token='.newToken().'&object='.urlencode(strtolower($myTmpObjectKey)).'&value='.urlencode($name).'&scan_dir='.urlencode($module->scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>'; |
|
507 | 507 | } |
508 | 508 | print '</td>'; |
509 | 509 | |
510 | 510 | // Info |
511 | - $htmltooltip = '' . $langs->trans("Name") . ': ' . $module->name; |
|
512 | - $htmltooltip .= '<br>' . $langs->trans("Type") . ': ' . ($module->type ? $module->type : $langs->trans("Unknown")); |
|
511 | + $htmltooltip = ''.$langs->trans("Name").': '.$module->name; |
|
512 | + $htmltooltip .= '<br>'.$langs->trans("Type").': '.($module->type ? $module->type : $langs->trans("Unknown")); |
|
513 | 513 | if ($module->type == 'pdf') { |
514 | - $htmltooltip .= '<br>' . $langs->trans("Width") . '/' . $langs->trans("Height") . ': ' . $module->page_largeur . '/' . $module->page_hauteur; |
|
514 | + $htmltooltip .= '<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur; |
|
515 | 515 | } |
516 | - $htmltooltip .= '<br>' . $langs->trans("Path") . ': ' . preg_replace('/^\//', '', $realpath) . '/' . $file; |
|
516 | + $htmltooltip .= '<br>'.$langs->trans("Path").': '.preg_replace('/^\//', '', $realpath).'/'.$file; |
|
517 | 517 | |
518 | - $htmltooltip .= '<br><br><u>' . $langs->trans("FeaturesSupported") . ':</u>'; |
|
519 | - $htmltooltip .= '<br>' . $langs->trans("Logo") . ': ' . yn($module->option_logo, 1, 1); |
|
520 | - $htmltooltip .= '<br>' . $langs->trans("MultiLanguage") . ': ' . yn($module->option_multilang, 1, 1); |
|
518 | + $htmltooltip .= '<br><br><u>'.$langs->trans("FeaturesSupported").':</u>'; |
|
519 | + $htmltooltip .= '<br>'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1); |
|
520 | + $htmltooltip .= '<br>'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1); |
|
521 | 521 | |
522 | 522 | print '<td class="center">'; |
523 | 523 | print $form->textwithpicto('', $htmltooltip, 1, 0); |
@@ -526,8 +526,8 @@ discard block |
||
526 | 526 | // Preview |
527 | 527 | print '<td class="center">'; |
528 | 528 | if ($module->type == 'pdf') { |
529 | - $newname = preg_replace('/_' . preg_quote(strtolower($myTmpObjectKey), '/') . '/', '', $name); |
|
530 | - print '<a href="' . $_SERVER["PHP_SELF"] . '?action=specimen&module=' . urlencode($newname) . '&object=' . urlencode($myTmpObjectKey) . '">' . img_object($langs->trans("Preview"), 'pdf') . '</a>'; |
|
529 | + $newname = preg_replace('/_'.preg_quote(strtolower($myTmpObjectKey), '/').'/', '', $name); |
|
530 | + print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.urlencode($newname).'&object='.urlencode($myTmpObjectKey).'">'.img_object($langs->trans("Preview"), 'pdf').'</a>'; |
|
531 | 531 | } else { |
532 | 532 | print img_object($langs->trans("PreviewNotAvailable"), 'generic'); |
533 | 533 | } |
@@ -25,8 +25,8 @@ discard block |
||
25 | 25 | |
26 | 26 | // Load Dolibarr environment |
27 | 27 | require_once "../../main.inc.php"; |
28 | -require_once DOL_DOCUMENT_ROOT . "/core/lib/admin.lib.php"; |
|
29 | -require_once DOL_DOCUMENT_ROOT . "/webportal/lib/webportal.lib.php"; |
|
28 | +require_once DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php"; |
|
29 | +require_once DOL_DOCUMENT_ROOT."/webportal/lib/webportal.lib.php"; |
|
30 | 30 | |
31 | 31 | // Translations |
32 | 32 | $langs->loadLangs(array("admin", "hrm", "other", "website")); |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | ); |
99 | 99 | |
100 | 100 | // Subheader |
101 | -$linkback = '<a href="' . ($backtopage ? $backtopage : DOL_URL_ROOT . '/admin/modules.php?restore_lastsearch_values=1') . '">' . $langs->trans("BackToModuleList") . '</a>'; |
|
101 | +$linkback = '<a href="'.($backtopage ? $backtopage : DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1').'">'.$langs->trans("BackToModuleList").'</a>'; |
|
102 | 102 | |
103 | 103 | print load_fiche_titre($langs->trans($title), $linkback, 'title_setup'); |
104 | 104 | |
@@ -107,14 +107,14 @@ discard block |
||
107 | 107 | print dol_get_fiche_head($head, 'css', $langs->trans($title), -1, "webportal"); |
108 | 108 | |
109 | 109 | // Setup page goes here |
110 | -echo '<span class="opacitymedium">' . $langs->trans("WebPortalCSS") . '</span><br><br>'; |
|
110 | +echo '<span class="opacitymedium">'.$langs->trans("WebPortalCSS").'</span><br><br>'; |
|
111 | 111 | |
112 | 112 | //WYSIWYG Editor |
113 | -require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php'; |
|
113 | +require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; |
|
114 | 114 | |
115 | -print '<form enctype="multipart/form-data" method="POST" action="' . $_SERVER["PHP_SELF"] . '">'; |
|
115 | +print '<form enctype="multipart/form-data" method="POST" action="'.$_SERVER["PHP_SELF"].'">'; |
|
116 | 116 | |
117 | -print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
117 | +print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
118 | 118 | print '<input type="hidden" name="action" value="updatecss">'; |
119 | 119 | |
120 | 120 | clearstatcache(); |
@@ -130,13 +130,13 @@ discard block |
||
130 | 130 | |
131 | 131 | $doleditor = new DolEditor('WEBPORTAL_CUSTOM_CSS', $customcssValue, '80%', 400, 'Basic', 'In', true, false, 'ace', 10, '90%'); |
132 | 132 | $doleditor->Create(0, '', true, 'css', 'css'); |
133 | -print '</td></tr>' . "\n"; |
|
133 | +print '</td></tr>'."\n"; |
|
134 | 134 | |
135 | -print '</table>' . "\n"; |
|
135 | +print '</table>'."\n"; |
|
136 | 136 | print '</div>'; |
137 | 137 | |
138 | 138 | print '<div class="center">'; |
139 | -print '<input class="button button-save reposition buttonforacesave" type="submit" name="submit" value="' . $langs->trans("Save") . '">'; |
|
139 | +print '<input class="button button-save reposition buttonforacesave" type="submit" name="submit" value="'.$langs->trans("Save").'">'; |
|
140 | 140 | //print '<input class="button button-cancel reposition" type="submit" name="cancel" value="' . $langs->trans("Cancel") . '">'; |
141 | 141 | print '</div>'; |
142 | 142 |
@@ -150,15 +150,15 @@ discard block |
||
150 | 150 | global $hookmanager, $langs; |
151 | 151 | |
152 | 152 | $elementEnUpper = strtoupper($elementEn); |
153 | - $objectclass = 'WebPortal' . ucfirst($elementEn); |
|
153 | + $objectclass = 'WebPortal'.ucfirst($elementEn); |
|
154 | 154 | |
155 | - $elementCardAccess = getDolGlobalString('WEBPORTAL_' . $elementEnUpper . '_CARD_ACCESS', 'hidden'); |
|
155 | + $elementCardAccess = getDolGlobalString('WEBPORTAL_'.$elementEnUpper.'_CARD_ACCESS', 'hidden'); |
|
156 | 156 | if ($elementCardAccess == 'hidden' || $id <= 0) { |
157 | 157 | accessforbidden(); |
158 | 158 | } |
159 | 159 | |
160 | 160 | // load module libraries |
161 | - dol_include_once('/webportal/class/webportal' . $elementEn . '.class.php'); |
|
161 | + dol_include_once('/webportal/class/webportal'.$elementEn.'.class.php'); |
|
162 | 162 | |
163 | 163 | // Load translation files required by the page |
164 | 164 | $langs->loadLangs(array('website', 'other')); |
@@ -169,15 +169,15 @@ discard block |
||
169 | 169 | $action = GETPOST('action', 'aZ09'); |
170 | 170 | $confirm = GETPOST('confirm', 'alpha'); |
171 | 171 | $cancel = GETPOST('cancel', 'aZ09'); |
172 | - $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'webportal' . $elementEn . 'card'; // To manage different context of search |
|
173 | - $backtopage = GETPOST('backtopage', 'alpha'); // if not set, a default page will be used |
|
174 | - $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); // if not set, $backtopage will be used |
|
172 | + $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'webportal'.$elementEn.'card'; // To manage different context of search |
|
173 | + $backtopage = GETPOST('backtopage', 'alpha'); // if not set, a default page will be used |
|
174 | + $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); // if not set, $backtopage will be used |
|
175 | 175 | $backtopagejsfields = GETPOST('backtopagejsfields', 'alpha'); |
176 | 176 | |
177 | 177 | // Initialize technical objects |
178 | 178 | $object = new $objectclass($this->db); |
179 | 179 | //$extrafields = new ExtraFields($db); |
180 | - $hookmanager->initHooks(array('webportal' . $elementEn . 'card', 'globalcard')); // Note that conf->hooks_modules contains array |
|
180 | + $hookmanager->initHooks(array('webportal'.$elementEn.'card', 'globalcard')); // Note that conf->hooks_modules contains array |
|
181 | 181 | |
182 | 182 | // Fetch optionals attributes and labels |
183 | 183 | //$extrafields->fetch_name_optionals_label($object->table_element); |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | } |
189 | 189 | |
190 | 190 | // Load object |
191 | - include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be include, not include_once. |
|
191 | + include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. |
|
192 | 192 | |
193 | 193 | // Security check (enable the most restrictive one) |
194 | 194 | if (!isModEnabled('webportal')) { |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | $this->permissiontodelete = $permissiontodelete; |
213 | 213 | $this->permissionnote = $permissionnote; |
214 | 214 | $this->permissiondellink = $permissiondellink; |
215 | - $this->titleKey = $objectclass . 'CardTitle'; |
|
215 | + $this->titleKey = $objectclass.'CardTitle'; |
|
216 | 216 | $this->ref = $ref; |
217 | 217 | } |
218 | 218 | |
@@ -245,17 +245,17 @@ discard block |
||
245 | 245 | |
246 | 246 | if (empty($backtopage) || ($cancel && empty($id))) { |
247 | 247 | if (empty($backtopage) || ($cancel && strpos($backtopage, '__ID__'))) { |
248 | - $backtopage = $context->getControllerUrl($elementEn . 'card'); |
|
248 | + $backtopage = $context->getControllerUrl($elementEn.'card'); |
|
249 | 249 | } |
250 | 250 | } |
251 | 251 | |
252 | 252 | // Action to cancel record |
253 | 253 | if ($cancel) { |
254 | 254 | if (!empty($backtopageforcancel)) { |
255 | - header("Location: " . $backtopageforcancel); |
|
255 | + header("Location: ".$backtopageforcancel); |
|
256 | 256 | exit; |
257 | 257 | } elseif (!empty($backtopage)) { |
258 | - header("Location: " . $backtopage); |
|
258 | + header("Location: ".$backtopage); |
|
259 | 259 | exit; |
260 | 260 | } |
261 | 261 | $action = ''; |
@@ -266,7 +266,7 @@ discard block |
||
266 | 266 | foreach ($object->fields as $key => $val) { |
267 | 267 | // Check if field was submitted to be edited |
268 | 268 | if ($object->fields[$key]['type'] == 'duration') { |
269 | - if (!GETPOSTISSET($key . 'hour') || !GETPOSTISSET($key . 'min')) { |
|
269 | + if (!GETPOSTISSET($key.'hour') || !GETPOSTISSET($key.'min')) { |
|
270 | 270 | continue; // The field was not submitted to be saved |
271 | 271 | } |
272 | 272 | } elseif ($object->fields[$key]['type'] == 'boolean') { |
@@ -317,7 +317,7 @@ discard block |
||
317 | 317 | $dateDay = (int) $dateArr[2]; |
318 | 318 | } |
319 | 319 | // extract time HH:ii:ss for hours, minutes and seconds |
320 | - $postTime = GETPOST($key . '_time', 'alphanohtml'); |
|
320 | + $postTime = GETPOST($key.'_time', 'alphanohtml'); |
|
321 | 321 | $timeArr = explode(':', $postTime); |
322 | 322 | $timeHours = 12; |
323 | 323 | $timeMinutes = 0; |
@@ -335,8 +335,8 @@ discard block |
||
335 | 335 | } |
336 | 336 | $value = dol_mktime($timeHours, $timeMinutes, $timeSeconds, $dateMonth, $dateDay, $dateYear); |
337 | 337 | } elseif ($object->fields[$key]['type'] == 'duration') { |
338 | - if (GETPOST($key . 'hour', 'int') != '' || GETPOST($key . 'min', 'int') != '') { |
|
339 | - $value = 60 * 60 * GETPOST($key . 'hour', 'int') + 60 * GETPOST($key . 'min', 'int'); |
|
338 | + if (GETPOST($key.'hour', 'int') != '' || GETPOST($key.'min', 'int') != '') { |
|
339 | + $value = 60 * 60 * GETPOST($key.'hour', 'int') + 60 * GETPOST($key.'min', 'int'); |
|
340 | 340 | } else { |
341 | 341 | $value = ''; |
342 | 342 | } |
@@ -405,7 +405,7 @@ discard block |
||
405 | 405 | $urltogo = $backtopage ? str_replace('__ID__', $result, $backtopage) : $backurlforlist; |
406 | 406 | $urltogo = preg_replace('/--IDFORBACKTOPAGE--/', $object->id, $urltogo); // New method to autoselect project after a New on another form object creation |
407 | 407 | if ($urltogo && empty($noback)) { |
408 | - header("Location: " . $urltogo); |
|
408 | + header("Location: ".$urltogo); |
|
409 | 409 | exit; |
410 | 410 | } |
411 | 411 | } else { |
@@ -464,7 +464,7 @@ discard block |
||
464 | 464 | // main information - begin |
465 | 465 | $html .= '<div class="header-card-main-information">'; |
466 | 466 | // ref |
467 | - $html .= '<div><strong>' . $object->ref . '</strong></div>'; |
|
467 | + $html .= '<div><strong>'.$object->ref.'</strong></div>'; |
|
468 | 468 | // full name |
469 | 469 | $fullname = ''; |
470 | 470 | if (method_exists($object, 'getFullName')) { |
@@ -474,11 +474,11 @@ discard block |
||
474 | 474 | if ($object->element == 'member') { |
475 | 475 | if ($object->morphy == 'mor' && !empty($object->societe)) { |
476 | 476 | $html .= dol_htmlentities($object->societe); |
477 | - $html .= (!empty($fullname) && $object->societe != $fullname) ? ' (' . dol_htmlentities($fullname) . $addgendertxt . ')' : ''; |
|
477 | + $html .= (!empty($fullname) && $object->societe != $fullname) ? ' ('.dol_htmlentities($fullname).$addgendertxt.')' : ''; |
|
478 | 478 | } else { |
479 | - $html .= dol_htmlentities($fullname) . $addgendertxt; |
|
479 | + $html .= dol_htmlentities($fullname).$addgendertxt; |
|
480 | 480 | if (empty($object->fk_soc)) { |
481 | - $html .= (!empty($object->societe) && $object->societe != $fullname) ? ' (' . dol_htmlentities($object->societe) . ')' : ''; |
|
481 | + $html .= (!empty($object->societe) && $object->societe != $fullname) ? ' ('.dol_htmlentities($object->societe).')' : ''; |
|
482 | 482 | } |
483 | 483 | } |
484 | 484 | } else { |
@@ -568,23 +568,23 @@ discard block |
||
568 | 568 | |
569 | 569 | $value = $object->$key; |
570 | 570 | |
571 | - $html .= '<div class="grid field_' . $key . '">'; |
|
571 | + $html .= '<div class="grid field_'.$key.'">'; |
|
572 | 572 | |
573 | - $html .= '<div class="' . (empty($val['tdcss']) ? '' : $val['tdcss']) . ' fieldname_' . $key; |
|
573 | + $html .= '<div class="'.(empty($val['tdcss']) ? '' : $val['tdcss']).' fieldname_'.$key; |
|
574 | 574 | $html .= '">'; |
575 | 575 | $labeltoshow = ''; |
576 | - $labeltoshow .= '<strong>' . $langs->trans($val['label']) . '</strong>'; |
|
576 | + $labeltoshow .= '<strong>'.$langs->trans($val['label']).'</strong>'; |
|
577 | 577 | $html .= $labeltoshow; |
578 | 578 | $html .= '</div>'; |
579 | 579 | |
580 | - $html .= '<div class="valuefield fieldname_' . $key; |
|
580 | + $html .= '<div class="valuefield fieldname_'.$key; |
|
581 | 581 | if (!empty($val['cssview'])) { |
582 | - $html .= ' ' . $val['cssview']; |
|
582 | + $html .= ' '.$val['cssview']; |
|
583 | 583 | } |
584 | 584 | $html .= '">'; |
585 | 585 | if ($key == 'lang') { |
586 | 586 | $langs->load('languages'); |
587 | - $labellang = ($value ? $langs->trans('Language_' . $value) : ''); |
|
587 | + $labellang = ($value ? $langs->trans('Language_'.$value) : ''); |
|
588 | 588 | //$html .= picto_from_langcode($value, 'class="paddingrightonly saturatemedium opacitylow"'); |
589 | 589 | $html .= $labellang; |
590 | 590 | } else { |
@@ -644,7 +644,7 @@ discard block |
||
644 | 644 | continue; // We don't want this field |
645 | 645 | } |
646 | 646 | |
647 | - $html .= '<div class="grid field_' . $key . '">'; |
|
647 | + $html .= '<div class="grid field_'.$key.'">'; |
|
648 | 648 | $html .= '<div class="titlefieldcreate'; |
649 | 649 | if (isset($val['notnull']) && $val['notnull'] > 0) { |
650 | 650 | $html .= ' required'; |
@@ -676,15 +676,15 @@ discard block |
||
676 | 676 | $value = GETPOSTISSET($key) ? GETPOST($key, $check) : $object->$key; |
677 | 677 | } elseif (in_array($val['type'], array('date', 'datetime'))) { |
678 | 678 | $isPostDate = GETPOSTISSET($key); |
679 | - $isPostTime = GETPOSTISSET($key . '_time'); |
|
679 | + $isPostTime = GETPOSTISSET($key.'_time'); |
|
680 | 680 | if ($isPostDate) { |
681 | 681 | $postDate = GETPOST($key, 'alphanohtml'); |
682 | 682 | if ($isPostTime) { |
683 | - $postTime = GETPOST($key . '_time', 'alphanohtml') . ':00'; |
|
683 | + $postTime = GETPOST($key.'_time', 'alphanohtml').':00'; |
|
684 | 684 | } else { |
685 | 685 | $postTime = '00:00:00'; |
686 | 686 | } |
687 | - $valueDateTimeStr = $postDate . ' ' . $postTime; |
|
687 | + $valueDateTimeStr = $postDate.' '.$postTime; |
|
688 | 688 | } else { |
689 | 689 | // format date timestamp to YYYY-MM-DD HH:ii:ss |
690 | 690 | $valueDateTimeStr = dol_print_date($object->$key, '%Y-%m-%d %H:%M:%S'); |
@@ -756,19 +756,19 @@ discard block |
||
756 | 756 | $html .= '<article>'; |
757 | 757 | //$html .= load_fiche_titre($title, '', 'object_'.$object->picto); |
758 | 758 | $html .= '<header>'; |
759 | - $html .= '<h2>' . $title . '</h2>'; |
|
759 | + $html .= '<h2>'.$title.'</h2>'; |
|
760 | 760 | $html .= '</header>'; |
761 | 761 | |
762 | 762 | $url_file = $context->getControllerUrl($context->controller, '', false); |
763 | - $html .= '<form method="POST" action="' . $url_file . '">'; |
|
763 | + $html .= '<form method="POST" action="'.$url_file.'">'; |
|
764 | 764 | $html .= $context->getFormToken(); |
765 | 765 | $html .= '<input type="hidden" name="action" value="update">'; |
766 | - $html .= '<input type="hidden" name="id" value="' . $object->id . '">'; |
|
766 | + $html .= '<input type="hidden" name="id" value="'.$object->id.'">'; |
|
767 | 767 | if ($backtopage) { |
768 | - $html .= '<input type="hidden" name="backtopage" value="' . $backtopage . '">'; |
|
768 | + $html .= '<input type="hidden" name="backtopage" value="'.$backtopage.'">'; |
|
769 | 769 | } |
770 | 770 | if ($backtopageforcancel) { |
771 | - $html .= '<input type="hidden" name="backtopageforcancel" value="' . $backtopageforcancel . '">'; |
|
771 | + $html .= '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">'; |
|
772 | 772 | } |
773 | 773 | |
774 | 774 | //$html .= '<table>'."\n"; |
@@ -782,8 +782,8 @@ discard block |
||
782 | 782 | |
783 | 783 | // Save and Cancel buttons |
784 | 784 | $html .= '<div class="grid">'; |
785 | - $html .= '<div><input type="submit" name="save" role="button" value="' . dol_escape_htmltag($langs->trans('Save')) . '" /></div>'; |
|
786 | - $html .= '<div><input type="submit" name="cancel" role="button" value="' . dol_escape_htmltag($langs->trans('Cancel')) . '" /></div>'; |
|
785 | + $html .= '<div><input type="submit" name="save" role="button" value="'.dol_escape_htmltag($langs->trans('Save')).'" /></div>'; |
|
786 | + $html .= '<div><input type="submit" name="cancel" role="button" value="'.dol_escape_htmltag($langs->trans('Cancel')).'" /></div>'; |
|
787 | 787 | $html .= '</div>'; |
788 | 788 | |
789 | 789 | $html .= '</form>'; |
@@ -824,7 +824,7 @@ discard block |
||
824 | 824 | |
825 | 825 | // Buttons for actions |
826 | 826 | if ($action != 'presend' && $action != 'editline') { |
827 | - $html .= '<div>' . "\n"; |
|
827 | + $html .= '<div>'."\n"; |
|
828 | 828 | $parameters = array(); |
829 | 829 | $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook |
830 | 830 | if ($reshook < 0) { |
@@ -834,10 +834,10 @@ discard block |
||
834 | 834 | if (empty($reshook)) { |
835 | 835 | if ($permissiontoadd) { |
836 | 836 | $url_file = $context->getControllerUrl($context->controller, '', false); |
837 | - $html .= '<a href="' . $url_file . '&id=' . $object->id . '&action=edit" role="button">' . $langs->trans('Modify') . '</a>'; |
|
837 | + $html .= '<a href="'.$url_file.'&id='.$object->id.'&action=edit" role="button">'.$langs->trans('Modify').'</a>'; |
|
838 | 838 | } |
839 | 839 | } |
840 | - $html .= '</div>' . "\n"; |
|
840 | + $html .= '</div>'."\n"; |
|
841 | 841 | } |
842 | 842 | } |
843 | 843 |
@@ -32,17 +32,17 @@ discard block |
||
32 | 32 | |
33 | 33 | // Load Dolibarr environment |
34 | 34 | require '../../main.inc.php'; |
35 | -require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.facture-rec.class.php'; |
|
36 | -require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.product.class.php'; |
|
37 | -require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; |
|
38 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php'; |
|
35 | +require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture-rec.class.php'; |
|
36 | +require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php'; |
|
37 | +require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; |
|
38 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; |
|
39 | 39 | if (isModEnabled('project')) { |
40 | - include_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
40 | + include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
41 | 41 | } |
42 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php'; |
|
43 | -require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php'; |
|
44 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/invoice.lib.php'; |
|
45 | -require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php'; |
|
42 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; |
|
43 | +require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; |
|
44 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php'; |
|
45 | +require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; |
|
46 | 46 | |
47 | 47 | // Load translation files required by the page |
48 | 48 | $langs->loadLangs(array('bills', 'companies', 'compta', 'admin', 'other', 'products', 'banks', 'suppliers')); |
@@ -83,10 +83,10 @@ discard block |
||
83 | 83 | $page = 0; |
84 | 84 | } // If $page is not defined, or '' or -1 |
85 | 85 | $offset = $limit * $page; |
86 | -if (! $sortorder) { |
|
86 | +if (!$sortorder) { |
|
87 | 87 | $sortorder = 'DESC'; |
88 | 88 | } |
89 | -if (! $sortfield) { |
|
89 | +if (!$sortfield) { |
|
90 | 90 | $sortfield = 'f.titre'; |
91 | 91 | } |
92 | 92 | $pageprev = $page - 1; |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | $object = new FactureFournisseurRec($db); |
96 | 96 | if (($id > 0 || $title) && $action != 'create' && $action != 'add') { |
97 | 97 | $ret = $object->fetch($id, $title); |
98 | - if (! $ret) { |
|
98 | + if (!$ret) { |
|
99 | 99 | setEventMessages($langs->trans("ErrorRecordNotFound"), null, 'errors'); |
100 | 100 | } |
101 | 101 | } |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | $action = 'list'; |
140 | 140 | $massaction = ''; |
141 | 141 | } |
142 | -if (! GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { |
|
142 | +if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { |
|
143 | 143 | $massaction = ''; |
144 | 144 | } |
145 | 145 | |
@@ -155,18 +155,18 @@ discard block |
||
155 | 155 | } |
156 | 156 | |
157 | 157 | // Selection of new fields |
158 | - include DOL_DOCUMENT_ROOT . '/core/actions_changeselectedfields.inc.php'; |
|
158 | + include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; |
|
159 | 159 | |
160 | 160 | // Set note |
161 | - include DOL_DOCUMENT_ROOT . '/core/actions_setnotes.inc.php'; // Must be include, not include_once |
|
161 | + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once |
|
162 | 162 | |
163 | - include DOL_DOCUMENT_ROOT . '/core/actions_dellink.inc.php'; // Must be include, not include_once |
|
163 | + include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be include, not include_once |
|
164 | 164 | |
165 | - include DOL_DOCUMENT_ROOT . '/core/actions_lineupdown.inc.php'; // Must be include, not include_once |
|
165 | + include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be include, not include_once |
|
166 | 166 | |
167 | 167 | // Create predefined invoice |
168 | 168 | if ($action == 'add') { |
169 | - if (! GETPOST('title', 'alphanohtml')) { |
|
169 | + if (!GETPOST('title', 'alphanohtml')) { |
|
170 | 170 | setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->trans("Title")), null, 'errors'); |
171 | 171 | $action = "create"; |
172 | 172 | $error++; |
@@ -189,10 +189,10 @@ discard block |
||
189 | 189 | } |
190 | 190 | } |
191 | 191 | |
192 | - if (! $error) { |
|
192 | + if (!$error) { |
|
193 | 193 | $object->titre = GETPOST('title', 'alphanohtml'); // deprecated |
194 | 194 | $object->title = GETPOST('title', 'alphanohtml'); |
195 | - $object->libelle = GETPOST('libelle', 'alpha'); // deprecated |
|
195 | + $object->libelle = GETPOST('libelle', 'alpha'); // deprecated |
|
196 | 196 | $object->label = GETPOST('libelle', 'alpha'); |
197 | 197 | $object->fk_project = GETPOSTINT('projectid'); |
198 | 198 | $object->ref_supplier = GETPOST('ref_supplier', 'alphanohtml'); |
@@ -238,10 +238,10 @@ discard block |
||
238 | 238 | $action = "create"; |
239 | 239 | } |
240 | 240 | |
241 | - if (! $error) { |
|
241 | + if (!$error) { |
|
242 | 242 | $db->commit(); |
243 | 243 | |
244 | - header("Location: " . $_SERVER['PHP_SELF'] . '?facid=' . $object->id); |
|
244 | + header("Location: ".$_SERVER['PHP_SELF'].'?facid='.$object->id); |
|
245 | 245 | exit; |
246 | 246 | } else { |
247 | 247 | $db->rollback(); |
@@ -258,7 +258,7 @@ discard block |
||
258 | 258 | if ($action == 'confirm_deleteinvoice' && $confirm == 'yes' && ($user->hasRight("fournisseur", "facture", "supprimer") || $user->hasRight("supplier_invoice", "supprimer"))) { |
259 | 259 | $object->delete($user); |
260 | 260 | |
261 | - header('Location: ' . DOL_URL_ROOT . '/fourn/facture/list-rec.php'); |
|
261 | + header('Location: '.DOL_URL_ROOT.'/fourn/facture/list-rec.php'); |
|
262 | 262 | exit; |
263 | 263 | } |
264 | 264 | |
@@ -288,7 +288,7 @@ discard block |
||
288 | 288 | $result = $object->setValueFrom('titre', $title, '', null, 'text', '', $user); |
289 | 289 | |
290 | 290 | if ($result > 0) { |
291 | - $object->titre = $title; // deprecated |
|
291 | + $object->titre = $title; // deprecated |
|
292 | 292 | $object->title = $title; |
293 | 293 | $object->ref = $object->title; |
294 | 294 | } else { |
@@ -335,7 +335,7 @@ discard block |
||
335 | 335 | $error++; |
336 | 336 | } |
337 | 337 | |
338 | - if (! $error) { |
|
338 | + if (!$error) { |
|
339 | 339 | $db->commit(); |
340 | 340 | } else { |
341 | 341 | $db->rollback(); |
@@ -352,7 +352,7 @@ discard block |
||
352 | 352 | $error++; |
353 | 353 | } |
354 | 354 | |
355 | - if (! $error) { |
|
355 | + if (!$error) { |
|
356 | 356 | $db->commit(); |
357 | 357 | } else { |
358 | 358 | $db->rollback(); |
@@ -411,7 +411,7 @@ discard block |
||
411 | 411 | $error++; |
412 | 412 | } |
413 | 413 | |
414 | - if (! $error) { |
|
414 | + if (!$error) { |
|
415 | 415 | $result = $object->insertExtraFields('BILLREC_MODIFY'); |
416 | 416 | if ($result < 0) { |
417 | 417 | setEventMessages($object->error, $object->errors, 'errors'); |
@@ -440,8 +440,8 @@ discard block |
||
440 | 440 | $tva_tx = ''; |
441 | 441 | } |
442 | 442 | |
443 | - $qty = price2num(GETPOST('qty' . $predef, 'alpha'), 'MS', 2); |
|
444 | - $remise_percent = price2num(GETPOST('remise_percent' . $predef), '', 2); |
|
443 | + $qty = price2num(GETPOST('qty'.$predef, 'alpha'), 'MS', 2); |
|
444 | + $remise_percent = price2num(GETPOST('remise_percent'.$predef), '', 2); |
|
445 | 445 | |
446 | 446 | // Extrafields |
447 | 447 | $extralabelsline = $extrafields->fetch_name_optionals_label($object->table_element_line); |
@@ -450,7 +450,7 @@ discard block |
||
450 | 450 | if (is_array($extralabelsline)) { |
451 | 451 | // Get extra fields |
452 | 452 | foreach ($extralabelsline as $key => $value) { |
453 | - unset($_POST["options_" . $key . $predef]); |
|
453 | + unset($_POST["options_".$key.$predef]); |
|
454 | 454 | } |
455 | 455 | } |
456 | 456 | |
@@ -462,7 +462,7 @@ discard block |
||
462 | 462 | setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Type')), null, 'errors'); |
463 | 463 | $error++; |
464 | 464 | } |
465 | - if ($prod_entry_mode == 'free' && (empty($idprod) || $idprod < 0) && (! ($price_ht >= 0) || $price_ht == '')) { // Unit price can be 0 but not '' |
|
465 | + if ($prod_entry_mode == 'free' && (empty($idprod) || $idprod < 0) && (!($price_ht >= 0) || $price_ht == '')) { // Unit price can be 0 but not '' |
|
466 | 466 | setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("UnitPriceHT")), null, 'errors'); |
467 | 467 | $error++; |
468 | 468 | } |
@@ -511,7 +511,7 @@ discard block |
||
511 | 511 | } |
512 | 512 | } |
513 | 513 | |
514 | - if (! $error && ($qty >= 0) && (!empty($product_desc) || (!empty($idprod) && $idprod > 0))) { |
|
514 | + if (!$error && ($qty >= 0) && (!empty($product_desc) || (!empty($idprod) && $idprod > 0))) { |
|
515 | 515 | $ret = $object->fetch($id); |
516 | 516 | if ($ret < 0) { |
517 | 517 | dol_print_error($db, $object->error); |
@@ -520,8 +520,8 @@ discard block |
||
520 | 520 | $ret = $object->fetch_thirdparty(); |
521 | 521 | |
522 | 522 | // Clean parameters |
523 | - $date_start = dol_mktime(GETPOST('date_start' . $predef . 'hour'), GETPOST('date_start' . $predef . 'min'), GETPOST('date_start' . $predef . 'sec'), GETPOST('date_start' . $predef . 'month'), GETPOST('date_start' . $predef . 'day'), GETPOST('date_start' . $predef . 'year')); |
|
524 | - $date_end = dol_mktime(GETPOST('date_end' . $predef . 'hour'), GETPOST('date_end' . $predef . 'min'), GETPOST('date_end' . $predef . 'sec'), GETPOST('date_end' . $predef . 'month'), GETPOST('date_end' . $predef . 'day'), GETPOST('date_end' . $predef . 'year')); |
|
523 | + $date_start = dol_mktime(GETPOST('date_start'.$predef.'hour'), GETPOST('date_start'.$predef.'min'), GETPOST('date_start'.$predef.'sec'), GETPOST('date_start'.$predef.'month'), GETPOST('date_start'.$predef.'day'), GETPOST('date_start'.$predef.'year')); |
|
524 | + $date_end = dol_mktime(GETPOST('date_end'.$predef.'hour'), GETPOST('date_end'.$predef.'min'), GETPOST('date_end'.$predef.'sec'), GETPOST('date_end'.$predef.'month'), GETPOST('date_end'.$predef.'day'), GETPOST('date_end'.$predef.'year')); |
|
525 | 525 | $price_base_type = (GETPOST('price_base_type', 'alpha') ? GETPOST('price_base_type', 'alpha') : 'HT'); |
526 | 526 | |
527 | 527 | // Define special_code for special lines |
@@ -618,23 +618,23 @@ discard block |
||
618 | 618 | $outputlangs->load('products'); |
619 | 619 | } |
620 | 620 | if (!empty($prod->customcode)) { |
621 | - $tmptxt .= $outputlangs->transnoentitiesnoconv("CustomCode") . ': ' . $prod->customcode; |
|
621 | + $tmptxt .= $outputlangs->transnoentitiesnoconv("CustomCode").': '.$prod->customcode; |
|
622 | 622 | } |
623 | 623 | if (!empty($prod->customcode) && !empty($prod->country_code)) { |
624 | 624 | $tmptxt .= ' - '; |
625 | 625 | } |
626 | 626 | if (!empty($prod->country_code)) { |
627 | - $tmptxt .= $outputlangs->transnoentitiesnoconv("CountryOrigin") . ': ' . getCountry($prod->country_code, 0, $db, $outputlangs, 0); |
|
627 | + $tmptxt .= $outputlangs->transnoentitiesnoconv("CountryOrigin").': '.getCountry($prod->country_code, 0, $db, $outputlangs, 0); |
|
628 | 628 | } |
629 | 629 | } else { |
630 | 630 | if (!empty($prod->customcode)) { |
631 | - $tmptxt .= $langs->transnoentitiesnoconv("CustomCode") . ': ' . $prod->customcode; |
|
631 | + $tmptxt .= $langs->transnoentitiesnoconv("CustomCode").': '.$prod->customcode; |
|
632 | 632 | } |
633 | 633 | if (!empty($prod->customcode) && !empty($prod->country_code)) { |
634 | 634 | $tmptxt .= ' - '; |
635 | 635 | } |
636 | 636 | if (!empty($prod->country_code)) { |
637 | - $tmptxt .= $langs->transnoentitiesnoconv("CountryOrigin") . ': ' . getCountry($prod->country_code, 0, $db, $langs, 0); |
|
637 | + $tmptxt .= $langs->transnoentitiesnoconv("CountryOrigin").': '.getCountry($prod->country_code, 0, $db, $langs, 0); |
|
638 | 638 | } |
639 | 639 | } |
640 | 640 | $tmptxt .= ')'; |
@@ -660,8 +660,8 @@ discard block |
||
660 | 660 | $date_end_fill = !empty(GETPOST('date_end_fill', 'int')) ? GETPOST('date_end_fill', 'int') : null; |
661 | 661 | |
662 | 662 | // Margin |
663 | - $fournprice = price2num(GETPOST('fournprice' . $predef) ? GETPOST('fournprice' . $predef) : ''); |
|
664 | - $buyingprice = price2num(GETPOST('buying_price' . $predef) != '' ? GETPOST('buying_price' . $predef) : ''); // If buying_price is '0', we must keep this value |
|
663 | + $fournprice = price2num(GETPOST('fournprice'.$predef) ? GETPOST('fournprice'.$predef) : ''); |
|
664 | + $buyingprice = price2num(GETPOST('buying_price'.$predef) != '' ? GETPOST('buying_price'.$predef) : ''); // If buying_price is '0', we must keep this value |
|
665 | 665 | |
666 | 666 | // Local Taxes |
667 | 667 | $localtax1_tx = get_localtax($tva_tx, 1, $object->thirdparty, $mysoc, $tva_npr); |
@@ -727,8 +727,8 @@ discard block |
||
727 | 727 | $action = ''; |
728 | 728 | } |
729 | 729 | } |
730 | - } elseif ($action == 'updateline' && $usercancreate && ! GETPOST('cancel', 'alpha')) { |
|
731 | - if (! $object->fetch($id) > 0) { |
|
730 | + } elseif ($action == 'updateline' && $usercancreate && !GETPOST('cancel', 'alpha')) { |
|
731 | + if (!$object->fetch($id) > 0) { |
|
732 | 732 | dol_print_error($db); |
733 | 733 | } |
734 | 734 | $object->fetch_thirdparty(); |
@@ -763,7 +763,7 @@ discard block |
||
763 | 763 | $objectline->array_options = $array_options; |
764 | 764 | $result = $objectline->insertExtraFields(); |
765 | 765 | if ($result < 0) { |
766 | - setEventMessages($langs->trans('Error') . $result, null, 'errors'); |
|
766 | + setEventMessages($langs->trans('Error').$result, null, 'errors'); |
|
767 | 767 | } |
768 | 768 | } |
769 | 769 | |
@@ -773,13 +773,13 @@ discard block |
||
773 | 773 | if (is_array($extralabelsline)) { |
774 | 774 | // Get extra fields |
775 | 775 | foreach ($extralabelsline as $key => $value) { |
776 | - unset($_POST["options_" . $key]); |
|
776 | + unset($_POST["options_".$key]); |
|
777 | 777 | } |
778 | 778 | } |
779 | 779 | |
780 | 780 | // Define special_code for special lines |
781 | 781 | $special_code = GETPOST('special_code', 'int'); |
782 | - if (! GETPOST('qty', 'alpha')) { |
|
782 | + if (!GETPOST('qty', 'alpha')) { |
|
783 | 783 | $special_code = 3; |
784 | 784 | } |
785 | 785 | |
@@ -825,7 +825,7 @@ discard block |
||
825 | 825 | $date_end_fill = !empty(GETPOST('date_end_fill', 'int')) ? GETPOST('date_end_fill', 'int') : 'NULL'; |
826 | 826 | |
827 | 827 | // Update line |
828 | - if (! $error) { |
|
828 | + if (!$error) { |
|
829 | 829 | $result = $object->updateline(GETPOST('lineid', 'int'), GETPOST('productid', 'int'), $ref_fourn, $label, $description, $pu_ht, $qty, $remise_percent, $vat_rate, $localtax1_rate, $localtax1_rate, 'HT', $type, $date_start_fill, $date_end_fill, $info_bits, $special_code, -1); |
830 | 830 | if ($result >= 0) { |
831 | 831 | $object->fetch($object->id); // Reload lines |
@@ -899,10 +899,10 @@ discard block |
||
899 | 899 | if ($object->fetch($id) > 0) { |
900 | 900 | $result = $object->fetch_lines(); |
901 | 901 | |
902 | - print '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST">'; |
|
903 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
902 | + print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">'; |
|
903 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
904 | 904 | print '<input type="hidden" name="action" value="add">'; |
905 | - print '<input type="hidden" name="facid" value="' . $object->id . '">'; |
|
905 | + print '<input type="hidden" name="facid" value="'.$object->id.'">'; |
|
906 | 906 | |
907 | 907 | print dol_get_fiche_head(null, '', '', 0); |
908 | 908 | |
@@ -919,17 +919,17 @@ discard block |
||
919 | 919 | $object->fetch_thirdparty(); |
920 | 920 | |
921 | 921 | // Title |
922 | - print '<tr><td class="titlefieldcreate fieldrequired">' . $langs->trans("Title") . '</td><td>'; |
|
923 | - print '<input class="flat quatrevingtpercent" type="text" name="title" value="' . dol_escape_htmltag(GETPOST("title", 'alphanohtml')) . '" autofocus>'; |
|
922 | + print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans("Title").'</td><td>'; |
|
923 | + print '<input class="flat quatrevingtpercent" type="text" name="title" value="'.dol_escape_htmltag(GETPOST("title", 'alphanohtml')).'" autofocus>'; |
|
924 | 924 | print '</td></tr>'; |
925 | 925 | |
926 | 926 | // Ref supplier |
927 | - print '<tr><td class="titlefieldcreate fieldrequired">' . $langs->trans("RefSupplier") . '</td><td>'; |
|
928 | - print '<input class="flat maxwidth500" type="text" name="ref_supplier" value="' . $object->ref_supplier . '">'; |
|
927 | + print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans("RefSupplier").'</td><td>'; |
|
928 | + print '<input class="flat maxwidth500" type="text" name="ref_supplier" value="'.$object->ref_supplier.'">'; |
|
929 | 929 | print '</td></tr>'; |
930 | 930 | |
931 | 931 | // Third party |
932 | - print '<tr><td class="titlefieldcreate">' . $langs->trans("Customer") . '</td><td>' . $object->thirdparty->getNomUrl(1, 'customer') . '</td>'; |
|
932 | + print '<tr><td class="titlefieldcreate">'.$langs->trans("Customer").'</td><td>'.$object->thirdparty->getNomUrl(1, 'customer').'</td>'; |
|
933 | 933 | print '</tr>'; |
934 | 934 | |
935 | 935 | $note_public = GETPOSTISSET('note_public') ? GETPOST('note_public', 'restricthtml') : $object->note_public; |
@@ -938,30 +938,30 @@ discard block |
||
938 | 938 | // Help of substitution key |
939 | 939 | $substitutionarray = getCommonSubstitutionArray($langs, 2, null, $object); |
940 | 940 | |
941 | - $substitutionarray['__INVOICE_PREVIOUS_MONTH__'] = $langs->trans("PreviousMonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($object->date, -1, 'm'), '%m') . ')'; |
|
942 | - $substitutionarray['__INVOICE_MONTH__'] = $langs->trans("MonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date($object->date, '%m') . ')'; |
|
943 | - $substitutionarray['__INVOICE_NEXT_MONTH__'] = $langs->trans("NextMonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($object->date, 1, 'm'), '%m') . ')'; |
|
944 | - $substitutionarray['__INVOICE_PREVIOUS_MONTH_TEXT__'] = $langs->trans("TextPreviousMonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($object->date, -1, 'm'), '%B') . ')'; |
|
945 | - $substitutionarray['__INVOICE_MONTH_TEXT__'] = $langs->trans("TextMonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date($object->date, '%B') . ')'; |
|
946 | - $substitutionarray['__INVOICE_NEXT_MONTH_TEXT__'] = $langs->trans("TextNextMonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($object->date, 1, 'm'), '%B') . ')'; |
|
947 | - $substitutionarray['__INVOICE_PREVIOUS_YEAR__'] = $langs->trans("PreviousYearOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($object->date, -1, 'y'), '%Y') . ')'; |
|
948 | - $substitutionarray['__INVOICE_YEAR__'] = $langs->trans("YearOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date($object->date, '%Y') . ')'; |
|
949 | - $substitutionarray['__INVOICE_NEXT_YEAR__'] = $langs->trans("NextYearOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($object->date, 1, 'y'), '%Y') . ')'; |
|
941 | + $substitutionarray['__INVOICE_PREVIOUS_MONTH__'] = $langs->trans("PreviousMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date, -1, 'm'), '%m').')'; |
|
942 | + $substitutionarray['__INVOICE_MONTH__'] = $langs->trans("MonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date($object->date, '%m').')'; |
|
943 | + $substitutionarray['__INVOICE_NEXT_MONTH__'] = $langs->trans("NextMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date, 1, 'm'), '%m').')'; |
|
944 | + $substitutionarray['__INVOICE_PREVIOUS_MONTH_TEXT__'] = $langs->trans("TextPreviousMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date, -1, 'm'), '%B').')'; |
|
945 | + $substitutionarray['__INVOICE_MONTH_TEXT__'] = $langs->trans("TextMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date($object->date, '%B').')'; |
|
946 | + $substitutionarray['__INVOICE_NEXT_MONTH_TEXT__'] = $langs->trans("TextNextMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date, 1, 'm'), '%B').')'; |
|
947 | + $substitutionarray['__INVOICE_PREVIOUS_YEAR__'] = $langs->trans("PreviousYearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date, -1, 'y'), '%Y').')'; |
|
948 | + $substitutionarray['__INVOICE_YEAR__'] = $langs->trans("YearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date($object->date, '%Y').')'; |
|
949 | + $substitutionarray['__INVOICE_NEXT_YEAR__'] = $langs->trans("NextYearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date, 1, 'y'), '%Y').')'; |
|
950 | 950 | // Only on template invoices |
951 | - $substitutionarray['__INVOICE_DATE_NEXT_INVOICE_BEFORE_GEN__'] = $langs->trans("DateNextInvoiceBeforeGen") . (isset($object->date_when) ? ' (' . $langs->trans("Example") . ': ' .dol_print_date($object->date_when, 'dayhour') . ')' : ''); |
|
952 | - $substitutionarray['__INVOICE_DATE_NEXT_INVOICE_AFTER_GEN__'] = $langs->trans("DateNextInvoiceAfterGen") . (isset($object->date_when) ? ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($object->date_when, $object->frequency, $object->unit_frequency), 'dayhour') . ')' : ''); |
|
951 | + $substitutionarray['__INVOICE_DATE_NEXT_INVOICE_BEFORE_GEN__'] = $langs->trans("DateNextInvoiceBeforeGen").(isset($object->date_when) ? ' ('.$langs->trans("Example").': '.dol_print_date($object->date_when, 'dayhour').')' : ''); |
|
952 | + $substitutionarray['__INVOICE_DATE_NEXT_INVOICE_AFTER_GEN__'] = $langs->trans("DateNextInvoiceAfterGen").(isset($object->date_when) ? ' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date_when, $object->frequency, $object->unit_frequency), 'dayhour').')' : ''); |
|
953 | 953 | $substitutionarray['__INVOICE_COUNTER_CURRENT__'] = $langs->trans("Count"); |
954 | 954 | $substitutionarray['__INVOICE_COUNTER_MAX__'] = $langs->trans("MaxPeriodNumber"); |
955 | 955 | |
956 | - $htmltext = '<i>' . $langs->trans("FollowingConstantsWillBeSubstituted") . ':<br>'; |
|
956 | + $htmltext = '<i>'.$langs->trans("FollowingConstantsWillBeSubstituted").':<br>'; |
|
957 | 957 | foreach ($substitutionarray as $key => $val) { |
958 | - $htmltext .= $key . ' = ' . $langs->trans($val) . '<br>'; |
|
958 | + $htmltext .= $key.' = '.$langs->trans($val).'<br>'; |
|
959 | 959 | } |
960 | 960 | $htmltext .= '</i>'; |
961 | 961 | |
962 | 962 | // Label |
963 | - print '<tr><td class="titlefieldcreate">' . $langs->trans("Label") . '</td><td>'; |
|
964 | - print '<input class="flat quatrevingtpercent" type="text" name="libelle" value="' . $object->label . '">'; |
|
963 | + print '<tr><td class="titlefieldcreate">'.$langs->trans("Label").'</td><td>'; |
|
964 | + print '<input class="flat quatrevingtpercent" type="text" name="libelle" value="'.$object->label.'">'; |
|
965 | 965 | print '</td></tr>'; |
966 | 966 | |
967 | 967 | // Public note |
@@ -986,38 +986,38 @@ discard block |
||
986 | 986 | } |
987 | 987 | |
988 | 988 | // Author |
989 | - print "<tr><td>" . $langs->trans("Author") . "</td><td>" . $user->getFullName($langs) . "</td></tr>"; |
|
989 | + print "<tr><td>".$langs->trans("Author")."</td><td>".$user->getFullName($langs)."</td></tr>"; |
|
990 | 990 | |
991 | 991 | // Payment term |
992 | - print "<tr><td>" . $langs->trans("PaymentConditions") . "</td><td>"; |
|
993 | - $form->form_conditions_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->cond_reglement_id, 'none'); |
|
992 | + print "<tr><td>".$langs->trans("PaymentConditions")."</td><td>"; |
|
993 | + $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->cond_reglement_id, 'none'); |
|
994 | 994 | print "</td></tr>"; |
995 | 995 | |
996 | 996 | // Payment mode |
997 | - print "<tr><td>" . $langs->trans("PaymentMode") . "</td><td>"; |
|
998 | - $form->form_modes_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->mode_reglement_id, 'none', '', 1); |
|
997 | + print "<tr><td>".$langs->trans("PaymentMode")."</td><td>"; |
|
998 | + $form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->mode_reglement_id, 'none', '', 1); |
|
999 | 999 | print "</td></tr>"; |
1000 | 1000 | |
1001 | 1001 | // Project |
1002 | 1002 | if (isModEnabled('project') && is_object($object->thirdparty) && $object->thirdparty->id > 0) { |
1003 | 1003 | $projectid = GETPOST('projectid') ? GETPOST('projectid') : $object->fk_project; |
1004 | 1004 | $langs->load('projects'); |
1005 | - print '<tr><td>' . $langs->trans('Project') . '</td><td>'; |
|
1005 | + print '<tr><td>'.$langs->trans('Project').'</td><td>'; |
|
1006 | 1006 | $numprojet = $formproject->select_projects($object->thirdparty->id, $projectid, 'projectid', 0, 0, 1, 0, 0, 0, 0, '', 0, 0, ''); |
1007 | - print ' <a href="' . DOL_URL_ROOT . '/projet/card.php?socid=' . $object->thirdparty->id . '&action=create&status=1&backtopage=' . urlencode($_SERVER["PHP_SELF"] . '?action=create&socid=' . $object->thirdparty->id . (!empty($id) ? '&id=' . $id : '')) . '">' . $langs->trans("AddProject") . '</a>'; |
|
1007 | + print ' <a href="'.DOL_URL_ROOT.'/projet/card.php?socid='.$object->thirdparty->id.'&action=create&status=1&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create&socid='.$object->thirdparty->id.(!empty($id) ? '&id='.$id : '')).'">'.$langs->trans("AddProject").'</a>'; |
|
1008 | 1008 | print '</td></tr>'; |
1009 | 1009 | } |
1010 | 1010 | |
1011 | 1011 | // Bank account |
1012 | 1012 | if ($object->fk_account > 0) { |
1013 | - print "<tr><td>" . $langs->trans('BankAccount') . "</td><td>"; |
|
1014 | - $form->formSelectAccount($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->fk_account, 'none'); |
|
1013 | + print "<tr><td>".$langs->trans('BankAccount')."</td><td>"; |
|
1014 | + $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'none'); |
|
1015 | 1015 | print "</td></tr>"; |
1016 | 1016 | } |
1017 | 1017 | |
1018 | 1018 | // Model pdf |
1019 | - print "<tr><td>" . $langs->trans('Model') . "</td><td>"; |
|
1020 | - include_once DOL_DOCUMENT_ROOT . '/core/modules/supplier_invoice/modules_facturefournisseur.php'; |
|
1019 | + print "<tr><td>".$langs->trans('Model')."</td><td>"; |
|
1020 | + include_once DOL_DOCUMENT_ROOT.'/core/modules/supplier_invoice/modules_facturefournisseur.php'; |
|
1021 | 1021 | $list = ModelePDFSuppliersInvoices::liste_modeles($db); |
1022 | 1022 | print $form->selectarray('modelpdf', $list, $conf->global->INVOICE_SUPPLIER_ADDON_PDF); |
1023 | 1023 | print "</td></tr>"; |
@@ -1028,7 +1028,7 @@ discard block |
||
1028 | 1028 | |
1029 | 1029 | // Autogeneration |
1030 | 1030 | $title = $langs->trans("Recurrence"); |
1031 | - print load_fiche_titre(img_picto('', 'recurring', 'class="pictofixedwidth"') . $title, '', ''); |
|
1031 | + print load_fiche_titre(img_picto('', 'recurring', 'class="pictofixedwidth"').$title, '', ''); |
|
1032 | 1032 | |
1033 | 1033 | print '<span class="opacitymedium">'.$langs->trans("ToCreateARecurringInvoiceGeneAuto", $langs->transnoentitiesnoconv('Module2300Name')).'</span><br><br>'; |
1034 | 1034 | |
@@ -1037,30 +1037,30 @@ discard block |
||
1037 | 1037 | print '<table class="border centpercent">'; |
1038 | 1038 | |
1039 | 1039 | // Frequency + unit |
1040 | - print '<tr><td class="titlefieldcreate">' . $form->textwithpicto($langs->trans("Frequency"), $langs->transnoentitiesnoconv('toolTipFrequency')) . "</td><td>"; |
|
1041 | - print "<input type='text' name='frequency' value='" . GETPOST('frequency', 'int') . "' size='4' /> " . $form->selectarray('unit_frequency', array('d' => $langs->trans('Day'), 'm' => $langs->trans('Month'), 'y' => $langs->trans('Year')), (GETPOST('unit_frequency') ? GETPOST('unit_frequency') : 'm')); |
|
1040 | + print '<tr><td class="titlefieldcreate">'.$form->textwithpicto($langs->trans("Frequency"), $langs->transnoentitiesnoconv('toolTipFrequency'))."</td><td>"; |
|
1041 | + print "<input type='text' name='frequency' value='".GETPOST('frequency', 'int')."' size='4' /> ".$form->selectarray('unit_frequency', array('d' => $langs->trans('Day'), 'm' => $langs->trans('Month'), 'y' => $langs->trans('Year')), (GETPOST('unit_frequency') ? GETPOST('unit_frequency') : 'm')); |
|
1042 | 1042 | print "</td></tr>"; |
1043 | 1043 | |
1044 | 1044 | // Date next run |
1045 | - print "<tr><td>" . $langs->trans('NextDateToExecution') . "</td><td>"; |
|
1045 | + print "<tr><td>".$langs->trans('NextDateToExecution')."</td><td>"; |
|
1046 | 1046 | $date_next_execution = isset($date_next_execution) ? $date_next_execution : (GETPOST('remonth') ? dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear')) : -1); |
1047 | 1047 | print $form->selectDate($date_next_execution, '', 1, 1, '', "add", 1, 1); |
1048 | 1048 | print "</td></tr>"; |
1049 | 1049 | |
1050 | 1050 | // Number max of generation |
1051 | - print "<tr><td>" . $langs->trans("MaxPeriodNumber") . "</td><td>"; |
|
1052 | - print '<input type="text" name="nb_gen_max" value="' . GETPOST('nb_gen_max') . '" size="5" />'; |
|
1051 | + print "<tr><td>".$langs->trans("MaxPeriodNumber")."</td><td>"; |
|
1052 | + print '<input type="text" name="nb_gen_max" value="'.GETPOST('nb_gen_max').'" size="5" />'; |
|
1053 | 1053 | print "</td></tr>"; |
1054 | 1054 | |
1055 | 1055 | // Auto validate the invoice |
1056 | - print "<tr><td>" . $langs->trans("StatusOfAutoGeneratedInvoices") . "</td><td>"; |
|
1056 | + print "<tr><td>".$langs->trans("StatusOfAutoGeneratedInvoices")."</td><td>"; |
|
1057 | 1057 | $select = array('0' => $langs->trans('BillStatusDraft'), '1' => $langs->trans('BillStatusValidated')); |
1058 | 1058 | print $form->selectarray('auto_validate', $select, GETPOST('auto_validate')); |
1059 | 1059 | print "</td></tr>"; |
1060 | 1060 | |
1061 | 1061 | // Auto generate document |
1062 | 1062 | if (getDolGlobalString('INVOICE_REC_CAN_DISABLE_DOCUMENT_FILE_GENERATION')) { |
1063 | - print "<tr><td>" . $langs->trans("StatusOfGeneratedDocuments") . "</td><td>"; |
|
1063 | + print "<tr><td>".$langs->trans("StatusOfGeneratedDocuments")."</td><td>"; |
|
1064 | 1064 | $select = array('0' => $langs->trans('DoNotGenerateDoc'), '1' => $langs->trans('AutoGenerateDoc')); |
1065 | 1065 | print $form->selectarray('generate_pdf', $select, GETPOST('generate_pdf')); |
1066 | 1066 | print "</td></tr>"; |
@@ -1103,7 +1103,7 @@ discard block |
||
1103 | 1103 | |
1104 | 1104 | print "</form>\n"; |
1105 | 1105 | } else { |
1106 | - dol_print_error(null, "Error, no invoice " . $object->id); |
|
1106 | + dol_print_error(null, "Error, no invoice ".$object->id); |
|
1107 | 1107 | } |
1108 | 1108 | } else { |
1109 | 1109 | /* |
@@ -1117,12 +1117,12 @@ discard block |
||
1117 | 1117 | |
1118 | 1118 | // Confirmation de la suppression d'une ligne produit |
1119 | 1119 | if ($action == 'ask_deleteline') { |
1120 | - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&lineid=' . $lineid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline', '', 'no', 1); |
|
1120 | + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline', '', 'no', 1); |
|
1121 | 1121 | } |
1122 | 1122 | |
1123 | 1123 | // Confirm delete of repeatable invoice |
1124 | 1124 | if ($action == 'ask_deleteinvoice') { |
1125 | - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteRepeatableInvoice'), $langs->trans('ConfirmDeleteRepeatableInvoice'), 'confirm_deleteinvoice', '', 'no', 1); |
|
1125 | + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteRepeatableInvoice'), $langs->trans('ConfirmDeleteRepeatableInvoice'), 'confirm_deleteinvoice', '', 'no', 1); |
|
1126 | 1126 | } |
1127 | 1127 | |
1128 | 1128 | print $formconfirm; |
@@ -1136,7 +1136,7 @@ discard block |
||
1136 | 1136 | |
1137 | 1137 | // Recurring invoice content |
1138 | 1138 | |
1139 | - $linkback = '<a href="' . DOL_URL_ROOT . '/fourn/facture/list-rec.php?restore_lastsearch_values=1' . (!empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans('BackToList') . '</a>'; |
|
1139 | + $linkback = '<a href="'.DOL_URL_ROOT.'/fourn/facture/list-rec.php?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans('BackToList').'</a>'; |
|
1140 | 1140 | |
1141 | 1141 | $morehtmlref = ''; |
1142 | 1142 | if ($action != 'edittitle') { |
@@ -1149,33 +1149,33 @@ discard block |
||
1149 | 1149 | $morehtmlref .= $form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $usercancreate, 'string', '', 0, 1); |
1150 | 1150 | $morehtmlref .= $form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $usercancreate, 'string', '', null, null, '', 1); |
1151 | 1151 | // Thirdparty |
1152 | - $morehtmlref .= '<br>' . $langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1); |
|
1152 | + $morehtmlref .= '<br>'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); |
|
1153 | 1153 | |
1154 | 1154 | // Project |
1155 | 1155 | if (isModEnabled('project')) { |
1156 | 1156 | $langs->load('projects'); |
1157 | - $morehtmlref .= '<br>' . $langs->trans('Project') . ' '; |
|
1157 | + $morehtmlref .= '<br>'.$langs->trans('Project').' '; |
|
1158 | 1158 | if ($usercancreate) { |
1159 | 1159 | if ($action != 'classify') { |
1160 | - $morehtmlref .= '<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&token=' . newToken() . '&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : '; |
|
1160 | + $morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> : '; |
|
1161 | 1161 | } |
1162 | 1162 | if ($action == 'classify') { |
1163 | - $morehtmlref .= '<form method="post" action="' . $_SERVER['PHP_SELF'] . '?id=' . $object->id . '">'; |
|
1163 | + $morehtmlref .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">'; |
|
1164 | 1164 | $morehtmlref .= '<input type="hidden" name="action" value="classin">'; |
1165 | - $morehtmlref .= '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
1165 | + $morehtmlref .= '<input type="hidden" name="token" value="'.newToken().'">'; |
|
1166 | 1166 | $morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); |
1167 | - $morehtmlref .= '<input type="submit" class="button valignmiddle" value="' . $langs->trans("Modify") . '">'; |
|
1167 | + $morehtmlref .= '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">'; |
|
1168 | 1168 | $morehtmlref .= '</form>'; |
1169 | 1169 | } else { |
1170 | - $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1, '', 'maxwidth300'); |
|
1170 | + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1, '', 'maxwidth300'); |
|
1171 | 1171 | } |
1172 | 1172 | } else { |
1173 | 1173 | if (!empty($object->fk_project)) { |
1174 | 1174 | $project = new Project($db); |
1175 | 1175 | $project->fetch($object->fk_project); |
1176 | - $morehtmlref .= ' : ' . $project->getNomUrl(1); |
|
1176 | + $morehtmlref .= ' : '.$project->getNomUrl(1); |
|
1177 | 1177 | if ($project->title) { |
1178 | - $morehtmlref .= ' - ' . $project->title; |
|
1178 | + $morehtmlref .= ' - '.$project->title; |
|
1179 | 1179 | } |
1180 | 1180 | } else { |
1181 | 1181 | $morehtmlref .= ''; |
@@ -1194,34 +1194,34 @@ discard block |
||
1194 | 1194 | |
1195 | 1195 | print '<table class="border centpercent tableforfield">'; |
1196 | 1196 | |
1197 | - print '<tr><td class="titlefield">' . $langs->trans('Author') . '</td><td>'; |
|
1197 | + print '<tr><td class="titlefield">'.$langs->trans('Author').'</td><td>'; |
|
1198 | 1198 | print $author->getNomUrl(-1); |
1199 | 1199 | print "</td></tr>"; |
1200 | 1200 | |
1201 | 1201 | // Label |
1202 | 1202 | print '<tr>'; |
1203 | - print '<td>' . $form->editfieldkey("Label", 'libelle', $object->libelle, $object, $usercancreate) . '</td>'; |
|
1204 | - print '<td>' . $form->editfieldval("Label", 'libelle', $object->libelle, $object, $usercancreate) . '</td>'; |
|
1203 | + print '<td>'.$form->editfieldkey("Label", 'libelle', $object->libelle, $object, $usercancreate).'</td>'; |
|
1204 | + print '<td>'.$form->editfieldval("Label", 'libelle', $object->libelle, $object, $usercancreate).'</td>'; |
|
1205 | 1205 | print '</tr>'; |
1206 | 1206 | |
1207 | - print '<tr><td>' . $langs->trans('AmountHT') . '</td>'; |
|
1208 | - print '<td>' . price($object->total_ht, '', $langs, 1, -1, -1, $conf->currency) . '</td>'; |
|
1207 | + print '<tr><td>'.$langs->trans('AmountHT').'</td>'; |
|
1208 | + print '<td>'.price($object->total_ht, '', $langs, 1, -1, -1, $conf->currency).'</td>'; |
|
1209 | 1209 | print '</tr>'; |
1210 | 1210 | |
1211 | - print '<tr><td>' . $langs->trans("AmountVAT") . '</td><td>' . price($object->total_tva, '', $langs, 1, -1, -1, $conf->currency) . '</td>'; |
|
1211 | + print '<tr><td>'.$langs->trans("AmountVAT").'</td><td>'.price($object->total_tva, '', $langs, 1, -1, -1, $conf->currency).'</td>'; |
|
1212 | 1212 | print '</tr>'; |
1213 | 1213 | |
1214 | 1214 | // Amount Local Taxes |
1215 | 1215 | if (($mysoc->localtax1_assuj == "1" && $mysoc->useLocalTax(1)) || $object->total_localtax1 != 0) { // Localtax1 |
1216 | - print '<tr><td>' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td>'; |
|
1217 | - print '<td class="nowrap">' . price($object->total_localtax1, 1, '', 1, -1, -1, $conf->currency) . '</td></tr>'; |
|
1216 | + print '<tr><td>'.$langs->transcountry("AmountLT1", $mysoc->country_code).'</td>'; |
|
1217 | + print '<td class="nowrap">'.price($object->total_localtax1, 1, '', 1, -1, -1, $conf->currency).'</td></tr>'; |
|
1218 | 1218 | } |
1219 | 1219 | if (($mysoc->localtax2_assuj == "1" && $mysoc->useLocalTax(2)) || $object->total_localtax2 != 0) { // Localtax2 |
1220 | - print '<tr><td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td>'; |
|
1221 | - print '<td class=nowrap">' . price($object->total_localtax2, 1, '', 1, -1, -1, $conf->currency) . '</td></tr>'; |
|
1220 | + print '<tr><td>'.$langs->transcountry("AmountLT2", $mysoc->country_code).'</td>'; |
|
1221 | + print '<td class=nowrap">'.price($object->total_localtax2, 1, '', 1, -1, -1, $conf->currency).'</td></tr>'; |
|
1222 | 1222 | } |
1223 | 1223 | |
1224 | - print '<tr><td>' . $langs->trans("AmountTTC") . '</td><td colspan="3">' . price($object->total_ttc, '', $langs, 1, -1, -1, $conf->currency) . '</td>'; |
|
1224 | + print '<tr><td>'.$langs->trans("AmountTTC").'</td><td colspan="3">'.price($object->total_ttc, '', $langs, 1, -1, -1, $conf->currency).'</td>'; |
|
1225 | 1225 | print '</tr>'; |
1226 | 1226 | |
1227 | 1227 | // Payment term |
@@ -1230,14 +1230,14 @@ discard block |
||
1230 | 1230 | print $langs->trans('PaymentConditionsShort'); |
1231 | 1231 | print '</td>'; |
1232 | 1232 | if ($action != 'editconditions' && $usercancreate) { |
1233 | - print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editconditions&token=' . newToken() . '&facid=' . $object->id . '">' . img_edit($langs->trans('SetConditions'), 1) . '</a></td>'; |
|
1233 | + print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editconditions&token='.newToken().'&facid='.$object->id.'">'.img_edit($langs->trans('SetConditions'), 1).'</a></td>'; |
|
1234 | 1234 | } |
1235 | 1235 | print '</tr></table>'; |
1236 | 1236 | print '</td><td>'; |
1237 | 1237 | if ($action == 'editconditions') { |
1238 | - $form->form_conditions_reglement($_SERVER['PHP_SELF'] . '?facid=' . $object->id, $object->cond_reglement_id, 'cond_reglement_id'); |
|
1238 | + $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id, $object->cond_reglement_id, 'cond_reglement_id'); |
|
1239 | 1239 | } else { |
1240 | - $form->form_conditions_reglement($_SERVER['PHP_SELF'] . '?facid=' . $object->id, $object->cond_reglement_id, 'none'); |
|
1240 | + $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id, $object->cond_reglement_id, 'none'); |
|
1241 | 1241 | } |
1242 | 1242 | |
1243 | 1243 | print '</td></tr>'; |
@@ -1248,14 +1248,14 @@ discard block |
||
1248 | 1248 | print $langs->trans('PaymentMode'); |
1249 | 1249 | print '</td>'; |
1250 | 1250 | if ($action != 'editmode' && $usercancreate) { |
1251 | - print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editmode&token=' . newToken() . '&facid=' . $object->id . '">' . img_edit($langs->trans('SetMode'), 1) . '</a></td>'; |
|
1251 | + print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editmode&token='.newToken().'&facid='.$object->id.'">'.img_edit($langs->trans('SetMode'), 1).'</a></td>'; |
|
1252 | 1252 | } |
1253 | 1253 | print '</tr></table>'; |
1254 | 1254 | print '</td><td>'; |
1255 | 1255 | if ($action == 'editmode') { |
1256 | - $form->form_modes_reglement($_SERVER['PHP_SELF'] . '?facid=' . $object->id, $object->mode_reglement_id, 'mode_reglement_id', 'CRDT', 1, 1); |
|
1256 | + $form->form_modes_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id, $object->mode_reglement_id, 'mode_reglement_id', 'CRDT', 1, 1); |
|
1257 | 1257 | } else { |
1258 | - $form->form_modes_reglement($_SERVER['PHP_SELF'] . '?facid=' . $object->id, $object->mode_reglement_id, 'none'); |
|
1258 | + $form->form_modes_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id, $object->mode_reglement_id, 'none'); |
|
1259 | 1259 | } |
1260 | 1260 | print '</td></tr>'; |
1261 | 1261 | |
@@ -1268,12 +1268,12 @@ discard block |
||
1268 | 1268 | print $form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0); |
1269 | 1269 | print '</td>'; |
1270 | 1270 | if ($usercancreate && $action != 'editmulticurrencycode' && $object->suspended == $object::STATUS_SUSPENDED) { |
1271 | - print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editmulticurrencycode&token=' . newToken() . '&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . '</a></td>'; |
|
1271 | + print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editmulticurrencycode&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1).'</a></td>'; |
|
1272 | 1272 | } |
1273 | 1273 | print '</tr></table>'; |
1274 | 1274 | print '</td><td>'; |
1275 | 1275 | $htmlname = (($usercancreate && $action == 'editmulticurrencycode') ? 'multicurrency_code' : 'none'); |
1276 | - $form->form_multicurrency_code($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_code, $htmlname); |
|
1276 | + $form->form_multicurrency_code($_SERVER['PHP_SELF'].'?id='.$object->id, $object->multicurrency_code, $htmlname); |
|
1277 | 1277 | print '</td></tr>'; |
1278 | 1278 | |
1279 | 1279 | // Multicurrency rate |
@@ -1284,7 +1284,7 @@ discard block |
||
1284 | 1284 | print $form->editfieldkey('CurrencyRate', 'multicurrency_tx', '', $object, 0); |
1285 | 1285 | print '</td>'; |
1286 | 1286 | if ($usercancreate && $action != 'editmulticurrencyrate' && $object->suspended == $object::STATUS_SUSPENDED && $object->multicurrency_code && $object->multicurrency_code != $conf->currency) { |
1287 | - print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editmulticurrencyrate&token=' . newToken() . '&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . '</a></td>'; |
|
1287 | + print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editmulticurrencyrate&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1).'</a></td>'; |
|
1288 | 1288 | } |
1289 | 1289 | print '</tr></table>'; |
1290 | 1290 | print '</td><td>'; |
@@ -1292,12 +1292,12 @@ discard block |
||
1292 | 1292 | if ($action == 'actualizemulticurrencyrate') { |
1293 | 1293 | list($object->fk_multicurrency, $object->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($object->db, $object->multicurrency_code); |
1294 | 1294 | } |
1295 | - $form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, ($usercancreate ? 'multicurrency_tx' : 'none'), $object->multicurrency_code); |
|
1295 | + $form->form_multicurrency_rate($_SERVER['PHP_SELF'].'?id='.$object->id, $object->multicurrency_tx, ($usercancreate ? 'multicurrency_tx' : 'none'), $object->multicurrency_code); |
|
1296 | 1296 | } else { |
1297 | - $form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'none', $object->multicurrency_code); |
|
1297 | + $form->form_multicurrency_rate($_SERVER['PHP_SELF'].'?id='.$object->id, $object->multicurrency_tx, 'none', $object->multicurrency_code); |
|
1298 | 1298 | if ($object->statut == $object::STATUS_DRAFT && $object->multicurrency_code && $object->multicurrency_code != $conf->currency) { |
1299 | 1299 | print '<div class="inline-block"> '; |
1300 | - print '<a href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=actualizemulticurrencyrate">' . $langs->trans("ActualizeCurrency") . '</a>'; |
|
1300 | + print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=actualizemulticurrencyrate">'.$langs->trans("ActualizeCurrency").'</a>'; |
|
1301 | 1301 | print '</div>'; |
1302 | 1302 | } |
1303 | 1303 | } |
@@ -1313,24 +1313,24 @@ discard block |
||
1313 | 1313 | |
1314 | 1314 | $substitutionarray = getCommonSubstitutionArray($langs, 2, null, $object); |
1315 | 1315 | |
1316 | - $substitutionarray['__INVOICE_PREVIOUS_MONTH__'] = $langs->trans("PreviousMonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($dateexample, -1, 'm'), '%m') . ')'; |
|
1317 | - $substitutionarray['__INVOICE_MONTH__'] = $langs->trans("MonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date($dateexample, '%m') . ')'; |
|
1318 | - $substitutionarray['__INVOICE_NEXT_MONTH__'] = $langs->trans("NextMonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($dateexample, 1, 'm'), '%m') . ')'; |
|
1319 | - $substitutionarray['__INVOICE_PREVIOUS_MONTH_TEXT__'] = $langs->trans("TextPreviousMonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($dateexample, -1, 'm'), '%B') . ')'; |
|
1320 | - $substitutionarray['__INVOICE_MONTH_TEXT__'] = $langs->trans("TextMonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date($dateexample, '%B') . ')'; |
|
1321 | - $substitutionarray['__INVOICE_NEXT_MONTH_TEXT__'] = $langs->trans("TextNextMonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($dateexample, 1, 'm'), '%B') . ')'; |
|
1322 | - $substitutionarray['__INVOICE_PREVIOUS_YEAR__'] = $langs->trans("PreviousYearOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($dateexample, -1, 'y'), '%Y') . ')'; |
|
1323 | - $substitutionarray['__INVOICE_YEAR__'] = $langs->trans("YearOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date($dateexample, '%Y') . ')'; |
|
1324 | - $substitutionarray['__INVOICE_NEXT_YEAR__'] = $langs->trans("NextYearOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($dateexample, 1, 'y'), '%Y') . ')'; |
|
1316 | + $substitutionarray['__INVOICE_PREVIOUS_MONTH__'] = $langs->trans("PreviousMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($dateexample, -1, 'm'), '%m').')'; |
|
1317 | + $substitutionarray['__INVOICE_MONTH__'] = $langs->trans("MonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date($dateexample, '%m').')'; |
|
1318 | + $substitutionarray['__INVOICE_NEXT_MONTH__'] = $langs->trans("NextMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($dateexample, 1, 'm'), '%m').')'; |
|
1319 | + $substitutionarray['__INVOICE_PREVIOUS_MONTH_TEXT__'] = $langs->trans("TextPreviousMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($dateexample, -1, 'm'), '%B').')'; |
|
1320 | + $substitutionarray['__INVOICE_MONTH_TEXT__'] = $langs->trans("TextMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date($dateexample, '%B').')'; |
|
1321 | + $substitutionarray['__INVOICE_NEXT_MONTH_TEXT__'] = $langs->trans("TextNextMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($dateexample, 1, 'm'), '%B').')'; |
|
1322 | + $substitutionarray['__INVOICE_PREVIOUS_YEAR__'] = $langs->trans("PreviousYearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($dateexample, -1, 'y'), '%Y').')'; |
|
1323 | + $substitutionarray['__INVOICE_YEAR__'] = $langs->trans("YearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date($dateexample, '%Y').')'; |
|
1324 | + $substitutionarray['__INVOICE_NEXT_YEAR__'] = $langs->trans("NextYearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($dateexample, 1, 'y'), '%Y').')'; |
|
1325 | 1325 | // Only on template invoices |
1326 | - $substitutionarray['__INVOICE_DATE_NEXT_INVOICE_BEFORE_GEN__'] = $langs->trans("DateNextInvoiceBeforeGen") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(($object->date_when ? $object->date_when : dol_now()), 'dayhour') . ')'; |
|
1327 | - $substitutionarray['__INVOICE_DATE_NEXT_INVOICE_AFTER_GEN__'] = $langs->trans("DateNextInvoiceAfterGen") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree(($object->date_when ? $object->date_when : dol_now()), $object->frequency, $object->unit_frequency), 'dayhour') . ')'; |
|
1326 | + $substitutionarray['__INVOICE_DATE_NEXT_INVOICE_BEFORE_GEN__'] = $langs->trans("DateNextInvoiceBeforeGen").' ('.$langs->trans("Example").': '.dol_print_date(($object->date_when ? $object->date_when : dol_now()), 'dayhour').')'; |
|
1327 | + $substitutionarray['__INVOICE_DATE_NEXT_INVOICE_AFTER_GEN__'] = $langs->trans("DateNextInvoiceAfterGen").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree(($object->date_when ? $object->date_when : dol_now()), $object->frequency, $object->unit_frequency), 'dayhour').')'; |
|
1328 | 1328 | $substitutionarray['__INVOICE_COUNTER_CURRENT__'] = $object->nb_gen_done; |
1329 | 1329 | $substitutionarray['__INVOICE_COUNTER_MAX__'] = $object->nb_gen_max; |
1330 | 1330 | |
1331 | - $htmltext = '<i>' . $langs->trans("FollowingConstantsWillBeSubstituted") . ':<br>'; |
|
1331 | + $htmltext = '<i>'.$langs->trans("FollowingConstantsWillBeSubstituted").':<br>'; |
|
1332 | 1332 | foreach ($substitutionarray as $key => $val) { |
1333 | - $htmltext .= $key . ' = ' . $langs->trans($val) . '<br>'; |
|
1333 | + $htmltext .= $key.' = '.$langs->trans($val).'<br>'; |
|
1334 | 1334 | } |
1335 | 1335 | $htmltext .= '</i>'; |
1336 | 1336 | |
@@ -1338,7 +1338,7 @@ discard block |
||
1338 | 1338 | print '<tr><td>'; |
1339 | 1339 | print $form->editfieldkey($form->textwithpicto($langs->trans('NotePublic'), $htmltext, 1, 'help', '', 0, 2, 'notepublic'), 'note_public', $object->note_public, $object, $usercancreate); |
1340 | 1340 | print '</td><td class="wordbreak">'; |
1341 | - print $form->editfieldval($langs->trans("NotePublic"), 'note_public', $object->note_public, $object, $usercancreate, 'textarea:' . ROWS_4 . ':90%', '', null, null, '', 1); |
|
1341 | + print $form->editfieldval($langs->trans("NotePublic"), 'note_public', $object->note_public, $object, $usercancreate, 'textarea:'.ROWS_4.':90%', '', null, null, '', 1); |
|
1342 | 1342 | print '</td>'; |
1343 | 1343 | print '</tr>'; |
1344 | 1344 | |
@@ -1346,7 +1346,7 @@ discard block |
||
1346 | 1346 | print '<tr><td>'; |
1347 | 1347 | print $form->editfieldkey($form->textwithpicto($langs->trans("NotePrivate"), $htmltext, 1, 'help', '', 0, 2, 'noteprivate'), 'note_private', $object->note_private, $object, $usercancreate); |
1348 | 1348 | print '</td><td class="wordbreak">'; |
1349 | - print $form->editfieldval($langs->trans("NotePrivate"), 'note_private', $object->note_private, $object, $usercancreate, 'textarea:' . ROWS_4 . ':90%', '', null, null, '', 1); |
|
1349 | + print $form->editfieldval($langs->trans("NotePrivate"), 'note_private', $object->note_private, $object, $usercancreate, 'textarea:'.ROWS_4.':90%', '', null, null, '', 1); |
|
1350 | 1350 | print '</td>'; |
1351 | 1351 | print '</tr>'; |
1352 | 1352 | |
@@ -1356,14 +1356,14 @@ discard block |
||
1356 | 1356 | print $langs->trans('BankAccount'); |
1357 | 1357 | print '<td>'; |
1358 | 1358 | if ($action != 'editbankaccount' && $usercancreate && $object->statut == FactureFournisseurRec::STATUS_NOTSUSPENDED) { |
1359 | - print '<td class="right"><a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=editbankaccount&token=' . newToken() . '&id=' . $object->id . '">' . img_edit($langs->trans('SetBankAccount'), 1) . '</a></td>'; |
|
1359 | + print '<td class="right"><a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=editbankaccount&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->trans('SetBankAccount'), 1).'</a></td>'; |
|
1360 | 1360 | } |
1361 | 1361 | print '</tr></table>'; |
1362 | 1362 | print '</td><td>'; |
1363 | 1363 | if ($action == 'editbankaccount') { |
1364 | - $form->formSelectAccount($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->fk_account, 'fk_account', 1); |
|
1364 | + $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'fk_account', 1); |
|
1365 | 1365 | } else { |
1366 | - $form->formSelectAccount($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->fk_account, 'none'); |
|
1366 | + $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'none'); |
|
1367 | 1367 | } |
1368 | 1368 | print "</td>"; |
1369 | 1369 | print '</tr>'; |
@@ -1374,18 +1374,18 @@ discard block |
||
1374 | 1374 | print $langs->trans('Model'); |
1375 | 1375 | print '<td>'; |
1376 | 1376 | if ($action != 'editmodelpdf' && $usercancreate && $object->statut == FactureFournisseurRec::STATUS_NOTSUSPENDED) { |
1377 | - print '<td class="right"><a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=editmodelpdf&token=' . newToken() . '&id=' . $object->id . '">' . img_edit($langs->trans('SetModel'), 1) . '</a></td>'; |
|
1377 | + print '<td class="right"><a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=editmodelpdf&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->trans('SetModel'), 1).'</a></td>'; |
|
1378 | 1378 | } |
1379 | 1379 | print '</tr></table>'; |
1380 | 1380 | print '</td><td>'; |
1381 | 1381 | if ($action == 'editmodelpdf') { |
1382 | - include_once DOL_DOCUMENT_ROOT . '/core/modules/supplier_invoice/modules_facturefournisseur.php'; |
|
1382 | + include_once DOL_DOCUMENT_ROOT.'/core/modules/supplier_invoice/modules_facturefournisseur.php'; |
|
1383 | 1383 | $list = array(); |
1384 | 1384 | $models = ModelePDFSuppliersInvoices::liste_modeles($db); |
1385 | 1385 | foreach ($models as $k => $model) { |
1386 | - $list[] = str_replace(':', '|', $k) . ':' . $model; |
|
1386 | + $list[] = str_replace(':', '|', $k).':'.$model; |
|
1387 | 1387 | } |
1388 | - $select = 'select;' . implode(',', $list); |
|
1388 | + $select = 'select;'.implode(',', $list); |
|
1389 | 1389 | //TODO : Droits |
1390 | 1390 | print $form->editfieldval($langs->trans('Model'), 'modelpdf', $object->model_pdf, $object, $usercancreate, $select); |
1391 | 1391 | } else { |
@@ -1396,7 +1396,7 @@ discard block |
||
1396 | 1396 | |
1397 | 1397 | // Other attributes |
1398 | 1398 | $cols = 2; |
1399 | - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; |
|
1399 | + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; |
|
1400 | 1400 | |
1401 | 1401 | print '</table>'; |
1402 | 1402 | |
@@ -1412,7 +1412,7 @@ discard block |
||
1412 | 1412 | |
1413 | 1413 | print '<table class="border centpercent tableforfield">'; |
1414 | 1414 | |
1415 | - print '<tr><td colspan="2">' . img_picto('', 'recurring', 'class="pictofixedwidth"') . $title . '</td></tr>'; |
|
1415 | + print '<tr><td colspan="2">'.img_picto('', 'recurring', 'class="pictofixedwidth"').$title.'</td></tr>'; |
|
1416 | 1416 | |
1417 | 1417 | // if "frequency" is empty or = 0, the recurrence is disabled |
1418 | 1418 | print '<tr><td style="width: 50%">'; |
@@ -1420,23 +1420,23 @@ discard block |
||
1420 | 1420 | print $langs->trans('Frequency'); |
1421 | 1421 | print '</td>'; |
1422 | 1422 | if ($action != 'editfrequency' && $usercancreate) { |
1423 | - print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editfrequency&token=' . newToken() . '&facid=' . $object->id . '">' . img_edit($langs->trans('Edit'), 1) . '</a></td>'; |
|
1423 | + print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editfrequency&token='.newToken().'&facid='.$object->id.'">'.img_edit($langs->trans('Edit'), 1).'</a></td>'; |
|
1424 | 1424 | } |
1425 | 1425 | print '</tr></table>'; |
1426 | 1426 | print '</td><td>'; |
1427 | 1427 | if ($action == 'editfrequency') { |
1428 | - print '<form method="post" action="' . $_SERVER["PHP_SELF"] . '?facid=' . $object->id . '">'; |
|
1428 | + print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?facid='.$object->id.'">'; |
|
1429 | 1429 | print '<input type="hidden" name="action" value="setfrequency">'; |
1430 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
1430 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
1431 | 1431 | print '<table class="nobordernopadding">'; |
1432 | 1432 | print '<tr><td>'; |
1433 | - print "<input type='text' name='frequency' value='" . $object->frequency . "' size='5' /> " . $form->selectarray('unit_frequency', array('d' => $langs->trans('Day'), 'm' => $langs->trans('Month'), 'y' => $langs->trans('Year')), ($object->unit_frequency ? $object->unit_frequency : 'm')); |
|
1433 | + print "<input type='text' name='frequency' value='".$object->frequency."' size='5' /> ".$form->selectarray('unit_frequency', array('d' => $langs->trans('Day'), 'm' => $langs->trans('Month'), 'y' => $langs->trans('Year')), ($object->unit_frequency ? $object->unit_frequency : 'm')); |
|
1434 | 1434 | print '</td>'; |
1435 | - print '<td class="left"><input type="submit" class="button button-edit" value="' . $langs->trans("Modify") . '"></td>'; |
|
1435 | + print '<td class="left"><input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'"></td>'; |
|
1436 | 1436 | print '</tr></table></form>'; |
1437 | 1437 | } else { |
1438 | 1438 | if ($object->frequency > 0) { |
1439 | - print $langs->trans('FrequencyPer_' . $object->unit_frequency, $object->frequency); |
|
1439 | + print $langs->trans('FrequencyPer_'.$object->unit_frequency, $object->frequency); |
|
1440 | 1440 | } else { |
1441 | 1441 | print $langs->trans("NotARecurringInvoiceTemplate"); |
1442 | 1442 | } |
@@ -1455,8 +1455,8 @@ discard block |
||
1455 | 1455 | print $form->editfieldval($langs->trans("NextDateToExecution"), 'date_when', $object->date_when, $object, $usercancreate, 'day', $object->date_when, null, '', '', 0, 'strikeIfMaxNbGenReached'); |
1456 | 1456 | } |
1457 | 1457 | //var_dump(dol_print_date($object->date_when+60, 'dayhour').' - '.dol_print_date($now, 'dayhour')); |
1458 | - if (! $object->isMaxNbGenReached()) { |
|
1459 | - if (! $object->suspended && $action != 'editdate_when' && $object->frequency > 0 && $object->date_when && $object->date_when < $now) { |
|
1458 | + if (!$object->isMaxNbGenReached()) { |
|
1459 | + if (!$object->suspended && $action != 'editdate_when' && $object->frequency > 0 && $object->date_when && $object->date_when < $now) { |
|
1460 | 1460 | print img_warning($langs->trans("Late")); |
1461 | 1461 | } |
1462 | 1462 | } else { |
@@ -1489,7 +1489,7 @@ discard block |
||
1489 | 1489 | print $langs->trans("StatusOfAutoGeneratedInvoices"); |
1490 | 1490 | } |
1491 | 1491 | print '</td><td>'; |
1492 | - $select = 'select;0:' . $langs->trans('BillStatusDraft') . ',1:' . $langs->trans('BillStatusValidated'); |
|
1492 | + $select = 'select;0:'.$langs->trans('BillStatusDraft').',1:'.$langs->trans('BillStatusValidated'); |
|
1493 | 1493 | if ($action == 'auto_validate' || $object->frequency > 0) { |
1494 | 1494 | print $form->editfieldval($langs->trans("StatusOfAutoGeneratedInvoices"), 'auto_validate', $object->auto_validate, $object, $usercancreate, $select); |
1495 | 1495 | } |
@@ -1505,7 +1505,7 @@ discard block |
||
1505 | 1505 | } |
1506 | 1506 | print '</td>'; |
1507 | 1507 | print '<td>'; |
1508 | - $select = 'select;0:' . $langs->trans('DoNotGenerateDoc') . ',1:' . $langs->trans('AutogenerateDoc'); |
|
1508 | + $select = 'select;0:'.$langs->trans('DoNotGenerateDoc').',1:'.$langs->trans('AutogenerateDoc'); |
|
1509 | 1509 | if ($action == 'generate_pdf' || $object->frequency > 0) { |
1510 | 1510 | print $form->editfieldval($langs->trans("StatusOfGeneratedDocuments"), 'generate_pdf', $object->generate_pdf, $object, $usercancreate, $select); |
1511 | 1511 | } |
@@ -1529,7 +1529,7 @@ discard block |
||
1529 | 1529 | print '<table class="border centpercent tableforfield">'; |
1530 | 1530 | |
1531 | 1531 | // Nb of generation already done |
1532 | - print '<tr><td style="width: 50%">' . $langs->trans("NbOfGenerationDone") . '</td>'; |
|
1532 | + print '<tr><td style="width: 50%">'.$langs->trans("NbOfGenerationDone").'</td>'; |
|
1533 | 1533 | print '<td>'; |
1534 | 1534 | print $object->nb_gen_done ? $object->nb_gen_done : '0'; |
1535 | 1535 | print '</td>'; |
@@ -1554,15 +1554,15 @@ discard block |
||
1554 | 1554 | print '<div class="clearboth"></div><br>'; |
1555 | 1555 | |
1556 | 1556 | // Lines |
1557 | - print ' <form name="addproduct" id="addproduct" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . (($action != 'editline') ? '#add' : '#line_' . GETPOST('lineid', 'int')) . '" method="POST"> |
|
1558 | - <input type="hidden" name="token" value="' . newToken() . '"> |
|
1559 | - <input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline') . '"> |
|
1557 | + print ' <form name="addproduct" id="addproduct" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.(($action != 'editline') ? '#add' : '#line_'.GETPOST('lineid', 'int')).'" method="POST"> |
|
1558 | + <input type="hidden" name="token" value="' . newToken().'"> |
|
1559 | + <input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline').'"> |
|
1560 | 1560 | <input type="hidden" name="mode" value=""> |
1561 | - <input type="hidden" name="id" value="' . $object->id . '"> |
|
1561 | + <input type="hidden" name="id" value="' . $object->id.'"> |
|
1562 | 1562 | '; |
1563 | 1563 | |
1564 | 1564 | if (!empty($conf->use_javascript_ajax) && $object->statut == 0) { |
1565 | - include DOL_DOCUMENT_ROOT . '/core/tpl/ajaxrow.tpl.php'; |
|
1565 | + include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php'; |
|
1566 | 1566 | } |
1567 | 1567 | |
1568 | 1568 | print '<div class="div-table-responsive-no-min">'; |
@@ -1619,24 +1619,24 @@ discard block |
||
1619 | 1619 | if (empty($object->suspended)) { |
1620 | 1620 | if ($usercancreate) { |
1621 | 1621 | if (!empty($object->frequency) && $object->nb_gen_max > 0 && ($object->nb_gen_done >= $object->nb_gen_max)) { |
1622 | - print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="' . dol_escape_htmltag($langs->trans("MaxGenerationReached")) . '">' . $langs->trans("CreateBill") . '</a></div>'; |
|
1622 | + print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("MaxGenerationReached")).'">'.$langs->trans("CreateBill").'</a></div>'; |
|
1623 | 1623 | } else { |
1624 | 1624 | if (empty($object->frequency) || $object->date_when <= $nowlasthour) { |
1625 | - print '<div class="inline-block divButAction"><a class="butAction" href="' . DOL_URL_ROOT . '/fourn/facture/card.php?action=create&socid=' . $object->thirdparty->id . '&fac_rec=' . $object->id . '">' . $langs->trans("CreateBill") . '</a></div>'; |
|
1625 | + print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/fourn/facture/card.php?action=create&socid='.$object->thirdparty->id.'&fac_rec='.$object->id.'">'.$langs->trans("CreateBill").'</a></div>'; |
|
1626 | 1626 | } else { |
1627 | - print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="' . dol_escape_htmltag($langs->trans("DateIsNotEnough")) . '">' . $langs->trans("CreateBill") . '</a></div>'; |
|
1627 | + print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("DateIsNotEnough")).'">'.$langs->trans("CreateBill").'</a></div>'; |
|
1628 | 1628 | } |
1629 | 1629 | } |
1630 | 1630 | } else { |
1631 | - print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#">' . $langs->trans("CreateBill") . '</a></div>'; |
|
1631 | + print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#">'.$langs->trans("CreateBill").'</a></div>'; |
|
1632 | 1632 | } |
1633 | 1633 | } |
1634 | 1634 | |
1635 | 1635 | if ($usercancreate) { |
1636 | 1636 | if (empty($object->suspended)) { |
1637 | - print '<div class="inline-block divButAction"><a class="butActionDelete" href="' . $_SERVER["PHP_SELF"] . '?action=disable&id=' . $object->id . '&token=' . newToken() . '">' . $langs->trans("Disable") . '</a></div>'; |
|
1637 | + print '<div class="inline-block divButAction"><a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?action=disable&id='.$object->id.'&token='.newToken().'">'.$langs->trans("Disable").'</a></div>'; |
|
1638 | 1638 | } else { |
1639 | - print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?action=enable&id=' . $object->id . '&token=' . newToken() . '">' . $langs->trans("Enable") . '</a></div>'; |
|
1639 | + print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=enable&id='.$object->id.'&token='.newToken().'">'.$langs->trans("Enable").'</a></div>'; |
|
1640 | 1640 | } |
1641 | 1641 | } |
1642 | 1642 |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | * \ingroup webportal |
25 | 25 | * \brief Description and activation file for module WebPortal |
26 | 26 | */ |
27 | -include_once DOL_DOCUMENT_ROOT . '/core/modules/DolibarrModules.class.php'; |
|
27 | +include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; |
|
28 | 28 | |
29 | 29 | /** |
30 | 30 | * Description and activation class for module WebPortal |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | //$this->url_last_version = 'http://www.example.com/versionmodule.txt'; |
76 | 76 | |
77 | 77 | // Key used in llx_const table to save module status enabled/disabled (where WEBPORTAL is value of property name of module in uppercase) |
78 | - $this->const_name = 'MAIN_MODULE_' . strtoupper($this->name); |
|
78 | + $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); |
|
79 | 79 | |
80 | 80 | // Name of image file used for this module. |
81 | 81 | // If file is in theme/yourtheme/img directory under name object_pictovalue.png, use this->picto='pictovalue' |
@@ -264,7 +264,7 @@ discard block |
||
264 | 264 | $this->rights = array(); |
265 | 265 | $r = 0; |
266 | 266 | // Add here entries to declare new permissions |
267 | - $this->rights[$r][0] = $this->numero . sprintf("%02d", $r + 1); // Permission id (must not be already used) |
|
267 | + $this->rights[$r][0] = $this->numero.sprintf("%02d", $r + 1); // Permission id (must not be already used) |
|
268 | 268 | $this->rights[$r][1] = 'Administer users of the customer/partner webportal module'; // Permission label |
269 | 269 | $this->rights[$r][3] = 0; |
270 | 270 | $this->rights[$r][4] = 'write'; |
@@ -99,9 +99,9 @@ discard block |
||
99 | 99 | //print "before decoding $val\n"; |
100 | 100 | do { |
101 | 101 | $oldval = $val; |
102 | - $val = html_entity_decode($val, ENT_QUOTES | ENT_HTML5); // Decode ':', ''', '	', '&NewLine', ... |
|
102 | + $val = html_entity_decode($val, ENT_QUOTES | ENT_HTML5); // Decode ':', ''', '	', '&NewLine', ... |
|
103 | 103 | // Sometimes we have entities without the ; at end so html_entity_decode does not work but entities is still interpreted by browser. |
104 | - $val = preg_replace_callback('/&#(x?[0-9][0-9a-f]+;?)/i', function ($m) { |
|
104 | + $val = preg_replace_callback('/&#(x?[0-9][0-9a-f]+;?)/i', function($m) { |
|
105 | 105 | // Decode 'n', ... |
106 | 106 | return realCharForNumericEntities($m); |
107 | 107 | }, $val); |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | $inj += preg_match('/user\s*\(/i', $val); // avoid to use function user() or mysql_user() that return current database login |
141 | 141 | $inj += preg_match('/information_schema/i', $val); // avoid to use request that read information_schema database |
142 | 142 | $inj += preg_match('/<svg/i', $val); // <svg can be allowed in POST |
143 | - $inj += preg_match('/update[^&=\w].*set.+=/i', $val); // the [^&=\w] test is to avoid error when request is like action=update&...set... or &updatemodule=...set... |
|
143 | + $inj += preg_match('/update[^&=\w].*set.+=/i', $val); // the [^&=\w] test is to avoid error when request is like action=update&...set... or &updatemodule=...set... |
|
144 | 144 | $inj += preg_match('/union.+select/i', $val); |
145 | 145 | } |
146 | 146 | if ($type == 3) { |
@@ -370,7 +370,7 @@ discard block |
||
370 | 370 | session_set_cookie_params($sessioncookieparams); |
371 | 371 | } |
372 | 372 | session_name($sessionname); |
373 | - session_start(); // This call the open and read of session handler |
|
373 | + session_start(); // This call the open and read of session handler |
|
374 | 374 | //exit; // this exist generates a call to write and close |
375 | 375 | } |
376 | 376 | |
@@ -398,11 +398,11 @@ discard block |
||
398 | 398 | if (!$ok) { |
399 | 399 | if (session_id() && isset($_SESSION["dol_login"]) && $_SESSION["dol_login"] != $conf->global->MAIN_ONLY_LOGIN_ALLOWED) { |
400 | 400 | print 'Sorry, your application is offline.'."\n"; |
401 | - print 'You are logged with user "'.$_SESSION["dol_login"].'" and only administrator user "' . getDolGlobalString('MAIN_ONLY_LOGIN_ALLOWED').'" is allowed to connect for the moment.'."\n"; |
|
401 | + print 'You are logged with user "'.$_SESSION["dol_login"].'" and only administrator user "'.getDolGlobalString('MAIN_ONLY_LOGIN_ALLOWED').'" is allowed to connect for the moment.'."\n"; |
|
402 | 402 | $nexturl = DOL_URL_ROOT.'/user/logout.php?token='.newToken(); |
403 | 403 | print 'Please try later or <a href="'.$nexturl.'">click here to disconnect and change login user</a>...'."\n"; |
404 | 404 | } else { |
405 | - print 'Sorry, your application is offline. Only administrator user "' . getDolGlobalString('MAIN_ONLY_LOGIN_ALLOWED').'" is allowed to connect for the moment.'."\n"; |
|
405 | + print 'Sorry, your application is offline. Only administrator user "'.getDolGlobalString('MAIN_ONLY_LOGIN_ALLOWED').'" is allowed to connect for the moment.'."\n"; |
|
406 | 406 | $nexturl = DOL_URL_ROOT.'/'; |
407 | 407 | print 'Please try later or <a href="'.$nexturl.'">click here to change login user</a>...'."\n"; |
408 | 408 | } |
@@ -604,7 +604,7 @@ discard block |
||
604 | 604 | 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"; |
605 | 605 | 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"; |
606 | 606 | if (getDolGlobalString('MAIN_SECURITY_CSRF_WITH_TOKEN')) { |
607 | - print " instead of " . getDolGlobalString('MAIN_SECURITY_CSRF_WITH_TOKEN'); |
|
607 | + print " instead of ".getDolGlobalString('MAIN_SECURITY_CSRF_WITH_TOKEN'); |
|
608 | 608 | } |
609 | 609 | print " into setup).\n"; |
610 | 610 | } |
@@ -616,7 +616,7 @@ discard block |
||
616 | 616 | $sessiontokenforthisurl = (empty($_SESSION['token']) ? '' : $_SESSION['token']); |
617 | 617 | // TODO Get the sessiontokenforthisurl into an array of session token (one array per base URL so we can use the CSRF per page and we keep ability for several tabs per url in a browser) |
618 | 618 | if (GETPOSTISSET('token') && GETPOST('token') != 'notrequired' && GETPOST('token', 'alpha') != $sessiontokenforthisurl) { |
619 | - dol_syslog("--- Access to ".(empty($_SERVER["REQUEST_METHOD"]) ? '' : $_SERVER["REQUEST_METHOD"].' ').$_SERVER["PHP_SELF"]." refused by CSRF protection (invalid token), so we disable POST and some GET parameters - referrer=".(empty($_SERVER['HTTP_REFERER'])?'':$_SERVER['HTTP_REFERER']).", action=".GETPOST('action', 'aZ09').", _GET|POST['token']=".GETPOST('token', 'alpha'), LOG_WARNING); |
|
619 | + dol_syslog("--- Access to ".(empty($_SERVER["REQUEST_METHOD"]) ? '' : $_SERVER["REQUEST_METHOD"].' ').$_SERVER["PHP_SELF"]." refused by CSRF protection (invalid token), so we disable POST and some GET parameters - referrer=".(empty($_SERVER['HTTP_REFERER']) ? '' : $_SERVER['HTTP_REFERER']).", action=".GETPOST('action', 'aZ09').", _GET|POST['token']=".GETPOST('token', 'alpha'), LOG_WARNING); |
|
620 | 620 | //dol_syslog("_SESSION['token']=".$sessiontokenforthisurl, LOG_DEBUG); |
621 | 621 | // Do not output anything on standard output because this create problems when using the BACK button on browsers. So we just set a message into session. |
622 | 622 | if (!defined('NOTOKENRENEWAL')) { |
@@ -632,7 +632,7 @@ discard block |
||
632 | 632 | unset($_GET['action']); |
633 | 633 | unset($_GET['confirmmassaction']); |
634 | 634 | unset($_GET['massaction']); |
635 | - unset($_GET['token']); // TODO Make a redirect if we have a token in url to remove it ? |
|
635 | + unset($_GET['token']); // TODO Make a redirect if we have a token in url to remove it ? |
|
636 | 636 | if (isset($savid)) { |
637 | 637 | $_POST['id'] = ((int) $savid); |
638 | 638 | } |
@@ -799,7 +799,7 @@ discard block |
||
799 | 799 | |
800 | 800 | $allowedmethodtopostusername = 3; |
801 | 801 | if (defined('MAIN_AUTHENTICATION_POST_METHOD')) { |
802 | - $allowedmethodtopostusername = constant('MAIN_AUTHENTICATION_POST_METHOD'); // Note a value of 2 is not compatible with some authentication methods that put username as GET parameter |
|
802 | + $allowedmethodtopostusername = constant('MAIN_AUTHENTICATION_POST_METHOD'); // Note a value of 2 is not compatible with some authentication methods that put username as GET parameter |
|
803 | 803 | } |
804 | 804 | // TODO Remove use of $_COOKIE['login_dolibarr'] ? Replace $usertotest = with $usertotest = GETPOST("username", "alpha", $allowedmethodtopostusername); |
805 | 805 | $usertotest = (!empty($_COOKIE['login_dolibarr']) ? preg_replace('/[^a-zA-Z0-9_@\-\.]/', '', $_COOKIE['login_dolibarr']) : GETPOST("username", "alpha", $allowedmethodtopostusername)); |
@@ -922,7 +922,7 @@ discard block |
||
922 | 922 | if (!empty($_SERVER["HTTP_USER_AGENT"]) && $_SERVER["HTTP_USER_AGENT"] == 'securitytest') { |
923 | 923 | http_response_code(401); // It makes easier to understand if session was broken during security tests |
924 | 924 | } |
925 | - dol_loginfunction($langs, $conf, (!empty($mysoc) ? $mysoc : '')); // This include http headers |
|
925 | + dol_loginfunction($langs, $conf, (!empty($mysoc) ? $mysoc : '')); // This include http headers |
|
926 | 926 | } |
927 | 927 | exit; |
928 | 928 | } |
@@ -1268,7 +1268,7 @@ discard block |
||
1268 | 1268 | } else { |
1269 | 1269 | // We may have NOLOGIN set, but NOREQUIREUSER not |
1270 | 1270 | if (!empty($user) && method_exists($user, 'loadDefaultValues') && !defined('NODEFAULTVALUES')) { |
1271 | - $user->loadDefaultValues(); // Load default values for everybody (works even if $user->id = 0 |
|
1271 | + $user->loadDefaultValues(); // Load default values for everybody (works even if $user->id = 0 |
|
1272 | 1272 | } |
1273 | 1273 | } |
1274 | 1274 | |
@@ -1448,7 +1448,7 @@ discard block |
||
1448 | 1448 | |
1449 | 1449 | if (!empty(GETPOST('seteventmessages', 'alpha'))) { |
1450 | 1450 | $message = GETPOST('seteventmessages', 'alpha'); |
1451 | - $messages = explode(',', $message); |
|
1451 | + $messages = explode(',', $message); |
|
1452 | 1452 | foreach ($messages as $key => $msg) { |
1453 | 1453 | $tmp = explode(':', $msg); |
1454 | 1454 | setEventMessages($tmp[0], null, !empty($tmp[1]) ? $tmp[1] : 'mesgs'); |
@@ -1753,7 +1753,7 @@ discard block |
||
1753 | 1753 | |
1754 | 1754 | if (getDolGlobalString('THEME_ELDY_TOPMENU_BACK1')) { |
1755 | 1755 | // TODO: use auto theme color switch |
1756 | - print '<meta name="theme-color" content="rgb(' . getDolGlobalString('THEME_ELDY_TOPMENU_BACK1').')">'."\n"; |
|
1756 | + print '<meta name="theme-color" content="rgb('.getDolGlobalString('THEME_ELDY_TOPMENU_BACK1').')">'."\n"; |
|
1757 | 1757 | } |
1758 | 1758 | |
1759 | 1759 | // Auto refresh page |
@@ -2070,7 +2070,7 @@ discard block |
||
2070 | 2070 | print $head."\n"; |
2071 | 2071 | } |
2072 | 2072 | if (getDolGlobalString('MAIN_HTML_HEADER')) { |
2073 | - print getDolGlobalString('MAIN_HTML_HEADER') . "\n"; |
|
2073 | + print getDolGlobalString('MAIN_HTML_HEADER')."\n"; |
|
2074 | 2074 | } |
2075 | 2075 | |
2076 | 2076 | $parameters = array(); |
@@ -2847,7 +2847,7 @@ discard block |
||
2847 | 2847 | $langs->load(explode('@', $item['name'])[1]); |
2848 | 2848 | $dropDownQuickAddHtml .= ' |
2849 | 2849 | <a class="dropdown-item quickadd-item" href="'.DOL_URL_ROOT.$item['url'].'" title="'.$langs->trans(explode('@', $item['title'])[0]).'"> |
2850 | - '. img_picto('', $item['picto'], 'style="width:18px;"') . ' ' . $langs->trans(explode('@', $item['name'])[0]) . '</a> |
|
2850 | + '. img_picto('', $item['picto'], 'style="width:18px;"').' '.$langs->trans(explode('@', $item['name'])[0]).'</a> |
|
2851 | 2851 | '; |
2852 | 2852 | } |
2853 | 2853 | |
@@ -3695,7 +3695,7 @@ discard block |
||
3695 | 3695 | $forceping = GETPOST('forceping', 'alpha'); |
3696 | 3696 | if (($_SERVER["PHP_SELF"] == DOL_URL_ROOT.'/index.php') || $forceping) { |
3697 | 3697 | //print '<!-- instance_unique_id='.$conf->file->instance_unique_id.' MAIN_FIRST_PING_OK_ID='.$conf->global->MAIN_FIRST_PING_OK_ID.' -->'; |
3698 | - $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. |
|
3698 | + $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. |
|
3699 | 3699 | |
3700 | 3700 | if (!getDolGlobalString('MAIN_FIRST_PING_OK_DATE') |
3701 | 3701 | || (!empty($conf->file->instance_unique_id) && ($hash_unique_id != $conf->global->MAIN_FIRST_PING_OK_ID) && (getDolGlobalString('MAIN_FIRST_PING_OK_ID') != 'disabled')) |
@@ -1111,8 +1111,8 @@ discard block |
||
1111 | 1111 | $stringtoexport = str_replace('file=js/'.$website->ref.'/', "file=js/__WEBSITE_KEY__/", $stringtoexport); |
1112 | 1112 | $stringtoexport = str_replace('medias/image/'.$website->ref.'/', "medias/image/__WEBSITE_KEY__/", $stringtoexport); |
1113 | 1113 | $stringtoexport = str_replace('medias/js/'.$website->ref.'/', "medias/js/__WEBSITE_KEY__/", $stringtoexport); |
1114 | - $stringtoexport = str_replace('"image/'.$website->ref.'/', '"image/__WEBSITE_KEY__/', $stringtoexport); // When we have a link src="image/websiteref/file.png" into html content |
|
1115 | - $stringtoexport = str_replace('"/image/'.$website->ref.'/', '"/image/__WEBSITE_KEY__/', $stringtoexport); // When we have a link src="/image/websiteref/file.png" into html content |
|
1114 | + $stringtoexport = str_replace('"image/'.$website->ref.'/', '"image/__WEBSITE_KEY__/', $stringtoexport); // When we have a link src="image/websiteref/file.png" into html content |
|
1115 | + $stringtoexport = str_replace('"/image/'.$website->ref.'/', '"/image/__WEBSITE_KEY__/', $stringtoexport); // When we have a link src="/image/websiteref/file.png" into html content |
|
1116 | 1116 | $stringtoexport = str_replace('"js/'.$website->ref.'/', '"js/__WEBSITE_KEY__/', $stringtoexport); |
1117 | 1117 | $stringtoexport = str_replace('"/js/'.$website->ref.'/', '"/js/__WEBSITE_KEY__/', $stringtoexport); |
1118 | 1118 | |
@@ -1383,7 +1383,7 @@ discard block |
||
1383 | 1383 | foreach ($aliasesarray as $aliasshortcuttocreate) { |
1384 | 1384 | if (trim($aliasshortcuttocreate)) { |
1385 | 1385 | $filealias = $conf->website->dir_output.'/'.$object->ref.'/'.trim($aliasshortcuttocreate).'.php'; |
1386 | - $result = dolSavePageAlias($filealias, $object, $objectpagestatic); // This includes also a copy into sublanguage directories. |
|
1386 | + $result = dolSavePageAlias($filealias, $object, $objectpagestatic); // This includes also a copy into sublanguage directories. |
|
1387 | 1387 | if (!$result) { |
1388 | 1388 | $this->errors[] = 'Failed to write file '.basename($filealias); |
1389 | 1389 | $error++; |
@@ -1404,7 +1404,7 @@ discard block |
||
1404 | 1404 | $filetpl = $pathofwebsite.'/page'.$object->fk_default_home.'.tpl.php'; |
1405 | 1405 | } |
1406 | 1406 | $filewrapper = $pathofwebsite.'/wrapper.php'; |
1407 | - dolSaveIndexPage($pathofwebsite, $fileindex, $filetpl, $filewrapper, $object); // This includes also a version of index.php into sublanguage directories |
|
1407 | + dolSaveIndexPage($pathofwebsite, $fileindex, $filetpl, $filewrapper, $object); // This includes also a version of index.php into sublanguage directories |
|
1408 | 1408 | } |
1409 | 1409 | |
1410 | 1410 | if ($error) { |
@@ -1633,7 +1633,7 @@ discard block |
||
1633 | 1633 | |
1634 | 1634 | $sourcedir = $conf->website->dir_output."/".$website->ref; |
1635 | 1635 | |
1636 | - $fichierEtat = $sourcedir . '/filelist-lastwrite-doctemplates.txt'; |
|
1636 | + $fichierEtat = $sourcedir.'/filelist-lastwrite-doctemplates.txt'; |
|
1637 | 1637 | |
1638 | 1638 | // Get array with hash of files |
1639 | 1639 | $etatPrecedent = $this->checkPreviousState($fichierEtat); |
@@ -1654,7 +1654,7 @@ discard block |
||
1654 | 1654 | $modifications[] = $file; |
1655 | 1655 | } |
1656 | 1656 | |
1657 | - $etatPrecedent[$file['name']] = $hashActuel; // we store he new hash to record it later on disk. |
|
1657 | + $etatPrecedent[$file['name']] = $hashActuel; // we store he new hash to record it later on disk. |
|
1658 | 1658 | } |
1659 | 1659 | |
1660 | 1660 | // Replace modified files into the doctemplates directory. |
@@ -1687,11 +1687,11 @@ discard block |
||
1687 | 1687 | } |
1688 | 1688 | $getContentSource = file_get_contents($destdir.'/containers/'.$nomFichierModifie); |
1689 | 1689 | $nextpage = max($tabnumpage) + 1; |
1690 | - $chaineModifiee = preg_replace('/page\d+\.tpl\.php/', 'page' . $nextpage . '.tpl.php', $getContentSource); |
|
1690 | + $chaineModifiee = preg_replace('/page\d+\.tpl\.php/', 'page'.$nextpage.'.tpl.php', $getContentSource); |
|
1691 | 1691 | $write = file_put_contents($destdir.'/containers/'.$nomFichierModifie, $chaineModifiee); |
1692 | 1692 | if ($write !== false) { |
1693 | - if (!touch($destdir.'/containers/'."page" . $nextpage . ".tpl.php")) { |
|
1694 | - setEventMessages("Please check permission to create <b>page" . $nextpage . ".tpl.php</b> in template <b>".$website->name_template."</b>", null, 'errors'); |
|
1693 | + if (!touch($destdir.'/containers/'."page".$nextpage.".tpl.php")) { |
|
1694 | + setEventMessages("Please check permission to create <b>page".$nextpage.".tpl.php</b> in template <b>".$website->name_template."</b>", null, 'errors'); |
|
1695 | 1695 | } |
1696 | 1696 | $fileFounded = ''; |
1697 | 1697 | foreach ($arraySourcedir as $file) { |
@@ -1708,9 +1708,9 @@ discard block |
||
1708 | 1708 | if (!is_writable($file['fullname'])) { |
1709 | 1709 | dolChmod($file['fullname'], '0664'); |
1710 | 1710 | } |
1711 | - $diff = $this->showDifferences(file_get_contents($destdir.'/containers/'."page" . $nextpage . ".tpl.php"), file_get_contents($file['fullname']), array($nextpage,$this->extractNumberFromFilename($file['name']))); |
|
1711 | + $diff = $this->showDifferences(file_get_contents($destdir.'/containers/'."page".$nextpage.".tpl.php"), file_get_contents($file['fullname']), array($nextpage, $this->extractNumberFromFilename($file['name']))); |
|
1712 | 1712 | if ($diff != -1) { |
1713 | - $replace = $this->replaceLineUsingNum($destdir.'/containers/'."page" . $nextpage . ".tpl.php", $diff); |
|
1713 | + $replace = $this->replaceLineUsingNum($destdir.'/containers/'."page".$nextpage.".tpl.php", $diff); |
|
1714 | 1714 | if ($replace !== false) { |
1715 | 1715 | setEventMessages("Copy file <b>page".$nextpage.".tpl.php</b> in template <b>".$this->name_template."</b> with success", null, 'warnings'); |
1716 | 1716 | } |
@@ -1856,7 +1856,7 @@ discard block |
||
1856 | 1856 | */ |
1857 | 1857 | public function initFilesStatus($sourcedir) |
1858 | 1858 | { |
1859 | - $fichierEtat = $sourcedir . '/filelist-lastwrite-doctemplates.txt'; |
|
1859 | + $fichierEtat = $sourcedir.'/filelist-lastwrite-doctemplates.txt'; |
|
1860 | 1860 | |
1861 | 1861 | $etatPrecedent = $this->checkPreviousState($fichierEtat); |
1862 | 1862 | |
@@ -1956,7 +1956,7 @@ discard block |
||
1956 | 1956 | $destContent = file_get_contents($fileNeeded['fullname']); |
1957 | 1957 | |
1958 | 1958 | $numOfPageDest = $this->extractNumberFromFilename($fileNeeded['name']); |
1959 | - $differences = $this->showDifferences($destContent, $sourceContent, array($numOfPageDest,$numOfPageSource)); |
|
1959 | + $differences = $this->showDifferences($destContent, $sourceContent, array($numOfPageDest, $numOfPageSource)); |
|
1960 | 1960 | $differences['file_destination'] = $fileNeeded; |
1961 | 1961 | } |
1962 | 1962 | return $differences; |
@@ -1997,9 +1997,9 @@ discard block |
||
1997 | 1997 | $linefound = array(); |
1998 | 1998 | $countNumPage = count($exceptNumPge); |
1999 | 1999 | |
2000 | - for ($i = 0;$i< $countNumPage; $i++) { |
|
2001 | - $linefound[$i]['meta'] = '/content="' . preg_quote($exceptNumPge[$i], '/') . '" \/>/'; |
|
2002 | - $linefound[$i]['output'] = '/dolWebsiteOutput\(\$tmp, "html", ' . preg_quote($exceptNumPge[$i], '/') . '\);/'; |
|
2000 | + for ($i = 0; $i < $countNumPage; $i++) { |
|
2001 | + $linefound[$i]['meta'] = '/content="'.preg_quote($exceptNumPge[$i], '/').'" \/>/'; |
|
2002 | + $linefound[$i]['output'] = '/dolWebsiteOutput\(\$tmp, "html", '.preg_quote($exceptNumPge[$i], '/').'\);/'; |
|
2003 | 2003 | } |
2004 | 2004 | |
2005 | 2005 | $maxLines = max(count($lines1), count($lines2)); |
@@ -2021,13 +2021,13 @@ discard block |
||
2021 | 2021 | if ($lineContent1 !== $lineContent2) { |
2022 | 2022 | if (isset($lines1[$lineNum]) && !isset($lines2[$lineNum])) { |
2023 | 2023 | // Ligne deleted de la source |
2024 | - $diff["Supprimée à la ligne " . ($lineNum + 1)] = $lineContent1; |
|
2024 | + $diff["Supprimée à la ligne ".($lineNum + 1)] = $lineContent1; |
|
2025 | 2025 | } elseif (!isset($lines1[$lineNum]) && isset($lines2[$lineNum])) { |
2026 | 2026 | // Nouvelle ligne added dans la destination |
2027 | - $diff["Ajoutée à la ligne " . ($lineNum + 1)] = $lineContent2; |
|
2027 | + $diff["Ajoutée à la ligne ".($lineNum + 1)] = $lineContent2; |
|
2028 | 2028 | } else { |
2029 | 2029 | // Différence found it |
2030 | - $diff["Modifiée à la ligne " . ($lineNum + 1)] = $lineContent2; |
|
2030 | + $diff["Modifiée à la ligne ".($lineNum + 1)] = $lineContent2; |
|
2031 | 2031 | } |
2032 | 2032 | } |
2033 | 2033 | } |
@@ -2040,7 +2040,7 @@ discard block |
||
2040 | 2040 | |
2041 | 2041 | $pairesRemplacement = array(); |
2042 | 2042 | if (!empty($linesShouldnNotChange)) { |
2043 | - $i =0; |
|
2043 | + $i = 0; |
|
2044 | 2044 | foreach ($linesShouldnNotChange as $numLigne => $ligneRemplacement) { |
2045 | 2045 | if (isset($linesShouldnChange[$numLigne])) { |
2046 | 2046 | $pairesRemplacement[$ligneRemplacement] = $linesShouldnChange[$numLigne]; |
@@ -2077,7 +2077,7 @@ discard block |
||
2077 | 2077 | $userId = fileowner($desfFile); |
2078 | 2078 | if ($userId !== false) { |
2079 | 2079 | // Obtain user information from the ID |
2080 | - if (function_exists('posix_getpwuid')&& function_exists('posix_getpwuid')) { |
|
2080 | + if (function_exists('posix_getpwuid') && function_exists('posix_getpwuid')) { |
|
2081 | 2081 | $uid = posix_geteuid(); |
2082 | 2082 | $userInfoM = posix_getpwuid($uid); |
2083 | 2083 |
@@ -153,8 +153,8 @@ discard block |
||
153 | 153 | public $posxlabel; |
154 | 154 | public $posxup; |
155 | 155 | public $posxref; |
156 | - public $posxpicture; // For picture |
|
157 | - public $posxdesc; // For description |
|
156 | + public $posxpicture; // For picture |
|
157 | + public $posxdesc; // For description |
|
158 | 158 | public $posxqty; |
159 | 159 | public $posxpuht; |
160 | 160 | public $posxtva; |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | 'myuser_email'=>$user->email, |
214 | 214 | 'myuser_logo'=>$logotouse, |
215 | 215 | 'myuser_job'=>$user->job, |
216 | - 'myuser_web'=>'', // url not exist in $user object |
|
216 | + 'myuser_web'=>'', // url not exist in $user object |
|
217 | 217 | 'myuser_birth'=>dol_print_date($user->birth, 'day', 'gmt'), |
218 | 218 | 'myuser_dateemployment'=>dol_print_date($user->dateemployment, 'day', 'tzuser'), |
219 | 219 | 'myuser_dateemploymentend'=>dol_print_date($user->dateemploymentend, 'day', 'tzuser'), |
@@ -529,7 +529,7 @@ discard block |
||
529 | 529 | |
530 | 530 | if (get_class($object) == 'CommandeFournisseur') { |
531 | 531 | /* @var $object CommandeFournisseur*/ |
532 | - $object->date_validation = $object->date_valid; |
|
532 | + $object->date_validation = $object->date_valid; |
|
533 | 533 | $object->date_commande = $object->date; |
534 | 534 | } |
535 | 535 | $resarray = array( |
@@ -615,10 +615,10 @@ discard block |
||
615 | 615 | $resarray[$array_key.'_bank_bic'] = (empty($bank_account) ? '' : $bank_account->bic); |
616 | 616 | $resarray[$array_key.'_bank_label'] = (empty($bank_account) ? '' : $bank_account->label); |
617 | 617 | $resarray[$array_key.'_bank_number'] = (empty($bank_account) ? '' : $bank_account->number); |
618 | - $resarray[$array_key.'_bank_proprio'] =(empty($bank_account) ? '' : $bank_account->proprio); |
|
619 | - $resarray[$array_key.'_bank_address'] =(empty($bank_account) ? '' : $bank_account->address); |
|
620 | - $resarray[$array_key.'_bank_state'] =(empty($bank_account) ? '' : $bank_account->state); |
|
621 | - $resarray[$array_key.'_bank_country'] =(empty($bank_account) ? '' : $bank_account->country); |
|
618 | + $resarray[$array_key.'_bank_proprio'] = (empty($bank_account) ? '' : $bank_account->proprio); |
|
619 | + $resarray[$array_key.'_bank_address'] = (empty($bank_account) ? '' : $bank_account->address); |
|
620 | + $resarray[$array_key.'_bank_state'] = (empty($bank_account) ? '' : $bank_account->state); |
|
621 | + $resarray[$array_key.'_bank_country'] = (empty($bank_account) ? '' : $bank_account->country); |
|
622 | 622 | } |
623 | 623 | |
624 | 624 | if (method_exists($object, 'getTotalDiscount') && in_array(get_class($object), array('Propal', 'Proposal', 'Commande', 'Facture', 'SupplierProposal', 'CommandeFournisseur', 'FactureFournisseur'))) { |
@@ -641,7 +641,7 @@ discard block |
||
641 | 641 | $resarray[$array_key.'_project_date_start'] = dol_print_date($object->project->date_start, 'day'); |
642 | 642 | $resarray[$array_key.'_project_date_end'] = dol_print_date($object->project->date_end, 'day'); |
643 | 643 | } else { // empty replacement |
644 | - $resarray[$array_key.'_project_ref'] =''; |
|
644 | + $resarray[$array_key.'_project_ref'] = ''; |
|
645 | 645 | $resarray[$array_key.'_project_title'] = ''; |
646 | 646 | $resarray[$array_key.'_project_description'] = ''; |
647 | 647 | $resarray[$array_key.'_project_date_start'] = ''; |
@@ -1478,7 +1478,7 @@ discard block |
||
1478 | 1478 | |
1479 | 1479 | if (!empty($fields)) { |
1480 | 1480 | // Sort extrafields by rank |
1481 | - uasort($fields, function ($a, $b) { |
|
1481 | + uasort($fields, function($a, $b) { |
|
1482 | 1482 | return ($a->rank > $b->rank) ? 1 : -1; |
1483 | 1483 | }); |
1484 | 1484 |