diff --git a/ChangeLog b/ChangeLog index c344e464673..a939cae003b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,7 @@ English Dolibarr ChangeLog ***** ChangeLog for 3.7 compared to 3.6.* ***** For users: - New: PDF event report show project and status of event. +- New: Onto event summary of elements, end date and status are visible. - New: Can filter on status on interventions. - New: Add help info of field type into dictionary of payment types. - New: Add proposals into referer page of thirdparty. diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 7b9705c9429..aa71db608fc 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -466,6 +466,8 @@ class ActionComm extends CommonObject $sql.= ", fk_user_mod = '".$user->id."'"; $sql.= ", fk_user_action=".($this->usertodo->id > 0 ? "'".$this->usertodo->id."'":"null"); $sql.= ", fk_user_done=".($this->userdone->id > 0 ? "'".$this->userdone->id."'":"null"); + if (! empty($this->fk_element)) $sql.= ", fk_element=".($this->fk_element?$this->fk_element:"null"); + if (! empty($this->elementtype)) $sql.= ", elementtype=".($this->elementtype?"'".$this->elementtype."'":"null"); $sql.= " WHERE id=".$this->id; dol_syslog(get_class($this)."::update", LOG_DEBUG); diff --git a/htdocs/comm/action/document.php b/htdocs/comm/action/document.php index 694536b6d14..b000d2017d7 100644 --- a/htdocs/comm/action/document.php +++ b/htdocs/comm/action/document.php @@ -105,9 +105,14 @@ if ($object->id > 0) $author->fetch($object->author->id); $object->author=$author; - if ($object->contact->id) $object->fetch_contact($object->contact->id); + if ($object->contact->id > 0) $object->fetch_contact($object->contact->id); + if ($object->usertodo->id > 0) { $tmpuser=new User($db); $res=$tmpuser->fetch($object->usertodo->id); $object->usertodo=$tmpuser; } $head=actions_prepare_head($object); + + $now=dol_now(); + $delay_warning=$conf->global->MAIN_DELAY_ACTIONS_TODO*24*60*60; + dol_fiche_head($head, 'documents', $langs->trans("Action"),0,'action'); // Affichage fiche action en mode visu @@ -138,7 +143,7 @@ if ($object->id > 0) else print dol_print_date($object->datep,'day'); if ($object->percentage == 0 && $object->datep && $object->datep < ($now - $delay_warning)) print img_warning($langs->trans("Late")); print ''; - print ''."\n"; + print ''."\n"; print '
'; print ''; print ''; @@ -146,7 +151,7 @@ if ($object->id > 0) print ''; print ''; //print ''; - print img_picto($langs->trans("ViewCal"),'object_calendar').' '; + print img_picto($langs->trans("ViewCal"),'object_calendar','class="hideonsmartphone"').' '; print '
'."\n"; print '
'; print ''; @@ -155,7 +160,7 @@ if ($object->id > 0) print ''; print ''; //print ''; - print img_picto($langs->trans("ViewCal"),'object_calendarweek').' '; + print img_picto($langs->trans("ViewCal"),'object_calendarweek','class="hideonsmartphone"').' '; print '
'."\n"; print '
'; print ''; @@ -164,9 +169,18 @@ if ($object->id > 0) print ''; print ''; //print ''; - print img_picto($langs->trans("ViewCal"),'object_calendarday').' '; + print img_picto($langs->trans("ViewCal"),'object_calendarday','class="hideonsmartphone"').' '; print '
'."\n"; - print ''; + print '
'; + print ''; + print ''; + print ''; + print ''; + print ''; + //print ''; + print img_picto($langs->trans("ViewCal"),'object_calendarperuser','class="hideonsmartphone"').' '; + print '
'."\n"; + print ''; print ''; // Date end @@ -184,7 +198,11 @@ if ($object->id > 0) // Location print ''.$langs->trans("Location").''.$object->location.''; - + // Assigned to + print ''.$langs->trans("ActionAffectedTo").''; + if ($object->usertodo->id > 0) print $object->usertodo->getNomUrl(1); + print ''; + print '

