Exemplo n.º 1
0
 public function getTransaction($start_index, $results, $sort, $dir, $filter = false)
 {
     $query = "SELECT t.id_trans, t.date_creation, t.date_activated, t.paid, SUM(ti.price) as price, u.userid, u.firstname, u.lastname" . " FROM %adm_transaction as t" . " JOIN %adm_transaction_info as ti ON t.id_trans = ti.id_trans" . " JOIN %adm_user as u ON t.id_user = u.idst" . " WHERE 1";
     $query .= " GROUP BY t.id_trans";
     switch ($sort) {
         case 'userid':
             $query .= " ORDER BY u.userid " . $dir;
             break;
         case 'firstname':
             $query .= " ORDER BY u.firstname " . $dir;
             break;
         case 'lastname':
             $query .= " ORDER BY u.lastname " . $dir;
             break;
         case 'date_creation':
             $query .= " ORDER BY t.date_creation " . $dir;
             break;
         case 'date_activated':
             $query .= " ORDER BY t.date_activated " . $dir;
             break;
     }
     $start_index === false ? '' : ($query .= " LIMIT " . $start_index . ", " . $results);
     $result = sql_query($query);
     $res = array();
     while ($row = sql_fetch_assoc($result)) {
         $row['userid'] = $this->acl_man->relativeId($row['userid']);
         $row['date_creation'] = Format::date($row['date_creation'], 'datetime');
         $row['date_activated'] = Format::date($row['date_activated'], 'datetime');
         $row['paid'] = $row['paid'] == 1 ? Get::img('standard/status_active.png', Lang::t('_ACTIVATED', 'transaction')) : Get::img('standard/status_deactive.png', Lang::t('_NOT_ACTIVATED', 'transaction'));
         $row['edit'] = '<a href="index.php?r=alms/transaction/mod&amp;id_trans=' . $row['id_trans'] . '" title="' . Lang::t('_MOD', 'transaction') . '">' . Get::img('standard/edit.png', Lang::t('_MOD', 'transaction')) . '</a>';
         $res[] = $row;
     }
     return $res;
 }
Exemplo n.º 2
0
 protected function getDateClassrooms($id_date)
 {
     $query = "SELECT DISTINCT classroom" . " FROM %lms_course_date_day" . " WHERE id_date = " . $id_date;
     $result = sql_query($query);
     $array_classroom = array();
     while (list($id_classroom) = sql_fetch_row($result)) {
         $array_classroom[$id_classroom] = $id_classroom;
     }
     $res = '';
     $first = true;
     if (isset($array_classroom[0])) {
         $first = false;
         $res .= Lang::t('_NOT_ASSIGNED', 'admin_date');
     }
     $query = "SELECT name" . " FROM %lms_classroom" . " WHERE idClassroom IN (" . implode(',', $array_classroom) . ")" . " ORDER BY name";
     $result = sql_query($query);
     while (list($name) = sql_fetch_row($result)) {
         if ($first) {
             $first = false;
             $res .= $name;
         } else {
             $res .= ', ' . $name;
         }
     }
     return $res;
 }
