/[dolibarr]/dolibarr/htdocs/societe.class.php
ViewVC logotype

Diff of /dolibarr/htdocs/societe.class.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.87 by eldy, Thu Aug 11 20:18:44 2005 UTC revision 1.88 by rodolphe, Tue Aug 30 15:39:57 2005 UTC
# Line 417  class Societe { Line 417  class Societe {
417     *    \return     int         >0 si ok, <0 si erreur     *    \return     int         >0 si ok, <0 si erreur
418     */     */
419                    
420    function fetch($socid)    function fetch($socid, $user=0)
421    {    {
422      global $langs;      global $langs;
423            
424        /* Lecture des permissions */
425        if ($user <> 0)
426          {
427            $sql = "SELECT p.pread, p.pwrite, p.pperms";
428            $sql .= " FROM ".MAIN_DB_PREFIX."societe_perms as p";
429            $sql .= " WHERE p.fk_user = '".$user->id."'";
430            $sql .= " AND p.fk_soc = '".$socid."';";
431            
432            $resql=$this->db->query($sql);
433            
434            if ($resql)
435              {
436                if ($row = $this->db->fetch_row($resql))
437                  {
438                    $this->perm_read  = $row[0];
439                    $this->perm_write = $row[1];
440                    $this->perm_perms = $row[2];
441                  }
442              }
443          }
444    
445      $this->id = $socid;      $this->id = $socid;
446    
447      $sql = "SELECT s.idp, s.nom, s.address,".$this->db->pdate("s.datec")." as dc, prefix_comm";      $sql = "SELECT s.idp, s.nom, s.address,".$this->db->pdate("s.datec")." as dc, prefix_comm";

Legend:
Removed from v.1.87  
changed lines
  Added in v.1.88

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26