Example #1
0
<?php

echo getTitleArea(array('index.php?r=alms/games/show' => Lang::t('_CONTEST', 'games'), Lang::t('_ADD', 'games')));
?>
<div class="std_block">
	<?php 
echo Form::openForm('add_games', 'index.php?r=alms/games/insert', false, false, 'multipart/form-data') . Form::getHidden('title', 'title', 255, Get::req('title', DOTY_MIXED, $data['title'])) . Form::openElementSpace() . Form::getTextfield(Lang::t('_TITLE', 'games'), 'title', 'title', 255, Get::req('title', DOTY_MIXED, $data['title'])) . Form::getDatefield(Lang::t('_START_DATE', 'games'), 'start_date', 'start_date', Get::req('start_date', DOTY_MIXED, $data['start_date'])) . Form::getDatefield(Lang::t('_DATE_END', 'games'), 'end_date', 'end_date', Get::req('end_date', DOTY_MIXED, $data['end_date'])) . Form::getRadioSet(Lang::t('_TYPE', 'games'), 'type_of', 'type_of', array(Lang::t('_LONAME_scormorg', 'storage') => 'scorm'), Get::req('type_of', DOTY_STRING, $data['type_of'])) . Form::getRadioSet(Lang::t('_PLAY_CHANCE', 'games'), 'play_chance', 'play_chance', array(Lang::t('_UNLIMITED', 'games') => 'play_unlimited', Lang::t('_ONLY_ONCE', 'games') => 'play_once'), 'play_unlimited') . Form::getTextarea(Lang::t('_DESCRIPTION', 'games'), 'description', 'description', Get::req('description', DOTY_MIXED, $data['description'])) . Form::closeElementSpace() . Form::openButtonSpace() . Form::getButton('save', 'save', Lang::t('_SAVE', 'games')) . Form::getButton('undo', 'undo', Lang::t('_UNDO', 'games')) . Form::closeButtonSpace() . Form::closeForm();
?>
</div>
Example #2
0
/**
 * The UI for create a new task
 * @param Module $module the caller module
 **/
