forked from Wavyzz/dolibarr
Merge branch 'patch-11' of github.com:defrance69/dolibarr into
defrance69-patch-11 Conflicts: htdocs/core/class/commonobject.class.php
This commit is contained in:
@@ -205,7 +205,7 @@ abstract class CommonObject
|
||||
$datecreate = dol_now();
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
|
||||
// Insertion dans la base
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."element_contact";
|
||||
$sql.= " (element_id, fk_socpeople, datecreate, statut, fk_c_type_contact) ";
|
||||
@@ -223,7 +223,7 @@ abstract class CommonObject
|
||||
$result=$this->call_trigger(strtoupper($this->element).'_ADD_CONTACT', $user);
|
||||
if ($result < 0) { $this->db->rollback(); return -1; }
|
||||
}
|
||||
|
||||
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
}
|
||||
@@ -310,7 +310,7 @@ abstract class CommonObject
|
||||
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."element_contact";
|
||||
$sql.= " WHERE rowid =".$rowid;
|
||||
|
||||
@@ -3226,12 +3226,17 @@ abstract class CommonObject
|
||||
|
||||
if (! $user->rights->margins->liretous) return;
|
||||
|
||||
$rounding = min($conf->global->MAIN_MAX_DECIMALS_UNIT,$conf->global->MAIN_MAX_DECIMALS_TOT);
|
||||
$rounding = min($conf->global->MAIN_MAX_DECIMALS_UNIT, $conf->global->MAIN_MAX_DECIMALS_TOT);
|
||||
|
||||
$marginInfo = $this->getMarginInfos($force_price);
|
||||
|
||||
print '<table class="nobordernopadding" width="100%">';
|
||||
if (! empty($conf->global->MARGININFO_HIDE_SHOW))
|
||||
{
|
||||
print "<img onclick=\"$('.margininfos').toggle();\" src='".img_picto($langs->trans("Hide")."/".$langs->trans("Show"),'object_margin.png','','',1)."'>";
|
||||
if ($conf->global->MARGININFO_HIDE_SHOW == 2) print '<script>$(document).ready(function() {$(".margininfos").hide();});</script>'; // hide by default
|
||||
}
|
||||
|
||||
print '<table class="nobordernopadding margintable" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td width="30%">'.$langs->trans('Margins').'</td>';
|
||||
print '<td width="20%" align="right">'.$langs->trans('SellingPrice').'</td>';
|
||||
@@ -3350,7 +3355,7 @@ abstract class CommonObject
|
||||
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."element_resources";
|
||||
$sql.= " WHERE rowid =".$rowid;
|
||||
|
||||
@@ -3392,13 +3397,13 @@ abstract class CommonObject
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Call trigger based on this instance
|
||||
*
|
||||
*
|
||||
* NB: Error from trigger are stacked in errors
|
||||
* NB2: if trigger fail, action should be canceled.
|
||||
*
|
||||
*
|
||||
* @param string $trigger_name trigger's name to execute
|
||||
* @param User $user Object user
|
||||
* @return int Result of run_triggers
|
||||
@@ -3406,7 +3411,7 @@ abstract class CommonObject
|
||||
function call_trigger($trigger_name, $user)
|
||||
{
|
||||
global $langs,$conf;
|
||||
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
$interface=new Interfaces($this->db);
|
||||
$result=$interface->run_triggers($trigger_name,$this,$user,$langs,$conf);
|
||||
@@ -3415,13 +3420,13 @@ abstract class CommonObject
|
||||
{
|
||||
$this->errors=array_merge($this->errors,$interface->errors);
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
$this->errors=$interface->errors;
|
||||
}
|
||||
}
|
||||
return $result;
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user