diff --git a/htdocs/comm/action/fiche.php b/htdocs/comm/action/fiche.php index ca8e6dd5084..9f6816ddf35 100644 --- a/htdocs/comm/action/fiche.php +++ b/htdocs/comm/action/fiche.php @@ -19,15 +19,25 @@ * $Id$ * $Source$ */ + +/*! + \file htdocs/comm/action/fiche.php + \ingroup commercial + \brief Page de la fiche action commercial + \version $Revision$ +*/ + require("./pre.inc.php"); $langs->load("company"); +$langs->load("commercial"); require("../../contact.class.php"); require("../../lib/webcal.class.php"); require("../../cactioncomm.class.php"); require("../../actioncomm.class.php"); + /* * Sécurité accés client */ @@ -38,8 +48,7 @@ if ($user->societe_id > 0) } /* - * - * + * Action création de l'action * */ if ($_POST["action"] == 'add_action') @@ -101,8 +110,7 @@ if ($_POST["action"] == 'add_action') $webcal->add($user, $actioncomm->date, $societe->nom, $libelle); } - // Header("Location: ".DOL_URL_ROOT."/comm/fiche.php?socid=$socid"); - Header("Location: ".$_POST["from"]); + Header("Location: ".$_POST["from"]); } else { @@ -112,13 +120,22 @@ if ($_POST["action"] == 'add_action') } +/* + * Action suppression de l'action + * + */ if ($_POST["action"] == 'confirm_delete' && $_POST["confirm"] == 'yes') { $actioncomm = new ActionComm($db); $actioncomm->delete($_GET["id"]); + Header("Location: index.php"); } +/* + * Action mise à jour de l'action + * + */ if ($_POST["action"] == 'update') { $action = new Actioncomm($db); @@ -138,10 +155,12 @@ llxHeader(); $html = new Form($db); -/* - * Affichage fiche action vierge en mode creation - * - */ + +/* ************************************************************************** */ +/* */ +/* Affichage fiche en mode création */ +/* */ +/* ************************************************************************** */ if ($_GET["action"] == 'create') { @@ -164,19 +183,19 @@ if ($_GET["action"] == 'create') */ if ($_GET["actionid"] == 5) { - print_titre ("Saisie d'une action Rendez-vous"); + print_titre ($langs->trans("AddActionRendezVous")); print "
"; print ''."\n"; - print ''; + print '
'; // Type d'action - print ''; + print ''; print ''; // Societe, contact - print ''; } @@ -217,10 +236,10 @@ if ($_GET["action"] == 'create') */ else { - print_titre ("Saisie d'une action"); + print_titre ($langs->trans("AddAction")); print "
"; - print '
Rendez-vous
'.$langs->trans("Rendez-Vous").'
'.$langs->trans("Action concernant la companie").''; + print '
'.$langs->trans("ActionOnCompany").''; if ($_GET["socid"]) { $societe = new Societe($db); $nomsoc=$societe->get_nom($_GET["socid"]); @@ -190,7 +209,7 @@ if ($_GET["action"] == 'create') // Si la societe est imposée, on propose ces contacts if ($_GET["socid"]) { - print '
'.$langs->trans("Action concernant le contact").''; + print '
'.$langs->trans("ActionOnContact").''; print $html->select_contacts($_GET["socid"],'','contactid',1,1); print '
'; + print '
'; // Type d'action actifs print ''; // Societe, contact - print ''; } @@ -306,6 +325,7 @@ if ($_GET["action"] == 'create') print ''; + print '
'.$langs->trans("Action").''; @@ -235,7 +254,7 @@ if ($_GET["action"] == 'create') print '
'.$langs->trans("Label").'
'.$langs->trans("Action concernant la companie").''; + print '
'.$langs->trans("ActionOnCompany").''; if ($_GET["socid"]) { $societe = new Societe($db); $nomsoc=$societe->get_nom($_GET["socid"]); @@ -249,7 +268,7 @@ if ($_GET["action"] == 'create') // Si la societe est imposée, on propose ces contacts if ($_GET["socid"]) { - print '
'.$langs->trans("Action concernant le contact").''; + print '
'.$langs->trans("ActionOnContact").''; print $html->select_contacts($_GET["socid"],'','contactid',1,1); print '
'.$langs->trans("Description").''; print '
'; print '