'; diff --git a/htdocs/comm/action/fiche.php b/htdocs/comm/action/fiche.php index 1615199de43..27be46bd9e1 100644 --- a/htdocs/comm/action/fiche.php +++ b/htdocs/comm/action/fiche.php @@ -101,7 +101,7 @@ if (GETPOST('addassignedtouser')) $action='create'; } // Add action -if ($action == 'add_action') +if ($action == 'add') { $error=0; @@ -317,7 +317,7 @@ if ($action == 'update') $apmin=GETPOST('apmin'); $p2hour=GETPOST('p2hour'); $p2min=GETPOST('p2min'); - $percentage=in_array(GETPOST('status'),array(-1,100))?GETPOST('status'):GETPOST("percentage"); // If status is -1 or 100, percentage is not defined and we must use status + $percentage=in_array(GETPOST('status'),array(-1,100))?GETPOST('status'):(in_array(GETPOST('complete'),array(-1,100))?GETPOST('complete'):GETPOST("percentage")); // If status is -1 or 100, percentage is not defined and we must use status // Clean parameters if ($aphour == -1) $aphour='0'; @@ -345,6 +345,7 @@ if ($action == 'update') $object->pnote = $_POST["note"]; $object->fk_element = $_POST["fk_element"]; $object->elementtype = $_POST["elementtype"]; + if (! $datef && $percentage == 100) { $error=$langs->trans("ErrorFieldRequired",$langs->trans("DateEnd")); @@ -512,7 +513,7 @@ if ($action == 'create') print ''; print ''; - print ''; + print ''; if ($backtopage) print ''; if (GETPOST("actioncode") == 'AC_RDV') print_fiche_titre($langs->trans("AddActionRendezVous")); diff --git a/htdocs/core/class/html.formactions.class.php b/htdocs/core/class/html.formactions.class.php index 64da47920c2..cd57f61d9a7 100644 --- a/htdocs/core/class/html.formactions.class.php +++ b/htdocs/core/class/html.formactions.class.php @@ -187,6 +187,7 @@ class FormActions print ''; print ''; print ''; + print ''; print ''; print "\n"; @@ -204,7 +205,15 @@ class FormActions print ''; print ''; print ''; - print ''; + print ''; print ''; + print ''; print ''; } print '
'.$langs->trans('Action').''.$langs->trans('Date').''.$langs->trans('By').''.$langs->trans('Status').'
'.$ref.''.$label.''.dol_print_date($action->datep,'day').''.dol_print_date($action->datep,'dayhour'); + if ($action->datef) + { + $tmpa=dol_getdate($action->datep); + $tmpb=dol_getdate($action->datef); + if ($tmpa['mday'] == $tmpb['mday'] && $tmpa['mon'] == $tmpb['mon'] && $tmpa['year'] == $tmpb['year']) print '-'.dol_print_date($action->datef,'hour'); + else print '-'.dol_print_date($action->datef,'dayhour'); + } + print ''; if (! empty($action->author->id)) { @@ -214,6 +223,12 @@ class FormActions print $userstatic->getNomUrl(1); } print ''; + if (! empty($action->author->id)) + { + print $action->getLibStatut(3); + } + print '
'; diff --git a/htdocs/fichinter/fiche.php b/htdocs/fichinter/fiche.php index dab1831bcad..467ee1d3632 100644 --- a/htdocs/fichinter/fiche.php +++ b/htdocs/fichinter/fiche.php @@ -1643,6 +1643,20 @@ else if ($id > 0 || ! empty($ref)) else print '
'.$langs->trans('SendByMail').'
'; } + // Event agenda + if (! empty($conf->global->FICHINTER_ADDLINK_TO_EVENT)) + { + if (! empty($conf->agenda->enabled) && $object->statut > 0) + { + $langs->load("agenda"); + if ($object->statut < 2) + { + if ($user->rights->agenda->myactions->create) print '
'.$langs->trans("AddEvent").'
'; + else print '
'.$langs->trans("AddEvent").'
'; + } + } + } + // Proposal if (! empty($conf->propal->enabled) && $object->statut > 0) { diff --git a/htdocs/langs/en_US/agenda.lang b/htdocs/langs/en_US/agenda.lang index 48a5b720f46..c4c332336d2 100644 --- a/htdocs/langs/en_US/agenda.lang +++ b/htdocs/langs/en_US/agenda.lang @@ -87,4 +87,5 @@ AgendaExtNb=Calendar nb %s ExtSiteUrlAgenda=URL to access .ical file ExtSiteNoLabel=No Description WorkingTimeRange=Working time range -WorkingDaysRange=Working days range \ No newline at end of file +WorkingDaysRange=Working days range +AddEvent=Create event \ No newline at end of file