diff --git a/htdocs/actioncomm.class.php3 b/htdocs/actioncomm.class.php3 index 1b7f3f07460..9d7e539872b 100644 --- a/htdocs/actioncomm.class.php3 +++ b/htdocs/actioncomm.class.php3 @@ -55,8 +55,7 @@ class ActionComm { $sql .= $this->user->id . ", $this->contact, $this->percent, '$this->note', $this->priority);"; if ($this->db->query($sql) ) { - - + return 1; } else { print $this->db->error() . "
" . $sql; } diff --git a/htdocs/comm/action/fiche.php3 b/htdocs/comm/action/fiche.php3 index 92889bc36e6..50920cc3be2 100644 --- a/htdocs/comm/action/fiche.php3 +++ b/htdocs/comm/action/fiche.php3 @@ -22,9 +22,9 @@ require("./pre.inc.php3"); require("../../contact.class.php3"); -require("../..//lib/webcal.class.php3"); -require("../cactioncomm.class.php3"); -require("../actioncomm.class.php3"); +require("../../lib/webcal.class.php3"); +require("../../cactioncomm.class.php3"); +require("../../actioncomm.class.php3"); $db = new Db(); @@ -36,6 +36,9 @@ $db = new Db(); if ($action=='add_action') { $contact = new Contact($db); $contact->fetch($contactid); + $societe = new Societe($db); + $societe->fetch($socid); + $actioncomm = new ActionComm($db); @@ -50,8 +53,6 @@ if ($action=='add_action') { $actioncomm->type = $actionid; $actioncomm->contact = $contactid; - - $actioncomm->user = $user; $actioncomm->societe = $socid; @@ -59,12 +60,7 @@ if ($action=='add_action') { $actioncomm->add($user); - - $societe = new Societe($db); - $societe->fetch($socid); - - - if ($todo) { + if ($todo == 'on' ) { $todo = new ActionComm($db); $todo->type = 0; @@ -83,7 +79,7 @@ if ($action=='add_action') { $todo->add($user); - if ($conf->webcal && $todo_webcal) { + if ($conf->webcal && $todo_webcal == 'on') { $webcal = new Webcal(); @@ -159,14 +155,15 @@ if ($action=='create' && $actionid && $contactid) { } /* - *Autre action + * + * Action autre que rendez-vous * * */ else { - print '
'; + print ''; print ''; print ''; diff --git a/htdocs/comm/action/index.php3 b/htdocs/comm/action/index.php3 index 0a91b78110b..c883daa50ff 100644 --- a/htdocs/comm/action/index.php3 +++ b/htdocs/comm/action/index.php3 @@ -24,8 +24,8 @@ require("./pre.inc.php3"); require("../../contact.class.php3"); require("../../lib/webcal.class.php3"); -require("../cactioncomm.class.php3"); -require("../actioncomm.class.php3"); +require("../../cactioncomm.class.php3"); +require("../../actioncomm.class.php3"); llxHeader(); diff --git a/htdocs/comm/actioncomm.class.php3 b/htdocs/comm/actioncomm.class.php3 deleted file mode 100644 index 1b7f3f07460..00000000000 --- a/htdocs/comm/actioncomm.class.php3 +++ /dev/null @@ -1,105 +0,0 @@ - - * - * $Id$ - * $Source$ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - */ - -class ActionComm { - var $id; - var $db; - - var $date; - var $type; - - var $priority; - - var $user; - var $author; - - var $societe; - var $contact; - var $note; - - var $percent; - - - Function ActionComm($db) { - $this->db = $db; - $this->societe = new Societe($db); - - } - /* - * - * - * - */ - Function add($author) { - $sql = "INSERT INTO actioncomm (datea, fk_action, fk_soc, fk_user_author, fk_user_action, fk_contact, percent, note,priority) "; - $sql .= " VALUES ('$this->date',$this->type,$this->societe, $author->id,"; - $sql .= $this->user->id . ", $this->contact, $this->percent, '$this->note', $this->priority);"; - - if ($this->db->query($sql) ) { - - - } else { - print $this->db->error() . "
" . $sql; - } - } - /* - * - * - * - */ - Function fetch($id) { - - $sql = "SELECT ".$this->db->pdate("a.datea")." as da, a.note,c.libelle, fk_soc "; - $sql .= "FROM actioncomm as a, c_actioncomm as c WHERE a.id=$id AND a.fk_action=c.id;"; - - if ($this->db->query($sql) ) { - if ($this->db->num_rows()) { - $obj = $this->db->fetch_object(0); - - $this->id = $id; - $this->type = $obj->libelle; - $this->date = $obj->da; - $this->note =$obj->note; - - $this->societe->id = $obj->fk_soc; - - $this->db->free(); - } - } else { - print $this->db->error(); - } - } - /* - * - * - * - */ - Function delete($id) { - - $sql = "DELETE FROM actioncomm WHERE id=$id;"; - - if ($this->db->query($sql) ) { - - } - } -} -?> diff --git a/htdocs/comm/cactioncomm.class.php3 b/htdocs/comm/cactioncomm.class.php3 deleted file mode 100644 index 5cb8517e37e..00000000000 --- a/htdocs/comm/cactioncomm.class.php3 +++ /dev/null @@ -1,53 +0,0 @@ - - * - * $Id$ - * $Source$ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - */ - -class CActioncomm { - var $id; - var $libelle; - - Function CActioncomm() { - - } - /* - * - * - * - */ - Function fetch($db, $id) { - - $sql = "SELECT libelle FROM c_actioncomm WHERE id=$id;"; - - if ($db->query($sql) ) { - if ($db->num_rows()) { - $obj = $db->fetch_object(0); - - $this->id = $id; - $this->libelle = $obj->libelle; - - $db->free(); - } - } else { - print $db->error(); - } - } -} -?> diff --git a/htdocs/comm/clients.php3 b/htdocs/comm/clients.php3 index f567b666f88..da56fc38aef 100644 --- a/htdocs/comm/clients.php3 +++ b/htdocs/comm/clients.php3 @@ -22,8 +22,8 @@ require("./pre.inc.php3"); require("../contact.class.php3"); require("../lib/webcal.class.php3"); -require("cactioncomm.class.php3"); -require("actioncomm.class.php3"); +require("../cactioncomm.class.php3"); +require("../actioncomm.class.php3"); llxHeader(); diff --git a/htdocs/comm/fiche.php3 b/htdocs/comm/fiche.php3 index 9c943f5bc8f..c4025440c40 100644 --- a/htdocs/comm/fiche.php3 +++ b/htdocs/comm/fiche.php3 @@ -22,8 +22,8 @@ require("./pre.inc.php3"); require("../contact.class.php3"); require("../lib/webcal.class.php3"); -require("cactioncomm.class.php3"); -require("actioncomm.class.php3"); +require("../cactioncomm.class.php3"); +require("../actioncomm.class.php3"); llxHeader(); @@ -37,42 +37,6 @@ if ($sortfield == "") { $sortfield="nom"; } -if ($action=='add_action') { - /* - * Vient de actioncomm.php3 - * - */ - $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); @@ -307,11 +271,13 @@ if ($socid > 0) { * Liste des contacts * */ - print ""; + print '
'; + + print ''; - print ""; - print ''; - print ""; + print ""; + print ''; + print ""; print ""; $sql = "SELECT p.idp, p.name, p.firstname, p.poste, p.phone, p.fax, p.email, p.note FROM socpeople as p WHERE p.fk_soc = $objsoc->idp ORDER by p.datec"; @@ -319,11 +285,9 @@ if ($socid > 0) { $i = 0 ; $num = $db->num_rows(); $tag = True; while ($i < $num) { $obj = $db->fetch_object( $i); - if ($tag) { - print ""; - } else { - print ""; - } + $var = !$var; + print ""; + print '
Prénom NomPosteTélFaxEmail
Prénom NomPosteTélFaxEmailidp&action=addcontact\">Ajouter
'; //print ''; //print ' '; @@ -343,7 +307,7 @@ if ($socid > 0) { $tag = !$tag; } print "
"; - + print '
'; print "\n
\n"; /* diff --git a/htdocs/comm/index.php3 b/htdocs/comm/index.php3 index 364a0a43c6b..6fedbb4c202 100644 --- a/htdocs/comm/index.php3 +++ b/htdocs/comm/index.php3 @@ -56,9 +56,6 @@ if ($action == 'del_bookmark') { } - - - print_titre("Espace commercial"); print ''; diff --git a/htdocs/comm/people.php3 b/htdocs/comm/people.php3 index ea8a07e3755..98dfc35034d 100644 --- a/htdocs/comm/people.php3 +++ b/htdocs/comm/people.php3 @@ -82,8 +82,8 @@ if ($socid > 0) { * * */ - print "
\n"; - print ""; + print "
N° $objsoc->idp - idp\">$objsoc->nom - [$objsoc->stcomm]
\n"; + print ""; print ""; print ""; @@ -190,11 +190,10 @@ if ($socid > 0) { * * */ - print "

idp\">$objsoc->nomNotes[Ajouter un contact]
"; + print '

'; - print ""; - print ""; - + print ""; + print ""; $sql = "SELECT a.id, ".$db->pdate("a.datea")." as da, c.libelle, u.code, a.propalrowid, a.fk_user_author, fk_contact, u.rowid "; $sql .= " FROM actioncomm as a, c_actioncomm as c, llx_user as u "; @@ -211,11 +210,9 @@ if ($socid > 0) { $i = 0 ; $num = $db->num_rows(); $tag = True; while ($i < $num) { $obj = $db->fetch_object( $i); - if ($tag) { - print ""; - } else { - print ""; - } + $var=!$var; + print ""; + print ""; if ($obj->propalrowid) { print ""; diff --git a/htdocs/fichinter/index.php3 b/htdocs/fichinter/index.php3 index b3836cfaced..ac21b5078e3 100644 --- a/htdocs/fichinter/index.php3 +++ b/htdocs/fichinter/index.php3 @@ -56,7 +56,7 @@ if ( $db->query($sql) ) { $var=!$var; print ""; print "\n"; - print "\n"; + print "\n"; print "\n"; print "\n"; diff --git a/htdocs/info.php3 b/htdocs/info.php3 index 9db355fc070..0f7751e3bfc 100644 --- a/htdocs/info.php3 +++ b/htdocs/info.php3 @@ -25,6 +25,7 @@ llxHeader(); print '
ActionFaxEmail
ActionFaxEmail
". strftime("%d %b %Y %H:%M", $obj->da) ."propalrowid\">$obj->libelle
fichid\">$objp->refidp\">$objp->nomidp\">$objp->nom".strftime("%d %B %Y",$objp->dp)."$objp->fk_statut
'; print ''; +print ''; print ''; print ''; @@ -46,7 +47,6 @@ if ($conf->fichinter->enabled) { print ''; } - print ''; print ''; print ''; @@ -54,11 +54,8 @@ print ''; print ''; print ''; - print '
css' . $conf->css . '
theme' . $conf->theme . '
Database
type' . $conf->db->type . '
output url' . $conf->fichinter->outputurl . '
Webcal
type' . $conf->webcal->db->type . '
host' . $conf->webcal->db->host . '
user' . $conf->webcal->db->user . ' 
pass' . $conf->webcal->db->pass . ' 
Database name' . $conf->webcal->db->name . '
'; - - $db = new Db(); llxFooter(); diff --git a/mysql/data/data.sql b/mysql/data/data.sql index 384fc7712c9..550a65886f2 100644 --- a/mysql/data/data.sql +++ b/mysql/data/data.sql @@ -23,6 +23,7 @@ -- delete from c_actioncomm; +insert into c_actioncomm (id,libelle) values ( 0, '-'); insert into c_actioncomm (id,libelle) values ( 1, 'Appel Téléphonique'); insert into c_actioncomm (id,libelle) values ( 2, 'Envoi Fax'); insert into c_actioncomm (id,libelle) values ( 3, 'Envoi propal par mail');