diff --git a/htdocs/comm/action/document.php b/htdocs/comm/action/document.php index d80cccf7177..b01c6c2b8e0 100755 --- a/htdocs/comm/action/document.php +++ b/htdocs/comm/action/document.php @@ -135,10 +135,14 @@ if ($_GET["id"] > 0) if ($act->contact->id) print ''.img_object($langs->trans("ShowContact"),'contact').' '.$act->contact->fullname.''; else print $langs->trans("None"); print ''; - print ''.$langs->trans("DateCreation").''.strftime('%d %B %Y %H:%M',$act->date).''; - print ''.$langs->trans("Author").''; - print ''.img_object($langs->trans("ShowUser"),'user').' '.$act->author->fullname.''; + + // Auteur + print ''.$langs->trans("Author").''; + print ''.img_object($langs->trans("ShowUser"),'user').' '.$act->author->fullname.''; + // Date + print ''.$langs->trans("Date").''.dolibarr_print_date($act->date,'%d %B %Y %H:%M').''; + // Construit liste des fichiers clearstatcache(); diff --git a/htdocs/comm/action/fiche.php b/htdocs/comm/action/fiche.php index 8cb1a0cc846..b6da5a0ce74 100644 --- a/htdocs/comm/action/fiche.php +++ b/htdocs/comm/action/fiche.php @@ -144,10 +144,11 @@ if ($_POST["action"] == 'add_action') */ if ($_POST["action"] == 'confirm_delete' && $_POST["confirm"] == 'yes') { - $actioncomm = new ActionComm($db); - $actioncomm->delete($_GET["id"]); - - Header("Location: index.php"); + $actioncomm = new ActionComm($db); + $actioncomm->delete($_GET["id"]); + + Header("Location: index.php"); + exit; } /* @@ -156,14 +157,18 @@ if ($_POST["action"] == 'confirm_delete' && $_POST["confirm"] == 'yes') */ if ($_POST["action"] == 'update') { - $action = new Actioncomm($db); - $action->fetch($_POST["id"]); - $action->percent = $_POST["percent"]; - $action->contact->id = $_POST["contactid"]; - $action->note = $_POST["note"]; - $action->update(); - - Header("Location: ".$_POST["from"]); + if (! $_POST["cancel"]) + { + $action = new Actioncomm($db); + $action->fetch($_POST["id"]); + $action->percent = $_POST["percent"]; + $action->contact->id = $_POST["contactid"]; + $action->note = $_POST["note"]; + $action->update(); + } + + Header("Location: ".$_POST["from"]); + exit; } @@ -385,7 +390,8 @@ if ($_GET["action"] == 'create') */ if ($_GET["id"]) { - if ($error) { + if ($error) + { print '
'.$error.'

