Manage code rewriting
This commit is contained in:
parent
99067ed2e1
commit
aace9db326
17 changed files with 304 additions and 287 deletions
|
|
@ -33,12 +33,10 @@ require_once NOALYSS_INCLUDE.'/lib/user_common.php';
|
|||
class Bank extends Fiche
|
||||
{
|
||||
|
||||
var $name; /*!< $name name of the company */
|
||||
var $street; /*!< $street Street */
|
||||
var $country; /*!< $country Country */
|
||||
var $cp; /*!< $cp Zip code */
|
||||
var $vat_number; /*!< $vat_number vat number */
|
||||
|
||||
|
||||
use Trait_Card;
|
||||
|
||||
/*! \brief Constructor only a db connection is needed */
|
||||
function __construct($p_cn,$p_id=0)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ class Customer extends Fiche
|
|||
var $country; /*!< $country Country */
|
||||
var $cp; /*!< $cp Zip code */
|
||||
var $vat_number; /*!< $vat_number vat number */
|
||||
|
||||
use Trait_Card;
|
||||
/*! \brief Constructor
|
||||
* only a db connection is needed
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -39,10 +39,10 @@ class Fiche_Def
|
|||
var $attribut; //!< get from attr_xxx tables
|
||||
var $fd_description; //!< Description of the Card Category
|
||||
|
||||
function __construct($p_cn,$p_id = 0)
|
||||
function __construct($cn,$id = 0)
|
||||
{
|
||||
$this->cn=$p_cn;
|
||||
$this->id=$p_id;
|
||||
$this->cn=$cn;
|
||||
$this->id=$id;
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -61,7 +61,7 @@ class Fiche_Def
|
|||
}
|
||||
/**
|
||||
* @brief replace by load_attribute
|
||||
* @deprecated since version 9.3.0.12
|
||||
* @deprecated since version 9.3.12
|
||||
* @return type
|
||||
*/
|
||||
function getAttribut() {
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ class Manager extends Fiche
|
|||
var $country; /*!< $country Country */
|
||||
var $cp; /*!< $cp Zip code */
|
||||
var $vat_number; /*!< $vat_number vat number */
|
||||
|
||||
use Trait_Card;
|
||||
/*! \brief Constructor
|
||||
* only a db connection is needed */
|
||||
function __construct($p_cn,$p_id=0)
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ require_once NOALYSS_INCLUDE.'/lib/user_common.php';
|
|||
* \brief class Supplier are a specific kind of card
|
||||
*/
|
||||
|
||||
// Use the view vw_supplier
|
||||
///@brief Use the view vw_supplier and the trait Trait_Card
|
||||
//
|
||||
class Supplier extends Fiche
|
||||
{
|
||||
|
|
@ -38,6 +38,9 @@ class Supplier extends Fiche
|
|||
var $cp; /*!< $cp Zip code */
|
||||
var $vat_number; /*!< $vat_number vat number */
|
||||
|
||||
use Trait_Card;
|
||||
|
||||
|
||||
/*! \brief Constructor
|
||||
* only a db connection is needed */
|
||||
function __construct($p_cn,$p_id=0)
|
||||
|
|
|
|||
46
include/class/trait_card.php
Normal file
46
include/class/trait_card.php
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of NOALYSS.
|
||||
*
|
||||
* NOALYSS is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* NOALYSS is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with NOALYSS; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
// Copyright Author Dany De Bontridder danydb@aevalys.eu 22/10/23
|
||||
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @brief Contains function used by object Customer , Supplier, Bank, ... that
|
||||
* are derivated from Fiche
|
||||
*/
|
||||
|
||||
/**
|
||||
* @class
|
||||
* @brief Contains function used by object Customer , Supplier, Bank, ... that
|
||||
* are derivated from Fiche
|
||||
*/
|
||||
trait Trait_Card {
|
||||
/**
|
||||
* @brief For the follow-up module for customer, supplier, ... display a
|
||||
* filter
|
||||
* @param $url (string URL) url with folder id, access code ,...
|
||||
* @param $type_card (int) category of card see FICHE_TYPE_* in
|
||||
* include/constant.php
|
||||
*/
|
||||
public static function form_search($url,$type_card)
|
||||
{
|
||||
require_once NOALYSS_TEMPLATE."/trait_card-form_search.php";
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue