Add a confirmation when cloning products.
This commit is contained in:
parent
8db457217b
commit
bd99870694
@ -62,6 +62,10 @@ EMailTestSubstitutionReplacedByGenericValues=When using test mode, substitutions
|
|||||||
MailingAddFile=Attach this file
|
MailingAddFile=Attach this file
|
||||||
NoAttachedFiles=No attached files
|
NoAttachedFiles=No attached files
|
||||||
BadEMail=Bad value for EMail
|
BadEMail=Bad value for EMail
|
||||||
|
CloneEMailing=Clone Emailing
|
||||||
|
ConfirmCloneEMailing=Are you sure you want to clone this emailing ?
|
||||||
|
CloneContent=Clone message
|
||||||
|
CloneReceivers=Cloner recipients
|
||||||
|
|
||||||
# Libelle des modules de liste de destinataires mailing
|
# Libelle des modules de liste de destinataires mailing
|
||||||
MailingModuleDescContactCompanies=Contacts of all third parties (customer, prospect, supplier, ...)
|
MailingModuleDescContactCompanies=Contacts of all third parties (customer, prospect, supplier, ...)
|
||||||
|
|||||||
@ -108,11 +108,7 @@ Save=Save
|
|||||||
SaveAs=Save As
|
SaveAs=Save As
|
||||||
TestConnection=Test connection
|
TestConnection=Test connection
|
||||||
ToClone=Clone
|
ToClone=Clone
|
||||||
CloneEMailing=Clone Emailing
|
|
||||||
CloneContent=Clone message
|
|
||||||
CloneReceivers=Cloner recipients
|
|
||||||
ConfirmClone=Choose data you want to clone :
|
ConfirmClone=Choose data you want to clone :
|
||||||
ConfirmCloneEMailing=Are you sure you want to clone this emailing ?
|
|
||||||
NoCloneOptionsSpecified=No data to clone defined.
|
NoCloneOptionsSpecified=No data to clone defined.
|
||||||
CopyOf=Copy of
|
CopyOf=Copy of
|
||||||
Show=Show
|
Show=Show
|
||||||
|
|||||||
@ -142,3 +142,7 @@ ServiceNb=Service #%s
|
|||||||
ListProductByPopularity=List of products/services by popularity
|
ListProductByPopularity=List of products/services by popularity
|
||||||
Finished=Manufactured product
|
Finished=Manufactured product
|
||||||
RowMaterial=First material
|
RowMaterial=First material
|
||||||
|
CloneProduct=Clone product or service
|
||||||
|
ConfirmCloneProduct=Are you sure you want to clone product or service <b>%s</b> ?
|
||||||
|
CloneContentProduct=Clone all main informations of product/service
|
||||||
|
ClonePricesProduct=Clone main informations and prices
|
||||||
|
|||||||
@ -62,6 +62,10 @@ EMailTestSubstitutionReplacedByGenericValues=En mode test, les variables de subs
|
|||||||
MailingAddFile=Joindre ce fichier
|
MailingAddFile=Joindre ce fichier
|
||||||
NoAttachedFiles=Aucun fichier joint
|
NoAttachedFiles=Aucun fichier joint
|
||||||
BadEMail=EMail incorrect
|
BadEMail=EMail incorrect
|
||||||
|
CloneEMailing=Cloner Emailing
|
||||||
|
ConfirmCloneEMailing=Etes-vous sur de vouloir cloner cet emailing ?
|
||||||
|
CloneContent=Cloner message
|
||||||
|
CloneReceivers=Cloner destinataires
|
||||||
|
|
||||||
# Libelle des modules de liste de destinataires mailing
|
# Libelle des modules de liste de destinataires mailing
|
||||||
MailingModuleDescContactCompanies=Contacts des tiers (prospects, clients, fournisseurs...)
|
MailingModuleDescContactCompanies=Contacts des tiers (prospects, clients, fournisseurs...)
|
||||||
|
|||||||
@ -108,11 +108,7 @@ Save=Enregistrer
|
|||||||
SaveAs=Enregistrer sous
|
SaveAs=Enregistrer sous
|
||||||
TestConnection=Tester la connexion
|
TestConnection=Tester la connexion
|
||||||
ToClone=Cloner
|
ToClone=Cloner
|
||||||
CloneEMailing=Cloner Emailing
|
|
||||||
CloneContent=Cloner message
|
|
||||||
CloneReceivers=Cloner destinataires
|
|
||||||
ConfirmClone=Veuillez choisir votre option de clonage :
|
ConfirmClone=Veuillez choisir votre option de clonage :
|
||||||
ConfirmCloneEMailing=Etes-vous sur de vouloir cloner cet emailing ?
|
|
||||||
NoCloneOptionsSpecified=Aucun option de clonage n'a été spécifiée.
|
NoCloneOptionsSpecified=Aucun option de clonage n'a été spécifiée.
|
||||||
CopyOf=Copie de
|
CopyOf=Copie de
|
||||||
Show=Voir
|
Show=Voir
|
||||||
|
|||||||
@ -144,3 +144,7 @@ ServiceNb=Service no %s
|
|||||||
ListProductByPopularity=Liste des produits/services par popularité
|
ListProductByPopularity=Liste des produits/services par popularité
|
||||||
Finished=Produit manufacturé
|
Finished=Produit manufacturé
|
||||||
RowMaterial=Matière première
|
RowMaterial=Matière première
|
||||||
|
CloneProduct=Cloner produit/service
|
||||||
|
ConfirmCloneProduct=Etes-vous sur de vouloir cloner le produit ou service <b>%s</b> ?
|
||||||
|
CloneContentProduct=Cloner les informations générales du produit/service uniquement
|
||||||
|
ClonePricesProduct=Cloner les informations générales et les prix
|
||||||
|
|||||||
@ -51,9 +51,11 @@ $result=restrictedArea($user,'produit',$id,'product','','',$fieldid);
|
|||||||
|
|
||||||
$mesg = '';
|
$mesg = '';
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ($_GET["action"] == 'fastappro')
|
if ($_GET["action"] == 'fastappro')
|
||||||
{
|
{
|
||||||
$product = new Product($db);
|
$product = new Product($db);
|
||||||
@ -216,8 +218,14 @@ if ($_POST["action"] == 'update' && $user->rights->produit->creer)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clone a product
|
// Action clone object
|
||||||
if ($_GET["action"] == 'clone' && $user->rights->produit->creer)
|
if ($_POST["action"] == 'confirm_clone' && $_POST['confirm'] == 'yes' && $user->rights->produit->creer)
|
||||||
|
{
|
||||||
|
if (empty($_REQUEST["clone_content"]) && empty($_REQUEST["clone_prices"]))
|
||||||
|
{
|
||||||
|
$mesg='<div class="error">'.$langs->trans("NoCloneOptionsSpecified").'</div>';
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
$db->begin();
|
$db->begin();
|
||||||
|
|
||||||
@ -225,7 +233,7 @@ if ($_GET["action"] == 'clone' && $user->rights->produit->creer)
|
|||||||
$originalId = $_GET["id"];
|
$originalId = $_GET["id"];
|
||||||
if ($product->fetch($_GET["id"]) > 0)
|
if ($product->fetch($_GET["id"]) > 0)
|
||||||
{
|
{
|
||||||
$product->ref = "Clone ".$product->ref;
|
$product->ref = $langs->trans("CopyOf").' '.$product->ref;
|
||||||
$product->status = 0;
|
$product->status = 0;
|
||||||
$product->finished = 1;
|
$product->finished = 1;
|
||||||
$product->id = null;
|
$product->id = null;
|
||||||
@ -269,6 +277,7 @@ if ($_GET["action"] == 'clone' && $user->rights->produit->creer)
|
|||||||
dol_print_error($product->db);
|
dol_print_error($product->db);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Suppression d'un produit/service pas encore affect
|
* Suppression d'un produit/service pas encore affect
|
||||||
@ -1139,6 +1148,21 @@ else if (!$_GET["action"] == 'create')
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Clone confirmation
|
||||||
|
if ($_GET["action"] == 'clone')
|
||||||
|
{
|
||||||
|
// Create an array for form
|
||||||
|
$formquestion=array(
|
||||||
|
'text' => $langs->trans("ConfirmClone"),
|
||||||
|
array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneContentProduct"), 'value' => 1),
|
||||||
|
array('type' => 'checkbox', 'name' => 'clone_prices', 'label' => $langs->trans("ClonePricesProduct").' ('.$langs->trans("FeatureNotYetAvailable").')', 'value' => 0, 'disabled' => true)
|
||||||
|
);
|
||||||
|
// Paiement incomplet. On demande si motif = escompte ou autre
|
||||||
|
$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$product->id,$langs->trans('CloneProduct'),$langs->trans('ConfirmCloneProduct',$product->ref),'confirm_clone',$formquestion,'yes');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
/* */
|
/* */
|
||||||
/* Barre d'action */
|
/* Barre d'action */
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user