@@ -92,10 +92,18 @@ |
||
| 92 | 92 | global $langs; |
| 93 | 93 | $langs->load("admin"); |
| 94 | 94 | |
| 95 | - if ($this->version == 'development') return $langs->trans("VersionDevelopment"); |
|
| 96 | - if ($this->version == 'experimental') return $langs->trans("VersionExperimental"); |
|
| 97 | - if ($this->version == 'dolibarr') return DOL_VERSION; |
|
| 98 | - if ($this->version) return $this->version; |
|
| 95 | + if ($this->version == 'development') { |
|
| 96 | + return $langs->trans("VersionDevelopment"); |
|
| 97 | + } |
|
| 98 | + if ($this->version == 'experimental') { |
|
| 99 | + return $langs->trans("VersionExperimental"); |
|
| 100 | + } |
|
| 101 | + if ($this->version == 'dolibarr') { |
|
| 102 | + return DOL_VERSION; |
|
| 103 | + } |
|
| 104 | + if ($this->version) { |
|
| 105 | + return $this->version; |
|
| 106 | + } |
|
| 99 | 107 | return $langs->trans("NotAvailable"); |
| 100 | 108 | } |
| 101 | 109 | } |
@@ -42,17 +42,17 @@ |
||
| 42 | 42 | public $error = ''; |
| 43 | 43 | |
| 44 | 44 | |
| 45 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 46 | - /** |
|
| 47 | - * Return list of active generation modules |
|
| 48 | - * |
|
| 49 | - * @param DoliDB $db Database handler |
|
| 50 | - * @param integer $maxfilenamelength Max length of value to show |
|
| 51 | - * @return array List of templates |
|
| 45 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 46 | + /** |
|
| 47 | + * Return list of active generation modules |
|
| 48 | + * |
|
| 49 | + * @param DoliDB $db Database handler |
|
| 50 | + * @param integer $maxfilenamelength Max length of value to show |
|
| 51 | + * @return array List of templates |
|
| 52 | 52 | */ |
| 53 | 53 | public static function liste_modeles($db, $maxfilenamelength = 0) |
| 54 | 54 | { |
| 55 | - // phpcs:enable |
|
| 55 | + // phpcs:enable |
|
| 56 | 56 | global $conf; |
| 57 | 57 | |
| 58 | 58 | $type = 'supplier_proposal'; |
@@ -92,10 +92,18 @@ |
||
| 92 | 92 | global $langs; |
| 93 | 93 | $langs->load("admin"); |
| 94 | 94 | |
| 95 | - if ($this->version == 'development') return $langs->trans("VersionDevelopment"); |
|
| 96 | - if ($this->version == 'experimental') return $langs->trans("VersionExperimental"); |
|
| 97 | - if ($this->version == 'dolibarr') return DOL_VERSION; |
|
| 98 | - if ($this->version) return $this->version; |
|
| 95 | + if ($this->version == 'development') { |
|
| 96 | + return $langs->trans("VersionDevelopment"); |
|
| 97 | + } |
|
| 98 | + if ($this->version == 'experimental') { |
|
| 99 | + return $langs->trans("VersionExperimental"); |
|
| 100 | + } |
|
| 101 | + if ($this->version == 'dolibarr') { |
|
| 102 | + return DOL_VERSION; |
|
| 103 | + } |
|
| 104 | + if ($this->version) { |
|
| 105 | + return $this->version; |
|
| 106 | + } |
|
| 99 | 107 | return $langs->trans("NotAvailable"); |
| 100 | 108 | } |
| 101 | 109 | } |
@@ -36,23 +36,23 @@ discard block |
||
| 36 | 36 | */ |
| 37 | 37 | abstract class ModelePdfExpedition extends CommonDocGenerator |
| 38 | 38 | { |
| 39 | - /** |
|
| 39 | + /** |
|
| 40 | 40 | * @var string Error code (or message) |
| 41 | 41 | */ |
| 42 | 42 | public $error = ''; |
| 43 | 43 | |
| 44 | 44 | |
| 45 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 45 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 46 | 46 | /** |
| 47 | 47 | * Return list of active generation models |
| 48 | 48 | * |
| 49 | - * @param DoliDB $db Database handler |
|
| 50 | - * @param integer $maxfilenamelength Max length of value to show |
|
| 51 | - * @return array List of templates |
|
| 49 | + * @param DoliDB $db Database handler |
|
| 50 | + * @param integer $maxfilenamelength Max length of value to show |
|
| 51 | + * @return array List of templates |
|
| 52 | 52 | */ |
| 53 | 53 | public static function liste_modeles($db, $maxfilenamelength = 0) |
| 54 | 54 | { |
| 55 | - // phpcs:enable |
|
| 55 | + // phpcs:enable |
|
| 56 | 56 | global $conf; |
| 57 | 57 | |
| 58 | 58 | $type = 'shipping'; |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | * |
| 81 | 81 | * @return boolean true if model can be used |
| 82 | 82 | */ |
| 83 | - public function isEnabled() |
|
| 83 | + public function isEnabled() |
|
| 84 | 84 | { |
| 85 | 85 | return true; |
| 86 | 86 | } |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | * |
| 91 | 91 | * @return string text description |
| 92 | 92 | */ |
| 93 | - public function info() |
|
| 93 | + public function info() |
|
| 94 | 94 | { |
| 95 | 95 | global $langs; |
| 96 | 96 | $langs->load("sendings"); |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | * |
| 103 | 103 | * @return string Example |
| 104 | 104 | */ |
| 105 | - public function getExample() |
|
| 105 | + public function getExample() |
|
| 106 | 106 | { |
| 107 | 107 | global $langs; |
| 108 | 108 | $langs->load("sendings"); |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | * |
| 115 | 115 | * @return boolean false if conflict, true if ok |
| 116 | 116 | */ |
| 117 | - public function canBeActivated() |
|
| 117 | + public function canBeActivated() |
|
| 118 | 118 | { |
| 119 | 119 | return true; |
| 120 | 120 | } |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | * @param Object $shipment Shipment object |
| 127 | 127 | * @return string Value |
| 128 | 128 | */ |
| 129 | - public function getNextValue($objsoc, $shipment) |
|
| 129 | + public function getNextValue($objsoc, $shipment) |
|
| 130 | 130 | { |
| 131 | 131 | global $langs; |
| 132 | 132 | return $langs->trans("NotAvailable"); |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | * |
| 138 | 138 | * @return string Value |
| 139 | 139 | */ |
| 140 | - public function getVersion() |
|
| 140 | + public function getVersion() |
|
| 141 | 141 | { |
| 142 | 142 | global $langs; |
| 143 | 143 | $langs->load("admin"); |
@@ -374,7 +374,7 @@ |
||
| 374 | 374 | echo <<<EOF |
| 375 | 375 | <script type="text/javascript"> |
| 376 | 376 | (function(){var d=document.domain;while (true){try{var A=window.parent.document.domain;break;}catch(e) {};d=d.replace(/.*?(?:\.|$)/,'');if (d.length==0) break;try{document.domain=d;}catch (e){break;}}})(); |
| 377 | -EOF; |
|
| 377 | +eof; |
|
| 378 | 378 | |
| 379 | 379 | if ($errorNumber && $errorNumber != 201) { |
| 380 | 380 | $fileUrl = ""; |
@@ -131,8 +131,8 @@ discard block |
||
| 131 | 131 | */ |
| 132 | 132 | function GetParentFolder($folderPath) |
| 133 | 133 | { |
| 134 | - $sPattern = "-[/\\\\][^/\\\\]+[/\\\\]?$-"; |
|
| 135 | - return preg_replace($sPattern, '', $folderPath); |
|
| 134 | + $sPattern = "-[/\\\\][^/\\\\]+[/\\\\]?$-"; |
|
| 135 | + return preg_replace($sPattern, '', $folderPath); |
|
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | /** |
@@ -214,26 +214,26 @@ discard block |
||
| 214 | 214 | */ |
| 215 | 215 | function GetRootPath() |
| 216 | 216 | { |
| 217 | - if (!isset($_SERVER)) { |
|
| 218 | - global $_SERVER; |
|
| 219 | - } |
|
| 220 | - $sRealPath = realpath('./'); |
|
| 221 | - // #2124 ensure that no slash is at the end |
|
| 222 | - $sRealPath = rtrim($sRealPath, "\\/"); |
|
| 217 | + if (!isset($_SERVER)) { |
|
| 218 | + global $_SERVER; |
|
| 219 | + } |
|
| 220 | + $sRealPath = realpath('./'); |
|
| 221 | + // #2124 ensure that no slash is at the end |
|
| 222 | + $sRealPath = rtrim($sRealPath, "\\/"); |
|
| 223 | 223 | |
| 224 | - $sSelfPath = $_SERVER['PHP_SELF']; |
|
| 225 | - $sSelfPath = substr($sSelfPath, 0, strrpos($sSelfPath, '/')); |
|
| 224 | + $sSelfPath = $_SERVER['PHP_SELF']; |
|
| 225 | + $sSelfPath = substr($sSelfPath, 0, strrpos($sSelfPath, '/')); |
|
| 226 | 226 | |
| 227 | - $sSelfPath = str_replace('/', DIRECTORY_SEPARATOR, $sSelfPath); |
|
| 227 | + $sSelfPath = str_replace('/', DIRECTORY_SEPARATOR, $sSelfPath); |
|
| 228 | 228 | |
| 229 | - $position = strpos($sRealPath, $sSelfPath); |
|
| 229 | + $position = strpos($sRealPath, $sSelfPath); |
|
| 230 | 230 | |
| 231 | - // This can check only that this script isn't run from a virtual dir |
|
| 232 | - // But it avoids the problems that arise if it isn't checked |
|
| 233 | - if ($position === false || $position <> strlen($sRealPath) - strlen($sSelfPath)) |
|
| 234 | - SendError(1, 'Sorry, can\'t map "UserFilesPath" to a physical path. You must set the "UserFilesAbsolutePath" value in "editor/filemanager/connectors/php/config.php".'); |
|
| 231 | + // This can check only that this script isn't run from a virtual dir |
|
| 232 | + // But it avoids the problems that arise if it isn't checked |
|
| 233 | + if ($position === false || $position <> strlen($sRealPath) - strlen($sSelfPath)) |
|
| 234 | + SendError(1, 'Sorry, can\'t map "UserFilesPath" to a physical path. You must set the "UserFilesAbsolutePath" value in "editor/filemanager/connectors/php/config.php".'); |
|
| 235 | 235 | |
| 236 | - return substr($sRealPath, 0, $position); |
|
| 236 | + return substr($sRealPath, 0, $position); |
|
| 237 | 237 | } |
| 238 | 238 | |
| 239 | 239 | /** |
@@ -243,15 +243,15 @@ discard block |
||
| 243 | 243 | */ |
| 244 | 244 | function Server_MapPath($path) |
| 245 | 245 | { |
| 246 | - // This function is available only for Apache |
|
| 247 | - if (function_exists('apache_lookup_uri')) { |
|
| 248 | - $info = apache_lookup_uri($path); |
|
| 249 | - return $info->filename.$info->path_info; |
|
| 250 | - } |
|
| 251 | - |
|
| 252 | - // This isn't correct but for the moment there's no other solution |
|
| 253 | - // If this script is under a virtual directory or symlink it will detect the problem and stop |
|
| 254 | - return GetRootPath().$path; |
|
| 246 | + // This function is available only for Apache |
|
| 247 | + if (function_exists('apache_lookup_uri')) { |
|
| 248 | + $info = apache_lookup_uri($path); |
|
| 249 | + return $info->filename.$info->path_info; |
|
| 250 | + } |
|
| 251 | + |
|
| 252 | + // This isn't correct but for the moment there's no other solution |
|
| 253 | + // If this script is under a virtual directory or symlink it will detect the problem and stop |
|
| 254 | + return GetRootPath().$path; |
|
| 255 | 255 | } |
| 256 | 256 | |
| 257 | 257 | /** |
@@ -422,11 +422,11 @@ discard block |
||
| 422 | 422 | */ |
| 423 | 423 | function SendCKEditorResults($callback, $sFileUrl, $customMsg = '') |
| 424 | 424 | { |
| 425 | - echo '<script type="text/javascript">'; |
|
| 425 | + echo '<script type="text/javascript">'; |
|
| 426 | 426 | |
| 427 | - $rpl = array('\\' => '\\\\', '"' => '\\"'); |
|
| 427 | + $rpl = array('\\' => '\\\\', '"' => '\\"'); |
|
| 428 | 428 | |
| 429 | - echo 'window.parent.CKEDITOR.tools.callFunction("'.$callback.'","'.strtr($sFileUrl, $rpl).'", "'.strtr($customMsg, $rpl).'");'; |
|
| 429 | + echo 'window.parent.CKEDITOR.tools.callFunction("'.$callback.'","'.strtr($sFileUrl, $rpl).'", "'.strtr($customMsg, $rpl).'");'; |
|
| 430 | 430 | |
| 431 | - echo '</script>'; |
|
| 431 | + echo '</script>'; |
|
| 432 | 432 | } |
@@ -44,10 +44,12 @@ discard block |
||
| 44 | 44 | { |
| 45 | 45 | global $Config; |
| 46 | 46 | |
| 47 | - if ($sCommand == "QuickUpload") |
|
| 48 | - return $Config['QuickUploadPath'][$resourceType]; |
|
| 49 | - else return $Config['FileTypesPath'][$resourceType]; |
|
| 50 | -} |
|
| 47 | + if ($sCommand == "QuickUpload") { |
|
| 48 | + return $Config['QuickUploadPath'][$resourceType]; |
|
| 49 | + } else { |
|
| 50 | + return $Config['FileTypesPath'][$resourceType]; |
|
| 51 | + } |
|
| 52 | + } |
|
| 51 | 53 | |
| 52 | 54 | /** |
| 53 | 55 | * GetResourceTypeDirectory |
@@ -61,14 +63,16 @@ discard block |
||
| 61 | 63 | global $Config; |
| 62 | 64 | if ($sCommand == "QuickUpload") |
| 63 | 65 | { |
| 64 | - if (strlen($Config['QuickUploadAbsolutePath'][$resourceType]) > 0) |
|
| 65 | - return $Config['QuickUploadAbsolutePath'][$resourceType]; |
|
| 66 | + if (strlen($Config['QuickUploadAbsolutePath'][$resourceType]) > 0) { |
|
| 67 | + return $Config['QuickUploadAbsolutePath'][$resourceType]; |
|
| 68 | + } |
|
| 66 | 69 | |
| 67 | 70 | // Map the "UserFiles" path to a local directory. |
| 68 | 71 | return Server_MapPath($Config['QuickUploadPath'][$resourceType]); |
| 69 | 72 | } else { |
| 70 | - if (strlen($Config['FileTypesAbsolutePath'][$resourceType]) > 0) |
|
| 71 | - return $Config['FileTypesAbsolutePath'][$resourceType]; |
|
| 73 | + if (strlen($Config['FileTypesAbsolutePath'][$resourceType]) > 0) { |
|
| 74 | + return $Config['FileTypesAbsolutePath'][$resourceType]; |
|
| 75 | + } |
|
| 72 | 76 | |
| 73 | 77 | // Map the "UserFiles" path to a local directory. |
| 74 | 78 | return Server_MapPath($Config['FileTypesPath'][$resourceType]); |
@@ -113,8 +117,9 @@ discard block |
||
| 113 | 117 | |
| 114 | 118 | // Ensure that the directory exists. |
| 115 | 119 | $sErrorMsg = CreateServerFolder($sResourceTypePath); |
| 116 | - if ($sErrorMsg != '') |
|
| 117 | - SendError(1, "Error creating folder \"{$sResourceTypePath}\" ({$sErrorMsg})"); |
|
| 120 | + if ($sErrorMsg != '') { |
|
| 121 | + SendError(1, "Error creating folder \"{$sResourceTypePath}\" ({$sErrorMsg})"); |
|
| 122 | + } |
|
| 118 | 123 | |
| 119 | 124 | // Return the resource type directory combined with the required path. |
| 120 | 125 | return CombinePaths($sResourceTypePath, $folderPath); |
@@ -159,8 +164,9 @@ discard block |
||
| 159 | 164 | } |
| 160 | 165 | |
| 161 | 166 | $sErrorMsg = CreateServerFolder($sParent, $folderPath); |
| 162 | - if ($sErrorMsg != '') |
|
| 163 | - return $sErrorMsg; |
|
| 167 | + if ($sErrorMsg != '') { |
|
| 168 | + return $sErrorMsg; |
|
| 169 | + } |
|
| 164 | 170 | } |
| 165 | 171 | |
| 166 | 172 | if (!file_exists($folderPath)) |
@@ -197,8 +203,10 @@ discard block |
||
| 197 | 203 | ini_restore('error_reporting'); |
| 198 | 204 | |
| 199 | 205 | return $sErrorMsg; |
| 200 | - } else return ''; |
|
| 201 | -} |
|
| 206 | + } else { |
|
| 207 | + return ''; |
|
| 208 | + } |
|
| 209 | + } |
|
| 202 | 210 | |
| 203 | 211 | /** |
| 204 | 212 | * Get Root Path |
@@ -223,8 +231,9 @@ discard block |
||
| 223 | 231 | |
| 224 | 232 | // This can check only that this script isn't run from a virtual dir |
| 225 | 233 | // But it avoids the problems that arise if it isn't checked |
| 226 | - if ($position === false || $position <> strlen($sRealPath) - strlen($sSelfPath)) |
|
| 227 | - SendError(1, 'Sorry, can\'t map "UserFilesPath" to a physical path. You must set the "UserFilesAbsolutePath" value in "editor/filemanager/connectors/php/config.php".'); |
|
| 234 | + if ($position === false || $position <> strlen($sRealPath) - strlen($sSelfPath)) { |
|
| 235 | + SendError(1, 'Sorry, can\'t map "UserFilesPath" to a physical path. You must set the "UserFilesAbsolutePath" value in "editor/filemanager/connectors/php/config.php".'); |
|
| 236 | + } |
|
| 228 | 237 | |
| 229 | 238 | return substr($sRealPath, 0, $position); |
| 230 | 239 | } |
@@ -261,11 +270,13 @@ discard block |
||
| 261 | 270 | $arAllowed = $Config['AllowedExtensions'][$resourceType]; |
| 262 | 271 | $arDenied = $Config['DeniedExtensions'][$resourceType]; |
| 263 | 272 | |
| 264 | - if (count($arAllowed) > 0 && !in_array($sExtension, $arAllowed)) |
|
| 265 | - return false; |
|
| 273 | + if (count($arAllowed) > 0 && !in_array($sExtension, $arAllowed)) { |
|
| 274 | + return false; |
|
| 275 | + } |
|
| 266 | 276 | |
| 267 | - if (count($arDenied) > 0 && in_array($sExtension, $arDenied)) |
|
| 268 | - return false; |
|
| 277 | + if (count($arDenied) > 0 && in_array($sExtension, $arDenied)) { |
|
| 278 | + return false; |
|
| 279 | + } |
|
| 269 | 280 | |
| 270 | 281 | return true; |
| 271 | 282 | } |
@@ -279,8 +290,9 @@ discard block |
||
| 279 | 290 | function IsAllowedType($resourceType) |
| 280 | 291 | { |
| 281 | 292 | global $Config; |
| 282 | - if (!in_array($resourceType, $Config['ConfigAllowedTypes'])) |
|
| 283 | - return false; |
|
| 293 | + if (!in_array($resourceType, $Config['ConfigAllowedTypes'])) { |
|
| 294 | + return false; |
|
| 295 | + } |
|
| 284 | 296 | |
| 285 | 297 | return true; |
| 286 | 298 | } |
@@ -295,8 +307,9 @@ discard block |
||
| 295 | 307 | { |
| 296 | 308 | global $Config; |
| 297 | 309 | |
| 298 | - if (!in_array($sCommand, $Config['ConfigAllowedCommands'])) |
|
| 299 | - return false; |
|
| 310 | + if (!in_array($sCommand, $Config['ConfigAllowedCommands'])) { |
|
| 311 | + return false; |
|
| 312 | + } |
|
| 300 | 313 | |
| 301 | 314 | return true; |
| 302 | 315 | } |
@@ -314,10 +327,12 @@ discard block |
||
| 314 | 327 | $sCurrentFolder = isset($_GET['CurrentFolder']) ? GETPOST('CurrentFolder', '', 1) : '/'; |
| 315 | 328 | |
| 316 | 329 | // Check the current folder syntax (must begin and start with a slash). |
| 317 | - if (!preg_match('|/$|', $sCurrentFolder)) |
|
| 318 | - $sCurrentFolder .= '/'; |
|
| 319 | - if (strpos($sCurrentFolder, '/') !== 0) |
|
| 320 | - $sCurrentFolder = '/'.$sCurrentFolder; |
|
| 330 | + if (!preg_match('|/$|', $sCurrentFolder)) { |
|
| 331 | + $sCurrentFolder .= '/'; |
|
| 332 | + } |
|
| 333 | + if (strpos($sCurrentFolder, '/') !== 0) { |
|
| 334 | + $sCurrentFolder = '/'.$sCurrentFolder; |
|
| 335 | + } |
|
| 321 | 336 | |
| 322 | 337 | // Ensure the folder path has no double-slashes |
| 323 | 338 | while (strpos($sCurrentFolder, '//') !== false) { |
@@ -325,11 +340,13 @@ discard block |
||
| 325 | 340 | } |
| 326 | 341 | |
| 327 | 342 | // Check for invalid folder paths (..) |
| 328 | - if (strpos($sCurrentFolder, '..') || strpos($sCurrentFolder, "\\")) |
|
| 329 | - SendError(102, ''); |
|
| 343 | + if (strpos($sCurrentFolder, '..') || strpos($sCurrentFolder, "\\")) { |
|
| 344 | + SendError(102, ''); |
|
| 345 | + } |
|
| 330 | 346 | |
| 331 | - if (preg_match(",(/\.)|[[:cntrl:]]|(//)|(\\\\)|([\:\*\?\"\<\>\|]),", $sCurrentFolder)) |
|
| 332 | - SendError(102, ''); |
|
| 347 | + if (preg_match(",(/\.)|[[:cntrl:]]|(//)|(\\\\)|([\:\*\?\"\<\>\|]),", $sCurrentFolder)) { |
|
| 348 | + SendError(102, ''); |
|
| 349 | + } |
|
| 333 | 350 | |
| 334 | 351 | return $sCurrentFolder; |
| 335 | 352 | } |
@@ -363,8 +380,9 @@ discard block |
||
| 363 | 380 | $sNewFileName = stripslashes($sNewFileName); |
| 364 | 381 | |
| 365 | 382 | // Replace dots in the name with underscores (only one dot can be there... security issue). |
| 366 | - if ($Config['ForceSingleExtension']) |
|
| 367 | - $sNewFileName = preg_replace('/\\.(?![^.]*$)/', '_', $sNewFileName); |
|
| 383 | + if ($Config['ForceSingleExtension']) { |
|
| 384 | + $sNewFileName = preg_replace('/\\.(?![^.]*$)/', '_', $sNewFileName); |
|
| 385 | + } |
|
| 368 | 386 | |
| 369 | 387 | // Remove \ / | : ? * " < > |
| 370 | 388 | $sNewFileName = preg_replace('/\\\\|\\/|\\||\\:|\\?|\\*|"|<|>|[[:cntrl:]]/', '_', $sNewFileName); |
@@ -28,8 +28,9 @@ |
||
| 28 | 28 | // Load translation files required by the page |
| 29 | 29 | $langs->loadLangs(array('banks', 'categories')); |
| 30 | 30 | |
| 31 | -if (!$user->rights->banque->lire) |
|
| 31 | +if (!$user->rights->banque->lire) { |
|
| 32 | 32 | accessforbidden(); |
| 33 | +} |
|
| 33 | 34 | |
| 34 | 35 | |
| 35 | 36 | /** |
@@ -28,7 +28,9 @@ |
||
| 28 | 28 | require_once DOL_DOCUMENT_ROOT."/opensurvey/fonctions.php"; |
| 29 | 29 | |
| 30 | 30 | // Security check |
| 31 | -if (!$user->rights->opensurvey->write) accessforbidden(); |
|
| 31 | +if (!$user->rights->opensurvey->write) { |
|
| 32 | + accessforbidden(); |
|
| 33 | +} |
|
| 32 | 34 | |
| 33 | 35 | |
| 34 | 36 | |
@@ -97,7 +97,7 @@ |
||
| 97 | 97 | } |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | -var_dump($_SESSION);exit; |
|
| 100 | +var_dump($_SESSION); exit; |
|
| 101 | 101 | |
| 102 | 102 | |
| 103 | 103 | /* |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | print "<br>"; |
| 98 | 98 | print load_fiche_titre($langs->trans('NewAttribute')); |
| 99 | 99 | |
| 100 | - require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; |
|
| 100 | + require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; |
|
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | /* ************************************************************************** */ |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | print "<br>"; |
| 111 | 111 | print load_fiche_titre($langs->trans("FieldEdition", $attrname)); |
| 112 | 112 | |
| 113 | - require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; |
|
| 113 | + require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; |
|
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | // End of page |
@@ -34,13 +34,17 @@ |
||
| 34 | 34 | // List of supported format |
| 35 | 35 | $tmptype2label = ExtraFields::$type2label; |
| 36 | 36 | $type2label = array(''); |
| 37 | -foreach ($tmptype2label as $key => $val) $type2label[$key] = $langs->transnoentitiesnoconv($val); |
|
| 37 | +foreach ($tmptype2label as $key => $val) { |
|
| 38 | + $type2label[$key] = $langs->transnoentitiesnoconv($val); |
|
| 39 | +} |
|
| 38 | 40 | |
| 39 | 41 | $action = GETPOST('action', 'aZ09'); |
| 40 | 42 | $attrname = GETPOST('attrname', 'alpha'); |
| 41 | 43 | $elementtype = 'adherent_type'; //Must be the $table_element of the class that manage extrafield |
| 42 | 44 | |
| 43 | -if (!$user->admin) accessforbidden(); |
|
| 45 | +if (!$user->admin) { |
|
| 46 | + accessforbidden(); |
|
| 47 | +} |
|
| 44 | 48 | |
| 45 | 49 | |
| 46 | 50 | /* |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | print '<br><div id="newattrib"></div>'; |
| 99 | 99 | print load_fiche_titre($langs->trans('NewAttribute')); |
| 100 | 100 | |
| 101 | - require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; |
|
| 101 | + require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; |
|
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | /* ************************************************************************** */ |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | print "<br>"; |
| 112 | 112 | print load_fiche_titre($langs->trans("FieldEdition", $attrname)); |
| 113 | 113 | |
| 114 | - require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; |
|
| 114 | + require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; |
|
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | // End of page |
@@ -37,13 +37,17 @@ |
||
| 37 | 37 | // List of supported format |
| 38 | 38 | $tmptype2label = ExtraFields::$type2label; |
| 39 | 39 | $type2label = array(''); |
| 40 | -foreach ($tmptype2label as $key => $val) $type2label[$key] = $langs->transnoentitiesnoconv($val); |
|
| 40 | +foreach ($tmptype2label as $key => $val) { |
|
| 41 | + $type2label[$key] = $langs->transnoentitiesnoconv($val); |
|
| 42 | +} |
|
| 41 | 43 | |
| 42 | 44 | $action = GETPOST('action', 'aZ09'); |
| 43 | 45 | $attrname = GETPOST('attrname', 'alpha'); |
| 44 | 46 | $elementtype = 'user'; //Must be the $table_element of the class that manage extrafield |
| 45 | 47 | |
| 46 | -if (!$user->admin) accessforbidden(); |
|
| 48 | +if (!$user->admin) { |
|
| 49 | + accessforbidden(); |
|
| 50 | +} |
|
| 47 | 51 | |
| 48 | 52 | |
| 49 | 53 | /* |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | print "<br>"; |
| 98 | 98 | print load_fiche_titre($langs->trans('NewAttribute')); |
| 99 | 99 | |
| 100 | - require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; |
|
| 100 | + require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; |
|
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | /* ************************************************************************** */ |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | print "<br>"; |
| 111 | 111 | print load_fiche_titre($langs->trans("FieldEdition", $attrname)); |
| 112 | 112 | |
| 113 | - require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; |
|
| 113 | + require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; |
|
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | // End of page |
@@ -39,13 +39,17 @@ |
||
| 39 | 39 | // List of supported format |
| 40 | 40 | $tmptype2label = ExtraFields::$type2label; |
| 41 | 41 | $type2label = array(''); |
| 42 | -foreach ($tmptype2label as $key => $val) $type2label[$key] = $langs->transnoentitiesnoconv($val); |
|
| 42 | +foreach ($tmptype2label as $key => $val) { |
|
| 43 | + $type2label[$key] = $langs->transnoentitiesnoconv($val); |
|
| 44 | +} |
|
| 43 | 45 | |
| 44 | 46 | $action = GETPOST('action', 'aZ09'); |
| 45 | 47 | $attrname = GETPOST('attrname', 'alpha'); |
| 46 | 48 | $elementtype = 'projet_task'; |
| 47 | 49 | |
| 48 | -if (!$user->admin) accessforbidden(); |
|
| 50 | +if (!$user->admin) { |
|
| 51 | + accessforbidden(); |
|
| 52 | +} |
|
| 49 | 53 | |
| 50 | 54 | |
| 51 | 55 | /* |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | print "<br>"; |
| 98 | 98 | print load_fiche_titre($langs->trans('NewAttribute')); |
| 99 | 99 | |
| 100 | - require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; |
|
| 100 | + require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; |
|
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | /* ************************************************************************** */ |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | print "<br>"; |
| 111 | 111 | print load_fiche_titre($langs->trans("FieldEdition", $attrname)); |
| 112 | 112 | |
| 113 | - require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; |
|
| 113 | + require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; |
|
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | // End of page |
@@ -38,13 +38,17 @@ |
||
| 38 | 38 | // List of supported format |
| 39 | 39 | $tmptype2label = ExtraFields::$type2label; |
| 40 | 40 | $type2label = array(''); |
| 41 | -foreach ($tmptype2label as $key => $val) $type2label[$key] = $langs->transnoentitiesnoconv($val); |
|
| 41 | +foreach ($tmptype2label as $key => $val) { |
|
| 42 | + $type2label[$key] = $langs->transnoentitiesnoconv($val); |
|
| 43 | +} |
|
| 42 | 44 | |
| 43 | 45 | $action = GETPOST('action', 'aZ09'); |
| 44 | 46 | $attrname = GETPOST('attrname', 'alpha'); |
| 45 | 47 | $elementtype = 'projet'; //Must be the $table_element of the class that manage extrafield |
| 46 | 48 | |
| 47 | -if (!$user->admin) accessforbidden(); |
|
| 49 | +if (!$user->admin) { |
|
| 50 | + accessforbidden(); |
|
| 51 | +} |
|
| 48 | 52 | |
| 49 | 53 | |
| 50 | 54 | /* |