function ioTask_UITaskNew_step2(&$module, &$params)
{
    checkPerm('view');
    require_once _base_ . '/lib/lib.form.php';
    $connMgr =& $module->get_connMgr();
    $lang =& $module->get_lang();
    $out =& $module->get_out();
    $form = new Form();
    $out->add($form->getLineBox($lang->def('_NAME'), $params[CONNMGR_TASK_NAME]));
    $out->add($form->getRadioSet($lang->def('_IMPORT_TYPE'), 'task_import_type', 'task_params[' . CONNMGR_TASK_IMPORT_TYPE . ']', array($lang->def('_IMPORT_TYPE_INSERTONLY') => TASK_IMPORT_TYPE_INSERTONLY, $lang->def('_IMPORT_TYPE_INSERTREMOVE') => TASK_IMPORT_TYPE_INSERTREMOVE), $params[CONNMGR_TASK_IMPORT_TYPE]));
    $out->add($form->getRadioSet($lang->def('_SCHEDULE'), 'task_schedule_type', 'task_params[' . CONNMGR_TASK_SCHEDTYPE . ']', array($lang->def('_SCHEDULE_TYPE_AT') => 'at', $lang->def('_SCHEDULE_TYPE_INTERVAL') => 'interval'), $params[CONNMGR_TASK_SCHEDTYPE]));
    $tmp_um = $form->getInputListbox('', 'task_schedule_um', 'task_params[' . CONNMGR_TASK_SCHEDULE . '][um]', array('hour' => $lang->def('_HOUR'), 'day' => $lang->def('_DAY')), array($params[CONNMGR_TASK_SCHEDULE]['um']), FALSE, '');
    $out->add($form->getTextfield($lang->def('_SCHEDULE'), 'task_schedule_qt', 'task_params[' . CONNMGR_TASK_SCHEDULE . '][qt]', 10, $params[CONNMGR_TASK_SCHEDULE]['qt'], '', $tmp_um, ''));
    $out->add("\n<script type='text/javascript'>\n" . "var field_um = document.getElementById('task_schedule_um');\n" . "var field = document.getElementById('task_schedule_type_0');\n" . "field.onclick = function() {\n" . "\tfield_um.style.display = 'none';\n" . "}\n" . "field = document.getElementById('task_schedule_type_1');\n" . "field.onclick = function() {\n" . "\tfield_um.style.display = 'inline';\n" . "}\n" . "</script>\n");
}
Example #3
0
 //step 1 : choose file and reading options
 case 1:
     echo getTitleArea(Lang::t('_ORG_CHART_IMPORT_USERS', 'organization_chart'), 'directory_group');
     echo '<div class="std_block">';
     echo Form::getFormHeader(Lang::t('_ASSIGN_USERS', 'admin_directory'));
     echo Form::openForm('directory_importgroupuser', 'index.php?r=' . $this->link . '/importusers', false, false, 'multipart/form-data');
     //echo Form::getHidden('id', 'id', $id_org);
     echo Form::getHidden('step', 'step', 2);
     echo Form::openElementSpace();
     echo Form::getFilefield(Lang::t('_GROUP_USER_IMPORT_FILE', 'admin_directory'), 'file_import', 'file_import');
     //echo Form::getTextfield(Lang::t('_GROUP_USER_IMPORT_SEPARATOR', 'admin_directory'), 'import_separator', 'import_separator', 1, ',');
     echo Form::getRadioSet(Lang::t('_GROUP_USER_IMPORT_SEPARATOR', 'admin_directory'), 'import_separator', 'import_separator', array(Lang::t('_AUTODETECT', 'standard') => 'auto', '<b>,</b>' => 'comma', '<b>;</b>' => 'dotcomma', Lang::t('_MANUAL', 'standard') . ':&nbsp;' . Form::getInputTextfield('', 'import_separator_manual', 'import_separator_manual', "", "", 255) => 'manual'), 'auto');
     echo Form::getCheckbox(Lang::t('_GROUP_USER_IMPORT_HEADER', 'admin_directory'), 'import_first_row_header', 'import_first_row_header', 'true', true);
     echo Form::getTextfield(Lang::t('_GROUP_USER_IMPORT_CHARSET', 'admin_directory'), 'import_charset', 'import_charset', 20, 'UTF-8');
     echo Form::getDropdown(Lang::t('_DIRECTORY_MEMBERTYPETREE', 'admin_directory'), 'id', 'id', $orgchart_list, $id_org);
     echo Form::getRadioSet(Lang::t('_FORCE_PASSWORD_CHANGE', 'admin_directory'), 'pwd_force_change_policy', 'pwd_force_change_policy', array(Lang::t('_NO', 'standard') => 'false', Lang::t('_YES', 'standard') => 'true', Lang::t('_SERVERINFO', 'configuration') => 'by_setting', Lang::t('_DO_NOTHING', 'preassessment') => 'do_nothing'), 'do_nothing');
     echo Form::closeElementSpace();
     echo Form::openButtonSpace();
     echo Form::getButton('import_groupuser_2', 'import_groupuser_2', Lang::t('_NEXT', 'standard'));
     echo Form::getButton('import_groupcancel', 'import_groupcancel', Lang::t('_UNDO', 'standard'));
     echo Form::closeButtonSpace();
     echo Form::closeForm();
     echo '</div>';
     break;
     //step 2 : set columns
 //step 2 : set columns
 case 2:
     echo getTitleArea(Lang::t('_ORG_CHART_IMPORT_USERS', 'organization_chart'), 'directory_group');
     echo '<div class="std_block">';
     echo Form::openForm('directory_importgroupuser', 'index.php?r=' . $this->link . '/importusers', false, false, 'multipart/form-data');
     echo Form::openElementSpace();
 function get_delay_filter()
 {
     $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';
     //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']
     $ref =& $_SESSION['report_tempdata']['columns_filter'];
     $selector = new Selector_Course();
     if (isset($_POST['update_tempdata'])) {
         $selector->parseForState($_POST);
         $temp = array('report_type_completed' => $_POST['report_type'] == "course_completed" || $_POST['report_type'] == "both" ? true : false, 'report_type_started' => $_POST['report_type'] == "course_started" || $_POST['report_type'] == "both" ? true : false, 'day_from_subscription' => $_POST['day_from_subscription'], 'day_until_course_end' => $_POST['day_until_course_end'], 'date_until_course_end' => Format::dateDb($_POST['date_until_course_end'], 'date'), 'org_chart_subdivision' => isset($_POST['org_chart_subdivision']) ? 1 : 0, 'all_courses' => $_POST['all_courses'] == 1 ? true : false, 'selected_courses' => $selector->getSelection(), 'showed_columns' => isset($_POST['cols']) ? $_POST['cols'] : 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);
         $_SESSION['report_tempdata']['columns_filter'] = $temp;
         //$ref = $temp;
     } else {
         //first loading of this page -> prepare $_SESSION data structure
         //if (isset($_SESSION['report_update']) /* && is equal to id_report */) break;
         if (!isset($_SESSION['report_tempdata']['columns_filter'])) {
             $_SESSION['report_tempdata']['columns_filter'] = array('report_type_completed' => false, 'report_type_started' => false, 'day_from_subscription' => '', 'day_until_course_end' => '', 'date_until_course_end' => '', 'org_chart_subdivision' => 0, 'all_users' => false, 'all_courses' => true, 'selected_courses' => array(), 'showed_columns' => array(), 'order_by' => 'userid', 'order_dir' => 'asc', 'show_suspended' => false);
         }
     }
     //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);
     }
     $lang = $this->lang;
     cout(Form::getHidden('update_tempdata', 'update_tempdata', 1), 'content');
     $array_report_type = array($lang->def('_COURSE_COMPLETED') => "course_completed", $lang->def('_COURSE_STARTED') => "course_started", $lang->def('_FILTER_ALL_CONDS') => "both");
     //box for rpeort options
     $box = new ReportBox('delay_options_box');
     $box->title = $lang->def('_REPORT_USER_TITLE_TIMEBELT');
     $box->description = $lang->def('_REPORT_USER_TITLE_TIMEBELT_DESC');
     $selected_radio = "both";
     if (!$ref['report_type_completed'] || !$ref['report_type_started']) {
         if ($ref['report_type_completed']) {
             $selected_radio = 'course_completed';
         }
         if ($ref['report_type_started']) {
             $selected_radio = 'course_started';
         }
     }
     $box->body = Form::getRadioSet('', 'report_type', 'report_type', $array_report_type, $selected_radio) . Form::getTextfield($lang->def('_DAY_FROM_SUBSCRIPTION'), 'day_from_subscription', 'day_from_subscription', 20, $ref['day_from_subscription']) . Form::getTextfield($lang->def('_DAY_UNTIL_COURSE_END'), 'day_until_course_end', 'day_until_course_end', 20, $ref['day_until_course_end']) . Form::getDatefield($lang->def('_DATE_UNTIL_COURSE_END'), 'date_until_course_end', 'date_until_course_end', Format::date($ref['date_until_course_end'], 'date')) . Form::getBreakRow();
     cout($box->get());
     YuiLib::load('datasource');
     Util::get_js(Get::rel_path('lms') . '/admin/modules/report/courses_filter.js', true, true);
     //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->def('_REPORT_COURSE_SELECTION');
     $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 .= '</div>';
     $box->footer = $lang->def('_CURRENT_SELECTION') . ':&nbsp;<span id="csel_foot">' . ($ref['all_courses'] ? $lang->def('_ALL') : ($temp != '' ? $temp : '0')) . '</span>';
     cout($box->get());
     cout('<script type="text/javascript">courses_count=' . ($temp == '' ? '0' : $temp) . ';' . 'courses_all="' . $lang->def('_ALL') . '";' . "\n" . 'YAHOO.util.Event.addListener(window, "load", courses_selector_init);</script>');
     $box = new ReportBox('columns_selector');
     $box->title = $lang->def('_SELECT_THE_DATA_COL_NEEDED');
     $box->description = false;
     $box->body = Form::getOpenFieldset($lang->def('_SHOWED_COLUMNS'));
     //backward compatibility
     $arr_check_columns = array();
     foreach ($ref['showed_columns'] as $_column_key) {
         $arr_check_columns[] = $this->_check_delay_column($_column_key);
     }
     foreach ($this->delay_columns as $delay_row) {
         if ($delay_row['select']) {
             //column is selectable
             $box->body .= Form::getCheckBox($delay_row['label'], 'col_' . $delay_row['key'], 'cols[]', $delay_row['key'], in_array($delay_row['key'], $arr_check_columns) ? true : false);
         }
     }
     $box->body .= Form::getCloseFieldset();
     cout($box->get());
     //other options
     $box = new ReportBox('other_options');
     $box->title = Lang::t('_OTHER_OPTION', 'course');
     $box->description = false;
     $sort_list = array('userid' => Lang::t('_USERID', 'standard'), 'firstname' => Lang::t('_FIRSTNAME', 'standard'), 'lastname' => Lang::t('_LASTNAME', 'standard'), 'email' => Lang::t('_EMAIL', 'standard'), 'status' => Lang::t('_STATUS', 'standard'), 'date_subscription' => Lang::t('_DATE_INSCR', 'report'), 'date_first_access' => Lang::t('_DATE_FIRST_ACCESS', 'standard'), 'date_last_access' => Lang::t('_DATE_LAST_ACCESS', 'standard'), 'date_complete' => Lang::t('_DATE_END', 'standard'));
     $dir_list = array('asc' => Lang::t('_ORD_ASC_TITLE', 'standard'), 'desc' => Lang::t('_ORD_DESC_TITLE', 'standard'));
     $sort_selected = array_key_exists($ref['order_by'], $sort_list) ? $ref['order_by'] : 'userid';
     $dir_selected = array_key_exists($ref['order_dir'], $dir_list) ? $ref['order_dir'] : 'asc';
     $sort_dir_dropdown = Form::getInputDropdown('', 'order_dir', 'order_dir', $dir_list, $dir_selected, '');
     $box->body .= Form::getDropdown(Lang::t('_ORDER_BY', 'standard'), 'order_by', 'order_by', $sort_list, $sort_selected, $sort_dir_dropdown);
     $box->body .= Form::getCheckbox(Lang::t('_SHOW_SUSPENDED', 'organization_chart'), 'show_suspended', 'show_suspended', 1, (bool) $ref['show_suspended']);
     cout($box->get());
 }
 function get_rows_filter()
 {
     $back_url = $this->back_url;
     $jump_url = $this->jump_url;
     $next_url = $this->next_url;
     require_once _base_ . '/lib/lib.form.php';
     require_once $GLOBALS['where_framework'] . '/lib/lib.directory.php';
     require_once _base_ . '/lib/lib.userselector.php';
     require_once $GLOBALS['where_lms'] . '/lib/lib.course.php';
     require_once $GLOBALS['where_lms'] . '/lib/lib.course_managment.php';
     $lang =& DoceboLanguage::createInstance('report', 'framework');
     //update session
     $ref =& $_SESSION['report_tempdata'];
     if (!isset($ref['rows_filter'])) {
         $ref['rows_filter'] = array('select_all' => false, 'selection_type' => 'users', 'selection' => array());
     } else {
         //already resolved in switch block
     }
     $step = Get::req('step', DOTY_ALPHANUM, 'sel_type');
     switch ($step) {
         case 'sel_type':
             $values = array('users' => $this->lang->def('_USERS'), 'groups' => $this->lang->def('_GROUPS'));
             $sel_val = isset($ref['rows_filter']['selection_type']) ? $ref['rows_filter']['selection_type'] : 'users';
             $out = Form::openForm('selection_type_form', $jump_url);
             $out .= Form::getRadioSet($this->lang->def('_AGGREGATE_ON'), 'selection_type', 'selection_type', array_flip($values), $sel_val) . '<div class="nofloat"></div>';
             $out .= Form::openButtonSpace();
             $out .= Form::getButton('ok_selection', 'ok_selection', $this->lang->def('_CONFIRM'));
             $out .= Form::getButton('undo', 'undo', $this->lang->def('_UNDO'));
             $out .= Form::closeButtonSpace();
             $out .= Form::getHidden('step', 'step', 'sel_data');
             $out .= Form::closeForm();
             cout($out);
             break;
         case 'sel_data':
             $type = Get::req('selection_type', DOTY_ALPHANUM, 'users');
             //$aclManager = new DoceboACLManager();
             $user_select = new UserSelector();
             if (Get::req('is_updating', DOTY_INT, 0) > 0) {
                 $ref['rows_filter']['select_all'] = Get::req('select_all', DOTY_INT, 0) > 0 ? true : false;
                 $ref['rows_filter']['selection_type'] = $type;
                 //$ref['rows_filter']['selection'] = $user_select->getSelection($_POST);
             } else {
                 //maybe redoundant
                 if (!isset($ref['rows_filter']['select_all'])) {
                     $ref['rows_filter']['select_all'] = false;
                 }
                 if (!isset($ref['rows_filter']['selection_type'])) {
                     $ref['rows_filter']['selection_type'] = 'groups';
                 }
                 if (!isset($ref['rows_filter']['selection'])) {
                     $ref['rows_filter']['selection'] = array();
                 }
                 $user_select->resetSelection($ref['rows_filter']['selection']);
                 //$ref['users'] = array(); it should already have been set to void array, if non existent
             }
             if (isset($_POST['cancelselector'])) {
                 Util::jump_to($back_url);
             } elseif (isset($_POST['okselector'])) {
                 $ref['rows_filter']['selection'] = $user_select->getSelection($_POST);
                 Util::jump_to($next_url);
             }
             //set page
             switch ($type) {
                 case 'groups':
                     $user_select->show_user_selector = FALSE;
                     $user_select->show_group_selector = TRUE;
                     $user_select->show_orgchart_selector = TRUE;
                     break;
                 case 'users':
                     $user_select->show_user_selector = TRUE;
                     $user_select->show_group_selector = TRUE;
                     $user_select->show_orgchart_selector = TRUE;
                     break;
             }
             //$user_select->show_orgchart_simple_selector = FALSE;
             //$user_select->multi_choice = TRUE;
             $user_select->addFormInfo(($type == 'users' ? Form::getCheckbox($lang->def('_REPORT_FOR_ALL'), 'select_all', 'select_all', 1, $ref['rows_filter']['select_all']) : '') . Form::getBreakRow() . Form::getHidden('selection_type', 'selection_type', $type) . Form::getHidden('step', 'step', 'sel_data') . Form::getHidden('is_updating', 'is_updating', 1) . Form::getHidden('substep', 'substep', 'user_selection') . Form::getHidden('second_step', 'second_step', 1));
             $user_select->setPageTitle('');
             $user_select->loadSelector(Util::str_replace_once('&', '&amp;', $jump_url), false, $this->lang->def('_CHOOSE_USER_FOR_REPORT'), true);
             break;
     }
 }
