diff --git a/htdocs/comm/action/fiche.php b/htdocs/comm/action/fiche.php index 39b639110c5..9d958d5d7dd 100644 --- a/htdocs/comm/action/fiche.php +++ b/htdocs/comm/action/fiche.php @@ -447,7 +447,7 @@ if (GETPOST('action') == 'create') print ''.$langs->trans("Type").''; if (GETPOST("actioncode")) { - print ''."\n"; + print ''."\n"; $cactioncomm->fetch(GETPOST("actioncode")); print $cactioncomm->getNomUrl(); } @@ -458,10 +458,57 @@ if (GETPOST('action') == 'create') print ''; // Title - print ''.$langs->trans("Title").''; + print ''.$langs->trans("Title").''; // Location - print ''.$langs->trans("Location").''; + print ''.$langs->trans("Location").''; + + // Date start + print ''.$langs->trans("DateActionStart").''; + if (GETPOST("afaire") == 1) $html->select_date($actioncomm->datep,'ap',1,1,0,"action",1,1); + else if (GETPOST("afaire") == 2) $html->select_date($actioncomm->datep,'ap',1,1,1,"action",1,1); + else $html->select_date($actioncomm->datep,'ap',1,1,1,"action",1,1); + print ''; + // Date end + print ''.$langs->trans("DateActionEnd").''; + if (GETPOST("afaire") == 1) $html->select_date($actioncomm->datef,'p2',1,1,1,"action",1,1); + else if (GETPOST("afaire") == 2) $html->select_date($actioncomm->datef,'p2',1,1,1,"action",1,1); + else $html->select_date($actioncomm->datef,'p2',1,1,1,"action",1,1); + print ''; + + // Avancement + print ''.$langs->trans("Status").' / '.$langs->trans("Percentage").''; + print ''; + $percent=0; + if (GETPOST('percentage')) + { + $percent=GETPOST('percentage'); + } + else + { + if (GETPOST("afaire") == 1) $percent=0; + if (GETPOST("afaire") == 2) $percent=100; + } + print $htmlactions->form_select_status_action('formaction',$percent,1); + print ''; + + print ''; + print '
'; + print ''; + + // Affected by + print ''; + + // Realised by + print ''; + + print '
'.$langs->trans("ActionAffectedTo").''; + $html->select_users(GETPOST("affectedto")?GETPOST("affectedto"):($actioncomm->usertodo->id > 0 ? $actioncomm->usertodo : $user),'affectedto',1); + print '
'.$langs->trans("ActionDoneBy").''; + $html->select_users(GETPOST("doneby")?GETPOST("doneby"):$actioncomm->userdone,'doneby',1); + print '
'; + print '
'; + print ''; // Societe, contact print ''; } - print '
'.$langs->trans("ActionOnCompany").''; @@ -501,58 +548,11 @@ if (GETPOST('action') == 'create') print '
'; - print '
'; - print ''; - - // Affected by - print ''; - - // Realised by - print ''; - - print '
'.$langs->trans("ActionAffectedTo").''; - $html->select_users(GETPOST("affectedto")?GETPOST("affectedto"):($actioncomm->usertodo->id > 0 ? $actioncomm->usertodo : $user),'affectedto',1); - print '
'.$langs->trans("ActionDoneBy").''; - $html->select_users(GETPOST("doneby")?GETPOST("doneby"):$actioncomm->userdone,'doneby',1); - print '
'; - print '
'; - print ''; - if (GETPOST("datep") && preg_match('/^([0-9][0-9][0-9][0-9])([0-9][0-9])([0-9][0-9])$/',GETPOST("datep"),$reg)) { $actioncomm->datep=dol_mktime(0,0,0,$reg[2],$reg[3],$reg[1]); } - // Date start - print ''; - // Date end - print ''; - - // Avancement - print ''; - print ''; - // Priority print ''; + // Date start + print ''; + // Date end + print ''; + + // Status + print ''; + + print '
'.$langs->trans("DateActionStart").''; - if (GETPOST("afaire") == 1) $html->select_date($actioncomm->datep,'ap',1,1,0,"action",1,1); - else if (GETPOST("afaire") == 2) $html->select_date($actioncomm->datep,'ap',1,1,1,"action",1,1); - else $html->select_date($actioncomm->datep,'ap',1,1,1,"action",1,1); - print '
'.$langs->trans("DateActionEnd").''; - if (GETPOST("afaire") == 1) $html->select_date($actioncomm->datef,'p2',1,1,1,"action",1,1); - else if (GETPOST("afaire") == 2) $html->select_date($actioncomm->datef,'p2',1,1,1,"action",1,1); - else $html->select_date($actioncomm->datef,'p2',1,1,1,"action",1,1); - print '
'.$langs->trans("Status").' / '.$langs->trans("Percentage").''; - $percent=0; - if (GETPOST('percentage')) - { - $percent=GETPOST('percentage'); - } - else - { - if (GETPOST("afaire") == 1) $percent=0; - if (GETPOST("afaire") == 2) $percent=100; - } - print $htmlactions->form_select_status_action('formaction',$percent,1); - print '
'.$langs->trans("Priority").''; print 'priority).'" size="5">'; @@ -659,8 +659,48 @@ if ($id) // Location print '
'.$langs->trans("Location").'
'.$langs->trans("DateActionStart").''; + if (GETPOST("afaire") == 1) $html->select_date($act->datep,'ap',1,1,0,"action",1,1); + else if (GETPOST("afaire") == 2) $html->select_date($act->datep,'ap',1,1,1,"action",1,1); + else $html->select_date($act->datep,'ap',1,1,1,"action",1,1); + print '
'.$langs->trans("DateActionEnd").''; + if (GETPOST("afaire") == 1) $html->select_date($act->datef,'p2',1,1,1,"action",1,1); + else if (GETPOST("afaire") == 2) $html->select_date($act->datef,'p2',1,1,1,"action",1,1); + else $html->select_date($act->datef,'p2',1,1,1,"action",1,1); + print '
'.$langs->trans("Status").' / '.$langs->trans("Percentage").''; + $percent=GETPOST("percentage")?GETPOST("percentage"):$act->percentage; + print $htmlactions->form_select_status_action('formaction',$percent,1); + print '

