Qual: Uniformize code. Removed dead code.

This commit is contained in:
Laurent Destailleur 2011-09-20 22:12:59 +00:00
parent 5a2b222235
commit 3fca369e29
9 changed files with 64 additions and 203 deletions

View File

@ -93,8 +93,32 @@ class ActionsContactCardDefault extends ActionsContactCardCommon
$this->tpl['actionsdone']=show_actions_done($conf,$langs,$db,$objsoc,$this->object,1); $this->tpl['actionsdone']=show_actions_done($conf,$langs,$db,$objsoc,$this->object,1);
} }
if ($action == 'list')
{
$this->LoadListDatas($GLOBALS['limit'], $GLOBALS['offset'], $GLOBALS['sortfield'], $GLOBALS['sortorder']);
}
} }
/**
* Fetch datas list
*
* @param int $limit Limit number of responses
* @param int $offset Offset for first response
* @param string $sortfield Sort field
* @param string $sortorder Sort order ('ASC' or 'DESC')
* @return void
*/
function LoadListDatas($limit, $offset, $sortfield, $sortorder)
{
global $conf, $langs;
//$this->getFieldList();
$this->list_datas = array();
}
} }
?> ?>

View File

@ -27,11 +27,6 @@
*/ */
class DaoContactDefault extends Contact class DaoContactDefault extends Contact
{ {
var $db;
//! Numero d'erreur Plage 1280-1535
var $errno = 0;
/** /**
* Constructor * Constructor
* *
@ -42,58 +37,6 @@ class DaoContactDefault extends Contact
$this->db = $DB; $this->db = $DB;
} }
/**
* Create third party in database
*
* @param User $user Object of user that ask creation
* @return int >= 0 if OK, < 0 if KO
*/
function create($user='')
{
$result = parent::create($user);
return $result;
}
/**
* Update parameters of third party
*
* @param int $id Id societe
* @param User $user Utilisateur qui demande la mise a jour
* @param int $call_trigger 0=non, 1=oui
* @param int $allowmodcodeclient Inclut modif code client et code compta
* @param int $allowmodcodefournisseur Inclut modif code fournisseur et code compta fournisseur
* @return int <0 if KO, >=0 if OK
*/
function update($id, $user='', $call_trigger=1, $allowmodcodeclient=0, $allowmodcodefournisseur=0)
{
$result = parent::update($id, $user, $call_trigger, $allowmodcodeclient, $allowmodcodefournisseur);
return $result;
}
/**
* Delete third party in database
*
* @return int <0 if KO, >=0 if OK
*/
function delete()
{
$result = parent::delete();
return $result;
}
/**
* Fetch datas list
*/
function LoadListDatas($limit, $offset, $sortfield, $sortorder)
{
global $conf, $langs;
$this->list_datas = array();
}
} }
?> ?>

View File