Exemplo n.º 3
0
 public function getLabelsTask()
 {
     $start_index = Get::req('startIndex', DOTY_INT, 0);
     $results = Get::req('results', DOTY_MIXED, Get::sett('visuItem', 25));
     $sort = Get::req('sort', DOTY_MIXED, 'title');
     $dir = Get::req('dir', DOTY_MIXED, 'asc');
     $labels = $this->model->getLabels($start_index, $results, $sort, $dir);
     $total_label = $this->model->getTotalLabelsCount();
     $list = array();
     $first = true;
     $count = count($labels);
     $counter = 0;
     foreach ($labels as $value) {
         $position = "";
         if ($first) {
             $position .= 'first';
             $first = false;
         }
         $counter++;
         if ($counter == $count) {
             $position .= 'last';
         }
         $list[] = array('id_common_label' => $value[LABEL_ID_COMMON], 'title' => $value[LABEL_TITLE], 'description' => $this->_formatDescription($value[LABEL_DESCRIPTION], 100), 'position' => $position, 'sequence' => $value[LABEL_SEQUENCE], 'mod' => '<a href="index.php?r=alms/label/mod&amp;id_common_label=' . $value[LABEL_ID_COMMON] . '" title="' . Lang::t('_MOD', 'label') . '">' . Get::img('standard/edit.png', Lang::t('_MOD', 'label')) . '</a>', 'del' => 'ajax.adm_server.php?r=alms/label/dellabel&id_common_label=' . $value[LABEL_ID_COMMON]);
     }
     $result = array('totalRecords' => $total_label, 'startIndex' => $start_index, 'sort' => $sort, 'dir' => $dir, 'rowsPerPage' => $results, 'results' => count($list), 'records' => $list);
     echo $this->json->encode($result);
 }
 public function exportIt($return)
 {
     return parent::exportIt($return);
     $filename = $return['classname'] . "_" . date('Ymd');
     $xls = new Excel($filename);
     //$filename = $return['classname'] . "_" . date('Ymd') . ".xls";
     //header("Content-Disposition: attachment; filename=\"$filename\"");
     //header("Content-Type: application/vnd.ms-excel");
     //$flag = false;
     $xls->home();
     foreach ($return['objs'] as $key => $obj) {
         foreach ($obj as $name => $value) {
             $xls->label(Lang::t($name));
             $xls->right();
         }
         break;
     }
     $xls->down();
     //print("\n");
     foreach ($return['objs'] as $key => $obj) {
         $xls->home();
         foreach ($obj as $name => $value) {
             $xls->label($value);
             $xls->right();
         }
         $xls->down();
     }
     $xls->send();
     exit;
 }
Exemplo n.º 5
0
 public function actionIndex()
 {
     $this->hasPrivilege(Acl::ACTION_VIEW);
     $this->pageTitle = Lang::t(Common::pluralize($this->resourceLabel));
     $searchModel = Dept::model()->searchModel(array(), $this->settings[Constants::KEY_PAGINATION], 'name');
     $this->render('default/index', array('model' => $searchModel));
 }
Exemplo n.º 6
0
 /**
  * @param int $id contains the resource id
  * @param string $back_url contains the back url (not used yet)
  */
 function del($id, $back_url = NULL)
 {
     //checkPerm('view', false, 'storage');
     unset($_SESSION['last_error']);
     require_once _base_ . '/lib/lib.upload.php';
     $path_to_file = '/appLms/' . Get::sett('pathlesson');
     list($old_file) = sql_fetch_row(sql_query("\r\n\t\tSELECT path \r\n\t\tFROM " . $GLOBALS['prefix_lms'] . "_materials_lesson \r\n\t\tWHERE idLesson = '" . $id . "'"));
     $size = Get::file_size($GLOBALS['where_files_relative'] . $path_to_file . $old_file);
     if ($old_file != '') {
         sl_open_fileoperations();
         if (!sl_unlink($path_to_file . $old_file)) {
             sl_close_fileoperations();
             $_SESSION['last_error'] = Lang::t('_OPERATION_FAILURE', 'item');
             return false;
         }
         sl_close_fileoperations();
         if (isset($_SESSION['idCourse']) && defined("LMS")) {
             $GLOBALS['course_descriptor']->subFileToUsedSpace(false, $size);
         }
     }
     $delete_query = "\r\n\t\tDELETE FROM " . $GLOBALS['prefix_lms'] . "_materials_lesson \r\n\t\tWHERE idLesson = '" . $id . "'";
     if (!sql_query($delete_query)) {
         $_SESSION['last_error'] = Lang::t('_OPERATION_FAILURE', 'item');
         return false;
     }
     return $id;
 }
Exemplo n.º 7
0
 public function actionIndex()
 {
     $this->hasPrivilege();
     $this->pageTitle = Lang::t($this->resourceLabel . 's');
     $searchModel = ConsoleTasks::model()->searchModel(array(), $this->settings[Constants::KEY_PAGINATION]);
     $this->render('index', array('model' => $searchModel));
 }
