Debug cloning of BOMs
This commit is contained in:
parent
f060ef1018
commit
e17cc5b2e5
@ -294,12 +294,6 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
{
|
{
|
||||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_deleteline', '', 0, 1);
|
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_deleteline', '', 0, 1);
|
||||||
}
|
}
|
||||||
$formconfirm = '';
|
|
||||||
|
|
||||||
// Confirmation to delete
|
|
||||||
if ($action == 'delete') {
|
|
||||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteOrder'), $langs->trans('ConfirmDeleteOrder'), 'confirm_delete', '', 0, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Confirmation of validation
|
// Confirmation of validation
|
||||||
if ($action == 'validate')
|
if ($action == 'validate')
|
||||||
|
|||||||
@ -240,9 +240,10 @@ class BOM extends CommonObject
|
|||||||
unset($object->import_key);
|
unset($object->import_key);
|
||||||
|
|
||||||
// Clear fields
|
// Clear fields
|
||||||
$object->ref = "copy_of_".$object->ref;
|
$object->ref = empty($this->fields['ref']['default']) ? $langs->trans("copy_of_").$object->ref: $this->fields['ref']['default'];
|
||||||
$object->title = $langs->trans("CopyOf")." ".$object->title;
|
$object->label = empty($this->fields['label']['default']) ? $langs->trans("CopyOf")." ".$object->label: $this->fields['label']['default'];
|
||||||
|
$object->status = self::STATUS_DRAFT;
|
||||||
|
// ...
|
||||||
// Clear extrafields that are unique
|
// Clear extrafields that are unique
|
||||||
if (is_array($object->array_options) && count($object->array_options) > 0)
|
if (is_array($object->array_options) && count($object->array_options) > 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -7476,6 +7476,7 @@ abstract class CommonObject
|
|||||||
{
|
{
|
||||||
$sql="UPDATE ".MAIN_DB_PREFIX.$this->table_element." SET ref = '(PROV".$this->id.")' WHERE ref = '(PROV)' AND rowid = ".$this->id;
|
$sql="UPDATE ".MAIN_DB_PREFIX.$this->table_element." SET ref = '(PROV".$this->id.")' WHERE ref = '(PROV)' AND rowid = ".$this->id;
|
||||||
$resqlupdate = $this->db->query($sql);
|
$resqlupdate = $this->db->query($sql);
|
||||||
|
|
||||||
if ($resqlupdate===false)
|
if ($resqlupdate===false)
|
||||||
{
|
{
|
||||||
$error++;
|
$error++;
|
||||||
|
|||||||
@ -283,8 +283,9 @@ class MyObject extends CommonObject
|
|||||||
|
|
||||||
|
|
||||||
// Clear fields
|
// Clear fields
|
||||||
$object->ref = "copy_of_".$object->ref;
|
$object->ref = empty($this->fields['ref']['default']) ? "copy_of_".$object->ref: $this->fields['ref']['default'];
|
||||||
$object->title = $langs->trans("CopyOf")." ".$object->title;
|
$object->label = empty($this->fields['label']['default']) ? $langs->trans("CopyOf")." ".$object->label: $this->fields['label']['default'];
|
||||||
|
$object->status = self::STATUS_DRAFT;
|
||||||
// ...
|
// ...
|
||||||
// Clear extrafields that are unique
|
// Clear extrafields that are unique
|
||||||
if (is_array($object->array_options) && count($object->array_options) > 0)
|
if (is_array($object->array_options) && count($object->array_options) > 0)
|
||||||
|
|||||||
@ -246,10 +246,10 @@ class Mo extends CommonObject
|
|||||||
unset($object->fk_user_creat);
|
unset($object->fk_user_creat);
|
||||||
unset($object->import_key);
|
unset($object->import_key);
|
||||||
|
|
||||||
|
|
||||||
// Clear fields
|
// Clear fields
|
||||||
$object->ref = "copy_of_".$object->ref;
|
$object->ref = empty($this->fields['ref']['default']) ? "copy_of_".$object->ref: $this->fields['ref']['default'];
|
||||||
$object->title = $langs->trans("CopyOf")." ".$object->title;
|
$object->label = empty($this->fields['label']['default']) ? $langs->trans("CopyOf")." ".$object->label: $this->fields['label']['default'];
|
||||||
|
$object->status = self::STATUS_DRAFT;
|
||||||
// ...
|
// ...
|
||||||
// Clear extrafields that are unique
|
// Clear extrafields that are unique
|
||||||
if (is_array($object->array_options) && count($object->array_options) > 0)
|
if (is_array($object->array_options) && count($object->array_options) > 0)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user