[ 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/admin/ -> societe.php (source)

   1  <?php
   2  /* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
   3   * Copyright (C) 2004 Éric Seigne          <eric.seigne@ryxeo.com>
   4   * Copyright (C) 2005 Laurent Destailleur  <eldy@users.sourceforge.net>
   5   *
   6   * This program is free software; you can redistribute it and/or modify
   7   * it under the terms of the GNU General Public License as published by
   8   * the Free Software Foundation; either version 2 of the License, or
   9   * (at your option) any later version.
  10   *
  11   * This program is distributed in the hope that it will be useful,
  12   * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14   * GNU General Public License for more details.
  15   *
  16   * You should have received a copy of the GNU General Public License
  17   * along with this program; if not, write to the Free Software
  18   * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  19   *
  20   * $Id: societe.php,v 1.7 2005/03/06 15:40:24 eldy Exp $
  21   * $Source: /cvsroot/dolibarr/dolibarr/htdocs/admin/societe.php,v $
  22   */
  23  
  24  /**
  25          \file       htdocs/admin/societe.php
  26          \ingroup    propale
  27          \brief      Page d'administration/configuration du module Societe
  28          \version    $Revision: 1.7 $
  29  */
  30  
  31  require ("./pre.inc.php");
  32  
  33  $langs->load("admin");
  34  
  35  if (!$user->admin)
  36    accessforbidden();
  37  
  38  $codeclient_addon_var = CODECLIENT_ADDON;
  39  
  40  if ($_GET["action"] == 'setcodeclient')
  41  {
  42    if (dolibarr_set_const($db, "CODECLIENT_ADDON",$_GET["value"]))
  43      {
  44        // la constante qui a été lue en avant du nouveau set
  45        // on passe donc par une variable pour avoir un affichage cohérent
  46        $codeclient_addon_var = $_GET["value"];
  47        Header("Location: societe.php");
  48      }
  49  }
  50  
  51  
  52  $codecompta_addon_var = CODECOMPTA_ADDON;
  53  
  54  if ($_GET["action"] == 'setcodecompta')
  55  {
  56    if (dolibarr_set_const($db, "CODECOMPTA_ADDON",$_GET["value"]))
  57      {
  58        // la constante qui a été lue en avant du nouveau set
  59        // on passe donc par une variable pour avoir un affichage cohérent
  60        $codecompta_addon_var = $_GET["value"];
  61        Header("Location: societe.php");
  62      }
  63  }
  64  
  65  
  66  
  67  llxHeader();
  68  
  69  /*
  70   *
  71   *
  72   *
  73   */
  74  
  75  print_titre($langs->trans("CompanySetup"));
  76  
  77  print "<br>";
  78  
  79  print_titre($langs->trans("CustomerCodeChecker"));
  80  
  81  print "<table class=\"noborder\" width=\"100%\">\n";
  82  print "<tr class=\"liste_titre\">\n";
  83  print '  <td>'.$langs->trans("Name").'</td>';
  84  print '  <td>'.$langs->trans("Description").'</td>';
  85  print '  <td align="center">'.$langs->trans("Activated").'</td>';
  86  print '  <td>&nbsp;</td>';
  87  print "</tr>\n";
  88  
  89  clearstatcache();
  90  
  91  $dir = "../includes/modules/societe/";
  92  $handle = opendir($dir);
  93  if ($handle)
  94  {
  95    $var = true;
  96    while (($file = readdir($handle))!==false)
  97      {
  98        if (substr($file, 0, 15) == 'mod_codeclient_' && substr($file, -3) == 'php')
  99      {
 100        $file = substr($file, 0, strlen($file)-4);
 101  
 102        require_once(DOL_DOCUMENT_ROOT ."/includes/modules/societe/".$file.".php");
 103  
 104        $modCodeClient = new $file;
 105        $var = !$var;
 106        print "<tr ".$bc[$var].">\n  <td width=\"140\">".$modCodeClient->nom."</td>\n  <td>";
 107        print $modCodeClient->info();
 108        print "</td>\n";
 109        
 110        if ($codeclient_addon_var == "$file")
 111          {
 112            print "  <td align=\"center\">\n";
 113            print img_tick();
 114            print "</td>\n  <td>&nbsp;</td>\n";
 115          }
 116        else
 117          {
 118  
 119            print '<td>&nbsp;</td>';
 120            print '<td align="center"><a href="societe.php?action=setcodeclient&amp;value='.$file.'">'.$langs->trans("Activate").'</a></td>';
 121          }
 122        
 123        print '</tr>';
 124      }
 125      }
 126    closedir($handle);
 127  }
 128  print '</table>';
 129  
 130  print "<br>";
 131  
 132  print_titre($langs->trans("AccountCodeManager"));
 133  
 134  print '<table class="noborder" width="100%">';
 135  print '<tr class="liste_titre">';
 136  print '<td>'.$langs->trans("Name").'</td>';
 137  print '<td>'.$langs->trans("Description").'</td>';
 138  print '<td align="center">'.$langs->trans("Activated").'</td>';
 139  print '<td>&nbsp;</td>';
 140  print "</tr>\n";
 141  
 142  clearstatcache();
 143  
 144  $dir = "../includes/modules/societe/";
 145  $handle = opendir($dir);
 146  if ($handle)
 147  {
 148    $var = true;
 149    while (($file = readdir($handle))!==false)
 150      {
 151        if (substr($file, 0, 15) == 'mod_codecompta_' && substr($file, -3) == 'php')
 152      {
 153        $file = substr($file, 0, strlen($file)-4);
 154  
 155        require_once(DOL_DOCUMENT_ROOT ."/includes/modules/societe/".$file.".php");
 156  
 157        $modCodeCompta = new $file;
 158        $var = !$var;
 159  
 160        print '<tr '.$bc[$var].'><td width="140">'.$modCodeCompta->nom."</td><td>\n";
 161        print $modCodeCompta->info();
 162        print '</td>';
 163        
 164        if ($codecompta_addon_var == "$file")
 165          {
 166            print '<td align="center">';
 167            print img_tick();
 168            print '</td><td>&nbsp;</td>';
 169          }
 170        else
 171          {
 172            print '<td>&nbsp;</td>';
 173            print '<td align="center"><a href="societe.php?action=setcodecompta&amp;value='.$file.'">'.$langs->trans("Activate").'</a></td>';
 174  
 175          }
 176        
 177        print "</tr>\n";
 178      }
 179      }
 180    closedir($handle);
 181  }
 182  print "</table>\n";
 183  
 184  
 185  
 186  $db->close();
 187  
 188  llxFooter();
 189  ?>


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