Merge branch '12.0' of git@github.com:Dolibarr/dolibarr.git into 12.0
This commit is contained in:
commit
98a0959b64
@ -427,8 +427,12 @@ class Mailing extends CommonObject
|
||||
* @param int $rowid id du mailing a supprimer
|
||||
* @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 .= " WHERE rowid = ".$rowid;
|
||||
|
||||
@ -436,13 +440,31 @@ class Mailing extends CommonObject
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
return $this->delete_targets();
|
||||
$res = $this->delete_targets();
|
||||
if(empty($res)){
|
||||
$this->db->rollback();
|
||||
$this->error = $this->db->lasterror();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->db->rollback();
|
||||
$this->error = $this->db->lasterror();
|
||||
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
|
||||
|
||||
@ -362,11 +362,12 @@ class pdf_espadon extends ModelePdfExpedition
|
||||
{
|
||||
$tab_top = 88 + $height_incoterms;
|
||||
$tab_top_alt = $tab_top;
|
||||
|
||||
$pdf->SetFont('', 'B', $default_font_size - 2);
|
||||
$pdf->writeHTMLCell(60, 4, $this->posxdesc - 1, $tab_top - 1, $outputlangs->transnoentities("TrackingNumber")." : ".$object->tracking_number, 0, 1, false, true, 'L');
|
||||
if(!empty($object->tracking_number)) {
|
||||
$pdf->writeHTMLCell(60, 4, $this->posxdesc - 1, $tab_top - 1, $outputlangs->transnoentities("TrackingNumber")." : ".$object->tracking_number, 0, 1, false, true, 'L');
|
||||
}
|
||||
|
||||
$tab_top_alt = $pdf->GetY();
|
||||
if(!empty($object->tracking_number)) $tab_top_alt = $pdf->GetY();
|
||||
//$tab_top_alt += 1;
|
||||
|
||||
// Tracking number
|
||||
|
||||
Loading…
Reference in New Issue
Block a user