Exemplo n.º 8
0
    public function getAddEditForm($form_url, $data)
    {
        $this->loadJs();
        $res = '';
        $e = false;
        if ($data['rule_id'] > 0) {
            $e = true;
        }
        $res .= Form::openForm('main_form', $form_url);
        $res .= Form::openElementSpace() . Form::getTextfield(Lang::t('_FROM', 'test'), 'from_score', 'from_score', 11, $e ? $data['from_score'] : '') . Form::getTextfield(Lang::t('_TO', 'test'), 'to_score', 'to_score', 11, $e ? $data['to_score'] : '') . '<br />' . '<p class="section_title">' . Lang::t('_COMPETENCES', 'test') . '</p>' . '<div id="competence_box"></div>' . '<div class="form_line_l">
					<p><label for="input_add_competence" class="floating">' . Lang::t('_NAME', 'test') . '</label></p>
					<div class="form_autocomplete_container">
					<input type="text" maxlength="255" value="" name="input_add_competence" id="input_add_competence" class="textfield">
					<a href="" id="link_add_competence"><img alt="' . Lang::t('_ADD', 'test') . '" src="' . getPathImage() . 'standard/add.png" class="valing-middle"></a>
					<div id="box_autocomplete_competence"></div>
					</div>
				</div>' . '<br />' . '<p class="section_title">' . Lang::t('_COURSES', 'test') . '</p>' . '<div id="course_box"></div>' . '<div class="form_line_l">
					<p><label for="input_add_course" class="floating">' . Lang::t('_NEW_COURSE', 'test') . '</label></p>
					<div class="form_autocomplete_container">
					<input type="text" maxlength="255" value="" name="input_add_course" id="input_add_course" class="textfield">
					<a href="" id="link_add_course"><img alt="' . Lang::t('_ADD', 'test') . '" src="' . getPathImage() . 'standard/add.png" class="valing-middle"></a>
					<div id="box_autocomplete_course"></div>
					</div>
				</div>' . '<br /><br />' . Form::getTextarea(Lang::t('_FEEDBACK_TEXT', 'test'), 'feedback_txt', 'feedback_txt', $e ? $data['feedback_txt'] : '') . Form::getHidden('rule_id', 'rule_id', (int) $data['rule_id']) . Form::getHidden('competences_list', 'competences_list', '') . Form::getHidden('courses_list', 'courses_list', '') . Form::getHidden('test_id', 'test_id', (int) $data['test_id']) . Form::getHidden('category_id', 'category_id', (int) $data['category_id']) . Form::getHidden('save', 'save', '1') . Form::closeElementSpace() . Form::openButtonSpace() . Form::getButton('btn_save', 'btn_save', Lang::t('_SAVE', 'test')) . Form::getButton('btn_cancel', 'btn_cancel', Lang::t('_UNDO', 'test')) . Form::closeButtonSpace();
        $res .= Form::closeForm();
        $res .= '<script type="text/javascript">
			var course_ac_url="' . Get::rel_path('adm') . '/ajax.adm_server.php?mn=course&plf=lms&op=course_autocomplete&results=20' . '";
			var competence_ac_url="' . Get::rel_path('adm') . '/ajax.adm_server.php?r=adm/competences/competences_autocomplete' . '";
			var lang={"remove_item": "' . Lang::t('_DEL', 'test') . '"};
			var course_arr=' . ($e && !empty($data['courses_list']) ? $data['courses_list'] : '{}') . ';
			var competence_arr=' . ($e && !empty($data['competences_list']) ? $data['competences_list'] : '{}') . ';
			</script>';
        return $res;
    }
 public static function saveIt($arr_objects, $filename = "")
 {
     if ($filename == "") {
         $filename = date('Ymd') . ".xls";
     }
     //pr($arr_objects);
     $file = fopen($filename, "w+");
     //echo $filename;
     //header("Content-Disposition: attachment; filename=\"$filename\"");
     //header("Content-Type: application/vnd.ms-excel");
     $flag = false;
     $str = "";
     foreach ($arr_objects as $key => $obj) {
         foreach ($obj as $name => $value) {
             $str .= Lang::t($name) . "\t";
         }
         break;
     }
     $str .= "\n";
     foreach ($arr_objects as $key => $obj) {
         foreach ($obj as $name => $value) {
             $str .= $value . "\t";
         }
         $str .= "\n";
     }
     fwrite($file, $str);
     fclose($file);
     //exit;
     //pr($file);
     //pr($str);
 }
