本文整理汇总了PHP中FieldList::getFlatAllFields方法的典型用法代码示例。如果您正苦于以下问题:PHP FieldList::getFlatAllFields方法的具体用法?PHP FieldList::getFlatAllFields怎么用?PHP FieldList::getFlatAllFields使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FieldList
的用法示例。
在下文中一共展示了FieldList::getFlatAllFields方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getSubstitution
function getSubstitution()
{
$subs = array();
$aclman =& Docebo::user()->getAclManager();
$user = $aclman->getUser($this->id_user, false);
$subs['[display_name]'] = $user[ACL_INFO_LASTNAME] . $user[ACL_INFO_FIRSTNAME] ? $user[ACL_INFO_LASTNAME] . ' ' . $user[ACL_INFO_FIRSTNAME] : $aclman->relativeId($user[ACL_INFO_USERID]);
$subs['[username]'] = $aclman->relativeId($user[ACL_INFO_USERID]);
$subs['[firstname]'] = $user[ACL_INFO_FIRSTNAME];
$subs['[lastname]'] = $user[ACL_INFO_LASTNAME];
//variable fields
require_once $GLOBALS['where_framework'] . '/lib/lib.field.php';
$temp = new FieldList();
$fields = $temp->getFlatAllFields();
foreach ($fields as $key => $value) {
$subs['[userfield_' . $key . ']'] = $temp->showFieldForUser($this->id_user, $key);
}
return $subs;
}
示例2: array
function get_LO_filter()
{
//addCss('style_filterbox');
$back_url = $this->back_url;
$jump_url = $this->jump_url;
$next_url = $this->next_url;
require_once _base_ . '/lib/lib.form.php';
require_once _lms_ . '/lib/lib.course.php';
$ref =& $_SESSION['report_tempdata']['columns_filter'];
YuiLib::load();
Util::get_js(Get::rel_path('lms') . '/admin/modules/report/courses_filter.js', true, true);
//back to columns category selection
if (isset($_POST['undo_filter'])) {
//go back at the previous step
Util::jump_to($back_url);
}
//set $_POST data in $_SESSION['report_tempdata']
$selector = new Selector_Course();
if (isset($_POST['update_tempdata'])) {
$selector->parseForState($_POST);
$temp = array('all_courses' => $_POST['all_courses'] == 1 ? true : false, 'selected_courses' => $selector->getSelection(), 'lo_types' => isset($_POST['lo_types']) ? $_POST['lo_types'] : array(), 'lo_milestones' => isset($_POST['lo_milestones']) ? $_POST['lo_milestones'] : array(), 'showed_columns' => isset($_POST['cols']) ? $_POST['cols'] : array(), 'custom_fields' => array(), 'order_by' => Get::req('order_by', DOTY_STRING, 'userid'), 'order_dir' => Get::req('order_dir', DOTY_STRING, 'asc'), 'show_suspended' => Get::req('show_suspended', DOTY_INT, 0) > 0);
foreach ($ref['custom_fields'] as $val) {
$temp['custom_fields'][] = array('id' => $val['id'], 'label' => $val['label'], 'selected' => isset($_POST['custom'][$val['id']]) ? true : false);
}
$_SESSION['report_tempdata']['columns_filter'] = $temp;
} else {
//first loading of this page -> prepare $_SESSION data structure
//if (isset($_SESSION['report_update']) /* && is equal to id_report */) break;
//get users' custom fields
require_once _adm_ . '/lib/lib.field.php';
$fman = new FieldList();
$fields = $fman->getFlatAllFields();
$custom = array();
foreach ($fields as $key => $val) {
$custom[] = array('id' => $key, 'label' => $val, 'selected' => false);
}
if (!isset($_SESSION['report_tempdata']['columns_filter'])) {
$_SESSION['report_tempdata']['columns_filter'] = array('all_courses' => false, 'selected_courses' => $selector->getSelection(), 'lo_types' => array(), 'lo_milestones' => array(), 'showed_columns' => array(), 'custom_fields' => $custom, 'order_by' => 'userid', 'order_dir' => 'asc', 'show_suspended' => 'show_suspended');
}
}
//filter setting done, go to next step
if (isset($_POST['import_filter']) || isset($_POST['show_filter']) || isset($_POST['pre_filter'])) {
$temp_url = $next_url;
if (isset($_POST['pre_filter'])) {
$temp_url .= '&show=1&nosave=1';
}
if (isset($_POST['show_filter'])) {
$temp_url .= '&show=1';
}
Util::jump_to($temp_url);
}
cout(Form::getHidden('update_tempdata', 'update_tempdata', 1), 'content');
$lang = $this->lang;
//box for direct course selection
$selection =& $ref['selected_courses'];
$selector->parseForState($_POST);
$selector->resetSelection($selection);
$temp = count($selection);
$box = new ReportBox('course_selector');
$box->title = Lang::t('_REPORT_COURSE_SELECTION', 'report');
$box->description = false;
$box->body .= '<div class="fc_filter_line filter_corr">';
$box->body .= '<input id="all_courses" name="all_courses" type="radio" value="1" ' . ($ref['all_courses'] ? 'checked="checked"' : '') . ' />';
$box->body .= ' <label for="all_courses">' . $lang->def('_ALL_COURSES') . '</label>';
$box->body .= ' <input id="sel_courses" name="all_courses" type="radio" value="0" ' . ($ref['all_courses'] ? '' : 'checked="checked"') . ' />';
$box->body .= ' <label for="sel_courses">' . $lang->def('_SEL_COURSES') . '</label>';
$box->body .= '</div>';
$box->body .= '<div id="selector_container"' . ($ref['all_courses'] ? ' style="display:none"' : '') . '>';
//$box->body .= Form::openElementSpace();
$box->body .= $selector->loadCourseSelector(true);
//$box->body .= Form::closeElementSpace();
$box->body .= '<br /></div>';
$box->footer = $lang->def('_CURRENT_SELECTION') . ': <span id="csel_foot">' . ($ref['all_courses'] ? Lang::t('_ALL', 'standard') : ($temp != '' ? $temp : '0')) . '</span>';
//.'</div>';
cout($box->get(), 'content');
cout('<script type="text/javascript">courses_count=' . ($temp == '' ? '0' : $temp) . ';' . 'courses_all="' . Lang::t('_ALL', 'standard') . '";' . "\n" . 'YAHOO.util.Event.addListener(window, "load", courses_selector_init);</script>', 'page_head');
$box = new ReportBox('lo_selection');
$box->title = $lang->def('_SELECT_LO_OPTIONS');
//LO columns selection
$lo_trans = $this->getLOTypesTranslations();
$box->body .= Form::getOpenFieldset(Lang::t('_RU_LO_TYPES', 'report'), 'lotypes_fieldset');
$res = sql_query("SELECT * FROM %lms_lo_types");
while ($row = mysql_fetch_assoc($res)) {
$trans = isset($lo_trans[$row['objectType']]) ? $lo_trans[$row['objectType']] : "";
$box->body .= Form::getCheckBox($trans, 'lo_type_' . $row['objectType'], 'lo_types[' . $row['objectType'] . ']', $row['objectType'], in_array($row['objectType'], $ref['lo_types']) ? true : false);
}
$box->body .= Form::getCloseFieldset();
$box->body .= Form::getOpenFieldset($lang->def('_RU_LO_MILESTONES'), 'lomilestones_fieldset');
$box->body .= Form::getCheckBox($lang->def('_NONE'), 'lo_milestone_0', 'lo_milestones[]', _MILESTONE_NONE, in_array(_MILESTONE_NONE, $ref['lo_milestones']) ? true : false);
$box->body .= Form::getCheckBox($lang->def('_START'), 'lo_milestone_1', 'lo_milestones[]', _MILESTONE_START, in_array(_MILESTONE_START, $ref['lo_milestones']) ? true : false);
$box->body .= Form::getCheckBox($lang->def('_END'), 'lo_milestone_2', 'lo_milestones[]', _MILESTONE_END, in_array(_MILESTONE_END, $ref['lo_milestones']) ? true : false);
$box->body .= Form::getCloseFieldset();
cout($box->get(), 'content');
function is_showed($which)
{
if (isset($_SESSION['report_tempdata']['columns_filter'])) {
return in_array($which, $_SESSION['report_tempdata']['columns_filter']['showed_columns']);
} else {
return false;
}
//.........这里部分代码省略.........
示例3: FieldList
function _maskTemplateManager()
{
require_once _base_ . '/lib/lib.form.php';
require_once $GLOBALS['where_framework'] . '/lib/lib.field.php';
require_once _base_ . '/lib/lib.table.php';
$lang =& DoceboLanguage::createInstance('configuration', 'framework');
$field_man = new FieldList();
$html = '';
if (isset($_POST['save_and_refresh'])) {
if (!sql_query("\r\n\t\t\tUPDATE " . $this->table . "\r\n\t\t\tSET param_value = '" . $_POST['templ_use_field'] . "'\r\n\t\t\tWHERE pack = 'main' AND param_name = 'templ_use_field'")) {
$html .= getErrorUi('_ERROR_WHILE_SAVING_NEW_FIELD');
} else {
setTemplate($_POST['templ_use_field']);
}
}
$drop_field = array();
$drop_field = $field_man->getFlatAllFields(false, 'dropdown');
$drop_field[0] = $lang->def('_NO');
$html .= Form::getDropdown($lang->def('_TEMPL_USE_FIELD'), 'templ_use_field', 'templ_use_field', $drop_field, Get::sett('templ_use_field'));
$html .= Form::getButton('save_and_refresh', 'save_and_refresh', $lang->def('_SAVE_AND_REFRESH'));
if (Get::sett('templ_use_field') != 0) {
$field_obj =& $field_man->getFieldInstance(Get::sett('templ_use_field'));
if ($field_obj === NULL) {
return $html . getErrorUi('_ERROR_WITH_THIS_FIELD');
}
$assignement = array();
$query_template_assigned = "\r\n\t\t\tSELECT ref_id, template_code\r\n\t\t\tFROM " . $GLOBALS['prefix_fw'] . "_field_template\r\n\t\t\tWHERE id_common = '" . Get::sett('templ_use_field') . "'";
$re_templ_assigned = sql_query($query_template_assigned);
while (list($ref_id, $template_code) = sql_fetch_row($re_templ_assigned)) {
$assignement[$ref_id] = $template_code;
}
$son_value = $field_obj->getAllSon();
$template_list = getTemplateList(true);
$default_template = getDefaultTemplate();
$tb_son = new Table(0, $lang->def('_ASSIGN_DROPDOWN_VALUE_TEMPLATE'), $lang->def('_ASSIGN_DROPDOWN_VALUE_TEMPLATE_SUMMARY'));
$cont_h = array($lang->def('_VALUE'), $lang->def('_TEMPLATE_VALUE'));
$type_h = array('', '');
$tb_son->setColsStyle($type_h);
$tb_son->addHead($cont_h);
while (list($id_son, $drop_son_name) = each($son_value)) {
$cont = array('<label for="template_selected_' . $id_son . '">' . $drop_son_name . '</label>', Form::getInputDropdown('dropdown', 'template_selected_' . $id_son, 'template_selected[' . $id_son . ']', $template_list, isset($assignement[$id_son]) && isset($template_list[$assignement[$id_son]]) ? $assignement[$id_son] : $default_template, ''));
$tb_son->addBody($cont);
}
$html .= $tb_son->getTable();
}
return $html;
}
示例4: run
public function run()
{
$num_tabs = 0;
$selected_tab = false;
if ($this->show_fncrole_selector) {
$num_tabs++;
$selected_tab = 'fncrole';
}
if ($this->show_orgchart_selector) {
$num_tabs++;
$selected_tab = 'orgchart';
}
if ($this->show_group_selector) {
$num_tabs++;
$selected_tab = 'group';
}
if ($this->show_user_selector) {
$num_tabs++;
$selected_tab = 'user';
}
if ($num_tabs <= 0 || !$selected_tab) {
return;
}
//no tabs to display: do nothing
//set selected tab, if specified a valid one
$_check_tab = strtolower($this->selected_tab);
switch ($_check_tab) {
case 'user':
case 'group':
case 'orgchart':
case 'fncrole':
$selected_tab = $_check_tab;
break;
}
$_selection = array();
if (is_array($this->initial_selection) && count($this->initial_selection) > 0) {
$_selection = $this->util->getInitialSelFromIdst($this->initial_selection);
}
//validate tab configuration
$initial_selection = array('user' => isset($_selection['user']) ? $_selection['user'] : array(), 'group' => isset($_selection['group']) ? $_selection['group'] : array(), 'orgchart' => isset($_selection['orgchart']) ? $this->_filterOrgchartSelection($_selection['orgchart']) : array(), 'fncrole' => isset($_selection['fncrole']) ? $_selection['fncrole'] : array());
//set view parameters
$params = array('id' => $this->id, 'show_user_selector' => $this->show_user_selector, 'show_group_selector' => $this->show_group_selector, 'show_orgchart_selector' => $this->show_orgchart_selector, 'show_fncrole_selector' => $this->show_fncrole_selector, 'selected_tab' => $selected_tab, 'use_form_input' => (bool) $this->use_form_input, 'separate_input' => (bool) $this->separate_input, 'initial_selection' => $initial_selection, 'ajax_url' => '../widget/ajax.widget.php?r=userselector/gettreedata');
//single tabs specific parameters:
//--- USER SELECTOR PARAMETERS ---------------------------------------------
if ($this->show_user_selector) {
require_once _adm_ . '/lib/lib.field.php';
$fman = new FieldList();
$fields = $fman->getFlatAllFields(array('framework', 'lms'));
$f_list = array('email' => Lang::t('_EMAIL', 'standard'), 'lastenter' => Lang::t('_DATE_LAST_ACCESS', 'profile'), 'register_date' => Lang::t('_DIRECTORY_FILTER_register_date', 'admin_directory'), 'language' => Lang::t('_LANGUAGE', 'standard'), 'level' => Lang::t('_LEVEL', 'standard'));
$f_list = $f_list + $fields;
$f_selected = $this->json->decode(Docebo::user()->getPreference('ui.directory.custom_columns'));
if ($f_selected == false) {
$f_selected = array('email', 'lastenter', 'register_date');
}
$js_arr = array();
foreach ($f_list as $key => $value) {
$js_arr[] = $key . ': ' . $this->json->encode($value);
}
$f_list_js = '{' . implode(',', $js_arr) . '}';
require_once _adm_ . '/lib/user_selector/lib.dynamicuserfilter.php';
$dyn_filter = new DynamicUserFilter("user_dyn_filter");
$dyn_filter->init();
$user_config = new stdClass();
$user_config->num_var_fields = $this->nFields;
//$this->numVarFields,
$user_config->fieldlist = $f_list;
$user_config->fieldlist_js = $f_list_js;
$user_config->selected = $f_selected;
$user_config->use_suspended = $this->use_suspended;
$user_config->show_suspended = false;
//$this-> _getSuspendedFilter(),
$user_config->filter_text = "";
//$this->_getTextFilter();
$user_config->dynamic_filter = $dyn_filter;
$params['user_config'] = $user_config;
}
//--- GROUP SELECTOR PARAMETERS --------------------------------------------
if ($this->show_group_selector) {
//...
}
//--- ORGCHART SELECTOR PARAMETERS -----------------------------------------
if ($this->show_orgchart_selector) {
$acl_man = Docebo::user()->getACLManager();
$arr_idst = $acl_man->getArrGroupST(array('/oc_0', '/ocd_0'));
$orgchart_config = new stdClass();
$orgchart_config->root_node_id = $arr_idst['/oc_0'] . '_' . $arr_idst['/ocd_0'];
//$acl_man->getGroupST('oc_0').'_'.$acl_man->getGroupST('ocd_0');
$orgchart_config->can_select_root = (bool) $this->can_select_root;
$params['orgchart_config'] = $orgchart_config;
}
//--- FNCROLES SELECTOR PARAMETERS -----------------------------------------
if ($this->show_fncrole_selector) {
//...
}
$this->render('userselector', $params);
}
示例5: coursereport
//.........这里部分代码省略.........
$top .= '<a class="ico-sprite subs_right" href="index.php?modname=coursereport&op=moveright&id_report=' . $info_report['id_report'] . '"><span><span>' . $lang->def('_MOVE_RIGHT') . '</span></a>';
}
}
$cont_h[] = $top;
$i++;
//set info colums
$colums['max_score'][] = $info_report['max_score'];
$colums['required_score'][] = $info_report['required_score'];
$colums['weight'][] = $info_report['weight'];
$colums['show_to_user'][] = $info_report['show_to_user'] == 'true' ? $lang->def('_YES') : $lang->def('_NO');
$colums['use_for_final'][] = $info_report['use_for_final'] == 'true' ? $lang->def('_YES') : $lang->def('_NO');
if ($info_report['use_for_final'] == 'true') {
$total_weight += $info_report['weight'];
}
}
// XXX: Set table intestation
$tb_report = new Table(0, $lang->def('_COURSE_REPORT_CAPTION'), $lang->def('_COURSE_REPORT_SUMMARY'));
$tb_report->setColsStyle($type_h);
$tb_report->addHead($cont_h);
$tb_report->addBody($a_line_2);
$tb_report->addBody($colums['max_score']);
$tb_report->addBody($colums['required_score']);
$tb_report->addBody($colums['weight']);
$tb_report->addBody($colums['show_to_user']);
$tb_report->addBody($colums['use_for_final']);
//$tb->addBodyExpanded('<span class="text_bold title_big">'.$lang->def('_STUDENTS_VOTE').'</span>', 'align-center');
$tb_score = new Table(0, $lang->def('_STUDENTS_VOTE'), $lang->def('_COURSE_REPORT_SUMMARY'));
$tb_score->setColsStyle($type_h);
$cont_h[0] = $lang->def('_STUDENTS');
$cont_old = $cont_h;
// ALE aggiungo menu a tendina con valori utente:
require_once _adm_ . '/lib/lib.field.php';
$fman = new FieldList();
$fields = $fman->getFlatAllFields(array('framework', 'lms'));
$f_list = array('userid' => Lang::t('_USERNAME', 'standard'), 'firstname' => Lang::t('_FIRSTNAME', 'standard'), 'lastname' => Lang::t('_LASTNAME', 'standard'), 'email' => Lang::t('_EMAIL', 'standard'), 'lastenter' => Lang::t('_DATE_LAST_ACCESS', 'profile'), 'register_date' => Lang::t('_DIRECTORY_FILTER_register_date', 'admin_directory'), 'language' => Lang::t('_LANGUAGE', 'standard'), 'level' => Lang::t('_LEVEL', 'standard'));
$f_list = $f_list + $fields;
$js_arr = array();
foreach ($f_list as $key => $value) {
$js_arr[] = $key . ': ' . json_encode($value);
}
$f_list_js = '{' . implode(',', $js_arr) . '}';
$fieldlist = $f_list;
$dyn_labels = array();
$dyn_filter = array();
$num_var_fields = 1;
$label = '<form name="formx" method="get">';
for ($i = 0; $i < $num_var_fields; $i++) {
$label .= '<select onchange="document.formx.submit()" id="_dyn_field_selector_0" name="_dyn_field_selector_0">';
foreach ($fieldlist as $key => $value) {
if ($i == 0) {
$first = $key;
}
$label .= '<option value="' . $key . '"' . ($_GET['_dyn_field_selector_0'] == $key ? ' selected="selected"' : '') . '>' . $value . '</option>';
}
$label .= '</select>';
}
$label .= '</form>';
$field_selected = $_GET['_dyn_field_selector_0'] ? $_GET['_dyn_field_selector_0'] : 'userid';
$_SESSION['field_selected'] = $field_selected;
// aggiungo un elemento in posizione 1
$index = 1;
$start = array_slice($cont_h, 0, $index);
$end = array_slice($cont_h, $index);
$start[] = $label;
$cont_h = array_merge($start, $end);
// fine inserimento
示例6: gap_analisysTask
public function gap_analisysTask()
{
$back_url = 'index.php?r=adm/functionalroles/show';
$id_fncrole = Get::req('id', DOTY_INT, -1);
if ($id_fncrole <= 0) {
$this->render('invalid', array('message' => $this->_getErrorMessage('invalid fncrole'), 'back_url' => $back_url));
return;
}
$title_arr = array($back_url => Lang::t('_FUNCTIONAL_ROLE', 'fncroles'), Lang::t('_GAP_ANALYSIS', 'fncroles') . ': ' . $this->model->getFunctionalRoleName($id_fncrole));
$result = Get::req('res', DOTY_ALPHANUM, '');
$result_message = "";
/*
switch ($result) {
case "ok_gap": $result_message = Lang::t('_RESULT_GAP_OK', 'fncroles'); break;
case "err_gap": $result_message = Lang::t('_RESULT_GAP_ERR', 'fncroles'); break;
}
*/
require_once _adm_ . '/lib/user_selector/lib.dynamicuserfilter.php';
$dyn_filter = new DynamicUserFilter("user_dyn_filter");
$dyn_filter->init();
require_once _adm_ . '/lib/lib.field.php';
$fman = new FieldList();
$fields = $fman->getFlatAllFields(array('framework', 'lms'));
$f_list = array('email' => Lang::t('_EMAIL', 'standard'), 'lastenter' => Lang::t('_DATE_LAST_ACCESS', 'profile'), 'register_date' => Lang::t('_DIRECTORY_FILTER_register_date', 'admin_directory'), 'language' => Lang::t('_LANGUAGE', 'standard'), 'level' => Lang::t('_LEVEL', 'standard'));
$f_list = $f_list + $fields;
$f_selected = $this->json->decode(Docebo::user()->getPreference('ui.directory.custom_columns'));
if ($f_selected == false) {
$f_selected = array('email', 'lastenter', 'register_date');
}
$js_arr = array();
foreach ($f_list as $key => $value) {
$js_arr[] = $key . ': ' . $this->json->encode($value);
}
$f_list_js = '{' . implode(',', $js_arr) . '}';
$this->render('gap_analisys', array('id_fncrole' => $id_fncrole, 'num_var_fields' => 1, 'fieldlist' => $f_list, 'fieldlist_js' => $f_list_js, 'selected' => $f_selected, 'title_arr' => $title_arr, 'filter_text' => "", 'result_message' => $result_message, 'advanced_filter' => array('active' => false, 'gap_filter' => 0, 'expire_filter' => 0)));
}
示例7: getCustomFields
public function getCustomFields($lang_code = false, $indexes = false)
{
require_once _adm_ . '/lib/lib.field.php';
$output = array();
$fl = new FieldList();
$fields = $fl->getFlatAllFields(false, false, $lang_code);
foreach ($fields as $key => $val) {
if ($indexes) {
$output[$key] = $val;
} else {
$output[] = array('id' => $key, 'name' => $val);
}
}
return $output;
}
示例8: subscribemod
function subscribemod()
{
checkPerm('subscribe', false, 'course');
require_once $GLOBALS['where_lms'] . '/lib/lib.course.php';
require_once _base_ . '/lib/lib.form.php';
require_once $GLOBALS['where_framework'] . '/lib/lib.field.php';
require_once _base_ . '/lib/lib.table.php';
$id_course = importVar('id_course', true, 0);
$course_info = Man_Course::getCourseInfo($id_course);
$edition_id = getCourseEditionId();
$fman = new FieldList();
//addScriptaculousJs();
YuiLib::load(array('json' => 'json-min.js'));
$GLOBALS['page']->add('<script type="text/javascript">' . ' function reloadInfo() {
var $ = YAHOO.util.Dom.get;
var selection = $("extra_info").value;
var id_course = $("id_course").value;
var data = "op=get_info&id_course="+id_course+"&id_field=" + selection;
var objAjax = YAHOO.util.Connect.asyncRequest("POST",
"' . $GLOBALS['where_lms_relative'] . '/ajax.adm_server.php?mn=subscribe",
{onSuccess: callback_change}, data
);
$("extra_info").disabled = true;
} ' . ' function callback_change(o) {
var result = YAHOO.lang.JSON.parse(o.responseText);
var table = $("subscribed_list");
for(var i= 0;i < table.rows.length;i++) {
var ind = table.rows[i].id.indexOf("user_");
if(ind >= 0) {
var id_user = table.rows[i].id.substr(5);
table.rows[i].cells[1].innerHTML = result[id_user];
}
}
$("extra_info").disabled = false;
}' . '</script>', 'page_head');
$out =& $GLOBALS['page'];
$lang =& DoceboLanguage::CreateInstance('subscribe', 'lms');
$acl_man =& Docebo::user()->getAclManager();
$levels = CourseLevel::getLevels();
$arr_absent = array(0 => $lang->def('_NO'), 1 => $lang->def('_JUSTIFIED'), 2 => $lang->def('_NOT_JUSTIFIED'));
$arr_status = array(_CUS_CONFIRMED => $lang->def('_USER_STATUS_CONFIRMED'), _CUS_SUBSCRIBED => $lang->def('_USER_STATUS_SUBS'), _CUS_BEGIN => $lang->def('_USER_STATUS_BEGIN'), _CUS_END => $lang->def('_USER_STATUS_END'), _CUS_SUSPEND => $lang->def('_USER_STATUS_SUSPEND'), _CUS_CANCELLED => $lang->def('_USER_STATUS_CANCELLED'));
$field = $fman->getFlatAllFields();
$field = array('name' => $lang->def('_FULLNAME'), 'email' => $lang->def('_EMAIL')) + $field;
// Retrive info about the selected user
$user_alredy_subscribed = getSubscribed($id_course, false, false, true, $edition_id);
$user_levels = getSubscribedInfo($id_course, false, false, false, false, $edition_id);
require_once $GLOBALS['where_framework'] . '/lib/lib.adminmanager.php';
$adminManager = new AdminManager();
$acl_manager = new DoceboACLManager();
$idst_associated = $adminManager->getAdminTree(getLogUserId());
$array_user_associated =& $acl_manager->getAllUsersFromIdst($idst_associated);
$user_level = Docebo::user()->getUserLevelId();
if ($user_level != ADMIN_GROUP_GODADMIN) {
$user_alredy_subscribed = array_intersect($user_alredy_subscribed, $array_user_associated);
}
$user_selected_info =& $acl_man->getUsers($user_alredy_subscribed);
$page_title = array('index.php?modname=course&op=course_list' => $lang->def('_COURSES'), $course_info['name'], $lang->def('_SUBSCRIBE'));
$GLOBALS['page']->add(getTitleArea($page_title, 'subscribe') . '<div class="std_block">' . Form::openForm('levelselection', 'index.php?modname=subscribe&op=subscribeupdate') . Form::getHidden('id_course', 'id_course', $id_course) . Form::getHidden('edition_id', 'edition_id', $edition_id), 'content');
$tb = new Table(0, $lang->def('_CAPTION_SELECT_LEVELS'), $lang->def('_SUMMARY_SELECT_LEVEL'));
$tb->setTableId('subscribed_list');
$type_h = array('', '');
$content_h = array($lang->def('_USERNAME'), Form::getInputDropdown('dropdown_nowh', 'extra_info', 'extra_info', $field, 0, ' onchange="reloadInfo();"'));
foreach ($levels as $lv => $lv_name) {
$type_h[] = 'image';
$content_h[] = '<a href="javascript:SelAll(\'' . $lv . '\');">' . $lv_name . '</a>';
}
$type_h[] = 'image';
$content_h[] = $lang->def('_STATUS');
if ($course_info['course_type'] != 'elearning') {
$type_h[] = 'image';
$content_h[] = $lang->def('_ABSENT');
}
$tb->addHead($content_h, $type_h);
$num_user_sel = 0;
if (is_array($user_selected_info)) {
reset($user_selected_info);
$jsArr = "var elementi = new Array(";
$i = 0;
while (list($id_user, $user_info) = each($user_selected_info)) {
if ($i != 0) {
$jsArr .= ",";
}
$i++;
$jsArr .= "'" . $id_user . "'";
// if the user isn't alredy subscribed to the course
$content = array(substr($user_info[ACL_INFO_USERID], 1), $user_info[ACL_INFO_LASTNAME] . ' ' . $user_info[ACL_INFO_FIRSTNAME]);
foreach ($levels as $lv => $lv_name) {
$content[] = Form::getInputRadio('user_level_sel_' . $id_user . '_' . $lv, 'user_level_sel[' . $id_user . ']', $lv, $lv == $user_levels[$id_user]['level'], '') . '<label class="access-only" for="user_level_sel_' . $id_user . '_' . $lv . '">' . $lv_name . '</label>';
}
$content[] = Form::getInputDropdown('dropdown', 'user_status_sel_' . $id_user . '', 'user_status_sel[' . $id_user . ']', $arr_status, $user_levels[$id_user]['status'], '') . '<label class="access-only" for="user_status_sel_' . $id_user . '">' . $lang->def('_STATUS') . '</label>';
if ($course_info['course_type'] != 'elearning') {
$content[] = Form::getInputDropdown('dropdown_nowh', 'user_absent' . $id_user . '', 'user_absent[' . $id_user . ']', $arr_absent, $user_levels[$id_user]['absent'], '') . '<label class="access-only" for="user_absent_' . $id_user . '">' . $lang->def('_ABSENT') . '</label>';
}
$tb->addBody($content, false, false, 'user_' . $id_user);
}
$GLOBALS['page']->add($tb->getTable(), 'content');
}
//.........这里部分代码省略.........
示例9: FieldList
/**
* @param string $id_folder folder destination of fields
* @param array $arr_fields an array with fields to attach to folder
* any element of folder is an array:
* key => array( 'fvalue', 'mandatory' )
* - key is the field name in current language
* - fvalue is the value of the field
* - mandatory is TRUE if this field is mandatory
*/
function _add_custom_fields($id_folder, $arr_fields)
{
require_once $GLOBALS['where_framework'] . '/lib/lib.field.php';
$fl = new FieldList();
$fl->setGroupFieldsTable($GLOBALS['prefix_fw'] . ORGCHAR_FIELDTABLE);
$fl->setFieldEntryTable($GLOBALS['prefix_fw'] . ORGCHAR_FIELDENTRYTABLE);
$arr_all_fields = $fl->getFlatAllFields(false, false, $this->default_lang);
// remove all fields
foreach ($arr_all_fields as $id_field => $ftranslation) {
$fl->removeFieldFromGroup($id_field, $id_folder);
}
$arr_all_fields_translation = array_flip($arr_all_fields);
$arr_fields_value = array();
// add selected fields
foreach ($arr_fields as $field_translation => $field_data) {
if (isset($arr_all_fields_translation[$field_translation])) {
$field_id = $arr_all_fields_translation[$field_translation];
$fl->addFieldToGroup($field_id, $id_folder, $field_data['mandatory']);
$arr_fields_value[$field_id] = $field_data['fvalue'];
} else {
die("Field non trovato: {$field_translation}");
}
}
$fl->storeDirectFieldsForUser($id_folder, $arr_fields_value, FALSE);
}
示例10: show
public function show()
{
if (!$this->permissions['subscribe_course']) {
// the user cannot use this function
$this->render('invalid', array('message' => $this->_getErrorMessage('no permission'), 'back_url' => 'index.php?r=' . $this->link_course . '/show'));
return;
}
Util::get_js(Get::rel_path('base') . '/lib/lib.elem_selector.js', true, true);
Util::get_js(Get::rel_path('base') . '/lib/js_utils.js', true, true);
Util::get_js(Get::rel_path('lms') . '/admin/views/subscription/subscription.js', true, true);
if (isset($_GET['res']) && $_GET['res'] !== '') {
UIFeedback::info(Lang::t(strtoupper($_GET['res']), 'subscription'));
}
if (isset($_GET['err']) && $_GET['err'] !== '') {
UIFeedback::error(Lang::t(strtoupper($_GET['err']), 'subscription'));
}
Form::loadDatefieldScript();
//some dialogs use date inputs
$umodel = new UsermanagementAdm();
$course_info = $this->model->getCourseInfoForSubscription();
$course_name = ($course_info['code'] !== '' ? '[' . $course_info['code'] . '] ' : '') . $course_info['name'];
//generate field list for dynamic user column
require_once _adm_ . '/lib/lib.field.php';
$fman = new FieldList();
$fields = $fman->getFlatAllFields(array('framework', 'lms'));
$f_list = array('email' => Lang::t('_EMAIL', 'standard'), 'lastenter' => Lang::t('_DATE_LAST_ACCESS', 'profile'), 'register_date' => Lang::t('_DIRECTORY_FILTER_register_date', 'admin_directory'), 'level' => Lang::t('_LEVEL', 'standard'), 'language' => Lang::t('_LANGUAGE', 'standard'));
$f_list = $f_list + $fields;
$f_selected = $this->json->decode(Docebo::user()->getPreference('ui.directory.custom_columns'));
if ($f_selected == false) {
$f_selected = array('email');
}
$js_arr = array();
foreach ($f_list as $key => $value) {
$js_arr[] = $key . ': ' . $this->json->encode($value);
}
$f_list_js = '{' . implode(',', $js_arr) . '}';
$params = array('back_link' => $this->_getBackLink(), 'id_course' => $this->id_course, 'id_edition' => $this->id_edition, 'id_date' => $this->id_date, 'level_list_js' => $this->_getJsArrayLevel(), 'status_list_js' => $this->_getJsArrayStatus(), 'orgchart_list' => $umodel->getOrgChartDropdownList(), 'is_active_advanced_filter' => false, 'filter_text' => "", 'filter_orgchart' => 0, 'filter_descendants' => false, 'filter_date_valid' => "", 'filter_show' => 0, 'course_name' => $course_name, 'use_overbooking' => isset($course_info['overbooking']) ? (bool) $course_info['overbooking'] : false, 'num_var_fields' => 1, 'fieldlist' => $f_list, 'fieldlist_js' => $f_list_js, 'selected' => $f_selected, 'hidden_validity' => false);
$this->render('show', $params);
}
示例11: multimodTask
public function multimodTask()
{
if (!$this->permissions['mod_user']) {
$output = array('success' => false, 'message' => $this->_getErrorMessage('no permission'));
echo $this->json->encode($output);
return;
}
$title = Lang::t('_MOD', 'admin_directory');
$users_count = Get::req('users_count', DOTY_INT, 0);
if ($users_count <= 0) {
$output = array('success' => true, 'header' => $title, 'body' => Lang::t('_EMPTY_SELECTION', 'admin_directory'));
echo $this->json->encode($output);
return;
}
$acl_man = Docebo::user()->getAclManager();
$level = ADMIN_GROUP_USER;
$arr_levels = $acl_man->getAdminLevels();
//index = idst; value = groupid;
$levels = array();
foreach ($arr_levels as $groupid_level => $idst_level) {
$levels[$groupid_level] = Lang::t('_DIRECTORY_' . $groupid_level, 'admin_directory');
}
$info = array('firstname' => '', 'lastname' => '', 'email' => '', 'level' => '', 'facebook_id' => '', 'twitter_id' => '', 'linkedin_id' => '', 'google_id' => '');
$language = getDefaultLanguage();
$languages = Docebo::langManager()->getAllLanguages();
require_once _base_ . '/lib/lib.platform.php';
$pman =& PlatformManager::createInstance();
// = new PlatformManager();
$platforms = $pman->getPlatformList();
require_once _adm_ . '/lib/lib.field.php';
$fman = new FieldList();
$field_list = $fman->getFlatAllFields(array_keys($platforms));
$fields_to_exclude = $fman->getFieldsByType('upload');
$preference = new UserPreferences(0);
$modify_mask = $preference->getModifyMask('ui.', true, true);
$fields_mask = $fman->playFieldsForUser(-1, false, false, true, false, true);
//build edit mask
$this->render('multimod', array('users_count' => $users_count, 'title' => $title, 'levels' => $levels, 'modify_mask' => $modify_mask, 'fields_mask' => $fields_mask, 'fields_to_exclude' => is_array($fields_to_exclude) ? $fields_to_exclude : array(), 'info' => $info, 'json' => $this->json));
}
示例12: FieldList
function _step0()
{
require_once $GLOBALS['where_framework'] . '/lib/lib.field.php';
$field_man = new FieldList();
$field_list = $field_man->getFlatAllFields();
$out = '';
// ---- name -----
$out = $this->form->getTextfield($this->lang->def('_NAME'), $this->_get_base_name() . '_name', $this->_get_base_name() . '[name]', 255, $this->post_params['name']);
// ---- description -----
$out .= $this->form->getSimpleTextarea($this->lang->def('_DESCRIPTION'), $this->_get_base_name() . '_description', $this->_get_base_name() . '[description]', $this->post_params['description']);
// --- cid field --------
$out .= $this->form->getDropdown($this->lang->def('_CID'), $this->_get_base_name() . '_cid_field', $this->_get_base_name() . '[cid_field]', $field_list, $this->post_params['cid_field']);
return $out;
}