示例#1
0
     if ($msg = $tag2->store()) {
         CAppUI::setMsg("Ligne {$line_number} : {$msg}", UI_MSG_WARNING);
         continue;
     } else {
         CAppUI::setMsg("{$tag2->_class}-msg-create", UI_MSG_OK);
     }
 }
 // CONCEPT
 $concept_prop = CValue::read($prop_map, CMbString::lower($line["concept_type"]));
 if (!$concept_prop) {
     CAppUI::setMsg("Ligne {$line_number} : type de concept invalide : <strong>{$line['concept_type']}</strong>", UI_MSG_WARNING);
     continue;
 }
 // If list name provided, it needs to exist
 if ($line["list_name"]) {
     $_list = new CExList();
     $_list->name = $line["list_name"];
     if (!$_list->loadMatchingObject()) {
         CAppUI::setMsg("Ligne {$line_number} : nom de liste introuvable : <strong>{$line['list_name']}</strong>", UI_MSG_WARNING);
         continue;
     }
 }
 $concept = new CExConcept();
 $ds = $concept->_spec->ds;
 $where = array("name" => $ds->prepare("=%", $line["concept_name"]));
 $concept->loadObject($where);
 if (!$concept->_id) {
     if ($_list && $_list->_id && $line["list_name"]) {
         $concept->ex_list_id = $_list->_id;
         if ($_list->multiple) {
             $concept_prop = "set vertical|1 typeEnum|checkbox";
<?php

/**
 * $Id$
 *  
 * @category Forms
 * @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
 */
$list_id = CValue::get("list_id");
$list = new CExList();
$list->load($list_id);
$list->loadRefItems();
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("list", $list);
$smarty->display("inc_ex_list_info.tpl");
示例#3
0
foreach ($list_elements as $_list_element) {
    $_id = $_list_element->getAttribute("id");
    $_elements = $import->getElementsByFwdRef("CExListItem", "list_id", $_id);
    $_elements_values = array();
    foreach ($_elements as $_element) {
        $_elements_values[] = CMbXMLObjectImport::getValuesFromElement($_element);
    }
    /** @var CExList[] $_similar */
    $_similar = $import->getSimilarFromElement($_list_element);
    $lists[$_list_element->getAttribute("id")] = array("values" => CMbXMLObjectImport::getValuesFromElement($_list_element), "similar" => $_similar, "elements" => $_elements_values);
}
$sortfunc = function ($a, $b) {
    return strcasecmp($a["values"]["name"], $b["values"]["name"]);
};
uasort($lists, $sortfunc);
$list = new CExList();
/** @var CExList[] $all_lists */
$all_lists = $list->loadGroupList(null, "name");
$concept_elements = $import->getElementsbyClass("CExConcept");
$concepts = array();
foreach ($concept_elements as $_concept_element) {
    $_values = CMbXMLObjectImport::getValuesFromElement($_concept_element);
    $_spec = explode(" ", $_values["prop"]);
    $concepts[$_concept_element->getAttribute("id")] = array("values" => CMbXMLObjectImport::getValuesFromElement($_concept_element), "similar" => $import->getSimilarFromElement($_concept_element), "spec_type" => $_spec[0]);
}
uasort($concepts, $sortfunc);
$concept = new CExConcept();
$all_concepts = $concept->loadGroupList(null, "name");
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("ex_class_name", $ex_class_name);
$prop = CValue::get("prop");
$spec_type = CValue::get("_spec_type");
$form_name = CValue::get("form_name");
$context_guid = CValue::get("context_guid");
$ex_concept_id = CValue::get("ex_concept_id");
// Cas du choix d'une liste
$concept_type = CValue::get("_concept_type");
$ex_list_id = CValue::get("ex_list_id");
$multiple = CValue::get("_multiple");
/** @var CExListItemsOwner $context */
$context = CMbObject::loadFromGuid($context_guid);
$context->loadView();
$list_owner = $context->getRealListOwner();
$list_owner->loadView();
if ($concept_type == "list" && !$ex_concept_id && $context instanceof CExConcept) {
    $ex_list = new CExList();
    $ex_list->load($ex_list_id);
    $ex_list_items = $ex_list->loadRefItems();
    $prop = ($multiple ? "set" : "enum") . " list|" . implode("|", CMbArray::pluck($ex_list_items, "_id"));
}
$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;