New: not reload page with dialog confirm
Fix: problem with external module constraint
This commit is contained in:
parent
b08844f915
commit
781fe52b39
@ -579,6 +579,7 @@ class Product extends CommonObject
|
||||
$prod_use = $this->verif_prod_use($id);
|
||||
if ($prod_use == 0)
|
||||
{
|
||||
// TODO possibility to add external module constraint
|
||||
$elements = array('product_price','product_price_min','product_lang','categorie_product');
|
||||
|
||||
foreach($elements as $table)
|
||||
@ -588,13 +589,14 @@ class Product extends CommonObject
|
||||
$result = $this->db->query($sql);
|
||||
}
|
||||
|
||||
$sqlz = "DELETE from ".MAIN_DB_PREFIX."product";
|
||||
$sqlz = "DELETE FROM ".MAIN_DB_PREFIX."product";
|
||||
$sqlz.= " WHERE rowid = ".$id;
|
||||
$resultz = $this->db->query($sqlz);
|
||||
|
||||
if ( !$resultz )
|
||||
if ( ! $resultz )
|
||||
{
|
||||
dol_syslog('Product::delete error sqlz='.$sqlz, LOG_ERR);
|
||||
$error++;
|
||||
}
|
||||
|
||||
// Appel des triggers
|
||||
|
||||
@ -1028,7 +1028,7 @@ if ($id || $ref)
|
||||
$picto=($product->type==1?'service':'product');
|
||||
dol_fiche_head($head, 'card', $titre, 0, $picto);
|
||||
|
||||
// Confirmation de la suppression de la facture
|
||||
// Confirm delete product
|
||||
if ($action == 'delete' || ($conf->use_javascript_ajax && $conf->global->MAIN_CONFIRM_AJAX))
|
||||
{
|
||||
$ret=$html->form_confirm("fiche.php?id=".$product->id,$langs->trans("DeleteProduct"),$langs->trans("ConfirmDeleteProduct"),"confirm_delete",'',0,"action-delete");
|
||||
|
||||
@ -234,10 +234,7 @@ if ($resql)
|
||||
llxHeader('',$title,$helpurl,'');
|
||||
|
||||
// Displays product removal confirmation
|
||||
if (!empty($_GET['delprod']))
|
||||
{
|
||||
print '<div class="warning">'.$langs->trans("ProductDeleted",$_GET['delprod']).'</div><br>';
|
||||
}
|
||||
if (GETPOST('delprod')) dol_htmloutput_mesg($langs->trans("ProductDeleted",GETPOST('delprod')));
|
||||
|
||||
$param="&sref=".$sref.($sbarcode?"&sbarcode=".$sbarcode:"")."&snom=".$snom."&sall=".$sall."&tosell=".$tosell."&tobuy=".$tobuy;
|
||||
$param.=($fourn_id?"&fourn_id=".$fourn_id:"");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user