diff --git a/htdocs/actioncomm.class.php b/htdocs/actioncomm.class.php index 99cc0302837..b546470fc22 100644 --- a/htdocs/actioncomm.class.php +++ b/htdocs/actioncomm.class.php @@ -38,10 +38,11 @@ class ActionComm var $id; var $db; - var $label; - var $date; + var $type_id; var $type_code; var $type; + var $label; + var $date; var $priority; var $user; var $author; @@ -84,7 +85,9 @@ class ActionComm $sql = "INSERT INTO ".MAIN_DB_PREFIX."actioncomm"; $sql.= "(datea,fk_action,fk_soc,note,fk_contact,fk_user_author,fk_user_action,label,percent,priority,"; $sql.= "fk_facture,propalrowid)"; - $sql.= " VALUES (now(), '".$this->type_code."', '".$this->societe->id."' ,'".addslashes($this->note)."',"; + $sql.= " VALUES ("; + $sql.= "'".$this->db->idate($this->date)."',"; + $sql.= "'".$this->type_id."', '".$this->societe->id."' ,'".addslashes($this->note)."',"; $sql.= ($this->contact->id?$this->contact->id:"null").","; $sql.= "'$author->id', '".$this->user->id ."', '".addslashes($this->label)."','".$this->percent."','".$this->priority."',"; $sql.= ($this->facid?$this->facid:"null").","; @@ -93,27 +96,32 @@ class ActionComm if ($this->db->query($sql) ) { - $idaction = $this->db->last_insert_id(MAIN_DB_PREFIX."actioncomm"); + $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."actioncomm"); if ($conf->webcal->enabled) { - if (is_object($webcal)) - { - dolibarr_syslog("ActionComm::ajout entree dans webcal"); - // Ajoute entrée dans webcal - $result=$webcal->add($author,$webcal->date,$webcal->texte,$webcal->desc); - if ($result < 0) { - $this->error="Echec insertion dans webcal: ".$webcal->error; - } - } - else if ($webcal == 1) + // Appel a webcal + dolibarr_syslog("ActionComm::ajout entree dans webcal"); + + // Si webcal demandé et non défini en tant qu'objet, on le construit + if (! is_object($webcal) && $webcal == 1) { - // \todo On ajoute une entrée générique, pour l'instant pas utilisé - + $webcal=new ActionComm($this->db); + $webcal->date=$this->date; + $webcal->duree=0; + $webcal->texte=$this->societe; + $webcal->desc="Action ".$this->type_code."\n".$this->note; } + + // Ajoute entrée dans webcal + $result=$webcal->add($author,$webcal->date,$webcal->texte,$webcal->desc); + if ($result < 0) { + $this->error="Echec insertion dans webcal: ".$webcal->error; + } + } - return $idaction; + return $this->id; } else { @@ -128,46 +136,47 @@ class ActionComm * \param id id de l'action a récupérer */ function fetch($id) - { - global $langs; - - $sql = "SELECT ".$this->db->pdate("a.datea")." as da, a.note, a.label, c.code, c.libelle, fk_soc, fk_user_author, fk_contact, fk_facture, a.percent"; - $sql.= " FROM ".MAIN_DB_PREFIX."actioncomm as a, ".MAIN_DB_PREFIX."c_actioncomm as c"; - $sql.= " WHERE a.id=$id AND a.fk_action=c.id;"; - - $resql=$this->db->query($sql); - if ($resql) - { - if ($this->db->num_rows($resql)) - { - $obj = $this->db->fetch_object($resql); - - $this->id = $id; - $this->type_code = $obj->code; - $transcode=$langs->trans("Action".$obj->code); - $type_libelle=($transcode!="Action".$obj->code?$transcode:$obj->libelle); - $this->type = $type_libelle; - $this->libelle = $obj->label; - $this->date = $obj->da; - $this->note =$obj->note; - $this->percent =$obj->percent; - $this->societe->id = $obj->fk_soc; - $this->author->id = $obj->fk_user_author; - $this->contact->id = $obj->fk_contact; - $this->fk_facture = $obj->fk_facture; - if ($this->fk_facture) - { - $this->objet_url = ''.$langs->trans("Bill").''; - } - - } - $this->db->free($resql); - } - else - { - dolibarr_print_error($this->db); - } + { + global $langs; + + $sql = "SELECT ".$this->db->pdate("a.datea")." as da, a.note, a.label, a.fk_action as type_id, c.code, c.libelle, fk_soc, fk_user_author, fk_contact, fk_facture, a.percent"; + $sql.= " FROM ".MAIN_DB_PREFIX."actioncomm as a, ".MAIN_DB_PREFIX."c_actioncomm as c"; + $sql.= " WHERE a.id=$id AND a.fk_action=c.id;"; + + $resql=$this->db->query($sql); + if ($resql) + { + if ($this->db->num_rows($resql)) + { + $obj = $this->db->fetch_object($resql); + + $this->id = $id; + $this->type_id = $type_id; + $this->type_code = $obj->code; + $transcode=$langs->trans("Action".$obj->code); + $type_libelle=($transcode!="Action".$obj->code?$transcode:$obj->libelle); + $this->type = $type_libelle; + $this->label = $obj->label; + $this->date = $obj->da; + $this->note =$obj->note; + $this->percent =$obj->percent; + $this->societe->id = $obj->fk_soc; + $this->author->id = $obj->fk_user_author; + $this->contact->id = $obj->fk_contact; + $this->fk_facture = $obj->fk_facture; + if ($this->fk_facture) + { + $this->objet_url = ''.$langs->trans("Bill").''; + } + + } + $this->db->free($resql); } + else + { + dolibarr_print_error($this->db); + } + } /** * \brief Supprime l'action de la base @@ -186,31 +195,23 @@ class ActionComm /** * \brief Met a jour l'action en base - * \return int 1 en cas de succès + * \return int <0 si ko, >0 si ok */ - function update() + function update() { - if ($this->percent > 100) - { - $this->percent = 100; - } - - $sql = "UPDATE ".MAIN_DB_PREFIX."actioncomm "; - $sql .= " SET percent=$this->percent"; - - if ($this->percent == 100) - { - $sql .= ", datea = now()"; - } - - $sql .= ", fk_contact =". $this->contact->id; - - $sql .= " WHERE id=$this->id;"; - - if ($this->db->query($sql) ) - { - return 1; - } + if ($this->percent > 100) $this->percent = 100; + + $sql = "UPDATE ".MAIN_DB_PREFIX."actioncomm "; + $sql.= " SET percent='".$this->percent."'"; + if ($this->percent == 100) $sql .= ", datea = now()"; + if ($this->note) $sql .= ", note = '".addslashes($this->note)."'"; + $sql.= ", fk_contact =". $this->contact->id; + $sql.= " WHERE id=$this->id;"; + + if ($this->db->query($sql) ) + { + return 1; + } } } diff --git a/htdocs/cactioncomm.class.php b/htdocs/cactioncomm.class.php index 7fdfa7288c5..82d2f86cc4b 100644 --- a/htdocs/cactioncomm.class.php +++ b/htdocs/cactioncomm.class.php @@ -37,7 +37,12 @@ class CActioncomm { var $db; var $id; + + var $code; + var $type; var $libelle; + var $active; + var $error; var $type_actions=array(); @@ -60,7 +65,9 @@ class CActioncomm { function fetch($id) { - $sql = "SELECT libelle FROM ".MAIN_DB_PREFIX."c_actioncomm WHERE id=$id;"; + $sql = "SELECT code, type, libelle, active"; + $sql.= " FROM ".MAIN_DB_PREFIX."c_actioncomm"; + $sql.= " WHERE id=$id"; $resql=$this->db->query($sql); if ($resql) @@ -70,7 +77,10 @@ class CActioncomm { $obj = $this->db->fetch_object($resql); $this->id = $id; + $this->code = $obj->code; + $this->type = $obj->type; $this->libelle = $obj->libelle; + $this->active = $obj->active; return 1; } diff --git a/htdocs/comm/action/fiche.php b/htdocs/comm/action/fiche.php index 51e78621069..30be162e445 100644 --- a/htdocs/comm/action/fiche.php +++ b/htdocs/comm/action/fiche.php @@ -27,13 +27,12 @@ \version $Revision$ */ -require("./pre.inc.php"); - -require("../../contact.class.php"); -require("../../cactioncomm.class.php"); -require("../../actioncomm.class.php"); +require_once("./pre.inc.php"); +require_once("../../contact.class.php"); +require_once("../../cactioncomm.class.php"); +require_once("../../actioncomm.class.php"); if ($conf->webcal->enabled) { - require("../../lib/webcal.class.php"); + require_once("../../lib/webcal.class.php"); } $langs->load("companies"); @@ -71,29 +70,24 @@ if ($_POST["action"] == 'add_action') { $db->begin(); + $cactioncomm = new CActionComm($db); + $cactioncomm->fetch($_POST["actionid"]); + + // Initialisation objet actioncomm $actioncomm = new ActionComm($db); - $actioncomm->type_code = $_POST["actionid"]; + $actioncomm->type_id = $_POST["actionid"]; + $actioncomm->type_code = $cactioncomm->code; $actioncomm->priority = isset($_POST["priority"])?$_POST["priority"]:0; - if ($_POST["actionid"] == 5) - { - if ($contact->fullname) { $actioncomm->label = $langs->trans("TaskRDVWith",$contact->fullname); } - else { $actioncomm->label = $langs->trans("TaskRDV"); } - } else { - $actioncomm->label = $_POST["label"]; - } - $actioncomm->date = $db->idate(mktime($_POST["heurehour"], - $_POST["heuremin"], - 0, - $_POST["acmonth"], - $_POST["acday"], - $_POST["acyear"]) - ); - + $actioncomm->label = $_POST["label"]; + $actioncomm->date = mktime($_POST["heurehour"], + $_POST["heuremin"], + 0, + $_POST["acmonth"], + $_POST["acday"], + $_POST["acyear"]); $actioncomm->percent = isset($_POST["percentage"])?$_POST["percentage"]:0; - $actioncomm->user = $user; - if (isset($_POST["contactid"])) { $actioncomm->contact = $contact; @@ -104,6 +98,7 @@ if ($_POST["action"] == 'add_action') } $actioncomm->note = $_POST["note"]; + // On definit la ressource webcal si le module webcal est actif $webcal=0; if ($conf->webcal->enabled && $_POST["todo_webcal"] == 'on') @@ -120,24 +115,24 @@ if ($_POST["action"] == 'add_action') } else { - if ($_POST["actionid"] == 5) + // Initialisation donnees webcal + if ($_POST["actionid"] == 5 && $contact->fullname) { - $libellecal = $langs->trans("TaskRDVWith",$contact->fullname); - $libellecal .= "\n" . $actioncomm->label; + $libellecal =$langs->trans("TaskRDVWith",$contact->fullname)."\n"; + $libellecal.=$actioncomm->label; } else { - $libellecal = $actioncomm->label; + $libellecal=""; + if ($langs->trans("Action".$actioncomm->type_code) != "Action".$actioncomm->type_code) + { + $libellecal.=$langs->trans("Action".$actioncomm->type_code)."\n"; + } + $libellecal.=$actioncomm->label; } - $webcal->date=mktime($_POST["heurehour"], - $_POST["heuremin"], - 0, - $_POST["acmonth"], - $_POST["acday"], - $_POST["acyear"]); - $webcal->heure = $_POST["heurehour"] . $_POST["heuremin"] . '00'; - $webcal->duree = ($_POST["dureehour"] * 60) + $_POST["dureemin"]; + $webcal->date=$actioncomm->date; + $webcal->duree=($_POST["dureehour"] * 60) + $_POST["dureemin"]; $webcal->texte=$societe->nom; $webcal->desc=$libellecal; } @@ -208,11 +203,14 @@ if ($_POST["action"] == 'update') $action->fetch($_POST["id"]); $action->percent = $_POST["percent"]; $action->contact->id = $_POST["contactid"]; + $action->note = $_POST["note"]; $action->update(); Header("Location: ".$_POST["from"]); } + + llxHeader(); $html = new Form($db); @@ -343,7 +341,7 @@ if ($_GET["action"] == 'create') } print ''; - print ''.$langs->trans("Label").''; + print ''.$langs->trans("Title").''; // Societe, contact print ''.$langs->trans("ActionOnCompany").''; @@ -470,7 +468,7 @@ if ($_GET["id"]) print ''; print ''; - print ''; + print ''; print ''; print ''; @@ -486,11 +484,10 @@ if ($_GET["id"]) print ''; } - if ($act->note) - { + // Note print ''; - } + print ''; + print ''; print '
'.$langs->trans("Type").''.$act->type.'
'.$langs->trans("Label").''.$act->libelle.'
'.$langs->trans("Title").''.$act->label.'
'.$langs->trans("Company").''.$act->societe->nom.''.$act->objet_url.'
'.$langs->trans("Note").''; - print nl2br($act->note).'
'; } @@ -499,7 +496,7 @@ if ($_GET["id"]) // Affichage fiche action en mode visu print ''; - print ''; + print ''; print ''; print ''; @@ -514,11 +511,10 @@ if ($_GET["id"]) print ''; } - if ($act->note) - { + // Note print ''; - } + print '
'.$langs->trans("Type").''.$act->type.'
'.$langs->trans("Label").''.$act->libelle.'
'.$langs->trans("Title").''.$act->label.'
'.$langs->trans("Company").''.$act->societe->nom_url.''.$act->objet_url.'
'.$langs->trans("Note").''; print nl2br($act->note).'
'; } print '
'; diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 660092e8b4b..8a0d09ba107 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -29,10 +29,9 @@ \version $Revision$ */ -require("./pre.inc.php"); - -require("../../contact.class.php"); -require("../../actioncomm.class.php"); +require_once("./pre.inc.php"); +require_once("../../contact.class.php"); +require_once("../../actioncomm.class.php"); $langs->load("companies"); diff --git a/htdocs/comm/action/rapport/index.php b/htdocs/comm/action/rapport/index.php index d88b2113f3b..030ed341f80 100644 --- a/htdocs/comm/action/rapport/index.php +++ b/htdocs/comm/action/rapport/index.php @@ -28,10 +28,9 @@ \version $Revision$ */ -require("./pre.inc.php"); - -require("../../../contact.class.php"); -require("../../../actioncomm.class.php"); +require_once("./pre.inc.php"); +require_once("../../../contact.class.php"); +require_once("../../../actioncomm.class.php"); /* * Sécurité accés client @@ -49,81 +48,21 @@ if ($_GET["action"] == 'pdf') } -llxHeader(); - /* - * - * - * + * Actions */ if ($action=='delete_action') { $actioncomm = new ActionComm($db); $actioncomm->delete($actionid); } -/* - * - */ -if ($action=='add_action') -{ - $contact = new Contact($db); - $contact->fetch($contactid); - - $actioncomm = new ActionComm($db); - - if ($actionid == 5) - { - $actioncomm->date = $db->idate(mktime($heurehour,$heuremin,0,$remonth,$reday,$reyear)); - } - else - { - $actioncomm->date = $date; - } - $actioncomm->type = $actionid; - $actioncomm->contact = $contactid; - - $actioncomm->societe = $socid; - $actioncomm->note = $note; - - $actioncomm->add($user); - - $societe = new Societe($db); - $societe->fetch($socid); - $todo = new TodoComm($db); - $todo->date = mktime(12,0,0,$remonth, $reday, $reyear); - $todo->libelle = $todo_label; - - $todo->societe = $societe->id; - $todo->contact = $contactid; - - $todo->note = $todo_note; - - $todo->add($user); - - $webcal = new Webcal(); - - $webcal->heure = $heurehour . $heuremin . '00'; - $webcal->duree = ($dureehour * 60) + $dureemin; - - if ($actionid == 5) { - $libelle = "Rendez-vous avec ".$contact->fullname; - $libelle .= "\n" . $todo->libelle; - } else { - $libelle = $todo->libelle; - } - - - $webcal->add($user, $todo->date, $societe->nom, $libelle); - -} +llxHeader(); /* - * * Liste - * */ if ($page == -1) { $page = 0 ; } @@ -155,7 +94,7 @@ if ( $db->query($sql) ) $i = 0; print ''; print ''; - print ''; + print ''; print ''; print ''; print ''; @@ -206,5 +145,5 @@ else $db->close(); -llxFooter("Dernière modification $Date$ révision $Revision$"); +llxFooter('$Date$ - $Revision$'); ?> diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 1d7a75fe76b..b62e00cbc05 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -173,7 +173,7 @@ if ($_POST['action'] == 'send') if ($_POST['action'] == 'send') { $subject = $langs->trans('Propal').' '.$propal->ref; - $actioncode=3; + $actiontypeid=3; $actionmsg ='Mail envoyé par '.$from.' à '.$sendto.'.
'; if ($message) { @@ -186,7 +186,7 @@ if ($_POST['action'] == 'send') if ($_POST["action"] == 'relance') { $subject = "Relance facture $propal->ref"; - $actioncode=10; + $actiontypeid=10; $actionmsg="Mail envoyé par $from à $sendto.
"; if ($message) { @@ -210,10 +210,10 @@ if ($_POST['action'] == 'send') // Insertion action include_once('../contact.class.php'); $actioncomm = new ActionComm($db); - $actioncomm->type_code = $actioncode; + $actioncomm->type_id = $actiontypeid; $actioncomm->label = $actionmsg2; $actioncomm->note = $actionmsg; - $actioncomm->date = $db->idate(time()); + $actioncomm->date = time(); // L'action est faite maintenant $actioncomm->percent = 100; $actioncomm->contact = new Contact($db,$sendtoid); $actioncomm->societe = new Societe($db,$propal->socidp); diff --git a/htdocs/comm/prospect/fiche.php b/htdocs/comm/prospect/fiche.php index 5a3e48445fa..73d6395a159 100644 --- a/htdocs/comm/prospect/fiche.php +++ b/htdocs/comm/prospect/fiche.php @@ -28,9 +28,9 @@ \version $Revision$ */ -require("./pre.inc.php"); -require("../../contact.class.php"); -require("../../actioncomm.class.php"); +require_once("./pre.inc.php"); +require_once("../../contact.class.php"); +require_once("../../actioncomm.class.php"); $langs->load('companies'); $langs->load('projects'); diff --git a/htdocs/comm/remise.php b/htdocs/comm/remise.php index 936efba6dab..e141fe32337 100644 --- a/htdocs/comm/remise.php +++ b/htdocs/comm/remise.php @@ -18,7 +18,6 @@ * * $Id$ * $Source$ - * */ /** @@ -28,10 +27,10 @@ \version $Revision$ */ -require("./pre.inc.php"); -require("../contact.class.php"); -require("../cactioncomm.class.php"); -require("../actioncomm.class.php"); +require_once("./pre.inc.php"); +require_once("../contact.class.php"); +//require_once("../cactioncomm.class.php"); +//require_once("../actioncomm.class.php"); $user->getrights('propale'); $user->getrights('commande'); @@ -210,7 +209,8 @@ if ($_socid > 0) $sql .= " AND u.rowid = rc.fk_user_author"; $sql .= " ORDER BY rc.datec DESC"; - if ( $db->query($sql) ) + $resql=$db->query($sql); + if ($resql) { print '
Date'.$langs->trans("Date").''.$langs->trans("Nb").''.$langs->trans("Action").''.$langs->trans("PDF").'
'; $tag = !$tag; @@ -220,11 +220,11 @@ if ($_socid > 0) print ''; print ''; $i = 0 ; - $num = $db->num_rows(); + $num = $db->num_rows($resql); while ($i < $num ) { - $obj = $db->fetch_object( $i); + $obj = $db->fetch_object($resql); $tag = !$tag; print ''; print ''; @@ -233,7 +233,7 @@ if ($_socid > 0) print ''; $i++; } - $db->free(); + $db->free($resql); print "
'.$langs->trans("User").'
'.dolibarr_print_date($obj->dc,"%d %B %Y %H:%M").'
"; } else @@ -245,5 +245,5 @@ if ($_socid > 0) $db->close(); -llxFooter("Dernière modification $Date$ révision $Revision$"); +llxFooter('$Date$ - $Revision$'); ?> diff --git a/htdocs/comm/remx.php b/htdocs/comm/remx.php index 987e4e29c91..b484eaea3a9 100644 --- a/htdocs/comm/remx.php +++ b/htdocs/comm/remx.php @@ -18,12 +18,19 @@ * * $Id$ * $Source$ - * */ -require("./pre.inc.php"); -require("../contact.class.php"); -require("../cactioncomm.class.php"); -require("../actioncomm.class.php"); + +/** + \file htdocs/comm/remx.php + \ingroup commercial + \brief Onglet ??? + \version $Revision$ +*/ + +require_once("./pre.inc.php"); +require_once("../contact.class.php"); +//require_once("../cactioncomm.class.php"); +//require_once("../actioncomm.class.php"); $user->getrights('propale'); $user->getrights('commande'); diff --git a/htdocs/compta/clients.php b/htdocs/compta/clients.php index d7f0c396857..801489c6360 100644 --- a/htdocs/compta/clients.php +++ b/htdocs/compta/clients.php @@ -28,9 +28,9 @@ \version $Revision$ */ -require("./pre.inc.php"); -require("../contact.class.php"); -require("../actioncomm.class.php"); +require_once("./pre.inc.php"); +require_once("../contact.class.php"); +require_once("../actioncomm.class.php"); if ($conf->webcal->enabled) { require("../lib/webcal.class.php"); @@ -59,45 +59,6 @@ if ($user->societe_id > 0) $socidp = $user->societe_id; } - -// \todo code encore utilisé ? -if ($action=='add_action') { - /* - * Vient de actioncomm.php - * - */ - $actioncomm = new ActionComm($db); - $actioncomm->date = $date; - $actioncomm->type = $actionid; - $actioncomm->contact = $contactid; - - $actioncomm->societe = $socid; - $actioncomm->note = $note; - - $actioncomm->add($user); - - - $societe = new Societe($db); - $societe->fetch($socid); - - - $todo = new TodoComm($db); - $todo->date = mktime(12,0,0,$remonth, $reday, $reyear); - - $todo->libelle = $todo_label; - - $todo->societe = $societe->id; - $todo->contact = $contactid; - - $todo->note = $todo_note; - - $todo->add($user); - - $webcal = new Webcal(); - $webcal->add($user, $todo->date, $societe->nom, $todo->libelle); -} - - if ($action == 'attribute_prefix') { $societe = new Societe($db, $socid); diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 256ab684114..7f9344c1894 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -382,7 +382,7 @@ if ($_POST["action"] == 'send' || $_POST["action"] == 'relance') $message = $_POST["message"]; if ($_POST["action"] == 'send') { $subject = $langs->trans("Bill")." $fac->ref"; - $actioncode=9; + $actiontypeid=9; $actionmsg ="Mail envoyé par $from à $sendto.
"; if ($message) { $actionmsg.="Texte utilisé dans le corps du message:
"; @@ -392,7 +392,7 @@ if ($_POST["action"] == 'send' || $_POST["action"] == 'relance') } if ($_POST["action"] == 'relance') { $subject = "Relance facture $fac->ref"; - $actioncode=10; + $actiontypeid=10; $actionmsg="Mail envoyé par $from à $sendto.
"; if ($message) { $actionmsg.="Texte utilisé dans le corps du message:
"; @@ -419,10 +419,10 @@ if ($_POST["action"] == 'send' || $_POST["action"] == 'relance') include_once("../contact.class.php"); include_once("../actioncomm.class.php"); $actioncomm = new ActionComm($db); - $actioncomm->type_code = $actioncode; + $actioncomm->type_id = $actiontypeid; $actioncomm->label = $actionmsg2; $actioncomm->note = $actionmsg; - $actioncomm->date = $db->idate(time()); + $actioncomm->date = time(); $actioncomm->percent = 100; $actioncomm->contact = new Contact($db,$sendtoid); $actioncomm->societe = new Societe($db,$fac->socidp); diff --git a/htdocs/compta/fiche.php b/htdocs/compta/fiche.php index 4717df274fc..62cc09596c3 100644 --- a/htdocs/compta/fiche.php +++ b/htdocs/compta/fiche.php @@ -53,26 +53,6 @@ $user->getrights('facture'); llxHeader(); -if ($action=='add_action') -{ - /* - * Vient de actioncomm.php - * - */ - $actioncomm = new ActionComm($db); - $actioncomm->date = $date; - $actioncomm->type = $actionid; - $actioncomm->contact = $contactid; - - $actioncomm->societe = $socid; - $actioncomm->note = $note; - - $actioncomm->add($user); - - $societe = new Societe($db); - $societe->fetch($socid); -} - if ($action == 'recontact') { diff --git a/htdocs/compta/propal.php b/htdocs/compta/propal.php index 6eb67fae81e..e5edbe14849 100644 --- a/htdocs/compta/propal.php +++ b/htdocs/compta/propal.php @@ -38,7 +38,7 @@ accessforbidden(); require_once(DOL_DOCUMENT_ROOT."/lib/CMailFile.class.php"); require_once("../project.class.php"); require_once("../propal.class.php"); -require_once("../actioncomm.class.php"); +//require_once("../actioncomm.class.php"); // Sécurité accés client if ($user->societe_id > 0) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 9f7f268008e..76deaada645 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -245,6 +245,7 @@ WebCalSetupSaved=Webcalendar setup saved successfully. WebCalTestOk=Connection to server '%s' on database '%s' with user '%s' successfull. WebCalTestKo1=Connection to server '%s' succeed but database '%s' could not be reached. WebCalTestKo2=Connection to server '%s' with user '%s' failed. +ErrorConnectOkButWrongDatabase=Connection succeeded but database doesn't look to be a Webcalendar database. ##### Bills ##### BillsSetup=Bills module setup BillsDate=Bills date diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index f97eab849b3..b6772cc22b2 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -17,6 +17,7 @@ ErrorAttachedFilesDisabled=Attaching files feature is disabled on this serveur ErrorFileNotUploaded=File was not uploaded ErrorInternalErrorDetected=Internal error detected ErrorNoRequestRan=No request ran +ErrorWrongHostParameter=Wrong host parameter RequestedUrl=Requested Url DatabaseTypeManager=Database type manager RequestLastAccess=Request for last database access @@ -81,6 +82,7 @@ Type=Type Language=Language Note=Note CurrentNote=Current note +Title=Titre Label=Label Info=Info Family=Family diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index c065ad478d9..6f65e9a3ebd 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -245,6 +245,7 @@ WebCalSetupSaved=Les identifiants Webcalendar ont WebCalTestOk=La connexion au serveur '%s' sur la base '%s' par l'utilisateur '%s' a réussi. WebCalTestKo1=La connexion au serveur '%s' a réussi mais la base '%s' n'a pu être atteinte. WebCalTestKo2=La connexion au serveur '%s' par l'utilisateur '%s' à échoué. +ErrorConnectOkButWrongDatabase=La connexion a réussie mais la base ne semble pas etre une base webcalendar. ##### Bills ##### BillsSetup=Configuration du module Factures BillsDate=Date des factures diff --git a/htdocs/langs/fr_FR/main.lang b/htdocs/langs/fr_FR/main.lang index e9db69643dd..8488db77254 100644 --- a/htdocs/langs/fr_FR/main.lang +++ b/htdocs/langs/fr_FR/main.lang @@ -17,6 +17,7 @@ ErrorAttachedFilesDisabled=La gestion des fichiers associ ErrorFileNotUploaded=Le fichier n'a pas été transféré ErrorInternalErrorDetected=Erreur interne détectée ErrorNoRequestRan=Aucune requête exécutée +ErrorWrongHostParameter=Mauvais paramètre Serveur RequestedUrl=Url sollicitée DatabaseTypeManager=Type gestionnaire de base de donnée RequestLastAccess=Requete dernier acces en base @@ -81,6 +82,7 @@ Type=Type Language=Langue Note=Note CurrentNote=Note actuelle +Title=Titre Label=Libellé Info=Info Family=Famille diff --git a/htdocs/lib/webcal.class.php b/htdocs/lib/webcal.class.php index ac4f2dc4fb7..0d30b841391 100644 --- a/htdocs/lib/webcal.class.php +++ b/htdocs/lib/webcal.class.php @@ -40,9 +40,9 @@ require_once (DOL_DOCUMENT_ROOT ."/lib/".$conf->webcal->db->type.".lib.php"); class Webcal { var $localdb; - var $heure = -1; - var $duree = 0; + var $date; + var $duree = 0; var $texte; var $desc; var $error; @@ -68,7 +68,7 @@ class Webcal { /** \brief Ajoute une entree dans le calendrier de l'utilisateur \param[in] user le login de l'utilisateur - \param[in] date la date de l'evenement dans le calendrier + \param[in] date la date et l'heure de l'evenement dans le calendrier \param[in] texte le titre a indiquer dans l'evenement \param[in] desc la description a indiquer dans l'evenement \return int 1 en cas de succès, -1,-2,-3 en cas d'erreur, -4 si login webcal non défini @@ -93,9 +93,9 @@ class Webcal { $cal_id = $id; $cal_create_by = $user->webcal_login; $cal_date = strftime('%Y%m%d', $date); - $cal_time = $this->heure; + $cal_time = strftime('%H%M%S', $date); $cal_mod_date = strftime('%Y%m%d', time()); - $cal_mod_time = strftime('%H%M', time()); + $cal_mod_time = strftime('%H%M%S', time()); $cal_duration = $this->duree; $cal_priority = 2; $cal_type = "E"; @@ -106,7 +106,7 @@ class Webcal { $sql = "INSERT INTO webcal_entry (cal_id, cal_create_by,cal_date,cal_time,cal_mod_date, cal_mod_time,cal_duration,cal_priority,cal_type, cal_access, cal_name,cal_description)"; - $sql .= " VALUES ($cal_id, '$cal_create_by', $cal_date, $cal_time,$cal_mod_date, $cal_mod_time, + $sql .= " VALUES ($cal_id, '$cal_create_by', '$cal_date', '$cal_time', '$cal_mod_date', '$cal_mod_time', $cal_duration,$cal_priority,'$cal_type', '$cal_access', '$cal_name','$cal_description')"; if ($this->localdb->query($sql)) diff --git a/htdocs/societe.php b/htdocs/societe.php index 9fceab686b4..185c53368e0 100644 --- a/htdocs/societe.php +++ b/htdocs/societe.php @@ -27,10 +27,10 @@ \version $Revision$ */ -require("./pre.inc.php"); -require("./contact.class.php"); -require("./cactioncomm.class.php"); -require("./actioncomm.class.php"); +require_once("./pre.inc.php"); +require_once("./contact.class.php"); +//require_once("./cactioncomm.class.php"); +//require_once("./actioncomm.class.php"); $langs->load("companies"); $langs->load("customers");