Example #6
0
 /**
  * @return 	string 	contains the displayable information for a selected group
  *
  * @access 	public
  */
 function getPageWithElement($regroup)
 {
     require_once _base_ . '/lib/lib.form.php';
     if ($regroup == 'templ_man') {
         return $this->_maskTemplateManager();
     } elseif ($regroup == 'suiteman') {
         return $this->_maskSuiteManager();
     }
     $lang =& DoceboLanguage::createInstance('configuration', 'framework');
     $reSetting = sql_query("\r\n\t\tSELECT param_name, param_value, value_type, max_size\r\n\t\tFROM " . $this->table . "\r\n\t\tWHERE regroup = '" . $regroup . "' AND\r\n\t\t\thide_in_modify = '0'\r\n\t\tORDER BY regroup, pack, sequence");
     $html = '';
     while (list($var_name, $var_value, $value_type, $max_size) = sql_fetch_row($reSetting)) {
         $i_after = ' <span class="ico-tooltip" id="tt_target_' . $var_name . '" title="' . $lang->def('_CONF_DESCR_' . strtoupper($var_name)) . '">info</span>';
         switch ($value_type) {
             case "register_type":
                 //on off
                 $html .= Form::getOpenCombo($lang->def('_' . strtoupper($var_name))) . Form::getLineRadio('', 'label_bold', $lang->def('_REGISTER_TYPE_SELF'), $var_name . '_self', 'option[' . $var_name . ']', 'self', $var_value == 'self') . Form::getLineRadio('', 'label_bold', $lang->def('_REGISTER_TYPE_SELF_OPTIN'), $var_name . '_self_optin', 'option[' . $var_name . ']', 'self_optin', $var_value == 'self_optin') . Form::getLineRadio('', 'label_bold', $lang->def('_REGISTER_TYPE_MODERATE'), $var_name . '_moderate', 'option[' . $var_name . ']', 'moderate', $var_value == 'moderate') . Form::getLineRadio('', 'label_bold', $lang->def('_REGISTER_TYPE_ADMIN'), $var_name . '_admin', 'option[' . $var_name . ']', 'admin', $var_value == 'admin') . Form::getCloseCombo($i_after);
                 break;
             case "register_tree":
                 $register_possible_option = array('off' => $lang->def('_DONT_USE_TREE_REGISTRATION'), 'manual_insert' => $lang->def('_USE_WITH_MANUALEINSERT'), 'selection' => $lang->def('_USE_WITH_SELECTION'));
                 $html .= Form::getDropdown($lang->def('_' . strtoupper($var_name)), $var_name, 'option[' . $var_name . ']', $register_possible_option, $var_value, $i_after);
                 break;
             case "field_tree":
                 require_once $GLOBALS['where_framework'] . '/lib/lib.field.php';
                 $fl = new FieldList();
                 $all_fields = $fl->getAllFields(false);
                 $fields[0] = $lang->def('_NO_VALUE');
                 foreach ($all_fields as $key => $val) {
                     $fields[$val[FIELD_INFO_ID]] = $val[FIELD_INFO_TRANSLATION];
                 }
                 $html .= Form::getDropdown($lang->def('_' . strtoupper($var_name)), $var_name, 'option[' . $var_name . ']', $fields, $var_value, $i_after);
                 break;
             case "save_log_attempt":
                 //on off
                 $html .= Form::getOpenCombo($lang->def('_' . strtoupper($var_name))) . Form::getLineRadio('', 'label_bold', $lang->def('_SAVE_LA_ALL'), $var_name . '_all', 'option[' . $var_name . ']', 'all', $var_value == 'all') . Form::getLineRadio('', 'label_bold', $lang->def('_SAVE_LA_AFTER_MAX'), $var_name . '_after_max', 'option[' . $var_name . ']', 'after_max', $var_value == 'after_max') . Form::getLineRadio('', 'label_bold', $lang->def('_NO'), $var_name . '_no', 'option[' . $var_name . ']', 'no', $var_value == 'no') . Form::getCloseCombo($i_after);
                 break;
             case "language":
                 //drop down language
                 $langs = Docebo::langManager()->getAllLangCode();
                 $html .= Form::getDropdown($lang->def('_' . strtoupper($var_name)), $var_name, 'option[' . $var_name . ']', $langs, array_search($var_value, $langs), $i_after);
                 break;
             case "template":
                 //drop down template
                 $templ = getTemplateList();
                 $html .= Form::getDropdown($lang->def('_' . strtoupper($var_name)), $var_name, 'option[' . $var_name . ']', $templ, array_search($var_value, $templ), $i_after);
                 break;
             case "hteditor":
                 //drop down hteditor
                 $ht_edit = getHTMLEditorList();
                 $html .= Form::getDropdown($lang->def('_' . strtoupper($var_name)), $var_name, 'option[' . $var_name . ']', $ht_edit, $var_value, $i_after);
                 break;
             case "layout_chooser":
                 //drop down hteditor
                 $layout = array('left' => Lang::t('_LAYOUT_LEFT'), 'over' => Lang::t('_LAYOUT_OVER'), 'right' => Lang::t('_LAYOUT_RIGHT'));
                 $html .= Form::getDropdown($lang->def('_' . strtoupper($var_name)), $var_name, 'option[' . $var_name . ']', $layout, $var_value, $i_after);
                 break;
             case "pubflow_method_chooser":
                 //drop down hteditor
                 $options = array('onestate' => Lang::t('_PUBFLOW_ONESTATE'), 'twostate' => Lang::t('_PUBFLOW_TWOSTATE'), 'advanced' => Lang::t('_PUBFLOW_ADVANCED'));
                 $html .= Form::getDropdown($lang->def('_' . strtoupper($var_name)), $var_name, 'option[' . $var_name . ']', $options, $var_value, $i_after);
                 break;
             case "field_select":
                 require_once $GLOBALS['where_framework'] . '/lib/lib.field.php';
                 $fl = new FieldList();
                 $all_fields = $fl->getAllFields();
                 $fields = array();
                 foreach ($all_fields as $key => $val) {
                     $fields[$val[FIELD_INFO_ID]] = $val[FIELD_INFO_TRANSLATION];
                 }
                 $html .= Form::getDropdown($lang->def('_' . strtoupper($var_name)), $var_name, 'option[' . $var_name . ']', $fields, $var_value, $i_after);
                 break;
             case "sel_sms_gateway":
                 $options = array('0' => Lang::t('_SMS_GATEWAY_AUTO'), '1' => Lang::t('_SMS_GATEWAY_1'), '2' => Lang::t('_SMS_GATEWAY_2'), '3' => Lang::t('_SMS_GATEWAY_3'), '4' => Lang::t('_SMS_GATEWAY_4'));
                 $html .= Form::getDropdown($lang->def('_' . strtoupper($var_name)), $var_name, 'option[' . $var_name . ']', $options, $var_value, $i_after);
                 break;
             case "menuvoice":
             case "menuvoice_course_public":
             case "layout_chooser":
                 //drop down hteditor
                 $layout = array('left' => Lang::t('_LAYOUT_LEFT'), 'over' => Lang::t('_LAYOUT_OVER'), 'right' => Lang::t('_LAYOUT_RIGHT'));
                 $html .= Form::getDropdown($lang->def('_' . strtoupper($var_name)), $var_name, 'option[' . $var_name . ']', $layout, $var_value, $i_after);
                 break;
             case "grpsel_chooser":
                 $layout = array('group' => $lang->def('_GROUPS'), 'orgchart' => $lang->def('_ORGCHART'));
                 $html .= Form::getDropdown($lang->def('_' . strtoupper($var_name)), $var_name, 'option[' . $var_name . ']', $layout, $var_value, $i_after);
                 break;
             case "tablist_coursecatalogue":
                 $lang_c =& DoceboLanguage::createInstance('catalogue', 'lms');
                 $tab_selected = unserialize(urldecode($var_value));
                 $tab_list = array('time' => $lang_c->def('_TAB_VIEW_TIME'), 'category' => $lang_c->def('_TAB_VIEW_CATEGORY'), 'all' => $lang_c->def('_ALL'));
                 if (Get::sett('use_coursepath') == '1') {
                     $tab_list['pathcourse'] = $lang_c->def('_COURSEPATH');
                 }
                 if (Get::sett('use_social_courselist') == 'on') {
                     $tab_list['mostscore'] = $lang_c->def('_TAB_VIEW_MOSTSCORE');
                     $tab_list['popular'] = $lang_c->def('_TAB_VIEW_MOSTPOPULAR');
                     $tab_list['recent'] = $lang_c->def('_TAB_VIEW_RECENT');
                 }
                 foreach ($tab_list as $tab_code => $name) {
                     $html .= Form::getCheckbox($name, 'tablist_' . $tab_code, 'tablist[' . $tab_code . ']', 1, isset($tab_selected[$tab_code]), '', $i_after);
                 }
                 break;
             case "first_coursecatalogue_tab":
                 $lang_c =& DoceboLanguage::createInstance('catalogue', 'lms');
                 $tab_list = array('time' => $lang_c->def('_TAB_VIEW_TIME'), 'category' => $lang_c->def('_TAB_VIEW_CATEGORY'), 'all' => $lang_c->def('_ALL'));
                 if (Get::sett('use_coursepath') == '1') {
                     $tab_list['pathcourse'] = $lang_c->def('_COURSEPATH');
                 }
                 if (Get::sett('use_social_courselist') == 'on') {
                     $tab_list['mostscore'] = $lang_c->def('_TAB_VIEW_MOSTSCORE');
                     $tab_list['popular'] = $lang_c->def('_TAB_VIEW_MOSTPOPULAR');
                     $tab_list['recent'] = $lang_c->def('_TAB_VIEW_RECENT');
                 }
                 $html .= Form::getDropdown($lang->def('_' . strtoupper($var_name)), $var_name, 'option[' . $var_name . ']', $tab_list, $var_value, $i_after);
                 break;
             case "tablist_mycourses":
                 //$var_value=deformat($var_value);
                 $arr_value = explode(',', $var_value);
                 //$arr_value=array();
                 $tab_list = array();
                 $tab_list[''] = $lang->def('_MYCOURSES_NOTUSED');
                 $tab_list['status'] = $lang->def('_STATUS');
                 $tab_list['name'] = $lang->def('_NAME');
                 $tab_list['code'] = $lang->def('_CODE');
                 $html .= '<div class="form_line_l"><p>' . '<label class="floating">' . $lang->def('_' . strtoupper($var_name)) . '</label></p>';
                 for ($i = 0; $i < 3; $i++) {
                     $html .= Form::getInputDropdown('dropdown', $var_name . '_' . $i, "mycourses[{$i}]", $tab_list, isset($arr_value[$i]) ? $arr_value[$i] : '', '');
                 }
                 $html .= $i_after . '</div>';
                 break;
             case "point_field":
                 require_once $GLOBALS['where_framework'] . '/lib/lib.field.php';
                 $fl = new FieldList();
                 $all_fields = $fl->getAllFields();
                 $fields[0] = $lang->def('_NO_VALUE');
                 foreach ($all_fields as $key => $val) {
                     $fields[$val[FIELD_INFO_ID]] = $val[FIELD_INFO_TRANSLATION];
                 }
                 $html .= Form::getDropdown($lang->def('_' . strtoupper($var_name)), $var_name, 'option[' . $var_name . ']', $fields, $var_value, $i_after);
                 break;
             case "rest_auth_sel_method":
                 $value_set = array($lang->def('_REST_AUTH_UCODE') => 0, $lang->def('_REST_AUTH_TOKEN') => 1);
                 $html .= Form::getRadioSet($lang->def('_REST_AUTH_SEL_METHOD'), $var_name, 'option[' . $var_name . ']', $value_set, $var_value, $i_after);
                 break;
                 // Common types
             // Common types
             case "password":
                 $html .= Form::getPassword($lang->def('_' . strtoupper($var_name)), $var_name, 'option[' . $var_name . ']', $max_size, $var_value, $i_after);
                 break;
             case "textarea":
                 $html .= Form::getSimpletextarea($lang->def('_' . strtoupper($var_name)), $var_name, 'option[' . $var_name . ']', $var_value, $i_after);
                 break;
             case "check":
                 $html .= Form::getCheckbox($lang->def('_' . strtoupper($var_name)), $var_name, 'option[' . $var_name . ']', 1, $var_value == 1, '', '', $i_after . ' ');
                 break;
             case "enum":
                 $html .= Form::getCheckbox($lang->def('_' . strtoupper($var_name)), $var_name . '_on', 'option[' . $var_name . ']', 'on', $var_value == 'on', '', '', $i_after . ' ');
                 break;
             default:
                 //string or int
                 $html .= Form::getTextfield($lang->def('_' . strtoupper($var_name)), $var_name, 'option[' . $var_name . ']', $max_size, $var_value, false, $i_after);
         }
     }
     return $html;
 }
