Fix: Corrige nombreux problmes sur enregistrements incomplets des actions.
This commit is contained in:
parent
0e2dd91381
commit
2333344f2a
@ -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 = '<a href="'. DOL_URL_ROOT . '/compta/facture.php?facid='.$this->fk_facture.'">'.$langs->trans("Bill").'</a>';
|
||||
}
|
||||
|
||||
}
|
||||
$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 = '<a href="'. DOL_URL_ROOT . '/compta/facture.php?facid='.$this->fk_facture.'">'.$langs->trans("Bill").'</a>';
|
||||
}
|
||||
|
||||
}
|
||||
$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;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -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 '</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("Label").'</td><td><input type="text" name="label" size="30"></td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Title").'</td><td><input type="text" name="label" size="30"></td></tr>';
|
||||
|
||||
// Societe, contact
|
||||
print '<tr><td nowrap>'.$langs->trans("ActionOnCompany").'</td><td>';
|
||||
@ -470,7 +468,7 @@ if ($_GET["id"])
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
print '<tr><td>'.$langs->trans("Type").'</td><td colspan="3">'.$act->type.'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Label").'</td><td colspan="3">'.$act->libelle.'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Title").'</td><td colspan="3">'.$act->label.'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Company").'</td>';
|
||||
print '<td><a href="../fiche.php?socid='.$act->societe->id.'">'.$act->societe->nom.'</a></td>';
|
||||
|
||||
@ -486,11 +484,10 @@ if ($_GET["id"])
|
||||
print '<td colspan="3">'.$act->objet_url.'</td></tr>';
|
||||
}
|
||||
|
||||
if ($act->note)
|
||||
{
|
||||
// Note
|
||||
print '<tr><td valign="top">'.$langs->trans("Note").'</td><td colspan="3">';
|
||||
print nl2br($act->note).'</td></tr>';
|
||||
}
|
||||
print '<textarea cols="60" rows="6" name="note">'.nl2br($act->note).'</textarea></td></tr>';
|
||||
|
||||
print '<tr><td align="center" colspan="4"><input type="submit" value="'.$langs->trans("Save").'"</td></tr>';
|
||||
print '</table></form>';
|
||||
}
|
||||
@ -499,7 +496,7 @@ if ($_GET["id"])
|
||||
// Affichage fiche action en mode visu
|
||||
print '<table class="border" width="100%"';
|
||||
print '<tr><td>'.$langs->trans("Type").'</td><td colspan="3">'.$act->type.'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Label").'</td><td colspan="3">'.$act->libelle.'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Title").'</td><td colspan="3">'.$act->label.'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Company").'</td>';
|
||||
print '<td>'.$act->societe->nom_url.'</td>';
|
||||
|
||||
@ -514,11 +511,10 @@ if ($_GET["id"])
|
||||
print '<td colspan="3">'.$act->objet_url.'</td></tr>';
|
||||
}
|
||||
|
||||
if ($act->note)
|
||||
{
|
||||
// Note
|
||||
print '<tr><td valign="top">'.$langs->trans("Note").'</td><td colspan="3">';
|
||||
print nl2br($act->note).'</td></tr>';
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
}
|
||||
print '<br>';
|
||||
|
||||
@ -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");
|
||||
|
||||
|
||||
@ -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 '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>Date</td>';
|
||||
print '<td>'.$langs->trans("Date").'</td>';
|
||||
print '<td align="center">'.$langs->trans("Nb").'</td>';
|
||||
print '<td>'.$langs->trans("Action").'</td>';
|
||||
print '<td align="center">'.$langs->trans("PDF").'</td>';
|
||||
@ -206,5 +145,5 @@ else
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter("<em>Dernière modification $Date$ révision $Revision$</em>");
|
||||
llxFooter('$Date$ - $Revision$');
|
||||
?>
|
||||
|
||||
@ -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.'.<br>';
|
||||
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.<br>";
|
||||
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);
|
||||
|
||||
@ -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');
|
||||
|
||||
@ -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 '<table class="noborder" width="100%">';
|
||||
$tag = !$tag;
|
||||
@ -220,11 +220,11 @@ if ($_socid > 0)
|
||||
print '<td>'.$langs->trans("User").'</td>';
|
||||
print '</tr>';
|
||||
$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 '<tr '.$bc[$tag].'>';
|
||||
print '<td>'.dolibarr_print_date($obj->dc,"%d %B %Y %H:%M").'</td>';
|
||||
@ -233,7 +233,7 @@ if ($_socid > 0)
|
||||
print '</tr>';
|
||||
$i++;
|
||||
}
|
||||
$db->free();
|
||||
$db->free($resql);
|
||||
print "</table>";
|
||||
}
|
||||
else
|
||||
@ -245,5 +245,5 @@ if ($_socid > 0)
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter("<em>Dernière modification $Date$ révision $Revision$</em>");
|
||||
llxFooter('$Date$ - $Revision$');
|
||||
?>
|
||||
|
||||
@ -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');
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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.<br>";
|
||||
if ($message) {
|
||||
$actionmsg.="Texte utilisé dans le corps du message:<br>";
|
||||
@ -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.<br>";
|
||||
if ($message) {
|
||||
$actionmsg.="Texte utilisé dans le corps du message:<br>";
|
||||
@ -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);
|
||||
|
||||
@ -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')
|
||||
{
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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))
|
||||
|
||||
@ -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");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user