public function __construct($mvc_name) { parent::__construct($mvc_name); require_once _base_ . '/lib/lib.json.php'; $this->json = new Services_JSON(); $this->acl_man =& Docebo::user()->getAclManager(); }
function drawCalendar() { checkPerm('view'); $size = importVar('size', false, 'max'); $width = "90%"; if ($size == "min") { $width = "200px"; } addCss('calendar_' . $size); YuiLib::load('base,dragdrop'); Util::get_js(Get::rel_path('lms') . '/modules/calendar/calendar.js', true, true); Util::get_js(Get::rel_path('lms') . '/modules/calendar/calendar_helper.js', true, true); //permissions = permissions granted to the logged user according to his/her level and role // 2 => can create/delete/modify all events // 1 => can create/delete/modify only own events // 0 => can view only $permissions = 0; if (checkPerm('mod', true)) { $permissions = 2; } elseif (checkPerm('personal', true)) { $permissions = 1; } //mode="edit" => events can be added and edited according to given permissions //mode="view" => events can only be viewed regardless the permissions $GLOBALS['page']->add('<script type="text/javascript">' . ' setup_cal( null, ' . '\'lms\', ' . '\'lms\', ' . '\'edit\', ' . '\'' . $permissions . '\', ' . '\'' . Docebo::user()->getIdSt() . '\' ' . ');' . '</script>', 'page_head'); $GLOBALS['page']->add("\n" . getTitleArea(Lang::t('_CALENDAR', 'calendar'), 'calendar') . '<div class="std_block">' . '<div id="displayCalendar" style="clear: both; width:' . $width . '"></div>' . '<div class="nofloat"></div>' . '</div>', 'content'); }
public function connectedToUser($network_code, $user_idst = false) { $res = false; $user_idst = $user_idst > 0 ? $user_idst : getLogUserId(); if (!isset($this->_userinfo[$user_idst])) { $acl_man = Docebo::user()->getAclManager(); $this->_userinfo[$user_idst] = $acl_man->getUser($user_idst, false); } switch ($network_code) { case 'twitter': $res = !empty($this->_userinfo[$user_idst][ACL_INFO_TWITTER_ID]); break; case 'linkedin': $res = !empty($this->_userinfo[$user_idst][ACL_INFO_LINKEDIN_ID]); break; case 'facebook': $res = !empty($this->_userinfo[$user_idst][ACL_INFO_FACEBOOK_ID]); break; case 'google': $res = !empty($this->_userinfo[$user_idst][ACL_INFO_GOOGLE_ID]); break; case 'google_apps': $res = true; break; } return $res; }
/** * @return string the actual template name */ function getTemplate() { // If saved in session use this one if (isset($_SESSION['template']) && $_SESSION['template'] != false) { return $_SESSION['template']; } //search for a template associated to the current host $plat_templ = parseTemplateDomain($_SERVER['HTTP_HOST']); if ($plat_templ != false) { $_SESSION['template'] = $plat_templ; return $plat_templ; } // search template according to the org_chart_tree option if (!Docebo::user()->isAnonymous()) { $qtxt = "SELECT associated_template FROM\r\n\t\t\t%adm_org_chart_tree\r\n\t\t\tWHERE associated_template IS NOT NULL AND\r\n\t\t\tidst_oc IN (" . implode(',', Docebo::user()->getArrSt()) . ")\r\n\t\t\tORDER BY iLeft DESC\r\n\t\t\tLIMIT 0,1"; $re = sql_query($qtxt); if (mysql_num_rows($re) > 0) { list($template_code) = sql_fetch_row($re); setTemplate($template_code); return $_SESSION['template']; } } // search for the default template $_SESSION['template'] = getDefaultTemplate(); return $_SESSION['template']; }
function assignVar() { $this->id = importVar("id"); $this->calEventClass = importVar("calEventClass"); $this->start_year = importVar("start_year"); $this->start_month = importVar("start_month"); $this->start_day = importVar("start_day"); $this->_year = $this->start_year; $this->_month = $this->start_month; $this->_day = $this->start_day; $this->start_hour = importVar("start_hour"); $this->start_min = importVar("start_min"); $this->start_sec = importVar("start_sec"); $this->end_year = importVar("end_year"); $this->end_month = importVar("end_month"); $this->end_day = importVar("end_day"); $this->end_hour = importVar("end_hour"); $this->end_min = importVar("end_min"); $this->end_sec = importVar("end_sec"); $this->title = importVar("title"); $this->description = importVar("description"); $this->_owner = importVar("_owner"); if (!$this->_owner) { $this->_owner == Docebo::user()->getIdSt(); } $this->category = importVar("category"); $this->private = importVar("private"); }
function organization_categorize_save(&$treeView, $idItem) { require_once _lms_ . '/lib/lib.kbres.php'; $folder = $treeView->tdb->getFolderById($idItem); $data = $folder->otherValues; $res_id = Get::req('res_id', DOTY_INT, 0); $name = Get::req('r_name', DOTY_STRING, ""); $original_name = Get::req('original_name', DOTY_STRING, ""); $desc = Get::req('r_desc', DOTY_STRING, ""); $r_item_id = Get::req('r_item_id', DOTY_INT, 0); $type = Get::req('r_type', DOTY_STRING, ""); $env = Get::req('r_env', DOTY_STRING, ""); $env_parent_id = Get::req('r_env_parent_id', DOTY_INT, 0); $param = ''; //Get::req('', DOTY_STRING, ""); $alt_desc = ''; $lang_id = Get::req('r_lang', DOTY_INT, ""); $lang_arr = Docebo::langManager()->getAllLangCode(); $lang = $lang_arr[$lang_id]; $force_visible = Get::req('force_visible', DOTY_INT, 0); $is_mobile = Get::req('is_mobile', DOTY_INT, 0); $folders = Get::req('h_selected_folders', DOTY_STRING, ""); $json_tags = Util::strip_slashes(Get::req('tag_list', DOTY_STRING, "[]")); $kbres = new KbRes(); $res_id = $kbres->saveResource($res_id, $name, $original_name, $desc, $r_item_id, $type, $env, $env_parent_id, $param, $alt_desc, $lang, $force_visible, $is_mobile); $json_tags = str_replace("[", "", $json_tags); $json_tags = str_replace("]", "", $json_tags); $json_tags = str_replace('"', "", $json_tags); $json_tags = str_replace("\\", "", $json_tags); $tags_arr = explode(",", $json_tags); if ($res_id > 0) { $kbres->setResourceTags($res_id, $tags_arr); $kbres->assignToFolders($res_id, explode(',', $folders)); } }
public function init() { parent::init(); require_once _base_ . '/lib/lib.json.php'; $this->model = new AdminrulesAdm(); $this->json = new Services_JSON(); $this->acl_man =& Docebo::user()->getAclManager(); }
public function init() { YuiLib::load('base,tabview'); Lang::init('course'); $this->model = new VideoconferenceLms(Docebo::user()->getIdSt()); $upd = new UpdatesLms(); $this->info = $upd->videoconferenceCounterUpdates(); }
/** * This constructor require the source file name * @param array $params the array of params * - 'filename' => name of the file (required) * - 'first_row_header' => bool TRUE if first row is header (Optional, default = TRUE ) * - 'separator' => string a char with the fields separator (Optional, default = ,) **/ function __construct($params) { if ($params !== NULL) { $this->set_config($params); } $this->aclm = Docebo::aclm(); $this->cols_descriptor = array(array(DOCEBOIMPORT_COLNAME => Lang::t('_TYPE'), DOCEBOIMPORT_COLID => 'admin_type', DOCEBOIMPORT_COLMANDATORY => true, DOCEBOIMPORT_DATATYPE => 'text', DOCEBOIMPORT_DEFAULT => ''), array(DOCEBOIMPORT_COLNAME => Lang::t('_PROFILE'), DOCEBOIMPORT_COLID => 'profile', DOCEBOIMPORT_COLMANDATORY => true, DOCEBOIMPORT_DATATYPE => 'text', DOCEBOIMPORT_DEFAULT => ''), array(DOCEBOIMPORT_COLNAME => Lang::t('_USERNAME'), DOCEBOIMPORT_COLID => 'username', DOCEBOIMPORT_COLMANDATORY => true, DOCEBOIMPORT_DATATYPE => 'text', DOCEBOIMPORT_DEFAULT => ''), array(DOCEBOIMPORT_COLNAME => Lang::t('_FOLDER_NAME'), DOCEBOIMPORT_COLID => 'folder_name', DOCEBOIMPORT_COLMANDATORY => false, DOCEBOIMPORT_DATATYPE => 'text', DOCEBOIMPORT_DEFAULT => 'root'), array(DOCEBOIMPORT_COLNAME => Lang::t('courses'), DOCEBOIMPORT_COLID => 'courses', DOCEBOIMPORT_COLMANDATORY => false, DOCEBOIMPORT_DATATYPE => 'text', DOCEBOIMPORT_DEFAULT => 'root')); }
/** * Return the link for the logout * @return <type> */ public static function logout() { $res = ""; if (!Docebo::user()->isAnonymous()) { $res .= '<a href="index.php?action=logout">' . Get::img('standard/exit.png', Lang::t('_LOG_LOGOUT')) . Lang::t('_LOG_LOGOUT') . '</a>'; } return $res; }
public function __construct() { require_once _base_ . '/lib/lib.preference.php'; $this->preference = new AdminPreference(); $this->acl_man =& Docebo::user()->getAclManager(); $this->rules_path = '/framework/adminrules/'; $this->rules_cache = NULL; }
public function init() { parent::init(); require_once _base_ . '/lib/lib.json.php'; $this->json = new Services_JSON(); $this->acl_man =& Docebo::user()->getAclManager(); $this->model = new TransactionAlms(); $this->permissions = array('view' => checkPerm('view', true, 'transaction', 'lms'), 'mod' => checkPerm('mod', true, 'transaction', 'lms'), 'del' => checkPerm('mod', true, 'transaction', 'lms')); }
public function __construct() { require_once _base_ . '/lib/lib.preference.php'; $this->preference = new AdminPreference(); $this->acl_man =& Docebo::user()->getAclManager(); list($idst) = each($this->acl_man->getGroupsIdstFromBasePath('/framework/level/admin')); $this->idst_admin_group = $idst; $this->model_adminrules = new AdminrulesAdm(); }
function sl_sal_getUserName() { /*$dbconn = $GLOBALS['dbConn']; $result = sql_query("SELECT surname,name FROM ".$GLOBALS['prefix_lms']."_user WHERE idUser="******""); list($surname, $name) = mysql_fetch_array($result);*/ $aclManager = Docebo::user()->getACLManager(); $arr_result = $aclManager->getUser(Docebo::user()->getIdSt(), FALSE); return $arr_result[ACL_INFO_LASTNAME] . ',' . $arr_result[ACL_INFO_FIRSTNAME]; }
public function init() { require_once _base_ . '/lib/lib.json.php'; $this->db = DbConn::getInstance(); $this->model = new MessageLms(); $this->json = new Services_JSON(); $this->aclManager = Docebo::user()->getAClManager(); $this->can_send = true; //checkPerm('send_all', true) || checkPerm('send_upper', true); }
/** * function learning_Object() * class constructor **/ function Learning_Object($id = NULL, $environment = false) { $this->id = $id; $this->environment = $environment ? $environment : 'course_lo'; $this->idAuthor = ''; $this->title = ''; $this->db = DbConn::getInstance(); $this->aclManager = Docebo::user()->getAclManager(); $this->table = ''; }
public function __construct($id_course = 0, $id_edition = 0) { require_once _lms_ . '/lib/lib.edition.php'; require_once _lms_ . '/lib/lib.course.php'; $this->edition_man = new EditionManager(); $this->course_man = new Man_Course(); $this->acl_man =& Docebo::user()->getAclManager(); $this->id_course = $id_course; $this->id_edition = $id_edition; }
public static function find_files() { $files = false; $files = Docebo::cache()->get('plugin_files'); if ($files === false) { $files = self::file_substituton(_plugins_); Docebo::cache()->set('plugin_files', $files); } return $files; }
function checkRole($roleid, $return_value = true) { if (Docebo::user()->matchUserRole($roleid)) { return true; } if ($return_value) { return false; } else { die("You can't access"); } }
function actionEvent(&$event) { require_once $GLOBALS['where_lms'] . '/lib/lib.subscribe.php'; parent::actionEvent($event); $acl_man =& Docebo::user()->getACLManager(); // recover event information $id_user = $event->getProperty('userdeleted'); $man_subs = new CourseSubscribe_Management(); $man_subs->unsubscribeUserFromAllCourses($id_user); return true; }
public function init() { checkPerm('view', false, 'course', 'lms'); require_once _base_ . '/lib/lib.json.php'; $this->json = new Services_JSON(); $this->acl_man =& Docebo::user()->getAclManager(); $this->base_link_course = 'alms/course'; $this->base_link_edition = 'alms/edition'; $this->base_link_subscription = 'alms/subscription'; $this->permissions = array('view' => checkPerm('view', true, 'course', 'lms'), 'add' => checkPerm('add', true, 'course', 'lms'), 'mod' => checkPerm('mod', true, 'course', 'lms'), 'del' => checkPerm('del', true, 'course', 'lms'), 'moderate' => checkPerm('moderate', true, 'course', 'lms'), 'subscribe' => checkPerm('subscribe', true, 'course', 'lms')); }
public function init() { YuiLib::load('base,tabview'); Lang::init('course'); $this->path_course = $GLOBALS['where_files_relative'] . '/appLms/' . Get::sett('pathcourse') . '/'; $this->model = new HomecatalogueLms(); $this->model_catalog = new CatalogLms(); require_once _base_ . '/lib/lib.json.php'; $this->json = new Services_JSON(); $this->acl_man =& Docebo::user()->getAclManager(); }
function lmsLoginOperation() { require_once $GLOBALS['where_lms'] . '/lib/lib.subscribe.php'; require_once $GLOBALS['where_lms'] . '/lib/lib.preassessment.php'; $pa_man = new AssessmentList(); $user_course_as_assessment = $pa_man->getUserAssessmentSubsription(Docebo::user()->getArrSt()); if (is_array($user_course_as_assessment)) { $subs_man = new CourseSubscribe_Management(); $subs_man->multipleUserSubscribe(getLogUserId(), $user_course_as_assessment['course_list'], $user_course_as_assessment['level_number']); } }
function loadBody() { //global $op, $modname, $prefix; if (file_exists('modules/' . $this->module_name . '/' . $this->module_name . '.php')) { //include('modules/'.$this->module_name.'/'.$this->module_name.'.php'); include Docebo::inc(_adm_ . '/modules/' . $this->module_name . '/' . $this->module_name . '.php'); } else { //include('../appLms/admin/modules/'.$this->module_name.'/'.$this->module_name.'.php'); include Docebo::inc(_lms_ . '/admin/modules/' . $this->module_name . '/' . $this->module_name . '.php'); } }
public function __construct($id_course = 0, $id_date = 0) { require_once _lms_ . '/lib/lib.date.php'; require_once _lms_ . '/lib/lib.course.php'; $this->id_course = $id_course; $this->id_date = $id_date; $this->db = DbConn::getInstance(); $this->classroom_man = new DateManager(); $this->course_man = new Man_Course(); $this->acl_man =& Docebo::user()->getAclManager(); }
public function completedTask() { $model = new AssessmentLms(); $courselist = $model->findAll(array('cu.iduser = :id_user', 'cu.status = :status', 'c.course_type = ":course_type"'), array(':id_user' => Docebo::user()->getId(), ':status' => _CUS_END, ':course_type' => 'assessment')); //check courses accessibility $keys = array_keys($courselist); for ($i = 0; $i < count($keys); $i++) { $courselist[$keys[$i]]['can_enter'] = Man_Course::canEnterCourse($courselist[$keys[$i]]); } $this->render('courselist', array('path_course' => $this->path_course, 'courselist' => $courselist)); }
public function init() { checkPerm('view', false, 'pcourse'); require_once _base_ . '/lib/lib.json.php'; $this->json = new Services_JSON(); $this->acl_man =& Docebo::user()->getAclManager(); $this->model = new ClassroomAlms(); $this->base_link_course = 'lms/pcourse'; $this->base_link_classroom = 'lms/pclassroom'; $this->base_link_subscription = 'lms/psubscription'; $this->permissions = array('view' => checkPerm('view', true, 'pcourse'), 'add' => checkPerm('add', true, 'pcourse'), 'mod' => checkPerm('mod', true, 'pcourse'), 'del' => checkPerm('del', true, 'pcourse'), 'moderate' => checkPerm('moderate', true, 'pcourse'), 'subscribe' => checkPerm('subscribe', true, 'pcourse')); $this->_mvc_name = 'classroom'; }
function getFolderFormIdst(&$arr_idst) { $acl_man =& Docebo::user()->getAclManager(); $groups_id = $acl_man->getGroupsId($arr_idst); $folder_name = $this->tree_db->getFoldersCurrTranslationDoubleCheck($groups_id); $branch_name = array(); while (list($id, $groupid) = each($groups_id)) { $id_dir = split('_', $groupid); $branch_name[$id]['name'] = $folder_name[$id_dir[1]]; $branch_name[$id]['type_of_folder'] = $id_dir[0] == '/oc' ? ORG_CHART_NORMAL : ORG_CHART_WITH_DESCENDANTS; } return $branch_name; }
function reportList() { checkPerm('view'); require_once _base_ . '/lib/lib.table.php'; $lang =& DoceboLanguage::createInstance('report', 'framework'); $_SESSION['report_tempdata'] = array(); $can_mod = checkPerm('mod', true); $acl_man = Docebo::aclm(); $public_admin_mod = true; $query = "SELECT t1.*, t2.userid \r\n\tFROM %lms_report_filter as t1 \r\n\t\tLEFT JOIN %adm_user as t2 ON t1.author=t2.idst\r\n\tWHERE t1.is_public = 1 OR t1.author = " . Docebo::user()->getId(); $tb = new Table(); $tb->initNavBar('ini', 'button'); $col_type = array('', 'align_center', 'align_center', 'image'); $col_content = array($lang->def('_NAME'), $lang->def('_TAB_REP_CREATOR', 'report', 'framework'), $lang->def('_CREATION_DATE'), '<img src="' . getPathImage() . 'standard/view.png" alt="' . $lang->def('REPORT_SHOW_RESULTS') . '" title="' . $lang->def('REPORT_SHOW_RESULTS') . '" />'); if ($public_admin_mod && $can_mod) { $col_type[] = 'image'; $col_content[] = '<img src="' . getPathImage() . 'standard/edit.png" alt="' . $lang->def('_MOD') . '" title="' . $lang->def('_MOD') . '"/>'; $col_type[] = 'image'; $col_content[] = '<img src="' . getPathImage() . 'standard/delete.png" alt="' . $lang->def('_DEL') . '" title="' . $lang->def('_DEL') . '"/>'; } $tb->setColsStyle($col_type); $tb->addHead($col_content); $res = sql_query($query); if ($res) { while ($row = sql_fetch_assoc($res)) { $id = $row['id_filter']; $opn_link = '<a href="index.php?modname=public_report_admin&op=view_report&idrep=' . $id . '" ' . ' title="' . $lang->def('REPORT_SHOW_RESULTS', 'report', 'framework') . '">' . '<img src="' . getPathImage() . 'standard/view.png" alt="' . $lang->def('REPORT_SHOW_RESULTS', 'report', 'framework') . '" />' . '</a>'; $tb_content = array($row['author'] == 0 ? $lang->def($row['filter_name']) : $row['filter_name'], $row['author'] == 0 ? '<div class="align_center">-</div>' : $acl_man->relativeId($row['userid']), Format::date($row['creation_date']), $opn_link); if ($public_admin_mod && $can_mod) { if ($row['author'] == Docebo::user()->getId()) { $tb_content[] = '<a href="index.php?modname=public_report_admin&op=modify_name&modid=' . $id . '" ' . ' title="' . $lang->def('_MOD', 'report', 'framework') . '">' . '<img src="' . getPathImage() . 'standard/edit.png" alt="' . $lang->def('_MOD', 'report', 'framework') . '" />' . '</a>'; } else { $tb_content[] = ''; } if ($row['author'] == Docebo::user()->getId()) { $tb_content[] = '<a href="index.php?modname=public_report_admin&op=del_public_report&idrep=' . $id . '" ' . ' title="' . $lang->def('_DEL', 'report', 'framework') . '">' . '<img src="' . getPathImage() . 'standard/delete.png" alt="' . $lang->def('_DEL', 'report', 'framework') . '" />' . '</a>'; } else { $tb_content[] = ''; } } $tb->addBody($tb_content); } } require_once _base_ . '/lib/lib.dialog.php'; setupHrefDialogBox('a[href*=del_public_report]'); if ($public_admin_mod && $can_mod) { $tb->addActionAdd('<a href="index.php?modname=public_report_admin&op=create_name">' . '<img src="' . getPathImage() . 'standard/add.png" title="' . $lang->def('_NEW') . '" /> ' . $lang->def('_NEW') . '</a>'); } cout(getTitleArea($lang->def('_REPORT')) . '<div class="std_block">' . $tb->getTable() . '</div>', 'content'); }
public function getCourseUsers($idCourse) { $output = false; $query = "SELECT cu.idUser, u.userid FROM %lms_courseuser as cu JOIN %adm_user as u ON (u.idst=cu.idUser) WHERE cu.idCourse=" . (int) $idCourse; $res = $this->db->query($query); if ($res) { $output = array(); $acl_man = Docebo::user()->getAclManager(); while (list($idUser, $userName) = $this->db->fetch_row($res)) { $output[$idUser] = $acl_man->relativeId($userName); } } return $output; }