Feature #2099 - Coding the page for editition training requests (1) - the initial pattern is created.

skala
Ivan Tcholakov 15 years ago
parent 6a8a8f4c1e
commit 46310beb08
  1. 4
      main/admin/course_request_accepted.php
  2. 102
      main/admin/course_request_edit.php
  3. 4
      main/admin/course_request_rejected.php
  4. 5
      main/admin/course_request_review.php
  5. 1
      main/lang/bulgarian/create_course.inc.php
  6. 1
      main/lang/english/create_course.inc.php

@ -132,7 +132,7 @@ function get_request_data($from, $number_of_items, $column, $direction) {
*/
function modify_filter($id) {
$code = CourseRequestManager::get_course_request_code($id);
$result = '<a href="course_request_edit.php?id='.$id.'">'.Display::return_icon('edit.gif', get_lang('Edit'), array('style' => 'vertical-align: middle;')).'</a>'.
$result = '<a href="course_request_edit.php?id='.$id.'&caller=1">'.Display::return_icon('edit.gif', get_lang('Edit'), array('style' => 'vertical-align: middle;')).'</a>'.
'&nbsp;<a href="?delete_course_request='.$id.'">'.Display::return_icon('delete.gif', get_lang('DeleteThisCourseRequest'), array('style' => 'vertical-align: middle;', 'onclick' => 'javascript: if (!confirm(\''.addslashes(api_htmlentities(sprintf(get_lang('ACourseRequestWillBeDeleted'), $code), ENT_QUOTES)).'\')) return false;')).'</a>';
return $result;
}
@ -162,7 +162,7 @@ echo '<a href="course_request_review.php">'.Display::return_icon('course_request
echo '<a href="course_request_rejected.php">'.Display::return_icon('course_request_rejected.gif', get_lang('RejectedCourseRequests')).get_lang('RejectedCourseRequests').'</a>';
echo '</div>';
// Create a sortable table with the course data
// Create a sortable table with the course data.
$table = new SortableTable('course_requests', 'get_number_of_requests', 'get_request_data', 2);
$table->set_additional_parameters($parameters);
$table->set_header(0, '', false);

@ -1,3 +1,105 @@
<?php
/* For licensing terms, see /license.txt */
/**
* A page for detailed preview or edition of a given course request.
* @package chamilo.admin
* @author Ivan Tcholakov <ivantcholakov@gmail.com>, 2010
*/
/* INIT SECTION */
// Language files that need to be included.
$language_file = array('admin', 'create_course');
$cidReset = true;
require '../inc/global.inc.php';
$this_section = SECTION_PLATFORM_ADMIN;
api_protect_admin_script();
require_once api_get_path(LIBRARY_PATH).'add_course.lib.inc.php';
require_once api_get_path(CONFIGURATION_PATH).'course_info.conf.php';
require_once api_get_path(LIBRARY_PATH).'course.lib.php';
require_once api_get_path(LIBRARY_PATH).'course_request.lib.php';
require_once api_get_path(LIBRARY_PATH).'mail.lib.inc.php';
require_once api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php';
require_once api_get_path(LIBRARY_PATH).'sortabletable.class.php';
require_once api_get_path(LIBRARY_PATH).'usermanager.lib.php';
// Including a configuration file.
require_once api_get_path(CONFIGURATION_PATH).'add_course.conf.php';
// Including additional libraries.
require_once api_get_path(LIBRARY_PATH).'fileManage.lib.php';
// A check whether the course validation feature is enabled.
$course_validation_feature = api_get_setting('course_validation') == 'true';
$course_validation_feature = false;
// Filltering passed to this page parameters.
$id = intval($_GET['id']);
$caller = intval($_GET['caller']);
// Code for testing purposes, to be removed.
$message = 'id = '.$id.';<br />caller = "'.get_caller_name($caller).'";';
$is_error_message = false;
if ($course_validation_feature) {
// Actions, if any.
} else {
$link_to_setting = api_get_path(WEB_CODE_PATH).'admin/settings.php?category=Platform#course_validation';
$message = sprintf(get_lang('PleaseActivateCourseValidationFeature'), sprintf('<strong><a href="%s">%s</a></strong>', $link_to_setting, get_lang('EnableCourseValidation')));
$is_error_message = true;
}
// Functions.
// Converts the given numerical id to the name of the page that opened this editor.
function get_caller_name($caller_id) {
switch ($caller_id) {
case 1:
return 'course_request_accepted.php';
case 2:
return 'course_request_rejected.php';
}
return 'course_request_review.php';
}
// The header.
$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
$tool_name = get_lang('CourseRequestEdit');
Display :: display_header($tool_name);
// Display confirmation or error message.
if (!empty($message)) {
if ($is_error_message) {
Display::display_error_message($message, false);
} else {
Display::display_normal_message($message, false);
}
}
if (!$course_validation_feature) {
Display :: display_footer();
exit;
}
// The action bar.
echo '<div class="actions">';
echo '<a href="course_list.php">'.Display::return_icon('courses.gif', get_lang('CourseList')).get_lang('CourseList').'</a>';
echo '<a href="course_request_review.php">'.Display::return_icon('course_request_pending.png', get_lang('ReviewCourseRequests')).get_lang('ReviewCourseRequests').'</a>';
echo '<a href="course_request_accepted.php">'.Display::return_icon('course_request_accepted.gif', get_lang('AcceptedCourseRequests')).get_lang('AcceptedCourseRequests').'</a>';
echo '<a href="course_request_rejected.php">'.Display::return_icon('course_request_rejected.gif', get_lang('RejectedCourseRequests')).get_lang('RejectedCourseRequests').'</a>';
echo '</div>';
// The form.
//...
// The footer.
Display :: display_footer();

@ -166,7 +166,7 @@ function get_request_data($from, $number_of_items, $column, $direction) {
*/
function modify_filter($id) {
$code = CourseRequestManager::get_course_request_code($id);
$result = '<a href="course_request_edit.php?id='.$id.'">'.Display::return_icon('edit.gif', get_lang('Edit'), array('style' => 'vertical-align: middle;')).'</a>'.
$result = '<a href="course_request_edit.php?id='.$id.'&caller=2">'.Display::return_icon('edit.gif', get_lang('Edit'), array('style' => 'vertical-align: middle;')).'</a>'.
'&nbsp;<a href="?accept_course_request='.$id.'">'.Display::return_icon('action_accept.gif', get_lang('AcceptThisCourseRequest'), array('style' => 'vertical-align: middle;', 'onclick' => 'javascript: if (!confirm(\''.addslashes(api_htmlentities(sprintf(get_lang('ANewCourseWillBeCreated'), $code), ENT_QUOTES)).'\')) return false;')).'</a>';
if (!CourseRequestManager::additional_info_asked($id)) {
$result .= '&nbsp;<a href="?request_info='.$id.'">'.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;')).'</a>';
@ -201,7 +201,7 @@ echo '<a href="course_request_review.php">'.Display::return_icon('course_request
echo '<a href="course_request_accepted.php">'.Display::return_icon('course_request_accepted.gif', get_lang('AcceptedCourseRequests')).get_lang('AcceptedCourseRequests').'</a>';
echo '</div>';
// Create a sortable table with the course data
// Create a sortable table with the course data.
$table = new SortableTable('course_requests', 'get_number_of_requests', 'get_request_data', 2);
$table->set_additional_parameters($parameters);
$table->set_header(0, '', false);

@ -2,7 +2,6 @@
/* For licensing terms, see /license.txt */
/**
* Con este archivo se editan, se validan, se rechazan o se solicita mas informacion de los cursos que se solicitaron por parte de los profesores y que estan añadidos en la tabla temporal.
* A list containig the pending course requests
* @package chamilo.admin
* @author José Manuel Abuin Mosquera <chema@cesga.es>, 2010
@ -210,7 +209,7 @@ function email_filter($teacher) {
*/
function modify_filter($id) {
$code = CourseRequestManager::get_course_request_code($id);
$result = '<a href="course_request_edit.php?id='.$id.'">'.Display::return_icon('edit.gif', get_lang('Edit'), array('style' => 'vertical-align: middle;')).'</a>'.
$result = '<a href="course_request_edit.php?id='.$id.'&caller=0">'.Display::return_icon('edit.gif', get_lang('Edit'), array('style' => 'vertical-align: middle;')).'</a>'.
'&nbsp;<a href="?accept_course_request='.$id.'">'.Display::return_icon('action_accept.gif', get_lang('AcceptThisCourseRequest'), array('style' => 'vertical-align: middle;', 'onclick' => 'javascript: if (!confirm(\''.addslashes(api_htmlentities(sprintf(get_lang('ANewCourseWillBeCreated'), $code), ENT_QUOTES)).'\')) return false;')).'</a>'.
'&nbsp;<a href="?reject_course_request='.$id.'">'.Display::return_icon('action_reject.gif', get_lang('RejectThisCourseRequest'), array('style' => 'vertical-align: middle;', 'onclick' => 'javascript: if (!confirm(\''.addslashes(api_htmlentities(sprintf(get_lang('ACourseRequestWillBeRejected'), $code), ENT_QUOTES)).'\')) return false;')).'</a>';
if (!CourseRequestManager::additional_info_asked($id)) {
@ -247,7 +246,7 @@ echo '<a href="course_request_accepted.php">'.Display::return_icon('course_reque
echo '<a href="course_request_rejected.php">'.Display::return_icon('course_request_rejected.gif', get_lang('RejectedCourseRequests')).get_lang('RejectedCourseRequests').'</a>';
echo '</div>';
// Create a sortable table with the course data
// Create a sortable table with the course data.
$offet = DELETE_ACTION_ENABLED ? 1 : 0;
$table = new SortableTable('course_requests', 'get_number_of_requests', 'get_request_data', 1 + $offet);
$table->set_additional_parameters($parameters);

@ -144,4 +144,5 @@ $CourseRequestRejectedEmailSubject = "%s Заявката за нов курс %
$CourseRequestRejectedEmailText = "За съжаление Вашата заявка за нов курс %s е отхвърлена, тъй като не отговаря на нашите Условия за ползване.";
$CourseCreationFailed = "Курсът не е създаден поради появила се грешка.";
$CourseRequestCreationFailed = "Заявката за нов курс не е създадена поради появила се грешка.";
$CourseRequestEdit = "Редактиране на заявка за нов курс";
?>

@ -144,4 +144,5 @@ $CourseRequestRejectedEmailSubject = "%s The training request %s has been reject
$CourseRequestRejectedEmailText = "To our regret we have to inform you that the training request %s has been rejected due to not conforming to the requirements of our Terms and Conditions.";
$CourseCreationFailed = "The training has not been created due to internal error.";
$CourseRequestCreationFailed = "The training request has not been created due to internal error.";
$CourseRequestEdit = "Edit a training request";
?>
Loading…
Cancel
Save