*** empty log message ***
This commit is contained in:
parent
d9da53861e
commit
5b6a693c5b
@ -1,8 +1,5 @@
|
|||||||
<?PHP
|
<?PHP
|
||||||
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
*
|
|
||||||
* $Id$
|
|
||||||
* $Source$
|
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -18,10 +15,12 @@
|
|||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*
|
*
|
||||||
|
* $Id$
|
||||||
|
* $Source$
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require("./pre.inc.php3");
|
require("./pre.inc.php3");
|
||||||
|
|
||||||
require("./propal.class.php3");
|
require("./propal.class.php3");
|
||||||
|
|
||||||
$db = new Db();
|
$db = new Db();
|
||||||
@ -29,10 +28,12 @@ $db = new Db();
|
|||||||
$sql = "SELECT s.nom, s.idp, s.prefix_comm FROM societe as s WHERE s.idp = $socidp;";
|
$sql = "SELECT s.nom, s.idp, s.prefix_comm FROM societe as s WHERE s.idp = $socidp;";
|
||||||
|
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
if ($result) {
|
if ($result)
|
||||||
if ( $db->num_rows() ) {
|
{
|
||||||
$objsoc = $db->fetch_object(0);
|
if ( $db->num_rows() )
|
||||||
}
|
{
|
||||||
|
$objsoc = $db->fetch_object(0);
|
||||||
|
}
|
||||||
$db->free();
|
$db->free();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -63,27 +64,28 @@ if ($action == 'add') {
|
|||||||
* Generation
|
* Generation
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
if ($id) {
|
if ($id)
|
||||||
// print "<hr><b>Génération du PDF</b><p>";
|
{
|
||||||
|
|
||||||
//$DBI = "dbi:mysql:dbname=lolixdev:host=espy:user=rodo";
|
//$gljroot = "/home/www/dolibarr/dolibarr/htdocs";
|
||||||
|
|
||||||
$gljroot = "/home/www/dolibarr/dolibarr/htdocs";
|
$command = "export DBI_DSN=\"dbi:mysql:dbname=".$conf->db->name.":host=localhost\" ";
|
||||||
|
$command .= " ; ./propal-tex.pl --propal=".$id ." --pdf --ps --output=".$conf->propal->outputdir;
|
||||||
|
$command .= " --templates=".$conf->propal->templatesdir;
|
||||||
|
|
||||||
|
$output = system($command);
|
||||||
|
//print "<p>command : $command<br>";
|
||||||
|
//print $output;
|
||||||
|
|
||||||
$command = "export DBI_DSN=\"dbi:mysql:dbname=".$conf->db->name.":host=localhost\" ";
|
/*
|
||||||
$command .= " ; ./propal-tex.pl --propal=".$id ." --pdf --ps --output=".$conf->propal->outputdir;
|
* Renvoie directement sur la fiche
|
||||||
$command .= " --templates=".$conf->propal->templatesdir;
|
*/
|
||||||
|
//Header("Location: propal.php3?propalid=$id");
|
||||||
$output = system($command);
|
}
|
||||||
//print "<p>command : $command<br>";
|
else
|
||||||
//print $output;
|
{
|
||||||
|
print $db->error();
|
||||||
|
}
|
||||||
// Header("Location: propal.php3?propalid=$id");
|
|
||||||
|
|
||||||
} else {
|
|
||||||
print $db->error();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
llxHeader();
|
llxHeader();
|
||||||
@ -111,7 +113,7 @@ if ($action == 'create') {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
print "<form action=\"$PHP_SELF?socidp=$socidp\" method=\"post\">";
|
print "<form action=\"propal.php3?socidp=$socidp\" method=\"post\">";
|
||||||
print "<input type=\"hidden\" name=\"action\" value=\"add\">";
|
print "<input type=\"hidden\" name=\"action\" value=\"add\">";
|
||||||
|
|
||||||
print '<table border="1" cellspacing="0" cellpadding="3" width="100%"><tr><td width="50%" valign="top">';
|
print '<table border="1" cellspacing="0" cellpadding="3" width="100%"><tr><td width="50%" valign="top">';
|
||||||
@ -307,7 +309,7 @@ if ( $db->query($sql) ) {
|
|||||||
$objp = $db->fetch_object( $i);
|
$objp = $db->fetch_object( $i);
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print "<TR $bc[$var]>";
|
print "<TR $bc[$var]>";
|
||||||
print "<TD><a href=\"index.php3?socid=$objp->idp\">$objp->nom</a></TD>\n";
|
print "<TD><a href=\"fiche.php3?socid=$objp->idp\">$objp->nom</a></TD>\n";
|
||||||
print "<TD><a href=\"propal.php3?propalid=$objp->propalid\">$objp->ref</a></TD>\n";
|
print "<TD><a href=\"propal.php3?propalid=$objp->propalid\">$objp->ref</a></TD>\n";
|
||||||
print "<TD>$objp->lst</TD>\n";
|
print "<TD>$objp->lst</TD>\n";
|
||||||
|
|
||||||
|
|||||||
@ -36,8 +36,65 @@ llxHeader();
|
|||||||
|
|
||||||
$db = new Db();
|
$db = new Db();
|
||||||
|
|
||||||
|
/******************************************************************************/
|
||||||
|
/* Actions */
|
||||||
|
/******************************************************************************/
|
||||||
|
|
||||||
if ($action == 'setstatut') {
|
if ($action == 'add')
|
||||||
|
{
|
||||||
|
$propal = new Propal($db, $socidp);
|
||||||
|
|
||||||
|
$propal->remise = $remise;
|
||||||
|
$propal->datep = $db->idate(mktime(12, 1 , 1, $pmonth, $pday, $pyear));
|
||||||
|
|
||||||
|
$propal->contactid = $contactidp;
|
||||||
|
$propal->projetidp = $projetidp;
|
||||||
|
|
||||||
|
$propal->author = $user->id;
|
||||||
|
$propal->note = $note;
|
||||||
|
|
||||||
|
$propal->ref = $ref;
|
||||||
|
|
||||||
|
$propal->add_product($idprod1,$qty1);
|
||||||
|
$propal->add_product($idprod2,$qty2);
|
||||||
|
$propal->add_product($idprod3,$qty3);
|
||||||
|
$propal->add_product($idprod4,$qty4);
|
||||||
|
|
||||||
|
$id = $propal->create();
|
||||||
|
|
||||||
|
/*
|
||||||
|
*
|
||||||
|
* Generation
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
if ($id)
|
||||||
|
{
|
||||||
|
|
||||||
|
//$gljroot = "/home/www/dolibarr/dolibarr/htdocs";
|
||||||
|
|
||||||
|
$command = "export DBI_DSN=\"dbi:mysql:dbname=".$conf->db->name.":host=localhost\" ";
|
||||||
|
$command .= " ; ./propal-tex.pl --propal=".$id ." --pdf --ps --output=".$conf->propal->outputdir;
|
||||||
|
$command .= " --templates=".$conf->propal->templatesdir;
|
||||||
|
|
||||||
|
$output = system($command);
|
||||||
|
//print "<p>command : $command<br>";
|
||||||
|
//print $output;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Renvoie directement sur la fiche
|
||||||
|
*/
|
||||||
|
//Header("Location: propal.php3?propalid=$id");
|
||||||
|
$propalid = $id;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print $db->error();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if ($action == 'setstatut')
|
||||||
|
{
|
||||||
/*
|
/*
|
||||||
* Cloture de la propale
|
* Cloture de la propale
|
||||||
*/
|
*/
|
||||||
@ -45,24 +102,37 @@ if ($action == 'setstatut') {
|
|||||||
$propal->id = $propalid;
|
$propal->id = $propalid;
|
||||||
$propal->cloture($user->id, $statut, $note);
|
$propal->cloture($user->id, $statut, $note);
|
||||||
|
|
||||||
} elseif ( $action == 'delete' ) {
|
}
|
||||||
|
elseif ( $action == 'delete' )
|
||||||
|
{
|
||||||
$sql = "DELETE FROM llx_propal WHERE rowid = $propalid;";
|
$sql = "DELETE FROM llx_propal WHERE rowid = $propalid;";
|
||||||
if ( $db->query($sql) ) {
|
if ( $db->query($sql) )
|
||||||
|
{
|
||||||
|
|
||||||
$sql = "DELETE FROM llx_propaldet WHERE fk_propal = $propalid ;";
|
$sql = "DELETE FROM llx_propaldet WHERE fk_propal = $propalid ;";
|
||||||
if ( $db->query($sql) ) {
|
if ( $db->query($sql) )
|
||||||
print "<b><font color=\"red\">Propal supprimée</font></b>";
|
{
|
||||||
} else {
|
print "<b><font color=\"red\">Propal supprimée</font></b>";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print $db->error();
|
||||||
|
print "<p>$sql";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
print $db->error();
|
print $db->error();
|
||||||
print "<p>$sql";
|
print "<p>$sql";
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
print $db->error();
|
|
||||||
print "<p>$sql";
|
|
||||||
}
|
|
||||||
$propalid = 0;
|
$propalid = 0;
|
||||||
$brouillon = 1;
|
$brouillon = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/******************************************************************************/
|
||||||
|
/* Fin des Actions */
|
||||||
|
/******************************************************************************/
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* Mode fiche
|
* Mode fiche
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user