Fix standardize 'createfromclone' param when cloning
This commit is contained in:
parent
b3cbbc1b11
commit
2bbaae88d6
@ -1418,6 +1418,7 @@ class BookKeeping extends CommonObject
|
||||
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||
|
||||
global $user;
|
||||
|
||||
$error = 0;
|
||||
$object = new BookKeeping($this->db);
|
||||
|
||||
@ -1432,6 +1433,7 @@ class BookKeeping extends CommonObject
|
||||
// ...
|
||||
|
||||
// Create clone
|
||||
$object->context['createfromclone'] = 'createfromclone';
|
||||
$result = $object->create($user);
|
||||
|
||||
// Other options
|
||||
@ -1441,6 +1443,8 @@ class BookKeeping extends CommonObject
|
||||
dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR);
|
||||
}
|
||||
|
||||
unset($object->context['createfromclone']);
|
||||
|
||||
// End
|
||||
if (! $error) {
|
||||
$this->db->commit();
|
||||
@ -1449,7 +1453,7 @@ class BookKeeping extends CommonObject
|
||||
} else {
|
||||
$this->db->rollback();
|
||||
|
||||
return - 1;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -238,6 +238,8 @@ class Asset extends CommonObject
|
||||
$this->errors = $object->errors;
|
||||
}
|
||||
|
||||
unset($object->context['createfromclone']);
|
||||
|
||||
// End
|
||||
if (!$error) {
|
||||
$this->db->commit();
|
||||
|
||||
@ -490,8 +490,6 @@ class ActionComm extends CommonObject
|
||||
{
|
||||
global $db, $user, $langs, $conf, $hookmanager;
|
||||
|
||||
$this->context['createfromclone']='createfromclone';
|
||||
|
||||
$error=0;
|
||||
$now=dol_now();
|
||||
|
||||
@ -524,7 +522,8 @@ class ActionComm extends CommonObject
|
||||
}
|
||||
|
||||
// Create clone
|
||||
$result=$this->create($fuser);
|
||||
$this->context['createfromclone']='createfromclone';
|
||||
$result=$this->create($fuser);
|
||||
if ($result < 0) $error++;
|
||||
|
||||
if (! $error)
|
||||
|
||||
@ -279,8 +279,6 @@ class Mailing extends CommonObject
|
||||
|
||||
$object=new Mailing($this->db);
|
||||
|
||||
$object->context['createfromclone']='createfromclone';
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
// Load source object
|
||||
@ -314,6 +312,7 @@ class Mailing extends CommonObject
|
||||
}
|
||||
|
||||
// Create clone
|
||||
$object->context['createfromclone']='createfromclone';
|
||||
$result=$object->create($user);
|
||||
|
||||
// Other options
|
||||
@ -345,7 +344,6 @@ class Mailing extends CommonObject
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."mailing_cibles ";
|
||||
$sql.= " WHERE fk_mailing = ".$fromid;
|
||||
|
||||
dol_syslog(get_class($this)."::createFromClone", LOG_DEBUG);
|
||||
$result=$this->db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
|
||||
@ -1222,8 +1222,6 @@ class Propal extends CommonObject
|
||||
|
||||
dol_include_once('/projet/class/project.class.php');
|
||||
|
||||
$this->context['createfromclone']='createfromclone';
|
||||
|
||||
$error=0;
|
||||
$now=dol_now();
|
||||
|
||||
@ -1284,6 +1282,7 @@ class Propal extends CommonObject
|
||||
if (empty($conf->global->MAIN_KEEP_REF_CUSTOMER_ON_CLONING)) $clonedObj->ref_client = '';
|
||||
|
||||
// Create clone
|
||||
$this->context['createfromclone']='createfromclone';
|
||||
$result=$clonedObj->create($user);
|
||||
if ($result < 0) $error++;
|
||||
else
|
||||
|
||||
@ -1066,8 +1066,6 @@ class Commande extends CommonOrder
|
||||
|
||||
$error=0;
|
||||
|
||||
$this->context['createfromclone'] = 'createfromclone';
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
// get lines so they will be clone
|
||||
@ -1108,6 +1106,7 @@ class Commande extends CommonOrder
|
||||
$this->ref_client = '';
|
||||
|
||||
// Create clone
|
||||
$this->context['createfromclone'] = 'createfromclone';
|
||||
$result=$this->create($user);
|
||||
if ($result < 0) $error++;
|
||||
|
||||
|
||||
@ -280,8 +280,6 @@ class BankCateg // extends CommonObject
|
||||
|
||||
$object = new BankCateg($this->db);
|
||||
|
||||
$object->context['createfromclone'] = 'createfromclone';
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
// Load source object
|
||||
@ -290,6 +288,7 @@ class BankCateg // extends CommonObject
|
||||
$object->statut = 0;
|
||||
|
||||
// Create clone
|
||||
$object->context['createfromclone'] = 'createfromclone';
|
||||
$result = $object->create($user);
|
||||
|
||||
// Other options
|
||||
|
||||
@ -951,8 +951,6 @@ class Facture extends CommonInvoice
|
||||
|
||||
$error=0;
|
||||
|
||||
$this->context['createfromclone'] = 'createfromclone';
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
// get extrafields so they will be clone
|
||||
@ -962,8 +960,6 @@ class Facture extends CommonInvoice
|
||||
// Load source object
|
||||
$objFrom = clone $this;
|
||||
|
||||
|
||||
|
||||
// Change socid if needed
|
||||
if (! empty($socid) && $socid != $this->socid)
|
||||
{
|
||||
@ -1008,6 +1004,7 @@ class Facture extends CommonInvoice
|
||||
}
|
||||
|
||||
// Create clone
|
||||
$this->context['createfromclone'] = 'createfromclone';
|
||||
$result=$this->create($user);
|
||||
if ($result < 0) $error++;
|
||||
else {
|
||||
|
||||
@ -404,8 +404,6 @@ class PaymentTerm // extends CommonObject
|
||||
|
||||
$object=new PaymentTerm($this->db);
|
||||
|
||||
$object->context['createfromclone'] = 'createfromclone';
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
// Load source object
|
||||
@ -417,6 +415,7 @@ class PaymentTerm // extends CommonObject
|
||||
// ...
|
||||
|
||||
// Create clone
|
||||
$object->context['createfromclone'] = 'createfromclone';
|
||||
$result=$object->create($user);
|
||||
|
||||
// Other options
|
||||
@ -430,7 +429,7 @@ class PaymentTerm // extends CommonObject
|
||||
//{
|
||||
//}
|
||||
|
||||
unset($this->context['createfromclone']);
|
||||
unset($object->context['createfromclone']);
|
||||
|
||||
// End
|
||||
if (! $error)
|
||||
|
||||
@ -369,6 +369,7 @@ class Cchargesociales
|
||||
// ...
|
||||
|
||||
// Create clone
|
||||
$this->context['createfromclone'] = 'createfromclone';
|
||||
$result = $object->create($user);
|
||||
|
||||
// Other options
|
||||
@ -378,6 +379,8 @@ class Cchargesociales
|
||||
dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR);
|
||||
}
|
||||
|
||||
unset($this->context['createfromclone']);
|
||||
|
||||
// End
|
||||
if (!$error) {
|
||||
$this->db->commit();
|
||||
@ -386,7 +389,7 @@ class Cchargesociales
|
||||
} else {
|
||||
$this->db->rollback();
|
||||
|
||||
return - 1;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -459,8 +459,6 @@ class PaymentSocialContribution extends CommonObject
|
||||
|
||||
$object=new PaymentSocialContribution($this->db);
|
||||
|
||||
$object->context['createfromclone'] = 'createfromclone';
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
// Load source object
|
||||
@ -472,6 +470,7 @@ class PaymentSocialContribution extends CommonObject
|
||||
// ...
|
||||
|
||||
// Create clone
|
||||
$object->context['createfromclone'] = 'createfromclone';
|
||||
$result=$object->create($user);
|
||||
|
||||
// Other options
|
||||
@ -488,7 +487,7 @@ class PaymentSocialContribution extends CommonObject
|
||||
|
||||
}
|
||||
|
||||
unset($this->context['createfromclone']);
|
||||
unset($object->context['createfromclone']);
|
||||
|
||||
// End
|
||||
if (! $error)
|
||||
|
||||
@ -2388,8 +2388,6 @@ class Contrat extends CommonObject
|
||||
|
||||
dol_include_once('/projet/class/project.class.php');
|
||||
|
||||
$this->context['createfromclone'] = 'createfromclone';
|
||||
|
||||
$error = 0;
|
||||
|
||||
$this->fetch($this->id);
|
||||
@ -2440,6 +2438,7 @@ class Contrat extends CommonObject
|
||||
}
|
||||
|
||||
// Create clone
|
||||
$clonedObj->context['createfromclone'] = 'createfromclone';
|
||||
$result = $clonedObj->create($user);
|
||||
if ($result < 0) {
|
||||
$error ++;
|
||||
@ -2479,7 +2478,7 @@ class Contrat extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
unset($this->context['createfromclone']);
|
||||
unset($clonedObj->context['createfromclone']);
|
||||
|
||||
// End
|
||||
if (! $error) {
|
||||
|
||||
@ -202,7 +202,7 @@ if ($action == 'confirm_clone' && $confirm == 'yes' && ! empty($permissiontoadd)
|
||||
{
|
||||
if ($object->id > 0)
|
||||
{
|
||||
// Because createFromClone modifies the object, we must clone it so that we can restore it later
|
||||
// Because createFromClone modifies the object, we must clone it so that we can restore it later if error
|
||||
$orig = clone $object;
|
||||
|
||||
$result=$object->createFromClone($user, $object->id);
|
||||
|
||||
@ -427,6 +427,7 @@ class Ctyperesource
|
||||
// ...
|
||||
|
||||
// Create clone
|
||||
$object->context['createfromclone'] = 'createfromclone';
|
||||
$result = $object->create($user);
|
||||
|
||||
// Other options
|
||||
@ -436,6 +437,8 @@ class Ctyperesource
|
||||
dol_syslog(__METHOD__ . ' ' . implode(',', $this->errors), LOG_ERR);
|
||||
}
|
||||
|
||||
unset($object->context['createfromclone']);
|
||||
|
||||
// End
|
||||
if (!$error) {
|
||||
$this->db->commit();
|
||||
@ -444,7 +447,7 @@ class Ctyperesource
|
||||
} else {
|
||||
$this->db->rollback();
|
||||
|
||||
return - 1;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -207,6 +207,8 @@ class EmailSenderProfile extends CommonObject
|
||||
$this->errors = $object->errors;
|
||||
}
|
||||
|
||||
unset($object->context['createfromclone']);
|
||||
|
||||
// End
|
||||
if (!$error) {
|
||||
$this->db->commit();
|
||||
|
||||
@ -757,8 +757,6 @@ class Cronjob extends CommonObject
|
||||
|
||||
$object=new Cronjob($this->db);
|
||||
|
||||
$object->context['createfromclone'] = 'createfromclone';
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
// Load source object
|
||||
@ -770,6 +768,7 @@ class Cronjob extends CommonObject
|
||||
// ...
|
||||
|
||||
// Create clone
|
||||
$object->context['createfromclone'] = 'createfromclone';
|
||||
$result=$object->create($user);
|
||||
|
||||
// Other options
|
||||
@ -782,10 +781,9 @@ class Cronjob extends CommonObject
|
||||
//if (! $error)
|
||||
//{
|
||||
|
||||
|
||||
//}
|
||||
|
||||
unset($this->context['createfromclone']);
|
||||
unset($object->context['createfromclone']);
|
||||
|
||||
// End
|
||||
if (! $error)
|
||||
|
||||
@ -419,8 +419,6 @@ class PaymentDonation extends CommonObject
|
||||
|
||||
$object=new PaymentDonation($this->db);
|
||||
|
||||
$object->context['createfromclone'] = 'createfromclone';
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
// Load source object
|
||||
@ -432,6 +430,7 @@ class PaymentDonation extends CommonObject
|
||||
// ...
|
||||
|
||||
// Create clone
|
||||
$object->context['createfromclone'] = 'createfromclone';
|
||||
$result=$object->create($user);
|
||||
|
||||
// Other options
|
||||
@ -444,11 +443,9 @@ class PaymentDonation extends CommonObject
|
||||
if (! $error)
|
||||
{
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
unset($this->context['createfromclone']);
|
||||
unset($object->context['createfromclone']);
|
||||
|
||||
// End
|
||||
if (! $error)
|
||||
|
||||
@ -732,6 +732,7 @@ class EcmFiles extends CommonObject
|
||||
// ...
|
||||
|
||||
// Create clone
|
||||
$object->context['createfromclone'] = 'createfromclone';
|
||||
$result = $object->create($user);
|
||||
|
||||
// Other options
|
||||
@ -741,6 +742,8 @@ class EcmFiles extends CommonObject
|
||||
dol_syslog(__METHOD__ . ' ' . implode(',', $this->errors), LOG_ERR);
|
||||
}
|
||||
|
||||
unset($object->context['createfromclone']);
|
||||
|
||||
// End
|
||||
if (!$error) {
|
||||
$this->db->commit();
|
||||
|
||||
@ -274,6 +274,8 @@ class EmailCollector extends CommonObject
|
||||
$this->errors = $object->errors;
|
||||
}
|
||||
|
||||
unset($object->context['createfromclone']);
|
||||
|
||||
// End
|
||||
if (!$error) {
|
||||
$this->db->commit();
|
||||
|
||||
@ -247,6 +247,8 @@ class EmailCollectorAction extends CommonObject
|
||||
$this->errors = $object->errors;
|
||||
}
|
||||
|
||||
unset($object->context['createfromclone']);
|
||||
|
||||
// End
|
||||
if (!$error) {
|
||||
$this->db->commit();
|
||||
|
||||
@ -222,6 +222,8 @@ class EmailCollectorFilter extends CommonObject
|
||||
$this->errors = $object->errors;
|
||||
}
|
||||
|
||||
unset($object->context['createfromclone']);
|
||||
|
||||
// End
|
||||
if (!$error) {
|
||||
$this->db->commit();
|
||||
|
||||
@ -315,8 +315,6 @@ class ExpenseReport extends CommonObject
|
||||
|
||||
if (empty($fk_user_author)) $fk_user_author = $user->id;
|
||||
|
||||
$this->context['createfromclone'] = 'createfromclone';
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
// get extrafields so they will be clone
|
||||
@ -339,6 +337,7 @@ class ExpenseReport extends CommonObject
|
||||
$this->date_validation = '';
|
||||
|
||||
// Create clone
|
||||
$this->context['createfromclone'] = 'createfromclone';
|
||||
$result=$this->create($user);
|
||||
if ($result < 0) $error++;
|
||||
|
||||
|
||||
@ -421,8 +421,6 @@ class PaymentExpenseReport extends CommonObject
|
||||
|
||||
$object=new PaymentExpenseReport($this->db);
|
||||
|
||||
$object->context['createfromclone'] = 'createfromclone';
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
// Load source object
|
||||
@ -434,6 +432,7 @@ class PaymentExpenseReport extends CommonObject
|
||||
// ...
|
||||
|
||||
// Create clone
|
||||
$object->context['createfromclone'] = 'createfromclone';
|
||||
$result=$object->create($user);
|
||||
|
||||
// Other options
|
||||
@ -446,11 +445,9 @@ class PaymentExpenseReport extends CommonObject
|
||||
if (! $error)
|
||||
{
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
unset($this->context['createfromclone']);
|
||||
unset($object->context['createfromclone']);
|
||||
|
||||
// End
|
||||
if (! $error)
|
||||
|
||||
@ -1118,8 +1118,6 @@ class Fichinter extends CommonObject
|
||||
|
||||
$error=0;
|
||||
|
||||
$this->context['createfromclone'] = 'createfromclone';
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
// get extrafields so they will be clone
|
||||
@ -1158,6 +1156,7 @@ class Fichinter extends CommonObject
|
||||
$this->ref_client = '';
|
||||
|
||||
// Create clone
|
||||
$this->context['createfromclone'] = 'createfromclone';
|
||||
$result=$this->create($user);
|
||||
if ($result < 0) $error++;
|
||||
|
||||
|
||||
@ -1417,8 +1417,6 @@ class CommandeFournisseur extends CommonOrder
|
||||
|
||||
$error=0;
|
||||
|
||||
$this->context['createfromclone'] = 'createfromclone';
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
// Load source object
|
||||
@ -1439,6 +1437,7 @@ class CommandeFournisseur extends CommonOrder
|
||||
$this->date_approve2 = '';
|
||||
|
||||
// Create clone
|
||||
$this->context['createfromclone'] = 'createfromclone';
|
||||
$result=$this->create($user);
|
||||
if ($result < 0) $error++;
|
||||
|
||||
|
||||
@ -463,6 +463,7 @@ class CommandeFournisseurDispatch extends CommonObject
|
||||
// ...
|
||||
|
||||
// Create clone
|
||||
$object->context['createfromclone'] = 'createfromclone';
|
||||
$result=$object->create($user);
|
||||
|
||||
// Other options
|
||||
@ -475,9 +476,10 @@ class CommandeFournisseurDispatch extends CommonObject
|
||||
if (! $error)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
unset($object->context['createfromclone']);
|
||||
|
||||
// End
|
||||
if (! $error)
|
||||
{
|
||||
|
||||
@ -2489,8 +2489,6 @@ class FactureFournisseur extends CommonInvoice
|
||||
|
||||
$object=new FactureFournisseur($this->db);
|
||||
|
||||
$object->context['createfromclone'] = 'createfromclone';
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
// Load source object
|
||||
@ -2521,6 +2519,7 @@ class FactureFournisseur extends CommonInvoice
|
||||
}
|
||||
|
||||
// Create clone
|
||||
$object->context['createfromclone'] = 'createfromclone';
|
||||
$result=$object->create($user);
|
||||
|
||||
// Other options
|
||||
@ -2533,8 +2532,6 @@ class FactureFournisseur extends CommonInvoice
|
||||
if (! $error)
|
||||
{
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
unset($object->context['createfromclone']);
|
||||
|
||||
@ -276,6 +276,8 @@ class MyObject extends CommonObject
|
||||
$this->errors = $object->errors;
|
||||
}
|
||||
|
||||
unset($object->context['createfromclone']);
|
||||
|
||||
// End
|
||||
if (!$error) {
|
||||
$this->db->commit();
|
||||
|
||||
@ -338,8 +338,6 @@ class Productbatch extends CommonObject
|
||||
|
||||
$object=new Productbatch($this->db);
|
||||
|
||||
$object->context['createfromclone']='createfromclone';
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
// Load source object
|
||||
@ -351,6 +349,7 @@ class Productbatch extends CommonObject
|
||||
// ...
|
||||
|
||||
// Create clone
|
||||
$object->context['createfromclone']='createfromclone';
|
||||
$result=$object->create($user);
|
||||
|
||||
// Other options
|
||||
@ -363,7 +362,6 @@ class Productbatch extends CommonObject
|
||||
if (! $error)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
unset($object->context['createfromclone']);
|
||||
|
||||
@ -907,8 +907,6 @@ class Productcustomerprice extends CommonObject
|
||||
|
||||
$object = new Productcustomerprice($this->db);
|
||||
|
||||
$object->context['createfromclone']='createfromclone';
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
// Load source object
|
||||
@ -920,6 +918,7 @@ class Productcustomerprice extends CommonObject
|
||||
// ...
|
||||
|
||||
// Create clone
|
||||
$object->context['createfromclone']='createfromclone';
|
||||
$result = $object->create($user);
|
||||
|
||||
// Other options
|
||||
@ -929,6 +928,7 @@ class Productcustomerprice extends CommonObject
|
||||
}
|
||||
|
||||
if (! $error) {
|
||||
|
||||
}
|
||||
|
||||
unset($object->context['createfromclone']);
|
||||
|
||||
@ -582,6 +582,7 @@ class Propalmergepdfproduct extends CommonObject
|
||||
// ...
|
||||
|
||||
// Create clone
|
||||
$object->context['createfromclone']='createfromclone';
|
||||
$result=$object->create($user);
|
||||
|
||||
// Other options
|
||||
@ -594,9 +595,10 @@ class Propalmergepdfproduct extends CommonObject
|
||||
if (! $error)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
unset($object->context['createfromclone']);
|
||||
|
||||
// End
|
||||
if (! $error)
|
||||
{
|
||||
|
||||
@ -247,6 +247,8 @@ class Inventory extends CommonObject
|
||||
$this->errors = $object->errors;
|
||||
}
|
||||
|
||||
unset($object->context['createfromclone']);
|
||||
|
||||
// End
|
||||
if (!$error) {
|
||||
$this->db->commit();
|
||||
|
||||
@ -454,6 +454,7 @@ class Productlot extends CommonObject
|
||||
// ...
|
||||
|
||||
// Create clone
|
||||
$object->context['createfromclone'] = 'createfromclone';
|
||||
$result = $object->create($user);
|
||||
|
||||
// Other options
|
||||
@ -463,6 +464,8 @@ class Productlot extends CommonObject
|
||||
dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR);
|
||||
}
|
||||
|
||||
unset($object->context['createfromclone']);
|
||||
|
||||
// End
|
||||
if (!$error) {
|
||||
$this->db->commit();
|
||||
|
||||
@ -443,6 +443,7 @@ class ProductStockEntrepot extends CommonObject
|
||||
// ...
|
||||
|
||||
// Create clone
|
||||
$object->context['createfromclone'] = 'createfromclone';
|
||||
$result = $object->create($user);
|
||||
|
||||
// Other options
|
||||
@ -452,6 +453,8 @@ class ProductStockEntrepot extends CommonObject
|
||||
dol_syslog(__METHOD__ . ' ' . implode(',', $this->errors), LOG_ERR);
|
||||
}
|
||||
|
||||
unset($object->context['createfromclone']);
|
||||
|
||||
// End
|
||||
if (!$error) {
|
||||
$this->db->commit();
|
||||
|
||||
@ -269,6 +269,8 @@ class CompanyPaymentMode extends CommonObject
|
||||
$this->errors = $object->errors;
|
||||
}
|
||||
|
||||
unset($object->context['createfromclone']);
|
||||
|
||||
// End
|
||||
if (!$error) {
|
||||
$this->db->commit();
|
||||
|
||||
@ -240,6 +240,8 @@ class SocieteAccount extends CommonObject
|
||||
$this->errors = $object->errors;
|
||||
}
|
||||
|
||||
unset($object->context['createfromclone']);
|
||||
|
||||
// End
|
||||
if (!$error) {
|
||||
$this->db->commit();
|
||||
|
||||
@ -1176,6 +1176,7 @@ class SupplierProposal extends CommonObject
|
||||
$this->ref = $modSupplierProposal->getNextValue($objsoc,$this);
|
||||
|
||||
// Create clone
|
||||
$this->context['createfromclone'] = 'createfromclone';
|
||||
$result=$this->create($user);
|
||||
if ($result < 0) $error++;
|
||||
|
||||
@ -1191,6 +1192,8 @@ class SupplierProposal extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
unset($this->context['createfromclone']);
|
||||
|
||||
// End
|
||||
if (! $error)
|
||||
{
|
||||
|
||||
@ -966,6 +966,7 @@ class Ticket extends CommonObject
|
||||
// Clear fields
|
||||
// ...
|
||||
// Create clone
|
||||
$object->context['createfromclone'] = 'createfromclone';
|
||||
$result = $object->create($user);
|
||||
|
||||
// Other options
|
||||
@ -977,6 +978,8 @@ class Ticket extends CommonObject
|
||||
if (!$error) {
|
||||
}
|
||||
|
||||
unset($object->context['createfromclone']);
|
||||
|
||||
// End
|
||||
if (!$error) {
|
||||
$this->db->commit();
|
||||
|
||||
@ -598,6 +598,7 @@ class Website extends CommonObject
|
||||
|
||||
// Create new file
|
||||
$objectpagenew = $objectpageold->createFromClone($user, $pageid, $objectpageold->pageurl, '', 0, $object->id, 1);
|
||||
|
||||
//print $pageid.' = '.$objectpageold->pageurl.' -> '.$objectpagenew->id.' = '.$objectpagenew->pageurl.'<br>';
|
||||
if (is_object($objectpagenew) && $objectpagenew->pageurl)
|
||||
{
|
||||
@ -646,6 +647,8 @@ class Website extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
unset($object->context['createfromclone']);
|
||||
|
||||
// End
|
||||
if (!$error) {
|
||||
$this->db->commit();
|
||||
|
||||
@ -447,6 +447,8 @@ class WebsitePage extends CommonObject
|
||||
dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR);
|
||||
}
|
||||
|
||||
unset($object->context['createfromclone']);
|
||||
|
||||
// End
|
||||
if (!$error) {
|
||||
$this->db->commit();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user