Merge pull request #1382 from atm-geoffrey/develop
Add new doActions and formObjectOptions hook on supplier prices page
This commit is contained in:
commit
0d0fda8fae
@ -200,8 +200,25 @@ class ProductFournisseur extends Product
|
|||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
$this->db->commit();
|
// Appel des triggers
|
||||||
return 0;
|
include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php");
|
||||||
|
$interface=new Interfaces($this->db);
|
||||||
|
$result=$interface->run_triggers('UPDATE_BUYPRICE',$this,$user,$langs,$conf);
|
||||||
|
if ($result < 0)
|
||||||
|
{
|
||||||
|
$error++; $this->errors=$interface->errors;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (empty($error))
|
||||||
|
{
|
||||||
|
$this->db->commit();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$this->db->rollback();
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -73,6 +73,10 @@ if (! $sortorder) $sortorder="ASC";
|
|||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
$parameters=array('socid'=>$socid, 'id_prod'=>$id);
|
||||||
|
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||||
|
$error=$hookmanager->error; $errors=array_merge($errors, (array) $hookmanager->errors);
|
||||||
|
|
||||||
if ($action == 'remove_pf')
|
if ($action == 'remove_pf')
|
||||||
{
|
{
|
||||||
$product = new ProductFournisseur($db);
|
$product = new ProductFournisseur($db);
|
||||||
@ -386,6 +390,12 @@ if ($id || $ref)
|
|||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (is_object($hookmanager))
|
||||||
|
{
|
||||||
|
$parameters=array('id_fourn'=>$id_fourn,'prod_id'=>$product->id);
|
||||||
|
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action);
|
||||||
|
}
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
print '<br><center><input class="button" type="submit" value="'.$langs->trans("Save").'">';
|
print '<br><center><input class="button" type="submit" value="'.$langs->trans("Save").'">';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user