@@ -61,7 +61,9 @@ |
||
| 61 | 61 | |
| 62 | 62 | // Security check |
| 63 | 63 | $id = GETPOST("id", 'int'); |
| 64 | -if ($user->socid > 0) $socid = $user->socid; |
|
| 64 | +if ($user->socid > 0) { |
|
| 65 | + $socid = $user->socid; |
|
| 66 | +} |
|
| 65 | 67 | $result = restrictedArea($user, 'ticket', $object->id, ''); |
| 66 | 68 | |
| 67 | 69 | // restrict access for externals users |
@@ -115,7 +115,9 @@ |
||
| 115 | 115 | $url_page_current = DOL_URL_ROOT.'/ticket/card.php'; |
| 116 | 116 | |
| 117 | 117 | // Security check - Protection if external user |
| 118 | -if ($user->socid > 0) $socid = $user->socid; |
|
| 118 | +if ($user->socid > 0) { |
|
| 119 | + $socid = $user->socid; |
|
| 120 | +} |
|
| 119 | 121 | $result = restrictedArea($user, 'ticket', $object->id); |
| 120 | 122 | |
| 121 | 123 | $triggermodname = 'TICKET_MODIFY'; |
@@ -158,7 +158,9 @@ |
||
| 158 | 158 | accessforbidden(); |
| 159 | 159 | } |
| 160 | 160 | // restrict view to current user's company |
| 161 | -if ($user->socid > 0) $socid = $user->socid; |
|
| 161 | +if ($user->socid > 0) { |
|
| 162 | + $socid = $user->socid; |
|
| 163 | +} |
|
| 162 | 164 | |
| 163 | 165 | // Store current page url |
| 164 | 166 | $url_page_current = DOL_URL_ROOT.'/ticket/list.php'; |
@@ -61,7 +61,9 @@ |
||
| 61 | 61 | |
| 62 | 62 | // Security check |
| 63 | 63 | $id = GETPOST("id", 'int'); |
| 64 | -if ($user->socid > 0) $socid = $user->socid; |
|
| 64 | +if ($user->socid > 0) { |
|
| 65 | + $socid = $user->socid; |
|
| 66 | +} |
|
| 65 | 67 | $result = restrictedArea($user, 'ticket', $object->id, ''); |
| 66 | 68 | |
| 67 | 69 | // restrict access for externals users |
@@ -411,7 +411,9 @@ |
||
| 411 | 411 | $this->db->begin(); |
| 412 | 412 | |
| 413 | 413 | foreach ($request_data as $TData) { |
| 414 | - if (empty($TData[0])) $TData = array($TData); |
|
| 414 | + if (empty($TData[0])) { |
|
| 415 | + $TData = array($TData); |
|
| 416 | + } |
|
| 415 | 417 | |
| 416 | 418 | foreach ($TData as $lineData) { |
| 417 | 419 | $line = (object) $lineData; |
@@ -29,16 +29,28 @@ discard block |
||
| 29 | 29 | // Load Dolibarr environment |
| 30 | 30 | $res = 0; |
| 31 | 31 | // Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) |
| 32 | -if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; |
|
| 32 | +if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { |
|
| 33 | + $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; |
|
| 34 | +} |
|
| 33 | 35 | // Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME |
| 34 | 36 | $tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; |
| 35 | 37 | while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { $i--; $j--; } |
| 36 | -if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; |
|
| 37 | -if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; |
|
| 38 | +if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) { |
|
| 39 | + $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; |
|
| 40 | +} |
|
| 41 | +if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) { |
|
| 42 | + $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; |
|
| 43 | +} |
|
| 38 | 44 | // Try main.inc.php using relative path |
| 39 | -if (!$res && file_exists("../../main.inc.php")) $res = @include "../../main.inc.php"; |
|
| 40 | -if (!$res && file_exists("../../../main.inc.php")) $res = @include "../../../main.inc.php"; |
|
| 41 | -if (!$res) die("Include of main fails"); |
|
| 45 | +if (!$res && file_exists("../../main.inc.php")) { |
|
| 46 | + $res = @include "../../main.inc.php"; |
|
| 47 | +} |
|
| 48 | +if (!$res && file_exists("../../../main.inc.php")) { |
|
| 49 | + $res = @include "../../../main.inc.php"; |
|
| 50 | +} |
|
| 51 | +if (!$res) { |
|
| 52 | + die("Include of main fails"); |
|
| 53 | +} |
|
| 42 | 54 | |
| 43 | 55 | require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; |
| 44 | 56 | require_once DOL_DOCUMENT_ROOT.'/core/lib/stock.lib.php'; |
@@ -52,13 +64,17 @@ discard block |
||
| 52 | 64 | // List of supported format |
| 53 | 65 | $tmptype2label = ExtraFields::$type2label; |
| 54 | 66 | $type2label = array(''); |
| 55 | -foreach ($tmptype2label as $key => $val) $type2label[$key] = $langs->transnoentitiesnoconv($val); |
|
| 67 | +foreach ($tmptype2label as $key => $val) { |
|
| 68 | + $type2label[$key] = $langs->transnoentitiesnoconv($val); |
|
| 69 | +} |
|
| 56 | 70 | |
| 57 | 71 | $action = GETPOST('action', 'aZ09'); |
| 58 | 72 | $attrname = GETPOST('attrname', 'alpha'); |
| 59 | 73 | $elementtype = 'stock_mouvement'; //Must be the $table_element of the class that manage extrafield |
| 60 | 74 | |
| 61 | -if (!$user->admin) accessforbidden(); |
|
| 75 | +if (!$user->admin) { |
|
| 76 | + accessforbidden(); |
|
| 77 | +} |
|
| 62 | 78 | |
| 63 | 79 | |
| 64 | 80 | /* |
@@ -444,7 +444,10 @@ |
||
| 444 | 444 | if (idproduct=="") return; |
| 445 | 445 | // Call page invoice.php to generate the section with product lines |
| 446 | 446 | $("#poslines").load("invoice.php?action=addline&token=<?php echo newToken() ?>&place="+place+"&idproduct="+idproduct+"&selectedline="+selectedline+"&qty="+qty, function() { |
| 447 | - <?php if (!empty($conf->global->TAKEPOS_CUSTOMER_DISPLAY)) echo "CustomerDisplay();";?> |
|
| 447 | + <?php if (!empty($conf->global->TAKEPOS_CUSTOMER_DISPLAY)) { |
|
| 448 | + echo "CustomerDisplay();"; |
|
| 449 | +} |
|
| 450 | +?> |
|
| 448 | 451 | }); |
| 449 | 452 | } |
| 450 | 453 | |
@@ -740,7 +740,9 @@ |
||
| 740 | 740 | $this->fetch_origin(); |
| 741 | 741 | if (empty($this->commandeFournisseur->lines)) { |
| 742 | 742 | $res = $this->commandeFournisseur->fetch_lines(); |
| 743 | - if ($res < 0) return $res; |
|
| 743 | + if ($res < 0) { |
|
| 744 | + return $res; |
|
| 745 | + } |
|
| 744 | 746 | } |
| 745 | 747 | } |
| 746 | 748 | |
@@ -29,16 +29,28 @@ discard block |
||
| 29 | 29 | // Load Dolibarr environment |
| 30 | 30 | $res = 0; |
| 31 | 31 | // Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) |
| 32 | -if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; |
|
| 32 | +if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { |
|
| 33 | + $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; |
|
| 34 | +} |
|
| 33 | 35 | // Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME |
| 34 | 36 | $tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; |
| 35 | 37 | while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { $i--; $j--; } |
| 36 | -if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; |
|
| 37 | -if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; |
|
| 38 | +if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) { |
|
| 39 | + $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; |
|
| 40 | +} |
|
| 41 | +if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) { |
|
| 42 | + $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; |
|
| 43 | +} |
|
| 38 | 44 | // Try main.inc.php using relative path |
| 39 | -if (!$res && file_exists("../../main.inc.php")) $res = @include "../../main.inc.php"; |
|
| 40 | -if (!$res && file_exists("../../../main.inc.php")) $res = @include "../../../main.inc.php"; |
|
| 41 | -if (!$res) die("Include of main fails"); |
|
| 45 | +if (!$res && file_exists("../../main.inc.php")) { |
|
| 46 | + $res = @include "../../main.inc.php"; |
|
| 47 | +} |
|
| 48 | +if (!$res && file_exists("../../../main.inc.php")) { |
|
| 49 | + $res = @include "../../../main.inc.php"; |
|
| 50 | +} |
|
| 51 | +if (!$res) { |
|
| 52 | + die("Include of main fails"); |
|
| 53 | +} |
|
| 42 | 54 | |
| 43 | 55 | require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; |
| 44 | 56 | require_once DOL_DOCUMENT_ROOT.'/core/lib/stock.lib.php'; |
@@ -52,13 +64,17 @@ discard block |
||
| 52 | 64 | // List of supported format |
| 53 | 65 | $tmptype2label = ExtraFields::$type2label; |
| 54 | 66 | $type2label = array(''); |
| 55 | -foreach ($tmptype2label as $key => $val) $type2label[$key] = $langs->transnoentitiesnoconv($val); |
|
| 67 | +foreach ($tmptype2label as $key => $val) { |
|
| 68 | + $type2label[$key] = $langs->transnoentitiesnoconv($val); |
|
| 69 | +} |
|
| 56 | 70 | |
| 57 | 71 | $action = GETPOST('action', 'aZ09'); |
| 58 | 72 | $attrname = GETPOST('attrname', 'alpha'); |
| 59 | 73 | $elementtype = 'inventory'; //Must be the $table_element of the class that manage extrafield |
| 60 | 74 | |
| 61 | -if (!$user->admin) accessforbidden(); |
|
| 75 | +if (!$user->admin) { |
|
| 76 | + accessforbidden(); |
|
| 77 | +} |
|
| 62 | 78 | |
| 63 | 79 | |
| 64 | 80 | /* |