} else { // $this->arrAssetModels = array(); // $arrAssetModels = AssetModel::LoadAll(); // foreach($arrAssetModels as $assetModel){ // $newAssetCustomFieldAssetModel = new AssetCustomFieldAssetModel(); // $newAssetCustomFieldAssetModel->CustomFieldId = $this->objCustomField->CustomFieldId; // $newAssetCustomFieldAssetModel->AssetModelId = $assetModel->AssetModelId; // array_push($this->arrAssetModels,$newAssetCustomFieldAssetModel); // } $this->DeleteAssetCustomFieldAssetModels(); } // Adding new assigned Model Assets $arrCurrentAssetModels = AssetCustomFieldAssetModel::LoadArrayByCustomFieldId($this->objCustomField->CustomFieldId); foreach ($this->arrAssetModels as $newAssetModel) { $blnExists = false; foreach ($arrCurrentAssetModels as $currentAssetModel) { if ($newAssetModel->AssetModelId == $currentAssetModel->AssetModelId) { $blnExists = true; break; } } if (!$blnExists) { $newAssetModel->Save(); } } } } // Go ahead and run this form object to render the page and its event handlers, using // generated/custom_field_edit.php.inc as the included HTML template file CustomFieldEditForm::Run('CustomFieldEditForm', __DOCROOT__ . __SUBDIRECTORY__ . '/admin/custom_field_edit.tpl.php');
// Include prepend.inc to load Qcodo require '../includes/prepend.inc.php'; /* if you DO NOT have "includes/" in your include_path */ // require('prepend.inc.php'); /* if you DO have "includes/" in your include_path */ // Include the classfile for CustomFieldEditFormBase require __FORMBASE_CLASSES__ . '/CustomFieldEditFormBase.class.php'; // Security check for ALLOW_REMOTE_ADMIN // To allow access REGARDLESS of ALLOW_REMOTE_ADMIN, simply remove the line below QApplication::CheckRemoteAdmin(); /** * This is a quick-and-dirty draft form object to do Create, Edit, and Delete functionality * of the CustomField class. It extends from the code-generated * abstract CustomFieldEditFormBase class. * * Any display customizations and presentation-tier logic can be implemented * here by overriding existing or implementing new methods, properties and variables. * * Additional qform control objects can also be defined and used here, as well. * * @package My Application * @subpackage FormDraftObjects * */ class CustomFieldEditForm extends CustomFieldEditFormBase { } // Go ahead and run this form object to render the page and its event handlers, using // generated/custom_field_edit.tpl.php as the included HTML template file CustomFieldEditForm::Run('CustomFieldEditForm', 'generated/custom_field_edit.tpl.php');