Fix: Corrige nombreux problèmes sur enregistrements incomplets des actions.

This commit is contained in:
Laurent Destailleur 2005-07-10 02:17:56 +00:00
parent a169e64e8d
commit 3f8f28852f

View File

@ -117,38 +117,42 @@ if ($_POST["action"] == 'add_action')
$webcal=0; $webcal=0;
if ($conf->webcal->enabled && $_POST["todo_webcal"] == 'on') if ($conf->webcal->enabled && $_POST["todo_webcal"] == 'on')
{ {
// Crée objet webcal et connexion avec params $conf->webcal->db->xxx // Si action complete ou si action de type rendez-vous
$webcal = new Webcal(); if ($actioncomm->percent == 100 || $actioncomm->type_code == 'AC_RDV')
if (! $webcal->localdb->ok)
{ {
// Si la creation de l'objet n'as pu se connecter // Crée objet webcal et connexion avec params $conf->webcal->db->xxx
$error ="Dolibarr n'a pu se connecter à la base Webcalendar avec les identifiants définis (host=".$conf->webcal->db->host." dbname=".$conf->webcal->db->name." user=".$conf->webcal->db->user.")."; $webcal = new Webcal();
$error.=" L'option de mise a jour Webcalendar a été ignorée.";
$webcal->error=$error; if (! $webcal->localdb->ok)
}
else
{
// Initialisation donnees webcal
if ($_POST["actionid"] == 5 && $contact->fullname)
{ {
$libellecal =$langs->trans("TaskRDVWith",$contact->fullname)."\n"; // Si la creation de l'objet n'as pu se connecter
$libellecal.=$_POST["label"]; $error ="Dolibarr n'a pu se connecter à la base Webcalendar avec les identifiants définis (host=".$conf->webcal->db->host." dbname=".$conf->webcal->db->name." user=".$conf->webcal->db->user.").";
$error.=" L'option de mise a jour Webcalendar a été ignorée.";
$webcal->error=$error;
} }
else else
{ {
$libellecal=""; // Initialisation donnees webcal
if ($langs->trans("Action".$actioncomm->type_code) != "Action".$actioncomm->type_code) if ($_POST["actionid"] == 5 && $contact->fullname)
{ {
$libellecal.=$langs->trans("Action".$actioncomm->type_code)."\n"; $libellecal =$langs->trans("TaskRDVWith",$contact->fullname)."\n";
$libellecal.=$_POST["label"];
} }
$libellecal.=$_POST["label"]; else
{
$libellecal="";
if ($langs->trans("Action".$actioncomm->type_code) != "Action".$actioncomm->type_code)
{
$libellecal.=$langs->trans("Action".$actioncomm->type_code)."\n";
}
$libellecal.=$_POST["label"];
}
$webcal->date=$actioncomm->date;
$webcal->duree=($_POST["dureehour"] * 60) + $_POST["dureemin"];
$webcal->texte=$societe->nom;
$webcal->desc=$libellecal;
} }
$webcal->date=$actioncomm->date;
$webcal->duree=($_POST["dureehour"] * 60) + $_POST["dureemin"];
$webcal->texte=$societe->nom;
$webcal->desc=$libellecal;
} }
} }