diff --git a/htdocs/comm/addpropal.php3 b/htdocs/comm/addpropal.php3 index 9b4f2f48bb0..db631e085f2 100644 --- a/htdocs/comm/addpropal.php3 +++ b/htdocs/comm/addpropal.php3 @@ -1,8 +1,5 @@ - * - * $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 @@ -18,10 +15,12 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + * $Id$ + * $Source$ + * */ require("./pre.inc.php3"); - require("./propal.class.php3"); $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;"; $result = $db->query($sql); -if ($result) { - if ( $db->num_rows() ) { - $objsoc = $db->fetch_object(0); - } +if ($result) +{ + if ( $db->num_rows() ) + { + $objsoc = $db->fetch_object(0); + } $db->free(); } @@ -63,27 +64,28 @@ if ($action == 'add') { * Generation * */ - if ($id) { - // print "
"; + if ($id) + { - //$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 "
command : $command
";
+ //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;
- $command .= " --templates=".$conf->propal->templatesdir;
-
- $output = system($command);
- //print "
command : $command
";
- //print $output;
-
-
- // Header("Location: propal.php3?propalid=$id");
-
- } else {
- print $db->error();
- }
+ /*
+ * Renvoie directement sur la fiche
+ */
+ //Header("Location: propal.php3?propalid=$id");
+ }
+ else
+ {
+ print $db->error();
+ }
}
llxHeader();
@@ -111,7 +113,7 @@ if ($action == 'create') {
}
}
- print "