[ 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/includes/modules/propale/ -> mod_propale_jade.php (source)

   1  <?php
   2  /* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
   3   * Copyright (C) 2004 Laurent Destailleur  <eldy@users.sourceforge.net>
   4   * Copyright (C) 2005 Regis Houssin        <regis.houssin@cap-networks.com>
   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   * or see http://www.gnu.org/
  20   *
  21   * $Id: mod_propale_jade.php,v 1.13 2005/11/14 17:46:58 hregis Exp $
  22   * $Source: /cvsroot/dolibarr/dolibarr/htdocs/includes/modules/propale/mod_propale_jade.php,v $
  23   *
  24   */
  25  
  26  /**
  27          \file       htdocs/includes/modules/propale/mod_propale_jade.php
  28          \ingroup    propale
  29          \brief      Fichier contenant la classe du modèle de numérotation de référence de propale Jade
  30          \version    $Revision: 1.13 $
  31  */
  32  
  33  require_once(DOL_DOCUMENT_ROOT ."/includes/modules/propale/modules_propale.php");
  34  
  35  /**
  36           \class      mod_propale_jade
  37          \brief      Classe du modèle de numérotation de référence de propale Jade
  38  */
  39  
  40  class mod_propale_jade extends ModeleNumRefPropales
  41  {
  42  
  43      /**     \brief      Renvoi la description du modele de numérotation
  44       *      \return     string      Texte descripif
  45       */
  46      function info()
  47      {
  48        return "Renvoie le numéro sous la forme PROPn ou n est un compteur continue sans remise à 0";
  49      }
  50  
  51  
  52      /**     \brief      Renvoi un exemple de numérotation
  53       *      \return     string      Example
  54       */
  55      function getExample()
  56      {
  57          return "PROP1";
  58      }
  59  
  60  
  61      /**     \brief      Renvoi prochaine valeur attribuée
  62       *      \return     string      Valeur
  63       */
  64      function getNextValue()
  65      {
  66          global $db;
  67      
  68          $sql = "SELECT count(*) FROM ".MAIN_DB_PREFIX."propal";
  69      
  70          if ( $db->query($sql) )
  71          {
  72              $row = $db->fetch_row(0);
  73      
  74              $num = $row[0];
  75          }
  76      
  77          $y = strftime("%y",time());
  78      
  79          return  "PROP" . ($num+1);
  80      }
  81      
  82      
  83      /**     \brief      Renvoie la référence de propale suivante non utilisée
  84       *      \param      objsoc      Objet société
  85       *      \return     string      Texte descripif
  86       */
  87      function propale_get_num($objsoc=0)
  88      {
  89          return $this->getNextValue();
  90      }
  91  }
  92  
  93  ?>


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