'; } @@ -406,57 +412,65 @@ if ($_GET["id"]) $hselected=$h; $h++; - $head[$h][0] = DOL_URL_ROOT.'/comm/action/document.php?id='.$_GET["id"]; - $head[$h][1] = $langs->trans('Documents'); - //$hselected=$h; - $h++; + $head[$h][0] = DOL_URL_ROOT.'/comm/action/document.php?id='.$_GET["id"]; + $head[$h][1] = $langs->trans('Documents'); + //$hselected=$h; + $h++; dolibarr_fiche_head($head, $hselected, $langs->trans("Ref")." ".$act->id); - // Confirmation suppression action - if ($_GET["action"] == 'delete') + // Confirmation suppression action + if ($_GET["action"] == 'delete') { - $html->form_confirm("fiche.php?id=".$_GET["id"],$langs->trans("DeleteAction"),$langs->trans("ConfirmDeleteAction"),"confirm_delete"); - print '
'; + $html->form_confirm("fiche.php?id=".$_GET["id"],$langs->trans("DeleteAction"),$langs->trans("ConfirmDeleteAction"),"confirm_delete"); + print '
'; } - - if ($_GET["action"] == 'edit') + + if ($_GET["action"] == 'edit') { - // Fiche action en mode edition - print '
'; - print ''; - print ''; - print ''; + // Fiche action en mode edition + print ''; + print ''; + print ''; + print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - - print ''; - print ''; - print ''; - print ''; - print ''; - if ($act->objet_url) - { - print ''; - print ''; - } - - // Note - print ''; + print '
'.$langs->trans("Ref").''.$act->id.'
'.$langs->trans("Type").''.$act->type.'
'.$langs->trans("Title").''.$act->label.'
'.$langs->trans("Company").''.img_object($langs->trans("ShowCompany"),'company').' '.$act->societe->nom.''.$langs->trans("Contact").''; - $html->select_array("contactid", $act->societe->contact_array(), $act->contact->id, 1); - print '
'.$langs->trans("DateCreation").''.strftime('%d %B %Y %H:%M',$act->date).''.$langs->trans("Author").''.img_object($langs->trans("ShowUser"),'user').' '.$act->author->fullname.'
'.$langs->trans("PercentDone").'%
'.$langs->trans("LinkedObject").''.$act->objet_url.'
'.$langs->trans("Note").''; - print '
'; + print ''; + print ''; + print ''; + print ''; + print ''; - print ''; - print '
'.$langs->trans("Ref").''.$act->id.'
'.$langs->trans("Type").''.$act->type.'
'.$langs->trans("Title").''.$act->label.'
'.$langs->trans("Company").''.img_object($langs->trans("ShowCompany"),'company').' '.$act->societe->nom.'
'; + print ''.$langs->trans("Contact").''; + $html->select_array("contactid", $act->societe->contact_array(), $act->contact->id, 1); + print ''; + + // Auteur + print ''.$langs->trans("Author").''; + print ''.img_object($langs->trans("ShowUser"),'user').' '.$act->author->fullname.''; + + // Date + print ''.$langs->trans("Date").''.dolibarr_print_date($act->date,'%d %B %Y %H:%M').''; + + print ''.$langs->trans("PercentDone").'%'; + if ($act->objet_url) + { + print ''.$langs->trans("LinkedObject").''; + print ''.$act->objet_url.''; + } + + // Note + print ''.$langs->trans("Note").''; + print ''; + + print ''; + print '     '; + print ''; + + print ''; } - else + else { // Affichage fiche action en mode visu print ''; print ''; print ''; - + print ''; print ''; - print ''; - print ''; - print ''; + + // Auteur + print ''; + print ''; + + // Date + print ''; + print ''; if ($act->objet_url) { print ''; print ''; } - + // Note print ''; - + print '
'.$langs->trans("Title").''.$act->label.'
'.$langs->trans("Company").''.img_object($langs->trans("ShowCompany"),'company').' '.$act->societe->nom_url.''.$langs->trans("Contact").''; if ($act->contact->id) print ''.img_object($langs->trans("ShowContact"),'contact').' '.$act->contact->fullname.''; else print $langs->trans("None"); print '
'.$langs->trans("DateCreation").''.strftime('%d %B %Y %H:%M',$act->date).''.$langs->trans("Author").''.img_object($langs->trans("ShowUser"),'user').' '.$act->author->fullname.'
'.$langs->trans("Author").''.img_object($langs->trans("ShowUser"),'user').' '.$act->author->fullname.'
'.$langs->trans("Date").''.dolibarr_print_date($act->date,'%d %B %Y %H:%M').'
'.$langs->trans("PercentDone").''.$act->percent.' %
'.$langs->trans("LinkedObject").''.$act->objet_url.'
'.$langs->trans("Note").''; print nl2br($act->note).'
'; } - + print "\n"; /** - * Barre d'actions - * - */ + * Barre d'actions + * + */ print '
'; - - if ($_GET["action"] == 'edit') + + if ($_GET["action"] != 'edit') { - print ''.$langs->trans("Cancel").''; + print ''.$langs->trans("Edit").''; + + print ''.$langs->trans("Delete").''; } - else - { - print ''.$langs->trans("Edit").''; - } - - print ''.$langs->trans("Delete").''; + print '
'; }