/** * @see parent::store() */ function store() { $is_new = !$this->_id; if ($msg = parent::store()) { return $msg; } if ($is_new || $this->fieldModified("name")) { CExObject::clearLocales(); } return null; }
<?php /** * $Id$ * * @category CCAM * @package Mediboard * @author SARL OpenXtrem <*****@*****.**> * @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html * @version $Revision$ * @link http://www.mediboard.org */ $count = CExObject::clearLocales(); CAppUI::stepAjax("module-forms-msg-cache-ex_class-suppr", UI_MSG_OK, $count);
/** * @see parent::store() */ function store() { if ($msg = parent::store()) { return $msg; } CExObject::clearLocales(); return null; }
/** * Duplicates the object * * - field_groups * - class_fields * - field_translations * - list_items * - ex_triggers * - (predicates) * * - host_fields * - class_messages * * - constraints * - ex_triggers * * @return null|string Store-like message */ function duplicate() { if (!$this->_id) { return null; } // Load all field values $this->load(); $new = new self(); $new->cloneFrom($this); $new->name .= " (Copie)"; $new->_dont_create_default_group = true; $this->_duplication_mapping = array(); if ($msg = $new->store()) { return $msg; } // field_groups foreach ($this->loadRefsGroups() as $_group) { if ($msg = $this->duplicateObject($_group, "ex_class_id", $new->_id, $_new_group)) { continue; } $fwd_field = "ex_group_id"; $fwd_value = $_new_group->_id; // class_fields foreach ($_group->loadRefsFields() as $_field) { $_exclude_fields = array("predicate_id", "subgroup_id"); if ($msg = $this->duplicateObject($_field, "ex_group_id", $_new_group->_id, $_new_field, $_exclude_fields)) { continue; } $_fwd_field = "ex_class_field_id"; $_fwd_value = $_new_field->_id; // field_translations $this->duplicateBackRefs($_field, "field_translations", $_fwd_field, $_fwd_value); // list_items $this->duplicateBackRefs($_field, "list_items", "field_id", $_fwd_value); // ex_triggers $this->duplicateBackRefs($_field, "ex_triggers", $_fwd_field, $_fwd_value); // predicates //$this->duplicateBackRefs($_field, "predicates", $_fwd_field, $_fwd_value); } // host_fields $this->duplicateBackRefs($_group, "host_fields", $fwd_field, $fwd_value); // class_messages $this->duplicateBackRefs($_group, "class_messages", $fwd_field, $fwd_value, array("predicate_id", "subgroup_id")); // subgroups $this->duplicateBackRefs($_group, "subgroups", "parent_id", $fwd_value, array("predicate_id", "subgroup_id")); } // ex_triggers $this->duplicateBackRefs($this, "ex_triggers", "ex_class_triggered_id", $new->_id); CExObject::clearLocales(); $this->_duplication_mapping = array(); return null; }