Minor - format code.

1.9.x
Julio Montoya 11 years ago
parent 09d6423216
commit f3bd286150
  1. 39
      main/admin/add_many_session_to_category.php
  2. 4
      main/admin/course_import.php
  3. 77
      main/admin/session_category_edit.php

@ -15,7 +15,7 @@ require_once api_get_path(LIBRARY_PATH).'add_many_session_to_category_functions.
require_once api_get_path(LIBRARY_PATH).'sessionmanager.lib.php';
$xajax = new xajax();
$xajax -> registerFunction ('search_courses');
$xajax->registerFunction('search_courses');
// setting the section (for the tabs)
$this_section = SECTION_PLATFORM_ADMIN;
@ -36,12 +36,12 @@ $tbl_session_rel_course = Database::get_main_table(TABLE_MAIN_SESSION_COURSE)
$tbl_course = Database::get_main_table(TABLE_MAIN_COURSE);
// setting the name of the tool
$tool_name= get_lang('SubscribeSessionsToCategory');
$id_session=intval($_GET['id_session']);
$tool_name = get_lang('SubscribeSessionsToCategory');
$id_session = isset($_GET['id_session']) ? intval($_GET['id_session']) : null;
$add_type = 'multiple';
if(isset($_GET['add_type']) && $_GET['add_type']!=''){
$add_type = Security::remove_XSS($_REQUEST['add_type']);
if (isset($_GET['add_type']) && $_GET['add_type'] != '') {
$add_type = Security::remove_XSS($_REQUEST['add_type']);
}
if (!api_is_platform_admin() && !api_is_session_admin()) {
@ -147,7 +147,7 @@ if (api_get_multiple_access_url()) {
$sql = "SELECT s.id, s.name FROM $tbl_session s INNER JOIN $table_access_url_rel_session u ON s.id = u.session_id $where AND u.access_url_id = $access_url_id ORDER BY name";
} else {
$sql = "SELECT id, name FROM $tbl_session $where ORDER BY name";
}
}
$result=Database::query($sql);
$rows_session = Database::store_result($result);
?>
@ -167,10 +167,10 @@ if(!empty($OkMsg)) {
Display::display_confirmation_message($OkMsg); //main API
}
/*
*
* The a/b/c Filter is not a priority
*
/*
*
* The a/b/c Filter is not a priority
*
* <td width="45%" align="center">
<?php echo get_lang('FirstLetterCourse'); ?> :
<select name="firstLetterCourse" onchange = "xajax_search_courses(this.value,'multiple')">
@ -188,7 +188,7 @@ if(!empty($OkMsg)) {
<tr>
<td align="left"></td>
<td align="left"></td>
<td align="center">
<td align="center">
<b><?php echo get_lang('SessionCategoryName') ?> :</b><br />
<select name="CategorySessionId" style="width: 320px;" onchange="javascript:send();" >
<option value="0" ></option>
@ -228,19 +228,9 @@ if(!empty($OkMsg)) {
<?php unset($nosessionCourses); ?>
</td>
<td width="10%" valign="middle" align="center">
<?php
if ($ajax_search) {
?>
<button class="arrowl" type="button" onclick="remove_item(document.getElementById('destination'))"></button>
<?php
} else {
?>
<button class="arrowr" type="button" onclick="moveItem(document.getElementById('origin'), document.getElementById('destination'))" onclick="moveItem(document.getElementById('origin'), document.getElementById('destination'))"></button>
<br /><br />
<button class="arrowl" type="button" onclick="moveItem(document.getElementById('destination'), document.getElementById('origin'))" onclick="moveItem(document.getElementById('destination'), document.getElementById('origin'))"></button>
<?php
}
?>
<br /><br /><br /><br /><br /><br />
<?php
echo '<button class="save" type="button" value="" onclick="valide()" >'.get_lang('SubscribeSessionsToCategory').'</button>';
@ -258,7 +248,6 @@ if(!empty($OkMsg)) {
</form>
<script type="text/javascript">
<!--
function moveItem(origin , destination) {
for(var i = 0 ; i<origin.options.length ; i++) {
if(origin.options[i].selected) {
@ -302,9 +291,7 @@ function valide(){
document.forms.formulaire.submit();
}
-->
</script>
<?php
/* FOOTER */
Display::display_footer();
Display::display_footer();

@ -72,6 +72,7 @@ function validate_data($courses)
}
}
}
return $errors;
}
@ -80,12 +81,13 @@ function getTeacherListInArray($teachers)
if (!empty($teachers)) {
return explode('|', $teachers);
}
return array();
}
/**
* Saves imported data.
* @param array List of courses
* @param array $courses List of courses
*/
function save_data($courses)
{

@ -4,27 +4,31 @@
* Edition script for sessions categories
* @package chamilo.admin
*/
/**
* Code
*/
// name of the language file that needs to be included
$language_file ='admin';
$cidReset=true;
$cidReset = true;
require_once '../inc/global.inc.php';
// setting the section (for the tabs)
$this_section=SECTION_PLATFORM_ADMIN;
$this_section = SECTION_PLATFORM_ADMIN;
api_protect_admin_script(true);
$id=intval($_GET['id']);
$formSent=0;
$errorMsg='';
$id = intval($_GET['id']);
$formSent = 0;
$errorMsg = '';
// Database Table Definitions
$tbl_session_category = Database::get_main_table(TABLE_MAIN_SESSION_CATEGORY);
$tool_name = get_lang('EditSessionCategory');
$interbreadcrumb[]=array('url' => 'index.php',"name" => get_lang('PlatformAdmin'));
$interbreadcrumb[]=array('url' => "session_category_list.php","name" => get_lang('ListSessionCategory'));
$interbreadcrumb[] = array(
'url' => 'index.php',
"name" => get_lang('PlatformAdmin')
);
$interbreadcrumb[] = array(
'url' => "session_category_list.php",
"name" => get_lang('ListSessionCategory')
);
$sql = "SELECT * FROM $tbl_session_category WHERE id='".$id."' ORDER BY name";
$result=Database::query($sql);
if (!$infos=Database::fetch_array($result)) {
@ -38,24 +42,38 @@ if (!api_is_platform_admin() && $infos['session_admin_id']!=$_user['user_id'] &&
api_not_allowed(true);
}
if ($_POST['formSent']) {
$formSent=1;
$name= $_POST['name'];
$year_start= $_POST['year_start'];
$month_start=$_POST['month_start'];
$day_start=$_POST['day_start'];
$year_end=$_POST['year_end'];
$month_end=$_POST['month_end'];
$day_end=$_POST['day_end'];
$return = SessionManager::edit_category_session($id, $name, $year_start, $month_start, $day_start, $year_end, $month_end, $day_end);
if ($return == strval(intval($return))) {
header('Location: session_category_list.php?action=show_message&message='.urlencode(get_lang('SessionCategoryUpdate')));
exit();
}
if (isset($_POST['formSent']) && $_POST['formSent']) {
$formSent = 1;
$name = $_POST['name'];
$year_start = $_POST['year_start'];
$month_start = $_POST['month_start'];
$day_start = $_POST['day_start'];
$year_end = $_POST['year_end'];
$month_end = $_POST['month_end'];
$day_end = $_POST['day_end'];
$return = SessionManager::edit_category_session(
$id,
$name,
$year_start,
$month_start,
$day_start,
$year_end,
$month_end,
$day_end
);
if ($return == strval(intval($return))) {
header(
'Location: session_category_list.php?action=show_message&message=' . urlencode(
get_lang('SessionCategoryUpdate')
)
);
exit();
}
}
$thisYear=date('Y');
$thisMonth=date('m');
$thisDay=date('d');
$thisYear = date('Y');
$thisMonth = date('m');
$thisDay = date('d');
// display the header
Display::display_header($tool_name);
@ -63,7 +81,7 @@ if (!empty($return)) {
Display::display_error_message($return,false);
}
?>
<form method="post" name="form" action="<?php echo api_get_self(); ?>?page=<?php echo Security::remove_XSS($_GET['page']) ?>&id=<?php echo $id; ?>" style="margin:0px;">
<form method="post" name="form" action="<?php echo api_get_self(); ?>?id=<?php echo $id; ?>">
<input type="hidden" name="formSent" value="1">
<legend><?php echo $tool_name;?> </legend>
<table border="0" cellpadding="5" cellspacing="0" width="550">
@ -216,7 +234,8 @@ for($i=$thisYear-5;$i <= ($thisYear+5);$i++)
<tr>
<td>&nbsp;</td>
<td>
<button class="save" type="submit" value="<?php echo get_lang('ModifyThisSession') ?>"><?php echo get_lang('ModifyThisSession') ?></button>
<button class="save" type="submit" value="<?php echo get_lang('ModifyThisSession') ?>">
<?php echo get_lang('ModifyThisSession') ?></button>
</td>
</tr>

Loading…
Cancel
Save