@@ -29,11 +29,11 @@ discard block |
||
29 | 29 | // Load Dolibarr environment |
30 | 30 | require '../main.inc.php'; |
31 | 31 | |
32 | -require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php'; |
|
33 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; |
|
34 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php'; |
|
35 | -require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php'; |
|
36 | -require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_job.lib.php'; |
|
32 | +require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; |
|
33 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; |
|
34 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; |
|
35 | +require_once DOL_DOCUMENT_ROOT.'/hrm/class/job.class.php'; |
|
36 | +require_once DOL_DOCUMENT_ROOT.'/hrm/lib/hrm_job.lib.php'; |
|
37 | 37 | |
38 | 38 | // Load translation files required by the page |
39 | 39 | $langs->loadLangs(array('hrm', 'other')); |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | $linkback = '<a href="'.dol_buildpath('/hrm/job_list.php', 1).'?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>'; |
152 | 152 | |
153 | 153 | $morehtmlref = '<div class="refid">'; |
154 | - $morehtmlref.= $object->label; |
|
154 | + $morehtmlref .= $object->label; |
|
155 | 155 | $morehtmlref .= '</div>'; |
156 | 156 | |
157 | 157 |
@@ -36,7 +36,7 @@ |
||
36 | 36 | |
37 | 37 | $langs->load("bookmarks"); |
38 | 38 | |
39 | - $authorized_var=array('limit','optioncss','contextpage'); |
|
39 | + $authorized_var = array('limit', 'optioncss', 'contextpage'); |
|
40 | 40 | $url = $_SERVER["PHP_SELF"]; |
41 | 41 | $url_param = array(); |
42 | 42 | if (!empty($_SERVER["QUERY_STRING"])) { |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | */ |
19 | 19 | class Bbb |
20 | 20 | { |
21 | - const BBB='bbb'; |
|
21 | + const BBB = 'bbb'; |
|
22 | 22 | |
23 | 23 | /** |
24 | 24 | * do |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | { |
30 | 30 | global $globalaaa, $globalbbb; |
31 | 31 | echo 'dobbb'."\n"; |
32 | - $globalaaa.='+bbb'; |
|
33 | - $globalbbb.='+bbb'; |
|
32 | + $globalaaa .= '+bbb'; |
|
33 | + $globalbbb .= '+bbb'; |
|
34 | 34 | } |
35 | 35 | } |
@@ -20,7 +20,7 @@ |
||
20 | 20 | */ |
21 | 21 | class Aaa |
22 | 22 | { |
23 | - const AAA='aaa'; |
|
23 | + const AAA = 'aaa'; |
|
24 | 24 | |
25 | 25 | /** |
26 | 26 | * do |
@@ -65,11 +65,11 @@ |
||
65 | 65 | - To convert pfx certificate to pem: openssl pkcs12 -in tcpdf.pfx -out tcpdf.crt -nodes |
66 | 66 | |
67 | 67 | */ |
68 | -$permissions=array('copy'); |
|
69 | -$user_pass='aaa'; |
|
70 | -$owner_pass=null; |
|
71 | -$mode=0; |
|
72 | -$pubkeys=null; |
|
68 | +$permissions = array('copy'); |
|
69 | +$user_pass = 'aaa'; |
|
70 | +$owner_pass = null; |
|
71 | +$mode = 0; |
|
72 | +$pubkeys = null; |
|
73 | 73 | $pdf->SetProtection($permissions, $user_pass, $owner_pass, $mode, $pubkeys); |
74 | 74 | |
75 | 75 | // Example with public-key |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | |
29 | 29 | $sapi_type = php_sapi_name(); |
30 | 30 | $script_file = basename(__FILE__); |
31 | -$path=dirname(__FILE__).'/'; |
|
31 | +$path = dirname(__FILE__).'/'; |
|
32 | 32 | |
33 | 33 | // Test if batch mode |
34 | 34 | if (substr($sapi_type, 0, 3) == 'cgi') { |
@@ -45,17 +45,17 @@ discard block |
||
45 | 45 | $langs->load("main"); |
46 | 46 | |
47 | 47 | // Global variables |
48 | -$version='1.14'; |
|
49 | -$error=0; |
|
48 | +$version = '1.14'; |
|
49 | +$error = 0; |
|
50 | 50 | |
51 | 51 | |
52 | 52 | // -------------------- START OF YOUR CODE HERE -------------------- |
53 | 53 | @set_time_limit(0); |
54 | 54 | print "***** ".$script_file." (".$version.") *****\n"; |
55 | -$dir=DOL_DOCUMENT_ROOT."/langs"; |
|
55 | +$dir = DOL_DOCUMENT_ROOT."/langs"; |
|
56 | 56 | |
57 | 57 | // Check parameters |
58 | -if (! isset($argv[3])) { |
|
58 | +if (!isset($argv[3])) { |
|
59 | 59 | print "Usage: ".$script_file." lang_code_src lang_code_dest|all APIKEY [langfile.lang]\n"; |
60 | 60 | print "Example: ".$script_file." en_US pt_PT 123456\n"; |
61 | 61 | print "Rem: lang_code to use can be found on https://translate.google.com\n"; |
@@ -66,18 +66,18 @@ discard block |
||
66 | 66 | print 'Argument 1='.$argv[1]."\n"; |
67 | 67 | print 'Argument 2='.$argv[2]."\n"; |
68 | 68 | print 'Argument 3='.$argv[3]."\n"; |
69 | -$file=''; |
|
69 | +$file = ''; |
|
70 | 70 | if (isset($argv[4])) { |
71 | - $file=$argv[4]; |
|
71 | + $file = $argv[4]; |
|
72 | 72 | print 'Argument 4='.$argv[4]."\n"; |
73 | 73 | } |
74 | 74 | print 'Files will be generated/updated in directory '.$dir."\n"; |
75 | 75 | |
76 | 76 | if ($argv[2] != 'all') { |
77 | - if (! is_dir($dir.'/'.$argv[2])) { |
|
77 | + if (!is_dir($dir.'/'.$argv[2])) { |
|
78 | 78 | print 'Create directory '.$dir.'/'.$argv[2]."\n"; |
79 | - $result=mkdir($dir.'/'.$argv[2]); |
|
80 | - if (! $result) { |
|
79 | + $result = mkdir($dir.'/'.$argv[2]); |
|
80 | + if (!$result) { |
|
81 | 81 | $db->close(); |
82 | 82 | return -1; |
83 | 83 | } |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | |
27 | 27 | $sapi_type = php_sapi_name(); |
28 | 28 | $script_file = basename(__FILE__); |
29 | -$path=__DIR__.'/'; |
|
29 | +$path = __DIR__.'/'; |
|
30 | 30 | |
31 | 31 | // Test si mode batch |
32 | 32 | if (substr($sapi_type, 0, 3) == 'cgi') { |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | } |
36 | 36 | |
37 | 37 | // Recupere root dolibarr |
38 | -$path=preg_replace('/purge-data.php/i', '', $_SERVER["PHP_SELF"]); |
|
38 | +$path = preg_replace('/purge-data.php/i', '', $_SERVER["PHP_SELF"]); |
|
39 | 39 | require $path."../../htdocs/master.inc.php"; |
40 | 40 | include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; |
41 | 41 | include_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; |
@@ -47,11 +47,11 @@ discard block |
||
47 | 47 | $langs->loadLangs(array("main", "errors")); |
48 | 48 | |
49 | 49 | // Global variables |
50 | -$version=DOL_VERSION; |
|
51 | -$error=0; |
|
50 | +$version = DOL_VERSION; |
|
51 | +$error = 0; |
|
52 | 52 | |
53 | 53 | // List of sql to execute |
54 | -$sqls=array( |
|
54 | +$sqls = array( |
|
55 | 55 | 'user'=>array( |
56 | 56 | "DELETE FROM ".MAIN_DB_PREFIX."user_rights WHERE fk_user IN (SELECT rowid FROM ".MAIN_DB_PREFIX."user WHERE admin = 0 and login != 'admin') AND fk_user IN (select rowid FROM ".MAIN_DB_PREFIX."user where datec < '__DATE__')", |
57 | 57 | "DELETE FROM ".MAIN_DB_PREFIX."user WHERE admin = 0 and login != 'admin' AND datec < '__DATE__'", |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | $option = $argv[2]; |
183 | 183 | $date = $argv[3]; |
184 | 184 | |
185 | -if (empty($mode) || ! in_array($mode, array('test','confirm'))) { |
|
185 | +if (empty($mode) || !in_array($mode, array('test', 'confirm'))) { |
|
186 | 186 | print "Usage: $script_file (test|confirm) (all|option) (all|YYYY-MM-DD) [dbtype dbhost dbuser dbpassword dbname dbport]\n"; |
187 | 187 | print "\n"; |
188 | 188 | print "option can be ".implode(',', array_keys($sqls))."\n"; |
@@ -195,9 +195,9 @@ discard block |
||
195 | 195 | exit(-1); |
196 | 196 | } |
197 | 197 | if ($option != 'all') { |
198 | - $listofoptions=explode(',', $option); |
|
198 | + $listofoptions = explode(',', $option); |
|
199 | 199 | foreach ($listofoptions as $cursoroption) { |
200 | - if (! in_array($cursoroption, array_keys($sqls))) { |
|
200 | + if (!in_array($cursoroption, array_keys($sqls))) { |
|
201 | 201 | print "Usage: $script_file (test|confirm) (all|option) (all|YYYY-MM-DD) [dbtype dbhost dbuser dbpassword dbname dbport]\n"; |
202 | 202 | print "\n"; |
203 | 203 | print "option '".$cursoroption."' must be in list ".implode(',', array_keys($sqls))."\n"; |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | } |
207 | 207 | } |
208 | 208 | |
209 | -if (empty($date) || (! preg_match('/\d\d\d\d\-\d\d\-\d\d$/', $date) && $date != 'all')) { |
|
209 | +if (empty($date) || (!preg_match('/\d\d\d\d\-\d\d\-\d\d$/', $date) && $date != 'all')) { |
|
210 | 210 | print "Usage: $script_file (test|confirm) (all|option) (all|YYYY-MM-DD) [dbtype dbhost dbuser dbpassword dbname dbport]\n"; |
211 | 211 | print "\n"; |
212 | 212 | print "date can be 'all' or 'YYYY-MM-DD' to delete record before YYYY-MM-DD\n"; |
@@ -221,13 +221,13 @@ discard block |
||
221 | 221 | if (!empty($argv[4])) { |
222 | 222 | $db->close(); |
223 | 223 | unset($db); |
224 | - $db=getDoliDBInstance($argv[4], $argv[5], $argv[6], $argv[7], $argv[8], $argv[9]); |
|
225 | - $user=new User($db); |
|
224 | + $db = getDoliDBInstance($argv[4], $argv[5], $argv[6], $argv[7], $argv[8], $argv[9]); |
|
225 | + $user = new User($db); |
|
226 | 226 | } |
227 | 227 | |
228 | 228 | //var_dump($user->db->database_name); |
229 | -$ret=$user->fetch('', 'admin'); |
|
230 | -if (! $ret > 0) { |
|
229 | +$ret = $user->fetch('', 'admin'); |
|
230 | +if (!$ret > 0) { |
|
231 | 231 | print 'An admin user with login "admin" must exists to use this script.'."\n"; |
232 | 232 | exit; |
233 | 233 | } |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | print "User = ".$db->database_user."\n"; |
243 | 243 | print "\n"; |
244 | 244 | |
245 | -if (! $confirmed) { |
|
245 | +if (!$confirmed) { |
|
246 | 246 | print "Hit Enter to continue or CTRL+C to stop...\n"; |
247 | 247 | $input = trim(fgets(STDIN)); |
248 | 248 | } |
@@ -259,10 +259,10 @@ discard block |
||
259 | 259 | { |
260 | 260 | global $db, $sqls; |
261 | 261 | |
262 | - $error=0; |
|
262 | + $error = 0; |
|
263 | 263 | foreach ($sqls[$family] as $sql) { |
264 | 264 | if (preg_match('/^@/', $sql)) { |
265 | - $newfamily=preg_replace('/@/', '', $sql); |
|
265 | + $newfamily = preg_replace('/@/', '', $sql); |
|
266 | 266 | processfamily($newfamily, $date); |
267 | 267 | continue; |
268 | 268 | } |
@@ -271,8 +271,8 @@ discard block |
||
271 | 271 | |
272 | 272 | print "Run sql: ".$sql."\n"; |
273 | 273 | |
274 | - $resql=$db->query($sql); |
|
275 | - if (! $resql) { |
|
274 | + $resql = $db->query($sql); |
|
275 | + if (!$resql) { |
|
276 | 276 | if ($db->errno() != 'DB_ERROR_NOSUCHTABLE') { |
277 | 277 | $error++; |
278 | 278 | } |
@@ -295,9 +295,9 @@ discard block |
||
295 | 295 | |
296 | 296 | $db->begin(); |
297 | 297 | |
298 | -$listofoptions=explode(',', $option); |
|
298 | +$listofoptions = explode(',', $option); |
|
299 | 299 | foreach ($listofoptions as $cursoroption) { |
300 | - $oldfamily=''; |
|
300 | + $oldfamily = ''; |
|
301 | 301 | foreach ($sqls as $family => $familysql) { |
302 | 302 | if ($cursoroption && $cursoroption != 'all' && $cursoroption != $family) { |
303 | 303 | continue; |
@@ -308,7 +308,7 @@ discard block |
||
308 | 308 | } |
309 | 309 | $oldfamily = $family; |
310 | 310 | |
311 | - $result=processfamily($family, $date); |
|
311 | + $result = processfamily($family, $date); |
|
312 | 312 | if ($result < 0) { |
313 | 313 | $error++; |
314 | 314 | break; |
@@ -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)) { |