@@ -106,7 +106,7 @@ |
||
106 | 106 | $produit->tva_tx = "20.0"; |
107 | 107 | $ret=$produit->create($user); |
108 | 108 | if ($ret < 0) { |
109 | - print "Error $ret - ".$produit->error."\n"; |
|
109 | + print "error $ret - ".$produit->error."\n"; |
|
110 | 110 | } else { |
111 | 111 | print " OK with ref ".$produit->ref."\n"; |
112 | 112 | } |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | |
27 | 27 | $sapi_type = php_sapi_name(); |
28 | 28 | $script_file = basename(__FILE__); |
29 | -$path=dirname(__FILE__).'/'; |
|
29 | +$path = dirname(__FILE__).'/'; |
|
30 | 30 | |
31 | 31 | // Test si mode batch |
32 | 32 | $sapi_type = php_sapi_name(); |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | |
38 | 38 | // Recupere root dolibarr |
39 | 39 | //$path=preg_replace('/generate-produit.php/i','',$_SERVER["PHP_SELF"]); |
40 | -require __DIR__. '/../../htdocs/master.inc.php'; |
|
40 | +require __DIR__.'/../../htdocs/master.inc.php'; |
|
41 | 41 | include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; |
42 | 42 | include_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; |
43 | 43 | include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; |
@@ -53,8 +53,8 @@ discard block |
||
53 | 53 | define('GEN_NUMBER_PRODUIT', $argv[1] ?? 100); |
54 | 54 | |
55 | 55 | |
56 | -$ret=$user->fetch('', 'admin'); |
|
57 | -if (! $ret > 0) { |
|
56 | +$ret = $user->fetch('', 'admin'); |
|
57 | +if (!$ret > 0) { |
|
58 | 58 | print 'A user with login "admin" and all permissions must be created to use this script.'."\n"; |
59 | 59 | exit; |
60 | 60 | } |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | |
63 | 63 | |
64 | 64 | $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."product"; $productsid = array(); |
65 | -$resql=$db->query($sql); |
|
65 | +$resql = $db->query($sql); |
|
66 | 66 | if ($resql) { |
67 | 67 | $num = $db->num_rows($resql); |
68 | 68 | $i = 0; |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | } |
75 | 75 | |
76 | 76 | $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."societe"; $societesid = array(); |
77 | -$resql=$db->query($sql); |
|
77 | +$resql = $db->query($sql); |
|
78 | 78 | if ($resql) { |
79 | 79 | $num = $db->num_rows($resql); |
80 | 80 | $i = 0; |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | } |
89 | 89 | |
90 | 90 | $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."commande"; $commandesid = array(); |
91 | -$resql=$db->query($sql); |
|
91 | +$resql = $db->query($sql); |
|
92 | 92 | if ($resql) { |
93 | 93 | $num = $db->num_rows($resql); |
94 | 94 | $i = 0; |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | $produit->description = 'Description '.time().$s; |
114 | 114 | $produit->price = mt_rand(1, 999.99); |
115 | 115 | $produit->tva_tx = "20.0"; |
116 | - $ret=$produit->create($user); |
|
116 | + $ret = $produit->create($user); |
|
117 | 117 | if ($ret < 0) { |
118 | 118 | print "Error $ret - ".$produit->error."\n"; |
119 | 119 | } else { |
@@ -91,7 +91,7 @@ |
||
91 | 91 | accessforbidden(); |
92 | 92 | } |
93 | 93 | |
94 | -$permissiontoadd = $user->rights->ticket->write; // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles |
|
94 | +$permissiontoadd = $user->rights->ticket->write; // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles |
|
95 | 95 | |
96 | 96 | |
97 | 97 | /* |
@@ -349,7 +349,7 @@ discard block |
||
349 | 349 | // Output page |
350 | 350 | // -------------------------------------------------------------------- |
351 | 351 | |
352 | -llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'bodyforlist'); // Can use also classforhorizontalscrolloftabs instead of bodyforlist for no horizontal scroll |
|
352 | +llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'bodyforlist'); // Can use also classforhorizontalscrolloftabs instead of bodyforlist for no horizontal scroll |
|
353 | 353 | |
354 | 354 | $arrayofselected = is_array($toselect) ? $toselect : array(); |
355 | 355 | |
@@ -637,7 +637,7 @@ discard block |
||
637 | 637 | $userstatic->login = $obj->login; |
638 | 638 | $userstatic->email = $obj->email; |
639 | 639 | $userstatic->socid = $obj->fk_soc; |
640 | - $userstatic->statut = $obj->status; // deprecated |
|
640 | + $userstatic->statut = $obj->status; // deprecated |
|
641 | 641 | $userstatic->status = $obj->status; |
642 | 642 | $userstatic->photo = $obj->photo; |
643 | 643 |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | if ($user->socid > 0) { |
103 | 103 | accessforbidden(); |
104 | 104 | } |
105 | -$isdraft = (($object->status== $object::STATUS_DRAFT) ? 1 : 0); |
|
105 | +$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); |
|
106 | 106 | $result = restrictedArea($user, 'eventorganization', $object->id, '', '', 'fk_soc', 'id', $isdraft); |
107 | 107 | |
108 | 108 | if (!$permissiontoread) { |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | $projectstatic->fetch_thirdparty(); |
142 | 142 | } |
143 | 143 | |
144 | -$withProjectUrl=''; |
|
144 | +$withProjectUrl = ''; |
|
145 | 145 | $object->project = clone $projectstatic; |
146 | 146 | |
147 | 147 | if (!empty($withproject)) { |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | if ($user->socid > 0) { |
98 | 98 | accessforbidden(); |
99 | 99 | } |
100 | -$isdraft = (($object->status== $object::STATUS_DRAFT) ? 1 : 0); |
|
100 | +$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); |
|
101 | 101 | $result = restrictedArea($user, 'eventorganization', $object->id, '', '', 'fk_soc', 'id', $isdraft); |
102 | 102 | |
103 | 103 | if (!$permissiontoread) { |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | $projectstatic->fetch_thirdparty(); |
187 | 187 | } |
188 | 188 | |
189 | -$withProjectUrl=''; |
|
189 | +$withProjectUrl = ''; |
|
190 | 190 | $object->project = clone $projectstatic; |
191 | 191 | |
192 | 192 | if (!empty($withproject)) { |
@@ -571,7 +571,7 @@ discard block |
||
571 | 571 | //$keyforbreak='fieldkeytoswitchonsecondcolumn'; // We change column just before this field |
572 | 572 | //unset($object->fields['fk_project']); // Hide field already shown in banner |
573 | 573 | //unset($object->fields['fk_soc']); // Hide field already shown in banner |
574 | - $keyforbreak='num_vote'; |
|
574 | + $keyforbreak = 'num_vote'; |
|
575 | 575 | |
576 | 576 | include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php'; |
577 | 577 | |
@@ -643,12 +643,12 @@ discard block |
||
643 | 643 | |
644 | 644 | $object->fetchObjectLinked(); |
645 | 645 | |
646 | - if (is_array($object->linkedObjects) && count($object->linkedObjects)>0 && array_key_exists("facture", $object->linkedObjects)) { |
|
646 | + if (is_array($object->linkedObjects) && count($object->linkedObjects) > 0 && array_key_exists("facture", $object->linkedObjects)) { |
|
647 | 647 | foreach ($object->linkedObjects["facture"] as $fac) { |
648 | 648 | if (empty($fac->paye)) { |
649 | 649 | $key = 'paymentlink_'.$fac->id; |
650 | 650 | |
651 | - print img_picto('', 'globe').' <span class="opacitymedium">'.$langs->trans("ToOfferALinkForOnlinePayment", $langs->transnoentitiesnoconv('Online')) . ' '. $fac->ref.'</span><br>'; |
|
651 | + print img_picto('', 'globe').' <span class="opacitymedium">'.$langs->trans("ToOfferALinkForOnlinePayment", $langs->transnoentitiesnoconv('Online')).' '.$fac->ref.'</span><br>'; |
|
652 | 652 | |
653 | 653 | $sourcetouse = 'boothlocation'; |
654 | 654 | $reftouse = $fac->id; |
@@ -122,9 +122,9 @@ discard block |
||
122 | 122 | require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; |
123 | 123 | |
124 | 124 | $action = GETPOST('action', 'aZ09'); |
125 | -$original_file = GETPOST('file', 'alphanohtml'); // Do not use urldecode here ($_GET are already decoded by PHP). |
|
126 | -$hashp = GETPOST('hashp', 'aZ09', 1); // Must be read only by GET |
|
127 | -$modulepart = GETPOST('modulepart', 'alpha', 1); // Must be read only by GET |
|
125 | +$original_file = GETPOST('file', 'alphanohtml'); // Do not use urldecode here ($_GET are already decoded by PHP). |
|
126 | +$hashp = GETPOST('hashp', 'aZ09', 1); // Must be read only by GET |
|
127 | +$modulepart = GETPOST('modulepart', 'alpha', 1); // Must be read only by GET |
|
128 | 128 | $urlsource = GETPOST('urlsource', 'alpha'); |
129 | 129 | $entity = (GETPOST('entity', 'int') ? GETPOST('entity', 'int') : $conf->entity); |
130 | 130 | |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | if (empty($dolibarr_nocache)) { |
159 | 159 | header('Cache-Control: max-age=3600, public, must-revalidate'); |
160 | 160 | header('Pragma: cache'); // This is to avoid to have Pragma: no-cache set by proxy or web server |
161 | - header('Expires: '.gmdate('D, d M Y H:i:s', time() + 3600).' GMT'); // This is to avoid to have Expires set by proxy or web server |
|
161 | + header('Expires: '.gmdate('D, d M Y H:i:s', time() + 3600).' GMT'); // This is to avoid to have Expires set by proxy or web server |
|
162 | 162 | //header('Expires: '.strtotime('+1 hour'); |
163 | 163 | } else { |
164 | 164 | header('Cache-Control: no-cache'); |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | } |
216 | 216 | |
217 | 217 | // Security: Delete string ../ or ..\ into $original_file |
218 | -$original_file = preg_replace('/\.\.+/', '..', $original_file); // Replace '... or more' with '..' |
|
218 | +$original_file = preg_replace('/\.\.+/', '..', $original_file); // Replace '... or more' with '..' |
|
219 | 219 | $original_file = str_replace('../', '/', $original_file); |
220 | 220 | $original_file = str_replace('..\\', '/', $original_file); |
221 | 221 |
@@ -45,11 +45,11 @@ discard block |
||
45 | 45 | if (!defined("NOSESSION")) { |
46 | 46 | define("NOSESSION", '1'); |
47 | 47 | } |
48 | -if (! defined('NOREQUIREHTML')) { |
|
49 | - define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php |
|
48 | +if (!defined('NOREQUIREHTML')) { |
|
49 | + define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php |
|
50 | 50 | } |
51 | -if (! defined('NOREQUIREAJAX')) { |
|
52 | - define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library |
|
51 | +if (!defined('NOREQUIREAJAX')) { |
|
52 | + define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | |
64 | 64 | $mtid = GETPOST('mtid'); |
65 | 65 | $email = GETPOST('email'); |
66 | -$tag = GETPOST('tag'); // To retreive the emailing, and recipient |
|
66 | +$tag = GETPOST('tag'); // To retreive the emailing, and recipient |
|
67 | 67 | $unsuscrib = GETPOST('unsuscrib'); |
68 | 68 | $securitykey = GETPOST('securitykey'); |
69 | 69 |
@@ -354,7 +354,7 @@ discard block |
||
354 | 354 | } |
355 | 355 | } |
356 | 356 | if (empty($nbemail)) { |
357 | - $nbemail .= ' '.img_warning($langs->trans('ToAddRecipientsChooseHere'));//.' <span class="warning">'.$langs->trans("NoTargetYet").'</span>'; |
|
357 | + $nbemail .= ' '.img_warning($langs->trans('ToAddRecipientsChooseHere')); //.' <span class="warning">'.$langs->trans("NoTargetYet").'</span>'; |
|
358 | 358 | } |
359 | 359 | if ($text) { |
360 | 360 | print $form->textwithpicto($nbemail, $text, 1, 'warning'); |
@@ -417,7 +417,7 @@ discard block |
||
417 | 417 | print '</div>'; |
418 | 418 | print '</div>'; |
419 | 419 | print '<div class="tagtd"> </div>'; |
420 | - print '</div>'; // End tr |
|
420 | + print '</div>'; // End tr |
|
421 | 421 | |
422 | 422 | clearstatcache(); |
423 | 423 | |
@@ -488,12 +488,12 @@ discard block |
||
488 | 488 | } |
489 | 489 | print img_object($langs->trans("EmailingTargetSelector").': '.get_class($obj), $obj->picto, 'class="valignmiddle width25 size15x"'); |
490 | 490 | print '</div>'; |
491 | - print '<div class="tagtd valignmiddle">'; // style="height: 4em" |
|
491 | + print '<div class="tagtd valignmiddle">'; // style="height: 4em" |
|
492 | 492 | print $obj->getDesc(); |
493 | 493 | print '</div>'; |
494 | 494 | |
495 | 495 | try { |
496 | - $obj->evenunsubscribe = $object->evenunsubscribe; // Set flag to include/exclude email that has opt-out. |
|
496 | + $obj->evenunsubscribe = $object->evenunsubscribe; // Set flag to include/exclude email that has opt-out. |
|
497 | 497 | |
498 | 498 | $nbofrecipient = $obj->getNbOfRecipients(''); |
499 | 499 | } catch (Exception $e) { |
@@ -546,7 +546,7 @@ discard block |
||
546 | 546 | $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook |
547 | 547 | print $hookmanager->resPrint; |
548 | 548 | |
549 | - print '</div>'; // End table |
|
549 | + print '</div>'; // End table |
|
550 | 550 | print '</div>'; |
551 | 551 | |
552 | 552 | print '<br>'; |
@@ -75,10 +75,10 @@ |
||
75 | 75 | public function getRenderer() |
76 | 76 | { |
77 | 77 | $renderer = parent::getJavascriptRenderer(DOL_URL_ROOT.'/includes/maximebf/debugbar/src/DebugBar/Resources'); |
78 | - $renderer->disableVendor('jquery'); // We already have jquery loaded globally by the main.inc.php |
|
79 | - $renderer->disableVendor('fontawesome'); // We already have fontawesome loaded globally by the main.inc.php |
|
80 | - $renderer->disableVendor('highlightjs'); // We don't need this |
|
81 | - $renderer->setEnableJqueryNoConflict(false); // We don't need no conflict |
|
78 | + $renderer->disableVendor('jquery'); // We already have jquery loaded globally by the main.inc.php |
|
79 | + $renderer->disableVendor('fontawesome'); // We already have fontawesome loaded globally by the main.inc.php |
|
80 | + $renderer->disableVendor('highlightjs'); // We don't need this |
|
81 | + $renderer->setEnableJqueryNoConflict(false); // We don't need no conflict |
|
82 | 82 | |
83 | 83 | return $renderer; |
84 | 84 | } |