Format code, fix PHP warnings,

1.10.x
Julio Montoya 10 years ago
parent ffadc5389d
commit c5e59d0ca8
  1. 45
      main/admin/careers.php
  2. 1
      main/admin/configure_inscription.php
  3. 9
      main/admin/statistics.php
  4. 2
      main/admin/user_import.php
  5. 45
      main/admin/user_list.php
  6. 4
      main/admin/user_update_import.php
  7. 17
      main/inc/lib/sessionmanager.lib.php
  8. 2
      main/inc/lib/zombie/zombie_report.class.php
  9. 15
      main/session/session_list.php
  10. 4
      main/work/work.lib.php

@ -4,6 +4,7 @@
/** /**
* @package chamilo.admin * @package chamilo.admin
*/ */
$cidReset = true; $cidReset = true;
require_once '../inc/global.inc.php'; require_once '../inc/global.inc.php';
@ -15,8 +16,14 @@ api_protect_admin_script();
$htmlHeadXtra[] = api_get_jqgrid_js(); $htmlHeadXtra[] = api_get_jqgrid_js();
// setting breadcrumbs // setting breadcrumbs
$interbreadcrumb[]=array('url' => 'index.php','name' => get_lang('PlatformAdmin')); $interbreadcrumb[] = array(
$interbreadcrumb[]=array('url' => 'career_dashboard.php','name' => get_lang('CareersAndPromotions')); 'url' => 'index.php',
'name' => get_lang('PlatformAdmin'),
);
$interbreadcrumb[] = array(
'url' => 'career_dashboard.php',
'name' => get_lang('CareersAndPromotions'),
);
$action = isset($_GET['action']) ? $_GET['action'] : null; $action = isset($_GET['action']) ? $_GET['action'] : null;
@ -25,12 +32,13 @@ $token = Security::get_token();
if ($action == 'add') { if ($action == 'add') {
$interbreadcrumb[]=array('url' => 'careers.php','name' => get_lang('Careers')); $interbreadcrumb[]=array('url' => 'careers.php','name' => get_lang('Careers'));
$interbreadcrumb[]=array('url' => '#','name' => get_lang('Add')); $tool_name = get_lang('Add');
} elseif ($action == 'edit') { } elseif ($action == 'edit') {
$interbreadcrumb[]=array('url' => 'careers.php','name' => get_lang('Careers')); $interbreadcrumb[]=array('url' => 'careers.php','name' => get_lang('Careers'));
$interbreadcrumb[]=array('url' => '#','name' => get_lang('Edit')); $interbreadcrumb[]=array('url' => '#','name' => get_lang('Edit'));
$tool_name = get_lang('Edit');
} else { } else {
$interbreadcrumb[]=array('url' => '#','name' => get_lang('Careers')); $tool_name = get_lang('Careers');
} }
// The header. // The header.
@ -43,10 +51,28 @@ $url = api_get_path(WEB_AJAX_PATH).'model.ajax.php?a=get_careers';
$columns = array(get_lang('Name'), get_lang('Description'), get_lang('Actions')); $columns = array(get_lang('Name'), get_lang('Description'), get_lang('Actions'));
// Column config // Column config
$column_model = array( $column_model = array(
array('name'=>'name', 'index'=>'name', 'width'=>'80', 'align'=>'left'), array(
array('name'=>'description', 'index'=>'description', 'width'=>'500', 'align'=>'left','sortable'=>'false'), 'name' => 'name',
array('name'=>'actions', 'index'=>'actions', 'width'=>'100', 'align'=>'left','formatter'=>'action_formatter','sortable'=>'false') 'index' => 'name',
'width' => '80',
'align' => 'left',
),
array(
'name' => 'description',
'index' => 'description',
'width' => '500',
'align' => 'left',
'sortable' => 'false',
),
array(
'name' => 'actions',
'index' => 'actions',
'width' => '100',
'align' => 'left',
'formatter' => 'action_formatter',
'sortable' => 'false',
),
); );
//Autowidth //Autowidth
$extra_params['autowidth'] = 'true'; $extra_params['autowidth'] = 'true';
@ -95,7 +121,8 @@ switch ($action) {
$career->display(); $career->display();
} else { } else {
echo '<div class="actions">'; echo '<div class="actions">';
echo '<a href="'.api_get_self().'">'.Display::return_icon('back.png',get_lang('Back'),'',ICON_SIZE_MEDIUM).'</a>'; echo '<a href="'.api_get_self().'">'.
Display::return_icon('back.png',get_lang('Back'),'',ICON_SIZE_MEDIUM).'</a>';
echo '</div>'; echo '</div>';
$form->addElement('hidden', 'sec_token'); $form->addElement('hidden', 'sec_token');
$form->setConstants(array('sec_token' => $token)); $form->setConstants(array('sec_token' => $token));

@ -315,7 +315,6 @@ if (api_get_setting('allow_terms_conditions') == 'true') {
} }
} }
//$form->addElement('style_submit_button', 'submit', get_lang('RegisterUser'), array('disabled' => 'disabled'));
$form->addButtonSave(get_lang('RegisterUser')); $form->addButtonSave(get_lang('RegisterUser'));
$defaults['status'] = STUDENT; $defaults['status'] = STUDENT;

