@@ -95,18 +95,18 @@ discard block |
||
95 | 95 | $placeholder = ''; |
96 | 96 | |
97 | 97 | if ($selected && empty($selected_input_value)) { |
98 | - require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
98 | + require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
99 | 99 | $project = new Project($this->db); |
100 | 100 | $project->fetch($selected); |
101 | 101 | $selected_input_value = $project->ref; |
102 | 102 | } |
103 | - $urloption = 'socid=' . ((int) $socid) . '&htmlname=' . urlencode($htmlname) . '&discardclosed=' . ((int) $discard_closed); |
|
103 | + $urloption = 'socid='.((int) $socid).'&htmlname='.urlencode($htmlname).'&discardclosed='.((int) $discard_closed); |
|
104 | 104 | if ($morefilter == 'usage_organize_event=1') { |
105 | 105 | $urloption .= '&usage_organize_event=1'; |
106 | 106 | } |
107 | - $out .= '<input type="text" class="minwidth200' . ($morecss ? ' ' . $morecss : '') . '" name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . $placeholder . ' />'; |
|
107 | + $out .= '<input type="text" class="minwidth200'.($morecss ? ' '.$morecss : '').'" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' />'; |
|
108 | 108 | |
109 | - $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/projet/ajax/projects.php', $urloption, $conf->global->PROJECT_USE_SEARCH_TO_SELECT, 0, array()); |
|
109 | + $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/projet/ajax/projects.php', $urloption, $conf->global->PROJECT_USE_SEARCH_TO_SELECT, 0, array()); |
|
110 | 110 | } else { |
111 | 111 | $out .= $this->select_projects_list($socid, $selected, $htmlname, $maxlength, $option_only, $show_empty, abs($discard_closed), $forcefocus, $disabled, 0, $filterkey, 1, $forceaddid, $htmlid, $morecss, $morefilter); |
112 | 112 | } |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | // phpcs:enable |
153 | 153 | global $user, $conf, $langs; |
154 | 154 | |
155 | - require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
155 | + require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
156 | 156 | |
157 | 157 | if (empty($htmlid)) { |
158 | 158 | $htmlid = $htmlname; |
@@ -174,26 +174,26 @@ discard block |
||
174 | 174 | |
175 | 175 | // Search all projects |
176 | 176 | $sql = "SELECT p.rowid, p.ref, p.title, p.fk_soc, p.fk_statut, p.public, s.nom as name, s.name_alias"; |
177 | - $sql .= " FROM " . $this->db->prefix() . "projet as p LEFT JOIN " . $this->db->prefix() . "societe as s ON s.rowid = p.fk_soc"; |
|
178 | - $sql .= " WHERE p.entity IN (" . getEntity('project') . ")"; |
|
177 | + $sql .= " FROM ".$this->db->prefix()."projet as p LEFT JOIN ".$this->db->prefix()."societe as s ON s.rowid = p.fk_soc"; |
|
178 | + $sql .= " WHERE p.entity IN (".getEntity('project').")"; |
|
179 | 179 | if ($projectsListId !== false) { |
180 | - $sql .= " AND p.rowid IN (" . $this->db->sanitize($projectsListId) . ")"; |
|
180 | + $sql .= " AND p.rowid IN (".$this->db->sanitize($projectsListId).")"; |
|
181 | 181 | } |
182 | 182 | if ($socid == 0) { |
183 | 183 | $sql .= " AND (p.fk_soc=0 OR p.fk_soc IS NULL)"; |
184 | 184 | } |
185 | 185 | if ($socid > 0) { |
186 | 186 | if (empty($conf->global->PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY)) { |
187 | - $sql .= " AND (p.fk_soc=" . ((int) $socid) . " OR p.fk_soc IS NULL)"; |
|
187 | + $sql .= " AND (p.fk_soc=".((int) $socid)." OR p.fk_soc IS NULL)"; |
|
188 | 188 | } elseif ($conf->global->PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY != 'all') { // PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY is 'all' or a list of ids separated by coma. |
189 | - $sql .= " AND (p.fk_soc IN (" . $this->db->sanitize(((int) $socid) . ", " . $conf->global->PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY) . ") OR p.fk_soc IS NULL)"; |
|
189 | + $sql .= " AND (p.fk_soc IN (".$this->db->sanitize(((int) $socid).", ".$conf->global->PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY).") OR p.fk_soc IS NULL)"; |
|
190 | 190 | } |
191 | 191 | } |
192 | 192 | if (!empty($filterkey)) { |
193 | 193 | $sql .= natural_search(array('p.title', 'p.ref'), $filterkey); |
194 | 194 | } |
195 | 195 | if ($morefilter) { |
196 | - $sql .= ' AND (' . $this->db->sanitize($morefilter, 0, 1) . ')'; |
|
196 | + $sql .= ' AND ('.$this->db->sanitize($morefilter, 0, 1).')'; |
|
197 | 197 | } |
198 | 198 | $sql .= " ORDER BY p.ref ASC"; |
199 | 199 | |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | $morecss .= ' minwidth100'; |
204 | 204 | } |
205 | 205 | if (empty($option_only)) { |
206 | - $out .= '<select class="flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ' id="' . $htmlid . '" name="' . $htmlname . '">'; |
|
206 | + $out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').' id="'.$htmlid.'" name="'.$htmlname.'">'; |
|
207 | 207 | } |
208 | 208 | if (!empty($show_empty)) { |
209 | 209 | if (is_numeric($show_empty)) { |
@@ -229,37 +229,37 @@ discard block |
||
229 | 229 | $labeltoshow = dol_trunc($obj->ref, 18); |
230 | 230 | //if ($obj->public) $labeltoshow.=' ('.$langs->trans("SharedProject").')'; |
231 | 231 | //else $labeltoshow.=' ('.$langs->trans("Private").')'; |
232 | - $labeltoshow .= ', ' . dol_trunc($obj->title, $maxlength); |
|
232 | + $labeltoshow .= ', '.dol_trunc($obj->title, $maxlength); |
|
233 | 233 | if ($obj->name) { |
234 | - $labeltoshow .= ' - ' . $obj->name; |
|
234 | + $labeltoshow .= ' - '.$obj->name; |
|
235 | 235 | if ($obj->name_alias) { |
236 | - $labeltoshow .= ' (' . $obj->name_alias . ')'; |
|
236 | + $labeltoshow .= ' ('.$obj->name_alias.')'; |
|
237 | 237 | } |
238 | 238 | } |
239 | 239 | |
240 | 240 | $disabled = 0; |
241 | 241 | if ($obj->fk_statut == 0) { |
242 | 242 | $disabled = 1; |
243 | - $labeltoshow .= ' - ' . $langs->trans("Draft"); |
|
243 | + $labeltoshow .= ' - '.$langs->trans("Draft"); |
|
244 | 244 | } elseif ($obj->fk_statut == 2) { |
245 | 245 | if ($discard_closed == 2) { |
246 | 246 | $disabled = 1; |
247 | 247 | } |
248 | - $labeltoshow .= ' - ' . $langs->trans("Closed"); |
|
248 | + $labeltoshow .= ' - '.$langs->trans("Closed"); |
|
249 | 249 | } elseif (empty($conf->global->PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY) && $socid > 0 && (!empty($obj->fk_soc) && $obj->fk_soc != $socid)) { |
250 | 250 | $disabled = 1; |
251 | - $labeltoshow .= ' - ' . $langs->trans("LinkedToAnotherCompany"); |
|
251 | + $labeltoshow .= ' - '.$langs->trans("LinkedToAnotherCompany"); |
|
252 | 252 | } |
253 | 253 | |
254 | 254 | if (!empty($selected) && $selected == $obj->rowid) { |
255 | - $out .= '<option value="' . $obj->rowid . '" selected'; |
|
255 | + $out .= '<option value="'.$obj->rowid.'" selected'; |
|
256 | 256 | //if ($disabled) $out.=' disabled'; // with select2, field can't be preselected if disabled |
257 | - $out .= '>' . $labeltoshow . '</option>'; |
|
257 | + $out .= '>'.$labeltoshow.'</option>'; |
|
258 | 258 | } else { |
259 | 259 | if ($hideunselectables && $disabled && ($selected != $obj->rowid)) { |
260 | 260 | $resultat = ''; |
261 | 261 | } else { |
262 | - $resultat = '<option value="' . $obj->rowid . '"'; |
|
262 | + $resultat = '<option value="'.$obj->rowid.'"'; |
|
263 | 263 | if ($disabled) { |
264 | 264 | $resultat .= ' disabled'; |
265 | 265 | } |
@@ -276,7 +276,7 @@ discard block |
||
276 | 276 | 'value' => $obj->ref, |
277 | 277 | 'ref' => $obj->ref, |
278 | 278 | 'labelx' => $labeltoshow, |
279 | - 'label' => ($disabled ? '<span class="opacitymedium">' . $labeltoshow . '</span>' : $labeltoshow), |
|
279 | + 'label' => ($disabled ? '<span class="opacitymedium">'.$labeltoshow.'</span>' : $labeltoshow), |
|
280 | 280 | 'disabled' => (bool) $disabled |
281 | 281 | ); |
282 | 282 | } |
@@ -294,7 +294,7 @@ discard block |
||
294 | 294 | |
295 | 295 | // Use select2 selector |
296 | 296 | if (!empty($conf->use_javascript_ajax)) { |
297 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
297 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
298 | 298 | $comboenhancement = ajax_combobox($htmlid, array(), 0, $forcefocus); |
299 | 299 | $out .= $comboenhancement; |
300 | 300 | $morecss .= ' minwidth100'; |
@@ -337,7 +337,7 @@ discard block |
||
337 | 337 | { |
338 | 338 | global $user, $conf, $langs; |
339 | 339 | |
340 | - require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
340 | + require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
341 | 341 | |
342 | 342 | if (is_null($usertofilter)) { |
343 | 343 | $usertofilter = $user; |
@@ -361,19 +361,19 @@ discard block |
||
361 | 361 | $sql = "SELECT t.rowid, t.ref as tref, t.label as tlabel, t.progress,"; |
362 | 362 | $sql .= " p.rowid as pid, p.ref, p.title, p.fk_soc, p.fk_statut, p.public, p.usage_task,"; |
363 | 363 | $sql .= " s.nom as name"; |
364 | - $sql .= " FROM " . $this->db->prefix() . "projet as p"; |
|
365 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "societe as s ON s.rowid = p.fk_soc,"; |
|
366 | - $sql .= " " . $this->db->prefix() . "projet_task as t"; |
|
367 | - $sql .= " WHERE p.entity IN (" . getEntity('project') . ")"; |
|
364 | + $sql .= " FROM ".$this->db->prefix()."projet as p"; |
|
365 | + $sql .= " LEFT JOIN ".$this->db->prefix()."societe as s ON s.rowid = p.fk_soc,"; |
|
366 | + $sql .= " ".$this->db->prefix()."projet_task as t"; |
|
367 | + $sql .= " WHERE p.entity IN (".getEntity('project').")"; |
|
368 | 368 | $sql .= " AND t.fk_projet = p.rowid"; |
369 | 369 | if ($projectsListId) { |
370 | - $sql .= " AND p.rowid IN (" . $this->db->sanitize($projectsListId) . ")"; |
|
370 | + $sql .= " AND p.rowid IN (".$this->db->sanitize($projectsListId).")"; |
|
371 | 371 | } |
372 | 372 | if ($socid == 0) { |
373 | 373 | $sql .= " AND (p.fk_soc=0 OR p.fk_soc IS NULL)"; |
374 | 374 | } |
375 | 375 | if ($socid > 0) { |
376 | - $sql .= " AND (p.fk_soc=" . ((int) $socid) . " OR p.fk_soc IS NULL)"; |
|
376 | + $sql .= " AND (p.fk_soc=".((int) $socid)." OR p.fk_soc IS NULL)"; |
|
377 | 377 | } |
378 | 378 | $sql .= " ORDER BY p.ref, t.ref ASC"; |
379 | 379 | |
@@ -381,14 +381,14 @@ discard block |
||
381 | 381 | if ($resql) { |
382 | 382 | // Use select2 selector |
383 | 383 | if (empty($option_only) && !empty($conf->use_javascript_ajax)) { |
384 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
384 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
385 | 385 | $comboenhancement = ajax_combobox($htmlname, '', 0, $forcefocus); |
386 | 386 | $out .= $comboenhancement; |
387 | 387 | $morecss .= ' minwidth150imp'; |
388 | 388 | } |
389 | 389 | |
390 | 390 | if (empty($option_only)) { |
391 | - $out .= '<select class="valignmiddle flat' . ($morecss ? ' ' . $morecss : '') . '"' . ($disabled ? ' disabled="disabled"' : '') . ' id="' . $htmlname . '" name="' . $htmlname . '">'; |
|
391 | + $out .= '<select class="valignmiddle flat'.($morecss ? ' '.$morecss : '').'"'.($disabled ? ' disabled="disabled"' : '').' id="'.$htmlname.'" name="'.$htmlname.'">'; |
|
392 | 392 | } |
393 | 393 | if (!empty($show_empty)) { |
394 | 394 | $out .= '<option value="0" class="optiongrey">'; |
@@ -434,58 +434,58 @@ discard block |
||
434 | 434 | $labeltoshow .= dol_trunc($obj->ref, 18); // Project ref |
435 | 435 | //if ($obj->public) $labeltoshow.=' ('.$langs->trans("SharedProject").')'; |
436 | 436 | //else $labeltoshow.=' ('.$langs->trans("Private").')'; |
437 | - $labeltoshow .= ' ' . dol_trunc($obj->title, $maxlength); |
|
437 | + $labeltoshow .= ' '.dol_trunc($obj->title, $maxlength); |
|
438 | 438 | $titletoshow = $labeltoshow; |
439 | 439 | |
440 | 440 | if ($obj->name) { |
441 | - $labeltoshow .= ' (' . $obj->name . ')'; |
|
442 | - $titletoshow .= ' <span class="opacitymedium">(' . $obj->name . ')</span>'; |
|
441 | + $labeltoshow .= ' ('.$obj->name.')'; |
|
442 | + $titletoshow .= ' <span class="opacitymedium">('.$obj->name.')</span>'; |
|
443 | 443 | } |
444 | 444 | |
445 | 445 | $disabled = 0; |
446 | 446 | if ($obj->fk_statut == Project::STATUS_DRAFT) { |
447 | 447 | $disabled = 1; |
448 | - $labeltoshow .= ' - ' . $langs->trans("Draft"); |
|
449 | - $titletoshow .= ' - <span class="opacitymedium">' . $langs->trans("Draft") . '</span>'; |
|
448 | + $labeltoshow .= ' - '.$langs->trans("Draft"); |
|
449 | + $titletoshow .= ' - <span class="opacitymedium">'.$langs->trans("Draft").'</span>'; |
|
450 | 450 | } elseif ($obj->fk_statut == Project::STATUS_CLOSED) { |
451 | 451 | if ($discard_closed == 2) { |
452 | 452 | $disabled = 1; |
453 | 453 | } |
454 | - $labeltoshow .= ' - ' . $langs->trans("Closed"); |
|
455 | - $titletoshow .= ' - <span class="opacitymedium">' . $langs->trans("Closed") . '</span>'; |
|
454 | + $labeltoshow .= ' - '.$langs->trans("Closed"); |
|
455 | + $titletoshow .= ' - <span class="opacitymedium">'.$langs->trans("Closed").'</span>'; |
|
456 | 456 | } elseif ($socid > 0 && (!empty($obj->fk_soc) && $obj->fk_soc != $socid)) { |
457 | 457 | $disabled = 1; |
458 | - $labeltoshow .= ' - ' . $langs->trans("LinkedToAnotherCompany"); |
|
459 | - $titletoshow .= ' - <span class="opacitymedium">' . $langs->trans("LinkedToAnotherCompany") . '</span>'; |
|
458 | + $labeltoshow .= ' - '.$langs->trans("LinkedToAnotherCompany"); |
|
459 | + $titletoshow .= ' - <span class="opacitymedium">'.$langs->trans("LinkedToAnotherCompany").'</span>'; |
|
460 | 460 | } |
461 | 461 | $labeltoshow .= ' - '; |
462 | 462 | $titletoshow .= ' - '; |
463 | 463 | } |
464 | 464 | |
465 | 465 | // Label for task |
466 | - $labeltoshow .= $obj->tref . ' ' . dol_trunc($obj->tlabel, $maxlength); |
|
467 | - $titletoshow .= $obj->tref . ' ' . dol_trunc($obj->tlabel, $maxlength); |
|
466 | + $labeltoshow .= $obj->tref.' '.dol_trunc($obj->tlabel, $maxlength); |
|
467 | + $titletoshow .= $obj->tref.' '.dol_trunc($obj->tlabel, $maxlength); |
|
468 | 468 | if ($obj->usage_task && preg_match('/progress/', $showmore)) { |
469 | - $labeltoshow .= ' <span class="opacitymedium">(' . $obj->progress . '%)</span>'; |
|
470 | - $titletoshow .= ' <span class="opacitymedium">(' . $obj->progress . '%)</span>'; |
|
469 | + $labeltoshow .= ' <span class="opacitymedium">('.$obj->progress.'%)</span>'; |
|
470 | + $titletoshow .= ' <span class="opacitymedium">('.$obj->progress.'%)</span>'; |
|
471 | 471 | } |
472 | 472 | |
473 | 473 | if (!empty($selected) && $selected == $obj->rowid) { |
474 | - $out .= '<option value="' . $obj->rowid . '" selected'; |
|
475 | - $out .= ' data-html="' . dol_escape_htmltag($titletoshow) . '"'; |
|
474 | + $out .= '<option value="'.$obj->rowid.'" selected'; |
|
475 | + $out .= ' data-html="'.dol_escape_htmltag($titletoshow).'"'; |
|
476 | 476 | //if ($disabled) $out.=' disabled'; // with select2, field can't be preselected if disabled |
477 | - $out .= '>' . $labeltoshow . '</option>'; |
|
477 | + $out .= '>'.$labeltoshow.'</option>'; |
|
478 | 478 | } else { |
479 | 479 | if ($hideunselectables && $disabled && ($selected != $obj->rowid)) { |
480 | 480 | $resultat = ''; |
481 | 481 | } else { |
482 | - $resultat = '<option value="' . $obj->rowid . '"'; |
|
482 | + $resultat = '<option value="'.$obj->rowid.'"'; |
|
483 | 483 | if ($disabled) { |
484 | 484 | $resultat .= ' disabled'; |
485 | 485 | } |
486 | 486 | //if ($obj->public) $labeltoshow.=' ('.$langs->trans("Public").')'; |
487 | 487 | //else $labeltoshow.=' ('.$langs->trans("Private").')'; |
488 | - $resultat .= ' data-html="' . dol_escape_htmltag($titletoshow) . '"'; |
|
488 | + $resultat .= ' data-html="'.dol_escape_htmltag($titletoshow).'"'; |
|
489 | 489 | $resultat .= '>'; |
490 | 490 | $resultat .= $labeltoshow; |
491 | 491 | $resultat .= '</option>'; |
@@ -604,30 +604,30 @@ discard block |
||
604 | 604 | if ($linkedtothirdparty) { |
605 | 605 | $sql .= ", s.nom as name"; |
606 | 606 | } |
607 | - $sql .= " FROM " . $this->db->prefix() . $table_element . " as t"; |
|
607 | + $sql .= " FROM ".$this->db->prefix().$table_element." as t"; |
|
608 | 608 | if ($linkedtothirdparty) { |
609 | - $sql .= ", " . $this->db->prefix() . "societe as s"; |
|
609 | + $sql .= ", ".$this->db->prefix()."societe as s"; |
|
610 | 610 | } |
611 | - $sql .= " WHERE " . $projectkey . " is null"; |
|
611 | + $sql .= " WHERE ".$projectkey." is null"; |
|
612 | 612 | if (!empty($socid) && $linkedtothirdparty) { |
613 | 613 | if (is_numeric($socid)) { |
614 | - $sql .= " AND t.fk_soc = " . ((int) $socid); |
|
614 | + $sql .= " AND t.fk_soc = ".((int) $socid); |
|
615 | 615 | } else { |
616 | - $sql .= " AND t.fk_soc IN (" . $this->db->sanitize($socid) . ")"; |
|
616 | + $sql .= " AND t.fk_soc IN (".$this->db->sanitize($socid).")"; |
|
617 | 617 | } |
618 | 618 | } |
619 | 619 | if (!in_array($table_element, array('expensereport_det', 'stock_mouvement'))) { |
620 | - $sql .= ' AND t.entity IN (' . getEntity('project') . ')'; |
|
620 | + $sql .= ' AND t.entity IN ('.getEntity('project').')'; |
|
621 | 621 | } |
622 | 622 | if ($linkedtothirdparty) { |
623 | 623 | $sql .= " AND s.rowid = t.fk_soc"; |
624 | 624 | } |
625 | 625 | if ($sqlfilter) { |
626 | - $sql .= " AND " . $sqlfilter; |
|
626 | + $sql .= " AND ".$sqlfilter; |
|
627 | 627 | } |
628 | 628 | $sql .= " ORDER BY ref DESC"; |
629 | 629 | |
630 | - dol_syslog(get_class($this) . '::select_element', LOG_DEBUG); |
|
630 | + dol_syslog(get_class($this).'::select_element', LOG_DEBUG); |
|
631 | 631 | $resql = $this->db->query($sql); |
632 | 632 | if ($resql) { |
633 | 633 | $num = $this->db->num_rows($resql); |
@@ -635,18 +635,18 @@ discard block |
||
635 | 635 | $sellist = ''; |
636 | 636 | |
637 | 637 | if ($num > 0) { |
638 | - $sellist = '<select class="flat elementselect css' . $table_element . ($morecss ? ' ' . $morecss : '') . '" name="elementselect">'; |
|
639 | - $sellist .= '<option value="-1"' . ($placeholder ? ' class="optiongrey"' : '') . '>' . $placeholder . '</option>'; |
|
638 | + $sellist = '<select class="flat elementselect css'.$table_element.($morecss ? ' '.$morecss : '').'" name="elementselect">'; |
|
639 | + $sellist .= '<option value="-1"'.($placeholder ? ' class="optiongrey"' : '').'>'.$placeholder.'</option>'; |
|
640 | 640 | while ($i < $num) { |
641 | 641 | $obj = $this->db->fetch_object($resql); |
642 | 642 | $ref = $obj->ref ? $obj->ref : $obj->rowid; |
643 | 643 | if (!empty($obj->ref_supplier)) { |
644 | - $ref .= ' (' . $obj->ref_supplier . ')'; |
|
644 | + $ref .= ' ('.$obj->ref_supplier.')'; |
|
645 | 645 | } |
646 | 646 | if (!empty($obj->name)) { |
647 | - $ref .= ' - ' . $obj->name; |
|
647 | + $ref .= ' - '.$obj->name; |
|
648 | 648 | } |
649 | - $sellist .= '<option value="' . $obj->rowid . '">' . $ref . '</option>'; |
|
649 | + $sellist .= '<option value="'.$obj->rowid.'">'.$ref.'</option>'; |
|
650 | 650 | $i++; |
651 | 651 | } |
652 | 652 | $sellist .= '</select>'; |
@@ -664,7 +664,7 @@ discard block |
||
664 | 664 | dol_print_error($this->db); |
665 | 665 | $this->error = $this->db->lasterror(); |
666 | 666 | $this->errors[] = $this->db->lasterror(); |
667 | - dol_syslog(get_class($this) . "::select_element " . $this->error, LOG_ERR); |
|
667 | + dol_syslog(get_class($this)."::select_element ".$this->error, LOG_ERR); |
|
668 | 668 | return -1; |
669 | 669 | } |
670 | 670 | } |
@@ -689,7 +689,7 @@ discard block |
||
689 | 689 | global $conf, $langs, $user; |
690 | 690 | |
691 | 691 | $sql = "SELECT rowid, code, label, percent"; |
692 | - $sql .= " FROM " . $this->db->prefix() . 'c_lead_status'; |
|
692 | + $sql .= " FROM ".$this->db->prefix().'c_lead_status'; |
|
693 | 693 | $sql .= " WHERE active = 1"; |
694 | 694 | $sql .= " ORDER BY position"; |
695 | 695 | |
@@ -698,31 +698,31 @@ discard block |
||
698 | 698 | $num = $this->db->num_rows($resql); |
699 | 699 | $i = 0; |
700 | 700 | if ($num > 0) { |
701 | - $sellist = '<select class="flat oppstatus' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlname . '" name="' . $htmlname . '">'; |
|
701 | + $sellist = '<select class="flat oppstatus'.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.'">'; |
|
702 | 702 | if ($showempty) { |
703 | 703 | // Without  , strange move of screen when switching value |
704 | 704 | $sellist .= '<option value="-1"> </option>'; |
705 | 705 | } |
706 | 706 | if ($showallnone) { |
707 | - $sellist .= '<option value="all"' . ($preselected == 'all' ? ' selected="selected"' : '') . '>-- ' . $langs->trans("OnlyOpportunitiesShort") . '</option>'; |
|
708 | - $sellist .= '<option value="openedopp"' . ($preselected == 'openedopp' ? ' selected="selected"' : '') . '>-- ' . $langs->trans("OpenedOpportunitiesShort") . '</option>'; |
|
709 | - $sellist .= '<option value="notopenedopp"' . ($preselected == 'notopenedopp' ? ' selected="selected"' : '') . '>-- ' . $langs->trans("NotOpenedOpportunitiesShort") . '</option>'; |
|
710 | - $sellist .= '<option value="none"' . ($preselected == 'none' ? ' selected="selected"' : '') . '>-- ' . $langs->trans("NotAnOpportunityShort") . '</option>'; |
|
707 | + $sellist .= '<option value="all"'.($preselected == 'all' ? ' selected="selected"' : '').'>-- '.$langs->trans("OnlyOpportunitiesShort").'</option>'; |
|
708 | + $sellist .= '<option value="openedopp"'.($preselected == 'openedopp' ? ' selected="selected"' : '').'>-- '.$langs->trans("OpenedOpportunitiesShort").'</option>'; |
|
709 | + $sellist .= '<option value="notopenedopp"'.($preselected == 'notopenedopp' ? ' selected="selected"' : '').'>-- '.$langs->trans("NotOpenedOpportunitiesShort").'</option>'; |
|
710 | + $sellist .= '<option value="none"'.($preselected == 'none' ? ' selected="selected"' : '').'>-- '.$langs->trans("NotAnOpportunityShort").'</option>'; |
|
711 | 711 | } |
712 | 712 | while ($i < $num) { |
713 | 713 | $obj = $this->db->fetch_object($resql); |
714 | 714 | |
715 | - $sellist .= '<option value="' . $obj->rowid . '" defaultpercent="' . $obj->percent . '" elemcode="' . $obj->code . '"'; |
|
715 | + $sellist .= '<option value="'.$obj->rowid.'" defaultpercent="'.$obj->percent.'" elemcode="'.$obj->code.'"'; |
|
716 | 716 | if ($obj->rowid == $preselected) { |
717 | 717 | $sellist .= ' selected="selected"'; |
718 | 718 | } |
719 | 719 | $sellist .= '>'; |
720 | 720 | if ($useshortlabel) { |
721 | - $finallabel = ($langs->transnoentitiesnoconv("OppStatus" . $obj->code) != "OppStatus" . $obj->code ? $langs->transnoentitiesnoconv("OppStatus" . $obj->code) : $obj->label); |
|
721 | + $finallabel = ($langs->transnoentitiesnoconv("OppStatus".$obj->code) != "OppStatus".$obj->code ? $langs->transnoentitiesnoconv("OppStatus".$obj->code) : $obj->label); |
|
722 | 722 | } else { |
723 | - $finallabel = ($langs->transnoentitiesnoconv("OppStatus" . $obj->code) != "OppStatus" . $obj->code ? $langs->transnoentitiesnoconv("OppStatus" . $obj->code) : $obj->label); |
|
723 | + $finallabel = ($langs->transnoentitiesnoconv("OppStatus".$obj->code) != "OppStatus".$obj->code ? $langs->transnoentitiesnoconv("OppStatus".$obj->code) : $obj->label); |
|
724 | 724 | if ($showpercent) { |
725 | - $finallabel .= ' (' . $obj->percent . '%)'; |
|
725 | + $finallabel .= ' ('.$obj->percent.'%)'; |
|
726 | 726 | } |
727 | 727 | } |
728 | 728 | $sellist .= $finallabel; |
@@ -751,7 +751,7 @@ discard block |
||
751 | 751 | } else { |
752 | 752 | $this->error = $this->db->lasterror(); |
753 | 753 | $this->errors[] = $this->db->lasterror(); |
754 | - dol_syslog(get_class($this) . "::selectOpportunityStatus " . $this->error, LOG_ERR); |
|
754 | + dol_syslog(get_class($this)."::selectOpportunityStatus ".$this->error, LOG_ERR); |
|
755 | 755 | return -1; |
756 | 756 | } |
757 | 757 | } |
@@ -772,24 +772,24 @@ discard block |
||
772 | 772 | { |
773 | 773 | global $user, $conf, $langs; |
774 | 774 | |
775 | - require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
775 | + require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
776 | 776 | |
777 | 777 | $out = ''; |
778 | 778 | if (empty($lineOnly)) { |
779 | 779 | // Search Invoice |
780 | 780 | $sql = "SELECT f.rowid, f.ref as fref,"; |
781 | 781 | $sql .= ' s.nom as name'; |
782 | - $sql .= ' FROM ' . $this->db->prefix() . 'projet as p'; |
|
783 | - $sql .= ' INNER JOIN ' . $this->db->prefix() . 'societe as s ON s.rowid = p.fk_soc'; |
|
784 | - $sql .= ' INNER JOIN ' . $this->db->prefix() . 'facture as f ON f.fk_projet = p.rowid'; |
|
785 | - $sql .= " WHERE p.entity IN (" . getEntity('project') . ")"; |
|
782 | + $sql .= ' FROM '.$this->db->prefix().'projet as p'; |
|
783 | + $sql .= ' INNER JOIN '.$this->db->prefix().'societe as s ON s.rowid = p.fk_soc'; |
|
784 | + $sql .= ' INNER JOIN '.$this->db->prefix().'facture as f ON f.fk_projet = p.rowid'; |
|
785 | + $sql .= " WHERE p.entity IN (".getEntity('project').")"; |
|
786 | 786 | if (!empty($filters)) { |
787 | 787 | foreach ($filters as $key => $value) { |
788 | 788 | if ($key == 'p.rowid') { |
789 | - $sql .= " AND p.rowid=" . (int) $value; |
|
789 | + $sql .= " AND p.rowid=".(int) $value; |
|
790 | 790 | } |
791 | 791 | if ($key == 'f.rowid') { |
792 | - $sql .= " AND f.rowid=" . (int) $value; |
|
792 | + $sql .= " AND f.rowid=".(int) $value; |
|
793 | 793 | } |
794 | 794 | } |
795 | 795 | } |
@@ -799,26 +799,26 @@ discard block |
||
799 | 799 | if ($resql) { |
800 | 800 | // Use select2 selector |
801 | 801 | if (!empty($conf->use_javascript_ajax)) { |
802 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
802 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
803 | 803 | $comboenhancement = ajax_combobox($htmlNameInvoice, array(array('method'=>'getLines', 'url'=>dol_buildpath('/core/ajax/ajaxinvoiceline.php', 1), 'htmlname'=>$htmlNameInvoiceLine)), 0, 0); |
804 | 804 | $out .= $comboenhancement; |
805 | 805 | $morecss = 'minwidth200imp maxwidth500'; |
806 | 806 | } |
807 | 807 | |
808 | - $out .= '<select class="valignmiddle flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlNameInvoice . '" name="' . $htmlNameInvoice . '">'; |
|
808 | + $out .= '<select class="valignmiddle flat'.($morecss ? ' '.$morecss : '').'" id="'.$htmlNameInvoice.'" name="'.$htmlNameInvoice.'">'; |
|
809 | 809 | $num = $this->db->num_rows($resql); |
810 | 810 | if ($num) { |
811 | 811 | while ($obj = $this->db->fetch_object($resql)) { |
812 | 812 | $labeltoshow = $obj->fref; // Invoice ref |
813 | 813 | if ($obj->name) { |
814 | - $labeltoshow .= ' - ' . $obj->name; |
|
814 | + $labeltoshow .= ' - '.$obj->name; |
|
815 | 815 | } |
816 | 816 | |
817 | - $out .= '<option value="' . $obj->rowid . '" '; |
|
817 | + $out .= '<option value="'.$obj->rowid.'" '; |
|
818 | 818 | if (!empty($selectedInvoiceId) && $selectedInvoiceId == $obj->rowid) { |
819 | 819 | $out .= ' selected '; |
820 | 820 | } |
821 | - $out .= '>' . $labeltoshow . '</option>'; |
|
821 | + $out .= '>'.$labeltoshow.'</option>'; |
|
822 | 822 | } |
823 | 823 | } |
824 | 824 | $out .= '</select>'; |
@@ -830,20 +830,20 @@ discard block |
||
830 | 830 | |
831 | 831 | // Search Invoice Line |
832 | 832 | $sql = "SELECT fd.rowid, fd.label, fd.description"; |
833 | - $sql .= ' FROM ' . $this->db->prefix() . 'projet as p'; |
|
834 | - $sql .= ' INNER JOIN ' . $this->db->prefix() . 'societe as s ON s.rowid = p.fk_soc'; |
|
835 | - $sql .= ' INNER JOIN ' . $this->db->prefix() . 'facture as f ON f.fk_projet = p.rowid'; |
|
836 | - $sql .= ' INNER JOIN ' . $this->db->prefix() . 'facturedet as fd ON fd.fk_facture = f.rowid'; |
|
837 | - $sql .= " WHERE p.entity IN (" . getEntity('project') . ")"; |
|
833 | + $sql .= ' FROM '.$this->db->prefix().'projet as p'; |
|
834 | + $sql .= ' INNER JOIN '.$this->db->prefix().'societe as s ON s.rowid = p.fk_soc'; |
|
835 | + $sql .= ' INNER JOIN '.$this->db->prefix().'facture as f ON f.fk_projet = p.rowid'; |
|
836 | + $sql .= ' INNER JOIN '.$this->db->prefix().'facturedet as fd ON fd.fk_facture = f.rowid'; |
|
837 | + $sql .= " WHERE p.entity IN (".getEntity('project').")"; |
|
838 | 838 | if (!empty($filters)) { |
839 | 839 | foreach ($filters as $key => $value) { |
840 | 840 | if ($key == 'p.rowid') { |
841 | - $sql .= " AND p.rowid=" . (int) $value; |
|
841 | + $sql .= " AND p.rowid=".(int) $value; |
|
842 | 842 | } |
843 | 843 | } |
844 | 844 | } |
845 | 845 | if (!empty($selectedInvoiceId)) { |
846 | - $sql .= " AND f.rowid=" . (int) $selectedInvoiceId; |
|
846 | + $sql .= " AND f.rowid=".(int) $selectedInvoiceId; |
|
847 | 847 | } |
848 | 848 | $sql .= " ORDER BY p.ref, f.ref ASC"; |
849 | 849 | $resql = $this->db->query($sql); |
@@ -851,24 +851,24 @@ discard block |
||
851 | 851 | // Use select2 selector |
852 | 852 | if (empty($lineOnly)) { |
853 | 853 | if (!empty($conf->use_javascript_ajax)) { |
854 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; |
|
854 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; |
|
855 | 855 | $comboenhancement = ajax_combobox($htmlNameInvoiceLine, '', 0, 0); |
856 | 856 | $out .= $comboenhancement; |
857 | 857 | $morecss = 'minwidth200imp maxwidth500'; |
858 | 858 | } |
859 | 859 | |
860 | - $out .= '<select class="valignmiddle flat' . ($morecss ? ' ' . $morecss : '') . '" id="' . $htmlNameInvoiceLine . '" name="' . $htmlNameInvoiceLine . '">'; |
|
860 | + $out .= '<select class="valignmiddle flat'.($morecss ? ' '.$morecss : '').'" id="'.$htmlNameInvoiceLine.'" name="'.$htmlNameInvoiceLine.'">'; |
|
861 | 861 | } |
862 | 862 | $num = $this->db->num_rows($resql); |
863 | 863 | if ($num) { |
864 | 864 | while ($obj = $this->db->fetch_object($resql)) { |
865 | 865 | $labeltoshow .= $obj->description; // Invoice ref |
866 | 866 | |
867 | - $out .= '<option value="' . $obj->rowid . '" '; |
|
867 | + $out .= '<option value="'.$obj->rowid.'" '; |
|
868 | 868 | if (!empty($selectedLineId) && $selectedLineId == $obj->rowid) { |
869 | 869 | $out .= ' selected '; |
870 | 870 | } |
871 | - $out .= '>' . $labeltoshow . '</option>'; |
|
871 | + $out .= '>'.$labeltoshow.'</option>'; |
|
872 | 872 | } |
873 | 873 | } |
874 | 874 | if (empty($lineOnly)) { |
@@ -30,14 +30,14 @@ discard block |
||
30 | 30 | |
31 | 31 | // Load Dolibarr environment |
32 | 32 | require '../../main.inc.php'; |
33 | -require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
34 | -require_once DOL_DOCUMENT_ROOT . '/projet/class/task.class.php'; |
|
35 | -require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; |
|
36 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php'; |
|
37 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; |
|
38 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php'; |
|
39 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php'; |
|
40 | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formintervention.class.php'; |
|
33 | +require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
34 | +require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php'; |
|
35 | +require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; |
|
36 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; |
|
37 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; |
|
38 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; |
|
39 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; |
|
40 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formintervention.class.php'; |
|
41 | 41 | |
42 | 42 | // Load translation files required by the page |
43 | 43 | $langsLoad = array('projects', 'bills', 'orders', 'companies'); |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
165 | 165 | } |
166 | 166 | |
167 | -include DOL_DOCUMENT_ROOT . '/core/actions_changeselectedfields.inc.php'; |
|
167 | +include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; |
|
168 | 168 | |
169 | 169 | // Purge search criteria |
170 | 170 | if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers |
@@ -354,10 +354,10 @@ discard block |
||
354 | 354 | } |
355 | 355 | |
356 | 356 | if ($action == 'confirm_deleteline' && $confirm == "yes" && ($user->hasRight('projet', 'time') || $user->hasRight('projet', 'all', 'creer'))) { |
357 | - $object->fetchTimeSpent(GETPOST('lineid', 'int')); // load properties like $object->timespent_xxx |
|
357 | + $object->fetchTimeSpent(GETPOST('lineid', 'int')); // load properties like $object->timespent_xxx |
|
358 | 358 | |
359 | 359 | if (in_array($object->timespent_fk_user, $childids) || $user->hasRight('projet', 'all', 'creer')) { |
360 | - $result = $object->delTimeSpent($user); // delete line with $object->timespent_id |
|
360 | + $result = $object->delTimeSpent($user); // delete line with $object->timespent_id |
|
361 | 361 | |
362 | 362 | if ($result < 0) { |
363 | 363 | $langs->load("errors"); |
@@ -377,7 +377,7 @@ discard block |
||
377 | 377 | if (count($tasksarray) > 0) { |
378 | 378 | $id = $tasksarray[0]->id; |
379 | 379 | } else { |
380 | - header("Location: " . DOL_URL_ROOT . '/projet/tasks.php?id=' . $projectstatic->id . ($withproject ? '&withproject=1' : '') . (empty($mode) ? '' : '&mode=' . $mode)); |
|
380 | + header("Location: ".DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id.($withproject ? '&withproject=1' : '').(empty($mode) ? '' : '&mode='.$mode)); |
|
381 | 381 | exit; |
382 | 382 | } |
383 | 383 | } |
@@ -414,9 +414,9 @@ discard block |
||
414 | 414 | if (!($projectstatic->thirdparty->id > 0)) { |
415 | 415 | setEventMessages($langs->trans("ThirdPartyRequiredToGenerateInvoice"), null, 'errors'); |
416 | 416 | } else { |
417 | - include_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; |
|
418 | - include_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
419 | - include_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; |
|
417 | + include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; |
|
418 | + include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
419 | + include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; |
|
420 | 420 | |
421 | 421 | $tmpinvoice = new Facture($db); |
422 | 422 | $tmptimespent = new Task($db); |
@@ -481,7 +481,7 @@ discard block |
||
481 | 481 | $arrayoftasks = array(); |
482 | 482 | foreach ($toselect as $key => $value) { |
483 | 483 | // Get userid, timepent |
484 | - $object->fetchTimeSpent($value); // $value is ID of 1 line in timespent table |
|
484 | + $object->fetchTimeSpent($value); // $value is ID of 1 line in timespent table |
|
485 | 485 | $arrayoftasks[$object->timespent_fk_user][(int) $object->timespent_fk_product]['timespent'] += $object->timespent_duration; |
486 | 486 | $arrayoftasks[$object->timespent_fk_user][(int) $object->timespent_fk_product]['totalvaluetodivideby3600'] += ($object->timespent_duration * $object->timespent_thm); |
487 | 487 | } |
@@ -553,7 +553,7 @@ discard block |
||
553 | 553 | } |
554 | 554 | |
555 | 555 | // Add lines |
556 | - $lineid = $tmpinvoice->addline($langs->trans("TimeSpentForInvoice", $username) . ' : ' . $qtyhourtext, $pu_htline, round($qtyhour / $prodDurationHours, 2), $txtvaline, $localtax1line, $localtax2line, ($idprodline > 0 ? $idprodline : 0)); |
|
556 | + $lineid = $tmpinvoice->addline($langs->trans("TimeSpentForInvoice", $username).' : '.$qtyhourtext, $pu_htline, round($qtyhour / $prodDurationHours, 2), $txtvaline, $localtax1line, $localtax2line, ($idprodline > 0 ? $idprodline : 0)); |
|
557 | 557 | if ($lineid < 0) { |
558 | 558 | $error++; |
559 | 559 | setEventMessages(null, $tmpinvoice->errors, 'errors'); |
@@ -586,16 +586,16 @@ discard block |
||
586 | 586 | |
587 | 587 | $arrayoftasks[$object->timespent_id]['timespent'] = $object->timespent_duration; |
588 | 588 | $arrayoftasks[$object->timespent_id]['totalvaluetodivideby3600'] = $object->timespent_duration * $object->timespent_thm; |
589 | - $arrayoftasks[$object->timespent_id]['note'] = $ftask->ref . ' - ' . $ftask->label . ' - ' . $username; |
|
589 | + $arrayoftasks[$object->timespent_id]['note'] = $ftask->ref.' - '.$ftask->label.' - '.$username; |
|
590 | 590 | $arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $object->timespent_note); |
591 | 591 | |
592 | 592 | if (!empty($withdetail)) { |
593 | 593 | if (!empty($object->timespent_withhour)) { |
594 | - $arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $langs->trans("Date") . ': ' . dol_print_date($object->timespent_datehour)); |
|
594 | + $arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $langs->trans("Date").': '.dol_print_date($object->timespent_datehour)); |
|
595 | 595 | } else { |
596 | - $arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $langs->trans("Date") . ': ' . dol_print_date($object->timespent_date)); |
|
596 | + $arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $langs->trans("Date").': '.dol_print_date($object->timespent_date)); |
|
597 | 597 | } |
598 | - $arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $langs->trans("Duration") . ': ' . convertSecondToTime($object->timespent_duration, 'all', $conf->global->MAIN_DURATION_OF_WORKDAY)); |
|
598 | + $arrayoftasks[$object->timespent_id]['note'] = dol_concatdesc($arrayoftasks[$object->timespent_id]['note'], $langs->trans("Duration").': '.convertSecondToTime($object->timespent_duration, 'all', $conf->global->MAIN_DURATION_OF_WORKDAY)); |
|
599 | 599 | } |
600 | 600 | $arrayoftasks[$object->timespent_id]['user'] = $object->timespent_fk_user; |
601 | 601 | $arrayoftasks[$object->timespent_id]['fk_product'] = $object->timespent_fk_product; |
@@ -673,7 +673,7 @@ discard block |
||
673 | 673 | $arrayoftasks = array(); |
674 | 674 | foreach ($toselect as $key => $value) { |
675 | 675 | // Get userid, timepent |
676 | - $object->fetchTimeSpent($value); // Call method to get list of timespent for a timespent line id (We use the utiliy method found into Task object) |
|
676 | + $object->fetchTimeSpent($value); // Call method to get list of timespent for a timespent line id (We use the utiliy method found into Task object) |
|
677 | 677 | // $object->id is now the task id |
678 | 678 | $arrayoftasks[$object->id][(int) $object->timespent_fk_product]['timespent'] += $object->timespent_duration; |
679 | 679 | $arrayoftasks[$object->id][(int) $object->timespent_fk_product]['totalvaluetodivideby3600'] += ($object->timespent_duration * $object->timespent_thm); |
@@ -749,7 +749,7 @@ discard block |
||
749 | 749 | // Add lines |
750 | 750 | $date_start = ''; |
751 | 751 | $date_end = ''; |
752 | - $lineName = $ftask->ref . ' - ' . $ftask->label; |
|
752 | + $lineName = $ftask->ref.' - '.$ftask->label; |
|
753 | 753 | $lineid = $tmpinvoice->addline($lineName, $pu_ht_for_task, price2num($qtyhour / $prodDurationHours, 'MS'), $txtvaline, $localtax1line, $localtax2line, ($idprodline > 0 ? $idprodline : 0), 0, $date_start, $date_end, 0, 0, '', 'HT', 0, 1, -1, 0, '', 0, 0, null, $pa_ht); |
754 | 754 | if ($lineid < 0) { |
755 | 755 | $error++; |
@@ -759,8 +759,8 @@ discard block |
||
759 | 759 | |
760 | 760 | if (!$error) { |
761 | 761 | // Update lineid into line of timespent |
762 | - $sql = 'UPDATE ' . MAIN_DB_PREFIX . 'element_time SET invoice_line_id = ' . ((int) $lineid) . ', invoice_id = ' . ((int) $tmpinvoice->id); |
|
763 | - $sql .= ' WHERE rowid IN (' . $db->sanitize(join(',', $toselect)) . ')'; |
|
762 | + $sql = 'UPDATE '.MAIN_DB_PREFIX.'element_time SET invoice_line_id = '.((int) $lineid).', invoice_id = '.((int) $tmpinvoice->id); |
|
763 | + $sql .= ' WHERE rowid IN ('.$db->sanitize(join(',', $toselect)).')'; |
|
764 | 764 | $result = $db->query($sql); |
765 | 765 | if (!$result) { |
766 | 766 | $error++; |
@@ -796,12 +796,12 @@ discard block |
||
796 | 796 | if (!($projectstatic->thirdparty->id > 0)) { |
797 | 797 | setEventMessages($langs->trans("ThirdPartyRequiredToGenerateIntervention"), null, 'errors'); |
798 | 798 | } else { |
799 | - include_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; |
|
800 | - include_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; |
|
801 | - include_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; |
|
799 | + include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; |
|
800 | + include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; |
|
801 | + include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; |
|
802 | 802 | |
803 | 803 | |
804 | - require_once DOL_DOCUMENT_ROOT . '/fichinter/class/fichinter.class.php'; |
|
804 | + require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; |
|
805 | 805 | $tmpinter = new Fichinter($db); |
806 | 806 | $tmptimespent = new Task($db); |
807 | 807 | $fuser = new User($db); |
@@ -813,7 +813,7 @@ discard block |
||
813 | 813 | $tmpinter->socid = $projectstatic->thirdparty->id; |
814 | 814 | $tmpinter->date = dol_mktime(GETPOST('rehour', 'int'), GETPOST('remin', 'int'), GETPOST('resec', 'int'), GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int')); |
815 | 815 | $tmpinter->fk_project = $projectstatic->id; |
816 | - $tmpinter->description = $projectstatic->title . (!empty($projectstatic->description) ? '-' . $projectstatic->label : ''); |
|
816 | + $tmpinter->description = $projectstatic->title.(!empty($projectstatic->description) ? '-'.$projectstatic->label : ''); |
|
817 | 817 | |
818 | 818 | if ($interToUse) { |
819 | 819 | $tmpinter->fetch($interToUse); |
@@ -846,7 +846,7 @@ discard block |
||
846 | 846 | $qtyhourtext = convertSecondToTime($value['timespent'], 'all', $conf->global->MAIN_DURATION_OF_WORKDAY); |
847 | 847 | |
848 | 848 | // Add lines |
849 | - $lineid = $tmpinter->addline($user, $tmpinter->id, $ftask->label . (!empty($value['note']) ? ' - ' . $value['note'] : ''), $value['date'], $value['timespent']); |
|
849 | + $lineid = $tmpinter->addline($user, $tmpinter->id, $ftask->label.(!empty($value['note']) ? ' - '.$value['note'] : ''), $value['date'], $value['timespent']); |
|
850 | 850 | } |
851 | 851 | } |
852 | 852 | |
@@ -877,9 +877,9 @@ discard block |
||
877 | 877 | //$result = $projectstatic->fetch($object->fk_project); |
878 | 878 | $arrayofselected = is_array($toselect) ? $toselect : array(); |
879 | 879 | |
880 | -$title = $object->ref . ' - ' . $langs->trans("TimeSpent"); |
|
880 | +$title = $object->ref.' - '.$langs->trans("TimeSpent"); |
|
881 | 881 | if (!empty($withproject)) { |
882 | - $title .= ' | ' . $langs->trans("Project") . (!empty($projectstatic->ref) ? ': ' . $projectstatic->ref : ''); |
|
882 | + $title .= ' | '.$langs->trans("Project").(!empty($projectstatic->ref) ? ': '.$projectstatic->ref : ''); |
|
883 | 883 | } |
884 | 884 | $help_url = ''; |
885 | 885 | |
@@ -928,13 +928,13 @@ discard block |
||
928 | 928 | |
929 | 929 | $param = ((!empty($mode) && $mode == 'mine') ? '&mode=mine' : ''); |
930 | 930 | if ($search_user) { |
931 | - $param .= '&search_user=' . ((int) $search_user); |
|
931 | + $param .= '&search_user='.((int) $search_user); |
|
932 | 932 | } |
933 | 933 | if ($search_month) { |
934 | - $param .= '&search_month=' . ((int) $search_month); |
|
934 | + $param .= '&search_month='.((int) $search_month); |
|
935 | 935 | } |
936 | 936 | if ($search_year) { |
937 | - $param .= '&search_year=' . ((int) $search_year); |
|
937 | + $param .= '&search_year='.((int) $search_year); |
|
938 | 938 | } |
939 | 939 | |
940 | 940 | // Project card |
@@ -946,14 +946,14 @@ discard block |
||
946 | 946 | $morehtmlref .= $projectstatic->title; |
947 | 947 | // Thirdparty |
948 | 948 | if (!empty($projectstatic->thirdparty->id) && $projectstatic->thirdparty->id > 0) { |
949 | - $morehtmlref .= '<br>' . $projectstatic->thirdparty->getNomUrl(1, 'project'); |
|
949 | + $morehtmlref .= '<br>'.$projectstatic->thirdparty->getNomUrl(1, 'project'); |
|
950 | 950 | } |
951 | 951 | $morehtmlref .= '</div>'; |
952 | 952 | |
953 | 953 | // Define a complementary filter for search of next/prev ref. |
954 | 954 | if (empty($user->rights->projet->all->lire)) { |
955 | 955 | $objectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 0); |
956 | - $projectstatic->next_prev_filter = " rowid IN (" . $db->sanitize(count($objectsListId) ? join(',', array_keys($objectsListId)) : '0') . ")"; |
|
956 | + $projectstatic->next_prev_filter = " rowid IN (".$db->sanitize(count($objectsListId) ? join(',', array_keys($objectsListId)) : '0').")"; |
|
957 | 957 | } |
958 | 958 | |
959 | 959 | dol_banner_tab($projectstatic, 'project_ref', $linkback, 1, 'ref', 'ref', $morehtmlref, $param); |
@@ -971,25 +971,25 @@ discard block |
||
971 | 971 | print '</td>'; |
972 | 972 | print '<td>'; |
973 | 973 | if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { |
974 | - print '<input type="checkbox" disabled name="usage_opportunity"' . (GETPOSTISSET('usage_opportunity') ? (GETPOST('usage_opportunity', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_opportunity ? ' checked="checked"' : '')) . '"> '; |
|
974 | + print '<input type="checkbox" disabled name="usage_opportunity"'.(GETPOSTISSET('usage_opportunity') ? (GETPOST('usage_opportunity', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_opportunity ? ' checked="checked"' : '')).'"> '; |
|
975 | 975 | $htmltext = $langs->trans("ProjectFollowOpportunity"); |
976 | 976 | print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext); |
977 | 977 | print '<br>'; |
978 | 978 | } |
979 | 979 | if (empty($conf->global->PROJECT_HIDE_TASKS)) { |
980 | - print '<input type="checkbox" disabled name="usage_task"' . (GETPOSTISSET('usage_task') ? (GETPOST('usage_task', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_task ? ' checked="checked"' : '')) . '"> '; |
|
980 | + print '<input type="checkbox" disabled name="usage_task"'.(GETPOSTISSET('usage_task') ? (GETPOST('usage_task', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_task ? ' checked="checked"' : '')).'"> '; |
|
981 | 981 | $htmltext = $langs->trans("ProjectFollowTasks"); |
982 | 982 | print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); |
983 | 983 | print '<br>'; |
984 | 984 | } |
985 | 985 | if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) { |
986 | - print '<input type="checkbox" disabled name="usage_bill_time"' . (GETPOSTISSET('usage_bill_time') ? (GETPOST('usage_bill_time', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_bill_time ? ' checked="checked"' : '')) . '"> '; |
|
986 | + print '<input type="checkbox" disabled name="usage_bill_time"'.(GETPOSTISSET('usage_bill_time') ? (GETPOST('usage_bill_time', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_bill_time ? ' checked="checked"' : '')).'"> '; |
|
987 | 987 | $htmltext = $langs->trans("ProjectBillTimeDescription"); |
988 | 988 | print $form->textwithpicto($langs->trans("BillTime"), $htmltext); |
989 | 989 | print '<br>'; |
990 | 990 | } |
991 | 991 | if (isModEnabled('eventorganization')) { |
992 | - print '<input type="checkbox" disabled name="usage_organize_event"' . (GETPOSTISSET('usage_organize_event') ? (GETPOST('usage_organize_event', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_organize_event ? ' checked="checked"' : '')) . '"> '; |
|
992 | + print '<input type="checkbox" disabled name="usage_organize_event"'.(GETPOSTISSET('usage_organize_event') ? (GETPOST('usage_organize_event', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_organize_event ? ' checked="checked"' : '')).'"> '; |
|
993 | 993 | $htmltext = $langs->trans("EventOrganizationDescriptionLong"); |
994 | 994 | print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext); |
995 | 995 | } |
@@ -997,7 +997,7 @@ discard block |
||
997 | 997 | } |
998 | 998 | |
999 | 999 | // Visibility |
1000 | - print '<tr><td class="titlefield">' . $langs->trans("Visibility") . '</td><td>'; |
|
1000 | + print '<tr><td class="titlefield">'.$langs->trans("Visibility").'</td><td>'; |
|
1001 | 1001 | if ($projectstatic->public) { |
1002 | 1002 | print img_picto($langs->trans('SharedProject'), 'world', 'class="paddingrightonly"'); |
1003 | 1003 | print $langs->trans('SharedProject'); |
@@ -1008,14 +1008,14 @@ discard block |
||
1008 | 1008 | print '</td></tr>'; |
1009 | 1009 | |
1010 | 1010 | // Budget |
1011 | - print '<tr><td>' . $langs->trans("Budget") . '</td><td>'; |
|
1011 | + print '<tr><td>'.$langs->trans("Budget").'</td><td>'; |
|
1012 | 1012 | if (!is_null($projectstatic->budget_amount) && strcmp($projectstatic->budget_amount, '')) { |
1013 | - print '<span class="amount">' . price($projectstatic->budget_amount, '', $langs, 1, 0, 0, $conf->currency) . '</span>'; |
|
1013 | + print '<span class="amount">'.price($projectstatic->budget_amount, '', $langs, 1, 0, 0, $conf->currency).'</span>'; |
|
1014 | 1014 | } |
1015 | 1015 | print '</td></tr>'; |
1016 | 1016 | |
1017 | 1017 | // Date start - end project |
1018 | - print '<tr><td>' . $langs->trans("Dates") . '</td><td>'; |
|
1018 | + print '<tr><td>'.$langs->trans("Dates").'</td><td>'; |
|
1019 | 1019 | $start = dol_print_date($projectstatic->date_start, 'day'); |
1020 | 1020 | print ($start ? $start : '?'); |
1021 | 1021 | $end = dol_print_date($projectstatic->date_end, 'day'); |
@@ -1030,7 +1030,7 @@ discard block |
||
1030 | 1030 | $cols = 2; |
1031 | 1031 | $savobject = $object; |
1032 | 1032 | $object = $projectstatic; |
1033 | - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; |
|
1033 | + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; |
|
1034 | 1034 | $object = $savobject; |
1035 | 1035 | |
1036 | 1036 | print '</table>'; |
@@ -1048,7 +1048,7 @@ discard block |
||
1048 | 1048 | |
1049 | 1049 | // Categories |
1050 | 1050 | if (isModEnabled('categorie')) { |
1051 | - print '<tr><td class="valignmiddle">' . $langs->trans("Categories") . '</td><td>'; |
|
1051 | + print '<tr><td class="valignmiddle">'.$langs->trans("Categories").'</td><td>'; |
|
1052 | 1052 | print $form->showCategories($projectstatic->id, 'project', 1); |
1053 | 1053 | print "</td></tr>"; |
1054 | 1054 | } |
@@ -1077,12 +1077,12 @@ discard block |
||
1077 | 1077 | |
1078 | 1078 | if (!empty($projectidforalltimes)) { |
1079 | 1079 | // We are on tab 'Time Spent' of project |
1080 | - $backtourl = $_SERVER['PHP_SELF'] . '?projectid=' . $projectstatic->id . ($withproject ? '&withproject=1' : ''); |
|
1081 | - $linktocreatetimeUrl = $_SERVER['PHP_SELF'] . '?' . ($withproject ? 'withproject=1' : '') . '&projectid=' . $projectstatic->id . '&action=createtime&token=' . newToken() . $param . '&backtopage=' . urlencode($backtourl); |
|
1080 | + $backtourl = $_SERVER['PHP_SELF'].'?projectid='.$projectstatic->id.($withproject ? '&withproject=1' : ''); |
|
1081 | + $linktocreatetimeUrl = $_SERVER['PHP_SELF'].'?'.($withproject ? 'withproject=1' : '').'&projectid='.$projectstatic->id.'&action=createtime&token='.newToken().$param.'&backtopage='.urlencode($backtourl); |
|
1082 | 1082 | } else { |
1083 | 1083 | // We are on tab 'Time Spent' of task |
1084 | - $backtourl = $_SERVER['PHP_SELF'] . '?id=' . $object->id . ($withproject ? '&withproject=1' : ''); |
|
1085 | - $linktocreatetimeUrl = $_SERVER['PHP_SELF'] . '?' . ($withproject ? 'withproject=1' : '') . ($object->id > 0 ? '&id=' . $object->id : '&projectid=' . $projectstatic->id) . '&action=createtime&token=' . newToken() . $param . '&backtopage=' . urlencode($backtourl); |
|
1084 | + $backtourl = $_SERVER['PHP_SELF'].'?id='.$object->id.($withproject ? '&withproject=1' : ''); |
|
1085 | + $linktocreatetimeUrl = $_SERVER['PHP_SELF'].'?'.($withproject ? 'withproject=1' : '').($object->id > 0 ? '&id='.$object->id : '&projectid='.$projectstatic->id).'&action=createtime&token='.newToken().$param.'&backtopage='.urlencode($backtourl); |
|
1086 | 1086 | } |
1087 | 1087 | } else { |
1088 | 1088 | $linktocreatetimeBtnStatus = -2; |
@@ -1127,19 +1127,19 @@ discard block |
||
1127 | 1127 | print dol_get_fiche_head($head, 'task_time', $langs->trans("Task"), -1, 'projecttask', 0, '', 'reposition'); |
1128 | 1128 | |
1129 | 1129 | if ($action == 'deleteline') { |
1130 | - $urlafterconfirm = $_SERVER["PHP_SELF"] . "?" . ($object->id > 0 ? "id=" . $object->id : 'projectid=' . $projectstatic->id) . '&lineid=' . GETPOST("lineid", 'int') . ($withproject ? '&withproject=1' : ''); |
|
1130 | + $urlafterconfirm = $_SERVER["PHP_SELF"]."?".($object->id > 0 ? "id=".$object->id : 'projectid='.$projectstatic->id).'&lineid='.GETPOST("lineid", 'int').($withproject ? '&withproject=1' : ''); |
|
1131 | 1131 | print $form->formconfirm($urlafterconfirm, $langs->trans("DeleteATimeSpent"), $langs->trans("ConfirmDeleteATimeSpent"), "confirm_deleteline", '', '', 1); |
1132 | 1132 | } |
1133 | 1133 | |
1134 | 1134 | $param = ($withproject ? '&withproject=1' : ''); |
1135 | - $param .= ($param ? '&' : '') . 'id=' . $object->id; // ID of task |
|
1136 | - $linkback = $withproject ? '<a href="' . DOL_URL_ROOT . '/projet/tasks.php?id=' . $projectstatic->id . '">' . $langs->trans("BackToList") . '</a>' : ''; |
|
1135 | + $param .= ($param ? '&' : '').'id='.$object->id; // ID of task |
|
1136 | + $linkback = $withproject ? '<a href="'.DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id.'">'.$langs->trans("BackToList").'</a>' : ''; |
|
1137 | 1137 | |
1138 | 1138 | if (!GETPOST('withproject') || empty($projectstatic->id)) { |
1139 | 1139 | $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1); |
1140 | - $object->next_prev_filter = " fk_projet IN (" . $db->sanitize($projectsListId) . ")"; |
|
1140 | + $object->next_prev_filter = " fk_projet IN (".$db->sanitize($projectsListId).")"; |
|
1141 | 1141 | } else { |
1142 | - $object->next_prev_filter = " fk_projet = " . ((int) $projectstatic->id); |
|
1142 | + $object->next_prev_filter = " fk_projet = ".((int) $projectstatic->id); |
|
1143 | 1143 | } |
1144 | 1144 | |
1145 | 1145 | $morehtmlref = ''; |
@@ -1147,12 +1147,12 @@ discard block |
||
1147 | 1147 | // Project |
1148 | 1148 | if (empty($withproject)) { |
1149 | 1149 | $morehtmlref .= '<div class="refidno">'; |
1150 | - $morehtmlref .= $langs->trans("Project") . ': '; |
|
1150 | + $morehtmlref .= $langs->trans("Project").': '; |
|
1151 | 1151 | $morehtmlref .= $projectstatic->getNomUrl(1); |
1152 | 1152 | $morehtmlref .= '<br>'; |
1153 | 1153 | |
1154 | 1154 | // Third party |
1155 | - $morehtmlref .= $langs->trans("ThirdParty") . ': '; |
|
1155 | + $morehtmlref .= $langs->trans("ThirdParty").': '; |
|
1156 | 1156 | if (!empty($projectstatic->thirdparty) && is_object($projectstatic->thirdparty)) { |
1157 | 1157 | $morehtmlref .= $projectstatic->thirdparty->getNomUrl(1); |
1158 | 1158 | } |
@@ -1168,7 +1168,7 @@ discard block |
||
1168 | 1168 | print '<table class="border centpercent tableforfield">'; |
1169 | 1169 | |
1170 | 1170 | // Task parent |
1171 | - print '<tr><td>' . $langs->trans("ChildOfTask") . '</td><td>'; |
|
1171 | + print '<tr><td>'.$langs->trans("ChildOfTask").'</td><td>'; |
|
1172 | 1172 | if ($object->fk_task_parent > 0) { |
1173 | 1173 | $tasktmp = new Task($db); |
1174 | 1174 | $tasktmp->fetch($object->fk_task_parent); |
@@ -1177,7 +1177,7 @@ discard block |
||
1177 | 1177 | print '</td></tr>'; |
1178 | 1178 | |
1179 | 1179 | // Date start - Date end task |
1180 | - print '<tr><td class="titlefield">' . $langs->trans("DateStart") . ' - ' . $langs->trans("Deadline") . '</td><td>'; |
|
1180 | + print '<tr><td class="titlefield">'.$langs->trans("DateStart").' - '.$langs->trans("Deadline").'</td><td>'; |
|
1181 | 1181 | $start = dol_print_date($object->date_start, 'dayhour'); |
1182 | 1182 | print ($start ? $start : '?'); |
1183 | 1183 | $end = dol_print_date($object->date_end, 'dayhour'); |
@@ -1189,7 +1189,7 @@ discard block |
||
1189 | 1189 | print '</td></tr>'; |
1190 | 1190 | |
1191 | 1191 | // Planned workload |
1192 | - print '<tr><td>' . $langs->trans("PlannedWorkload") . '</td><td>'; |
|
1192 | + print '<tr><td>'.$langs->trans("PlannedWorkload").'</td><td>'; |
|
1193 | 1193 | if ($object->planned_workload) { |
1194 | 1194 | print convertSecondToTime($object->planned_workload, 'allhourmin'); |
1195 | 1195 | } |
@@ -1204,21 +1204,21 @@ discard block |
||
1204 | 1204 | print '<table class="border tableforfield centpercent">'; |
1205 | 1205 | |
1206 | 1206 | // Progress declared |
1207 | - print '<tr><td class="titlefield">' . $langs->trans("ProgressDeclared") . '</td><td>'; |
|
1208 | - print $object->progress != '' ? $object->progress . ' %' : ''; |
|
1207 | + print '<tr><td class="titlefield">'.$langs->trans("ProgressDeclared").'</td><td>'; |
|
1208 | + print $object->progress != '' ? $object->progress.' %' : ''; |
|
1209 | 1209 | print '</td></tr>'; |
1210 | 1210 | |
1211 | 1211 | // Progress calculated |
1212 | - print '<tr><td>' . $langs->trans("ProgressCalculated") . '</td><td>'; |
|
1212 | + print '<tr><td>'.$langs->trans("ProgressCalculated").'</td><td>'; |
|
1213 | 1213 | if ($object->planned_workload) { |
1214 | 1214 | $tmparray = $object->getSummaryOfTimeSpent(); |
1215 | 1215 | if ($tmparray['total_duration'] > 0) { |
1216 | - print round($tmparray['total_duration'] / $object->planned_workload * 100, 2) . ' %'; |
|
1216 | + print round($tmparray['total_duration'] / $object->planned_workload * 100, 2).' %'; |
|
1217 | 1217 | } else { |
1218 | 1218 | print '0 %'; |
1219 | 1219 | } |
1220 | 1220 | } else { |
1221 | - print '<span class="opacitymedium">' . $langs->trans("WorkloadNotDefined") . '</span>'; |
|
1221 | + print '<span class="opacitymedium">'.$langs->trans("WorkloadNotDefined").'</span>'; |
|
1222 | 1222 | } |
1223 | 1223 | print '</td>'; |
1224 | 1224 | |
@@ -1243,7 +1243,7 @@ discard block |
||
1243 | 1243 | |
1244 | 1244 | if ($action == 'deleteline' && !empty($projectidforalltimes)) { |
1245 | 1245 | // We must use projectidprojectid if on list of timespent of project and id=taskid if on list of timespent of a task |
1246 | - $urlafterconfirm = $_SERVER["PHP_SELF"] . "?" . ($projectstatic->id > 0 ? 'projectid=' . $projectstatic->id : ($object->id > 0 ? "id=" . $object->id : '')) . '&lineid=' . GETPOST('lineid', 'int') . ($withproject ? '&withproject=1' : '') . "&contextpage=" . urlencode($contextpage); |
|
1246 | + $urlafterconfirm = $_SERVER["PHP_SELF"]."?".($projectstatic->id > 0 ? 'projectid='.$projectstatic->id : ($object->id > 0 ? "id=".$object->id : '')).'&lineid='.GETPOST('lineid', 'int').($withproject ? '&withproject=1' : '')."&contextpage=".urlencode($contextpage); |
|
1247 | 1247 | $formconfirm = $form->formconfirm($urlafterconfirm, $langs->trans("DeleteATimeSpent"), $langs->trans("ConfirmDeleteATimeSpent"), "confirm_deleteline", '', '', 1); |
1248 | 1248 | } |
1249 | 1249 | |
@@ -1262,10 +1262,10 @@ discard block |
||
1262 | 1262 | // Definition of fields for list |
1263 | 1263 | $arrayfields = array(); |
1264 | 1264 | $arrayfields['t.element_date'] = array('label'=>$langs->trans("Date"), 'checked'=>1); |
1265 | - $arrayfields['p.fk_soc'] = array('label'=>$langs->trans("ThirdParty"), 'type'=>'integer:Societe:/societe/class/societe.class.php:1','checked'=>1); |
|
1265 | + $arrayfields['p.fk_soc'] = array('label'=>$langs->trans("ThirdParty"), 'type'=>'integer:Societe:/societe/class/societe.class.php:1', 'checked'=>1); |
|
1266 | 1266 | $arrayfields['s.name_alias'] = array('label'=>$langs->trans("AliasNameShort"), 'type'=>'integer:Societe:/societe/class/societe.class.php:1'); |
1267 | 1267 | if ((empty($id) && empty($ref)) || !empty($projectidforalltimes)) { // Not a dedicated task |
1268 | - if (! empty($allprojectforuser)) { |
|
1268 | + if (!empty($allprojectforuser)) { |
|
1269 | 1269 | $arrayfields['p.project_ref'] = ['label' => $langs->trans('RefProject'), 'checked' => 1]; |
1270 | 1270 | $arrayfields['p.project_label'] = ['label' => $langs->trans('ProjectLabel'), 'checked' => 1]; |
1271 | 1271 | } |
@@ -1281,82 +1281,82 @@ discard block |
||
1281 | 1281 | $arrayfields['value'] = array('label'=>$langs->trans("Value"), 'checked'=>1, 'enabled'=>isModEnabled("salaries")); |
1282 | 1282 | $arrayfields['valuebilled'] = array('label'=>$langs->trans("Billed"), 'checked'=>1, 'enabled'=>(((getDolGlobalInt('PROJECT_HIDE_TASKS') || !getDolGlobalInt('PROJECT_BILL_TIME_SPENT')) ? 0 : 1) && $projectstatic->usage_bill_time)); |
1283 | 1283 | // Extra fields |
1284 | - include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_array_fields.tpl.php'; |
|
1284 | + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; |
|
1285 | 1285 | |
1286 | 1286 | $arrayfields = dol_sort_array($arrayfields, 'position'); |
1287 | 1287 | |
1288 | 1288 | $param = ''; |
1289 | 1289 | if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { |
1290 | - $param .= '&contextpage=' . urlencode($contextpage); |
|
1290 | + $param .= '&contextpage='.urlencode($contextpage); |
|
1291 | 1291 | } |
1292 | 1292 | if ($limit > 0 && $limit != $conf->liste_limit) { |
1293 | 1293 | $param .= '&limit='.((int) $limit); |
1294 | 1294 | } |
1295 | 1295 | if ($search_month > 0) { |
1296 | - $param .= '&search_month=' . urlencode($search_month); |
|
1296 | + $param .= '&search_month='.urlencode($search_month); |
|
1297 | 1297 | } |
1298 | 1298 | if ($search_year > 0) { |
1299 | - $param .= '&search_year=' . urlencode($search_year); |
|
1299 | + $param .= '&search_year='.urlencode($search_year); |
|
1300 | 1300 | } |
1301 | 1301 | if (!empty($search_user)) { // We keep param if -1 because default value is forced to user id if not set |
1302 | 1302 | $param .= '&search_user='.urlencode($search_user); |
1303 | 1303 | } |
1304 | 1304 | if ($search_task_ref != '') { |
1305 | - $param .= '&search_task_ref=' . urlencode($search_task_ref); |
|
1305 | + $param .= '&search_task_ref='.urlencode($search_task_ref); |
|
1306 | 1306 | } |
1307 | 1307 | if ($search_company != '') { |
1308 | - $param .= '&$search_company=' . urlencode($search_company); |
|
1308 | + $param .= '&$search_company='.urlencode($search_company); |
|
1309 | 1309 | } |
1310 | 1310 | if ($search_company_alias != '') { |
1311 | - $param .= '&$search_company_alias=' . urlencode($search_company_alias); |
|
1311 | + $param .= '&$search_company_alias='.urlencode($search_company_alias); |
|
1312 | 1312 | } |
1313 | 1313 | if ($search_project_ref != '') { |
1314 | - $param .= '&$search_project_ref=' . urlencode($search_project_ref); |
|
1314 | + $param .= '&$search_project_ref='.urlencode($search_project_ref); |
|
1315 | 1315 | } |
1316 | 1316 | if ($search_project_label != '') { |
1317 | - $param .= '&$search_project_label=' . urlencode($search_project_label); |
|
1317 | + $param .= '&$search_project_label='.urlencode($search_project_label); |
|
1318 | 1318 | } |
1319 | 1319 | if ($search_task_label != '') { |
1320 | - $param .= '&search_task_label=' . urlencode($search_task_label); |
|
1320 | + $param .= '&search_task_label='.urlencode($search_task_label); |
|
1321 | 1321 | } |
1322 | 1322 | if ($search_note != '') { |
1323 | - $param .= '&search_note=' . urlencode($search_note); |
|
1323 | + $param .= '&search_note='.urlencode($search_note); |
|
1324 | 1324 | } |
1325 | 1325 | if ($search_duration != '') { |
1326 | - $param .= '&search_field2=' . urlencode($search_duration); |
|
1326 | + $param .= '&search_field2='.urlencode($search_duration); |
|
1327 | 1327 | } |
1328 | 1328 | if ($optioncss != '') { |
1329 | - $param .= '&optioncss=' . urlencode($optioncss); |
|
1329 | + $param .= '&optioncss='.urlencode($optioncss); |
|
1330 | 1330 | } |
1331 | 1331 | if ($search_date_startday) { |
1332 | - $param .= '&search_date_startday=' . urlencode($search_date_startday); |
|
1332 | + $param .= '&search_date_startday='.urlencode($search_date_startday); |
|
1333 | 1333 | } |
1334 | 1334 | if ($search_date_startmonth) { |
1335 | - $param .= '&search_date_startmonth=' . urlencode($search_date_startmonth); |
|
1335 | + $param .= '&search_date_startmonth='.urlencode($search_date_startmonth); |
|
1336 | 1336 | } |
1337 | 1337 | if ($search_date_startyear) { |
1338 | - $param .= '&search_date_startyear=' . urlencode($search_date_startyear); |
|
1338 | + $param .= '&search_date_startyear='.urlencode($search_date_startyear); |
|
1339 | 1339 | } |
1340 | 1340 | if ($search_date_endday) { |
1341 | - $param .= '&search_date_endday=' . urlencode($search_date_endday); |
|
1341 | + $param .= '&search_date_endday='.urlencode($search_date_endday); |
|
1342 | 1342 | } |
1343 | 1343 | if ($search_date_endmonth) { |
1344 | - $param .= '&search_date_endmonth=' . urlencode($search_date_endmonth); |
|
1344 | + $param .= '&search_date_endmonth='.urlencode($search_date_endmonth); |
|
1345 | 1345 | } |
1346 | 1346 | if ($search_date_endyear) { |
1347 | - $param .= '&search_date_endyear=' . urlencode($search_date_endyear); |
|
1347 | + $param .= '&search_date_endyear='.urlencode($search_date_endyear); |
|
1348 | 1348 | } |
1349 | 1349 | if ($search_timespent_starthour) { |
1350 | - $param .= '&search_timespent_duration_starthour=' . urlencode($search_timespent_starthour); |
|
1350 | + $param .= '&search_timespent_duration_starthour='.urlencode($search_timespent_starthour); |
|
1351 | 1351 | } |
1352 | 1352 | if ($search_timespent_startmin) { |
1353 | - $param .= '&search_timespent_duration_startmin=' . urlencode($search_timespent_startmin); |
|
1353 | + $param .= '&search_timespent_duration_startmin='.urlencode($search_timespent_startmin); |
|
1354 | 1354 | } |
1355 | 1355 | if ($search_timespent_endhour) { |
1356 | - $param .= '&search_timespent_duration_endhour=' . urlencode($search_timespent_endhour); |
|
1356 | + $param .= '&search_timespent_duration_endhour='.urlencode($search_timespent_endhour); |
|
1357 | 1357 | } |
1358 | 1358 | if ($search_timespent_endmin) { |
1359 | - $param .= '&search_timespent_duration_endmin=' . urlencode($search_timespent_endmin); |
|
1359 | + $param .= '&search_timespent_duration_endmin='.urlencode($search_timespent_endmin); |
|
1360 | 1360 | } |
1361 | 1361 | |
1362 | 1362 | /* |
@@ -1364,24 +1364,24 @@ discard block |
||
1364 | 1364 | include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; |
1365 | 1365 | */ |
1366 | 1366 | if ($id) { |
1367 | - $param .= '&id=' . urlencode($id); |
|
1367 | + $param .= '&id='.urlencode($id); |
|
1368 | 1368 | } |
1369 | 1369 | if ($projectid) { |
1370 | - $param .= '&projectid=' . urlencode($projectid); |
|
1370 | + $param .= '&projectid='.urlencode($projectid); |
|
1371 | 1371 | } |
1372 | 1372 | if ($withproject) { |
1373 | - $param .= '&withproject=' . urlencode($withproject); |
|
1373 | + $param .= '&withproject='.urlencode($withproject); |
|
1374 | 1374 | } |
1375 | 1375 | // Add $param from hooks |
1376 | 1376 | $parameters = array(); |
1377 | 1377 | $reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object); // Note that $action and $object may have been modified by hook |
1378 | 1378 | $param .= $hookmanager->resPrint; |
1379 | 1379 | |
1380 | - print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">'; |
|
1380 | + print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">'; |
|
1381 | 1381 | if ($optioncss != '') { |
1382 | - print '<input type="hidden" name="optioncss" value="' . $optioncss . '">'; |
|
1382 | + print '<input type="hidden" name="optioncss" value="'.$optioncss.'">'; |
|
1383 | 1383 | } |
1384 | - print '<input type="hidden" name="token" value="' . newToken() . '">'; |
|
1384 | + print '<input type="hidden" name="token" value="'.newToken().'">'; |
|
1385 | 1385 | print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">'; |
1386 | 1386 | if ($action == 'editline') { |
1387 | 1387 | print '<input type="hidden" name="action" value="updateline">'; |
@@ -1396,13 +1396,13 @@ discard block |
||
1396 | 1396 | } else { |
1397 | 1397 | print '<input type="hidden" name="action" value="list">'; |
1398 | 1398 | } |
1399 | - print '<input type="hidden" name="sortfield" value="' . $sortfield . '">'; |
|
1400 | - print '<input type="hidden" name="sortorder" value="' . $sortorder . '">'; |
|
1399 | + print '<input type="hidden" name="sortfield" value="'.$sortfield.'">'; |
|
1400 | + print '<input type="hidden" name="sortorder" value="'.$sortorder.'">'; |
|
1401 | 1401 | |
1402 | - print '<input type="hidden" name="id" value="' . $id . '">'; |
|
1403 | - print '<input type="hidden" name="projectid" value="' . $projectidforalltimes . '">'; |
|
1404 | - print '<input type="hidden" name="withproject" value="' . $withproject . '">'; |
|
1405 | - print '<input type="hidden" name="tab" value="' . $tab . '">'; |
|
1402 | + print '<input type="hidden" name="id" value="'.$id.'">'; |
|
1403 | + print '<input type="hidden" name="projectid" value="'.$projectidforalltimes.'">'; |
|
1404 | + print '<input type="hidden" name="withproject" value="'.$withproject.'">'; |
|
1405 | + print '<input type="hidden" name="tab" value="'.$tab.'">'; |
|
1406 | 1406 | print '<input type="hidden" name="page_y" value="">'; |
1407 | 1407 | |
1408 | 1408 | // Form to convert time spent into invoice |
@@ -1429,7 +1429,7 @@ discard block |
||
1429 | 1429 | 'onelineperperiod' => 'OneLinePerTimeSpentLine', |
1430 | 1430 | ); |
1431 | 1431 | print $form->selectarray('generateinvoicemode', $tmparray, 'onelineperuser', 0, 0, 0, '', 1); |
1432 | - print "\n" . '<script type="text/javascript">'; |
|
1432 | + print "\n".'<script type="text/javascript">'; |
|
1433 | 1433 | print ' |
1434 | 1434 | $(document).ready(function () { |
1435 | 1435 | setDetailVisibility(); |
@@ -1446,8 +1446,8 @@ discard block |
||
1446 | 1446 | } |
1447 | 1447 | }); |
1448 | 1448 | '; |
1449 | - print '</script>' . "\n"; |
|
1450 | - print '<span style="display:none" id="detail_time_duration"><input type="checkbox" value="detail" name="detail_time_duration"/>' . $langs->trans('AddDetailDateAndDuration') . '</span>'; |
|
1449 | + print '</script>'."\n"; |
|
1450 | + print '<span style="display:none" id="detail_time_duration"><input type="checkbox" value="detail" name="detail_time_duration"/>'.$langs->trans('AddDetailDateAndDuration').'</span>'; |
|
1451 | 1451 | print '</td>'; |
1452 | 1452 | print '</tr>'; |
1453 | 1453 | |
@@ -1482,14 +1482,14 @@ discard block |
||
1482 | 1482 | |
1483 | 1483 | print '<br>'; |
1484 | 1484 | print '<div class="center">'; |
1485 | - print '<input type="submit" class="button" id="createbills" name="createbills" value="' . $langs->trans('GenerateBill') . '"> '; |
|
1486 | - print '<input type="submit" class="button button-cancel" id="cancel" name="cancel" value="' . $langs->trans("Cancel") . '">'; |
|
1485 | + print '<input type="submit" class="button" id="createbills" name="createbills" value="'.$langs->trans('GenerateBill').'"> '; |
|
1486 | + print '<input type="submit" class="button button-cancel" id="cancel" name="cancel" value="'.$langs->trans("Cancel").'">'; |
|
1487 | 1487 | print '</div>'; |
1488 | 1488 | print '<br>'; |
1489 | 1489 | } else { |
1490 | - print '<div class="warning">' . $langs->trans("ThirdPartyRequiredToGenerateInvoice") . '</div>'; |
|
1490 | + print '<div class="warning">'.$langs->trans("ThirdPartyRequiredToGenerateInvoice").'</div>'; |
|
1491 | 1491 | print '<div class="center">'; |
1492 | - print '<input type="submit" class="button button-cancel" id="cancel" name="cancel" value="' . $langs->trans("Cancel") . '">'; |
|
1492 | + print '<input type="submit" class="button button-cancel" id="cancel" name="cancel" value="'.$langs->trans("Cancel").'">'; |
|
1493 | 1493 | print '</div>'; |
1494 | 1494 | $massaction = ''; |
1495 | 1495 | } |
@@ -1502,7 +1502,7 @@ discard block |
||
1502 | 1502 | print '<table class="noborder centpercent">'; |
1503 | 1503 | print '<tr>'; |
1504 | 1504 | print '<td class="titlefield">'; |
1505 | - print img_picto('', 'intervention', 'class="pictofixedwidth"') . $langs->trans('InterToUse'); |
|
1505 | + print img_picto('', 'intervention', 'class="pictofixedwidth"').$langs->trans('InterToUse'); |
|
1506 | 1506 | print '</td>'; |
1507 | 1507 | print '<td>'; |
1508 | 1508 | $forminter = new FormIntervention($db); |
@@ -1512,14 +1512,14 @@ discard block |
||
1512 | 1512 | print '</table>'; |
1513 | 1513 | |
1514 | 1514 | print '<div class="center">'; |
1515 | - print '<input type="submit" class="button" id="createinter" name="createinter" value="' . $langs->trans('GenerateInter') . '"> '; |
|
1516 | - print '<input type="submit" class="button" id="cancel" name="cancel" value="' . $langs->trans('Cancel') . '">'; |
|
1515 | + print '<input type="submit" class="button" id="createinter" name="createinter" value="'.$langs->trans('GenerateInter').'"> '; |
|
1516 | + print '<input type="submit" class="button" id="cancel" name="cancel" value="'.$langs->trans('Cancel').'">'; |
|
1517 | 1517 | print '</div>'; |
1518 | 1518 | print '<br>'; |
1519 | 1519 | } else { |
1520 | - print '<div class="warning">' . $langs->trans("ThirdPartyRequiredToGenerateIntervention") . '</div>'; |
|
1520 | + print '<div class="warning">'.$langs->trans("ThirdPartyRequiredToGenerateIntervention").'</div>'; |
|
1521 | 1521 | print '<div class="center">'; |
1522 | - print '<input type="submit" class="button" id="cancel" name="cancel" value="' . $langs->trans('Cancel') . '">'; |
|
1522 | + print '<input type="submit" class="button" id="cancel" name="cancel" value="'.$langs->trans('Cancel').'">'; |
|
1523 | 1523 | print '</div>'; |
1524 | 1524 | $massaction = ''; |
1525 | 1525 | } |
@@ -1580,13 +1580,13 @@ discard block |
||
1580 | 1580 | $sql .= " AND t.fk_element =".((int) $object->id); |
1581 | 1581 | } elseif (!empty($projectidforalltimes)) { |
1582 | 1582 | // Limit on one project |
1583 | - $sql .= " AND pt.fk_projet IN (" . $db->sanitize($projectidforalltimes) . ")"; |
|
1583 | + $sql .= " AND pt.fk_projet IN (".$db->sanitize($projectidforalltimes).")"; |
|
1584 | 1584 | } elseif (!empty($allprojectforuser)) { |
1585 | 1585 | // Limit on on user |
1586 | 1586 | if (empty($search_user)) { |
1587 | 1587 | $search_user = $user->id; |
1588 | 1588 | } |
1589 | - if ($search_user > 0) $sql .= " AND t.fk_user = " . ((int) $search_user); |
|
1589 | + if ($search_user > 0) $sql .= " AND t.fk_user = ".((int) $search_user); |
|
1590 | 1590 | } |
1591 | 1591 | |
1592 | 1592 | if ($search_note) { |
@@ -1638,13 +1638,13 @@ discard block |
||
1638 | 1638 | if ($search_timespent_starthour || $search_timespent_startmin) { |
1639 | 1639 | $timespent_duration_start = $search_timespent_starthour * 60 * 60; // We store duration in seconds |
1640 | 1640 | $timespent_duration_start += ($search_timespent_startmin ? $search_timespent_startmin : 0) * 60; // We store duration in seconds |
1641 | - $sql .= " AND t.element_duration >= " . $timespent_duration_start; |
|
1641 | + $sql .= " AND t.element_duration >= ".$timespent_duration_start; |
|
1642 | 1642 | } |
1643 | 1643 | |
1644 | 1644 | if ($search_timespent_endhour || $search_timespent_endmin) { |
1645 | 1645 | $timespent_duration_end = $search_timespent_endhour * 60 * 60; // We store duration in seconds |
1646 | 1646 | $timespent_duration_end += ($search_timespent_endmin ? $search_timespent_endmin : 0) * 60; // We store duration in seconds |
1647 | - $sql .= " AND t.element_duration <= " . $timespent_duration_end; |
|
1647 | + $sql .= " AND t.element_duration <= ".$timespent_duration_end; |
|
1648 | 1648 | } |
1649 | 1649 | } |
1650 | 1650 | |
@@ -1692,13 +1692,13 @@ discard block |
||
1692 | 1692 | |
1693 | 1693 | if ($num >= 0) { |
1694 | 1694 | if (!empty($projectidforalltimes)) { |
1695 | - print '<!-- List of time spent for project -->' . "\n"; |
|
1695 | + print '<!-- List of time spent for project -->'."\n"; |
|
1696 | 1696 | |
1697 | 1697 | $title = $langs->trans("ListTaskTimeUserProject"); |
1698 | 1698 | |
1699 | 1699 | print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'clock', 0, $linktocreatetime, '', $limit, 0, 0, 1); |
1700 | 1700 | } else { |
1701 | - print '<!-- List of time spent -->' . "\n"; |
|
1701 | + print '<!-- List of time spent -->'."\n"; |
|
1702 | 1702 | |
1703 | 1703 | $title = $langs->trans("ListTaskTimeForTask"); |
1704 | 1704 | |
@@ -1720,26 +1720,26 @@ discard block |
||
1720 | 1720 | * Form to add a new line of time spent |
1721 | 1721 | */ |
1722 | 1722 | if ($action == 'createtime' && $user->hasRight('projet', 'time')) { |
1723 | - print '<!-- table to add time spent -->' . "\n"; |
|
1723 | + print '<!-- table to add time spent -->'."\n"; |
|
1724 | 1724 | if (!empty($id)) { |
1725 | - print '<input type="hidden" name="taskid" value="' . $id . '">'; |
|
1725 | + print '<input type="hidden" name="taskid" value="'.$id.'">'; |
|
1726 | 1726 | } |
1727 | 1727 | |
1728 | 1728 | print '<div class="div-table-responsive-no-min">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table |
1729 | 1729 | print '<table class="noborder nohover centpercent">'; |
1730 | 1730 | |
1731 | 1731 | print '<tr class="liste_titre">'; |
1732 | - print '<td>' . $langs->trans("Date") . '</td>'; |
|
1732 | + print '<td>'.$langs->trans("Date").'</td>'; |
|
1733 | 1733 | if (!empty($allprojectforuser)) { |
1734 | - print '<td>' . $langs->trans("Project") . '</td>'; |
|
1734 | + print '<td>'.$langs->trans("Project").'</td>'; |
|
1735 | 1735 | } |
1736 | 1736 | if (empty($id)) { |
1737 | - print '<td>' . $langs->trans("Task") . '</td>'; |
|
1737 | + print '<td>'.$langs->trans("Task").'</td>'; |
|
1738 | 1738 | } |
1739 | - print '<td>' . $langs->trans("By") . '</td>'; |
|
1740 | - print '<td>' . $langs->trans("Note") . '</td>'; |
|
1741 | - print '<td>' . $langs->trans("NewTimeSpent") . '</td>'; |
|
1742 | - print '<td>' . $langs->trans("ProgressDeclared") . '</td>'; |
|
1739 | + print '<td>'.$langs->trans("By").'</td>'; |
|
1740 | + print '<td>'.$langs->trans("Note").'</td>'; |
|
1741 | + print '<td>'.$langs->trans("NewTimeSpent").'</td>'; |
|
1742 | + print '<td>'.$langs->trans("ProgressDeclared").'</td>'; |
|
1743 | 1743 | if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) { |
1744 | 1744 | print '<td></td>'; |
1745 | 1745 | |
@@ -1793,14 +1793,14 @@ discard block |
||
1793 | 1793 | print $form->select_dolusers((GETPOST('userid', 'int') ? GETPOST('userid', 'int') : $userid), 'userid', 0, '', 0, '', $contactsofproject, 0, 0, 0, '', 0, $langs->trans("ResourceNotAssignedToProject"), 'minwidth150imp maxwidth200'); |
1794 | 1794 | } else { |
1795 | 1795 | if ($nboftasks) { |
1796 | - print img_error($langs->trans('FirstAddRessourceToAllocateTime')) . ' ' . $langs->trans('FirstAddRessourceToAllocateTime'); |
|
1796 | + print img_error($langs->trans('FirstAddRessourceToAllocateTime')).' '.$langs->trans('FirstAddRessourceToAllocateTime'); |
|
1797 | 1797 | } |
1798 | 1798 | } |
1799 | 1799 | print '</td>'; |
1800 | 1800 | |
1801 | 1801 | // Note |
1802 | 1802 | print '<td>'; |
1803 | - print '<textarea name="timespent_note" class="maxwidth100onsmartphone" rows="' . ROWS_2 . '">' . (GETPOST('timespent_note') ? GETPOST('timespent_note') : '') . '</textarea>'; |
|
1803 | + print '<textarea name="timespent_note" class="maxwidth100onsmartphone" rows="'.ROWS_2.'">'.(GETPOST('timespent_note') ? GETPOST('timespent_note') : '').'</textarea>'; |
|
1804 | 1804 | print '</td>'; |
1805 | 1805 | |
1806 | 1806 | // Duration - Time spent |
@@ -1868,7 +1868,7 @@ discard block |
||
1868 | 1868 | $selectedfields .= (is_array($arrayofmassactions) && count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); |
1869 | 1869 | |
1870 | 1870 | print '<div class="div-table-responsive">'; |
1871 | - print '<table class="tagtable nobottomiftotal liste' . ($moreforfilter ? " listwithfilterbefore" : "") . '">' . "\n"; |
|
1871 | + print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n"; |
|
1872 | 1872 | |
1873 | 1873 | // Fields title search |
1874 | 1874 | // -------------------------------------------------------------------- |
@@ -1893,20 +1893,20 @@ discard block |
||
1893 | 1893 | } |
1894 | 1894 | // Thirdparty |
1895 | 1895 | if (!empty($arrayfields['p.fk_soc']['checked'])) { |
1896 | - print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_company" value="' . dol_escape_htmltag($search_company) . '"></td>'; |
|
1896 | + print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_company" value="'.dol_escape_htmltag($search_company).'"></td>'; |
|
1897 | 1897 | } |
1898 | 1898 | |
1899 | 1899 | // Thirdparty alias |
1900 | 1900 | if (!empty($arrayfields['s.name_alias']['checked'])) { |
1901 | - print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_company_alias" value="' . dol_escape_htmltag($search_company_alias) . '"></td>'; |
|
1901 | + print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_company_alias" value="'.dol_escape_htmltag($search_company_alias).'"></td>'; |
|
1902 | 1902 | } |
1903 | 1903 | |
1904 | 1904 | if (!empty($allprojectforuser)) { |
1905 | 1905 | if (!empty($arrayfields['p.project_ref']['checked'])) { |
1906 | - print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_project_ref" value="' . dol_escape_htmltag($search_project_ref) . '"></td>'; |
|
1906 | + print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_project_ref" value="'.dol_escape_htmltag($search_project_ref).'"></td>'; |
|
1907 | 1907 | } |
1908 | 1908 | if (!empty($arrayfields['p.project_label']['checked'])) { |
1909 | - print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_project_label" value="' . dol_escape_htmltag($search_project_label) . '"></td>'; |
|
1909 | + print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="$search_project_label" value="'.dol_escape_htmltag($search_project_label).'"></td>'; |
|
1910 | 1910 | } |
1911 | 1911 | } |
1912 | 1912 | // Task |
@@ -1924,7 +1924,7 @@ discard block |
||
1924 | 1924 | } |
1925 | 1925 | // Note |
1926 | 1926 | if (!empty($arrayfields['t.note']['checked'])) { |
1927 | - print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="search_note" value="' . dol_escape_htmltag($search_note) . '"></td>'; |
|
1927 | + print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="search_note" value="'.dol_escape_htmltag($search_note).'"></td>'; |
|
1928 | 1928 | } |
1929 | 1929 | // Duration |
1930 | 1930 | if (!empty($arrayfields['t.element_duration']['checked'])) { |
@@ -1935,7 +1935,7 @@ discard block |
||
1935 | 1935 | if ($search_timespent_starthour || $search_timespent_startmin) { |
1936 | 1936 | $durationtouse_start = ($search_timespent_starthour * 3600 + $search_timespent_startmin * 60); |
1937 | 1937 | } |
1938 | - print '<div class="nowraponall">' . $langs->trans('from') . ' '; |
|
1938 | + print '<div class="nowraponall">'.$langs->trans('from').' '; |
|
1939 | 1939 | print $form->select_duration('search_timespent_duration_start', $durationtouse_start, 0, 'text', 0, 1); |
1940 | 1940 | print '</div>'; |
1941 | 1941 | |
@@ -1943,7 +1943,7 @@ discard block |
||
1943 | 1943 | if ($search_timespent_endhour || $search_timespent_endmin) { |
1944 | 1944 | $durationtouse_end = ($search_timespent_endhour * 3600 + $search_timespent_endmin * 60); |
1945 | 1945 | } |
1946 | - print '<div class="nowraponall">' . $langs->trans('at') . ' '; |
|
1946 | + print '<div class="nowraponall">'.$langs->trans('at').' '; |
|
1947 | 1947 | print $form->select_duration('search_timespent_duration_end', $durationtouse_end, 0, 'text', 0, 1); |
1948 | 1948 | print '</div>'; |
1949 | 1949 | |
@@ -1959,7 +1959,7 @@ discard block |
||
1959 | 1959 | } |
1960 | 1960 | // Value billed |
1961 | 1961 | if (!empty($arrayfields['valuebilled']['checked'])) { |
1962 | - print '<td class="liste_titre center">' . $form->selectyesno('search_valuebilled', $search_valuebilled, 1, false, 1) . '</td>'; |
|
1962 | + print '<td class="liste_titre center">'.$form->selectyesno('search_valuebilled', $search_valuebilled, 1, false, 1).'</td>'; |
|
1963 | 1963 | } |
1964 | 1964 | |
1965 | 1965 | /* |
@@ -1977,7 +1977,7 @@ discard block |
||
1977 | 1977 | print $searchpicto; |
1978 | 1978 | print '</td>'; |
1979 | 1979 | } |
1980 | - print '</tr>' . "\n"; |
|
1980 | + print '</tr>'."\n"; |
|
1981 | 1981 | |
1982 | 1982 | $totalarray = array(); |
1983 | 1983 | $totalarray['nbfield'] = 0; |
@@ -2087,7 +2087,7 @@ discard block |
||
2087 | 2087 | if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { |
2088 | 2088 | print '<td class="center nowraponall">'; |
2089 | 2089 | if (($action == 'editline' || $action == 'splitline') && GETPOST('lineid', 'int') == $task_time->rowid) { |
2090 | - print '<input type="hidden" name="lineid" value="' . GETPOST('lineid', 'int') . '">'; |
|
2090 | + print '<input type="hidden" name="lineid" value="'.GETPOST('lineid', 'int').'">'; |
|
2091 | 2091 | print '<input type="submit" class="button buttongen smallpaddingimp margintoponlyshort marginbottomonlyshort button-save" name="save" value="'.$langs->trans("Save").'">'; |
2092 | 2092 | print ' '; |
2093 | 2093 | print '<input type="submit" class="button buttongen smallpaddingimp margintoponlyshort marginbottomonlyshort button-cancel" name="cancel" value="'.$langs->trans("Cancel").'">'; |
@@ -2095,7 +2095,7 @@ discard block |
||
2095 | 2095 | if (in_array($task_time->fk_user, $childids) || $user->hasRight('projet', 'all', 'creer')) { |
2096 | 2096 | if (getDolGlobalString('MAIN_FEATURES_LEVEL') >= 2) { |
2097 | 2097 | print ' '; |
2098 | - print '<a class="reposition" href="' . $_SERVER["PHP_SELF"] . '?action=splitline&token=' . newToken() . '&lineid=' . $task_time->rowid . $param . ((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '') . '">'; |
|
2098 | + print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=splitline&token='.newToken().'&lineid='.$task_time->rowid.$param.((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '').'">'; |
|
2099 | 2099 | print img_split('', 'class="pictofixedwidth"'); |
2100 | 2100 | print '</a>'; |
2101 | 2101 | } |
@@ -2114,7 +2114,7 @@ discard block |
||
2114 | 2114 | $selected = 1; |
2115 | 2115 | } |
2116 | 2116 | print ' '; |
2117 | - print '<input id="cb' . $task_time->rowid . '" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="' . $task_time->rowid . '"' . ($selected ? ' checked="checked"' : '') . '>'; |
|
2117 | + print '<input id="cb'.$task_time->rowid.'" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="'.$task_time->rowid.'"'.($selected ? ' checked="checked"' : '').'>'; |
|
2118 | 2118 | } |
2119 | 2119 | } |
2120 | 2120 | } |
@@ -2232,7 +2232,7 @@ discard block |
||
2232 | 2232 | } |
2233 | 2233 | } |
2234 | 2234 | } elseif ($action !== 'createtime') { |
2235 | - print '<input type="hidden" name="taskid" value="' . $id . '">'; |
|
2235 | + print '<input type="hidden" name="taskid" value="'.$id.'">'; |
|
2236 | 2236 | } |
2237 | 2237 | |
2238 | 2238 | // Task label |
@@ -2262,7 +2262,7 @@ discard block |
||
2262 | 2262 | print img_object('', 'user', 'class="hideonsmartphone"'); |
2263 | 2263 | print $form->select_dolusers($task_time->fk_user, 'userid_line', 0, '', 0, '', $contactsoftask, '0', 0, 0, '', 0, '', 'maxwidth200'); |
2264 | 2264 | } else { |
2265 | - print img_error($langs->trans('FirstAddRessourceToAllocateTime')) . $langs->trans('FirstAddRessourceToAllocateTime'); |
|
2265 | + print img_error($langs->trans('FirstAddRessourceToAllocateTime')).$langs->trans('FirstAddRessourceToAllocateTime'); |
|
2266 | 2266 | } |
2267 | 2267 | } else { |
2268 | 2268 | $userstatic->id = $task_time->fk_user; |
@@ -2282,7 +2282,7 @@ discard block |
||
2282 | 2282 | if (!empty($arrayfields['t.note']['checked'])) { |
2283 | 2283 | print '<td class="small">'; |
2284 | 2284 | if ($action == 'editline' && GETPOST('lineid', 'int') == $task_time->rowid) { |
2285 | - print '<textarea name="timespent_note_line" width="95%" rows="' . ROWS_1 . '">' . dol_escape_htmltag($task_time->note, 0, 1) . '</textarea>'; |
|
2285 | + print '<textarea name="timespent_note_line" width="95%" rows="'.ROWS_1.'">'.dol_escape_htmltag($task_time->note, 0, 1).'</textarea>'; |
|
2286 | 2286 | } else { |
2287 | 2287 | print dol_nl2br($task_time->note); |
2288 | 2288 | } |
@@ -2291,7 +2291,7 @@ discard block |
||
2291 | 2291 | $totalarray['nbfield']++; |
2292 | 2292 | } |
2293 | 2293 | } elseif ($action == 'editline' && GETPOST('lineid', 'int') == $task_time->rowid) { |
2294 | - print '<input type="hidden" name="timespent_note_line" value="' . dol_escape_htmltag($task_time->note, 0, 1) . '">'; |
|
2294 | + print '<input type="hidden" name="timespent_note_line" value="'.dol_escape_htmltag($task_time->note, 0, 1).'">'; |
|
2295 | 2295 | } |
2296 | 2296 | |
2297 | 2297 | // Time spent |
@@ -2351,7 +2351,7 @@ discard block |
||
2351 | 2351 | $value = price2num($task_time->thm * $task_time->element_duration / 3600, 'MT', 1); |
2352 | 2352 | |
2353 | 2353 | print '<td class="nowraponall right">'; |
2354 | - print '<span class="amount" title="' . $langs->trans("THM") . ': ' . price($task_time->thm) . '">'; |
|
2354 | + print '<span class="amount" title="'.$langs->trans("THM").': '.price($task_time->thm).'">'; |
|
2355 | 2355 | print price($value, 1, $langs, 1, -1, -1, $conf->currency); |
2356 | 2356 | print '</span>'; |
2357 | 2357 | print '</td>'; |
@@ -2384,7 +2384,7 @@ discard block |
||
2384 | 2384 | if ($task_time->invoice_id) { |
2385 | 2385 | $result = $tmpinvoice->fetch($task_time->invoice_id); |
2386 | 2386 | if ($result > 0) { |
2387 | - if ($action=='editline' && $_GET['lineid'] == $task_time->rowid) { |
|
2387 | + if ($action == 'editline' && $_GET['lineid'] == $task_time->rowid) { |
|
2388 | 2388 | print $formproject->selectInvoiceAndLine($task_time->invoice_id, $task_time->invoice_line_id, 'invoiceid', 'invoicelineid', 'maxwidth500', array('p.rowid'=>$projectstatic->id)); |
2389 | 2389 | } else { |
2390 | 2390 | print $tmpinvoice->getNomUrl(1); |
@@ -2402,7 +2402,7 @@ discard block |
||
2402 | 2402 | print $langs->trans("No"); |
2403 | 2403 | } |
2404 | 2404 | } else { |
2405 | - print '<span class="opacitymedium">' . $langs->trans("NA") . '</span>'; |
|
2405 | + print '<span class="opacitymedium">'.$langs->trans("NA").'</span>'; |
|
2406 | 2406 | } |
2407 | 2407 | } |
2408 | 2408 | print '</td>'; |
@@ -2433,7 +2433,7 @@ discard block |
||
2433 | 2433 | if (in_array($task_time->fk_user, $childids) || $user->hasRight('projet', 'all', 'creer')) { |
2434 | 2434 | if (getDolGlobalString('MAIN_FEATURES_LEVEL') >= 2) { |
2435 | 2435 | print ' '; |
2436 | - print '<a class="reposition" href="' . $_SERVER["PHP_SELF"] . '?action=splitline&token=' . newToken() . '&lineid=' . $task_time->rowid . $param . ((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '') . '">'; |
|
2436 | + print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=splitline&token='.newToken().'&lineid='.$task_time->rowid.$param.((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '').'">'; |
|
2437 | 2437 | print img_split('', 'class="pictofixedwidth"'); |
2438 | 2438 | print '</a>'; |
2439 | 2439 | } |
@@ -2452,7 +2452,7 @@ discard block |
||
2452 | 2452 | $selected = 1; |
2453 | 2453 | } |
2454 | 2454 | print ' '; |
2455 | - print '<input id="cb' . $task_time->rowid . '" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="' . $task_time->rowid . '"' . ($selected ? ' checked="checked"' : '') . '>'; |
|
2455 | + print '<input id="cb'.$task_time->rowid.'" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="'.$task_time->rowid.'"'.($selected ? ' checked="checked"' : '').'>'; |
|
2456 | 2456 | } |
2457 | 2457 | } |
2458 | 2458 | } |
@@ -2542,7 +2542,7 @@ discard block |
||
2542 | 2542 | print img_object('', 'user', 'class="hideonsmartphone"'); |
2543 | 2543 | print $form->select_dolusers($task_time->fk_user, 'userid_line', 0, '', 0, '', $contactsoftask); |
2544 | 2544 | } else { |
2545 | - print img_error($langs->trans('FirstAddRessourceToAllocateTime')) . $langs->trans('FirstAddRessourceToAllocateTime'); |
|
2545 | + print img_error($langs->trans('FirstAddRessourceToAllocateTime')).$langs->trans('FirstAddRessourceToAllocateTime'); |
|
2546 | 2546 | } |
2547 | 2547 | } else { |
2548 | 2548 | $userstatic->id = $task_time->fk_user; |
@@ -2559,13 +2559,13 @@ discard block |
||
2559 | 2559 | if (!empty($arrayfields['t.note']['checked'])) { |
2560 | 2560 | print '<td class="tdoverflowmax300">'; |
2561 | 2561 | if ($action == 'splitline' && GETPOST('lineid', 'int') == $task_time->rowid) { |
2562 | - print '<textarea name="timespent_note_line" width="95%" rows="' . ROWS_1 . '">' . dol_escape_htmltag($task_time->note, 0, 1) . '</textarea>'; |
|
2562 | + print '<textarea name="timespent_note_line" width="95%" rows="'.ROWS_1.'">'.dol_escape_htmltag($task_time->note, 0, 1).'</textarea>'; |
|
2563 | 2563 | } else { |
2564 | 2564 | print dol_nl2br($task_time->note); |
2565 | 2565 | } |
2566 | 2566 | print '</td>'; |
2567 | 2567 | } elseif ($action == 'splitline' && GETPOST('lineid', 'int') == $task_time->rowid) { |
2568 | - print '<input type="hidden" name="timespent_note_line" rows="' . ROWS_1 . '" value="' . dol_escape_htmltag($task_time->note, 0, 1) . '">'; |
|
2568 | + print '<input type="hidden" name="timespent_note_line" rows="'.ROWS_1.'" value="'.dol_escape_htmltag($task_time->note, 0, 1).'">'; |
|
2569 | 2569 | } |
2570 | 2570 | |
2571 | 2571 | // Time spent |
@@ -2698,7 +2698,7 @@ discard block |
||
2698 | 2698 | print img_object('', 'user', 'class="hideonsmartphone"'); |
2699 | 2699 | print $form->select_dolusers($task_time->fk_user, 'userid_line_2', 0, '', 0, '', $contactsoftask); |
2700 | 2700 | } else { |
2701 | - print img_error($langs->trans('FirstAddRessourceToAllocateTime')) . $langs->trans('FirstAddRessourceToAllocateTime'); |
|
2701 | + print img_error($langs->trans('FirstAddRessourceToAllocateTime')).$langs->trans('FirstAddRessourceToAllocateTime'); |
|
2702 | 2702 | } |
2703 | 2703 | } else { |
2704 | 2704 | $userstatic->id = $task_time->fk_user; |
@@ -2715,13 +2715,13 @@ discard block |
||
2715 | 2715 | if (!empty($arrayfields['t.note']['checked'])) { |
2716 | 2716 | print '<td class="small tdoverflowmax300"">'; |
2717 | 2717 | if ($action == 'splitline' && GETPOST('lineid', 'int') == $task_time->rowid) { |
2718 | - print '<textarea name="timespent_note_line_2" width="95%" rows="' . ROWS_1 . '">' . dol_escape_htmltag($task_time->note, 0, 1) . '</textarea>'; |
|
2718 | + print '<textarea name="timespent_note_line_2" width="95%" rows="'.ROWS_1.'">'.dol_escape_htmltag($task_time->note, 0, 1).'</textarea>'; |
|
2719 | 2719 | } else { |
2720 | 2720 | print dol_nl2br($task_time->note); |
2721 | 2721 | } |
2722 | 2722 | print '</td>'; |
2723 | 2723 | } elseif ($action == 'splitline' && GETPOST('lineid', 'int') == $task_time->rowid) { |
2724 | - print '<input type="hidden" name="timespent_note_line_2" value="' . dol_escape_htmltag($task_time->note, 0, 1) . '">'; |
|
2724 | + print '<input type="hidden" name="timespent_note_line_2" value="'.dol_escape_htmltag($task_time->note, 0, 1).'">'; |
|
2725 | 2725 | } |
2726 | 2726 | |
2727 | 2727 | // Time spent |
@@ -2793,14 +2793,14 @@ discard block |
||
2793 | 2793 | $i++; |
2794 | 2794 | if ($i == 1) { |
2795 | 2795 | if ($num < $limit && empty($offset)) { |
2796 | - print '<td class="left">' . $langs->trans("Total") . '</td>'; |
|
2796 | + print '<td class="left">'.$langs->trans("Total").'</td>'; |
|
2797 | 2797 | } else { |
2798 | 2798 | print '<td class="left">'.$form->textwithpicto($langs->trans("Total"), $langs->trans("Totalforthispage")).'</td>'; |
2799 | 2799 | } |
2800 | 2800 | } elseif ($totalarray['totaldurationfield'] == $i) { |
2801 | - print '<td class="right">' . convertSecondToTime($totalarray['totalduration'], 'allhourmin') . '</td>'; |
|
2801 | + print '<td class="right">'.convertSecondToTime($totalarray['totalduration'], 'allhourmin').'</td>'; |
|
2802 | 2802 | } elseif ($totalarray['totalvaluefield'] == $i) { |
2803 | - print '<td class="right">' . price($totalarray['totalvalue']) . '</td>'; |
|
2803 | + print '<td class="right">'.price($totalarray['totalvalue']).'</td>'; |
|
2804 | 2804 | //} elseif ($totalarray['totalvaluebilledfield'] == $i) { print '<td class="center">'.price($totalarray['totalvaluebilled']).'</td>'; |
2805 | 2805 | } else { |
2806 | 2806 | print '<td></td>'; |
@@ -2816,8 +2816,8 @@ discard block |
||
2816 | 2816 | $totalnboffields++; |
2817 | 2817 | } |
2818 | 2818 | } |
2819 | - print '<tr class="oddeven"><td colspan="' . $totalnboffields . '">'; |
|
2820 | - print '<span class="opacitymedium">' . $langs->trans("None") . '</span>'; |
|
2819 | + print '<tr class="oddeven"><td colspan="'.$totalnboffields.'">'; |
|
2820 | + print '<span class="opacitymedium">'.$langs->trans("None").'</span>'; |
|
2821 | 2821 | print '</td></tr>'; |
2822 | 2822 | } |
2823 | 2823 |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | public $error; //!< To return error code (or message) |
42 | 42 | public $errors = array(); //!< To return several error codes (or messages) |
43 | 43 | |
44 | - public $output; // To store output of some cron methods |
|
44 | + public $output; // To store output of some cron methods |
|
45 | 45 | |
46 | 46 | |
47 | 47 | /** |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | { |
67 | 67 | global $conf, $langs, $user; |
68 | 68 | |
69 | - $managedfor = getDolGlobalString('PARTNERSHIP_IS_MANAGED_FOR', 'thirdparty'); |
|
69 | + $managedfor = getDolGlobalString('PARTNERSHIP_IS_MANAGED_FOR', 'thirdparty'); |
|
70 | 70 | |
71 | 71 | if ($managedfor != 'member') { |
72 | 72 | return 0; // If option 'PARTNERSHIP_IS_MANAGED_FOR' = 'thirdparty', this cron job does nothing. |
@@ -201,9 +201,9 @@ discard block |
||
201 | 201 | |
202 | 202 | $object->actiontypecode = $actiontypecode; // Type of event ('AC_OTH', 'AC_OTH_AUTO', 'AC_XXX'...) |
203 | 203 | $object->actionmsg = $arraydefaultmessage->topic."\n".$arraydefaultmessage->content; // Long text |
204 | - $object->actionmsg2 = $langs->transnoentities("PartnershipSentByEMail", $object->ref);; // Short text ($langs->transnoentities('MailSentBy')...); |
|
204 | + $object->actionmsg2 = $langs->transnoentities("PartnershipSentByEMail", $object->ref); ; // Short text ($langs->transnoentities('MailSentBy')...); |
|
205 | 205 | if (!empty($conf->global->MAIN_MAIL_REPLACE_EVENT_TITLE_BY_EMAIL_SUBJECT)) { |
206 | - $object->actionmsg2 = $subject; // Short text |
|
206 | + $object->actionmsg2 = $subject; // Short text |
|
207 | 207 | } |
208 | 208 | |
209 | 209 | $object->trackid = $trackid; |
@@ -415,9 +415,9 @@ discard block |
||
415 | 415 | } |
416 | 416 | $object->actiontypecode = $actiontypecode; // Type of event ('AC_OTH', 'AC_OTH_AUTO', 'AC_XXX'...) |
417 | 417 | $object->actionmsg = $arraydefaultmessage->topic."\n".$arraydefaultmessage->content; // Long text |
418 | - $object->actionmsg2 = $langs->transnoentities("PartnershipSentByEMail", $object->ref);; // Short text ($langs->transnoentities('MailSentBy')...); |
|
418 | + $object->actionmsg2 = $langs->transnoentities("PartnershipSentByEMail", $object->ref); ; // Short text ($langs->transnoentities('MailSentBy')...); |
|
419 | 419 | if (!empty($conf->global->MAIN_MAIL_REPLACE_EVENT_TITLE_BY_EMAIL_SUBJECT)) { |
420 | - $object->actionmsg2 = $subject; // Short text |
|
420 | + $object->actionmsg2 = $subject; // Short text |
|
421 | 421 | } |
422 | 422 | |
423 | 423 | $object->trackid = $trackid; |
@@ -118,7 +118,9 @@ discard block |
||
118 | 118 | |
119 | 119 | $obj = $this->db->fetch_object($resql); |
120 | 120 | if ($obj) { |
121 | - if (!empty($partnershipsprocessed[$obj->rowid])) continue; |
|
121 | + if (!empty($partnershipsprocessed[$obj->rowid])) { |
|
122 | + continue; |
|
123 | + } |
|
122 | 124 | |
123 | 125 | if ($somethingdoneonpartnership >= $MAXPERCALL) { |
124 | 126 | dol_syslog("We reach the limit of ".$MAXPERCALL." partnership processed, so we quit loop for this batch doCancelStatusOfMemberPartnership to avoid to reach email quota.", LOG_WARNING); |
@@ -140,8 +142,11 @@ discard block |
||
140 | 142 | $error++; |
141 | 143 | $this->error = $object->error; |
142 | 144 | if (is_array($object->errors) && count($object->errors)) { |
143 | - if (is_array($this->errors)) $this->errors = array_merge($this->errors, $object->errors); |
|
144 | - else $this->errors = $object->errors; |
|
145 | + if (is_array($this->errors)) { |
|
146 | + $this->errors = array_merge($this->errors, $object->errors); |
|
147 | + } else { |
|
148 | + $this->errors = $object->errors; |
|
149 | + } |
|
145 | 150 | } |
146 | 151 | } else { |
147 | 152 | $partnershipsprocessed[$object->id] = $object->ref; |
@@ -159,7 +164,9 @@ discard block |
||
159 | 164 | // Define output language |
160 | 165 | $outputlangs = $langs; |
161 | 166 | $newlang = ''; |
162 | - if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) $newlang = GETPOST('lang_id', 'aZ09'); |
|
167 | + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) { |
|
168 | + $newlang = GETPOST('lang_id', 'aZ09'); |
|
169 | + } |
|
163 | 170 | if (!empty($newlang)) { |
164 | 171 | $outputlangs = new Translate("", $conf); |
165 | 172 | $outputlangs->setDefaultLang($newlang); |
@@ -192,7 +199,9 @@ discard block |
||
192 | 199 | if (!$result || !empty($cmail->error) || !empty($cmail->errors)) { |
193 | 200 | $erroremail .= ($erroremail ? ', ' : '').$cmail->error; |
194 | 201 | $this->errors[] = $cmail->error; |
195 | - if (is_array($cmail->errors) && count($cmail->errors) > 0) $this->errors += $cmail->errors; |
|
202 | + if (is_array($cmail->errors) && count($cmail->errors) > 0) { |
|
203 | + $this->errors += $cmail->errors; |
|
204 | + } |
|
196 | 205 | } else { |
197 | 206 | // Initialisation of datas of object to call trigger |
198 | 207 | if (is_object($object)) { |
@@ -241,12 +250,16 @@ discard block |
||
241 | 250 | if (!$error) { |
242 | 251 | $this->db->commit(); |
243 | 252 | $this->output = $numofexpiredmembers.' expired partnership members found'."\n"; |
244 | - if ($erroremail) $this->output .= '. Got errors when sending some email : '.$erroremail; |
|
253 | + if ($erroremail) { |
|
254 | + $this->output .= '. Got errors when sending some email : '.$erroremail; |
|
255 | + } |
|
245 | 256 | } else { |
246 | 257 | $this->db->rollback(); |
247 | 258 | $this->output = "Rollback after error\n"; |
248 | 259 | $this->output .= $numofexpiredmembers.' expired partnership members found'."\n"; |
249 | - if ($erroremail) $this->output .= '. Got errors when sending some email : '.$erroremail; |
|
260 | + if ($erroremail) { |
|
261 | + $this->output .= '. Got errors when sending some email : '.$erroremail; |
|
262 | + } |
|
250 | 263 | } |
251 | 264 | |
252 | 265 | return ($error ? 1 : 0); |
@@ -375,7 +388,9 @@ discard block |
||
375 | 388 | // Define output language |
376 | 389 | $outputlangs = $langs; |
377 | 390 | $newlang = ''; |
378 | - if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) $newlang = GETPOST('lang_id', 'aZ09'); |
|
391 | + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) { |
|
392 | + $newlang = GETPOST('lang_id', 'aZ09'); |
|
393 | + } |
|
379 | 394 | if (!empty($newlang)) { |
380 | 395 | $outputlangs = new Translate("", $conf); |
381 | 396 | $outputlangs->setDefaultLang($newlang); |
@@ -403,7 +418,9 @@ discard block |
||
403 | 418 | if (!$result || !empty($cmail->error) || !empty($cmail->errors)) { |
404 | 419 | $erroremail .= ($erroremail ? ', ' : '').$cmail->error; |
405 | 420 | $this->errors[] = $cmail->error; |
406 | - if (is_array($cmail->errors) && count($cmail->errors) > 0) $this->errors += $cmail->errors; |
|
421 | + if (is_array($cmail->errors) && count($cmail->errors) > 0) { |
|
422 | + $this->errors += $cmail->errors; |
|
423 | + } |
|
407 | 424 | } else { |
408 | 425 | // Initialisation of datas of object to call trigger |
409 | 426 | if (is_object($object)) { |
@@ -476,9 +493,15 @@ discard block |
||
476 | 493 | $this->output = "Rollback after error\n"; |
477 | 494 | } |
478 | 495 | $this->output .= $numofexpiredmembers.' partnership checked'."\n"; |
479 | - if ($erroremail) $this->output .= '. Got errors when sending some email : '.$erroremail."\n"; |
|
480 | - if ($emailnotfound) $this->output .= '. Email not found for some partner : '.$emailnotfound."\n"; |
|
481 | - if ($websitenotfound) $this->output .= '. Website not found for some partner : '.$websitenotfound."\n"; |
|
496 | + if ($erroremail) { |
|
497 | + $this->output .= '. Got errors when sending some email : '.$erroremail."\n"; |
|
498 | + } |
|
499 | + if ($emailnotfound) { |
|
500 | + $this->output .= '. Email not found for some partner : '.$emailnotfound."\n"; |
|
501 | + } |
|
502 | + if ($websitenotfound) { |
|
503 | + $this->output .= '. Website not found for some partner : '.$websitenotfound."\n"; |
|
504 | + } |
|
482 | 505 | $this->output .= "\nSQL used to find partnerships to scan: ".$sql; |
483 | 506 | |
484 | 507 | return ($error ? 1 : 0); |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | $dateendvalidity = dol_mktime(0, 0, 0, GETPOST('dateendvaliditymonth', 'int'), GETPOST('dateendvalidityday', 'int'), GETPOST('dateendvalidityyear', 'int')); |
85 | 85 | $dateofbirth = dol_mktime(0, 0, 0, GETPOST('dateofbirthmonth', 'int'), GETPOST('dateofbirthday', 'int'), GETPOST('dateofbirthyear', 'int')); |
86 | 86 | |
87 | -$childids = $user->getAllChildIds(1); // For later, test on salary visibility |
|
87 | +$childids = $user->getAllChildIds(1); // For later, test on salary visibility |
|
88 | 88 | |
89 | 89 | $object = new User($db); |
90 | 90 | $extrafields = new ExtraFields($db); |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | // Define value to know what current user can do on users |
117 | 117 | $canadduser = (!empty($user->admin) || $user->hasRight("user", "user", "write")); |
118 | 118 | $canreaduser = (!empty($user->admin) || $user->hasRight("user", "user", "read")); |
119 | -$canedituser = (!empty($user->admin) || $user->hasRight("user", "user", "write")); // edit other user |
|
119 | +$canedituser = (!empty($user->admin) || $user->hasRight("user", "user", "write")); // edit other user |
|
120 | 120 | $candisableuser = (!empty($user->admin) || $user->hasRight("user", "user", "delete")); |
121 | 121 | $canreadgroup = $canreaduser; |
122 | 122 | $caneditgroup = $canedituser; |
@@ -441,7 +441,7 @@ discard block |
||
441 | 441 | } |
442 | 442 | $object->gender = GETPOST("gender", 'aZ09'); |
443 | 443 | if ($caneditpasswordandsee) { |
444 | - $object->pass = GETPOST("password", 'none'); // We can keep 'none' for password fields |
|
444 | + $object->pass = GETPOST("password", 'none'); // We can keep 'none' for password fields |
|
445 | 445 | } |
446 | 446 | if ($caneditpasswordandsee || $user->hasRight("api", "apikey", "generate")) { |
447 | 447 | $object->api_key = (GETPOST("api_key", 'alphanohtml')) ? GETPOST("api_key", 'alphanohtml') : $object->api_key; |
@@ -549,7 +549,7 @@ discard block |
||
549 | 549 | } |
550 | 550 | } |
551 | 551 | |
552 | - $ret = $object->update($user); // This may include call to setPassword if password has changed |
|
552 | + $ret = $object->update($user); // This may include call to setPassword if password has changed |
|
553 | 553 | if ($ret < 0) { |
554 | 554 | $error++; |
555 | 555 | if ($db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') { |
@@ -678,7 +678,7 @@ discard block |
||
678 | 678 | ) { |
679 | 679 | $object->fetch($id); |
680 | 680 | |
681 | - $newpassword = $object->setPassword($user, ''); // This will generate a new password |
|
681 | + $newpassword = $object->setPassword($user, ''); // This will generate a new password |
|
682 | 682 | if (is_int($newpassword) && $newpassword < 0) { |
683 | 683 | // Echec |
684 | 684 | setEventMessages($langs->trans("ErrorFailedToSetNewPassword"), null, 'errors'); |
@@ -1906,7 +1906,7 @@ discard block |
||
1906 | 1906 | print '<td>'; |
1907 | 1907 | if (!empty($object->api_key)) { |
1908 | 1908 | print '<span class="opacitymedium">'; |
1909 | - print showValueWithClipboardCPButton($object->api_key, 1, $langs->trans("Hidden")); // TODO Add an option to also reveal the hash, not only copy paste |
|
1909 | + print showValueWithClipboardCPButton($object->api_key, 1, $langs->trans("Hidden")); // TODO Add an option to also reveal the hash, not only copy paste |
|
1910 | 1910 | print '</span>'; |
1911 | 1911 | } |
1912 | 1912 | print '</td></tr>'; |
@@ -1958,7 +1958,7 @@ discard block |
||
1958 | 1958 | $langs->load("mails"); |
1959 | 1959 | $params['attr']['title'] = $langs->trans('NoEMail'); |
1960 | 1960 | } |
1961 | - print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=presend&mode=init#formmailbeforetitle', '', $canSendMail, $params); |
|
1961 | + print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=presend&mode=init#formmailbeforetitle', '', $canSendMail, $params); |
|
1962 | 1962 | } |
1963 | 1963 | |
1964 | 1964 | if ($caneditfield && (!isModEnabled('multicompany') || !$user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $object->entity == 1))) { |
@@ -2024,12 +2024,12 @@ discard block |
||
2024 | 2024 | ); |
2025 | 2025 | if ($user->id <> $id && $candisableuser && $object->statut == 0 && |
2026 | 2026 | ((!isModEnabled('multicompany') && $object->entity == $user->entity) || !$user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $object->entity == 1))) { |
2027 | - print dolGetButtonAction($langs->trans('Reactivate'), '', 'default', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=enable&token='.newToken(), '', true, $params); |
|
2027 | + print dolGetButtonAction($langs->trans('Reactivate'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=enable&token='.newToken(), '', true, $params); |
|
2028 | 2028 | } |
2029 | 2029 | // Disable user |
2030 | 2030 | if ($user->id <> $id && $candisableuser && $object->statut == 1 && |
2031 | 2031 | ((!isModEnabled('multicompany') && $object->entity == $user->entity) || !$user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $object->entity == 1))) { |
2032 | - print dolGetButtonAction($langs->trans('DisableUser'), '', 'default', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=disable&token='.newToken(), '', true, $params); |
|
2032 | + print dolGetButtonAction($langs->trans('DisableUser'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=disable&token='.newToken(), '', true, $params); |
|
2033 | 2033 | } else { |
2034 | 2034 | if ($user->id == $id) { |
2035 | 2035 | $params['attr']['title'] = $langs->trans('CantDisableYourself'); |
@@ -2616,7 +2616,7 @@ discard block |
||
2616 | 2616 | print '<span class="fa '.$value['icon'].' pictofixedwidth"></span>'; |
2617 | 2617 | } |
2618 | 2618 | if ($caneditfield && empty($object->ldap_sid)) { |
2619 | - print '<input type="text" name="'.$key.'" class="flat maxwidth200" value="'.(isset($object->socialnetworks[$key])?$object->socialnetworks[$key]:'').'">'; |
|
2619 | + print '<input type="text" name="'.$key.'" class="flat maxwidth200" value="'.(isset($object->socialnetworks[$key]) ? $object->socialnetworks[$key] : '').'">'; |
|
2620 | 2620 | } else { |
2621 | 2621 | print '<input type="hidden" name="'.$key.'" value="'.$object->socialnetworks[$key].'">'; |
2622 | 2622 | print $object->socialnetworks[$key]; |
@@ -2624,7 +2624,7 @@ discard block |
||
2624 | 2624 | print '</td></tr>'; |
2625 | 2625 | } else { |
2626 | 2626 | // if social network is not active but value exist we do not want to loose it |
2627 | - print '<input type="hidden" name="'.$key.'" value="'.(isset($object->socialnetworks[$key])?$object->socialnetworks[$key]:'').'">'; |
|
2627 | + print '<input type="hidden" name="'.$key.'" value="'.(isset($object->socialnetworks[$key]) ? $object->socialnetworks[$key] : '').'">'; |
|
2628 | 2628 | } |
2629 | 2629 | } |
2630 | 2630 | } |