Remove old deprecated hook insertExtraFields. Triggers must be used for
action on CRUD events.
This commit is contained in:
parent
65996c47ff
commit
7108f68db9
@ -463,14 +463,7 @@ class Adherent extends CommonObject
|
|||||||
|
|
||||||
$action='update';
|
$action='update';
|
||||||
|
|
||||||
// Actions on extra fields (by external module)
|
// Actions on extra fields
|
||||||
// TODO le hook fait double emploi avec le trigger !!
|
|
||||||
$hookmanager->initHooks(array('memberdao'));
|
|
||||||
$parameters=array('id'=>$this->id);
|
|
||||||
$action='';
|
|
||||||
$reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
|
|
||||||
if (empty($reshook))
|
|
||||||
{
|
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
||||||
{
|
{
|
||||||
$result=$this->insertExtraFields();
|
$result=$this->insertExtraFields();
|
||||||
@ -479,8 +472,6 @@ class Adherent extends CommonObject
|
|||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else if ($reshook < 0) $error++;
|
|
||||||
|
|
||||||
// Update password
|
// Update password
|
||||||
if (! $error && $this->pass)
|
if (! $error && $this->pass)
|
||||||
|
|||||||
@ -171,12 +171,7 @@ class AdherentType extends CommonObject
|
|||||||
{
|
{
|
||||||
$action='update';
|
$action='update';
|
||||||
|
|
||||||
// Actions on extra fields (by external module or standard code)
|
// Actions on extra fields
|
||||||
$hookmanager->initHooks(array('membertypedao'));
|
|
||||||
$parameters=array('membertype'=>$this->id);
|
|
||||||
$reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
|
|
||||||
if (empty($reshook))
|
|
||||||
{
|
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
||||||
{
|
{
|
||||||
$result=$this->insertExtraFields();
|
$result=$this->insertExtraFields();
|
||||||
@ -185,8 +180,6 @@ class AdherentType extends CommonObject
|
|||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else if ($reshook < 0) $error++;
|
|
||||||
|
|
||||||
if (! $error && ! $notrigger)
|
if (! $error && ! $notrigger)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -155,12 +155,7 @@ class AssetType extends CommonObject
|
|||||||
{
|
{
|
||||||
$action='update';
|
$action='update';
|
||||||
|
|
||||||
// Actions on extra fields (by external module or standard code)
|
// Actions on extra fields
|
||||||
$hookmanager->initHooks(array('assettypedao'));
|
|
||||||
$parameters=array('assettype'=>$this->id);
|
|
||||||
$reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
|
|
||||||
if (empty($reshook))
|
|
||||||
{
|
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
||||||
{
|
{
|
||||||
$result=$this->insertExtraFields();
|
$result=$this->insertExtraFields();
|
||||||
@ -169,8 +164,6 @@ class AssetType extends CommonObject
|
|||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else if ($reshook < 0) $error++;
|
|
||||||
|
|
||||||
if (! $error && ! $notrigger)
|
if (! $error && ! $notrigger)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -338,13 +338,7 @@ class Categorie extends CommonObject
|
|||||||
|
|
||||||
$action='create';
|
$action='create';
|
||||||
|
|
||||||
// Actions on extra fields (by external module or standard code)
|
// Actions on extra fields
|
||||||
// TODO the hook duplicates the trigger !!
|
|
||||||
$hookmanager->initHooks(array('HookModuleNamedao'));
|
|
||||||
$parameters=array('socid'=>$this->id);
|
|
||||||
$reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
|
|
||||||
if (empty($reshook))
|
|
||||||
{
|
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
||||||
{
|
{
|
||||||
$result=$this->insertExtraFields();
|
$result=$this->insertExtraFields();
|
||||||
@ -353,13 +347,14 @@ class Categorie extends CommonObject
|
|||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else if ($reshook < 0) $error++;
|
|
||||||
|
|
||||||
|
if (! $error)
|
||||||
|
{
|
||||||
// Call trigger
|
// Call trigger
|
||||||
$result=$this->call_trigger('CATEGORY_CREATE',$user);
|
$result=$this->call_trigger('CATEGORY_CREATE',$user);
|
||||||
if ($result < 0) { $error++; }
|
if ($result < 0) { $error++; }
|
||||||
// End call triggers
|
// End call triggers
|
||||||
|
}
|
||||||
|
|
||||||
if ( ! $error )
|
if ( ! $error )
|
||||||
{
|
{
|
||||||
@ -432,13 +427,7 @@ class Categorie extends CommonObject
|
|||||||
{
|
{
|
||||||
$action='update';
|
$action='update';
|
||||||
|
|
||||||
// Actions on extra fields (by external module or standard code)
|
// Actions on extra fields
|
||||||
// TODO the hook duplicates the trigger !!
|
|
||||||
$hookmanager->initHooks(array('HookCategorydao'));
|
|
||||||
$parameters=array();
|
|
||||||
$reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
|
|
||||||
if (empty($reshook))
|
|
||||||
{
|
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
||||||
{
|
{
|
||||||
$result=$this->insertExtraFields();
|
$result=$this->insertExtraFields();
|
||||||
@ -447,13 +436,14 @@ class Categorie extends CommonObject
|
|||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else if ($reshook < 0) $error++;
|
|
||||||
|
|
||||||
|
if (! $error)
|
||||||
|
{
|
||||||
// Call trigger
|
// Call trigger
|
||||||
$result=$this->call_trigger('CATEGORY_MODIFY',$user);
|
$result=$this->call_trigger('CATEGORY_MODIFY',$user);
|
||||||
if ($result < 0) { $error++; $this->db->rollback(); return -1; }
|
if ($result < 0) { $error++; $this->db->rollback(); return -1; }
|
||||||
// End call triggers
|
// End call triggers
|
||||||
|
}
|
||||||
|
|
||||||
$this->db->commit();
|
$this->db->commit();
|
||||||
|
|
||||||
|
|||||||
@ -384,13 +384,7 @@ class ActionComm extends CommonObject
|
|||||||
{
|
{
|
||||||
$action='create';
|
$action='create';
|
||||||
|
|
||||||
// Actions on extra fields (by external module or standard code)
|
// Actions on extra fields
|
||||||
// TODO le hook fait double emploi avec le trigger !!
|
|
||||||
$hookmanager->initHooks(array('actioncommdao'));
|
|
||||||
$parameters=array('actcomm'=>$this->id);
|
|
||||||
$reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
|
|
||||||
if (empty($reshook))
|
|
||||||
{
|
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
||||||
{
|
{
|
||||||
$result=$this->insertExtraFields();
|
$result=$this->insertExtraFields();
|
||||||
@ -400,8 +394,6 @@ class ActionComm extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ($reshook < 0) $error++;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (! $error && ! $notrigger)
|
if (! $error && ! $notrigger)
|
||||||
{
|
{
|
||||||
@ -865,13 +857,7 @@ class ActionComm extends CommonObject
|
|||||||
{
|
{
|
||||||
$action='update';
|
$action='update';
|
||||||
|
|
||||||
// Actions on extra fields (by external module or standard code)
|
// Actions on extra fields
|
||||||
// TODO le hook fait double emploi avec le trigger !!
|
|
||||||
$hookmanager->initHooks(array('actioncommdao'));
|
|
||||||
$parameters=array('actcomm'=>$this->id);
|
|
||||||
$reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
|
|
||||||
if (empty($reshook))
|
|
||||||
{
|
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
||||||
{
|
{
|
||||||
$result=$this->insertExtraFields();
|
$result=$this->insertExtraFields();
|
||||||
@ -880,8 +866,6 @@ class ActionComm extends CommonObject
|
|||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else if ($reshook < 0) $error++;
|
|
||||||
|
|
||||||
// Now insert assignedusers
|
// Now insert assignedusers
|
||||||
if (! $error)
|
if (! $error)
|
||||||
|
|||||||
@ -1114,12 +1114,8 @@ class Propal extends CommonObject
|
|||||||
{
|
{
|
||||||
$action='update';
|
$action='update';
|
||||||
|
|
||||||
// Actions on extra fields (by external module or standard code)
|
// Actions on extra fields
|
||||||
// TODO le hook fait double emploi avec le trigger !!
|
if (! $error)
|
||||||
$hookmanager->initHooks(array('propaldao'));
|
|
||||||
$parameters=array('socid'=>$this->id);
|
|
||||||
$reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
|
|
||||||
if (empty($reshook))
|
|
||||||
{
|
{
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
||||||
{
|
{
|
||||||
@ -1130,9 +1126,8 @@ class Propal extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ($reshook < 0) $error++;
|
|
||||||
|
|
||||||
if (! $notrigger)
|
if (! $error && ! $notrigger)
|
||||||
{
|
{
|
||||||
// Call trigger
|
// Call trigger
|
||||||
$result=$this->call_trigger('PROPAL_CREATE',$user);
|
$result=$this->call_trigger('PROPAL_CREATE',$user);
|
||||||
@ -3953,7 +3948,7 @@ class PropaleLigne extends CommonObjectLine
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! $notrigger)
|
if (! $error && ! $notrigger)
|
||||||
{
|
{
|
||||||
// Call trigger
|
// Call trigger
|
||||||
$result=$this->call_trigger('LINEPROPAL_INSERT',$user);
|
$result=$this->call_trigger('LINEPROPAL_INSERT',$user);
|
||||||
@ -4136,7 +4131,7 @@ class PropaleLigne extends CommonObjectLine
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! $notrigger)
|
if (! $error && ! $notrigger)
|
||||||
{
|
{
|
||||||
// Call trigger
|
// Call trigger
|
||||||
$result=$this->call_trigger('LINEPROPAL_UPDATE',$user);
|
$result=$this->call_trigger('LINEPROPAL_UPDATE',$user);
|
||||||
|
|||||||
@ -1269,24 +1269,16 @@ if (empty($reshook))
|
|||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
// Actions on extra fields (by external module or standard code)
|
// Actions on extra fields
|
||||||
$hookmanager->initHooks(array('orderdao'));
|
|
||||||
$parameters = array('id' => $object->id);
|
|
||||||
$reshook = $hookmanager->executeHooks('insertExtraFields', $parameters, $object, $action); // Note that $action and $object may have been modified by
|
|
||||||
// some hooks
|
|
||||||
if (empty($reshook)) {
|
|
||||||
$result = $object->insertExtraFields('ORDER_MODIFY');
|
$result = $object->insertExtraFields('ORDER_MODIFY');
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
{
|
{
|
||||||
setEventMessages($object->error, $object->errors, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
} else if ($reshook < 0)
|
|
||||||
$error++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($error)
|
if ($error) $action = 'edit_extras';
|
||||||
$action = 'edit_extras';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == 'set_thirdparty' && $user->rights->commande->creer)
|
if ($action == 'set_thirdparty' && $user->rights->commande->creer)
|
||||||
|
|||||||
@ -4208,7 +4208,7 @@ class OrderLine extends CommonOrderLine
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! $notrigger)
|
if (! $error && ! $notrigger)
|
||||||
{
|
{
|
||||||
// Call trigger
|
// Call trigger
|
||||||
$result=$this->call_trigger('LINEORDER_UPDATE',$user);
|
$result=$this->call_trigger('LINEORDER_UPDATE',$user);
|
||||||
|
|||||||
@ -2209,22 +2209,15 @@ if (empty($reshook))
|
|||||||
$ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute','none'));
|
$ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute','none'));
|
||||||
if ($ret < 0) $error++;
|
if ($ret < 0) $error++;
|
||||||
|
|
||||||
if (! $error) {
|
if (! $error)
|
||||||
// Actions on extra fields (by external module or standard code)
|
{
|
||||||
// TODO le hook fait double emploi avec le trigger !!
|
// Actions on extra fields
|
||||||
$hookmanager->initHooks(array('invoicedao'));
|
|
||||||
$parameters = array('id' => $object->id);
|
|
||||||
$reshook = $hookmanager->executeHooks('insertExtraFields', $parameters, $object, $action); // Note that $action and $object may have been modified by
|
|
||||||
// some hooks
|
|
||||||
if (empty($reshook)) {
|
|
||||||
$result = $object->insertExtraFields('BILL_MODIFY');
|
$result = $object->insertExtraFields('BILL_MODIFY');
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
{
|
{
|
||||||
setEventMessages($object->error, $object->errors, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
} else if ($reshook < 0)
|
|
||||||
$error ++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($error)
|
if ($error)
|
||||||
|
|||||||
@ -1791,7 +1791,7 @@ class FactureLigneRec extends CommonInvoiceLine
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! $notrigger)
|
if (! $error && ! $notrigger)
|
||||||
{
|
{
|
||||||
// Call trigger
|
// Call trigger
|
||||||
$result=$this->call_trigger('LINEBILL_REC_UPDATE',$user);
|
$result=$this->call_trigger('LINEBILL_REC_UPDATE',$user);
|
||||||
|
|||||||
@ -750,34 +750,19 @@ class Facture extends CommonInvoice
|
|||||||
{
|
{
|
||||||
$action='create';
|
$action='create';
|
||||||
|
|
||||||
// Actions on extra fields (by external module or standard code)
|
// Actions on extra fields
|
||||||
// TODO le hook fait double emploi avec le trigger !!
|
|
||||||
/*
|
|
||||||
$hookmanager->initHooks(array('invoicedao'));
|
|
||||||
$parameters=array('invoiceid'=>$this->id);
|
|
||||||
$reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
|
|
||||||
if (empty($reshook))
|
|
||||||
{
|
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
|
||||||
{*/
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
$result=$this->insertExtraFields();
|
$result=$this->insertExtraFields();
|
||||||
if ($result < 0) $error++;
|
if ($result < 0) $error++;
|
||||||
}
|
}
|
||||||
/*}
|
|
||||||
}
|
|
||||||
else if ($reshook < 0) $error++;*/
|
|
||||||
|
|
||||||
if (! $error)
|
if (! $error && ! $notrigger)
|
||||||
{
|
|
||||||
if (! $notrigger)
|
|
||||||
{
|
{
|
||||||
// Call trigger
|
// Call trigger
|
||||||
$result=$this->call_trigger('BILL_CREATE',$user);
|
$result=$this->call_trigger('BILL_CREATE',$user);
|
||||||
if ($result < 0) $error++;
|
if ($result < 0) $error++;
|
||||||
// End call triggers
|
// End call triggers
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
@ -4697,7 +4682,7 @@ class FactureLigne extends CommonInvoiceLine
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! $notrigger)
|
if (! $error && ! $notrigger)
|
||||||
{
|
{
|
||||||
// Call trigger
|
// Call trigger
|
||||||
$result=$this->call_trigger('LINEBILL_UPDATE',$user);
|
$result=$this->call_trigger('LINEBILL_UPDATE',$user);
|
||||||
|
|||||||
@ -417,7 +417,8 @@ if (empty($reshook))
|
|||||||
$ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute','none'));
|
$ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute','none'));
|
||||||
if ($ret < 0) $error++;
|
if ($ret < 0) $error++;
|
||||||
|
|
||||||
if (! $error) {
|
if (! $error)
|
||||||
|
{
|
||||||
$result = $object->insertExtraFields('BILLREC_MODIFY');
|
$result = $object->insertExtraFields('BILLREC_MODIFY');
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -366,11 +366,8 @@ class Contact extends CommonObject
|
|||||||
|
|
||||||
$action='update';
|
$action='update';
|
||||||
|
|
||||||
// Actions on extra fields (by external module or standard code)
|
// Actions on extra fields
|
||||||
$hookmanager->initHooks(array('contactdao'));
|
if (! $error)
|
||||||
$parameters=array('socid'=>$this->id);
|
|
||||||
$reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
|
|
||||||
if (empty($reshook))
|
|
||||||
{
|
{
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
||||||
{
|
{
|
||||||
@ -381,7 +378,6 @@ class Contact extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ($reshook < 0) $error++;
|
|
||||||
|
|
||||||
if (! $error && $this->user_id > 0)
|
if (! $error && $this->user_id > 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -164,20 +164,13 @@ if (empty($reshook))
|
|||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
// Actions on extra fields (by external module or standard code)
|
// Actions on extra fields
|
||||||
// TODO le hook fait double emploi avec le trigger !!
|
|
||||||
$hookmanager->initHooks(array('expeditiondao'));
|
|
||||||
$parameters = array('id' => $object->id);
|
|
||||||
$reshook = $hookmanager->executeHooks('insertExtraFields', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
|
||||||
if (empty($reshook)) {
|
|
||||||
$result = $object->insertExtraFields('SHIPMENT_MODIFY');
|
$result = $object->insertExtraFields('SHIPMENT_MODIFY');
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
{
|
{
|
||||||
setEventMessages($object->error, $object->errors, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
} else if ($reshook < 0)
|
|
||||||
$error++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($error)
|
if ($error)
|
||||||
|
|||||||
@ -311,13 +311,7 @@ class Expedition extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Actions on extra fields (by external module or standard code)
|
// Actions on extra fields
|
||||||
// TODO le hook fait double emploi avec le trigger !!
|
|
||||||
$hookmanager->initHooks(array('expeditiondao'));
|
|
||||||
$parameters=array('socid'=>$this->id);
|
|
||||||
$reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
|
|
||||||
if (empty($reshook))
|
|
||||||
{
|
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
||||||
{
|
{
|
||||||
$result=$this->insertExtraFields();
|
$result=$this->insertExtraFields();
|
||||||
@ -326,8 +320,6 @@ class Expedition extends CommonObject
|
|||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else if ($reshook < 0) $error++;
|
|
||||||
|
|
||||||
if (! $error && ! $notrigger)
|
if (! $error && ! $notrigger)
|
||||||
{
|
{
|
||||||
@ -2690,7 +2682,9 @@ class ExpeditionLigne extends CommonObjectLine
|
|||||||
$this->errors[]=$this->db->lasterror()." - sql=$sql";
|
$this->errors[]=$this->db->lasterror()." - sql=$sql";
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
else
|
}
|
||||||
|
|
||||||
|
if (! $error)
|
||||||
{
|
{
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
||||||
{
|
{
|
||||||
@ -2702,7 +2696,7 @@ class ExpeditionLigne extends CommonObjectLine
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (! $error && ! $notrigger)
|
if (! $error && ! $notrigger)
|
||||||
{
|
{
|
||||||
// Call trigger
|
// Call trigger
|
||||||
|
|||||||
@ -189,20 +189,13 @@ if (empty($reshook))
|
|||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
// Actions on extra fields (by external module or standard code)
|
// Actions on extra fields
|
||||||
$hookmanager->initHooks(array('orderdao'));
|
|
||||||
$parameters = array('id' => $object->id);
|
|
||||||
$reshook = $hookmanager->executeHooks('insertExtraFields', $parameters, $object, $action); // Note that $action and $object may have been modified by
|
|
||||||
// some hooks
|
|
||||||
if (empty($reshook)) {
|
|
||||||
$result = $object->insertExtraFields('SHIPMENT_MODIFY');
|
$result = $object->insertExtraFields('SHIPMENT_MODIFY');
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
{
|
{
|
||||||
setEventMessages($object->error, $object->errors, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
} else if ($reshook < 0)
|
|
||||||
$error++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($error)
|
if ($error)
|
||||||
|
|||||||
@ -288,20 +288,13 @@ if (empty($reshook))
|
|||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
// Actions on extra fields (by external module or standard code)
|
// Actions on extra fields
|
||||||
$hookmanager->initHooks(array('expensereportdao'));
|
|
||||||
$parameters = array('id' => $object->id);
|
|
||||||
$reshook = $hookmanager->executeHooks('insertExtraFields', $parameters, $object, $action); // Note that $action and $object may have been modified by
|
|
||||||
// some hooks
|
|
||||||
if (empty($reshook)) {
|
|
||||||
$result = $object->insertExtraFields('FICHINTER_MODIFY');
|
$result = $object->insertExtraFields('FICHINTER_MODIFY');
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
{
|
{
|
||||||
setEventMessages($object->error, $object->errors, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
} else if ($reshook < 0)
|
|
||||||
$error++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($error)
|
if ($error)
|
||||||
|
|||||||
@ -750,21 +750,13 @@ if (empty($reshook))
|
|||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
// Actions on extra fields (by external module or standard code)
|
// Actions on extra fields
|
||||||
// TODO le hook fait double emploi avec le trigger !!
|
|
||||||
$hookmanager->initHooks(array('interventiondao'));
|
|
||||||
$parameters=array('id'=>$object->id);
|
|
||||||
$reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
|
||||||
if (empty($reshook))
|
|
||||||
{
|
|
||||||
$result=$object->insertExtraFields('INTERVENTION_MODIFY');
|
$result=$object->insertExtraFields('INTERVENTION_MODIFY');
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
{
|
{
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ($reshook < 0) $error++;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($error) $action = 'edit_extras';
|
if ($error) $action = 'edit_extras';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -253,7 +253,7 @@ class Fichinter extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (! $notrigger)
|
if (! $error && ! $notrigger)
|
||||||
{
|
{
|
||||||
// Call trigger
|
// Call trigger
|
||||||
$result=$this->call_trigger('FICHINTER_CREATE',$user);
|
$result=$this->call_trigger('FICHINTER_CREATE',$user);
|
||||||
|
|||||||
@ -121,11 +121,13 @@ if (empty($reshook))
|
|||||||
$ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute', 'none'));
|
$ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute', 'none'));
|
||||||
|
|
||||||
if ($ret < 0) $error++;
|
if ($ret < 0) $error++;
|
||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
$result = $object->insertExtraFields('COMPANY_MODIFY');
|
$result = $object->insertExtraFields('COMPANY_MODIFY');
|
||||||
if ($result < 0) $error++;
|
if ($result < 0) $error++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($error) $action = 'edit_extras';
|
if ($error) $action = 'edit_extras';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3259,7 +3259,6 @@ class CommandeFournisseurLigne extends CommonOrderLine
|
|||||||
|
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
||||||
{
|
{
|
||||||
|
|
||||||
$result=$this->insertExtraFields();
|
$result=$this->insertExtraFields();
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
{
|
{
|
||||||
@ -3347,7 +3346,6 @@ class CommandeFournisseurLigne extends CommonOrderLine
|
|||||||
{
|
{
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
||||||
{
|
{
|
||||||
|
|
||||||
$result=$this->insertExtraFields();
|
$result=$this->insertExtraFields();
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -444,13 +444,7 @@ class FactureFournisseur extends CommonInvoice
|
|||||||
{
|
{
|
||||||
$action='create';
|
$action='create';
|
||||||
|
|
||||||
// Actions on extra fields (by external module or standard code)
|
// Actions on extra fields
|
||||||
// TODO le hook fait double emploi avec le trigger !!
|
|
||||||
$hookmanager->initHooks(array('supplierinvoicedao'));
|
|
||||||
$parameters=array('socid'=>$this->id);
|
|
||||||
$reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
|
|
||||||
if (empty($reshook))
|
|
||||||
{
|
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
||||||
{
|
{
|
||||||
$result=$this->insertExtraFields(); // This also set $this->error or $this->errors if errors are found
|
$result=$this->insertExtraFields(); // This also set $this->error or $this->errors if errors are found
|
||||||
@ -459,8 +453,6 @@ class FactureFournisseur extends CommonInvoice
|
|||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else if ($reshook < 0) $error++;
|
|
||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
@ -2830,7 +2822,9 @@ class SupplierInvoiceLine extends CommonObjectLine
|
|||||||
|
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
||||||
{
|
{
|
||||||
if ($this->insertExtraFields() < 0) {
|
$result = $this->insertExtraFields();
|
||||||
|
if ($result < 0)
|
||||||
|
{
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2976,7 +2970,7 @@ class SupplierInvoiceLine extends CommonObjectLine
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! $notrigger)
|
if (! $error && ! $notrigger)
|
||||||
{
|
{
|
||||||
// Call trigger
|
// Call trigger
|
||||||
$result=$this->call_trigger('LINEBILL_SUPPLIER_CREATE',$user);
|
$result=$this->call_trigger('LINEBILL_SUPPLIER_CREATE',$user);
|
||||||
|
|||||||
@ -955,33 +955,20 @@ if (empty($reshook))
|
|||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
// Actions on extra fields (by external module or standard code)
|
// Actions on extra fields
|
||||||
// TODO le hook fait double emploi avec le trigger !!
|
|
||||||
$hookmanager->initHooks(array('supplierorderdao'));
|
|
||||||
$parameters=array('id'=>$object->id);
|
|
||||||
|
|
||||||
$reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
|
||||||
|
|
||||||
if (empty($reshook))
|
|
||||||
{
|
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
||||||
{
|
{
|
||||||
$result=$object->insertExtraFields('ORDER_SUPPLIER_MODIFY');
|
$result=$object->insertExtraFields('ORDER_SUPPLIER_MODIFY');
|
||||||
|
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
{
|
{
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
if ($error)
|
||||||
}
|
|
||||||
else if ($reshook < 0) $error++;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$action = 'edit_extras';
|
$action = 'edit_extras';
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Create an order
|
* Create an order
|
||||||
|
|||||||
@ -1461,34 +1461,20 @@ if (empty($reshook))
|
|||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
// Actions on extra fields (by external module or standard code)
|
// Actions on extra fields
|
||||||
// TODO le hook fait double emploi avec le trigger !!
|
|
||||||
$hookmanager->initHooks(array('supplierinvoicedao'));
|
|
||||||
$parameters=array('id'=>$object->id);
|
|
||||||
|
|
||||||
$reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
|
||||||
|
|
||||||
if (empty($reshook))
|
|
||||||
{
|
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
||||||
{
|
{
|
||||||
|
|
||||||
$result=$object->insertExtraFields('BILL_SUPPLIER_MODIFY');
|
$result=$object->insertExtraFields('BILL_SUPPLIER_MODIFY');
|
||||||
|
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
{
|
{
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
if ($error)
|
||||||
}
|
|
||||||
else if ($reshook < 0) $error++;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$action = 'edit_extras';
|
$action = 'edit_extras';
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->fournisseur->facture->creer)
|
if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->fournisseur->facture->creer)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -202,20 +202,13 @@ if ($action == 'update_extras')
|
|||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
// Actions on extra fields (by external module or standard code)
|
// Actions on extra fields
|
||||||
// TODO le hook fait double emploi avec le trigger !!
|
|
||||||
$hookmanager->initHooks(array('livraisondao'));
|
|
||||||
$parameters = array('id' => $object->id);
|
|
||||||
$reshook = $hookmanager->executeHooks('insertExtraFields', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
|
||||||
if (empty($reshook)) {
|
|
||||||
$result = $object->insertExtraFields('DELIVERY_MODIFY');
|
$result = $object->insertExtraFields('DELIVERY_MODIFY');
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
{
|
{
|
||||||
setEventMessages($object->error, $object->errors, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
} else if ($reshook < 0)
|
|
||||||
$error++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($error)
|
if ($error)
|
||||||
|
|||||||
@ -926,12 +926,7 @@ class Product extends CommonObject
|
|||||||
|
|
||||||
$action='update';
|
$action='update';
|
||||||
|
|
||||||
// Actions on extra fields (by external module or standard code)
|
// Actions on extra fields
|
||||||
$hookmanager->initHooks(array('productdao'));
|
|
||||||
$parameters=array('id'=>$this->id);
|
|
||||||
$reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
|
|
||||||
if (empty($reshook))
|
|
||||||
{
|
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
||||||
{
|
{
|
||||||
$result=$this->insertExtraFields();
|
$result=$this->insertExtraFields();
|
||||||
@ -940,8 +935,6 @@ class Product extends CommonObject
|
|||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else if ($reshook < 0) $error++;
|
|
||||||
|
|
||||||
if (! $error && ! $notrigger)
|
if (! $error && ! $notrigger)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -131,20 +131,13 @@ if (empty($reshook))
|
|||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
// Actions on extra fields (by external module or standard code)
|
// Actions on extra fields
|
||||||
$hookmanager->initHooks(array('productlotdao'));
|
|
||||||
$parameters = array('id' => $object->id);
|
|
||||||
$reshook = $hookmanager->executeHooks('insertExtraFields', $parameters, $object, $action); // Note that $action and $object may have been modified by
|
|
||||||
// some hooks
|
|
||||||
if (empty($reshook)) {
|
|
||||||
$result = $object->insertExtraFields('PRODUCT_LOT_MODIFY');
|
$result = $object->insertExtraFields('PRODUCT_LOT_MODIFY');
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
{
|
{
|
||||||
setEventMessages($object->error, $object->errors, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
} else if ($reshook < 0)
|
|
||||||
$error++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($error)
|
if ($error)
|
||||||
|
|||||||
@ -333,17 +333,6 @@ class Task extends CommonObject
|
|||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); }
|
if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); }
|
||||||
|
|
||||||
if (! $error)
|
|
||||||
{
|
|
||||||
if (! $notrigger)
|
|
||||||
{
|
|
||||||
// Call trigger
|
|
||||||
$result=$this->call_trigger('TASK_MODIFY',$user);
|
|
||||||
if ($result < 0) { $error++; }
|
|
||||||
// End call triggers
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Update extrafield
|
// Update extrafield
|
||||||
if (! $error) {
|
if (! $error) {
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
||||||
@ -356,6 +345,17 @@ class Task extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (! $error)
|
||||||
|
{
|
||||||
|
if (! $notrigger)
|
||||||
|
{
|
||||||
|
// Call trigger
|
||||||
|
$result=$this->call_trigger('TASK_MODIFY',$user);
|
||||||
|
if ($result < 0) { $error++; }
|
||||||
|
// End call triggers
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (! $error && (is_object($this->oldcopy) && $this->oldcopy->ref !== $this->ref))
|
if (! $error && (is_object($this->oldcopy) && $this->oldcopy->ref !== $this->ref))
|
||||||
{
|
{
|
||||||
// We remove directory
|
// We remove directory
|
||||||
|
|||||||
@ -119,13 +119,7 @@ class Dolresource extends CommonObject
|
|||||||
{
|
{
|
||||||
$action='create';
|
$action='create';
|
||||||
|
|
||||||
// Actions on extra fields (by external module or standard code)
|
// Actions on extra fields
|
||||||
// TODO le hook fait double emploi avec le trigger !!
|
|
||||||
$hookmanager->initHooks(array('actioncommdao'));
|
|
||||||
$parameters=array('actcomm'=>$this->id);
|
|
||||||
$reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
|
|
||||||
if (empty($reshook))
|
|
||||||
{
|
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
||||||
{
|
{
|
||||||
$result=$this->insertExtraFields();
|
$result=$this->insertExtraFields();
|
||||||
@ -135,8 +129,6 @@ class Dolresource extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ($reshook < 0) $error++;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
@ -305,13 +297,7 @@ class Dolresource extends CommonObject
|
|||||||
{
|
{
|
||||||
$action='update';
|
$action='update';
|
||||||
|
|
||||||
// Actions on extra fields (by external module or standard code)
|
// Actions on extra fields
|
||||||
// TODO le hook fait double emploi avec le trigger !!
|
|
||||||
$hookmanager->initHooks(array('actioncommdao'));
|
|
||||||
$parameters=array('actcomm'=>$this->id);
|
|
||||||
$reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
|
|
||||||
if (empty($reshook))
|
|
||||||
{
|
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
||||||
{
|
{
|
||||||
$result=$this->insertExtraFields();
|
$result=$this->insertExtraFields();
|
||||||
@ -321,8 +307,6 @@ class Dolresource extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ($reshook < 0) $error++;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Commit or rollback
|
// Commit or rollback
|
||||||
if ($error)
|
if ($error)
|
||||||
|
|||||||
@ -1056,13 +1056,7 @@ class Societe extends CommonObject
|
|||||||
|
|
||||||
$action='update';
|
$action='update';
|
||||||
|
|
||||||
// Actions on extra fields (by external module or standard code)
|
// Actions on extra fields
|
||||||
// TODO le hook fait double emploi avec le trigger !!
|
|
||||||
$hookmanager->initHooks(array('thirdpartydao'));
|
|
||||||
$parameters=array('socid'=>$this->id);
|
|
||||||
$reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
|
|
||||||
if (empty($reshook))
|
|
||||||
{
|
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
||||||
{
|
{
|
||||||
$result=$this->insertExtraFields();
|
$result=$this->insertExtraFields();
|
||||||
@ -1071,8 +1065,6 @@ class Societe extends CommonObject
|
|||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else if ($reshook < 0) $error++;
|
|
||||||
|
|
||||||
if (! $error && $call_trigger)
|
if (! $error && $call_trigger)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -960,12 +960,7 @@ class SupplierProposal extends CommonObject
|
|||||||
{
|
{
|
||||||
$action='update';
|
$action='update';
|
||||||
|
|
||||||
// Actions on extra fields (by external module or standard code)
|
// Actions on extra fields
|
||||||
$hookmanager->initHooks(array('supplier_proposaldao'));
|
|
||||||
$parameters=array('socid'=>$this->id);
|
|
||||||
$reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
|
|
||||||
if (empty($reshook))
|
|
||||||
{
|
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
||||||
{
|
{
|
||||||
$result=$this->insertExtraFields();
|
$result=$this->insertExtraFields();
|
||||||
@ -974,10 +969,8 @@ class SupplierProposal extends CommonObject
|
|||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else if ($reshook < 0) $error++;
|
|
||||||
|
|
||||||
if (! $notrigger)
|
if (! $erro && ! $notrigger)
|
||||||
{
|
{
|
||||||
// Call trigger
|
// Call trigger
|
||||||
$result=$this->call_trigger('PROPAL_SUPPLIER_CREATE',$user);
|
$result=$this->call_trigger('PROPAL_SUPPLIER_CREATE',$user);
|
||||||
@ -2885,7 +2878,7 @@ class SupplierProposalLine extends CommonObjectLine
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! $notrigger)
|
if (! $error && ! $notrigger)
|
||||||
{
|
{
|
||||||
// Call trigger
|
// Call trigger
|
||||||
$result=$this->call_trigger('LINESUPPLIER_PROPOSAL_INSERT',$user);
|
$result=$this->call_trigger('LINESUPPLIER_PROPOSAL_INSERT',$user);
|
||||||
@ -3061,7 +3054,7 @@ class SupplierProposalLine extends CommonObjectLine
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! $notrigger)
|
if (! $error && ! $notrigger)
|
||||||
{
|
{
|
||||||
// Call trigger
|
// Call trigger
|
||||||
$result=$this->call_trigger('LINESUPPLIER_PROPOSAL_UPDATE',$user);
|
$result=$this->call_trigger('LINESUPPLIER_PROPOSAL_UPDATE',$user);
|
||||||
|
|||||||
@ -823,22 +823,16 @@ class Ticketsup extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (! $error) {
|
if (! $error) {
|
||||||
// FIXME le hook fait double emploi avec le trigger !!
|
// Update extrafields
|
||||||
$hookmanager->initHooks(array('TicketSupDao'));
|
|
||||||
$parameters = array('ticketsupid' => $this->id);
|
|
||||||
$reshook = $hookmanager->executeHooks('insertExtraFields', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
|
||||||
if (empty($reshook)) {
|
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) { // For avoid conflicts if trigger used
|
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) { // For avoid conflicts if trigger used
|
||||||
$result = $this->insertExtraFields();
|
$result = $this->insertExtraFields();
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} elseif ($reshook < 0) {
|
|
||||||
$error++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$notrigger) {
|
if (! $error && ! $notrigger) {
|
||||||
// Call trigger
|
// Call trigger
|
||||||
$result=$this->call_trigger('TICKET_MODIFY', $user);
|
$result=$this->call_trigger('TICKET_MODIFY', $user);
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
@ -846,7 +840,6 @@ class Ticketsup extends CommonObject
|
|||||||
}
|
}
|
||||||
// End call triggers
|
// End call triggers
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Commit or rollback
|
// Commit or rollback
|
||||||
if ($error) {
|
if ($error) {
|
||||||
|
|||||||
@ -1572,7 +1572,7 @@ class User extends CommonObject
|
|||||||
|
|
||||||
$action='update';
|
$action='update';
|
||||||
|
|
||||||
// Actions on extra fields (by external module or standard code)
|
// Actions on extra fields
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
||||||
{
|
{
|
||||||
$result=$this->insertExtraFields();
|
$result=$this->insertExtraFields();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user