'; + + // Input by + print ''; + + // Affected to + print ''; + + // Realised by + print ''; + + print '
'.$langs->trans("ActionAskedBy").''; + print $act->author->getNomUrl(1); + print '
'.$langs->trans("ActionAffectedTo").''; + $html->select_users($act->usertodo->id,'affectedto',1); + print '
'.$langs->trans("ActionDoneBy").''; + $html->select_users($act->userdone->id,'doneby',1); + print '

'; + + print ''; + // Company - print ''; + print ''; print ''; @@ -685,44 +725,6 @@ if ($id) print ''; } - print '
'.$langs->trans("Company").'
'.$langs->trans("ActionOnCompany").''; print $html->select_societes($act->societe->id,'socid','',1,1); print '

'; - - // Input by - print ''; - - // Affected to - print ''; - - // Realised by - print ''; - - print '
'.$langs->trans("ActionAskedBy").''; - print $act->author->getNomUrl(1); - print '
'.$langs->trans("ActionAffectedTo").''; - $html->select_users($act->usertodo->id,'affectedto',1); - print '
'.$langs->trans("ActionDoneBy").''; - $html->select_users($act->userdone->id,'doneby',1); - print '

'; - - // Date start - print ''; - // Date end - print ''; - - // Status - print ''; - // Priority print ''; + // Date debut + print ''; + + // Date fin + print ''; + + // Statut + print ''; + + print '
'.$langs->trans("DateActionStart").''; - if (GETPOST("afaire") == 1) $html->select_date($act->datep,'ap',1,1,0,"action",1,1); - else if (GETPOST("afaire") == 2) $html->select_date($act->datep,'ap',1,1,1,"action",1,1); - else $html->select_date($act->datep,'ap',1,1,1,"action",1,1); - print '
'.$langs->trans("DateActionEnd").''; - if (GETPOST("afaire") == 1) $html->select_date($act->datef,'p2',1,1,1,"action",1,1); - else if (GETPOST("afaire") == 2) $html->select_date($act->datef,'p2',1,1,1,"action",1,1); - else $html->select_date($act->datef,'p2',1,1,1,"action",1,1); - print '
'.$langs->trans("Status").' / '.$langs->trans("Percentage").''; - $percent=GETPOST("percentage")?GETPOST("percentage"):$act->percentage; - print $htmlactions->form_select_status_action('formaction',$percent,1); - print '
'.$langs->trans("Priority").''; print ''; @@ -770,8 +772,45 @@ if ($id) // Location print '
'.$langs->trans("Location").''.$act->location.'
'.$langs->trans("DateActionStart").''; + print dol_print_date($act->datep,'dayhour'); + if ($act->percentage == 0 && $act->datep && $act->datep < ($now - $delay_warning)) print img_warning($langs->trans("Late")); + print '
'.$langs->trans("DateActionEnd").''; + print dol_print_date($act->datef,'dayhour'); + if ($act->percentage > 0 && $act->percentage < 100 && $act->datef && $act->datef < ($now- $delay_warning)) print img_warning($langs->trans("Late")); + print '
'.$langs->trans("Status").' / '.$langs->trans("Percentage").''; + print $act->getLibStatut(4); + print '