Exemplo n.º 10
0
 /**
  * function create()
  *
  * @param $back_url	the url where the function retutn at the end of the operation
  * @return nothing
  */
 function create($id_poll, $back_poll)
 {
     if (!sql_query("\r\n\t\tINSERT INTO " . $GLOBALS['prefix_lms'] . "_pollquest \r\n\t\t( id_poll, type_quest, title_quest, sequence, page ) VALUES \r\n\t\t( \t'" . $id_poll . "', \r\n\t\t\t'" . $this->getQuestionType() . "', \r\n\t\t\t'<span class=\"text_bold\">" . Lang::t('_QUEST_BREAK_PAGE') . "</span>',\r\n\t\t\t'" . $this->_getNextSequence($id_poll) . "', \r\n\t\t\t'" . $this->_getPageNumber($id_poll) . "' ) ")) {
         errorCommunication(def('_POLL_ERR_INS_QUEST') . getBackUi(Util::str_replace_once('&', '&amp;', $back_poll), Lang::t('_BACK')));
     }
     Util::jump_to('' . $back_poll);
 }
Exemplo n.º 11
0
 /**
  * function create()
  *
  * @param $back_url	the url where the function retutn at the end of the operation
  * @return nothing
  */
 function create($idTest, $back_test)
 {
     if (!sql_query("\r\n\t\tINSERT INTO " . $GLOBALS['prefix_lms'] . "_testquest \r\n\t\t( idTest, type_quest, title_quest, sequence, page, difficult ) VALUES \r\n\t\t( \t'" . $idTest . "', \r\n\t\t\t'" . $this->getQuestionType() . "', \r\n\t\t\t'<span class=\"text_bold\">" . Lang::t('_QUEST_BREAK_PAGE') . "</span>',\r\n\t\t\t'" . $this->_getNextSequence($idTest) . "', \r\n\t\t\t'" . $this->_getPageNumber($idTest) . "',\r\n\t\t\t'0') ")) {
         errorCommunication(def('_OPERATION_FAILURE') . getBackUi(Util::str_replace_once('&', '&amp;', $back_test), Lang::t('_BACK')));
     }
     Util::jump_to('' . $back_test);
 }
 public function mod()
 {
     $id_trans = Get::req('id_trans', DOTY_INT, 0);
     if (isset($_POST['undo'])) {
         Util::jump_to('index.php?r=alms/transaction/show');
     }
     if (isset($_POST['save']) || isset($_POST['not_paid'])) {
         $product_to_activate = Get::req('product', DOTY_MIXED, array());
         $id_user = Get::req('id_user', DOTY_MIXED, 0);
         if ($this->model->saveTransaction($product_to_activate, $id_trans, $id_user)) {
             $this->model->controlActivation($id_trans, isset($_POST['not_paid']));
             Util::jump_to('index.php?r=alms/transaction/show&res=ok');
         }
         Util::jump_to('index.php?r=alms/transaction/show&res=err');
     }
     $transaction_info = $this->model->getTransactionInfo($id_trans);
     $user_info = $this->acl_man->getUser($transaction_info['id_user'], false);
     $user_info[ACL_INFO_USERID] = $this->acl_man->relativeId($user_info[ACL_INFO_USERID]);
     require_once _base_ . '/lib/lib.table.php';
     $tb = new Table(false, Lang::t('_DETAILS', 'transaction'), Lang::t('_DETAILS', 'transaction'));
     $ts = array('', '', 'min-cell', 'image');
     $th = array(Lang::t('_CODE', 'transaction'), Lang::t('_NAME', 'transaction'), Lang::t('_PRICE', 'transaction'), Lang::t('_MARK_AS_PAID', 'transaction'));
     $tb->setColsStyle($ts);
     $tb->addHead($th);
     foreach ($transaction_info['product'] as $product_info) {
         $tb->addBody(array($product_info['code'], $product_info['name'], $product_info['price'], Form::getInputCheckbox('product_' . $product_info['id_course'] . '_' . $product_info['id_date'] . '_' . $product_info['id_edition'], 'product[' . $product_info['id_course'] . '_' . $product_info['id_date'] . '_' . $product_info['id_edition'] . ']', 1, $product_info['activated'], $product_info['activated'] ? ' disabled="disabled"' : '')));
     }
     $this->render('mod', array('transaction_info' => $transaction_info, 'user_info' => $user_info, 'tb' => $tb, 'id_trans' => $id_trans));
 }