Example #7
0
<?php

$_header = Lang::t('_CHOOSE_EXPORT_FORMAT', 'dashboard');
$_body = "";
$_body .= Form::openForm('export_report_dialog_form', 'index.php?modname=report&op=show_results&of_platform=lms&idrep=' . (int) $id_report);
$_body .= Form::getHidden('idrep', 'idrep', $id_report);
$_body .= Form::getRadioSet(Lang::t('_FORMAT', 'standard'), 'report_format', 'dl', array(Lang::t('_EXPORT_HTML', 'report') => 'htm', Lang::t('_EXPORT_CSV', 'report') => 'csv', Lang::t('_EXPORT_XLS', 'report') => 'xls'), 'htm');
$_body .= Form::closeForm();
if (isset($json)) {
    $output = array('success' => true, 'header' => $_header, 'body' => $_body);
    echo $json->encode($output);
} else {
}
Example #8
0
function modscorm()
{
    checkPerm('mod');
    require_once _lms_ . '/lib/lib.coursereport.php';
    require_once _base_ . '/lib/lib.form.php';
    require_once _base_ . '/lib/lib.table.php';
    // XXX: Initializaing
    $id_report = Get::req('id_report', DOTY_INT, 0);
    $lang =& DoceboLanguage::createInstance('coursereport', 'lms');
    $out =& $GLOBALS['page'];
    $out->setWorkingZone('content');
    // XXX: undo
    if (isset($_POST['undo'])) {
        jumpTo('index.php?modname=coursereport&amp;op=coursereport');
    }
    // XXX: Retrive all colums (test and so), and set it
    if ($id_report == 0) {
        $info_report = array('id_report' => importVar('id_report', true, 0), 'title' => importVar('title'), 'max_score' => importVar('max_score', true), 'required_score' => importVar('required_score', true), 'weight' => importVar('weight', true), 'show_to_user' => importVar('show_to_user', false, 'true'), 'use_for_final' => importVar('use_for_final', false, 'true'), 'source_of' => '', 'id_source' => '0');
    } elseif (!isset($_POST['save'])) {
        $query_report = "\r\n\t\tSELECT id_report, title, max_score, required_score, weight, show_to_user, use_for_final, source_of, id_source\r\n\t\tFROM " . $GLOBALS['prefix_lms'] . "_coursereport\r\n\t\tWHERE id_course = '" . $_SESSION['idCourse'] . "' AND id_report = '" . $id_report . "'\r\n\t\t\t\tAND source_of = 'activity' AND id_source = '0'";
        $info_report = sql_fetch_assoc(sql_query($query_report));
    }
    $page_title = array('index.php?modname=coursereport&amp;op=coursereport' => $lang->def('_COURSEREPORT', 'menu_course'), strip_tags($lang->def('_ADD_ACTIVITY')));
    $out->add(getTitleArea($page_title, 'coursereport') . '<div class="std_block">' . getBackUi('index.php?modname=coursereport&amp;op=coursereport', $lang->def('_BACK')));
    // XXX: Save input if needed
    if (isset($_POST['save']) && is_numeric($_POST['id_source'])) {
        $report_man = new CourseReportManager();
        // check input
        if ($_POST['titolo'] == '') {
            $_POST['titolo'] = $lang->def('_NOTITLE');
        }
        //MODIFICHE NUOVISSIMISSIME
        $query_report = "\r\n\t\tSELECT  *\r\n\t\tFROM " . $GLOBALS['prefix_lms'] . "_scorm_items\r\n\t\tWHERE idscorm_item=" . $_POST['id_source'];
        //echo $query_report;
        $risultato = sql_query($query_report);
        $titolo2 = sql_fetch_assoc($risultato);
        // if module title is equals to main title don't append it
        if ($titolo2['title'] != $_POST['titolo']) {
            $_POST['titolo'] = $_POST['titolo'] . " - " . addslashes($titolo2['title']);
        }
        $_POST['title'] = $_POST['titolo'];
        $re_check = $report_man->checkActivityData($_POST);
        if (!$re_check['error']) {
            if ($id_report == 0) {
                $numero = $report_man->getNextSequence();
                $query_ins_report = "\r\n\t\t\t\tINSERT INTO " . $GLOBALS['prefix_lms'] . "_coursereport\r\n\t\t\t\t( id_course, title, max_score, required_score, weight, show_to_user, use_for_final, source_of, id_source, sequence ) VALUES (\r\n\t\t\t\t\t'" . $_SESSION['idCourse'] . "',\r\n\t\t\t\t\t'" . $_POST['title'] . "',\r\n\t\t\t\t\t'0',\r\n\t\t\t\t\t'0',\r\n\t\t\t\t\t'" . $_POST['weight'] . "',\r\n\t\t\t\t\t'" . $_POST['show_to_user'] . "',\r\n\t\t\t\t\t'" . $_POST['use_for_final'] . "',\r\n\t\t\t\t\t'" . $_POST['source_of'] . "',\r\n\t\t\t\t\t'" . $_POST['id_source'] . "',\r\n\t\t\t\t\t'" . $numero . "'\r\n\t\t\t\t)";
                echo $query_ins_report;
                $re = sql_query($query_ins_report);
            } else {
                $query_upd_report = "\r\n\t\t\t\tUPDATE " . $GLOBALS['prefix_lms'] . "_coursereport\r\n\t\t\t\tSET title = '" . $_POST['title'] . "',\r\n\t\t\t\t\tweight = '" . $_POST['weight'] . "',\r\n\t\t\t\t\tmax_score = '0',\r\n\t\t\t\t\trequired_score = '0',\r\n\t\t\t\t\tuse_for_final = '" . $_POST['use_for_final'] . "',\r\n\t\t\t\t\tshow_to_user = '******'show_to_user'] . "'\r\n\t\t\t\tWHERE id_course = '" . $_POST['id_course'] . "' AND id_report = '" . $id_report . "'";
                $re = sql_query($query_upd_report);
            }
            Util::jump_to('index.php?modname=coursereport&amp;op=coursereport&result=' . ($re ? 'ok' : 'err'));
        } else {
            $out->add(getErrorUi($re_check['message']));
        }
    }
    if (isset($_POST['filtra'])) {
        if ($_POST['source_of'] == 'scoitem' && is_numeric($_POST['title'])) {
            //richiesto lo scorm item
            $query_report = "\r\n\t\t\tSELECT  title\r\n\t\t\tFROM " . $GLOBALS['prefix_lms'] . "_organization\r\n\t\t\tWHERE objectType='scormorg' and idResource=" . (int) $_POST['title'] . "";
            $risultato = sql_query($query_report);
            $titolo = sql_fetch_assoc($risultato);
            $titolo = $titolo['title'];
            $query_report = "\r\n\t\t\tSELECT  *\r\n\t\t\tFROM " . $GLOBALS['prefix_lms'] . "_scorm_items\r\n\t\t\tWHERE idscorm_organization=" . (int) $_POST['title'] . "\r\n\t\t\tORDER BY idscorm_item";
            //echo $query_report;
            $risultato = sql_query($query_report);
            while ($scorm = sql_fetch_assoc($risultato)) {
                $array_scorm[$scorm['idscorm_item']] = $scorm['title'];
            }
            $out->add(Form::openForm('addscorm', 'index.php?modname=coursereport&amp;op=addscorm') . Form::openElementSpace() . Form::getHidden('id_report', 'id_report', $id_report) . Form::getDropdown($lang->def('_SCORM_ITEM'), 'id_source', 'id_source', $array_scorm, $info_report['id_source']) . Form::getTextfield($lang->def('_WEIGHT'), 'weight', 'weight', '11', $info_report['weight']) . Form::getDropdown($lang->def('_SHOW_TO_USER'), 'show_to_user', 'show_to_user', array('true' => $lang->def('_YES'), 'false' => $lang->def('_NO')), $info_report['show_to_user']) . Form::getDropdown($lang->def('_USE_FOR_FINAL'), 'use_for_final', 'use_for_final', array('true' => $lang->def('_YES'), 'false' => $lang->def('_NO')), $info_report['use_for_final']) . Form::getHidden('title', 'title', $_POST['title']) . Form::getHidden('source_of', 'source_of', $_POST['source_of']) . Form::getHidden('titolo', 'titolo', $titolo) . Form::closeElementSpace() . Form::openButtonSpace() . Form::getButton('save', 'save', $lang->def('_SAVE')) . Form::getButton('undo', 'undo', $lang->def('_UNDO')) . Form::closeButtonSpace() . Form::closeForm() . '</div>');
        }
    }
    // XXX: Write in output
    $page_title = array('index.php?modname=coursereport&amp;op=coursereport' => $lang->def('_COURSEREPORT', 'menu_course'), strip_tags($lang->def('_ADD_ACTIVITY')));
    if (!isset($_POST['filtra'])) {
        $query_report = "\r\n\t\t\tSELECT  idResource,title\r\n\t\t\tFROM " . $GLOBALS['prefix_lms'] . "_organization\r\n\t\t\tWHERE objectType='scormorg' and idCourse=" . $_SESSION['idCourse'] . "";
        $risultato = sql_query($query_report);
        while ($scorm = sql_fetch_assoc($risultato)) {
            $array_scorm[$scorm['idResource']] = $scorm['title'];
        }
        $out->add(Form::openForm('addscorm', 'index.php?modname=coursereport&amp;op=addscorm') . Form::openElementSpace() . Form::getHidden('id_report', 'id_report', $id_report) . Form::getDropdown($lang->def('_TITLE'), 'title', 'title', $array_scorm, $info_report['title']) . Form::getRadioSet($lang->def('_SCORE'), 'source_of', 'source_of', array("Scorm Item" => 'scoitem'), 'scoitem') . Form::closeElementSpace() . Form::openButtonSpace() . Form::getButton('filtra', 'filtra', $lang->def('_SAVE')) . Form::getButton('undo', 'undo', $lang->def('_UNDO')) . Form::closeButtonSpace() . Form::closeForm() . '</div>');
    }
}
function create()
{
    checkPerm('mod');
    require_once $GLOBALS['where_lms'] . '/lib/lib.course.php';
    require_once _base_ . '/lib/lib.table.php';
    require_once _base_ . '/lib/lib.form.php';
    $lang =& DoceboLanguage::createInstance('certificate', 'lms');
    $id_certificate = importVar('id_certificate', true, 0);
    $id_meta = array();
    $acl_man =& Docebo::user()->getAclManager();
    $first = true;
    $tot_element = 0;
    $out =& $GLOBALS['page'];
    $out->setWorkingZone('content');
    $tb = new Table(Get::sett('visuItem'), $lang->def('_META_CERTIFICATE_CREATE_CAPTION'), $lang->def('_META_CERTIFICATE_CREATE_CAPTION'));
    $tb->initNavBar('ini', 'button');
    $ini = $tb->getSelectedElement();
    $query = "SELECT idMetaCertificate" . " FROM " . $GLOBALS['prefix_lms'] . "_certificate_meta" . " WHERE idCertificate = '" . $id_certificate . "'";
    $result = sql_query($query);
    while (list($id_meta_temp) = sql_fetch_row($result)) {
        $id_meta[] = $id_meta_temp;
    }
    $query = "SELECT idCourse, idUser" . " FROM " . $GLOBALS['prefix_lms'] . "_courseuser" . " WHERE status = '" . _CUS_END . "'";
    $result = sql_query($query);
    $user_course_completed = array();
    while (list($id_course_t, $id_user_t) = sql_fetch_row($result)) {
        $user_course_completed[$id_user_t][$id_course_t] = $id_course_t;
    }
    $query = "SELECT idMetaCertificate, title" . " FROM " . $GLOBALS['prefix_lms'] . "_certificate_meta";
    $result = sql_query($query);
    $array_title = array();
    while (list($id_meta_t, $title_t) = sql_fetch_row($result)) {
        $array_title[$id_meta_t] = $title_t;
    }
    $query = "SELECT idUser, idMetaCertificate, COUNT(*)" . " FROM " . $GLOBALS['prefix_lms'] . "_certificate_meta_course" . " GROUP BY idUser, idMetaCertificate";
    $result = sql_query($query);
    $array_control = array();
    while (list($id_user_t, $id_meta_t, $control_t) = sql_fetch_row($result)) {
        $array_control[$id_user_t][$id_meta_t] = $control_t;
    }
    if (isset($_POST['undo_filter_create'])) {
        unset($_POST['filter_username']);
        unset($_POST['filter_firstname']);
        unset($_POST['filter_lastname']);
        unset($_POST['filter_release_status']);
    }
    $query = "SELECT m.idUser, u.lastname, u.firstname, u.userid" . " FROM " . $GLOBALS['prefix_lms'] . "_certificate_meta_course as m" . " JOIN " . $GLOBALS['prefix_fw'] . "_user as u ON u.idst = m.idUser" . " WHERE m.idMetaCertificate IN (" . implode(',', $id_meta) . ")" . (isset($_POST['filter_username']) ? "AND u.userid LIKE '%" . $_POST['filter_username'] . "%'" : '') . (isset($_POST['filter_firstname']) ? "AND u.firstname LIKE '%" . $_POST['filter_firstname'] . "%'" : '') . (isset($_POST['filter_lastname']) ? "AND u.lastname LIKE '%" . $_POST['filter_lastname'] . "%'" : '') . " GROUP BY m.idUser, u.lastname, u.firstname, u.userid" . " ORDER BY u.lastname, u.firstname, u.userid";
    $result = sql_query($query);
    while (list($id_user, $lastname, $firstname, $userid) = sql_fetch_row($result)) {
        foreach ($id_meta as $idmeta) {
            if (isset($array_control[$id_user][$idmeta]) && $array_control[$id_user][$idmeta]) {
                $title = strip_tags($array_title[$idmeta]);
                $query = "SELECT idCourse" . " FROM " . $GLOBALS['prefix_lms'] . "_certificate_meta_course" . " WHERE idUser = '******'" . " AND idMetaCertificate = '" . $idmeta . "'";
                $result_int = sql_query($query);
                $control = true;
                while (list($id_course) = sql_fetch_row($result_int)) {
                    if (!isset($user_course_completed[$id_user][$id_course])) {
                        $control = false;
                    }
                }
                if ($control) {
                    $tot_element++;
                    if ($tot_element > $ini && $tot_element <= $ini + Get::sett('visuItem')) {
                        list($is_released) = sql_fetch_row(sql_query("SELECT COUNT(*)" . " FROM " . $GLOBALS['prefix_lms'] . "_certificate_meta_assign" . " WHERE idUser = '******'" . " AND idMetaCertificate = '" . $idmeta . "'"));
                        if (!isset($_POST['filter_release_status']) || isset($_POST['filter_release_status']) && $_POST['filter_release_status'] == 0 || isset($_POST['filter_release_status']) && $_POST['filter_release_status'] == '1' && $is_released == 1 || isset($_POST['filter_release_status']) && $_POST['filter_release_status'] == '2' && $is_released == 0) {
                            if ($first) {
                                $first = false;
                                $type_h = array('', '', '', 'image', 'image', 'image');
                                $cont_h = array($lang->def('_FULLNAME'), $lang->def('_USERNAME'), $lang->def('_TITLE'), Get::img('standard/view.png', Lang::t('_PREVIEW', 'certificate')), Get::img('course/certificate.png', Lang::t('_TAKE_A_COPY', 'certificate')), '<img src="' . getPathImage('lms') . 'standard/delete.png" alt="' . $lang->def('_ALT_REM_META_CERT') . ' : ' . strip_tags($title) . '" />');
                                $tb->setColsStyle($type_h);
                                $tb->addHead($cont_h);
                            }
                            $cont = array();
                            $cont[] = $lastname . ' ' . $firstname;
                            $cont[] = $acl_man->relativeId($userid);
                            $cont[] = $title;
                            $cont[] = '<a href="index.php?modname=meta_certificate&amp;op=preview_cert&amp;id_certificate=' . $id_certificate . '&amp;idmeta=' . $idmeta . '&amp;iduser='******'">' . Get::img('standard/view.png', Lang::t('_PREVIEW', 'certificate') . ' : ' . strip_tags($title)) . '</a>';
                            $cont[] = '<a href="index.php?modname=meta_certificate&amp;op=release_cert&amp;id_certificate=' . $id_certificate . '&amp;idmeta=' . $idmeta . '&amp;iduser='******'">' . Get::img('course/certificate.png', Lang::t('_TAKE_A_COPY', 'certificate') . ' : ' . strip_tags($title)) . '</a>';
                            if ($is_released) {
                                $cont[] = '<a href="index.php?modname=meta_certificate&amp;op=del_released&amp;id_certificate=' . $id_certificate . '&amp;idmeta=' . $idmeta . '&amp;iduser='******'">' . '<img src="' . getPathImage('lms') . 'standard/delete.png" alt="' . $lang->def('_ALT_REM_META_CERT') . ' : ' . strip_tags($title) . '" /></a>';
                            } else {
                                $cont[] = '';
                            }
                            $tb->addBody($cont);
                        }
                    }
                }
            }
        }
    }
    require_once _base_ . '/lib/lib.dialog.php';
    setupHrefDialogBox('a[href*=del_released]');
    $array_release_status = array($lang->def('_ALL') => '0', $lang->def('_ONLY_RELEASED') => '1', $lang->def('_ONLY_NOT_RELEASED') => '2');
    if ($first) {
        $out->add(getTitleArea($lang->def('_TITLE_META_CERTIFICATE_CREATE'), 'certificate') . '<div class="std_block">');
        if (isset($_POST['filter'])) {
            $out->add(Form::openForm('meta_certificate_filter', 'index.php?modname=meta_certificate&op=create&id_certificate=' . $id_certificate) . Form::openElementSpace() . Form::getTextfield($lang->def('_USERNAME'), 'filter_username', 'filter_username', '255', isset($_POST['filter_username']) ? $_POST['filter_username'] : '') . Form::getTextfield($lang->def('_FIRSTNAME'), 'filter_firstname', 'filter_firstname', '255', isset($_POST['filter_firstname']) ? $_POST['filter_firstname'] : '') . Form::getTextfield($lang->def('_LASTNAME'), 'filter_lastname', 'filter_lastname', '255', isset($_POST['filter_lastname']) ? $_POST['filter_lastname'] : '') . Form::getRadioSet($lang->def('_RELEASE_STATUS_FILTER'), 'filter_release_status', 'filter_release_status', $array_release_status, isset($_POST['filter_release_status']) ? $_POST['filter_release_status'] : '0') . Form::closeElementSpace() . Form::openButtonSpace() . Form::getButton('filter', 'filter', $lang->def('_FILTER')) . Form::getButton('undo_filter_create', 'undo_filter_create', $lang->def('_UNDO_FILTER')) . Form::closeButtonSpace() . Form::closeForm());
        }
        $out->add($lang->def('_NO_USER_FOUND') . getBackUi('index.php?modname=meta_certificate&amp;op=meta_certificate', $lang->def('_BACK')) . '</div>');
    } else {
        $out->add(getTitleArea($lang->def('_TITLE_META_CERTIFICATE_CREATE'), 'certificate') . '<div class="std_block">');
        if (isset($_GET['result'])) {
            switch ($_GET['result']) {
                case "ok":
                    $out->add(getResultUi($lang->def('_OPERATION_SUCCESSFUL')));
                    break;
                case "err_del_cert":
                    $out->add(getErrorUi($lang->def('_OPERATION_FAILURE')));
                    break;
            }
        }
        $out->add(Form::openForm('meta_certificate_filter', 'index.php?modname=meta_certificate&op=create&id_certificate=' . $id_certificate) . Form::openElementSpace() . Form::getTextfield($lang->def('_USERNAME'), 'filter_username', 'filter_username', '255', isset($_POST['filter_username']) ? $_POST['filter_username'] : '') . Form::getTextfield($lang->def('_FIRSTNAME'), 'filter_firstname', 'filter_firstname', '255', isset($_POST['filter_firstname']) ? $_POST['filter_firstname'] : '') . Form::getTextfield($lang->def('_LASTNAME'), 'filter_lastname', 'filter_lastname', '255', isset($_POST['filter_lastname']) ? $_POST['filter_lastname'] : '') . Form::getRadioSet($lang->def('_RELEASE_STATUS_FILTER'), 'filter_release_status', 'filter_release_status', $array_release_status, isset($_POST['filter_release_status']) ? $_POST['filter_release_status'] : '0') . Form::closeElementSpace() . Form::openButtonSpace() . Form::getButton('filter', 'filter', $lang->def('_FILTER')) . Form::getButton('undo_filter_create', 'undo_filter_create', $lang->def('_UNDO_FILTER')) . Form::closeButtonSpace() . $tb->getTable() . $tb->getNavBar($ini, $tot_element) . Form::closeForm() . getBackUi('index.php?modname=meta_certificate&amp;op=meta_certificate', $lang->def('_BACK')) . '</div>');
    }
}
Example #10
0
<?php