@ -1,14 +1,13 @@
<?php // $Id: statistics.php 10811 2007-01-22 08:26:40Z elixir_julian $ <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
/** /**
* @package chamilo.admin * @package chamilo.admin
*/ */
/*
INIT SECTION
*/
$cidReset=true; $cidReset=true;
require_once '../inc/global.inc.php'; require_once '../inc/global.inc.php';
$this_section=SECTION_PLATFORM_ADMIN; $this_section = SECTION_PLATFORM_ADMIN;
api_protect_admin_script(); api_protect_admin_script();

@ -340,7 +340,7 @@ api_protect_limit_for_session_admin();
$defined_auth_sources[] = PLATFORM_AUTH_SOURCE; $defined_auth_sources[] = PLATFORM_AUTH_SOURCE;
if (is_array($extAuthSource)) { if (isset($extAuthSource) && is_array($extAuthSource)) {
$defined_auth_sources = array_merge($defined_auth_sources, array_keys($extAuthSource)); $defined_auth_sources = array_merge($defined_auth_sources, array_keys($extAuthSource));
} }

@ -726,7 +726,7 @@ if (!empty($action)) {
// Create a search-box // Create a search-box
$form = new FormValidator('search_simple', 'get', '', '', array(), FormValidator::LAYOUT_INLINE); $form = new FormValidator('search_simple', 'get', '', '', array(), FormValidator::LAYOUT_INLINE);
$form->addElement('text', 'keyword', get_lang('Keyword'), array('id' => 'user-search-keyword')); $form->addElement('text', 'keyword');
$form->addButtonSearch(get_lang('Search')); $form->addButtonSearch(get_lang('Search'));
$form->addElement( $form->addElement(
'static', 'static',
@ -773,28 +773,17 @@ while ($row_admin = Database::fetch_row($res_admin)) {
} }
// Display Advanced search form. // Display Advanced search form.
$form = new FormValidator('advanced_search', 'get'); $form = new FormValidator('advanced_search', 'get', '', '', array(), FormValidator::LAYOUT_HORIZONTAL);
$form->addElement('html','<div id="advanced_search_form" style="display:none;">'); $form->addElement('html','<div id="advanced_search_form" style="display:none;">');
$form->addElement('header', get_lang('AdvancedSearch')); $form->addElement('header', get_lang('AdvancedSearch'));
$form->addElement('html', '<table>'); $form->addText('keyword_firstname',get_lang('FirstName'),false);
$form->addText('keyword_lastname',get_lang('LastName'),false);
$form->addElement('html', '<tr><td>'); $form->addText('keyword_username',get_lang('LoginName'),false);
$form->addText('keyword_firstname',get_lang('FirstName'),false,array('style'=>'margin-left:17px')); $form->addText('keyword_email',get_lang('Email'),false);
$form->addElement('html', '</td><td width="200px;">');
$form->addText('keyword_lastname',get_lang('LastName'),false,array('style'=>'margin-left:17px'));
$form->addElement('html', '</td></tr>');
$form->addElement('html', '<tr><td>'); $form->addText('keyword_officialcode',get_lang('OfficialCode'),false);
$form->addText('keyword_username',get_lang('LoginName'),false,array('style'=>'margin-left:17px'));
$form->addElement('html', '</td>');
$form->addElement('html', '<td>');
$form->addText('keyword_email',get_lang('Email'),false,array('style'=>'margin-left:17px'));
$form->addElement('html', '</td></tr>');
$form->addElement('html', '<tr><td>');
$form->addText('keyword_officialcode',get_lang('OfficialCode'),false,array('style'=>'margin-left:17px'));
$form->addElement('html', '</td><td>');
$status_options = array(); $status_options = array();
$status_options['%'] = get_lang('All'); $status_options['%'] = get_lang('All');
@ -804,24 +793,17 @@ $status_options[DRH] = get_lang('Drh');
$status_options[SESSIONADMIN] = get_lang('SessionsAdmin'); $status_options[SESSIONADMIN] = get_lang('SessionsAdmin');
$status_options[PLATFORM_ADMIN] = get_lang('Administrator'); $status_options[PLATFORM_ADMIN] = get_lang('Administrator');
$form->addElement('select','keyword_status',get_lang('Profile'), $status_options, array('style'=>'margin-left:17px')); $form->addElement('select','keyword_status',get_lang('Profile'), $status_options );
$form->addElement('html', '</td></tr>');
$form->addElement('html', '<tr><td>');
$active_group = array(); $active_group = array();
$active_group[] = $form->createElement('checkbox','keyword_active','', get_lang('Active')); $active_group[] = $form->createElement('checkbox','keyword_active','', get_lang('Active'));
$active_group[] = $form->createElement('checkbox','keyword_inactive','', get_lang('Inactive')); $active_group[] = $form->createElement('checkbox','keyword_inactive','', get_lang('Inactive'));
$form->addGroup($active_group,'',get_lang('ActiveAccount'),'<br/>',false); $form->addGroup($active_group,'',get_lang('ActiveAccount'), '<br/>',false);
$form->addElement('html', '</td><td>');
$form->addElement('checkbox', 'check_easy_passwords', null, get_lang('CheckEasyPasswords')); $form->addElement('checkbox', 'check_easy_passwords', null, get_lang('CheckEasyPasswords'));
$form->addElement('html', '</td></tr>');
$form->addElement('html', '<tr><td>');
$form->addButtonSearch(get_lang('SearchUsers')); $form->addButtonSearch(get_lang('SearchUsers'));
$form->addElement('html', '</td></tr>');
$form->addElement('html', '</table>');
$defaults = array(); $defaults = array();
$defaults['keyword_active'] = 1; $defaults['keyword_active'] = 1;
@ -831,7 +813,12 @@ $form->addElement('html','</div>');
$form = $form->returnForm(); $form = $form->returnForm();
$table = new SortableTable('users', 'get_number_of_users', 'get_user_data', (api_is_western_name_order() xor api_sort_by_first_name()) ? 3 : 2); $table = new SortableTable(
'users',
'get_number_of_users',
'get_user_data',
(api_is_western_name_order() xor api_sort_by_first_name()) ? 3 : 2
);
$table->set_additional_parameters($parameters); $table->set_additional_parameters($parameters);
$table->set_header(0, '', false, 'width="18px"'); $table->set_header(0, '', false, 'width="18px"');
$table->set_header(1, get_lang('Photo'), false); $table->set_header(1, get_lang('Photo'), false);

@ -10,7 +10,7 @@
*/ */
$cidReset = true; $cidReset = true;
require '../inc/global.inc.php'; require_once '../inc/global.inc.php';
// Set this option to true to enforce strict purification for usenames. // Set this option to true to enforce strict purification for usenames.
$purification_option_for_usernames = false; $purification_option_for_usernames = false;
@ -336,7 +336,7 @@ api_protect_admin_script(true, null, 'login');
$defined_auth_sources[] = PLATFORM_AUTH_SOURCE; $defined_auth_sources[] = PLATFORM_AUTH_SOURCE;
if (is_array($extAuthSource)) { if (isset($extAuthSource) && is_array($extAuthSource)) {
$defined_auth_sources = array_merge($defined_auth_sources, array_keys($extAuthSource)); $defined_auth_sources = array_merge($defined_auth_sources, array_keys($extAuthSource));
} }

@ -447,8 +447,10 @@ class SessionManager
$categories = self::get_all_session_category(); $categories = self::get_all_session_category();
$orderedCategories = array(); $orderedCategories = array();
foreach ($categories as $category) { if (!empty($categories)) {
$orderedCategories[$category['id']] = $category['name']; foreach ($categories as $category) {
$orderedCategories[$category['id']] = $category['name'];
}
} }
$formatted_sessions = array(); $formatted_sessions = array();
@ -509,7 +511,8 @@ class SessionManager
} }
} }
$formatted_sessions[$session_id] = $session; $formatted_sessions[$session_id] = $session;
$formatted_sessions[$session_id]['category_name'] = $orderedCategories[$session['session_category_id']]; $categoryName = isset($orderedCategories[$session['session_category_id']]) ? $orderedCategories[$session['session_category_id']] : '';
$formatted_sessions[$session_id]['category_name'] = $categoryName;
} }
} }
return $formatted_sessions; return $formatted_sessions;
@ -6689,10 +6692,10 @@ class SessionManager
get_lang('Visibility'), get_lang('Visibility'),
); );
$column_model = array ( $column_model = array (
array('name'=>'name', 'index'=>'s.name', 'width'=>'180', 'align'=>'left', 'search' => 'true', 'searchoptions' => array('sopt' => $operators)), array('name'=>'name', 'index'=>'s.name', 'width'=>'160', 'align'=>'left', 'search' => 'true', 'searchoptions' => array('sopt' => $operators)),
array('name'=>'category_name', 'index'=>'category_name', 'width'=>'20', 'align'=>'left', 'search' => 'true', 'searchoptions' => array('sopt' => $operators)), array('name'=>'category_name', 'index'=>'category_name', 'width'=>'40', 'align'=>'left', 'search' => 'true', 'searchoptions' => array('sopt' => $operators)),
array('name'=>'display_start_date', 'index'=>'display_start_date', 'width'=>'70', 'align'=>'left', 'search' => 'true', 'searchoptions' => array('dataInit' => 'date_pick_today', 'sopt' => $date_operators)), array('name'=>'display_start_date', 'index'=>'display_start_date', 'width'=>'50', 'align'=>'left', 'search' => 'true', 'searchoptions' => array('dataInit' => 'date_pick_today', 'sopt' => $date_operators)),
array('name'=>'display_end_date', 'index'=>'display_end_date', 'width'=>'70', 'align'=>'left', 'search' => 'true', 'searchoptions' => array('dataInit' => 'date_pick_one_month', 'sopt' => $date_operators)), array('name'=>'display_end_date', 'index'=>'display_end_date', 'width'=>'50', 'align'=>'left', 'search' => 'true', 'searchoptions' => array('dataInit' => 'date_pick_one_month', 'sopt' => $date_operators)),
array('name'=>'visibility', 'index'=>'visibility', 'width'=>'40', 'align'=>'left', 'search' => 'false'), array('name'=>'visibility', 'index'=>'visibility', 'width'=>'40', 'align'=>'left', 'search' => 'false'),
); );
break; break;