Exemplo n.º 13
0
 function uppage()
 {
     checkPerm('view', false, 'storage');
     $back_url = urldecode($_POST['back_url']);
     $insert_query = "\r\n\tUPDATE " . $GLOBALS['prefix_lms'] . "_htmlpage\r\n\tSET title = '" . (trim($_POST['title']) == '' ? Lang::t('_NOTITLE', 'htmlpage', 'lms') : $_POST['title']) . "',\r\n\t\ttextof = '" . $_POST['textof'] . "'\r\n\tWHERE idPage = '" . (int) $_POST['idPage'] . "'";
     if (!sql_query($insert_query)) {
         $_SESSION['last_error'] = Lang::t('_OPERATION_FAILURE', 'htmlpage', 'lms');
         Util::jump_to($back_url . '&mod_result=0');
     }
     if ($_FILES) {
         $n = 0;
         foreach ($_FILES as $_FILE) {
             $n++;
             $file = save_file($_FILE);
             if ($file) {
                 $insert_query = "INSERT INTO " . $GLOBALS['prefix_lms'] . "_htmlpage_attachment SET file = '" . $file . "', title = '" . trim($_FILE['name']) . "', idpage = " . (int) $_POST['idPage'];
                 sql_query($insert_query);
             }
         }
     }
     if ($_POST['iddelattachment'] != '') {
         $ids = explode(';', $_POST['iddelattachment']);
         foreach ($ids as $id) {
             if ($id) {
                 $query = "DELETE FROM learning_htmlpage_attachment WHERE id = " . $id;
                 mysql_query($query);
             }
         }
     }
     require_once $GLOBALS['where_lms'] . '/class.module/track.object.php';
     Track_Object::updateObjectTitle($_POST['idPage'], 'htmlpage', $_POST['title']);
     Util::jump_to($back_url . '&id_lo=' . $_POST['idPage'] . '&mod_result=1');
 }
 public function show()
 {
     Util::get_js(Get::rel_path('base') . '/lib/js_utils.js', true, true);
     $rmodel = new AdminrulesAdm();
     switch (Get::req('res', DOTY_ALPHANUM, "")) {
         case 'ok_ins':
             UIFeedback::info(Lang::t('_OPERATION_SUCCESSFUL', 'standard'));
             break;
         case 'err_ins':
             UIFeedback::error(Lang::t('_OPERATION_FAILURE', 'standard'));
             break;
         default:
             if ($rmodel->totalGroup() <= 0) {
                 UIFeedback::notice(Lang::t('_NO_PROFILE_SET', 'adminrules'));
             }
             break;
     }
     $rules_list_js = "";
     if ($this->permissions['assign_profile']) {
         $rules = $rmodel->getGroupForDropdown();
         $rules_list_js .= '[';
         $first = true;
         foreach ($rules as $idst => $label) {
             $rules_list_js .= ($first ? '' : ',') . '{"label":"' . $label . '","value":' . $idst . '}';
             if ($first) {
                 $first = false;
             }
         }
         $rules_list_js .= ']';
     }
     $this->render('show', array('filter_text' => $this->_getSessionValue('filter', ""), 'permissions' => $this->permissions, 'rules_list_js' => $rules_list_js));
 }