echo getTitleArea(array('index.php?r=alms/communication/show' => Lang::t('_COMMUNICATIONS', 'communication'), Lang::t('_ADD', 'communication')));
?>
<div class="std_block">
<?php 
echo Form::openForm('add_comm', 'index.php?r=alms/communication/insert', false, false, 'multipart/form-data') . Form::getHidden('title', 'title', 255, Get::req('title', DOTY_MIXED, $data['title'])) . Form::openElementSpace() . Form::getTextfield(Lang::t('_TITLE', 'communication'), 'title', 'title', 255, Get::req('title', DOTY_MIXED, $data['title'])) . Form::getDatefield(Lang::t('_DATE', 'communication'), 'publish_date', 'publish_date', Get::req('publish_date', DOTY_MIXED, $data['publish_date'])) . Form::getRadioSet(Lang::t('_TYPE', 'communication'), 'type_of', 'type_of', array(Lang::t('_NONE', 'communication') => 'none', Lang::t('_LONAME_item', 'storage') => 'file', Lang::t('_LONAME_scormorg', 'storage') => 'scorm'), Get::req('type_of', DOTY_STRING, $data['type_of'])) . Form::getTextarea(Lang::t('_DESCRIPTION', 'communication'), 'description', 'description', Get::req('description', DOTY_MIXED, $data['description'])) . '<div class="quick_search_form qsf_left">' . '<div class="form_line_l">' . '<label class="label_effect" for="set_course">' . Lang::t('_COURSE', 'course') . '</label>&nbsp;' . Form::getInputTextfield('search_t', 'set_course', 'set_course', '', '', 255, '') . '<div id="set_course_container"></div>' . '</div>' . '</div>' . Form::getHidden('id_course', 'id_course', $data['id_course']) . Form::getHidden('id_category', 'id_category', $data['id_category']) . Form::closeElementSpace() . Form::openButtonSpace() . Form::getButton('save', 'save', Lang::t('_SAVE', 'communication')) . Form::getButton('undo', 'undo', Lang::t('_UNDO', 'communication')) . Form::closeButtonSpace() . Form::closeForm();
?>
</div>
<script type="text/javascript">
//courses autocomplete
YAHOO.util.Event.onDOMReady(function() {
	var oDS = new YAHOO.util.XHRDataSource('ajax.adm_server.php?mn=course&plf=lms&op=course_autocomplete');
	oDS.responseType = YAHOO.util.XHRDataSource.TYPE_JSON;
	oDS.responseSchema = {
		resultsList : "courses",
		fields: ["cname", "id_course", "code", "name", "code_highlight", "name_highlight", "has_editions", "editions", "has_classrooms", "classrooms"]
	};

	var oAC = new YAHOO.widget.AutoComplete("set_course", "set_course_container", oDS);
	oAC.forceSelection = true;
	oAC.useShadow = true;
	oAC.resultTypeList = false;
	oAC.formatResult = function(oResultData, sQuery, sResultMatch) {
		return (oResultData.code_highlight != "" ? '['+oResultData.code_highlight+'] ' : '')+oResultData.name_highlight;
	};
	oAC.itemSelectEvent.subscribe(function(sType, oArgs) {
		var D = YAHOO.util.Dom;
		D.get('id_course').value = oArgs[2].id_course;
	});
	oAC.generateRequest = function(sQuery) { return "&results=20&query=" + sQuery; };
Example #11
0
function importquest()
{
    checkPerm('view', false, 'storage');
    $lang =& DoceboLanguage::createInstance('test');
    $idTest = importVar('idTest', true, 0);
    $back_url = urldecode(importVar('back_url'));
    $back_coded = htmlentities(urlencode($back_url));
    require_once _base_ . '/lib/lib.form.php';
    $form = new Form();
    require_once $GLOBALS['where_lms'] . '/lib/lib.quest_bank.php';
    $qb_man = new QuestBankMan();
    $supported_format = $qb_man->supported_format();
    unset($supported_format[-1]);
    $title = array('index.php?modname=test&op=modtestgui&idTest=' . $idTest . '&back_url=' . $back_coded => $lang->def('_TEST_SECTION'), $lang->def('_IMPORT'));
    cout(getTitleArea($title, 'quest_bank') . '<div class="std_block">' . $form->openForm('import_form', 'index.php?modname=test&op=doimportquest', false, false, 'multipart/form-data') . $form->openElementSpace() . '<input type="hidden" name="idTest" value="' . $idTest . '" />' . '<input type="hidden" name="back_url" value="' . $back_coded . '" />' . $form->getFilefield($lang->def('_FILE'), 'import_file', 'import_file') . $form->getRadioSet($lang->def('_TYPE'), 'file_format', 'file_format', array_flip($supported_format), 0) . $form->getTextfield(Lang::t('_LANG_CHARSET', 'admin_lang'), 'file_encode', 'file_encode', 255, 'utf-8') . $form->closeElementSpace() . $form->openButtonSpace() . $form->getButton('save', 'save', $lang->def('_IMPORT')) . $form->getButton('undo', 'undo', $lang->def('_UNDO')) . $form->closeButtonSpace() . $form->closeForm() . '</div>', 'content');
}
Example #12
0
 /**
  * display the field for filters
  *
  * @param	string	$field_id		the id of the field used for id/name
  * @param 	mixed 	$value 			(optional) the value to put in the field
  *										retrieved from $_POST if not given
  * @param	string	$label			(optional) the label to use if not given the
  *									value will be retrieved from custom field
  *									$id_field
  * @param	string	$field_prefix 	(optional) the prefix to give to
  *									the field id/name
  * @param 	string 	$other_after 	optional html code added after the input element
  * @param	string 	$other_before 	optional html code added before the label element
  * @param   mixed 	$field_special	(optional) not used
  *
  * @return string 	of field xhtml code
  *
  * @access public
  */
 function play_filter($id_field, $value = FALSE, $label = FALSE, $field_prefix = FALSE, $other_after = '', $other_before = '', $field_special = FALSE)
 {
     require_once _base_ . '/lib/lib.form.php';
     $lang =& DoceboLanguage::createInstance('field');
     if ($value === FALSE) {
         echo "Trallallero: " . Field::getFieldValue_Filter($_POST, $id_field, $field_prefix, 'false');
         if (Field::getFieldValue_Filter($_POST, $id_field, $field_prefix, 'false') == 'false') {
             $value = 'false';
         } else {
             $value = 'true';
         }
     }
     if ($label === FALSE) {
         $re_field = sql_query("\r\n\t\t\tSELECT translation\r\n\t\t\tFROM " . Field::_getMainTable() . "\r\n\t\t\tWHERE id_common = '" . (int) $id_field . "' AND type_field = '" . Field_Upload::getFieldType() . "'");
         list($label) = sql_fetch_row($re_field);
     }
     return Form::getRadioSet($label, Field::getFieldId_Filter($id_field, $field_prefix), Field::getFieldName_Filter($id_field, $field_prefix), array($lang->def('_YES') => 'true', $lang->def('_NO') => 'false'), $value, $other_after, $other_before);
 }
Example #13
0
<?php

echo Form::openForm('upd_lang', 'ajax.adm_server.php?r=adm/lang/updatelang') . "<b>" . Lang::t('_LANGUAGE', 'admin_lang') . ":</b> " . $lang->lang_code . Form::gethidden('lang_code', 'lang_code', $lang->lang_code) . Form::getTextfield(Lang::t('_DESCRIPTION', 'standard'), 'lang_description', 'lang_description', 255, $lang->lang_description) . Form::getRadioSet(Lang::t('_ORIENTATION', 'admin_lang'), 'lang_direction', 'lang_direction', array(Lang::t('_DIRECTION_LTR', 'admin_lang') => 'ltr', Lang::t('_DIRECTION_RTL', 'admin_lang') => 'rtl'), $lang->lang_direction) . Form::getTextfield(Lang::t('_LANG_BROWSERCODE', 'admin_lang'), 'lang_browsercode', 'lang_browsercode', 255, $lang->lang_browsercode) . Form::closeForm();
<?php

echo getTitleArea(Lang::t('_ORG_CHART_IMPORT_USERS', 'organization_chart'), 'directory_group');
echo '<div class="std_block">';
echo Form::getFormHeader(Lang::t('_ASSIGN_USERS', 'admin_directory'));
echo Form::openForm('directory_importgroupuser', 'index.php?r=' . $this->link . '/importusers_step2', false, false, 'multipart/form-data');
echo Form::getHidden('id_group', 'id_group', $id_group);
echo Form::openElementSpace();
echo Form::getFilefield(Lang::t('_GROUP_USER_IMPORT_FILE', 'admin_directory'), 'file_import', 'file_import');
echo Form::getRadioSet(Lang::t('_GROUP_USER_IMPORT_SEPARATOR', 'admin_directory'), 'import_separator', 'import_separator', array(Lang::t('_AUTODETECT', 'standard') => 'auto', '<b>,</b>' => 'comma', '<b>;</b>' => 'dotcomma', Lang::t('_MANUAL', 'standard') . ':&nbsp;' . Form::getInputTextfield('', 'import_separator_manual', 'import_separator_manual', "", "", 255) => 'manual'), 'auto');
echo Form::getCheckbox(Lang::t('_GROUP_USER_IMPORT_HEADER', 'admin_directory'), 'import_first_row_header', 'import_first_row_header', 'true', true);
echo Form::getTextfield(Lang::t('_GROUP_USER_IMPORT_CHARSET', 'admin_directory'), 'import_charset', 'import_charset', 20, 'UTF-8');
echo Form::closeElementSpace();
echo Form::openButtonSpace();
echo Form::getButton('import_groupuser_2', 'import_groupuser_2', Lang::t('_NEXT', 'standard'));
echo Form::getButton('import_groupcancel', 'import_groupcancel', Lang::t('_UNDO', 'standard'));
echo Form::closeButtonSpace();
echo Form::closeForm();
echo '</div>';
Example #15
0
function importquest(&$url)
{
    require_once _lib_ . '/lib.form.php';
    $lang =& DoceboLanguage::createInstance('test');
    $form = new Form();
    require_once _lms_ . '/lib/lib.quest_bank.php';
    $qb_man = new QuestBankMan();
    $supported_format = array_flip($qb_man->supported_format());
    require_once _lms_ . '/lib/lib.questcategory.php';
    $quest_categories = array(0 => $lang->def('_NONE'));
    $cman = new Questcategory();
    $arr = $cman->getCategory();
    foreach ($arr as $id_category => $name_category) {
        $quest_categories[$id_category] = $name_category;
    }
    unset($arr);
    $title = array($url->getUrl() => $lang->def('_QUEST_BANK', 'menu_course'), $lang->def('_IMPORT'));
    cout(getTitleArea($title, 'quest_bank') . '<div class="std_block">' . $form->openForm('import_form', $url->getUrl('op=doimportquest'), false, false, 'multipart/form-data') . $form->openElementSpace() . $form->getFilefield($lang->def('_FILE'), 'import_file', 'import_file') . $form->getRadioSet($lang->def('_FILE_FORMAT'), 'file_format', 'file_format', $supported_format, 0) . $form->getTextfield($lang->def('_FILE_ENCODE'), 'file_encode', 'file_encode', 255, 'utf-8') . $form->getDropdown($lang->def('_QUEST_CATEGORY'), 'quest_category', 'quest_category', $quest_categories) . $form->closeElementSpace() . $form->openButtonSpace() . $form->getButton('undo', 'undo', $lang->def('_UNDO')) . $form->getButton('quest_search', 'quest_search', $lang->def('_IMPORT')) . $form->closeButtonSpace() . $form->closeForm() . '</div>', 'content');
}