@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | */ |
44 | 44 | public function __construct($db) |
45 | 45 | { |
46 | - global $conf, $user; // $conf is required by /core/extrafieldsinexport.inc.php |
|
46 | + global $conf, $user; // $conf is required by /core/extrafieldsinexport.inc.php |
|
47 | 47 | |
48 | 48 | $this->db = $db; |
49 | 49 | $this->numero = 80; |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | $this->export_fields_array[$r] = array( |
247 | 247 | 's.rowid'=>"IdCompany", 's.nom'=>'ThirdParty', 's.address'=>'Address', 's.zip'=>'Zip', 's.town'=>'Town', 'd.nom'=>'State', 'co.label'=>'Country', |
248 | 248 | 'co.code'=>'CountryCode', 's.phone'=>'Phone', 's.siren'=>'ProfId1', 's.siret'=>'ProfId2', 's.ape'=>'ProfId3', 's.idprof4'=>'ProfId4', 's.idprof5'=>'ProfId5', |
249 | - 's.idprof6'=>'ProfId6', 'c.rowid'=>"Id", 'c.ref'=>"Ref", 'c.ref_customer'=>"RefCustomer", 'c.fk_soc'=>"IdCompany", 'c.date_creation'=>"DateCreation", 'c.date_valid'=>"DateValidation", |
|
249 | + 's.idprof6'=>'ProfId6', 'c.rowid'=>"Id", 'c.ref'=>"Ref", 'c.ref_customer'=>"RefCustomer", 'c.fk_soc'=>"IdCompany", 'c.date_creation'=>"DateCreation", 'c.date_valid'=>"DateValidation", |
|
250 | 250 | 'c.date_delivery'=>"DateDeliveryPlanned", 'c.tracking_number'=>"TrackingNumber", 'c.height'=>"Height", 'c.width'=>"Width", 'c.size'=>"Depth", |
251 | 251 | 'c.size_units'=>'SizeUnits', 'c.weight'=>"Weight", 'c.weight_units'=>"WeightUnits", 'c.fk_statut'=>'Status', 'c.note_public'=>"NotePublic", |
252 | 252 | 'ed.rowid'=>'LineId', 'cd.description'=>'Description', 'ed.qty'=>"Qty", 'p.rowid'=>'ProductId', 'p.ref'=>'ProductRef', 'p.label'=>'ProductLabel', |
@@ -405,11 +405,11 @@ discard block |
||
405 | 405 | $this->planned_workload = $obj->planned_workload; |
406 | 406 | $this->date_c = $this->db->jdate($obj->datec); |
407 | 407 | $this->date_start = $this->db->jdate($obj->date_start); |
408 | - $this->date_end = $this->db->jdate($obj->date_end); |
|
408 | + $this->date_end = $this->db->jdate($obj->date_end); |
|
409 | 409 | $this->fk_user_creat = $obj->fk_user_creat; |
410 | 410 | $this->fk_user_valid = $obj->fk_user_valid; |
411 | 411 | $this->fk_statut = $obj->status; |
412 | - $this->status = $obj->status; |
|
412 | + $this->status = $obj->status; |
|
413 | 413 | $this->progress = $obj->progress; |
414 | 414 | $this->budget_amount = $obj->budget_amount; |
415 | 415 | $this->priority = $obj->priority; |
@@ -533,7 +533,7 @@ discard block |
||
533 | 533 | * @param Task $task |
534 | 534 | * @return bool |
535 | 535 | */ |
536 | - static function ($allTasksCompleted, $task) { |
|
536 | + static function($allTasksCompleted, $task) { |
|
537 | 537 | return $allTasksCompleted && $task->progress >= 100; |
538 | 538 | }, |
539 | 539 | 1 |
@@ -1161,14 +1161,14 @@ discard block |
||
1161 | 1161 | $tasks[$i]->billed = $obj->billed; |
1162 | 1162 | } |
1163 | 1163 | |
1164 | - $tasks[$i]->progress = $obj->progress; |
|
1164 | + $tasks[$i]->progress = $obj->progress; |
|
1165 | 1165 | $tasks[$i]->fk_statut = $obj->status; |
1166 | - $tasks[$i]->status = $obj->status; |
|
1166 | + $tasks[$i]->status = $obj->status; |
|
1167 | 1167 | $tasks[$i]->public = $obj->public; |
1168 | 1168 | $tasks[$i]->date_start = $this->db->jdate($obj->date_start); |
1169 | 1169 | $tasks[$i]->date_end = $this->db->jdate($obj->date_end); |
1170 | 1170 | $tasks[$i]->rang = $obj->rang; |
1171 | - $tasks[$i]->priority = $obj->priority; |
|
1171 | + $tasks[$i]->priority = $obj->priority; |
|
1172 | 1172 | |
1173 | 1173 | $tasks[$i]->socid = $obj->thirdparty_id; // For backward compatibility |
1174 | 1174 | $tasks[$i]->thirdparty_id = $obj->thirdparty_id; |
@@ -1489,7 +1489,7 @@ discard block |
||
1489 | 1489 | } |
1490 | 1490 | |
1491 | 1491 | // Update hourly rate of this time spent entry |
1492 | - $resql_thm_user = $this->db->query("SELECT thm FROM " . MAIN_DB_PREFIX . "user WHERE rowid = " . ((int) $timespent->fk_user)); |
|
1492 | + $resql_thm_user = $this->db->query("SELECT thm FROM ".MAIN_DB_PREFIX."user WHERE rowid = ".((int) $timespent->fk_user)); |
|
1493 | 1493 | if (!empty($resql_thm_user)) { |
1494 | 1494 | $obj_thm_user = $this->db->fetch_object($resql_thm_user); |
1495 | 1495 | $timespent->thm = $obj_thm_user->thm; |
@@ -1583,7 +1583,7 @@ discard block |
||
1583 | 1583 | $newobj->timespent_line_withhour = $obj->task_date_withhour; |
1584 | 1584 | $newobj->timespent_line_duration = $obj->task_duration; |
1585 | 1585 | $newobj->timespent_line_fk_user = $obj->fk_user; |
1586 | - $newobj->timespent_line_thm = $obj->thm; // hourly rate |
|
1586 | + $newobj->timespent_line_thm = $obj->thm; // hourly rate |
|
1587 | 1587 | $newobj->timespent_line_note = $obj->note; |
1588 | 1588 | |
1589 | 1589 | $arrayres[] = $newobj; |
@@ -1819,7 +1819,7 @@ discard block |
||
1819 | 1819 | $newobj->timespent_withhour = $obj->task_date_withhour; |
1820 | 1820 | $newobj->timespent_duration = $obj->task_duration; |
1821 | 1821 | $newobj->timespent_fk_user = $obj->fk_user; |
1822 | - $newobj->timespent_thm = $obj->thm; // hourly rate |
|
1822 | + $newobj->timespent_thm = $obj->thm; // hourly rate |
|
1823 | 1823 | $newobj->timespent_note = $obj->note; |
1824 | 1824 | |
1825 | 1825 | $arrayres[] = $newobj; |
@@ -1917,14 +1917,14 @@ discard block |
||
1917 | 1917 | if ($ret == 1 && (($this->timespent_old_duration != $this->timespent_duration) || getDolGlobalString('TIMESPENT_ALWAYS_UPDATE_THM'))) { |
1918 | 1918 | if ($this->timespent_old_duration != $this->timespent_duration) { |
1919 | 1919 | // Recalculate amount of time spent for task and update denormalized field |
1920 | - $sql = "UPDATE " . MAIN_DB_PREFIX . "projet_task"; |
|
1921 | - $sql .= " SET duration_effective = (SELECT SUM(element_duration) FROM " . MAIN_DB_PREFIX . "element_time as ptt where ptt.elementtype = 'task' AND ptt.fk_element = " . ((int) $this->id) . ")"; |
|
1920 | + $sql = "UPDATE ".MAIN_DB_PREFIX."projet_task"; |
|
1921 | + $sql .= " SET duration_effective = (SELECT SUM(element_duration) FROM ".MAIN_DB_PREFIX."element_time as ptt where ptt.elementtype = 'task' AND ptt.fk_element = ".((int) $this->id).")"; |
|
1922 | 1922 | if (isset($this->progress)) { |
1923 | - $sql .= ", progress = " . ((float) $this->progress); // Do not overwrite value if not provided |
|
1923 | + $sql .= ", progress = ".((float) $this->progress); // Do not overwrite value if not provided |
|
1924 | 1924 | } |
1925 | - $sql .= " WHERE rowid = " . ((int) $this->id); |
|
1925 | + $sql .= " WHERE rowid = ".((int) $this->id); |
|
1926 | 1926 | |
1927 | - dol_syslog(get_class($this) . "::updateTimeSpent", LOG_DEBUG); |
|
1927 | + dol_syslog(get_class($this)."::updateTimeSpent", LOG_DEBUG); |
|
1928 | 1928 | if (!$this->db->query($sql)) { |
1929 | 1929 | $this->error = $this->db->lasterror(); |
1930 | 1930 | $this->db->rollback(); |
@@ -1935,7 +1935,7 @@ discard block |
||
1935 | 1935 | // Update hourly rate of this time spent entry, but only if it was not set initially |
1936 | 1936 | $res_update = 1; |
1937 | 1937 | if (empty($timespent->thm) || getDolGlobalString('TIMESPENT_ALWAYS_UPDATE_THM')) { |
1938 | - $resql_thm_user = $this->db->query("SELECT thm FROM " . MAIN_DB_PREFIX . "user WHERE rowid = " . ((int) $timespent->fk_user)); |
|
1938 | + $resql_thm_user = $this->db->query("SELECT thm FROM ".MAIN_DB_PREFIX."user WHERE rowid = ".((int) $timespent->fk_user)); |
|
1939 | 1939 | if (!empty($resql_thm_user)) { |
1940 | 1940 | $obj_thm_user = $this->db->fetch_object($resql_thm_user); |
1941 | 1941 | $timespent->thm = $obj_thm_user->thm; |
@@ -2072,8 +2072,8 @@ discard block |
||
2072 | 2072 | |
2073 | 2073 | $defaultref = ''; |
2074 | 2074 | $obj = !getDolGlobalString('PROJECT_TASK_ADDON') ? 'mod_task_simple' : $conf->global->PROJECT_TASK_ADDON; |
2075 | - if (getDolGlobalString('PROJECT_TASK_ADDON') && is_readable(DOL_DOCUMENT_ROOT."/core/modules/project/task/" . getDolGlobalString('PROJECT_TASK_ADDON').".php")) { |
|
2076 | - require_once DOL_DOCUMENT_ROOT."/core/modules/project/task/" . getDolGlobalString('PROJECT_TASK_ADDON').'.php'; |
|
2075 | + if (getDolGlobalString('PROJECT_TASK_ADDON') && is_readable(DOL_DOCUMENT_ROOT."/core/modules/project/task/".getDolGlobalString('PROJECT_TASK_ADDON').".php")) { |
|
2076 | + require_once DOL_DOCUMENT_ROOT."/core/modules/project/task/".getDolGlobalString('PROJECT_TASK_ADDON').'.php'; |
|
2077 | 2077 | $modTask = new $obj(); |
2078 | 2078 | $defaultref = $modTask->getNextValue(0, $clone_task); |
2079 | 2079 | } |
@@ -2122,7 +2122,7 @@ discard block |
||
2122 | 2122 | } |
2123 | 2123 | // End |
2124 | 2124 | if ($error) { |
2125 | - $clone_task_id = 0; // For static tool check |
|
2125 | + $clone_task_id = 0; // For static tool check |
|
2126 | 2126 | } else { |
2127 | 2127 | $clone_task_id = $clone_task->id; |
2128 | 2128 | $clone_task_ref = $clone_task->ref; |
@@ -2571,7 +2571,7 @@ discard block |
||
2571 | 2571 | global $conf, $langs, $hookmanager, $user, $action; |
2572 | 2572 | |
2573 | 2573 | $error = 0; |
2574 | - $task_origin = new Task($this->db); // The thirdparty that we will delete |
|
2574 | + $task_origin = new Task($this->db); // The thirdparty that we will delete |
|
2575 | 2575 | |
2576 | 2576 | dol_syslog("mergeTask merge task id=".$task_origin_id." (will be deleted) into the task id=".$this->id); |
2577 | 2577 |
@@ -27,12 +27,12 @@ discard block |
||
27 | 27 | |
28 | 28 | $sapi_type = php_sapi_name(); |
29 | 29 | $script_file = basename(__FILE__); |
30 | -$path = dirname(__FILE__) . '/'; |
|
30 | +$path = dirname(__FILE__).'/'; |
|
31 | 31 | |
32 | 32 | // Test si mode batch |
33 | 33 | $sapi_type = php_sapi_name(); |
34 | 34 | if (substr($sapi_type, 0, 3) == 'cgi') { |
35 | - echo "Error: You are using PHP for CGI. To execute " . $script_file . " from command line, you must use PHP for CLI mode.\n"; |
|
35 | + echo "Error: You are using PHP for CGI. To execute ".$script_file." from command line, you must use PHP for CLI mode.\n"; |
|
36 | 36 | exit(); |
37 | 37 | } |
38 | 38 | |
@@ -928,19 +928,19 @@ discard block |
||
928 | 928 | fwrite($fh, '<?xml version="1.0" encoding="UTF-8" ?>'."\n"); |
929 | 929 | fwrite($fh, '<rss version="2.0">'."\n"); |
930 | 930 | fwrite($fh, '<channel>'."\n"); |
931 | - fwrite($fh, '<title>' . htmlspecialchars($title_security) . '</title>'."\n"); |
|
932 | - fwrite($fh, '<description>' . htmlspecialchars("Feed of the latest security reports on the project") . '</description>'."\n"); |
|
931 | + fwrite($fh, '<title>'.htmlspecialchars($title_security).'</title>'."\n"); |
|
932 | + fwrite($fh, '<description>'.htmlspecialchars("Feed of the latest security reports on the project").'</description>'."\n"); |
|
933 | 933 | if ($url_site) { |
934 | - fwrite($fh, '<link>' . htmlspecialchars($url_site) . '</link>'."\n"); |
|
934 | + fwrite($fh, '<link>'.htmlspecialchars($url_site).'</link>'."\n"); |
|
935 | 935 | } |
936 | 936 | if ($url_flux) { |
937 | - fwrite($fh, '<atom:link href="' . htmlspecialchars($url_flux) . '" rel="self" type="application/rss+xml" />'."\n"); |
|
937 | + fwrite($fh, '<atom:link href="'.htmlspecialchars($url_flux).'" rel="self" type="application/rss+xml" />'."\n"); |
|
938 | 938 | } |
939 | 939 | // Image |
940 | 940 | fwrite($fh, '<image>'."\n"); |
941 | 941 | fwrite($fh, '<url>https://www.dolibarr.org/medias/image/www.dolibarr.org/badge-openssf.png</url>'."\n"); |
942 | 942 | if ($url_site) { |
943 | - fwrite($fh, '<link>' . htmlspecialchars($url_site) . '</link>'."\n"); |
|
943 | + fwrite($fh, '<link>'.htmlspecialchars($url_site).'</link>'."\n"); |
|
944 | 944 | } |
945 | 945 | fwrite($fh, '</image>'."\n"); |
946 | 946 | |
@@ -948,10 +948,10 @@ discard block |
||
948 | 948 | $alert['url_commit'] = 'https://github.com/Dolibarr/dolibarr/commit/'.$alert['commitid']; |
949 | 949 | |
950 | 950 | fwrite($fh, '<item>'."\n"); |
951 | - fwrite($fh, '<title>' . htmlspecialchars($alert['title']) . '</title>'."\n"); |
|
952 | - fwrite($fh, '<description>' . $alert['description'] . '</description>'."\n"); // no htmlspeciachars here |
|
953 | - fwrite($fh, '<link>' . htmlspecialchars($alert['url_commit']) . '</link>'."\n"); |
|
954 | - fwrite($fh, '<pubDate>' . htmlspecialchars($alert['created_at']) . '</pubDate>'."\n"); |
|
951 | + fwrite($fh, '<title>'.htmlspecialchars($alert['title']).'</title>'."\n"); |
|
952 | + fwrite($fh, '<description>'.$alert['description'].'</description>'."\n"); // no htmlspeciachars here |
|
953 | + fwrite($fh, '<link>'.htmlspecialchars($alert['url_commit']).'</link>'."\n"); |
|
954 | + fwrite($fh, '<pubDate>'.htmlspecialchars($alert['created_at']).'</pubDate>'."\n"); |
|
955 | 955 | fwrite($fh, '</item>'."\n"); |
956 | 956 | } |
957 | 957 |