예제 #1
0
    case "str_to_text":
        $where = array("prop" => "LIKE 'str%'");
        $concept = new CExConcept();
        $str_concepts = $concept->loadList($where);
        foreach ($str_concepts as $_concept) {
            $_concept->prop = preg_replace("/^(str)/", "text", $_concept->prop);
            if ($msg = $_concept->store()) {
                CAppUI::setMsg($msg, UI_MSG_WARNING);
            } else {
                CAppUI::setMsg("Concept modifié", UI_MSG_OK);
            }
        }
        if (count($str_concepts) == 0) {
            CAppUI::setMsg("Aucun concept modifié", UI_MSG_OK);
        }
        $ex_field = new CExClassField();
        $str_fields = $ex_field->loadList($where);
        foreach ($str_fields as $_field) {
            $_field->prop = preg_replace("/^(str)/", "text", $_field->prop);
            if ($msg = $_field->store()) {
                CAppUI::setMsg($msg, UI_MSG_WARNING);
            } else {
                CAppUI::setMsg("Champ modifié", UI_MSG_OK);
            }
        }
        if (count($str_fields) == 0) {
            CAppUI::setMsg("Aucun champ modifié", UI_MSG_OK);
        }
        break;
}
echo CAppUI::getMsg();