'; @@ -316,45 +336,57 @@ if ($_GET["action"] == 'create') } /* - * - * + * Affichage action en mode edition ou visu * */ if ($_GET["id"]) { + $act = new ActionComm($db); + $act->fetch($_GET["id"]); + + $act->societe->fetch($act->societe->id); + $act->author->fetch($act->author->id); + $act->contact->fetch($act->contact->id); + + /* + * Affichage onglets + */ + + $h = 0; + + $head[$h][0] = DOL_URL_ROOT.'/comm/action/fiche.php?id='.$_GET["id"]; + $head[$h][1] = $langs->trans("CardAction"); + $hselected=$h; + $h++; + + dolibarr_fiche_head($head, $hselected, $langs->trans("Ref")." ".$act->id); + + // Confirmation suppression action if ($_GET["action"] == 'delete') { - $html->form_confirm("fiche.php?id=".$_GET["id"],"Supprimer l'action","Etes-vous sûr de vouloir supprimer cette action ?","confirm_delete"); + $html->form_confirm("fiche.php?id=".$_GET["id"],$langs->trans("DeleteAction"),$langs->trans("ConfirmDeleteAction"),"confirm_delete"); } - $act = new ActionComm($db); - $act->fetch($_GET["id"]); - - $act->societe->fetch($act->societe->id); - $act->author->fetch($act->author->id); - $act->contact->fetch($act->contact->id); - - // Fiche action en mode edition if ($_GET["action"] == 'edit') { - print_titre ("Edition de la fiche action"); + // Fiche action en mode edition print '
'; print ''; print ''; print ''; - print ''; + print '
'; print ''; - print ''; + print ''; print ''; - print ''; - print ''; + print ''; print ''; - print ''; + print ''; if ($act->objet_url) { print ''; @@ -366,23 +398,22 @@ if ($_GET["id"]) print ''; } - print ''; + print ''; print '
'.$langs->trans("Type").''.$act->type.'
Société
'.$langs->trans("Company").''.$act->societe->nom.'Contact'; + print ''.$langs->trans("Contact").''; $html->select_array("contactid", $act->societe->contact_array(), $act->contact->id, 1); print '
'.$langs->trans("Author").''.strftime('%d %B %Y %H:%M',$act->date).'
'.$langs->trans("DateCreation").''.strftime('%d %B %Y %H:%M',$act->date).''.$langs->trans("Author").''.$act->author->fullname.'
Pourcentage réalisé%
'.$langs->trans("PercentDone").'%
Objet lié
'.$langs->trans("Comment").''; print nl2br($act->note).'
'; } else { // Affichage fiche action en mode visu - print_titre ("Action commerciale"); - - print ''; + print '
'; - print ''; - print ''; + print ''; + print ''; - print ''; - print ''; + print ''; + print ''; + print ''; print ''; - print ''; + print ''; if ($act->objet_url) { print ''; @@ -396,22 +427,29 @@ if ($_GET["id"]) } print '
'.$langs->trans("Type").''.$act->type.'
Société'.$act->societe->nom.'
'.$langs->trans("Company").''.$act->societe->nom.'Contact'.$act->contact->fullname.'
'.$langs->trans("Author").''.strftime('%d %B %Y %H:%M',$act->date).''.$langs->trans("Contact").''.$act->contact->fullname.'
'.$langs->trans("DateCreation").''.strftime('%d %B %Y %H:%M',$act->date).''.$langs->trans("Author").''.$act->author->fullname.'
Pourcentage réalisé'.$act->percent.' %
'.$langs->trans("PercentDone").''.$act->percent.' %
Objet lié
'; } - /* - * - */ - print '
'; + print '
'; + + print "
\n"; - if ($_GET["action"] == 'edit') + + /* + * Barre d'actions + * + */ + + print '
'; + + if ($_GET["action"] == 'edit') { print ''.$langs->trans("Cancel").''; } - else + else { print ''.$langs->trans("Edit").''; } - - print ''.$langs->trans("Delete").''; - print '
'; + + print ''.$langs->trans("Delete").''; + print ''; } $db->close();