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);
}
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
{
var $db;
//! Numero d'erreur Plage 1280-1535
var $errno = 0;
/**
* Constructor
*
@ -42,58 +37,6 @@ class DaoContactDefault extends Contact
$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
{
var $db;
var $targetmodule;
var $canvas;
var $card;
@ -38,6 +37,7 @@ class ActionsCardProduct extends Product
// List of fiels for action=list
var $field_list =array();
public $list_datas = array();
/**
@ -48,7 +48,7 @@ class ActionsCardProduct extends Product
* @param string $canvas Name of 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->targetmodule = $targetmodule;
@ -64,6 +64,8 @@ class ActionsCardProduct extends Product
/**
* Return the title of card
*
* @return string Label of card
*/
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)
*
* @param action Type of action
* @param string $action Type of action
* @return void
*/
function assign_values($action)
{
@ -141,7 +144,7 @@ class ActionsCardProduct extends Product
$this->tpl['accountancySellCodeKey'] = $html->editfieldkey("ProductAccountancySellCode",'productaccountancycodebuy',$this->accountancy_code_buy,'id',$this->id,$user->rights->produit->creer);
$this->tpl['accountancySellCodeVal'] = $html->editfieldval("ProductAccountancySellCode",'productaccountancycodebuy',$this->accountancy_code_buy,'id',$this->id,$user->rights->produit->creer);
}
$this->tpl['finished'] = $this->object->finished;
$this->tpl['ref'] = $this->object->ref;
$this->tpl['label'] = $this->object->label;
@ -249,6 +252,8 @@ class ActionsCardProduct extends Product
/**
* Fetch field list
*
* @return void
*/
private function getFieldList()
{
@ -299,6 +304,12 @@ class ActionsCardProduct extends Product
/**
* 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)
{
@ -372,7 +383,7 @@ class ActionsCardProduct extends Product
$sql.= " AND p.canvas = '".$this->db->escape($_GET["canvas"])."'";
}
$sql.= $this->db->order($sortfield,$sortorder);
$sql.= $this->db->plimit($limit + 1 ,$offset);
$sql.= $this->db->plimit($limit+1, $offset);
//print $sql;
$resql = $this->db->query($sql);

View File

@ -23,12 +23,11 @@
include_once(DOL_DOCUMENT_ROOT.'/product/class/product.class.php');
/**
* \class ProductService
* \class ActionsCardService
* \brief Class with controller methods for product canvas
*/
class ActionsCardService extends Product
{
var $db;
var $targetmodule;
var $canvas;
var $card;
@ -38,6 +37,7 @@ class ActionsCardService extends Product
// List of fiels for action=list
var $field_list =array();
public $list_datas = array();
/**
@ -48,7 +48,7 @@ class ActionsCardService extends Product
* @param string $canvas Name of 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->targetmodule = $targetmodule;
@ -64,6 +64,8 @@ class ActionsCardService extends Product
/**
* Return the title of card
*
* @return string Label of card
*/
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)
*
* @param action Type of action
* @param string $action Type of action
* @return void
*/
function assign_values($action)
{
@ -141,7 +144,7 @@ class ActionsCardService extends Product
$this->tpl['accountancySellCodeKey'] = $html->editfieldkey("ProductAccountancySellCode",'productaccountancycodebuy',$this->accountancy_code_buy,'id',$this->id,$user->rights->produit->creer);
$this->tpl['accountancySellCodeVal'] = $html->editfieldval("ProductAccountancySellCode",'productaccountancycodebuy',$this->accountancy_code_buy,'id',$this->id,$user->rights->produit->creer);
}
$this->tpl['finished'] = $this->object->finished;
$this->tpl['ref'] = $this->object->ref;
$this->tpl['label'] = $this->object->label;
@ -229,6 +232,8 @@ class ActionsCardService extends Product
/**
* Fetch field list
*
* @return void
*/
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)
{
@ -327,7 +338,7 @@ class ActionsCardService extends Product
$sql .= " AND cp.fk_categorie = ".$this->db->escape($search_categ);
}
$sql.= $this->db->order($sortfield,$sortorder);
$sql.= $this->db->plimit($limit + 1 ,$offset);
$sql.= $this->db->plimit($limit+1, $offset);
$this->list_datas = array();

View File

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

View File

@ -29,7 +29,6 @@ include_once(DOL_DOCUMENT_ROOT.'/societe/canvas/actions_card_common.class.php');
*/
class ActionsCardCompany extends ActionsCardCommon
{
var $db;
var $targetmodule;
var $canvas;
var $card;
@ -96,7 +95,7 @@ class ActionsCardCompany extends ActionsCardCommon
$this->tpl['profid3'] = $this->object->ape;
$this->tpl['profid4'] = $this->object->idprof4;
if ($conf->use_javascript_ajax && empty($conf->global->MAIN_DISABLEVATCHECK))
if ($conf->use_javascript_ajax && empty($conf->global->MAIN_DISABLEVATCHECK))
{
$js = "\n";
$js.= '<script language="JavaScript" type="text/javascript">';

View File

@ -27,14 +27,10 @@
*/
class DaoThirdPartyCompany extends Societe
{
var $db;
//! Numero d'erreur Plage 1280-1535
var $errno = 0;
/**
* Constructor
*
*
* @param DoliDB $DB Databae handler
*/
function DaoThirdPartyCompany($DB)
@ -42,66 +38,6 @@ class DaoThirdPartyCompany extends Societe
$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
{
var $db;
var $targetmodule;
var $canvas;
var $card;

View File

@ -27,78 +27,18 @@
*/
class DaoThirdPartyIndividual extends Societe
{
//! Numero d'erreur Plage 1280-1535
var $errno = 0;
public $list_datas = array();
/**
* Constructeur de la classe
* @param DB Handler acces base de donnees
* Constructor
*
* @param DoliDB $DB Databae handler
*/
function DaoThirdPartyIndividual($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();
}
}
?>