@@ -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 | } |
@@ -94,7 +94,7 @@ |
||
| 94 | 94 | } |
| 95 | 95 | $result = restrictedArea($user, 'contact', $id, 'socpeople&societe', '', '', 'rowid', 0); // If we create a contact with no company (shared contacts), no check on write permission |
| 96 | 96 | |
| 97 | -$permissiontoadd = $user->hasRight('societe', 'contact', 'creer'); // Used by the include of actions_dellink.inc.php |
|
| 97 | +$permissiontoadd = $user->hasRight('societe', 'contact', 'creer'); // Used by the include of actions_dellink.inc.php |
|
| 98 | 98 | |
| 99 | 99 | |
| 100 | 100 | /* |
@@ -197,7 +197,7 @@ |
||
| 197 | 197 | $maxfilesizearray = getMaxFileSizeArray(); |
| 198 | 198 | $maxmin = $maxfilesizearray['maxmin']; |
| 199 | 199 | if ($maxmin > 0) { |
| 200 | - print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
| 200 | + print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
| 201 | 201 | } |
| 202 | 202 | print '<input type="file" class="flat" name="photo" id="photoinput">'; |
| 203 | 203 | print '</td></tr>'; |
@@ -61,10 +61,10 @@ discard block |
||
| 61 | 61 | */ |
| 62 | 62 | public $picto = 'inventory'; |
| 63 | 63 | |
| 64 | - const STATUS_DRAFT = 0; // Draft |
|
| 65 | - const STATUS_VALIDATED = 1; // Inventory is in process |
|
| 66 | - const STATUS_RECORDED = 2; // Inventory is finisged. Stock movement has been recorded. |
|
| 67 | - const STATUS_CANCELED = 9; // Canceled |
|
| 64 | + const STATUS_DRAFT = 0; // Draft |
|
| 65 | + const STATUS_VALIDATED = 1; // Inventory is in process |
|
| 66 | + const STATUS_RECORDED = 2; // Inventory is finisged. Stock movement has been recorded. |
|
| 67 | + const STATUS_CANCELED = 9; // Canceled |
|
| 68 | 68 | |
| 69 | 69 | /** |
| 70 | 70 | * 'type' field format ('integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter]]', 'sellist:TableName:LabelFieldName[:KeyFieldName[:KeyFieldParent[:Filter]]]', 'varchar(x)', 'double(24,8)', 'real', 'price', 'text', 'text:none', 'html', 'date', 'datetime', 'timestamp', 'duration', 'mail', 'phone', 'url', 'password') |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | 'fk_warehouse' => array('type'=>'integer:Entrepot:product/stock/class/entrepot.class.php', 'label'=>'Warehouse', 'visible'=>1, 'enabled'=>1, 'position'=>30, 'index'=>1, 'help'=>'InventoryForASpecificWarehouse', 'picto'=>'stock', 'css'=>'minwidth300 maxwidth500 widthcentpercentminusx', 'csslist'=>'tdoverflowmax150'), |
| 105 | 105 | 'fk_product' => array('type'=>'integer:Product:product/class/product.class.php', 'label'=>'Product', 'get_name_url_params' => '0::0:-1:0::1', 'visible'=>1, 'enabled'=>1, 'position'=>32, 'index'=>1, 'help'=>'InventoryForASpecificProduct', 'picto'=>'product', 'css'=>'minwidth300 maxwidth500 widthcentpercentminusx', 'csslist'=>'tdoverflowmax150'), |
| 106 | 106 | 'categories_product' => array('type'=>'chkbxlst:categorie:label:rowid::type=0:0:', 'label'=>'OrProductsWithCategories', 'visible'=>3, 'enabled'=>1, 'position'=>33, 'help'=>'', 'picto'=>'category', 'css'=>'minwidth300 maxwidth500 widthcentpercentminusx'), |
| 107 | - 'date_inventory' => array('type'=>'date', 'label'=>'DateValue', 'visible'=>1, 'enabled'=>'$conf->global->STOCK_INVENTORY_ADD_A_VALUE_DATE', 'position'=>35, 'csslist'=>'nowraponall'), // This date is not used so disabled by default. |
|
| 107 | + 'date_inventory' => array('type'=>'date', 'label'=>'DateValue', 'visible'=>1, 'enabled'=>'$conf->global->STOCK_INVENTORY_ADD_A_VALUE_DATE', 'position'=>35, 'csslist'=>'nowraponall'), // This date is not used so disabled by default. |
|
| 108 | 108 | 'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>500, 'csslist'=>'nowraponall'), |
| 109 | 109 | 'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>501, 'csslist'=>'nowraponall'), |
| 110 | 110 | 'date_validation' => array('type'=>'datetime', 'label'=>'DateValidation', 'visible'=>-2, 'enabled'=>1, 'position'=>502, 'csslist'=>'nowraponall'), |
@@ -763,10 +763,10 @@ discard block |
||
| 763 | 763 | public function getChildWarehouse($id, &$TChildWarehouse) |
| 764 | 764 | { |
| 765 | 765 | $sql = 'SELECT rowid FROM '.MAIN_DB_PREFIX.'entrepot'; |
| 766 | - $sql.= ' WHERE fk_parent='.(int) $id; |
|
| 767 | - $sql.= ' ORDER BY rowid'; |
|
| 766 | + $sql .= ' WHERE fk_parent='.(int) $id; |
|
| 767 | + $sql .= ' ORDER BY rowid'; |
|
| 768 | 768 | $resql = $this->db->query($sql); |
| 769 | - if ($resql && $this->db->num_rows($resql)>0) { |
|
| 769 | + if ($resql && $this->db->num_rows($resql) > 0) { |
|
| 770 | 770 | while ($obj = $this->db->fetch_object($resql)) { |
| 771 | 771 | $TChildWarehouse[] = $obj->rowid; |
| 772 | 772 | $this->getChildWarehouse($obj->rowid, $TChildWarehouse); |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | |
| 74 | 74 | // Default sort order (if not yet defined by previous GETPOST) |
| 75 | 75 | if (!$sortfield) { |
| 76 | - reset($object->fields); // Reset is required to avoid key() to return null. |
|
| 76 | + reset($object->fields); // Reset is required to avoid key() to return null. |
|
| 77 | 77 | $sortfield = "t.".key($object->fields); // Set here default search field. By default 1st field in definition. |
| 78 | 78 | } |
| 79 | 79 | if (!$sortorder) { |
@@ -285,7 +285,7 @@ discard block |
||
| 285 | 285 | if ($searchCategoryProductOperator == 0) { |
| 286 | 286 | $searchCategoryProductSqlList[] = " EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck WHERE p.rowid = ck.fk_product AND ck.fk_categorie = ".((int) $searchCategoryProduct).")"; |
| 287 | 287 | } else { |
| 288 | - $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryProduct); |
|
| 288 | + $listofcategoryid .= ($listofcategoryid ? ', ' : '').((int) $searchCategoryProduct); |
|
| 289 | 289 | } |
| 290 | 290 | } |
| 291 | 291 | } |
@@ -374,7 +374,7 @@ discard block |
||
| 374 | 374 | // Output page |
| 375 | 375 | // -------------------------------------------------------------------- |
| 376 | 376 | |
| 377 | -llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'bodyforlist'); // Can use also classforhorizontalscrolloftabs instead of bodyforlist for no horizontal scroll |
|
| 377 | +llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'bodyforlist'); // Can use also classforhorizontalscrolloftabs instead of bodyforlist for no horizontal scroll |
|
| 378 | 378 | |
| 379 | 379 | $arrayofselected = is_array($toselect) ? $toselect : array(); |
| 380 | 380 | |
@@ -484,7 +484,7 @@ discard block |
||
| 484 | 484 | $categoriesProductArr[-2] = '- '.$langs->trans('NotCategorized').' -'; |
| 485 | 485 | $moreforfilter .= Form::multiselectarray('search_category_product_list', $categoriesProductArr, $searchCategoryProductList, 0, 0, 'minwidth300', 0, 0, '', 'category', $tmptitle); |
| 486 | 486 | $moreforfilter .= ' <input type="checkbox" class="valignmiddle" id="search_category_product_operator" name="search_category_product_operator" value="1"'.($searchCategoryProductOperator == 1 ? ' checked="checked"' : '').'/>'; |
| 487 | - $moreforfilter .= $form->textwithpicto('', $langs->trans('UseOrOperatorForCategories') . ' : ' . $tmptitle, 1, 'help', '', 0, 2, 'tooltip_cat_pro'); // Tooltip on click |
|
| 487 | + $moreforfilter .= $form->textwithpicto('', $langs->trans('UseOrOperatorForCategories').' : '.$tmptitle, 1, 'help', '', 0, 2, 'tooltip_cat_pro'); // Tooltip on click |
|
| 488 | 488 | $moreforfilter .= '</div>'; |
| 489 | 489 | } |
| 490 | 490 | |
@@ -596,7 +596,7 @@ discard block |
||
| 596 | 596 | } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('id', 'rowid', 'ref', 'status')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) { |
| 597 | 597 | $cssforfield .= ($cssforfield ? ' ' : '').'right'; |
| 598 | 598 | } |
| 599 | - $cssforfield = preg_replace('/small\s*/', '', $cssforfield); // the 'small' css must not be used for the title label |
|
| 599 | + $cssforfield = preg_replace('/small\s*/', '', $cssforfield); // the 'small' css must not be used for the title label |
|
| 600 | 600 | if (!empty($arrayfields['t.'.$key]['checked'])) { |
| 601 | 601 | print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($cssforfield ? 'class="'.$cssforfield.'"' : ''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.' ' : ''), 0, (empty($val['helplist']) ? '' : $val['helplist']))."\n"; |
| 602 | 602 | $totalarray['nbfield']++; |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | |
| 190 | 190 | $sql = "SELECT t.rowid, t.ref, t.ref_ext"; |
| 191 | 191 | $sql .= " FROM ".$this->db->prefix()."product as t"; |
| 192 | - $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_extrafields AS ef ON ef.fk_object = t.rowid"; // So we will be able to filter on extrafields |
|
| 192 | + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_extrafields AS ef ON ef.fk_object = t.rowid"; // So we will be able to filter on extrafields |
|
| 193 | 193 | if ($category > 0) { |
| 194 | 194 | $sql .= ", ".$this->db->prefix()."categorie_product as c"; |
| 195 | 195 | } |
@@ -229,7 +229,7 @@ discard block |
||
| 229 | 229 | } |
| 230 | 230 | |
| 231 | 231 | //this query will return total products with the filters given |
| 232 | - $sqlTotals = str_replace('SELECT t.rowid, t.ref, t.ref_ext', 'SELECT count(t.rowid) as total', $sql); |
|
| 232 | + $sqlTotals = str_replace('SELECT t.rowid, t.ref, t.ref_ext', 'SELECT count(t.rowid) as total', $sql); |
|
| 233 | 233 | |
| 234 | 234 | $sql .= $this->db->order($sortfield, $sortorder); |
| 235 | 235 | if ($limit) { |
@@ -292,7 +292,7 @@ discard block |
||
| 292 | 292 | $obj_ret['pagination'] = array( |
| 293 | 293 | 'total' => (int) $total, |
| 294 | 294 | 'page' => $page, //count starts from 0 |
| 295 | - 'page_count' => ceil((int) $total/$limit), |
|
| 295 | + 'page_count' => ceil((int) $total / $limit), |
|
| 296 | 296 | 'limit' => $limit |
| 297 | 297 | ); |
| 298 | 298 | } |
@@ -1980,7 +1980,7 @@ discard block |
||
| 1980 | 1980 | unset($object->fk_bank); |
| 1981 | 1981 | unset($object->fk_account); |
| 1982 | 1982 | |
| 1983 | - unset($object->supplierprices); // Mut use another API to get them |
|
| 1983 | + unset($object->supplierprices); // Mut use another API to get them |
|
| 1984 | 1984 | |
| 1985 | 1985 | if (empty(DolibarrApiAccess::$user->rights->stock->lire)) { |
| 1986 | 1986 | unset($object->stock_reel); |