diff --git a/htdocs/comm/action/rapport/index.php b/htdocs/comm/action/rapport/index.php index 4326149f3c5..3a3f434b699 100644 --- a/htdocs/comm/action/rapport/index.php +++ b/htdocs/comm/action/rapport/index.php @@ -139,8 +139,7 @@ $sql .= " FROM ".MAIN_DB_PREFIX."actioncomm as a"; $sql .= " GROUP BY date_format(a.datea, '%m/%Y') "; $sql .= " ORDER BY date_format(a.datea, '%Y %m') DESC"; - - + if ( $db->query($sql) ) { $num = $db->num_rows(); @@ -153,6 +152,9 @@ if ( $db->query($sql) ) print 'Date'; print 'Nombre'; print 'Action'; + print 'PDF'; + print 'Date'; + print 'Taille'; print "\n"; $var=True; while ($i < min($num,$limit)) diff --git a/htdocs/comm/action/rapport/rapport.pdf.php b/htdocs/comm/action/rapport/rapport.pdf.php index 2be2b260528..15eb07eb566 100644 --- a/htdocs/comm/action/rapport/rapport.pdf.php +++ b/htdocs/comm/action/rapport/rapport.pdf.php @@ -149,22 +149,34 @@ Class CommActionRapport { { $num = $this->db->num_rows(); $i = 0; + $y1 = 0; + $y2 = 0; while ($i < $num) { $obj = $this->db->fetch_object($i); - $y = $pdf->GetY(); - $pdf->SetFont('Arial','',11); - $pdf->SetXY(10, $y); - $pdf->MultiCell(40, 8, $obj->societe, 0, 'L', 0); - $pdf->SetXY(50,$y); - $pdf->MultiCell(40, 8, $obj->libelle, 0, 'L', 0); - $pdf->SetXY(90,$y); - $pdf->MultiCell(110, 8, $obj->note, 0, 'L', 0); + $y = max($pdf->GetY(), $y1, $y2) + 1; + $pdf->SetFont('Arial','',10); + + $pdf->SetXY(5, $y); + $pdf->MultiCell(15, 4, strftime('%d/%b',$obj->da), 0, 'L', 0); + + $pdf->SetXY(20, $y); + $pdf->MultiCell(40, 4, $obj->societe, 0, 'L', 0); + + $y1 = max($y, $pdf->GetY()); + + $pdf->SetXY(60,$y); + $pdf->MultiCell(40, 4, $obj->libelle, 0, 'L', 0); + + $pdf->SetXY(100,$y); + $pdf->MultiCell(110, 4, $obj->note, 0, 'L', 0); + $y2 = max($y, $pdf->GetY()); + $i++; } } - $pdf->Rect(10, 10, 190, 277); + $pdf->Rect(5, 5, 200, 287); return 1; } diff --git a/htdocs/contact/fiche.php b/htdocs/contact/fiche.php index 40a0850ebcd..64c2cc5b6ba 100644 --- a/htdocs/contact/fiche.php +++ b/htdocs/contact/fiche.php @@ -33,13 +33,10 @@ if ($HTTP_POST_VARS["action"] == 'add') $contact->name = $HTTP_POST_VARS["name"]; $contact->firstname = $HTTP_POST_VARS["firstname"]; - $contact->poste = $HTTP_POST_VARS["poste"]; - - $contact->address = $HTTP_POST_VARS["adresse"]; - $contact->cp = $HTTP_POST_VARS["cp"]; - $contact->ville = $HTTP_POST_VARS["ville"]; - + $contact->address = $HTTP_POST_VARS["adresse"]; + $contact->cp = $HTTP_POST_VARS["cp"]; + $contact->ville = $HTTP_POST_VARS["ville"]; $contact->fax = $HTTP_POST_VARS["fax"]; $contact->note = $HTTP_POST_VARS["note"]; $contact->email = $HTTP_POST_VARS["email"]; @@ -189,7 +186,7 @@ elseif ($_GET["action"] == 'edit') } print 'Nom'; - print 'Prenom'; + print 'Prénom'; print 'Tel Pro'; diff --git a/htdocs/contrat/index.php b/htdocs/contrat/index.php index 146619383ed..0fbc13e0757 100644 --- a/htdocs/contrat/index.php +++ b/htdocs/contrat/index.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2001-2004 Rodolphe Quiedeville * Copyright (C) 2004 Laurent Destailleur * * This program is free software; you can redistribute it and/or modify diff --git a/htdocs/includes/modules/facture/pdf_tourteau.modules.php b/htdocs/includes/modules/facture/pdf_tourteau.modules.php index 0054cc04a0d..0a2c561a55f 100644 --- a/htdocs/includes/modules/facture/pdf_tourteau.modules.php +++ b/htdocs/includes/modules/facture/pdf_tourteau.modules.php @@ -88,7 +88,18 @@ Class pdf_tourteau { $curY = $nexY; $pdf->SetXY (11, $curY ); - $pdf->MultiCell(118, 5, $fac->lignes[$i]->desc, 0, 'J'); + + // if ($fac->lignes[$i]->produit_id) + // { + // $prod = new Product($this->db, $fac->lignes[$i]->produit_id); + // $prod->fetch($fac->lignes[$i]->produit_id); + // $pdf->MultiCell(118, 5, $prod->description, 0, 'J'); + // } + //else + // { + $pdf->MultiCell(118, 5, $fac->lignes[$i]->desc, 0, 'J'); + // } + $nexY = $pdf->GetY(); diff --git a/htdocs/install/fileconf.php b/htdocs/install/fileconf.php index 5aeaf7501d7..b137fee176f 100644 --- a/htdocs/install/fileconf.php +++ b/htdocs/install/fileconf.php @@ -21,7 +21,6 @@ * $Source$ * */ - include("./inc.php"); pHeader("Fichier de configuration","etape1"); @@ -181,8 +180,6 @@ $dolibarr_main_db_host = "localhost"; - -

Base de données - Accés super utilisateur

diff --git a/htdocs/product.class.php b/htdocs/product.class.php index da4f9123557..a8e84a5570f 100644 --- a/htdocs/product.class.php +++ b/htdocs/product.class.php @@ -48,6 +48,9 @@ class Product */ Function check() { + $this->ref = ereg_replace("'","",stripslashes($this->ref)); + $this->ref = ereg_replace("\"","",stripslashes($this->ref)); + $err = 0; if (strlen(trim($this->ref)) == 0) $err++; @@ -70,6 +73,8 @@ class Product */ Function create($user) { + $this->ref = ereg_replace("'","",stripslashes($this->ref)); + $this->ref = ereg_replace("\"","",stripslashes($this->ref)); $sql = "SELECT count(*)"; $sql .= " FROM ".MAIN_DB_PREFIX."product WHERE ref = '" .trim($this->ref)."'"; @@ -123,34 +128,36 @@ class Product */ Function update($id, $user) { + $this->ref = ereg_replace("\"","",stripslashes($this->ref)); + $this->ref = ereg_replace("'","",stripslashes($this->ref)); - if (strlen(trim($this->libelle)) == 0) - { - $this->libelle = 'LIBELLE MANQUANT'; - } - - $sql = "UPDATE ".MAIN_DB_PREFIX."product "; - $sql .= " SET label = '" . trim($this->libelle) ."'"; - if (strlen(trim($this->ref))) - { - $sql .= ",ref = '" . trim($this->ref) ."'"; - } - $sql .= ",tva_tx = " . $this->tva_tx ; - $sql .= ",envente = " . $this->envente ; - $sql .= ",seuil_stock_alerte = " . $this->seuil_stock_alerte ; - $sql .= ",description = '" . trim($this->description) ."'"; - $sql .= ",duration = '" . $this->duration_value . $this->duration_unit ."'"; - - $sql .= " WHERE rowid = " . $id; - - if ( $this->db->query($sql) ) - { - return 1; - } - else - { - print $this->db->error() . ' in ' . $sql; - } + if (strlen(trim($this->libelle)) == 0) + { + $this->libelle = 'LIBELLE MANQUANT'; + } + + $sql = "UPDATE ".MAIN_DB_PREFIX."product "; + $sql .= " SET label = '" . trim($this->libelle) ."'"; + if (strlen(trim($this->ref))) + { + $sql .= ",ref = '" . trim($this->ref) ."'"; + } + $sql .= ",tva_tx = " . $this->tva_tx ; + $sql .= ",envente = " . $this->envente ; + $sql .= ",seuil_stock_alerte = " . $this->seuil_stock_alerte ; + $sql .= ",description = '" . trim($this->description) ."'"; + $sql .= ",duration = '" . $this->duration_value . $this->duration_unit ."'"; + + $sql .= " WHERE rowid = " . $id; + + if ( $this->db->query($sql) ) + { + return 1; + } + else + { + print $this->db->error() . ' in ' . $sql; + } } /** * diff --git a/htdocs/project.class.php b/htdocs/project.class.php index 2d660f2a799..d783dee84ab 100644 --- a/htdocs/project.class.php +++ b/htdocs/project.class.php @@ -148,6 +148,5 @@ class Project { } } - } ?> diff --git a/htdocs/projet/commandes.php b/htdocs/projet/commandes.php index 39143818853..3bcdbcbe2d4 100644 --- a/htdocs/projet/commandes.php +++ b/htdocs/projet/commandes.php @@ -20,12 +20,10 @@ * */ require("./pre.inc.php"); -require("./project.class.php"); require("../propal.class.php"); require("../facture.class.php"); require("../commande/commande.class.php"); - llxHeader("","../"); $projet = new Project($db); diff --git a/htdocs/projet/facture.php b/htdocs/projet/facture.php index c9b003d51b7..20b8a8ab42e 100644 --- a/htdocs/projet/facture.php +++ b/htdocs/projet/facture.php @@ -20,7 +20,6 @@ * */ require("./pre.inc.php"); -require("./project.class.php"); require("../propal.class.php"); require("../facture.class.php"); require("../commande/commande.class.php"); diff --git a/htdocs/projet/fiche.php b/htdocs/projet/fiche.php index a1a7408ec06..2f0c28972e4 100644 --- a/htdocs/projet/fiche.php +++ b/htdocs/projet/fiche.php @@ -20,7 +20,6 @@ * */ require("./pre.inc.php"); -require("./project.class.php"); require("../propal.class.php"); require("../facture.class.php"); require("../commande/commande.class.php"); @@ -101,8 +100,8 @@ if ($action == 'create') $projet = new Project($db); $projet->fetch($id); - - + $projet->societe->fetch($projet->societe->id); + $h=0; $head[$h][0] = DOL_URL_ROOT.'/projet/fiche.php?id='.$projet->id; $head[$h][1] = 'Fiche projet'; @@ -118,10 +117,6 @@ if ($action == 'create') dolibarr_fiche_head($head, 0); - - - $projet->societe->fetch($projet->societe->id); - if ($action == 'edit') { print '
'; @@ -129,16 +124,16 @@ if ($action == 'create') print ''; print ''; print ''; - print ''; + print '
Société'.$projet->societe->nom.'
Ref
Titre
'; } else { print ''; - print ''; - - print ''; - print ''; + +print ''; +print ''; +print ''; print '
Société'.$projet->societe->nom.'
Réf'.$projet->ref.'
Titre'.$projet->title.'
Titre'.$projet->title.'Réf'.$projet->ref.'
Société'.$projet->societe->nom.$projet->societe->id.'
'; } diff --git a/htdocs/projet/pre.inc.php b/htdocs/projet/pre.inc.php index f9dd4dc3042..a2be70959e5 100644 --- a/htdocs/projet/pre.inc.php +++ b/htdocs/projet/pre.inc.php @@ -21,6 +21,8 @@ */ require ("../main.inc.php"); +require("./project.class.php"); + function llxHeader($head = "", $urlp = "") { /* diff --git a/htdocs/projet/project.class.php b/htdocs/projet/project.class.php index a97d536370e..c7ee99cd467 100644 --- a/htdocs/projet/project.class.php +++ b/htdocs/projet/project.class.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2002-2004 Rodolphe Quiedeville * * 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 diff --git a/htdocs/projet/propal.php b/htdocs/projet/propal.php index 71546a3ed56..e1156899267 100644 --- a/htdocs/projet/propal.php +++ b/htdocs/projet/propal.php @@ -20,7 +20,6 @@ * */ require("./pre.inc.php"); -require("./project.class.php"); require("../propal.class.php"); require("../facture.class.php"); require("../commande/commande.class.php"); diff --git a/htdocs/propal.class.php b/htdocs/propal.class.php index 9909a8f9965..b9c2ff56908 100644 --- a/htdocs/propal.class.php +++ b/htdocs/propal.class.php @@ -307,8 +307,11 @@ class Propal Function fetch($rowid) { - $sql = "SELECT ref,total,price,remise,tva,fk_soc,fk_soc_contact,".$this->db->pdate("datep")."as dp,".$this->db->pdate("fin_validite")."as dfv, model_pdf, note, fk_projet, fk_statut, remise_percent"; - $sql .= " FROM ".MAIN_DB_PREFIX."propal WHERE rowid=$rowid;"; + $sql = "SELECT ref,total,price,remise,tva,fk_soc,fk_soc_contact,".$this->db->pdate("datep")."as dp,".$this->db->pdate("fin_validite")."as dfv, model_pdf, note, fk_projet, fk_statut, remise_percent, fk_user_author"; + $sql .= ", c.label as statut_label"; + $sql .= " FROM ".MAIN_DB_PREFIX."propal"; + $sql .= "," . MAIN_DB_PREFIX."c_propalst as c"; + $sql .= " WHERE rowid=$rowid AND fk_statut = c.id"; if ($this->db->query($sql) ) { @@ -335,6 +338,10 @@ class Propal $this->modelpdf = $obj->model_pdf; $this->note = $obj->note; $this->statut = $obj->fk_statut; + $this->statut_libelle = $obj->statut_label; + + $this->user_author_id = $obj->fk_user_author; + if ($obj->fk_statut == 0) { $this->brouillon = 1; @@ -506,7 +513,7 @@ class Propal } } /** - * Cloture de la propale + * Cloture de la proposition commerciale * */ Function cloture($user, $statut, $note) @@ -540,7 +547,7 @@ class Propal } } /** - * + * Créée une commande à partir de la proposition commerciale * */ Function create_commande($user)