@ -61,7 +61,7 @@ class ZombieReport implements Countable
), ),
array( array(
'name' => 'submit_button', 'name' => 'submit_button',
'type' => 'style_submit_button', 'type' => 'button',
'value' => get_lang('Search'), 'value' => get_lang('Search'),
'attributes' => array('class' => 'search') 'attributes' => array('class' => 'search')
) )

@ -34,8 +34,6 @@ if ($action == 'delete') {
exit(); exit();
} }
//$interbreadcrumb[]=array("url" => "index.php","name" => get_lang('PlatformAdmin'));
$tool_name = get_lang('SessionList'); $tool_name = get_lang('SessionList');
Display::display_header($tool_name); Display::display_header($tool_name);
@ -49,7 +47,14 @@ if (!empty($courseId)) {
$courseList[$courseInfo['code']] = $parents . $courseInfo['title']; $courseList[$courseInfo['code']] = $parents . $courseInfo['title'];
} }
$sessionFilter = new FormValidator('course_filter', 'get', '', '', array(), FormValidator::LAYOUT_INLINE); $sessionFilter = new FormValidator(
'course_filter',
'get',
'',
'',
array(),
FormValidator::LAYOUT_INLINE
);
$sessionFilter->addElement( $sessionFilter->addElement(
'select_ajax', 'select_ajax',
'course_name', 'course_name',
@ -96,10 +101,10 @@ $result = SessionManager::getGridColumns($list_type);
$columns = $result['columns']; $columns = $result['columns'];
$column_model = $result['column_model']; $column_model = $result['column_model'];
//Autowidth // Autowidth
$extra_params['autowidth'] = 'true'; $extra_params['autowidth'] = 'true';
//height auto // height auto
$extra_params['height'] = 'auto'; $extra_params['height'] = 'auto';
$extra_params['postData'] =array( $extra_params['postData'] =array(

@ -98,10 +98,10 @@ function settingsForm($defaults)
$form->createElement('radio', 'student_delete_own_publication', null, get_lang('No'), 0) $form->createElement('radio', 'student_delete_own_publication', null, get_lang('No'), 0)
); );
$form->addGroup($group, '', get_lang('StudentAllowedToDeleteOwnPublication')); $form->addGroup($group, '', get_lang('StudentAllowedToDeleteOwnPublication'));
$form->addElement('button', 'submit', get_lang('Save')); $form->addButtonSave(get_lang('Save'));
$form->setDefaults($defaults); $form->setDefaults($defaults);
return $form->return_form(); return $form->returnForm();
} }
/** /**

Loading…
Cancel
Save