コード例 #1
0
/**
 * $Id$
 *
 * @package    Mediboard
 * @subpackage forms
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision$
 */
CCanDo::checkEdit();
$ex_class_field_id = CValue::get("ex_class_field_id");
$form_name = CValue::get("form_name");
$value = CValue::get("value");
$ex_class_field = new CExClassField();
$ex_class_field->load($ex_class_field_id);
$ex_class_id = $ex_class_field->loadRefExGroup()->ex_class_id;
$ex_object = new CExObject($ex_class_id);
$ex_object->{$ex_class_field->name} = $value;
$spec = CExConcept::getConceptSpec($ex_class_field->prop);
if ($spec instanceof CEnumSpec) {
    $ex_class_field->updateEnumSpec($spec);
}
$ex_class_field->readonly = "0";
$ex_class_field->hidden = "0";
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("ex_field", $ex_class_field);
$smarty->assign("ex_object", $ex_object);
$smarty->assign("form", $form_name);
$smarty->assign("is_predicate", true);
$smarty->display("inc_ex_object_field.tpl");
コード例 #2
0
<?php

/**
 * $Id$
 *
 * @package    Mediboard
 * @subpackage forms
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision$
 */
CCanDo::checkEdit();
$concept_id = CValue::get("concept_id");
$concept = new CExConcept();
$concept->load($concept_id);
$concept->loadView();
$list_owner = $concept->getRealListOwner();
$list_owner->loadView();
$list_owner->loadRefItems();
$spec = CExConcept::getConceptSpec($concept->prop);
if ($spec instanceof CEnumSpec) {
    $list_owner->updateEnumSpec($spec);
}
$smarty = new CSmartyDP();
$smarty->assign("concept", $concept);
$smarty->assign("spec", $spec);
$smarty->display("inc_concept_value_choser.tpl");
コード例 #3
0
}
$prop = stripslashes($prop);
$prop_type = explode(" ", $prop);
$prop_type = reset($prop_type);
if ($spec_type) {
    if (!array_key_exists($prop_type, CMbFieldSpecFact::$classes)) {
        $prop = "{$spec_type} {$prop}";
    } else {
        if (strpos($prop, " ") !== false) {
            $prop = $spec_type . " " . substr($prop, strpos($prop, " ") + 1);
        } else {
            $prop = $spec_type;
        }
    }
}
$spec = CExConcept::getConceptSpec($prop);
if (!$spec->prop) {
    CAppUI::stepMessage(UI_MSG_ALERT, "Enregistrez le champ avant de pouvoir changer les propriétés");
    return;
}
// UGLY hack because of the default value of the Boolspec
if ($spec instanceof CBoolSpec && strpos($prop, "default|") === false) {
    $spec->default = null;
}
if ($spec instanceof CEnumSpec || $spec instanceof CBoolSpec) {
    if ($spec->typeEnum === null || !in_array($spec->typeEnum, $spec->_options["typeEnum"])) {
        $spec->typeEnum = reset($spec->_options["typeEnum"]);
    }
}
$exclude = array("confidential", "mask", "format", "reported", "perm", "seekable", "pattern", "autocomplete", "cascade", "delimiter", "canonical", "protected", "class", "alphaAndNum", "byteUnit", "length", "loggable");
$boolean = array("notNull", "vertical", "progressive", "cascade");