Exemplo n.º 15
0
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');
}
Exemplo n.º 16
0
 public function actionIndex()
 {
     $this->hasPrivilege(Acl::ACTION_VIEW);
     $this->pageTitle = Lang::t($this->resourceLabel . 's');
     $this->showPageTitle = TRUE;
     $this->render('index', array('model' => UserResources::model()->searchModel(array(), $this->settings[Constants::KEY_PAGINATION], 'id')));
 }
Exemplo n.º 17
0
 /**
  * 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'));
 }
Exemplo n.º 18
0
 public function findByKey($key)
 {
     $model = $this->find('`key`=:t1', array(':t1' => $key));
     if ($model === null) {
         throw new CHttpException(404, Lang::t('404_error'));
     }
     return $model;
 }
Exemplo n.º 19
0
 public function afterValidate()
 {
     if (!$this->hasErrors()) {
         $this->sendEmail();
         $this->success_message = Lang::t('Check this email ({email}) for instructions on how to get a new password.If you don\'t get email please check your spam and mark it as "not spam"', array('{email}' => $this->user_model->email));
     }
     return parent::afterValidate();
 }
Exemplo n.º 20
0
 public function actionSchedule()
 {
     $this->hasPrivilege(Acl::ACTION_VIEW);
     $this->pageTitle = Lang::t(Common::pluralize($this->resourceLabel));
     $client = Yii::app()->user->client != 0 ? "sp_client = " . (int) Yii::app()->user->client : "";
     $searchModel = Services::model()->searchModel(array(), $this->settings[Constants::KEY_PAGINATION], 'service_name', $client);
     $this->render('index', array('model' => $searchModel));
 }
Exemplo n.º 21
0
 /**
  * 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;
 }
Exemplo n.º 22
0
 public function actionSub()
 {
     $this->hasPrivilege(Acl::ACTION_CREATE);
     $this->activeMenu = self::MENU_SUBS;
     $this->pageTitle = Lang::t($this->resourceLabel);
     $model = new Syncorder();
     $model_class_name = $model->getClassName();
     $this->render('index', array('model' => $model));
 }
Exemplo n.º 23
0
 public function constraints()
 {
     //err id => err msg
     $err = array();
     if (!isset($this->nama_depan)) {
         $err['nama_depan'] = Lang::t('err nama_depan empty');
     }
     return $err;
 }
Exemplo n.º 24
0
 public function constraints()
 {
     //err id => err msg
     $err = array();
     if (!isset($this->kelas_name)) {
         $err['kelas_name'] = Lang::t('err kelas_name empty');
     }
     return $err;
 }
Exemplo n.º 25
0
function checkFolderPerm()
{
    $res = '';
    $platform_folders = $_SESSION['platform_arr'];
    $file_to_check = array("config.php");
    $dir_to_check = array();
    $empty_dir_to_check = array();
    // common dir to check
    $dir_to_check = array('files/tmp', 'files/common/comment', 'files/common/iofiles', 'files/common/users');
    foreach ($platform_folders as $platform_code => $dir_name) {
        $specific_file_to_check = array();
        $specific_dir_to_check = array();
        if (!is_dir(_base_ . '/' . $dir_name . '/')) {
            $install[$platform_code] = FALSE;
        } else {
            $install[$platform_code] = TRUE;
            $empty_specific_dir_to_check = NULL;
            switch ($platform_code) {
                case "lms":
                    $specific_dir_to_check = array('files/appLms/certificate', 'files/appLms/chat', 'files/appLms/forum', 'files/appLms/htmlpages', 'files/appLms/item', 'files/appLms/label', 'files/appLms/message', 'files/appLms/project', 'files/appLms/repo_light', 'files/appLms/sponsor', 'files/appLms/test');
                    $empty_specific_dir_to_check = array('files/appLms/course', 'files/appLms/scorm');
                    break;
                case "framework":
                    $specific_dir_to_check = array('files/appCore/field', 'files/appCore/photo', 'files/appCore/newsletter', 'files/common/users');
                    break;
            }
            $dir_to_check = array_merge($dir_to_check, $specific_dir_to_check);
            $file_to_check = array_merge($file_to_check, $specific_file_to_check);
            if (is_array($specific_dir_to_check) && count($specific_dir_to_check) > 0 && is_array($empty_specific_dir_to_check)) {
                $empty_dir_to_check = array_merge($empty_dir_to_check, $empty_specific_dir_to_check);
            }
        }
    }
    // Write permission
    $checked_dir = array();
    foreach ($dir_to_check as $dir_name) {
        if (!is_dir(_base_ . '/' . $dir_name . '/')) {
            $checked_dir[] = $dir_name;
        } elseif (!is_writable(_base_ . '/' . $dir_name . '/')) {
            $checked_dir[] = $dir_name;
        }
    }
    if (!empty($checked_dir)) {
        $res .= '<h3>' . Lang::t('_CHECKED_DIRECTORIES') . '</h3>' . '<ul class="info"><li class="err">' . implode('</li><li class="err">', $checked_dir) . '</li></ul>';
    }
    $checked_file = array();
    foreach ($file_to_check as $file_name) {
        if (!is_writable(_base_ . '/' . $file_name)) {
            $checked_file[] = $file_name;
        }
    }
    if (!empty($checked_file)) {
        $res .= '<h3>' . Lang::t('_CHECKED_FILES') . '</h3>' . '<ul class="info"><li class="err">' . implode('</li><li class="err">', $checked_file) . '</li></ul>';
    }
    return $res;
}
 public function editTask()
 {
     YuiLib::load('colorpicker');
     $id = Get::req('id', DOTY_INT, -1);
     if ($id > 0) {
         $params = array('id' => $id, 'data' => $this->model->getTemplateData($id));
     } else {
         $params = array('error' => Lang::t('_INVALID_TEMPLATE', 'template'));
     }
     $this->render("edit", $params);
 }
Exemplo n.º 27
0
 public function init()
 {
     if (empty($this->deleteConfirmation)) {
         $this->deleteConfirmation = Lang::t('DELETE_CONFIRM');
     }
     if (empty($this->header)) {
         $this->header = 'Actions';
     }
     $this->htmlOptions['class'] = isset($this->htmlOptions['class']) ? $this->htmlOptions['class'] . ' button-column' : 'button-column';
     parent::init();
 }
Exemplo n.º 28
0
    public function createSend($buttonId, $formID, $errDivID, $log = 0)
    {
        $this->id = $buttonId;
        ?>
        <script type="text/javascript">
            $("<?php 
        echo $buttonId;
        ?>
").onClick(
                function () {
                    $("<?php 
        echo $formID;
        ?>
").send({
                        onSuccess: function () {
                            <?php 
        if ($log) {
            ?>
console.log(this.text);
                            <?php 
        }
        ?>
                            if (this.text == 1) {
                                lwrefresh('<?php 
        echo $_GET['parent_page'];
        ?>
');
                                lwclose(selected_page);
                            }
                            else {
                                $("<?php 
        echo $errDivID;
        ?>
").html('<?php 
        echo Lang::t('CrudSaveFailed');
        ?>
');
                            }
                        },
                        onFailure: function () {
                            $("<?php 
        echo $errDivID;
        ?>
").html('<?php 
        echo Lang::t('CrudSaveFailed');
        ?>
');
                            //console.log("Failed", this.text);
                        }
                    });
                });
        </script>
    <?php 
    }
Exemplo n.º 29
0
 public function constraints()
 {
     //err id => err msg
     $err = array();
     if (!isset($this->prog_name)) {
         $err['prog_name'] = Lang::t('Program name cannot be empty');
     }
     if (!isset($this->prog_pic)) {
         $err['prog_pic'] = Lang::t('Please provide program photo');
     }
     return $err;
 }
 public function constraints()
 {
     //err id => err msg
     $err = array();
     if (!isset($this->ads_pic)) {
         $err['ads_pic'] = Lang::t('Pic cannot be empty');
     }
     if (!isset($this->ads_url)) {
         $err['ads_url'] = Lang::t('Please provide URL');
     }
     return $err;
 }