'; + + // Input by + print ''; + + // Affecte a + print ''; + + // Realise par + print ''; + + print '
'.$langs->trans("ActionAskedBy").''; + if ($act->author->id > 0) print $act->author->getNomUrl(1); + else print ' '; + print '
'.$langs->trans("ActionAffectedTo").''; + if ($act->usertodo->id > 0) print $act->usertodo->getNomUrl(1); + print '
'.$langs->trans("ActionDoneBy").''; + if ($act->userdone->id > 0) print $act->userdone->getNomUrl(1); + print '

'; + // Societe - contact - print ''; } - print '
'.$langs->trans("Company").''.($act->societe->id?$act->societe->getNomUrl(1):$langs->trans("None")); + print '
'.$langs->trans("ActionOnCompany").''.($act->societe->id?$act->societe->getNomUrl(1):$langs->trans("None")); if ($act->societe->id && $act->type_code == 'AC_TEL') { if ($act->societe->fetch($act->societe->id)) @@ -813,43 +852,6 @@ if ($id) print '

'; - - // Input by - print ''; - - // Affecte a - print ''; - - // Realise par - print ''; - - print '
'.$langs->trans("ActionAskedBy").''; - if ($act->author->id > 0) print $act->author->getNomUrl(1); - else print ' '; - print '
'.$langs->trans("ActionAffectedTo").''; - if ($act->usertodo->id > 0) print $act->usertodo->getNomUrl(1); - print '
'.$langs->trans("ActionDoneBy").''; - if ($act->userdone->id > 0) print $act->userdone->getNomUrl(1); - print '

'; - - // Date debut - print ''; - - // Date fin - print ''; - - // Statut - print ''; - // Priority print '
'.$langs->trans("DateActionStart").''; - print dol_print_date($act->datep,'dayhour'); - if ($act->percentage == 0 && $act->datep && $act->datep < ($now - $delay_warning)) print img_warning($langs->trans("Late")); - print '
'.$langs->trans("DateActionEnd").''; - print dol_print_date($act->datef,'dayhour'); - if ($act->percentage > 0 && $act->percentage < 100 && $act->datef && $act->datef < ($now- $delay_warning)) print img_warning($langs->trans("Late")); - print '
'.$langs->trans("Status").' / '.$langs->trans("Percentage").''; - print $act->getLibStatut(4); - print '
'.$langs->trans("Priority").''; print $act->priority;