diff --git a/main/dropbox/index.php b/main/dropbox/index.php index 68aef7f876..a17d3e5284 100755 --- a/main/dropbox/index.php +++ b/main/dropbox/index.php @@ -5,7 +5,7 @@ require_once 'dropbox_init.inc.php'; // get the last time the user accessed the tool -if ($_SESSION[$_course['id']]['last_access'][TOOL_DROPBOX] == '') { +if (isset($_SESSION[$_course['id']]) && $_SESSION[$_course['id']]['last_access'][TOOL_DROPBOX] == '') { $last_access = get_last_tool_access(TOOL_DROPBOX); $_SESSION[$_course['id']]['last_access'][TOOL_DROPBOX] = $last_access; } else { @@ -181,9 +181,11 @@ if (isset($_GET['error']) AND !empty($_GET['error'])) { Display :: display_normal_message(get_lang($_GET['error'])); } +$dropbox_data_sent = array(); +$movelist = array(); +$dropbox_data_recieved = array(); if ($action != 'add') { - // Getting all the categories in the dropbox for the given user $dropbox_categories = get_dropbox_categories(); // Greating the arrays with the categories for the received files and for the sent files diff --git a/main/exercice/exercise.lib.php b/main/exercice/exercise.lib.php index 9a0b73250f..6d36767778 100755 --- a/main/exercice/exercise.lib.php +++ b/main/exercice/exercise.lib.php @@ -1379,7 +1379,9 @@ function get_exam_results_data( $teacher_id_list[] = $teacher['user_id']; } - //Simple exercises + $list_info = array(); + + // Simple exercises if (empty($hotpotatoe_where)) { $column = !empty($column) ? Database::escape_string($column) : null; $from = intval($from); @@ -1407,7 +1409,7 @@ function get_exam_results_data( $lp_list_obj = new learnpathList(api_get_user_id()); $lp_list = $lp_list_obj->get_flat_list(); - $list_info = array(); + if (is_array($results)) { $users_array_id = array(); diff --git a/main/forum/forumfunction.inc.php b/main/forum/forumfunction.inc.php index 4972befc9b..cce5651dd7 100755 --- a/main/forum/forumfunction.inc.php +++ b/main/forum/forumfunction.inc.php @@ -182,6 +182,7 @@ function handle_forum_and_forumcategories($lp_id = null) $return_message = delete_forum_forumcategory_thread($get_content, $get_id); Display::display_confirmation_message($return_message, false); } + // Change visibility of a forum or a forum category. if ($action_forum_cat == 'invisible' || $action_forum_cat == 'visible') { $return_message = change_visibility($get_content, $get_id, $action_forum_cat); @@ -1023,9 +1024,9 @@ function display_up_down_icon($content, $id, $list) /** * This function changes the visibility in the database (item_property) * - * @param $content what is it that we want to make (in)visible: forum category, forum, thread, post - * @param $id the id of the content we want to make invisible - * @param $target_visibility what is the current status of the visibility (0 = invisible, 1 = visible) + * @param string $content what is it that we want to make (in)visible: forum category, forum, thread, post + * @param int $id the id of the content we want to make invisible + * @param string $target_visibility what is the current status of the visibility (0 = invisible, 1 = visible) * * @todo change the get parameter so that it matches the tool constants. * @todo check if api_item_property_update returns true or false => returnmessage depends on it. diff --git a/main/gradebook/gradebook_display_certificate.php b/main/gradebook/gradebook_display_certificate.php index 2364de90c4..2365fbf085 100755 --- a/main/gradebook/gradebook_display_certificate.php +++ b/main/gradebook/gradebook_display_certificate.php @@ -97,7 +97,7 @@ $this_section = SECTION_COURSES; Display::display_header(''); -if ($_GET['action'] == 'delete') { +if (isset($_GET['action']) && $_GET['action'] == 'delete') { $check = Security::check_token('get'); if ($check) { $certificate = new Certificate($_GET['certificate_id']); diff --git a/main/gradebook/gradebook_edit_all.php b/main/gradebook/gradebook_edit_all.php index 29e3d8899b..593dc197cf 100755 --- a/main/gradebook/gradebook_edit_all.php +++ b/main/gradebook/gradebook_edit_all.php @@ -57,7 +57,6 @@ $course_id = get_course_id_by_link_id($my_selectcat); $table_link = Database::get_main_table(TABLE_MAIN_GRADEBOOK_LINK); $table_evaluation = Database::get_main_table(TABLE_MAIN_GRADEBOOK_EVALUATION); - $tbl_forum_thread = Database :: get_course_table(TABLE_FORUM_THREAD); $tbl_work = Database :: get_course_table(TABLE_STUDENT_PUBLICATION); $tbl_attendance = Database :: get_course_table(TABLE_ATTENDANCE); @@ -77,7 +76,7 @@ if ($submitted==1) { require_once 'lib/be/evaluation.class.php'; $eval_log = new Evaluation(); } - if(isset($_POST['link'])){ + if (isset($_POST['link'])) { require_once 'lib/be/abstractlink.class.php'; //$eval_link_log = new AbstractLink(); } @@ -170,7 +169,7 @@ if ($my_api_cidreq=='') { } ?>
- +
@@ -178,7 +177,7 @@ if ($my_api_cidreq=='') { $warning_message = sprintf(get_lang('TotalWeightMustBeX'), $masked_total); Display::display_normal_message($warning_message, false); ?> -
+ @@ -189,7 +188,9 @@ Display::display_normal_message($warning_message, false);

- +
save_linked_data(); - $tbl_grade_links = Database :: get_main_table(TABLE_MAIN_GRADEBOOK_LINK); $sql = "UPDATE $tbl_grade_links SET type = ".intval($this->get_type()).", @@ -322,7 +322,7 @@ abstract class AbstractLink implements GradebookItem /** * @param int $idevaluation */ - public function add_link_log($idevaluation) + public static function add_link_log($idevaluation) { $tbl_grade_linkeval_log = Database :: get_main_table(TABLE_MAIN_GRADEBOOK_LINKEVAL_LOG); $dateobject=AbstractLink::load ($idevaluation,null,null,null,null); @@ -345,7 +345,8 @@ abstract class AbstractLink implements GradebookItem /** * Delete this link from the database */ - public function delete() { + public function delete() + { $this->delete_linked_data(); $tbl_grade_links = Database :: get_main_table(TABLE_MAIN_GRADEBOOK_LINK); $sql = 'DELETE FROM '.$tbl_grade_links.' WHERE id = '.intval($this->id); @@ -361,7 +362,6 @@ abstract class AbstractLink implements GradebookItem public function get_target_categories() { // links can only be moved to categories inside this course - $targets = array(); $level = 0; @@ -416,22 +416,26 @@ abstract class AbstractLink implements GradebookItem $foundlinks[] = $link; } } + return $foundlinks; } - - // Other methods implementing GradebookItem + /** + * @return string + */ public function get_item_type() { return 'L'; } - public function get_icon_name() { + /** + * @return string + */ + public function get_icon_name() + { return 'link'; } - // ABSTRACT FUNCTIONS - to be implemented by subclass - abstract function has_results(); abstract function get_link(); abstract function is_valid_link(); @@ -469,19 +473,31 @@ abstract class AbstractLink implements GradebookItem { } + /** + * + */ public function delete_linked_data() { } - public function set_name ($name) + /** + * @param $name + */ + public function set_name($name) { } - public function set_description ($description) + /** + * @param $description + */ + public function set_description($description) { } - public function set_max ($max) + /** + * @param $max + */ + public function set_max($max) { } @@ -495,7 +511,7 @@ abstract class AbstractLink implements GradebookItem * @param int locked 1 or unlocked 0 * * */ - function lock($locked) + public function lock($locked) { $table = Database::get_main_table(TABLE_MAIN_GRADEBOOK_LINK); $sql = "UPDATE $table SET locked = '".intval($locked)."' WHERE id='".$this->id."'"; diff --git a/main/messages/new_message.php b/main/messages/new_message.php index 22f8ce2d15..7b63fee8d3 100755 --- a/main/messages/new_message.php +++ b/main/messages/new_message.php @@ -344,7 +344,7 @@ if (!isset($_POST['compose'])) { // post if ($restrict) { if (!isset($_POST['group_id'])) { - $default['users'] = $_POST['users']; + $default['users'] = isset($_POST['users']) ? $_POST['users'] : null; } else { $default['group_id'] = $_POST['group_id']; } diff --git a/main/social/group_topics.php b/main/social/group_topics.php index 7e7e6c87cd..fd2ca973c3 100755 --- a/main/social/group_topics.php +++ b/main/social/group_topics.php @@ -1,5 +1,6 @@ diff --git a/main/social/groups.php b/main/social/groups.php index 322a6370a2..20610891fb 100755 --- a/main/social/groups.php +++ b/main/social/groups.php @@ -1,5 +1,6 @@ @@ -47,9 +48,7 @@ function remove_image_form(id_elem1) { if (filepaths.childNodes.length < 3) { var link_attach = document.getElementById("link-more-attach"); if (link_attach) { - link_attach.innerHTML=\'' . get_lang( - 'AddOneMoreFile' - ) . '\'; + link_attach.innerHTML=\'' . get_lang('AddOneMoreFile') . '\'; } } } @@ -67,10 +66,7 @@ function add_image_form() { filepaths.appendChild(elem1); id_elem1 = "filepath_"+counter_image; id_elem1 = "\'"+id_elem1+"\'"; - document.getElementById("filepath_"+counter_image).innerHTML = " "; - + document.getElementById("filepath_"+counter_image).innerHTML = " "; if (filepaths.childNodes.length == 3) { var link_attach = document.getElementById("link-more-attach"); if (link_attach) { @@ -92,34 +88,33 @@ jQuery(document).ready(function() { $("#tab_browse").bind("tabsselect", function(event, ui) { window.location.href=ui.tab; }); + $("#tabs").tabs(); $("#tab_browse").tabs(); - var valor = "' . $anchor . '"; $(".head").click(function() { - $(this).next().next().slideToggle("fast"); - image_clicked = $("#" + this.id + " img").attr("src"); - image_clicked_info = image_clicked.split("/"); - image_real_clicked = image_clicked_info[image_clicked_info.length-1]; - image_path = image_clicked.split("img"); - current_path = image_path[0]+"img/"; - if (image_real_clicked == "div_show.gif") { - current_path = current_path+"div_hide.gif"; - $("#" + this.id + " img").attr("src", current_path); - } else { - current_path = current_path+"div_show.gif"; - $("#" + this.id + " img").attr("src", current_path) - } - return false; - }).next().next().hide(); + $(this).next().next().slideToggle("fast"); + image_clicked = $("#" + this.id + " img").attr("src"); + image_clicked_info = image_clicked.split("/"); + image_real_clicked = image_clicked_info[image_clicked_info.length-1]; + image_path = image_clicked.split("img"); + current_path = image_path[0]+"img/"; + if (image_real_clicked == "div_show.gif") { + current_path = current_path+"div_hide.gif"; + $("#" + this.id + " img").attr("src", current_path); + } else { + current_path = current_path+"div_show.gif"; + $("#" + this.id + " img").attr("src", current_path) + } + return false; + }).next().next().hide(); // anchor for current topic if (valor) { $("#"+valor).show(); window.location = document.URL+"#"+valor; } - }); '; diff --git a/main/social/message_for_group_form.inc.php b/main/social/message_for_group_form.inc.php index aad98fd704..1531461564 100755 --- a/main/social/message_for_group_form.inc.php +++ b/main/social/message_for_group_form.inc.php @@ -4,9 +4,7 @@ * Form for group message * @package chamilo.social */ -/** - * Initialization - */ + $language_file = array('registration', 'messages', 'userInfo', 'admin'); $cidReset = true; require_once '../inc/global.inc.php'; @@ -36,19 +34,15 @@ if (isset($_REQUEST['user_friend'])) { } $group_id = intval($_GET['group_id']); +$message_id = isset($_GET['message_id']) ? intval($_GET['message_id']) : null; -$message_id = intval($_GET['message_id']); $actions = array( 'add_message_group', 'edit_message_group', 'reply_message_group' ); -$allowed_action = (isset($_GET['action']) && in_array( - $_GET['action'], - $actions - )) ? Security::remove_XSS($_GET['action']) : ''; - +$allowed_action = (isset($_GET['action']) && in_array($_GET['action'], $actions)) ? Security::remove_XSS($_GET['action']) : ''; $to_group = ''; $subject = ''; $message = ''; @@ -75,24 +69,15 @@ if (!empty($group_id) && $allowed_action) { } } -$page_item = !empty($_GET['topics_page_nr']) ? intval( - $_GET['topics_page_nr'] -) : 1; -$param_item_page = isset($_GET['items_page_nr']) && isset($_GET['topic_id']) ? ('&items_' . intval( - $_GET['topic_id'] - ) . '_page_nr=' . (!empty($_GET['topics_page_nr']) ? intval( - $_GET['topics_page_nr'] - ) : 1)) : ''; +$page_item = !empty($_GET['topics_page_nr']) ? intval($_GET['topics_page_nr']) : 1; +$param_item_page = isset($_GET['items_page_nr']) && isset($_GET['topic_id']) ? ('&items_' . intval($_GET['topic_id']) . '_page_nr=' . (!empty($_GET['topics_page_nr']) ? intval($_GET['topics_page_nr']) : 1)) : ''; $param_item_page .= '&topic_id=' . intval($_GET['topic_id']); -$page_topic = !empty($_GET['topics_page_nr']) ? intval( - $_GET['topics_page_nr'] -) : 1; +$page_topic = !empty($_GET['topics_page_nr']) ? intval($_GET['topics_page_nr']) : 1; +$anchor = isset($_GET['anchor_topic']) ? Security::remove_XSS($_GET['anchor_topic']) : null; ?>
diff --git a/main/survey/survey.lib.php b/main/survey/survey.lib.php index 963e836043..40efc3ee81 100755 --- a/main/survey/survey.lib.php +++ b/main/survey/survey.lib.php @@ -872,6 +872,7 @@ class survey_manager $sql = "SELECT * FROM $table_survey_question_option WHERE c_id = $course_id AND survey_id='".Database::escape_string($survey_id)."'"; $result = Database::query($sql); + $return = array(); while ($row = Database::fetch_array($result, 'ASSOC')) { $return[$row['question_id']]['answers'][] = $row['option_text']; } @@ -2631,7 +2632,7 @@ class SurveyUtil * @author Patrick Cool , Ghent University * @version February 2007 */ - static function handle_reporting_actions($survey_data, $people_filled) + public static function handle_reporting_actions($survey_data, $people_filled) { $action = isset($_GET['action']) ? $_GET['action'] : null; @@ -2639,7 +2640,8 @@ class SurveyUtil $temp_questions_data = survey_manager::get_questions($_GET['survey_id']); // Sorting like they should be displayed and removing the non-answer question types (comment and pagebreak) - $my_temp_questions_data=($temp_questions_data==null) ? array() : $temp_questions_data; + $my_temp_questions_data = ($temp_questions_data==null) ? array() : $temp_questions_data; + $questions_data = array(); foreach ($my_temp_questions_data as $key => & $value) { if ($value['type'] != 'comment' && $value['type'] != 'pagebreak') { $questions_data[$value['sort']] = $value; @@ -2892,6 +2894,7 @@ class SurveyUtil } $currentQuestion = isset($_GET['question']) ? $_GET['question'] : 0; + $question = array(); echo '