Fixing define PHP errorPHP warning/notices avoided

skala
Julio Montoya 13 years ago
parent 8eb2609715
commit 8c57e73fe4
  1. 2
      main/admin/statistics/statistics.lib.php
  2. 7
      main/auth/profile.php
  3. 11
      main/dashboard/dashboard.php
  4. 2
      main/dashboard/dashboard_controller.php
  5. 11
      main/inc/lib/dashboard.lib.php
  6. 2
      main/inc/lib/sessionmanager.lib.php
  7. 1
      main/inc/lib/usermanager.lib.php
  8. 8
      main/social/friends.php
  9. 11
      main/social/groups.php
  10. 6
      main/social/invitations.php
  11. 2
      main/social/search.php
  12. 3
      plugin/dashboard/block_course/block_course.class.php
  13. 3
      plugin/dashboard/block_daily/block_daily.class.php
  14. 8
      plugin/dashboard/block_student/block_student.class.php
  15. 11
      plugin/dashboard/block_teacher/block_teacher.class.php

@ -57,7 +57,7 @@ class Statistics {
$course_table = Database :: get_main_table(TABLE_MAIN_COURSE);
$access_url_rel_course_table= Database :: get_main_table(TABLE_MAIN_ACCESS_URL_REL_COURSE);
$current_url_id = api_get_current_access_url_id();
if ($_configuration['multiple_access_urls']) {
if (api_is_multiple_url_enabled()) {
$sql = "SELECT COUNT(*) AS number FROM ".$course_table." as c, ".$access_url_rel_course_table." as u WHERE u.course_code=c.code AND access_url_id='".$current_url_id."'";
if (isset ($vis)) {
$sql .= " AND visibility = ".intval($vis);

@ -688,8 +688,6 @@ if (!empty($msg_is_not_password)){
$image_syspath = UserManager::get_user_picture_path_by_id(api_get_user_id(), 'system', false, true);
$image_syspath['dir'].$image_syspath['file'];
//$image_size = api_getimagesize($image_syspath['dir'].$image_syspath['file']);
//Web path
$image_path = UserManager::get_user_picture_path_by_id(api_get_user_id(), 'web', false, true);
$image_dir = $image_path['dir'];
@ -698,10 +696,6 @@ $image_file = $image_dir.$image;
$img_attributes = 'src="'.$image_file.'?rand='.time().'" '
.'alt="'.api_get_person_name($user_data['firstname'], $user_data['lastname']).'" '
.'style="float:'.($text_dir == 'rtl' ? 'left' : 'right').'; margin-top:0px;padding:5px;" ';
if ($image_size['width'] > 300) {
//limit display width to 300px
$img_attributes .= 'width="300" ';
}
// get the path,width and height from original picture
$big_image = $image_dir.'big_'.$image;
@ -723,7 +717,6 @@ if (api_get_setting('allow_social_tool') == 'true') {
echo '</div>';
} else {
// Style position:absolute has been removed for Opera-compatibility.
//echo '<div id="image-message-container" style="float:right;display:inline;position:absolute;padding:3px;width:250px;" >';
echo '<div id="image-message-container" style="float:right;display:inline;padding:3px;width:230px;" >';
if ($image == 'unknown.jpg') {

@ -12,19 +12,20 @@ api_block_anonymous_users();
// menu actions for dashboard views
$views = array('blocks', 'list');
//$dashboard_view = 'blocks';
if(isset($_GET['view']) && in_array($_GET['view'], $views)){
$dashboard_view = $_GET['view'];
}
if($dashboard_view == 'list') {
$link_blocks_view = '<a href="'.api_get_self().'?view=blocks">'.Display::return_icon('blocks.png',get_lang('DashboardBlocks'),'',ICON_SIZE_MEDIUM).'</a>';
$link_blocks_view = $link_list_view = null;
if (isset($dashboard_view) && $dashboard_view == 'list') {
$link_blocks_view = '<a href="'.api_get_self().'?view=blocks">'.Display::return_icon('blocks.png',get_lang('DashboardBlocks'),'',ICON_SIZE_MEDIUM).'</a>';
} else {
$link_list_view = '<a href="'.api_get_self().'?view=list">'.Display::return_icon('edit.png',get_lang('EditBlocks'),'',ICON_SIZE_MEDIUM).'</a>';
}
$configuration_link = '';
$configuration_link = null;
if (api_is_platform_admin()) {
$configuration_link = '<a href="'.api_get_path(WEB_CODE_PATH).'admin/settings.php?category=Plugins">'
.Display::return_icon('settings.png',get_lang('ConfigureDashboardPlugin'),'',ICON_SIZE_MEDIUM).'</a>';
@ -35,7 +36,7 @@ echo $link_blocks_view.$link_list_view.$configuration_link;
echo '</div>';
// block dashboard view
if($dashboard_view == 'blocks') {
if (isset($dashboard_view) && $dashboard_view == 'blocks') {
if (isset($msg)) {
//Display::display_confirmation_message(get_lang('BlocksHaveBeenUpdatedSuccessfully'));

@ -41,6 +41,8 @@ class DashboardController { // extends Controller {
$user_block_data = DashboardManager::get_user_block_data($user_id);
$user_blocks_id = array_keys($user_block_data);
$data_block = null;
if (!empty($dashboard_blocks)) {
foreach ($dashboard_blocks as $block) {

@ -9,7 +9,6 @@
* Code
*/
// required files
require_once api_get_path(LIBRARY_PATH).'usermanager.lib.php';
/**
* DashboardManager can be used to manage dashboard
* @package chamilo.dashboard
@ -381,8 +380,8 @@ class DashboardManager {
echo '<td>'.$block['description'].'</td>';
echo '<td><center>
<select name="columns['.$block['id'].']">
<option value="1" '.($user_block_data[$block['id']]['column']==1?'selected':'').' >1</option>
<option value="2" '.($user_block_data[$block['id']]['column']==2?'selected':'').' >2</option>
<option value="1" '.(isset($user_block_data[$block['id']]) && $user_block_data[$block['id']]['column']==1?'selected':'').' >1</option>
<option value="2" '.(isset($user_block_data[$block['id']]) && $user_block_data[$block['id']]['column']==2?'selected':'').' >2</option>
</select></center>
</td>';
echo '</tr>';
@ -464,13 +463,13 @@ class DashboardManager {
$data = array();
foreach ($extra_user_data as $extra) {
$split_extra = explode(':',$extra);
if (!empty($split_extra)) {
$block_id = $split_extra[0];
$column = $split_extra[1];
$column = isset($split_extra[1]) ? $split_extra[1] : null;
$data[$block_id] = array('block_id' => $block_id, 'column' => $column);
}
}
return $data;
}
/**

@ -1469,7 +1469,7 @@ class SessionManager {
$hr_manager_id = intval($hr_manager_id);
$assigned_sessions_to_hrm = array();
if ($_configuration['multiple_access_urls']) {
if (api_is_multiple_url_enabled()) {
$sql = "SELECT * FROM $tbl_session s INNER JOIN $tbl_session_rel_user sru ON (sru.id_session = s.id) LEFT JOIN $tbl_session_rel_access_url a ON (s.id = a.session_id)
WHERE sru.id_user = '$hr_manager_id' AND sru.relation_type = '".SESSION_RELATION_TYPE_RRHH."' AND access_url_id = ".api_get_current_access_url_id()."";
} else {

@ -3162,7 +3162,6 @@ class UserManager {
$condition_status = '';
if (!empty($user_status)) {
$status = intval($status);
$condition_status = ' AND u.status = '.$user_status;
}
if (api_get_multiple_access_url()) {

@ -1,5 +1,6 @@
<?php
/* For licensing terms, see /chamilo_license.txt */
/* For licensing terms, see /license.txt */
/**
* @package chamilo.social
* @author Julio Montoya <gugli100@gmail.com>
@ -21,7 +22,7 @@ if (api_get_setting('allow_social_tool') !='true') {
$this_section = SECTION_SOCIAL;
$htmlHeadXtra[] = '<script type="text/javascript">
$htmlHeadXtra[] = '<script>
function delete_friend (element_div) {
id_image=$(element_div).attr("id");
@ -143,7 +144,6 @@ $social_right_content .= '</div>';
$tpl = new Template(get_lang('Social'));
$tpl->assign('social_left_content', $social_left_content);
$tpl->assign('social_right_content', $social_right_content);
$tpl->assign('actions', $actions);
$tpl->assign('message', $message);
$social_layout = $tpl->get_template('layout/social_layout.tpl');
$tpl->display($social_layout);

@ -118,6 +118,7 @@ jQuery(document).ready(function() {
$allowed_views = array('mygroups','newest','pop');
$interbreadcrumb[]= array ('url' =>'home.php','name' => get_lang('SocialNetwork'));
$content = null;
if (isset($_GET['view']) && in_array($_GET['view'],$allowed_views)) {
if ($_GET['view'] == 'mygroups') {
@ -187,6 +188,8 @@ if ($group_id != 0 ) {
$social_left_content = SocialManager::show_social_menu($show_menu);
}
$social_right_content = null;
if ($group_id != 0 ) {
$group_info = GroupPortalManager::get_group_data($group_id);
@ -455,6 +458,8 @@ if ($group_id != 0 ) {
// Display groups (newest, mygroups, pop)
$query_vars = array();
$newest_content = $popular_content = $my_group_content = null;
if (isset($_GET['view']) && in_array($_GET['view'],$allowed_views)) {
$view_group = $_GET['view'];
@ -521,18 +526,16 @@ if ($group_id != 0 ) {
$social_right_content .= '<div class="span9">'.Display::tabs($headers, array($newest_content, $popular_content, $my_group_content),'tab_browse').'</div>';
}
//Display :: display_footer();
$show_message = null;
if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'show_message' && $_REQUEST['msg'] == 'topic_deleted') {
$show_message = Display::return_message(get_lang('Deleted'), 'success');
}
$tpl = new Template($tool_name);
$tpl = new Template();
$tpl->set_help('Groups');
$tpl->assign('social_left_content', $social_left_content);
$tpl->assign('social_left_menu', $social_left_menu);
$tpl->assign('social_right_content', $social_right_content);
$tpl->assign('actions', $actions);
$tpl->assign('message', $show_message);
$tpl->assign('content', $content);
$social_layout = $tpl->get_template('layout/social_layout.tpl');

@ -65,6 +65,8 @@ function register_friend(element_input) {
}
</script>';
$show_message = null;
$content = null;
// easy links
if (is_array($_GET) && count($_GET)>0) {
@ -188,12 +190,10 @@ if (count($pending_invitations) > 0) {
$social_right_content .= Display::return_sortable_grid('waiting_user', array(), $new_invitation, array('hide_navigation'=>true, 'per_page' => 100), $query_vars, false, array(true, true, true,false,false,true,true,true,true));
}
$tpl = new Template($tool_name);
$tpl = new Template(null);
$tpl->assign('social_left_content', $social_left_content);
$tpl->assign('social_left_menu', $social_left_menu);
$tpl->assign('social_right_content', $social_right_content);
$tpl->assign('actions', $actions);
$tpl->assign('message', $show_message);
$tpl->assign('content', $content);
$social_layout = $tpl->get_template('layout/social_layout.tpl');

@ -40,7 +40,7 @@ if ($query !='') {
$social_right_content .= get_lang('SorryNoResults');
}
$results .= '<div id="online_grid_container"><div class="span9">';
$results = '<div id="online_grid_container"><div class="span9">';
if (is_array($users) && count($users)> 0) {
$results .= Display::page_subheader(get_lang('Users'));

@ -94,8 +94,9 @@ class BlockCourse extends Block {
$course_data = $this->get_course_information_data();
$content = '<div style="margin:10px;">';
$content .= '<h3><font color="#000">'.get_lang('YourCourseList').'</font></h3>';
$data_table = null;
if (!empty($course_data)) {
$data_table = '<table class="data_table" width:"95%">';
$data_table .= '<table class="data_table" width:"95%">';
$data_table .= '<tr>
<th>'.get_lang('CourseTitle').'</th>
<th width="20%">'.get_lang('NbStudents').'</th>

@ -98,8 +98,9 @@ class BlockDaily extends Block {
$course_data = $this->get_course_information_data();
$content = '<div style="margin:10px;">';
$content .= '<h3><font color="#000">'.get_lang('YourCourseList').'</font></h3>';
$data_table = null;
if (!empty($course_data)) {
$data_table = '<table class="data_table" width:"95%">';
$data_table .= '<table class="data_table" width:"95%">';
$data_table .= '<tr>
<th>'.get_lang('CourseTitle').'</th>
<th width="20%">'.get_lang('NbStudents').'</th>

@ -94,9 +94,9 @@ class BlockStudent extends Block {
$students = $this->students;
$content = '<div style="margin:10px;">';
$content .= '<h3><font color="#000">'.get_lang('YourStudents').'</font></h3>';
$students_table = null;
if (count($students) > 0) {
$students_table = '<table class="data_table">';
$students_table .= '<table class="data_table">';
$students_table .= '<tr>
<th width="10%" rowspan="2">'.get_lang('FirstName').'</th>
<th width="10%" rowspan="2">'.get_lang('LastName').'</th>
@ -163,9 +163,9 @@ class BlockStudent extends Block {
$students = $this->students;
$content = '<div style="margin:5px;">';
$content .= '<h3><font color="#000">'.get_lang('YourStudents').'</font></h3>';
$students_table = null;
if (count($students) > 0) {
$students_table = '<table class="data_table">';
$students_table .= '<table class="data_table">';
$students_table .= '<tr>
<th>'.get_lang('User').'</th>
<th>'.get_lang('AttendancesFaults').'</th>

@ -96,12 +96,12 @@ class BlockTeacher extends Block {
public function get_teachers_content_html_for_platform_admin() {
$teachers = $this->teachers;
$content = '';
$content = '<div style="margin:10px;">';
$content .= '<h3><font color="#000">'.get_lang('YourTeachers').'</font></h3>';
$teachers_table = null;
if (count($teachers) > 0) {
$teachers_table = '<table class="data_table" width:"95%">';
$teachers_table .= '<table class="data_table" width:"95%">';
$teachers_table .= '
<tr>
<th>'.get_lang('User').'</th>
@ -138,7 +138,6 @@ class BlockTeacher extends Block {
$teachers_table .= get_lang('ThereIsNoInformationAboutYourTeachers');
}
$content .= $teachers_table;
if (count($teachers) > 0) {
@ -152,17 +151,15 @@ class BlockTeacher extends Block {
}
public function get_teachers_content_html_for_drh() {
$teachers = $this->teachers;
$content = '';
$content = '<div style="margin:10px;">';
$content .= '<h3><font color="#000">'.get_lang('YourTeachers').'</font></h3>';
$teachers_table = null;
if (count($teachers) > 0) {
$a_last_week = get_last_week();
$last_week = date('Y-m-d',$a_last_week[0]).' '.get_lang('To').' '.date('Y-m-d', $a_last_week[6]);
$teachers_table = '<table class="data_table" width:"95%">';
$teachers_table .= '<table class="data_table" width:"95%">';
$teachers_table .= '
<tr>
<th>'.get_lang('User').'</th>

Loading…
Cancel
Save