This commit is contained in:
Rodolphe Quiedeville 2002-05-16 15:38:04 +00:00
parent ae26238053
commit 8e8ed53776
12 changed files with 39 additions and 245 deletions

View File

@ -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() . "<br>" . $sql;
}

View File

@ -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 '<form action="fiche.php3?socid='.$socid.'" method="post">';
print '<form action="'.$PHP_SELF.'?socid='.$socid.'" method="post">';
print '<input type="hidden" name="action" value="add_action">';
print '<input type="hidden" name="date" value="'.$db->idate(time()).'">';

View File

@ -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();

View File

@ -1,105 +0,0 @@
<?PHP
/* Copyright (C) 2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
*
* $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() . "<br>" . $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) ) {
}
}
}
?>

View File

@ -1,53 +0,0 @@
<?PHP
/* Copyright (C) 2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
*
* $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();
}
}
}
?>

View File

@ -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();

View File

@ -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 "<table width=\"100%\" cellspacing=0 border=1 cellpadding=2>";
print '<table width="100%" cellspacing="0" border="0" cellpadding="0" bgcolor="#000000"><tr><td>';
print '<table width="100%" cellspacing="1" border="0" cellpadding="2">';
print "<tr><td><b>Pr&eacute;nom Nom</b></td>";
print '<td><b>Poste</b></td><td><b>T&eacute;l</b></td>';
print "<td><b>Fax</b></td><td><b>Email</b></td>";
print "<tr class=\"liste_titre\"><td>Pr&eacute;nom Nom</td>";
print '<td><b>Poste</b></td><td>T&eacute;l</td>';
print "<td><b>Fax</b></td><td>Email</td>";
print "<td><a href=\"people.php3?socid=$objsoc->idp&action=addcontact\">Ajouter</a></td></tr>";
$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 "<tr bgcolor=\"e0e0e0\">";
} else {
print "<tr>";
}
$var = !$var;
print "<tr $bc[$var]>";
print '<td>';
//print '<a href="action/fiche.php3?action=create&actionid=5&contactid='.$obj->idp.'&socid='.$objsoc->idp.'">';
//print '<img border="0" src="/theme/'.$conf->theme.'/img/filenew.png"></a>&nbsp;';
@ -343,7 +307,7 @@ if ($socid > 0) {
$tag = !$tag;
}
print "</table>";
print '</td></tr></table>';
print "\n<hr noshade size=1>\n";
/*

View File

@ -56,9 +56,6 @@ if ($action == 'del_bookmark') {
}
print_titre("Espace commercial");
print '<TABLE border="0" width="100%" cellspacing="0" cellpadding="4">';

View File

@ -82,8 +82,8 @@ if ($socid > 0) {
*
*
*/
print "<br><table width=\"100%\" border=\"0\" cellspacing=\"1\">\n";
print "<tr><td><big>N° $objsoc->idp - <a href=\"index.php3?socid=$objsoc->idp\">$objsoc->nom</a> - [$objsoc->stcomm] </td>";
print "<table width=\"100%\" border=\"0\" cellspacing=\"1\">\n";
print "<tr><td><a href=\"index.php3?socid=$objsoc->idp\">$objsoc->nom</a></td>";
print "<td align=\"center\"><a href=\"socnote.php3?socid=$socid\">Notes</a></big></td>";
print "<td bgcolor=\"#e0E0E0\" align=\"center\">[<a href=\"people.php3?socid=$socid&action=addcontact\">Ajouter un contact</a>]</td>";
@ -190,11 +190,10 @@ if ($socid > 0) {
*
*
*/
print "<P><table width=\"100%\" cellspacing=0 border=1 cellpadding=2>";
print '<P><table width="100%" cellspacing="0" border="0" cellpadding="2">';
print "<tr><td><b>Action</b></td>";
print "<td><b>Fax</b></td><td><b>Email</b></td>";
print "<tr class=\"liste_titre\"><td>Action</td>";
print "<td>Fax</td><td>Email</td>";
$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 "<tr bgcolor=\"e0e0e0\">";
} else {
print "<tr>";
}
$var=!$var;
print "<tr $bc[$var]>";
print "<td>". strftime("%d %b %Y %H:%M", $obj->da) ."</td>";
if ($obj->propalrowid) {
print "<td><a href=\"propal.php3?propalid=$obj->propalrowid\">$obj->libelle</a></td>";

View File

@ -56,7 +56,7 @@ if ( $db->query($sql) ) {
$var=!$var;
print "<TR $bc[$var]>";
print "<TD><a href=\"fiche.php3?id=$objp->fichid\">$objp->ref</a></TD>\n";
print "<TD><a href=\"../comm/index.php3?socid=$objp->idp\">$objp->nom</a></TD>\n";
print "<TD><a href=\"../comm/fiche.php3?socid=$objp->idp\">$objp->nom</a></TD>\n";
print "<TD>".strftime("%d %B %Y",$objp->dp)."</TD>\n";
print "<TD>$objp->fk_statut</TD>\n";

View File

@ -25,6 +25,7 @@ llxHeader();
print '<table border="1" cellpadding="3" cellspacing="0">';
print '<tr><td>css</td><td>' . $conf->css . '</td></tr>';
print '<tr><td>theme</td><td>' . $conf->theme . '</td></tr>';
print '<tr><td bgcolor="#e0e0e0" colspan="2">Database</td></tr>';
print '<tr><td>type</td><td>' . $conf->db->type . '</td></tr>';
@ -46,7 +47,6 @@ if ($conf->fichinter->enabled) {
print '<tr><td>output url</td><td>' . $conf->fichinter->outputurl . '</td></tr>';
}
print '<tr><td bgcolor="#e0e0e0" colspan="2">Webcal</td></tr>';
print '<tr><td>type</td><td>' . $conf->webcal->db->type . '</td></tr>';
print '<tr><td>host</td><td>' . $conf->webcal->db->host . '</td></tr>';
@ -54,11 +54,8 @@ print '<tr><td>user</td><td>' . $conf->webcal->db->user . '&nbsp;</td></tr>';
print '<tr><td>pass</td><td>' . $conf->webcal->db->pass . '&nbsp;</td></tr>';
print '<tr><td>Database name</td><td>' . $conf->webcal->db->name . '</td></tr>';
print '</table>';
$db = new Db();
llxFooter();

View File

@ -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');