From 50f9813f7fdd5456a6aad167d6a9c1d07ab08977 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Sat, 28 Jun 2003 20:07:09 +0000 Subject: [PATCH] ajout function fetch_client --- htdocs/fichinter/fichinter.class.php3 | 68 +++++++++++++++------------ 1 file changed, 39 insertions(+), 29 deletions(-) diff --git a/htdocs/fichinter/fichinter.class.php3 b/htdocs/fichinter/fichinter.class.php3 index 92bc586ea33..7850215fc0a 100644 --- a/htdocs/fichinter/fichinter.class.php3 +++ b/htdocs/fichinter/fichinter.class.php3 @@ -175,44 +175,54 @@ class Fichinter { * * */ - Function valid($userid, $outputdir) { + Function valid($userid, $outputdir) + { - $this->fetch($this->id); + $this->fetch($this->id); - $sql = "UPDATE llx_fichinter SET fk_statut = 1, date_valid=now(), fk_user_valid=$userid"; - $sql .= " WHERE rowid = $this->id AND fk_statut = 0 ;"; + $sql = "UPDATE llx_fichinter SET fk_statut = 1, date_valid=now(), fk_user_valid=$userid"; + $sql .= " WHERE rowid = $this->id AND fk_statut = 0 ;"; - if ($this->db->query($sql) ) { - - /* - * Set generates files readonly - * - */ - $file = $outputdir . "/$this->ref/$this->ref.tex"; - print $file; - if (is_writeable($file)) { - chmod($file, 0444); - } - $file = $outputdir . "/$this->ref/$this->ref.ps"; - if (is_writeable($file)) { - chmod($file, 0444); - } - $file = $outputdir . "/$this->ref/$this->ref.pdf"; - if (is_writeable($file)) { - chmod($file, 0444); - } - return 1; - } else { - print $this->db->error() . ' in ' . $sql; + if ($this->db->query($sql) ) + { + /* + * Set generates files readonly + * + */ + $file = $outputdir . "/$this->ref/$this->ref.tex"; + print $file; + if (is_writeable($file)) + { + chmod($file, 0444); + } + $file = $outputdir . "/$this->ref/$this->ref.ps"; + if (is_writeable($file)) + { + chmod($file, 0444); + } + $file = $outputdir . "/$this->ref/$this->ref.pdf"; + if (is_writeable($file)) { + chmod($file, 0444); + } + return 1; + } + else + { + print $this->db->error() . ' in ' . $sql; + } + } - - } /* * * * */ - + Function fetch_client() + { + $client = new Societe($this->db); + $client->fetch($this->societe_id); + $this->client = $client; + } } ?>