reduce complexity of cchargesociales class
This commit is contained in:
parent
ab0f842db6
commit
367e202df0
@ -143,7 +143,7 @@ class Cchargesociales
|
|||||||
if (!$error) {
|
if (!$error) {
|
||||||
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . $this->table_element);
|
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . $this->table_element);
|
||||||
|
|
||||||
if (!$notrigger) {
|
//if (!$notrigger) {
|
||||||
// Uncomment this and change MYOBJECT to your own tag if you
|
// Uncomment this and change MYOBJECT to your own tag if you
|
||||||
// want this action to call a trigger.
|
// want this action to call a trigger.
|
||||||
|
|
||||||
@ -151,7 +151,7 @@ class Cchargesociales
|
|||||||
//$result=$this->call_trigger('MYOBJECT_CREATE',$user);
|
//$result=$this->call_trigger('MYOBJECT_CREATE',$user);
|
||||||
//if ($result < 0) $error++;
|
//if ($result < 0) $error++;
|
||||||
//// End call triggers
|
//// End call triggers
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Commit or rollback
|
// Commit or rollback
|
||||||
@ -290,7 +290,7 @@ class Cchargesociales
|
|||||||
dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR);
|
dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$error && !$notrigger) {
|
//if (!$error && !$notrigger) {
|
||||||
// Uncomment this and change MYOBJECT to your own tag if you
|
// Uncomment this and change MYOBJECT to your own tag if you
|
||||||
// want this action calls a trigger.
|
// want this action calls a trigger.
|
||||||
|
|
||||||
@ -298,7 +298,7 @@ class Cchargesociales
|
|||||||
//$result=$this->call_trigger('MYOBJECT_MODIFY',$user);
|
//$result=$this->call_trigger('MYOBJECT_MODIFY',$user);
|
||||||
//if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail}
|
//if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail}
|
||||||
//// End call triggers
|
//// End call triggers
|
||||||
}
|
//}
|
||||||
|
|
||||||
// Commit or rollback
|
// Commit or rollback
|
||||||
if ($error) {
|
if ($error) {
|
||||||
@ -328,8 +328,8 @@ class Cchargesociales
|
|||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
if (!$error) {
|
//if (!$error) {
|
||||||
if (!$notrigger) {
|
//if (!$notrigger) {
|
||||||
// Uncomment this and change MYOBJECT to your own tag if you
|
// Uncomment this and change MYOBJECT to your own tag if you
|
||||||
// want this action calls a trigger.
|
// want this action calls a trigger.
|
||||||
|
|
||||||
@ -337,8 +337,8 @@ class Cchargesociales
|
|||||||
//$result=$this->call_trigger('MYOBJECT_DELETE',$user);
|
//$result=$this->call_trigger('MYOBJECT_DELETE',$user);
|
||||||
//if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail}
|
//if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail}
|
||||||
//// End call triggers
|
//// End call triggers
|
||||||
}
|
//}
|
||||||
}
|
//}
|
||||||
|
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
$sql = 'DELETE FROM ' . MAIN_DB_PREFIX . $this->table_element;
|
$sql = 'DELETE FROM ' . MAIN_DB_PREFIX . $this->table_element;
|
||||||
@ -476,34 +476,33 @@ class Cchargesociales
|
|||||||
|
|
||||||
if ($mode == 0)
|
if ($mode == 0)
|
||||||
{
|
{
|
||||||
$prefix='';
|
|
||||||
if ($status == 1) return $langs->trans('Enabled');
|
if ($status == 1) return $langs->trans('Enabled');
|
||||||
if ($status == 0) return $langs->trans('Disabled');
|
elseif ($status == 0) return $langs->trans('Disabled');
|
||||||
}
|
}
|
||||||
if ($mode == 1)
|
elseif ($mode == 1)
|
||||||
{
|
{
|
||||||
if ($status == 1) return $langs->trans('Enabled');
|
if ($status == 1) return $langs->trans('Enabled');
|
||||||
if ($status == 0) return $langs->trans('Disabled');
|
elseif ($status == 0) return $langs->trans('Disabled');
|
||||||
}
|
}
|
||||||
if ($mode == 2)
|
elseif ($mode == 2)
|
||||||
{
|
{
|
||||||
if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled');
|
if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled');
|
||||||
if ($status == 0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled');
|
elseif ($status == 0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled');
|
||||||
}
|
}
|
||||||
if ($mode == 3)
|
elseif ($mode == 3)
|
||||||
{
|
{
|
||||||
if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4');
|
if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4');
|
||||||
if ($status == 0) return img_picto($langs->trans('Disabled'),'statut5');
|
elseif ($status == 0) return img_picto($langs->trans('Disabled'),'statut5');
|
||||||
}
|
}
|
||||||
if ($mode == 4)
|
elseif ($mode == 4)
|
||||||
{
|
{
|
||||||
if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled');
|
if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled');
|
||||||
if ($status == 0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled');
|
elseif ($status == 0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled');
|
||||||
}
|
}
|
||||||
if ($mode == 5)
|
elseif ($mode == 5)
|
||||||
{
|
{
|
||||||
if ($status == 1) return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'),'statut4');
|
if ($status == 1) return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'),'statut4');
|
||||||
if ($status == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'),'statut5');
|
elseif ($status == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'),'statut5');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user