[ Index ]
 

Code source de Dolibarr 2.0.1

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/htdocs/telephonie/client/ -> permissions.php (source)

   1  <?PHP
   2  /* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
   3   *
   4   * This program is free software; you can redistribute it and/or modify
   5   * it under the terms of the GNU General Public License as published by
   6   * the Free Software Foundation; either version 2 of the License, or
   7   * (at your option) any later version.
   8   *
   9   * This program is distributed in the hope that it will be useful,
  10   * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12   * GNU General Public License for more details.
  13   *
  14   * You should have received a copy of the GNU General Public License
  15   * along with this program; if not, write to the Free Software
  16   * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  17   *
  18   * $Id: permissions.php,v 1.1 2005/08/30 14:56:46 rodolphe Exp $
  19   * $Source: /cvsroot/dolibarr/dolibarr/htdocs/telephonie/client/permissions.php,v $
  20   *
  21   */
  22  
  23  require ("./pre.inc.php");
  24  
  25  $mesg = '';
  26  
  27  $soc = new Societe($db);
  28  
  29  if ($_GET["id"])
  30  {
  31    $result = $soc->fetch($_GET["id"], $user);
  32  }
  33  
  34  if (!$soc->perm_read)
  35    accessforbidden();
  36  
  37  if (!$soc->perm_perms)
  38    accessforbidden();
  39  
  40  llxHeader("","","Fiche client");
  41  
  42  /*
  43   * Affichage
  44   *
  45   */
  46  
  47  if ($soc->id)
  48  {
  49    $h=0;
  50  
  51    $head[$h][0] = DOL_URL_ROOT."/telephonie/client/fiche.php?id=".$soc->id;
  52    $head[$h][1] = $langs->trans("Contrats");
  53    $hselected = $h;
  54    $h++;
  55  
  56    $head[$h][0] = DOL_URL_ROOT."/telephonie/client/lignes.php?id=".$soc->id;
  57    $head[$h][1] = $langs->trans("Lignes");
  58    $h++;
  59    
  60    $head[$h][0] = DOL_URL_ROOT."/telephonie/client/factures.php?id=".$soc->id;
  61    $head[$h][1] = $langs->trans("Factures");
  62    $h++;
  63    
  64    $head[$h][0] = DOL_URL_ROOT."/telephonie/client/ca.php?id=".$soc->id;
  65    $head[$h][1] = $langs->trans("CA");
  66    $h++;
  67    
  68    $head[$h][0] = DOL_URL_ROOT."/telephonie/client/tarifs.php?id=".$soc->id;
  69    $head[$h][1] = $langs->trans("Tarifs");
  70    $h++;
  71    
  72    $head[$h][0] = DOL_URL_ROOT."/telephonie/client/permissions.php?id=".$soc->id;
  73    $head[$h][1] = $langs->trans("Permissions");
  74    $hselected = $h;
  75    $h++;
  76    
  77    dolibarr_fiche_head($head, $hselected, 'Client : '.$soc->nom);
  78    
  79    print '<table class="border" cellpadding="3" cellspacing="0" width="100%">';
  80    print '<tr><td width="20%">'.$langs->trans('Name').'</td><td>'.$soc->nom.'</td><td>'.$langs->trans('Code client').'</td><td>'.$soc->code_client.'</td></tr>';
  81    
  82    
  83    print "<tr><td valign=\"top\">".$langs->trans('Address')."</td><td colspan=\"3\">".nl2br($soc->adresse)."<br>".$soc->cp." ".$soc->ville." ".$soc->pays."</td></tr>";
  84    
  85    print '<tr><td>'.$langs->trans('Phone').'</td><td>'.dolibarr_print_phone($soc->tel).'</td>';
  86    print '<td>'.$langs->trans('Fax').'</td><td>'.dolibarr_print_phone($soc->fax).'</td></tr>';
  87     
  88    print '</table><br />';
  89    
  90    print '<table class="border" width="100%" cellspacing="0" cellpadding="4">';
  91    
  92    /* Permissions */
  93    
  94    $sql = "SELECT u.firstname, u.name, p.pread, p.pwrite, p.pperms";
  95    $sql .= " FROM ".MAIN_DB_PREFIX."societe_perms as p";
  96    $sql .= " , ".MAIN_DB_PREFIX."user as u";
  97    
  98    $sql .= " WHERE p.fk_user = u.rowid";
  99    $sql .= " AND p.fk_soc = ".$soc->id;
 100    $sql .= " ORDER BY u.name ASC";
 101    
 102    $resql =  $db->query($sql);
 103    
 104    if ($resql)
 105      {
 106        $num = $db->num_rows($resql);
 107        if ( $num > 0 )
 108      {
 109        $i = 0;
 110        
 111        $ligne = new LigneTel($db);
 112        
 113        print '<tr class="liste_titre">';
 114        print '<td>Utilisateur</td>';
 115        print '<td align="center">Lecture</td>';
 116        print '<td align="center">Ecriture</td>';
 117        print '<td align="center">Permissions</td>';
 118        
 119        print "</tr>\n";
 120        
 121        while ($i < $num)
 122          {
 123            $obj = $db->fetch_object($resql);
 124            $var=!$var;
 125            
 126            print "<tr $bc[$var]>";
 127            print '<td>'.$obj->firstname." ".$obj->name."</td>\n";
 128            
 129            print '<td align="center">'.img_allow($obj->pread)."</td>\n";
 130            print '<td align="center">'.img_allow($obj->pwrite)."</td>\n";
 131            print '<td align="center">'.img_allow($obj->pperms)."</td>\n";
 132            
 133            print "</tr>\n";
 134            $i++;
 135          }
 136      }
 137        $db->free($resql);
 138        
 139      }
 140    else
 141      {
 142        print $sql;
 143      }
 144    
 145    print "</table>";   
 146  }
 147  else
 148  {
 149    print "Error";
 150  }
 151  
 152  
 153  print '</div>';
 154  
 155  /* ************************************************************************** */
 156  /*                                                                            */ 
 157  /* Barre d'action                                                             */ 
 158  /*                                                                            */ 
 159  /* ************************************************************************** */
 160  
 161  $db->close();
 162  
 163  llxFooter("<em>Derni&egrave;re modification $Date: 2005/08/30 14:56:46 $ r&eacute;vision $Revision: 1.1 $</em>");
 164  ?>


Généré le : Mon Nov 26 12:29:37 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics