diff --git a/htdocs/admin/delais.php b/htdocs/admin/delais.php index 14332ceee63..41b2f489904 100644 --- a/htdocs/admin/delais.php +++ b/htdocs/admin/delais.php @@ -41,6 +41,10 @@ $modules=array( ) ), 'projet' => array( + array( + 'code' => 'MAIN_DELAY_PROJECT_TO_CLOSE', + 'img' => 'project' + ), array( 'code' => 'MAIN_DELAY_TASKS_TODO', 'img' => 'task' diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index cfb4ff4f9cf..35b0d4024ec 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -508,7 +508,7 @@ class Conf { $this->projet->warning_delay=(isset($this->global->MAIN_DELAY_PROJECT_TO_CLOSE)?$this->global->MAIN_DELAY_PROJECT_TO_CLOSE:7)*24*60*60; $this->projet->task = new StdClass(); - $this->projet->task->warning_delay=(isset($this->global->MAIN_DELAY_TASKS_TODO)?$this->global->MAIN_DELAY_ACTIONS_TODO:7)*24*60*60; + $this->projet->task->warning_delay=(isset($this->global->MAIN_DELAY_TASKS_TODO)?$this->global->MAIN_DELAY_TASKS_TODO:7)*24*60*60; } if (isset($this->commande)) { diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 159708de61f..3d0a5ab182f 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -254,7 +254,7 @@ class Form * @param string $value Value to show/edit * @param string $htmlname DIV ID (field name) * @param int $condition Condition to edit - * @param string $inputType Type of input ('numeric', 'datepicker', 'textarea:rows:cols', 'ckeditor:dolibarr_zzz:width:height:?:1:rows:cols', 'select:xxx') + * @param string $inputType Type of input ('string', 'numeric', 'datepicker', 'textarea:rows:cols', 'ckeditor:dolibarr_zzz:width:height:?:1:rows:cols', 'select:xxx') * @param string $editvalue When in edit mode, use this value as $value instead of value * @param object $extObject External object * @param mixed $custommsg String or Array of custom messages : eg array('success' => 'MyMessage', 'error' => 'MyMessage') @@ -299,6 +299,7 @@ class Form $inputType=$tmp[0]; if (! empty($tmp[1])) $inputOption=$tmp[1]; if (! empty($tmp[2])) $savemethod=$tmp[2]; + $out.= ''."\n"; } else if ((preg_match('/^datepicker/',$inputType)) || (preg_match('/^datehourpicker/',$inputType))) { @@ -363,7 +364,6 @@ class Form $out.= ''."\n"; $out.= ''."\n"; } - $out.= ''.$value.''."\n"; $out.= ''.(! empty($editvalue) ? $editvalue : $value).''."\n"; } diff --git a/htdocs/core/js/editinplace.js b/htdocs/core/js/editinplace.js index 17d70220b31..7607ba6f885 100644 --- a/htdocs/core/js/editinplace.js +++ b/htdocs/core/js/editinplace.js @@ -127,7 +127,7 @@ $(document).ready(function() { $('.editval_string').editable(urlSaveInPlace, { type : 'text', id : 'field', - width : 300, + width : withInPlace, /* Size of string area in px ? */ tooltip : tooltipInPlace, placeholder : placeholderInPlace, cancel : cancelInPlace, diff --git a/htdocs/core/modules/modProjet.class.php b/htdocs/core/modules/modProjet.class.php index 8de0d100194..2d71eaba5a1 100644 --- a/htdocs/core/modules/modProjet.class.php +++ b/htdocs/core/modules/modProjet.class.php @@ -124,13 +124,18 @@ class modProjet extends DolibarrModules $this->const[$r][4] = 0; $r++; - /* not required (0 = not present) - $this->const[$r][0] = "PROJECT_HIDE_TASKS"; + $this->const[$r][0] = "MAIN_DELAY_PROJECT_TO_CLOSE"; $this->const[$r][1] = "chaine"; - $this->const[$r][2] = "0"; + $this->const[$r][2] = "7"; $this->const[$r][3] = ""; $this->const[$r][4] = 0; - */ + $r++; + $this->const[$r][0] = "MAIN_DELAY_TASKS_TODO"; + $this->const[$r][1] = "chaine"; + $this->const[$r][2] = "7"; + $this->const[$r][3] = ""; + $this->const[$r][4] = 0; + $r++; // Boxes $this->boxes = array(); diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 60b86e25dd0..d0a745ab491 100755 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -979,8 +979,9 @@ DelayBeforeWarning=Delay before warning DelaysBeforeWarning=Delays before warning DelaysOfToleranceBeforeWarning=Tolerance delays before warning DelaysOfToleranceDesc=This screen allows you to define the tolerated delays before an alert is reported on screen with picto %s for each late element. -Delays_MAIN_DELAY_ACTIONS_TODO=Delay tolerance (in days) before alert on planned events not completed yet -Delays_MAIN_DELAY_TASKS_TODO=Delay tolerance (in days) before alert on planned tasks not completed yet +Delays_MAIN_DELAY_ACTIONS_TODO=Delay tolerance (in days) before alert on planned events (agenda events) not completed yet +Delays_MAIN_DELAY_PROJECT_TO_CLOSE=Delay tolerance (in days) before alert on project not closed in time +Delays_MAIN_DELAY_TASKS_TODO=Delay tolerance (in days) before alert on planned tasks (project tasks) not completed yet Delays_MAIN_DELAY_ORDERS_TO_PROCESS=Delay tolerance (in days) before alert on orders not processed yet Delays_MAIN_DELAY_SUPPLIER_ORDERS_TO_PROCESS=Delay tolerance (in days) before alert on suppliers orders not processed yet Delays_MAIN_DELAY_PROPALS_TO_CLOSE=Delay tolerance (in days) before alert on proposals to close diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 4cbe98d8ccd..839c4fdd3b0 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1179,17 +1179,19 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs // jQuery jeditable if (! empty($conf->global->MAIN_USE_JQUERY_JEDITABLE)) { + print ''."\n"; print ''."\n"; print ''."\n"; print ''."\n"; print ''."\n"; print ''."\n"; print ''."\n"; diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index e49da226727..d8051465626 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -485,14 +485,14 @@ if ($id > 0 || $ref) } // Stock alert threshold - print ''.$form->editfieldkey("StockLimit",'stocklimit',$object->seuil_stock_alerte,$object,$user->rights->produit->creer).''; - print $form->editfieldval("StockLimit",'stocklimit',$object->seuil_stock_alerte,$object,$user->rights->produit->creer); + print ''.$form->editfieldkey("StockLimit",'seuil_stock_alerte',$object->seuil_stock_alerte,$object,$user->rights->produit->creer).''; + print $form->editfieldval("StockLimit",'seuil_stock_alerte',$object->seuil_stock_alerte,$object,$user->rights->produit->creer,'string'); print ''; // Desired stock print ''.$form->editfieldkey($form->textwithpicto($langs->trans("DesiredStock"), $langs->trans("DesiredStockDesc"), 1),'desiredstock',$object->desiredstock,$object,$user->rights->produit->creer); print ''; - print $form->editfieldval("DesiredStock",'desiredstock',$object->desiredstock,$object,$user->rights->produit->creer); + print $form->editfieldval("DesiredStock",'desiredstock',$object->desiredstock,$object,$user->rights->produit->creer,'string'); print ''; // Real stock diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 43b738021ee..236a8154578 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -1711,7 +1711,7 @@ class Project extends CommonObject /** - * Is the action delayed? + * Is the project delayed? * * @return bool */ diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index ea156b340d5..6db12174539 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -1599,7 +1599,7 @@ class Task extends CommonObject $task_static->projectstatus = $obj->projectstatus; $task_static->progress = $obj->progress; $task_static->fk_statut = $obj->status; - $task_static->datee = $this->db->jdate($obj->datee); + $task_static->date_end = $this->db->jdate($obj->datee); if ($task_static->hasDelay()) { $response->nbtodolate++; @@ -1616,7 +1616,7 @@ class Task extends CommonObject } /** - * Is the action delayed? + * Is the task delayed? * * @return bool */ @@ -1630,6 +1630,8 @@ class Task extends CommonObject $now = dol_now(); - return ($this->datee > 0 && $this->datee < ($now - $conf->projet->task->warning_delay)); + $datetouse = ($this->date_end > 0) ? $this->date_end : ($this->datee > 0 ? $this->datee : 0); + + return ($datetouse > 0 && ($datetouse < ($now - $conf->projet->task->warning_delay))); } } diff --git a/htdocs/projet/tasks/list.php b/htdocs/projet/tasks/list.php index e5c807371c2..52e01d445a8 100644 --- a/htdocs/projet/tasks/list.php +++ b/htdocs/projet/tasks/list.php @@ -551,14 +551,15 @@ if ($resql) $projectstatic->title = $obj->projecttitle; $projectstatic->public = $obj->public; $projectstatic->statut = $obj->projectstatus; - $projectstatic->datee = $obj->projectdatee; + $projectstatic->datee = $db->jdate($obj->projectdatee); $taskstatic->id = $obj->id; $taskstatic->ref = $obj->ref; $taskstatic->label = $obj->label; $taskstatic->fk_statut = $obj->fk_statut; $taskstatic->progress = $obj->progress; - $taskstatic->datee = $obj->date_end; + $taskstatic->datee = $db->jdate($obj->date_end); // deprecated + $taskstatic->date_end = $db->jdate($obj->date_end); $userAccess = $projectstatic->restrictedProjectArea($user); // why this ? if ($userAccess >= 0) diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php index 8c1d1fc40cb..5b3b8c9fe61 100644 --- a/htdocs/projet/tasks/task.php +++ b/htdocs/projet/tasks/task.php @@ -437,6 +437,7 @@ if ($id > 0 || ! empty($ref)) // Date end print ''.$langs->trans("DateEnd").''; print dol_print_date($object->date_end,'dayhour'); + if ($object->hasDelay()) print img_warning("Late"); print ''; // Planned workload