diff --git a/main/admin/course_request_accepted.php b/main/admin/course_request_accepted.php index fe0e1499a3..01ca457e04 100755 --- a/main/admin/course_request_accepted.php +++ b/main/admin/course_request_accepted.php @@ -60,7 +60,10 @@ if ($course_validation_feature) { } } else { $link_to_setting = api_get_path(WEB_CODE_PATH).'admin/settings.php?category=Platform#course_validation'; - $message = sprintf(get_lang('PleaseActivateCourseValidationFeature'), sprintf('%s', $link_to_setting, get_lang('EnableCourseValidation'))); + $message = sprintf( + get_lang('PleaseActivateCourseValidationFeature'), + sprintf('%s', $link_to_setting, get_lang('EnableCourseValidation')) + ); $is_error_message = true; } @@ -125,7 +128,15 @@ function modify_filter($id) $result = ''. Display::return_icon('edit.png', get_lang('Edit'), array('style' => 'vertical-align: middle;')).''. ' '. - Display::return_icon('delete.png', get_lang('DeleteThisCourseRequest'), array('style' => 'vertical-align: middle;', 'onclick' => 'javascript: if (!confirm(\''.addslashes(api_htmlentities(sprintf(get_lang('ACourseRequestWillBeDeleted'), $code), ENT_QUOTES)).'\')) return false;')).''; + Display::return_icon( + 'delete.png', + get_lang('DeleteThisCourseRequest'), + array( + 'style' => 'vertical-align: middle;', + 'onclick' => 'javascript: if (!confirm(\''.addslashes(api_htmlentities(sprintf(get_lang('ACourseRequestWillBeDeleted'), $code), ENT_QUOTES)).'\')) return false;', + ) + ). + ''; return $result; } @@ -159,8 +170,10 @@ $form->addButtonSearch(get_lang('Search')); // The action bar. echo '
'; -echo ' '.Display::return_icon('course_request_pending.png', get_lang('ReviewCourseRequests')).get_lang('ReviewCourseRequests').''; -echo ' '.Display::return_icon('course_request_rejected.gif', get_lang('RejectedCourseRequests')).get_lang('RejectedCourseRequests').''; +echo ' '. + Display::return_icon('course_request_pending.png', get_lang('ReviewCourseRequests')).get_lang('ReviewCourseRequests').''; +echo ' '. + Display::return_icon('course_request_rejected.gif', get_lang('RejectedCourseRequests')).get_lang('RejectedCourseRequests').''; echo '
'; echo '
'; $form->display(); diff --git a/main/admin/course_request_edit.php b/main/admin/course_request_edit.php index c56102c5f1..4940a20b06 100755 --- a/main/admin/course_request_edit.php +++ b/main/admin/course_request_edit.php @@ -78,15 +78,15 @@ if ($course_validation_feature) { $titular = $form->addText('tutor_name', get_lang('Professor'), null, array('size' => '60', 'disabled' => 'disabled')); // Description of the requested course. - $form->addElement('textarea', 'description', get_lang('Description'), array('style' => 'border:#A5ACB2 solid 1px; font-family:arial,verdana,helvetica,sans-serif; font-size:12px', 'rows' => '3', 'cols' => '116')); + $form->addElement('textarea', 'description', get_lang('Description')); $form->addRule('description', get_lang('ThisFieldIsRequired'), 'required'); // Objectives of the requested course. - $form->addElement('textarea', 'objetives', get_lang('Objectives'), array('style' => 'border:#A5ACB2 solid 1px; font-family:arial,verdana,helvetica,sans-serif; font-size:12px', 'rows' => '3', 'cols' => '116')); + $form->addElement('textarea', 'objetives', get_lang('Objectives')); $form->addRule('objetives', get_lang('ThisFieldIsRequired'), 'required'); // Target audience of the requested course. - $form->addElement('textarea', 'target_audience', get_lang('TargetAudience'), array('style' => 'border:#A5ACB2 solid 1px; font-family:arial,verdana,helvetica,sans-serif; font-size:12px', 'rows' => '3', 'cols' => '116')); + $form->addElement('textarea', 'target_audience', get_lang('TargetAudience')); $form->addRule('target_audience', get_lang('ThisFieldIsRequired'), 'required'); // Course language. @@ -325,21 +325,28 @@ Display :: display_header($tool_name); if (!$course_validation_feature) { // Disabled course validation feature - show nothing after the error message. - Display :: display_footer(); + Display::display_footer(); exit; } // The action bar. echo '
'; -echo ''.Display::return_icon('courses.gif', get_lang('CourseList')).get_lang('CourseList').''; -echo ''.Display::return_icon('course_request_pending.png', get_lang('ReviewCourseRequests')).get_lang('ReviewCourseRequests').''; -echo ''.Display::return_icon('course_request_accepted.gif', get_lang('AcceptedCourseRequests')).get_lang('AcceptedCourseRequests').''; -echo ''.Display::return_icon('course_request_rejected.gif', get_lang('RejectedCourseRequests')).get_lang('RejectedCourseRequests').''; +echo ''. + Display::return_icon('courses.gif', get_lang('CourseList')).get_lang('CourseList').''; +echo ''. + Display::return_icon('course_request_pending.png', get_lang('ReviewCourseRequests')).get_lang('ReviewCourseRequests'). + ''; +echo ''. + Display::return_icon('course_request_accepted.gif', get_lang('AcceptedCourseRequests')).get_lang('AcceptedCourseRequests'). + ''; +echo ''. + Display::return_icon('course_request_rejected.gif', get_lang('RejectedCourseRequests')).get_lang('RejectedCourseRequests'). + ''; echo '
'; if (!is_array($course_request_info)) { // Not accessible database record - show the error message and the action bar. - Display :: display_footer(); + Display::display_footer(); exit; } @@ -347,4 +354,4 @@ if (!is_array($course_request_info)) { $form->display(); // The footer. -Display :: display_footer(); +Display::display_footer(); diff --git a/main/admin/course_request_rejected.php b/main/admin/course_request_rejected.php index 7c9e39d752..493805522b 100755 --- a/main/admin/course_request_rejected.php +++ b/main/admin/course_request_rejected.php @@ -91,7 +91,10 @@ if ($course_validation_feature) { } } else { $link_to_setting = api_get_path(WEB_CODE_PATH).'admin/settings.php?category=Platform#course_validation'; - $message = sprintf(get_lang('PleaseActivateCourseValidationFeature'), sprintf('%s', $link_to_setting, get_lang('EnableCourseValidation'))); + $message = sprintf( + get_lang('PleaseActivateCourseValidationFeature'), + sprintf('%s', $link_to_setting, get_lang('EnableCourseValidation')) + ); $is_error_message = true; } @@ -150,14 +153,43 @@ function get_request_data($from, $number_of_items, $column, $direction) /** * Actions in the list: edit, accept, delete, request additional information. */ -function modify_filter($id) { +function modify_filter($id) +{ $code = CourseRequestManager::get_course_request_code($id); - $result = ''.Display::return_icon('edit.png', get_lang('Edit'), array('style' => 'vertical-align: middle;')).''. - ' '.Display::return_icon('accept.png', get_lang('AcceptThisCourseRequest'), array('style' => 'vertical-align: middle;', 'onclick' => 'javascript: if (!confirm(\''.addslashes(api_htmlentities(sprintf(get_lang('ANewCourseWillBeCreated'), $code), ENT_QUOTES)).'\')) return false;')).''; + $result = ''. + Display::return_icon('edit.png', get_lang('Edit'), array('style' => 'vertical-align: middle;')).''. + ' '. + Display::return_icon( + 'accept.png', + get_lang('AcceptThisCourseRequest'), + array( + 'style' => 'vertical-align: middle;', + 'onclick' => 'javascript: if (!confirm(\''.addslashes(api_htmlentities(sprintf(get_lang('ANewCourseWillBeCreated'), $code), ENT_QUOTES)).'\')) return false;', + ) + ). + ''; if (!CourseRequestManager::additional_info_asked($id)) { - $result .= ' '.Display::return_icon('request_info.gif', get_lang('AskAdditionalInfo'), array('style' => 'vertical-align: middle;', 'onclick' => 'javascript: if (!confirm(\''.addslashes(api_htmlentities(sprintf(get_lang('AdditionalInfoWillBeAsked'), $code), ENT_QUOTES)).'\')) return false;')).''; + $result .= ' '. + Display::return_icon( + 'request_info.gif', + get_lang('AskAdditionalInfo'), + array( + 'style' => 'vertical-align: middle;', + 'onclick' => 'javascript: if (!confirm(\''.addslashes(api_htmlentities(sprintf(get_lang('AdditionalInfoWillBeAsked'), $code), ENT_QUOTES)).'\')) return false;', + ) + ). + ''; } - $result .= ' '.Display::return_icon('delete.png', get_lang('DeleteThisCourseRequest'), array('style' => 'vertical-align: middle;', 'onclick' => 'javascript: if (!confirm(\''.addslashes(api_htmlentities(sprintf(get_lang('ACourseRequestWillBeDeleted'), $code), ENT_QUOTES)).'\')) return false;')).''; + $result .= ' '. + Display::return_icon( + 'delete.png', + get_lang('DeleteThisCourseRequest'), + array( + 'style' => 'vertical-align: middle;', + 'onclick' => 'javascript: if (!confirm(\''.addslashes(api_htmlentities(sprintf(get_lang('ACourseRequestWillBeDeleted'), $code), ENT_QUOTES)).'\')) return false;', + ) + ). + ''; return $result; } @@ -192,8 +224,12 @@ $form->addButtonSearch(get_lang('Search')); // The action bar. echo '
'; -echo ' '.Display::return_icon('course_request_pending.png', get_lang('ReviewCourseRequests')).get_lang('ReviewCourseRequests').''; -echo ' '.Display::return_icon('course_request_accepted.gif', get_lang('AcceptedCourseRequests')).get_lang('AcceptedCourseRequests').''; +echo ' '. + Display::return_icon('course_request_pending.png', get_lang('ReviewCourseRequests')).get_lang('ReviewCourseRequests'). + ''; +echo ' '. + Display::return_icon('course_request_accepted.gif', get_lang('AcceptedCourseRequests')).get_lang('AcceptedCourseRequests'). + ''; echo '
'; echo '
'; $form->display(); @@ -212,6 +248,4 @@ $table->set_column_filter(6, 'modify_filter'); $table->set_form_actions(array('delete_course_requests' => get_lang('DeleteCourseRequests')), 'course_request'); $table->display(); -/* FOOTER */ - -Display :: display_footer(); +Display::display_footer(); diff --git a/main/admin/course_request_review.php b/main/admin/course_request_review.php index 82c84252c3..17828d3967 100755 --- a/main/admin/course_request_review.php +++ b/main/admin/course_request_review.php @@ -108,7 +108,10 @@ if ($course_validation_feature) { } } else { $link_to_setting = api_get_path(WEB_CODE_PATH).'admin/settings.php?category=Platform#course_validation'; - $message = sprintf(get_lang('PleaseActivateCourseValidationFeature'), sprintf('%s', $link_to_setting, get_lang('EnableCourseValidation'))); + $message = sprintf( + get_lang('PleaseActivateCourseValidationFeature'), + sprintf('%s', $link_to_setting, get_lang('EnableCourseValidation')) + ); $is_error_message = true; } @@ -175,7 +178,8 @@ function get_request_data($from, $number_of_items, $column, $direction) */ function email_filter($teacher) { - $sql = "SELECT user_id FROM ".Database::get_main_table(TABLE_MAIN_COURSE_REQUEST)." WHERE tutor_name LIKE '".$teacher."'"; + $sql = "SELECT user_id FROM ".Database::get_main_table(TABLE_MAIN_COURSE_REQUEST)." + WHERE tutor_name LIKE '".$teacher."'"; $res = Database::query($sql); $info = Database::fetch_array($res); return ''.$teacher.''; @@ -187,14 +191,19 @@ function email_filter($teacher) function modify_filter($id) { $code = CourseRequestManager::get_course_request_code($id); - $result = ''.Display::return_icon('edit.png', get_lang('Edit'), array('style' => 'vertical-align: middle;')).''. - ' '.Display::return_icon('accept.png', get_lang('AcceptThisCourseRequest'), array('style' => 'vertical-align: middle;', 'onclick' => 'javascript: if (!confirm(\''.addslashes(api_htmlentities(sprintf(get_lang('ANewCourseWillBeCreated'), $code), ENT_QUOTES)).'\')) return false;'), 16).''. - ' '.Display::return_icon('error.png', get_lang('RejectThisCourseRequest'), array('style' => 'vertical-align: middle;', 'onclick' => 'javascript: if (!confirm(\''.addslashes(api_htmlentities(sprintf(get_lang('ACourseRequestWillBeRejected'), $code), ENT_QUOTES)).'\')) return false;'), 16).''; + $result = ''. + Display::return_icon('edit.png', get_lang('Edit'), array('style' => 'vertical-align: middle;')).''. + ' '. + Display::return_icon('accept.png', get_lang('AcceptThisCourseRequest'), array('style' => 'vertical-align: middle;', 'onclick' => 'javascript: if (!confirm(\''.addslashes(api_htmlentities(sprintf(get_lang('ANewCourseWillBeCreated'), $code), ENT_QUOTES)).'\')) return false;'), 16).''. + ' '. + Display::return_icon('error.png', get_lang('RejectThisCourseRequest'), array('style' => 'vertical-align: middle;', 'onclick' => 'javascript: if (!confirm(\''.addslashes(api_htmlentities(sprintf(get_lang('ACourseRequestWillBeRejected'), $code), ENT_QUOTES)).'\')) return false;'), 16).''; if (!CourseRequestManager::additional_info_asked($id)) { - $result .= ' '.Display::return_icon('request_info.gif', get_lang('AskAdditionalInfo'), array('style' => 'vertical-align: middle;', 'onclick' => 'javascript: if (!confirm(\''.addslashes(api_htmlentities(sprintf(get_lang('AdditionalInfoWillBeAsked'), $code), ENT_QUOTES)).'\')) return false;')).''; + $result .= ' '. + Display::return_icon('request_info.gif', get_lang('AskAdditionalInfo'), array('style' => 'vertical-align: middle;', 'onclick' => 'javascript: if (!confirm(\''.addslashes(api_htmlentities(sprintf(get_lang('AdditionalInfoWillBeAsked'), $code), ENT_QUOTES)).'\')) return false;')).''; } if (DELETE_ACTION_ENABLED) { - $result .= ' '.Display::return_icon('delete.png', get_lang('DeleteThisCourseRequest'), array('style' => 'vertical-align: middle;', 'onclick' => 'javascript: if (!confirm(\''.addslashes(api_htmlentities(sprintf(get_lang('ACourseRequestWillBeDeleted'), $code), ENT_QUOTES)).'\')) return false;')).''; + $result .= ' ' + .Display::return_icon('delete.png', get_lang('DeleteThisCourseRequest'), array('style' => 'vertical-align: middle;', 'onclick' => 'javascript: if (!confirm(\''.addslashes(api_htmlentities(sprintf(get_lang('ACourseRequestWillBeDeleted'), $code), ENT_QUOTES)).'\')) return false;')).''; } return $result; @@ -231,8 +240,10 @@ $form->addButtonSearch(get_lang('Search')); // The action bar. echo '
'; //echo ''.Display::return_icon('courses.gif', get_lang('CourseList')).get_lang('CourseList').''; -echo ' '.Display::return_icon('course_request_accepted.gif', get_lang('AcceptedCourseRequests')).get_lang('AcceptedCourseRequests').''; -echo ' '.Display::return_icon('course_request_rejected.gif', get_lang('RejectedCourseRequests')).get_lang('RejectedCourseRequests').''; +echo ' '. + Display::return_icon('course_request_accepted.gif', get_lang('AcceptedCourseRequests')).get_lang('AcceptedCourseRequests').''; +echo ' '. + Display::return_icon('course_request_rejected.gif', get_lang('RejectedCourseRequests')).get_lang('RejectedCourseRequests').''; echo '
'; echo '
'; $form->display(); @@ -258,4 +269,4 @@ if (DELETE_ACTION_ENABLED) { } $table->display(); -Display :: display_footer(); +Display::display_footer(); diff --git a/main/admin/extra_field_workflow.php b/main/admin/extra_field_workflow.php index 469fb42ffa..fa0c9bf01c 100755 --- a/main/admin/extra_field_workflow.php +++ b/main/admin/extra_field_workflow.php @@ -150,7 +150,9 @@ $options[0] = get_lang('SelectAnOption'); ksort($options); $form->addElement('select', 'status', get_lang('SelectRole'), $options, array('onclick' => 'changeStatus(this)')); -$checks = $app['orm.em']->getRepository('ChamiloLMS\Entity\ExtraFieldOptionRelFieldOption')->findBy(array('fieldId' => $field_id, 'roleId' => $roleId)); +$checks = $app['orm.em']->getRepository('ChamiloLMS\Entity\ExtraFieldOptionRelFieldOption')->findBy( + array('fieldId' => $field_id, 'roleId' => $roleId) +); $includedFields = array(); if (!empty($checks)) { foreach ($checks as $availableField) { @@ -215,7 +217,7 @@ if ($form->validate()) { if ($value == 1) { if (empty($extraFieldOptionRelFieldOption)) { - $extraFieldOptionRelFieldOption = new \ChamiloLMS\Entity\ExtraFieldOptionRelFieldOption(); + $extraFieldOptionRelFieldOption = new \Chamilo\CoreBundle\Entity\ExtraFieldOptionRelFieldOption(); $extraFieldOptionRelFieldOption->setFieldId($field_id); $extraFieldOptionRelFieldOption->setFieldOptionId($subItemId); $extraFieldOptionRelFieldOption->setRelatedFieldOptionId($id); @@ -223,7 +225,6 @@ if ($form->validate()) { $app['orm.ems']['db_write']->persist($extraFieldOptionRelFieldOption); } } else { - if ($extraFieldOptionRelFieldOption) { $app['orm.ems']['db_write']->remove($extraFieldOptionRelFieldOption); } diff --git a/main/admin/filler.php b/main/admin/filler.php index de3720ec04..1c08eac430 100755 --- a/main/admin/filler.php +++ b/main/admin/filler.php @@ -80,9 +80,9 @@ if (count($output) > 0) {
  • + echo Display::return_icon('new-course.png', get_lang('FillCourses'), null, ICON_SIZE_SMALL). + ' '.get_lang('FillCourses'); + ?>
  • diff --git a/main/admin/grade_models.php b/main/admin/grade_models.php index 56db4e49f4..8e74bcfb48 100755 --- a/main/admin/grade_models.php +++ b/main/admin/grade_models.php @@ -104,6 +104,7 @@ $column_model = array( 'sortable' => 'false' ) ); + //Autowidth $extra_params['autowidth'] = 'true'; //height auto @@ -157,7 +158,9 @@ switch ($action) { $obj->display(); } else { echo ''; $form->addElement('hidden', 'sec_token'); $form->setConstants(array('sec_token' => $token)); @@ -179,7 +182,9 @@ switch ($action) { $obj->display(); } else { echo ''; $form->addElement('hidden', 'sec_token'); $form->setConstants(array('sec_token' => $token)); @@ -201,4 +206,4 @@ switch ($action) { break; } echo ''; -Display :: display_footer(); +Display::display_footer(); diff --git a/main/admin/gradebook_dependency.php b/main/admin/gradebook_dependency.php index 8dc06b9853..d0f7d7a092 100644 --- a/main/admin/gradebook_dependency.php +++ b/main/admin/gradebook_dependency.php @@ -152,8 +152,6 @@ foreach ($dependencyList as $courseId => $courseInfo) { $userResult[$userId]['result_dependencies'][$courseCode] = $result; $userResult[$userId]['user_info'] = $userInfo; - //var_dump("$courseCode : $result"); - if (in_array($courseId, $mandatoryList)) { if ($userResult[$userId]['result_mandatory_20'] < 20 && $result) { $userResult[$userId]['result_mandatory_20'] += 10; @@ -161,7 +159,6 @@ foreach ($dependencyList as $courseId => $courseInfo) { } else { if ($userResult[$userId]['result_not_mandatory_80'] < 80 && $result) { $userResult[$userId]['result_not_mandatory_80'] += 10; - //var_dump($userResult[$userId]['result_80'] ); } } } @@ -190,7 +187,6 @@ $tpl->assign( ) ); - $tpl->assign('mandatory_courses', $mandatoryListCompleteList); $tpl->assign('min_to_validate', $min); $tpl->assign('gradebook_category', $category); diff --git a/main/admin/languages.php b/main/admin/languages.php index 313fa3d19c..f7abd8a679 100755 --- a/main/admin/languages.php +++ b/main/admin/languages.php @@ -26,7 +26,8 @@ $action = isset($_GET['action']) ? $_GET['action'] : null; //Ajax request if (isset($_POST['sent_http_request'])) { - if (isset($_POST['visibility']) && $_POST['visibility'] == strval(intval($_POST['visibility'])) && $_POST['visibility'] == 0) { + if (isset($_POST['visibility']) && + $_POST['visibility'] == strval(intval($_POST['visibility'])) && $_POST['visibility'] == 0) { if (isset($_POST['id']) && $_POST['id'] == strval(intval($_POST['id']))) { if (SubLanguageManager::check_if_language_is_used($_POST['id']) == false) { SubLanguageManager::make_unavailable_language($_POST['id']); @@ -36,7 +37,9 @@ if (isset($_POST['sent_http_request'])) { } } } - if (isset($_POST['visibility']) && $_POST['visibility'] == strval(intval($_POST['visibility'])) && $_POST['visibility'] == 1) { + if (isset($_POST['visibility']) && + $_POST['visibility'] == strval(intval($_POST['visibility'])) && $_POST['visibility'] == 1 + ) { if (isset($_POST['id']) && $_POST['id'] == strval(intval($_POST['id']))) { SubLanguageManager::make_available_language($_POST['id']); echo 'set_visible'; @@ -193,9 +196,9 @@ if ($action == 'disable_all_except_default') { if (isset($_POST['Submit']) && $_POST['Submit']) { // changing the name - $sql_update = "UPDATE $tbl_admin_languages SET original_name='{$_POST['txt_name']}' - WHERE id='{$_POST['edit_id']}'"; - $result = Database::query($sql_update); + $sql = "UPDATE $tbl_admin_languages SET original_name='{$_POST['txt_name']}' + WHERE id='{$_POST['edit_id']}'"; + $result = Database::query($sql); // changing the Platform language if ($_POST['platformlanguage'] && $_POST['platformlanguage'] <> '') { //$sql_update_2 = "UPDATE $tbl_settings_current SET selected_value='{$_POST['platformlanguage']}' WHERE variable='platformLanguage'"; @@ -204,7 +207,7 @@ if (isset($_POST['Submit']) && $_POST['Submit']) { } } elseif (isset($_POST['action'])) { switch ($_POST['action']) { - case 'makeavailable' : + case 'makeavailable': if (count($_POST['id']) > 0) { $ids = array(); foreach ($_POST['id'] as $index => $id) { @@ -214,7 +217,7 @@ if (isset($_POST['Submit']) && $_POST['Submit']) { Database::query($sql); } break; - case 'makeunavailable' : + case 'makeunavailable': if (count($_POST['id']) > 0) { $ids = array(); foreach ($_POST['id'] as $index => $id) { @@ -290,9 +293,7 @@ while ($row = Database::fetch_array($result_select)) { $allow_delete_sub_language = null; $allow_add_term_sub_language = null; - if (api_get_setting('allow_use_sub_language') == 'true') { - $verified_if_is_sub_language = SubLanguageManager::check_if_language_is_sub_language($row['id']); if ($verified_if_is_sub_language === false) {