Merge branch '12.0' of git@github.com:Dolibarr/dolibarr.git into 13.0
Conflicts: htdocs/comm/mailing/class/mailing.class.php htdocs/core/modules/expedition/doc/pdf_espadon.modules.php htdocs/product/stock/replenish.php
This commit is contained in:
commit
5063f29532
@ -480,19 +480,44 @@ class Mailing extends CommonObject
|
|||||||
* @param int $rowid id du mailing a supprimer
|
* @param int $rowid id du mailing a supprimer
|
||||||
* @return int 1 en cas de succes
|
* @return int 1 en cas de succes
|
||||||
*/
|
*/
|
||||||
public function delete($rowid)
|
public function delete($rowid, $notrigger = 0)
|
||||||
{
|
{
|
||||||
|
global $user;
|
||||||
|
|
||||||
|
$this->db->begin();
|
||||||
|
|
||||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."mailing";
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."mailing";
|
||||||
$sql .= " WHERE rowid = ".$rowid;
|
$sql .= " WHERE rowid = ".$rowid;
|
||||||
|
|
||||||
dol_syslog("Mailing::delete", LOG_DEBUG);
|
dol_syslog("Mailing::delete", LOG_DEBUG);
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if ($resql) {
|
if ($resql)
|
||||||
return $this->delete_targets();
|
{
|
||||||
} else {
|
$res = $this->delete_targets();
|
||||||
|
if ($res <= 0) {
|
||||||
|
$this->db->rollback();
|
||||||
|
$this->error = $this->db->lasterror();
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$this->db->rollback();
|
||||||
$this->error = $this->db->lasterror();
|
$this->error = $this->db->lasterror();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!$notrigger) {
|
||||||
|
$result = $this->call_trigger('MAILING_DELETE', $user);
|
||||||
|
if ($result < 0)
|
||||||
|
{
|
||||||
|
$this->db->rollback();
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->db->commit();
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
|
|||||||
@ -368,6 +368,11 @@ if (!empty($conf->variants->eabled) && empty($conf->global->VARIANT_ALLOW_STOCK_
|
|||||||
if ($fk_supplier > 0) {
|
if ($fk_supplier > 0) {
|
||||||
$sql .= ' AND EXISTS (SELECT pfp.rowid FROM '.MAIN_DB_PREFIX.'product_fournisseur_price as pfp WHERE pfp.fk_product = p.rowid AND pfp.fk_soc = '.((int) $fk_supplier).' AND pfp.entity IN ('.getEntity('product_fournisseur_price').'))';
|
$sql .= ' AND EXISTS (SELECT pfp.rowid FROM '.MAIN_DB_PREFIX.'product_fournisseur_price as pfp WHERE pfp.fk_product = p.rowid AND pfp.fk_soc = '.((int) $fk_supplier).' AND pfp.entity IN ('.getEntity('product_fournisseur_price').'))';
|
||||||
}
|
}
|
||||||
|
// Add where from hooks
|
||||||
|
$parameters = array();
|
||||||
|
$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters); // Note that $action and $object may have been modified by hook
|
||||||
|
$sql .= $hookmanager->resPrint;
|
||||||
|
|
||||||
$sql .= ' GROUP BY p.rowid, p.ref, p.label, p.description, p.price';
|
$sql .= ' GROUP BY p.rowid, p.ref, p.label, p.description, p.price';
|
||||||
$sql .= ', p.price_ttc, p.price_base_type,p.fk_product_type, p.tms';
|
$sql .= ', p.price_ttc, p.price_base_type,p.fk_product_type, p.tms';
|
||||||
$sql .= ', p.duration, p.tobuy';
|
$sql .= ', p.duration, p.tobuy';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user