@ -28,7 +28,6 @@ include_once(DOL_DOCUMENT_ROOT.'/product/class/product.class.php');
*/ */
class ActionsCardProduct extends Product class ActionsCardProduct extends Product
{ {
var $db;
var $targetmodule; var $targetmodule;
var $canvas; var $canvas;
var $card; var $card;
@ -38,6 +37,7 @@ class ActionsCardProduct extends Product
// List of fiels for action=list // List of fiels for action=list
var $field_list =array(); var $field_list =array();
public $list_datas = array();
/** /**
@ -48,7 +48,7 @@ class ActionsCardProduct extends Product
* @param string $canvas Name of canvas * @param string $canvas Name of canvas
* @param string $card Name of tab (sub-canvas) * @param string $card Name of tab (sub-canvas)
*/ */
function ActionsCardIndividual($DB,$targetmodule,$canvas,$card) function ActionsCardProduct($DB,$targetmodule,$canvas,$card)
{ {
$this->db = $DB; $this->db = $DB;
$this->targetmodule = $targetmodule; $this->targetmodule = $targetmodule;
@ -64,6 +64,8 @@ class ActionsCardProduct extends Product
/** /**
* Return the title of card * Return the title of card
*
* @return string Label of card
*/ */
private function getTitle() private function getTitle()
{ {
@ -75,7 +77,8 @@ class ActionsCardProduct extends Product
/** /**
* Assign custom values for canvas (for example into this->tpl to be used by templates) * Assign custom values for canvas (for example into this->tpl to be used by templates)
* *
* @param action Type of action * @param string $action Type of action
* @return void
*/ */
function assign_values($action) function assign_values($action)
{ {
@ -249,6 +252,8 @@ class ActionsCardProduct extends Product
/** /**
* Fetch field list * Fetch field list
*
* @return void
*/ */
private function getFieldList() private function getFieldList()
{ {
@ -299,6 +304,12 @@ class ActionsCardProduct extends Product
/** /**
* Fetch datas list * Fetch datas list
*
* @param int $limit Limit number of responses
* @param int $offset Offset for first response
* @param string $sortfield Sort field
* @param string $sortorder Sort order ('ASC' or 'DESC')
* @return void
*/ */
function LoadListDatas($limit, $offset, $sortfield, $sortorder) function LoadListDatas($limit, $offset, $sortfield, $sortorder)
{ {
@ -372,7 +383,7 @@ class ActionsCardProduct extends Product
$sql.= " AND p.canvas = '".$this->db->escape($_GET["canvas"])."'"; $sql.= " AND p.canvas = '".$this->db->escape($_GET["canvas"])."'";
} }
$sql.= $this->db->order($sortfield,$sortorder); $sql.= $this->db->order($sortfield,$sortorder);
$sql.= $this->db->plimit($limit + 1 ,$offset); $sql.= $this->db->plimit($limit+1, $offset);
//print $sql; //print $sql;
$resql = $this->db->query($sql); $resql = $this->db->query($sql);

View File

@ -23,12 +23,11 @@
include_once(DOL_DOCUMENT_ROOT.'/product/class/product.class.php'); include_once(DOL_DOCUMENT_ROOT.'/product/class/product.class.php');
/** /**
* \class ProductService * \class ActionsCardService
* \brief Class with controller methods for product canvas * \brief Class with controller methods for product canvas
*/ */
class ActionsCardService extends Product class ActionsCardService extends Product
{ {
var $db;
var $targetmodule; var $targetmodule;
var $canvas; var $canvas;
var $card; var $card;
@ -38,6 +37,7 @@ class ActionsCardService extends Product
// List of fiels for action=list // List of fiels for action=list
var $field_list =array(); var $field_list =array();
public $list_datas = array();
/** /**
@ -48,7 +48,7 @@ class ActionsCardService extends Product
* @param string $canvas Name of canvas * @param string $canvas Name of canvas
* @param string $card Name of tab (sub-canvas) * @param string $card Name of tab (sub-canvas)
*/ */
function ActionsCardIndividual($DB,$targetmodule,$canvas,$card) function ActionsCardService($DB,$targetmodule,$canvas,$card)
{ {
$this->db = $DB; $this->db = $DB;
$this->targetmodule = $targetmodule; $this->targetmodule = $targetmodule;
@ -64,6 +64,8 @@ class ActionsCardService extends Product
/** /**
* Return the title of card * Return the title of card
*
* @return string Label of card
*/ */
private function getTitle() private function getTitle()
{ {
@ -75,7 +77,8 @@ class ActionsCardService extends Product
/** /**
* Assign custom values for canvas (for example into this->tpl to be used by templates) * Assign custom values for canvas (for example into this->tpl to be used by templates)
* *
* @param action Type of action * @param string $action Type of action
* @return void
*/ */
function assign_values($action) function assign_values($action)
{ {
@ -229,6 +232,8 @@ class ActionsCardService extends Product
/** /**
* Fetch field list * Fetch field list
*
* @return void
*/ */
private function getFieldList() private function getFieldList()
{ {
@ -277,7 +282,13 @@ class ActionsCardService extends Product
} }
/** /**
* \brief Fetch datas list * Fetch datas list
*
* @param int $limit Limit number of responses
* @param int $offset Offset for first response
* @param string $sortfield Sort field
* @param string $sortorder Sort order ('ASC' or 'DESC')
* @return void
*/ */
function LoadListDatas($limit, $offset, $sortfield, $sortorder) function LoadListDatas($limit, $offset, $sortfield, $sortorder)
{ {
@ -327,7 +338,7 @@ class ActionsCardService extends Product
$sql .= " AND cp.fk_categorie = ".$this->db->escape($search_categ); $sql .= " AND cp.fk_categorie = ".$this->db->escape($search_categ);
} }
$sql.= $this->db->order($sortfield,$sortorder); $sql.= $this->db->order($sortfield,$sortorder);
$sql.= $this->db->plimit($limit + 1 ,$offset); $sql.= $this->db->plimit($limit+1, $offset);
$this->list_datas = array(); $this->list_datas = array();

View File

@ -33,8 +33,6 @@ abstract class ActionsCardCommon
var $canvas; var $canvas;
var $card; var $card;
//! Numero d'erreur Plage 1280-1535
var $errno = 0;
//! Template container //! Template container
var $tpl = array(); var $tpl = array();
//! Object container //! Object container

View File

@ -29,7 +29,6 @@ include_once(DOL_DOCUMENT_ROOT.'/societe/canvas/actions_card_common.class.php');
*/ */
class ActionsCardCompany extends ActionsCardCommon class ActionsCardCompany extends ActionsCardCommon
{ {
var $db;
var $targetmodule; var $targetmodule;
var $canvas; var $canvas;
var $card; var $card;

View File

@ -27,10 +27,6 @@
*/ */
class DaoThirdPartyCompany extends Societe class DaoThirdPartyCompany extends Societe
{ {
var $db;
//! Numero d'erreur Plage 1280-1535
var $errno = 0;
/** /**
* Constructor * Constructor
@ -42,66 +38,6 @@ class DaoThirdPartyCompany extends Societe
$this->db = $DB; $this->db = $DB;
} }
/**
* Lecture des donnees dans la base
* @param id Element id
*/
function fetch($id)
{
$result = parent::fetch($id);
return $result;
}
/**
* Create third party in database
* @param user Object of user that ask creation
* @return int >= 0 if OK, < 0 if KO
*/
function create($user='')
{
$result = parent::create($user);
return $result;
}
/**
* Update parameters of third party
* @param id id societe
* @param user Utilisateur qui demande la mise a jour
* @param call_trigger 0=non, 1=oui
* @param allowmodcodeclient Inclut modif code client et code compta
* @param allowmodcodefournisseur Inclut modif code fournisseur et code compta fournisseur
* @return int <0 si ko, >=0 si ok
*/
function update($id, $user='', $call_trigger=1, $allowmodcodeclient=0, $allowmodcodefournisseur=0)
{
$result = parent::update($id, $user, $call_trigger, $allowmodcodeclient, $allowmodcodefournisseur);
return $result;
}
/**
* Delete third party in database
* @param id id de la societe a supprimer
*/
function delete($id)
{
$result = parent::delete($id);
return $result;
}
/**
* Fetch datas list
*/
function LoadListDatas($limit, $offset, $sortfield, $sortorder)
{
global $conf, $langs;
$this->list_datas = array();
}
} }
?> ?>

View File

@ -28,7 +28,6 @@ include_once(DOL_DOCUMENT_ROOT.'/societe/canvas/actions_card_common.class.php');
*/ */
class ActionsCardIndividual extends ActionsCardCommon class ActionsCardIndividual extends ActionsCardCommon
{ {
var $db;
var $targetmodule; var $targetmodule;
var $canvas; var $canvas;
var $card; var $card;

View File

@ -27,78 +27,18 @@
*/ */
class DaoThirdPartyIndividual extends Societe class DaoThirdPartyIndividual extends Societe
{ {
//! Numero d'erreur Plage 1280-1535 public $list_datas = array();
var $errno = 0;
/** /**
* Constructeur de la classe * Constructor
* @param DB Handler acces base de donnees *
* @param DoliDB $DB Databae handler
*/ */
function DaoThirdPartyIndividual($DB) function DaoThirdPartyIndividual($DB)
{ {
$this->db = $DB; $this->db = $DB;
} }
/**
* Lecture des donnees dans la base
* @param id Element id
*/
function fetch($id)
{
$result = parent::fetch($id);
return $result;
}
/**
* Create third party in database
* @param user Object of user that ask creation
* @return int >= 0 if OK, < 0 if KO
*/
function create($user='')
{
$result = parent::create($user);
return $result;
}
/**
* Update parameters of third party
* @param id id societe
* @param user Utilisateur qui demande la mise a jour
* @param call_trigger 0=non, 1=oui
* @param allowmodcodeclient Inclut modif code client et code compta
* @param allowmodcodefournisseur Inclut modif code fournisseur et code compta fournisseur
* @return int <0 si ko, >=0 si ok
*/
function update($id, $user='', $call_trigger=1, $allowmodcodeclient=0, $allowmodcodefournisseur=0)
{
$result = parent::update($id, $user, $call_trigger, $allowmodcodeclient, $allowmodcodefournisseur);
return $result;
}
/**
* Delete third party in database
* @param id id de la societe a supprimer
*/
function delete($id)
{
$result = parent::delete($id);
return $result;
}
/**
* Fetch datas list
*/
function LoadListDatas($limit, $offset, $sortfield, $sortorder)
{
global $conf, $langs;
$this->list_datas = array();
}
} }
?> ?>