diff --git a/copy.php b/copy.php index 2647497..7c8a736 100644 --- a/copy.php +++ b/copy.php @@ -257,6 +257,7 @@ function ReloadAndDisplay($oPage, $oObj, $sMessageId = '', $sMessage = '', $sSev $oP->add("\n"); } $aCurrentValues = array(); + $aTagValues = array(); foreach (MetaModel::ListAttributeDefs(get_class($oObjToClone)) as $sAttCode => $oAttDef) { if (!$oAttDef->IsScalar()) continue; @@ -274,14 +275,63 @@ function ReloadAndDisplay($oPage, $oObj, $sMessageId = '', $sMessage = '', $sSev $aCurrentValues[$sAttCode] = $oObjToClone->Get($sAttCode); } } + + if($oAttDef instanceof AttributeTagSet && $oObjToClone->Get($sAttCode) !== null) { + + /** @var \ormTagSet $oSet Tag set */ + $oSet = $oObjToClone->Get($sAttCode); + $aTagValues[$sAttCode] = $oSet->GetValues(); + + } + } $sCurrentValues = json_encode($aCurrentValues); + $sTagValues = json_encode($aTagValues); + + $oP->add_script( +<<add_ready_script( << Back to details of the object we come from $('#form_2 button.cancel').click( function() { BackToDetails('$sSourceClass', $iSourceId, '')} ); +// Hack: call method to fix tags +$('#form_2').attr('onsubmit', 'TagFixer(); ' + $('#form_2').attr('onsubmit')); + // Hack: add the hidden (preset) fields into the Wizard Helper data (ajax autocomplete and widget reloads) oWizardHelper.ToJSON_original = oWizardHelper.ToJSON; oWizardHelper.ToJSON = function(){