Format code

ofaj
jmontoyaa 10 years ago
parent c4c0e0fde5
commit d6381bee81
  1. 26
      main/course_progress/thematic_advance.php
  2. 2
      main/course_progress/thematic_controller.php
  3. 13
      main/create_course/add_course.php
  4. 27
      main/dropbox/dropbox_class.inc.php
  5. 7
      main/exercise/exercise.php
  6. 13
      main/forum/forumfunction.inc.php
  7. 2
      main/forum/viewforum.php
  8. 3
      main/gradebook/certificate_report.php
  9. 8
      main/gradebook/get_badges.php
  10. 71
      main/gradebook/gradebook.php
  11. 14
      main/gradebook/gradebook_add_result.php
  12. 72
      main/gradebook/gradebook_add_user.php
  13. 6
      main/gradebook/lib/GradebookUtils.php
  14. 3
      main/gradebook/search.php
  15. 4
      main/group/group.php
  16. 2
      main/group/group_category.php
  17. 27
      main/group/group_creation.php
  18. 23
      main/group/group_edit.php
  19. 53
      main/group/group_space.php
  20. 4
      main/inc/lib/attendance.lib.php
  21. 10
      main/lp/learnpath.class.php
  22. 15
      main/messages/inbox.php
  23. 22
      main/messages/new_message.php
  24. 34
      main/messages/outbox.php
  25. 8
      main/messages/view_message.php
  26. 3
      main/mySpace/user_edit.php
  27. 37
      main/notebook/index.php
  28. 15
      main/search/search_suggestions.php
  29. 18
      main/session/about.php
  30. 275
      main/session/add_courses_to_session.php
  31. 1
      main/social/friends.php
  32. 5
      main/social/group_add.php
  33. 4
      main/social/group_edit.php
  34. 3
      main/social/group_view.php
  35. 1
      main/social/group_waiting_list.php
  36. 25
      main/social/groups.php
  37. 9
      main/social/home.php
  38. 2
      main/social/invitations.php
  39. 6
      main/social/message_for_group_form.inc.php
  40. 6
      main/social/my_skills_report.php
  41. 2
      main/social/skills_tree.php
  42. 2
      main/social/skills_wheel.php
  43. 2
      main/survey/create_new_survey.php
  44. 2
      main/survey/survey.lib.php
  45. 2
      main/work/edit_work.php
  46. 6
      main/work/work.lib.php
  47. 5
      src/Chamilo/CoreBundle/Component/Editor/CkEditor/Toolbar/AgendaStudent.php
  48. 2
      src/Chamilo/CoreBundle/Component/Editor/CkEditor/Toolbar/Announcements.php
  49. 3
      src/Chamilo/CoreBundle/Component/Editor/CkEditor/Toolbar/AssessmentsIntroduction.php
  50. 2
      src/Chamilo/CoreBundle/Component/Editor/Editor.php

@ -30,10 +30,10 @@ if ($action == 'thematic_advance_add' || $action == 'thematic_advance_edit') {
$form->addElement('hidden', 'action', $action);
if (!empty($thematic_advance_id)) {
$form->addElement('hidden', 'thematic_advance_id',$thematic_advance_id);
$form->addElement('hidden', 'thematic_advance_id', $thematic_advance_id);
}
if (!empty($thematic_id)) {
$form->addElement('hidden', 'thematic_id',$thematic_id);
$form->addElement('hidden', 'thematic_id', $thematic_id);
}
$radios = array();
@ -80,14 +80,30 @@ if ($action == 'thematic_advance_add' || $action == 'thematic_advance_edit') {
}
if (count($attendance_select) > 1) {
$form->addElement('select', 'attendance_select', get_lang('Attendances'), $attendance_select, array('id' => 'id_attendance_select', 'onchange' => 'datetime_by_attendance(this.value)'));
$form->addElement(
'select',
'attendance_select',
get_lang('Attendances'),
$attendance_select,
array('id' => 'id_attendance_select', 'onchange' => 'datetime_by_attendance(this.value)')
);
} else {
$form->addElement('label', get_lang('Attendances'), '<strong><em>'.get_lang('ThereAreNoAttendancesInsideCourse').'</em></strong>');
$form->addElement(
'label',
get_lang('Attendances'),
'<strong><em>'.get_lang('ThereAreNoAttendancesInsideCourse').'</em></strong>'
);
}
$form->addElement('html', '<div id="div_datetime_attendance">');
if (!empty($calendar_select)) {
$form->addElement('select', 'start_date_by_attendance', get_lang('StartDate'), $calendar_select, array('id'=>'start_date_select_calendar'));
$form->addElement(
'select',
'start_date_by_attendance',
get_lang('StartDate'),
$calendar_select,
array('id' => 'start_date_select_calendar')
);
}
$form->addElement('html', '</div>');
$form->addElement('html', '</div>');

@ -39,7 +39,7 @@ class ThematicController
$data = array();
$check = Security::check_token('request');
$thematic_id = isset($_REQUEST['thematic_id']) ? intval($_REQUEST['thematic_id']) : null;
$displayHeader = (!empty($_REQUEST['display']) && $_REQUEST['display'] === 'no_header') ? false : true;
$displayHeader = !empty($_REQUEST['display']) && $_REQUEST['display'] === 'no_header' ? false : true;
if ($check) {
switch ($action) {

@ -11,7 +11,6 @@
* "Course validation" feature, technical adaptation for Chamilo 1.8.8:
* @author Ivan Tcholakov <ivantcholakov@gmail.com>
*/
use \ChamiloSession as Session;
// Flag forcing the "current course" reset.
$cidReset = true;
@ -26,7 +25,7 @@ $this_section = SECTION_COURSES;
// true - the new course is requested only and it is created after approval;
// false - the new course is created immediately, after filling this form.
$course_validation_feature = false;
if (api_get_setting('course_validation') == 'true' && !api_is_platform_admin()) {
if (api_get_setting('course_validation') === 'true' && !api_is_platform_admin()) {
$course_validation_feature = true;
}
@ -49,10 +48,7 @@ $tool_name = $course_validation_feature ? get_lang('CreateCourseRequest') : get_
$tpl = new Template($tool_name);
if (
api_get_setting('allow_users_to_create_courses') == 'false' &&
!api_is_platform_admin()
) {
if (api_get_setting('allow_users_to_create_courses') === 'false' && !api_is_platform_admin()) {
api_not_allowed(true);
}
@ -123,7 +119,6 @@ $form->addRule(
);
// The teacher
//array(get_lang('Professor'), null), null, array('size' => '60', 'disabled' => 'disabled'));
$titular = & $form->addElement('hidden', 'tutor_name', '');
if ($course_validation_feature) {
@ -361,7 +356,7 @@ if ($form->validate()) {
false
);
// Display the form.
$content = $form->return_form();
$content = $form->returnForm();
}
}
} else {
@ -371,7 +366,7 @@ if ($form->validate()) {
false
);
// Display the form.
$content = $form->return_form();
$content = $form->returnForm();
}
} else {
if (!$course_validation_feature) {

@ -54,7 +54,8 @@ class Dropbox_Work
public $upload_date;
public $last_upload_date;
public $isOldWork;
public $feedback_date, $feedback;
public $feedback_date;
public $feedback;
/**
* Constructor calls private functions to create a new work or retreive an existing work from DB
@ -126,7 +127,7 @@ class Dropbox_Work
'description' => $this->description,
'author' => $this->author,
'last_upload_date' => $this->last_upload_date,
'session_id' => api_get_session_id(),
'session_id' => api_get_session_id()
];
Database::update(
@ -220,9 +221,10 @@ class Dropbox_Work
// Getting the feedback on the work.
if ($action == 'viewfeedback' AND $this->id == $_GET['id']) {
$feedback2 = array();
$sql_feedback = "SELECT * FROM ".$dropbox_cnf['tbl_feedback']."
WHERE c_id = $course_id AND file_id='".$id."' ORDER BY feedback_id ASC";
$result = Database::query($sql_feedback);
$sql = "SELECT * FROM ".$dropbox_cnf['tbl_feedback']."
WHERE c_id = $course_id AND file_id='".$id."'
ORDER BY feedback_id ASC";
$result = Database::query($sql);
while ($row_feedback = Database::fetch_array($result)) {
$row_feedback['feedback'] = Security::remove_XSS($row_feedback['feedback']);
$feedback2[] = $row_feedback;
@ -381,7 +383,6 @@ class Dropbox_SentWork extends Dropbox_Work
WHERE c_id = $course_id AND file_id = ".intval($id)."";
$result = Database::query($sql);
while ($res = Database::fetch_array($result, 'ASSOC')) {
// Check for deleted users
$dest_user_id = $res['dest_user_id'];
$user_info = api_get_user_info($dest_user_id);
@ -571,7 +572,7 @@ class Dropbox_Person
/**
* Deletes all the received work of this person
*/
function deleteAllReceivedWork()
public function deleteAllReceivedWork()
{
$course_id = api_get_course_int_id();
$dropbox_cnf = getDropboxConf();
@ -589,7 +590,7 @@ class Dropbox_Person
* Deletes all the received categories and work of this person
* @param integer $id
*/
function deleteReceivedWorkFolder($id)
public function deleteReceivedWorkFolder($id)
{
$dropbox_cnf = getDropboxConf();
$course_id = api_get_course_int_id();
@ -612,7 +613,7 @@ class Dropbox_Person
*
* @param integer $id
*/
function deleteReceivedWork($id)
public function deleteReceivedWork($id)
{
$course_id = api_get_course_int_id();
$dropbox_cnf = getDropboxConf();
@ -642,7 +643,7 @@ class Dropbox_Person
/**
* Deletes all the sent dropbox files of this person
*/
function deleteAllSentWork()
public function deleteAllSentWork()
{
$course_id = api_get_course_int_id();
$dropbox_cnf = getDropboxConf();
@ -661,7 +662,7 @@ class Dropbox_Person
*
* @param unknown_type $id
*/
function deleteSentWork($id)
public function deleteSentWork($id)
{
$course_id = api_get_course_int_id();
$dropbox_cnf = getDropboxConf();
@ -696,7 +697,7 @@ class Dropbox_Person
* @param string $id
* @param string $text
*/
function updateFeedback($id, $text)
public function updateFeedback($id, $text)
{
$course_id = api_get_course_int_id();
$_course = api_get_course_info();
@ -760,7 +761,7 @@ class Dropbox_Person
* @param string $type
* @param string $value
*/
function filter_received_work($type, $value)
public function filter_received_work($type, $value)
{
$dropbox_cnf = getDropboxConf();
$new_received_work = array();

@ -223,7 +223,12 @@ if ($is_allowedToEdit) {
// deletes an exercise
if ($exercise_action_locked == false) {
$objExerciseTmp->delete();
$link_info = GradebookUtils::is_resource_in_course_gradebook(api_get_course_id(), 1, $exerciseId, api_get_session_id());
$link_info = GradebookUtils::isResourceInCourseGradebook(
api_get_course_id(),
1,
$exerciseId,
api_get_session_id()
);
if ($link_info !== false) {
GradebookUtils::remove_resource_from_course_gradebook($link_info['id']);
}

@ -136,7 +136,7 @@ function handle_forum_and_forumcategories($lp_id = null)
for ($i = 0; $i < count($list_threads); $i++) {
deleteForumCategoryThread('thread', $list_threads[$i]['thread_id']);
$link_info = GradebookUtils::is_resource_in_course_gradebook(
$link_info = GradebookUtils::isResourceInCourseGradebook(
api_get_course_id(),
5,
intval($list_threads[$i]['thread_id']),
@ -2366,7 +2366,7 @@ function updateThread($values)
$sessionId = api_get_session_id();
$courseId = api_get_course_id();
$linkInfo = GradebookUtils::is_resource_in_course_gradebook(
$linkInfo = GradebookUtils::isResourceInCourseGradebook(
$courseId,
LINK_FORUM_THREAD,
$id,
@ -2636,7 +2636,7 @@ function store_thread($current_forum, $values, $courseInfo = array(), $showMessa
Session::erase('breadcrumbs');
Session::erase('addedresource');
Session::erase('addedresourceid');
if ($showMessage) {
Display::addFlash(Display::return_message($message, 'success', false));
}
@ -3520,7 +3520,12 @@ function show_edit_post_form(
$form->addElement('label', '<strong>'.get_lang('AlterQualifyThread').'</strong>');
$form->addElement('checkbox', 'thread_qualify_gradebook', '', get_lang('QualifyThreadGradebook'), 'onclick="javascript: if(this.checked){document.getElementById(\'options_field\').style.display = \'block\';}else{document.getElementById(\'options_field\').style.display = \'none\';}"');
$link_info = GradebookUtils::is_resource_in_course_gradebook(api_get_course_id(), 5, $_GET['thread'], api_get_session_id());
$link_info = GradebookUtils::isResourceInCourseGradebook(
api_get_course_id(),
5,
$_GET['thread'],
api_get_session_id()
);
if (!empty($link_info)) {
$defaults['thread_qualify_gradebook'] = true;
$defaults['category_id'] = $link_info['category_id'];

@ -193,7 +193,7 @@ if (
$message = deleteForumCategoryThread($_GET['content'], $_GET['id']);
// Delete link
$link_info = GradebookUtils::is_resource_in_course_gradebook(
$link_info = GradebookUtils::isResourceInCourseGradebook(
api_get_course_id(),
5,
intval($_GET['id']),

@ -1,12 +1,13 @@
<?php
/* For licensing terms, see /license.txt */
use ChamiloSession as Session;
/**
* List all certificates filtered by session/course and month/year
* @author Angel Fernando Quiroz Campos <angel.quiroz@beeznest.com>
* @package chamilo.gradebook
*/
use ChamiloSession as Session;
$cidReset = true;

@ -57,9 +57,11 @@ $tpl = new Template(get_lang('Badges'), false, false);
$tpl->assign(
'content',
"<script>"
. "$(document).on('ready', function (){ OpenBadges.issue_no_modal(" . json_encode($assertions) . "); });"
. "</script>"
"<script>
$(document).on('ready', function (){
OpenBadges.issue_no_modal(" . json_encode($assertions) . ");
});
</script>"
);
$tpl->display_one_col_template();

@ -1,9 +1,11 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Script
* @package chamilo.gradebook
*/
// $cidReset : This is the main difference with gradebook.php, here we say,
// basically, that we are inside a course, and many things depend from that
$cidReset= true;
@ -19,7 +21,7 @@ if (!empty($_GET['course'])) {
unset($_GET['course']);
}
$htmlHeadXtra[] = '<script type="text/javascript">
$htmlHeadXtra[] = '<script>
$(document).ready( function() {
for (i=0;i<$(".actions").length;i++) {
if ($(".actions:eq("+i+")").html()=="<table border=\"0\"></table>" || $(".actions:eq("+i+")").html()=="" || $(".actions:eq("+i+")").html()==null) {
@ -30,9 +32,8 @@ $(document).ready( function() {
</script>';
api_block_anonymous_users();
$htmlHeadXtra[]= '<script type="text/javascript">
function confirmation ()
{
$htmlHeadXtra[]= '<script>
function confirmation () {
if (confirm("'.get_lang('DeleteAll').'?")) {
return true;
} else {
@ -66,9 +67,9 @@ if (isset ($_GET['createallcategories'])) {
exit;
}
//move a category
$selectcat=isset($_GET['selectcat']) ? Security::remove_XSS($_GET['selectcat']) : '';
$selectcat = isset($_GET['selectcat']) ? (int) $_GET['selectcat'] : '';
if (isset ($_GET['movecat'])) {
if (isset($_GET['movecat'])) {
$move_cat = Security::remove_XSS($_GET['movecat']);
GradebookUtils::block_students();
$cats= Category :: load($move_cat);
@ -77,10 +78,10 @@ if (isset ($_GET['movecat'])) {
$cats[0],
'move_cat_form',
null,
api_get_self() . '?movecat=' . $move_cat
. '&selectcat=' . Security::remove_XSS($_GET['selectcat']));
api_get_self() . '?movecat=' . $move_cat. '&selectcat=' . $selectcat
);
if ($move_form->validate()) {
header('Location: ' . api_get_self() . '?selectcat=' . Security::remove_XSS($_GET['selectcat'])
header('Location: ' . api_get_self() . '?selectcat=' . $selectcat
. '&movecat=' . $move_cat
. '&targetcat=' . $move_form->exportValue('move_cat'));
exit;
@ -92,7 +93,7 @@ if (isset ($_GET['movecat'])) {
if (!($course_to_crsind && !isset($_GET['confirm']))) {
$cats[0]->move_to_cat($targetcat[0]);
header('Location: ' . api_get_self() . '?categorymoved=&selectcat=' . Security::remove_XSS($_GET['selectcat']));
header('Location: ' . api_get_self() . '?categorymoved=&selectcat=' . $selectcat);
exit;
}
unset($targetcat);
@ -107,16 +108,16 @@ if (isset ($_GET['moveeval'])) {
$evals= Evaluation :: load($get_move_eval);
if (!isset ($_GET['targetcat'])) {
$move_form= new EvalForm(EvalForm :: TYPE_MOVE,
$move_form = new EvalForm(EvalForm :: TYPE_MOVE,
$evals[0],
null,
'move_eval_form',
null,
api_get_self() . '?moveeval=' . $get_move_eval
. '&selectcat=' . Security::remove_XSS($_GET['selectcat']));
api_get_self() . '?moveeval=' . $get_move_eval. '&selectcat=' . $selectcat
);
if ($move_form->validate()) {
header('Location: ' .api_get_self() . '?selectcat=' . Security::remove_XSS($_GET['selectcat'])
header('Location: ' .api_get_self() . '?selectcat=' . $selectcat
. '&moveeval=' . $get_move_eval
. '&targetcat=' . $move_form->exportValue('move_cat'));
exit;
@ -128,7 +129,7 @@ if (isset ($_GET['moveeval'])) {
if (!($course_to_crsind && !isset($_GET['confirm']))) {
$evals[0]->move_to_cat($targetcat[0]);
header('Location: ' . api_get_self() . '?evaluationmoved=&selectcat=' . Security::remove_XSS($_GET['selectcat']));
header('Location: ' . api_get_self() . '?evaluationmoved=&selectcat=' . $selectcat);
exit;
}
unset ($targetcat);
@ -147,13 +148,13 @@ if (isset ($_GET['movelink'])) {
$link[0],
'move_link_form',
null,
api_get_self().'?movelink='.$get_move_link.'&selectcat='.Security::remove_XSS($_GET['selectcat'])
api_get_self().'?movelink='.$get_move_link.'&selectcat='.$selectcat
);
if ($move_form->validate()) {
$targetcat= Category :: load($move_form->exportValue('move_cat'));
$link[0]->move_to_cat($targetcat[0]);
unset ($link);
header('Location: ' . api_get_self(). '?linkmoved=&selectcat=' . Security::remove_XSS($_GET['selectcat']));
header('Location: ' . api_get_self(). '?linkmoved=&selectcat=' . $selectcat);
exit;
}
}
@ -262,12 +263,10 @@ if ($course_to_crsind && !isset($_GET['confirm'])) {
die ('Error: movecat or moveeval not defined');
}
$button = '<form name="confirm"
method="post"
action="'.api_get_self() .'?confirm='
method="post"
action="'.api_get_self() .'?confirm='
.(isset($_GET['movecat']) ? '&movecat=' . Security::remove_XSS($_GET['movecat'])
: '&moveeval=' . Security::remove_XSS($_GET['moveeval']) )
.'&selectcat=' . Security::remove_XSS($_GET['selectcat'])
.'&targetcat=' . Security::remove_XSS($_GET['targetcat']).'">
: '&moveeval=' . Security::remove_XSS($_GET['moveeval']) ).'&selectcat=' . $selectcat.'&targetcat=' . Security::remove_XSS($_GET['targetcat']).'">
<input type="submit" value="'.' '.get_lang('Ok').' '.'">
</form>';
@ -366,7 +365,7 @@ if (isset ($_POST['action'])) {
}
if (isset ($_POST['submit']) && isset ($_POST['keyword'])) {
header('Location: ' . api_get_self() . '?selectcat=' . Security::remove_XSS($_GET['selectcat'])
header('Location: ' . api_get_self() . '?selectcat=' . $selectcat
. '&search='.Security::remove_XSS($_POST['keyword']));
exit;
}
@ -375,7 +374,7 @@ if (isset ($_POST['submit']) && isset ($_POST['keyword'])) {
if (!isset($_GET['exportpdf']) && !isset($_GET['export_certificate'])) {
if (isset ($_GET['studentoverview'])) {
$interbreadcrumb[]= array (
'url' => $_SESSION['gradebook_dest'].'?selectcat=' . Security::remove_XSS($_GET['selectcat'].'&'.api_get_cidreq()),
'url' => $_SESSION['gradebook_dest'].'?selectcat=' . $selectcat.'&'.api_get_cidreq(),
'name' => get_lang('ToolGradebook')
);
Display :: display_header(get_lang('FlatView'));
@ -390,7 +389,7 @@ if (!isset($_GET['exportpdf']) && !isset($_GET['export_certificate'])) {
if ((isset($_GET['selectcat']) && $_GET['selectcat']>0)) {
if (!empty($_GET['course'])) {
$interbreadcrumb[]= array ('url' => $gradebook_dest.'selectcat='.Security::remove_XSS($_GET['selectcat']),'name' => get_lang('Details'));
$interbreadcrumb[]= array ('url' => $gradebook_dest.'selectcat='.$selectcat,'name' => get_lang('Details'));
} else {
$interbreadcrumb[]= array ('url' => $_SESSION['gradebook_dest'].'?selectcat=0','name' => get_lang('Details'));
}
@ -448,10 +447,10 @@ $is_platform_admin= api_is_platform_admin();
$is_course_admin= api_is_allowed_to_edit();
//load data for category, evaluation and links
if (!isset ($_GET['selectcat']) || empty ($_GET['selectcat'])) {
$category= 0;
if (empty($selectcat)) {
$category = 0;
} else {
$category= Security::remove_XSS($_GET['selectcat']);
$category = $selectcat;
}
// search form
@ -580,7 +579,7 @@ if (!empty($keyword)) {
$alleval= $cats[0]->get_evaluations($stud_id);
$alllink= $cats[0]->get_links($stud_id);
}
$addparams = array ('selectcat' => $cats[0]->get_id());
$addparams = array('selectcat' => $cats[0]->get_id());
if (isset($_GET['search'])) {
$addparams['search'] = $keyword;
}
@ -599,8 +598,16 @@ $gradebooktable = new GradebookTable(
$alllink,
$addparams
);
if (((empty ($allcat)) && (empty ($alleval)) && (empty ($alllink)) && (!$is_platform_admin) && ($is_course_admin) && (!isset ($_GET['selectcat']))) && api_is_course_tutor()) {
Display :: display_normal_message(get_lang('GradebookWelcomeMessage') . '<br /><br /><form name="createcat" method="post" action="' . api_get_self() . '?createallcategories=1"><input type="submit" value="' . get_lang('CreateAllCat') . '"></form>',false);
if (((empty($allcat)) && (empty ($alleval)) && (empty ($alllink)) && (!$is_platform_admin) && ($is_course_admin) && (!isset($_GET['selectcat']))) &&
api_is_course_tutor()
) {
Display :: display_normal_message(
get_lang('GradebookWelcomeMessage') .
'<br /><br />
<form name="createcat" method="post" action="' . api_get_self() . '?createallcategories=1">
<input type="submit" value="' . get_lang('CreateAllCat') . '"></form>',
false
);
}
// Here we are in a sub category
if ($category != '0') {
@ -616,7 +623,7 @@ if ($category != '0') {
// This is the root category
DisplayGradebook:: header(
$cats[0],
(((count($allcat) == '0') && (!isset ($_GET['search']))) ? 0 : 1),
count($allcat) == '0' && !isset($_GET['search']) ? 0 : 1,
0,
$is_course_admin,
$is_platform_admin,

@ -13,9 +13,11 @@ api_protect_course_script(true);
api_block_anonymous_users();
GradebookUtils::block_students();
$selectEval = isset($_GET['selecteval']) ? (int) $_GET['selecteval'] : 0;
$resultadd = new Result();
$resultadd->set_evaluation_id($_GET['selecteval']);
$evaluation = Evaluation :: load($_GET['selecteval']);
$resultadd->set_evaluation_id($selectEval);
$evaluation = Evaluation :: load($selectEval);
$category = !empty($_GET['selectcat']) ? $_GET['selectcat'] : "";
$add_result_form = new EvalForm(
EvalForm :: TYPE_RESULT_ADD,
@ -23,14 +25,14 @@ $add_result_form = new EvalForm(
$resultadd,
'add_result_form',
null,
api_get_self() . '?selectcat=' . Security::remove_XSS($category) . '&selecteval=' . Security::remove_XSS($_GET['selecteval']).'&'.api_get_cidreq()
api_get_self() . '?selectcat=' . Security::remove_XSS($category) . '&selecteval=' . $selectEval.'&'.api_get_cidreq()
);
$table = $add_result_form->toHtml();
if ($add_result_form->validate()) {
$values = $add_result_form->exportValues();
$nr_users = $values['nr_users'];
if ($nr_users == '0') {
header('Location: gradebook_view_result.php?addresultnostudents=&selecteval=' . Security::remove_XSS($_GET['selecteval']).'&'.api_get_cidreq());
header('Location: gradebook_view_result.php?addresultnostudents=&selecteval=' . $selectEval.'&'.api_get_cidreq());
exit;
}
$scores = ($values['score']);
@ -43,7 +45,7 @@ if ($add_result_form->validate()) {
$res->add();
next($scores);
}
header('Location: gradebook_view_result.php?addresult=&selecteval=' . Security::remove_XSS($_GET['selecteval']).'&'.api_get_cidreq());
header('Location: gradebook_view_result.php?addresult=&selecteval=' . $selectEval.'&'.api_get_cidreq());
exit;
}
$interbreadcrumb[] = array(
@ -51,6 +53,6 @@ $interbreadcrumb[] = array(
'name' => get_lang('Gradebook')
);
Display :: display_header(get_lang('AddResult'));
DisplayGradebook :: display_header_result ($evaluation[0], null, 0,0);
DisplayGradebook::display_header_result($evaluation[0], null, 0, 0);
echo $table;
Display :: display_footer();

@ -21,40 +21,48 @@ if (count($newstudents) == '0') {
header('Location: gradebook_view_result.php?nouser=&selecteval=' . Security::remove_XSS($_GET['selecteval']).'&'.api_get_cidreq());
exit;
}
$add_user_form= new EvalForm(EvalForm :: TYPE_ADD_USERS_TO_EVAL,
$evaluation[0],
null,
'add_users_to_evaluation',
null,
api_get_self() . '?selecteval=' . Security::remove_XSS($_GET['selecteval']),
Security::remove_XSS($_GET['firstletter']),
$newstudents);
$add_user_form = new EvalForm(
EvalForm :: TYPE_ADD_USERS_TO_EVAL,
$evaluation[0],
null,
'add_users_to_evaluation',
null,
api_get_self().'?selecteval='.Security::remove_XSS($_GET['selecteval']),
Security::remove_XSS($_GET['firstletter']),
$newstudents
);
if ( isset($_POST['submit_button']) ) {
$users= is_array($_POST['add_users']) ? $_POST['add_users'] : array ();
foreach ($users as $key => $value){
$users[$key]= intval($value);
}
if (isset($_POST['submit_button'])) {
$users = is_array($_POST['add_users']) ? $_POST['add_users'] : array();
foreach ($users as $key => $value) {
$users[$key] = intval($value);
}
if (count($users) == 0) {
header('Location: ' . api_get_self() . '?erroroneuser=&selecteval=' .Security::remove_XSS($_GET['selecteval']));
exit;
} else {
foreach ($users as $user_id) {
$result= new Result();
$result->set_user_id($user_id);
$result->set_evaluation_id($_GET['selecteval']);
$result->add();
}
}
header('Location: gradebook_view_result.php?adduser=&selecteval=' .Security::remove_XSS($_GET['selecteval']).'&'.api_get_cidreq());
exit;
} elseif ($_POST['firstLetterUser']) {
$firstletter= $_POST['firstLetterUser'];
if (!empty ($firstletter)) {
header('Location: ' . api_get_self() . '?firstletter=' . Security::remove_XSS($firstletter) . '&selecteval=' . Security::remove_XSS($_GET['selecteval']));
exit;
}
if (count($users) == 0) {
header('Location: '.api_get_self().'?erroroneuser=&selecteval='.Security::remove_XSS($_GET['selecteval']));
exit;
} else {
foreach ($users as $user_id) {
$result = new Result();
$result->set_user_id($user_id);
$result->set_evaluation_id($_GET['selecteval']);
$result->add();
}
}
header(
'Location: gradebook_view_result.php?adduser=&selecteval='.Security::remove_XSS($_GET['selecteval']).'&'.api_get_cidreq()
);
exit;
} elseif ($_POST['firstLetterUser']) {
$firstletter = $_POST['firstLetterUser'];
if (!empty ($firstletter)) {
header(
'Location: '.api_get_self().'?firstletter='.Security::remove_XSS(
$firstletter
).'&selecteval='.Security::remove_XSS($_GET['selecteval'])
);
exit;
}
}
$interbreadcrumb[]= array ('url' => Security::remove_XSS($_SESSION['gradebook_dest']),'name' => get_lang('Gradebook'));

@ -370,7 +370,7 @@ class GradebookUtils
$modify_icons .= '&nbsp;<a href="' . api_get_self() . '?deletelink=' . $link->get_id() . '&selectcat=' . $selectcat . ' &' . $courseParams. '" onclick="return confirmation();">' .
Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL) . '</a>';
}
return $modify_icons;
}
}
@ -384,7 +384,7 @@ class GradebookUtils
*
* @return array false on error or array of resource
*/
public static function is_resource_in_course_gradebook($course_code, $resource_type, $resource_id, $session_id = 0)
public static function isResourceInCourseGradebook($course_code, $resource_type, $resource_id, $session_id = 0)
{
$table = Database::get_main_table(TABLE_MAIN_GRADEBOOK_LINK);
$course_code = Database::escape_string($course_code);
@ -399,7 +399,7 @@ class GradebookUtils
return false;
}
$row = Database::fetch_array($res, 'ASSOC');
return $row;
}

@ -1,12 +1,11 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Search user certificates if them are publics
* @author Angel Fernando Quiroz Campos <angel.quiroz@beeznest.com>
* @package chamilo.gradebook
*/
use \ChamiloSession as Session;
$cidReset = true;

@ -170,7 +170,7 @@ if (api_is_allowed_to_edit(false, true)) {
$actionsLeft .= '<a href="group_creation.php?'.api_get_cidreq().'">'.
Display::return_icon('add-groups.png', get_lang('NewGroupCreate'), '', ICON_SIZE_MEDIUM).'</a>';
if (api_get_setting('allow_group_categories') == 'true') {
if (api_get_setting('allow_group_categories') === 'true') {
$actionsLeft .= '<a href="group_category.php?'.api_get_cidreq().'&action=add_category">'.
Display::return_icon('new_folder.png', get_lang('AddCategory'), '', ICON_SIZE_MEDIUM).'</a>';
} else {
@ -204,7 +204,7 @@ echo $toolbar;
echo UserManager::getUserSubscriptionTab(3);
/* List all categories */
if (api_get_setting('allow_group_categories') == 'true') {
if (api_get_setting('allow_group_categories') === 'true') {
$defaultCategory = [
'id' => 0,
'iid' => 0,

@ -48,7 +48,7 @@ function check_groups_per_user($value)
return true;
}
if (api_get_setting('allow_group_categories') == 'true') {
if (api_get_setting('allow_group_categories') === 'true') {
if (isset($_GET['id'])) {
$category = GroupManager::get_category($_GET['id']);
$nameTools = get_lang('EditGroupCategory').': '.$category['title'];

@ -160,7 +160,7 @@ EOT;
$group_el = array();
$group_el[] = $form->createElement('static', null, null, '<b>'.get_lang('GroupName').'</b>');
if (api_get_setting('allow_group_categories') == 'true') {
if (api_get_setting('allow_group_categories') === 'true') {
$group_el[] = $form->createElement('static', null, null, '<b>'.get_lang('GroupCategory').'</b>');
}
$group_el[] = $form->createElement('static', null, null, '<b>'.get_lang('GroupPlacesThis').'</b>');
@ -169,17 +169,29 @@ EOT;
if ($_POST['number_of_groups'] > 1) {
$group_el = array ();
$group_el[] = $form->createElement('static', null, null, ' ');
if (api_get_setting('allow_group_categories') == 'true') {
$group_el[] = $form->createElement('checkbox', 'same_category', null, get_lang('SameForAll'), array('onclick' => "javascript: switch_state('category');"));
if (api_get_setting('allow_group_categories') === 'true') {
$group_el[] = $form->createElement(
'checkbox',
'same_category',
null,
get_lang('SameForAll'),
array('onclick' => "javascript: switch_state('category');")
);
}
$group_el[] = $form->createElement('checkbox', 'same_places', null, get_lang('SameForAll'), array ('onclick' => "javascript: switch_state('places');"));
$group_el[] = $form->createElement(
'checkbox',
'same_places',
null,
get_lang('SameForAll'),
array('onclick' => "javascript: switch_state('places');")
);
$form->addGroup($group_el, 'groups', null, '</td><td>', false);
}
// Properties for all groups
for ($group_number = 0; $group_number < $_POST['number_of_groups']; $group_number ++) {
$group_el = array();
$group_el[] = $form->createElement('text', 'group_'.$group_number.'_name');
if (api_get_setting('allow_group_categories') == 'true') {
if (api_get_setting('allow_group_categories') === 'true') {
$group_el[] = $form->createElement(
'select',
'group_'.$group_number.'_category',
@ -220,7 +232,6 @@ EOT;
/*
* Show form to generate new groups
*/
$create_groups_form = new FormValidator('create_groups', 'post', api_get_self().'?'.api_get_cidreq());
$create_groups_form->addElement('header', $nameTools);
$create_groups_form->addText('number_of_groups',get_lang('NumberOfGroupsToCreate'),null,array('value'=>'1'));
@ -233,7 +244,7 @@ EOT;
/*
* Show form to generate subgroups
*/
if (api_get_setting('allow_group_categories') == 'true' && count(GroupManager :: get_group_list()) > 0) {
if (api_get_setting('allow_group_categories') === 'true' && count(GroupManager :: get_group_list()) > 0) {
$base_group_options = array ();
$groups = GroupManager :: get_group_list();
foreach ($groups as $index => $group) {
@ -283,7 +294,7 @@ EOT;
$create_class_groups_form = new FormValidator('create_class_groups_form', 'post', api_get_self().'?'.api_get_cidreq());
$create_class_groups_form->addElement('hidden', 'action');
if (api_get_setting('allow_group_categories') == 'true') {
if (api_get_setting('allow_group_categories') === 'true') {
$group_categories = GroupManager :: get_categories();
$cat_options = array();
foreach ($group_categories as $index => $category) {

@ -11,7 +11,7 @@
* @todo course admin functionality to create groups based on who is in which course (or class).
*/
require '../inc/global.inc.php';
require_once '../inc/global.inc.php';
$this_section = SECTION_COURSES;
$current_course_tool = TOOL_GROUP;
@ -148,7 +148,13 @@ foreach ($group_tutor_list as $index => $user) {
$selected_tutors[] = $user['user_id'];
}
$group_tutors_element = $form->addElement('advmultiselect', 'group_tutors', get_lang('GroupTutors'), $possible_users, 'style="width: 280px;"');
$group_tutors_element = $form->addElement(
'advmultiselect',
'group_tutors',
get_lang('GroupTutors'),
$possible_users,
'style="width: 280px;"'
);
// Group members
$group_member_list = GroupManager :: get_subscribed_users($current_group['id']);
@ -170,7 +176,13 @@ $group_members_element = $form->addElement('advmultiselect', 'group_members', ge
$form->addFormRule('check_group_members');
// Members per group
$form->addElement('radio', 'max_member_no_limit', get_lang('GroupLimit'), get_lang('NoLimit'), GroupManager::MEMBER_PER_GROUP_NO_LIMIT);
$form->addElement(
'radio',
'max_member_no_limit',
get_lang('GroupLimit'),
get_lang('NoLimit'),
GroupManager::MEMBER_PER_GROUP_NO_LIMIT
);
$group = array();
$group[] = $form->createElement('radio', 'max_member_no_limit', null, get_lang('MaximumOfParticipants'), 1, array('id' => 'max_member_selected'));
$group[] = $form->createElement('text', 'max_member', null, array('class' => 'span1', 'id' => 'max_member'));
@ -279,7 +291,10 @@ if ($form->validate()) {
// Returning to the group area (note: this is inconsistent with the rest of chamilo)
$cat = GroupManager :: get_category_from_group($current_group['id']);
if (isset($_POST['group_members']) && count($_POST['group_members']) > $max_member && $max_member != GroupManager::MEMBER_PER_GROUP_NO_LIMIT) {
if (isset($_POST['group_members']) &&
count($_POST['group_members']) > $max_member &&
$max_member != GroupManager::MEMBER_PER_GROUP_NO_LIMIT
) {
Display::addFlash(Display::return_message(get_lang('GroupTooMuchMembers'), 'warning'));
header('Location: group.php?'.api_get_cidreq(true, false));
} else {

@ -150,8 +150,8 @@ if (api_is_allowed_to_edit(false, true) ||
'content' => Display::return_icon('folder.png', get_lang('GroupDocument'), array(), 32)
);
}
if ($current_group['calendar_state'] != GroupManager::TOOL_NOT_AVAILABLE) {
if ($current_group['calendar_state'] != GroupManager::TOOL_NOT_AVAILABLE) {
$groupFilter = null;
if (!empty($group_id)) {
$groupFilter = "&type=course&user_id=GROUP:$group_id";
@ -162,6 +162,7 @@ if (api_is_allowed_to_edit(false, true) ||
'content' => Display::return_icon('agenda.png', get_lang('GroupCalendar'), array(), 32)
);
}
if ($current_group['work_state'] != GroupManager::TOOL_NOT_AVAILABLE) {
// Link to the works area of this group
$actions_array[] = array(
@ -214,7 +215,7 @@ if (api_is_allowed_to_edit(false, true) ||
);
}
}
if (!empty($actions_array)) {
echo Display::actions($actions_array);
}
@ -252,7 +253,6 @@ if (api_is_allowed_to_edit(false, true) ||
'url' => api_get_path(WEB_CODE_PATH).'calendar/agenda.php?'.api_get_cidreq(),
'content' => Display::return_icon('agenda.png', get_lang('GroupCalendar'), array(), ICON_SIZE_MEDIUM)
);
}
if ($current_group['work_state'] == GroupManager::TOOL_PUBLIC) {
@ -389,8 +389,10 @@ function get_number_of_group_users()
// Query
$sql = "SELECT count(iid) AS number_of_users
FROM ".$table."
WHERE c_id = $course_id AND group_id='".intval($current_group['id'])."'";
FROM $table
WHERE
c_id = $course_id AND
group_id='".intval($current_group['id'])."'";
$result = Database::query($sql);
$return = Database::fetch_array($result, 'ASSOC');
@ -414,8 +416,8 @@ function get_group_user_data($from, $number_of_items, $column, $direction)
global $current_group;
// Database table definition
$table_group_user = Database :: get_course_table(TABLE_GROUP_USER);
$table_user = Database :: get_main_table(TABLE_MAIN_USER);
$table_group_user = Database:: get_course_table(TABLE_GROUP_USER);
$table_user = Database:: get_main_table(TABLE_MAIN_USER);
$course_id = api_get_course_int_id();
@ -430,11 +432,14 @@ function get_group_user_data($from, $number_of_items, $column, $direction)
user.firstname AS col2,"
)."
user.email AS col3
FROM ".$table_user." user, ".$table_group_user." group_rel_user
WHERE group_rel_user.c_id = $course_id AND group_rel_user.user_id = user.id
AND group_rel_user.group_id = '".Database::escape_string($current_group['id'])."'";
$sql .= " ORDER BY col$column $direction ";
$sql .= " LIMIT $from,$number_of_items";
FROM $table_user user,
$table_group_user group_rel_user
WHERE
group_rel_user.c_id = $course_id AND
group_rel_user.user_id = user.id AND
group_rel_user.group_id = '".Database::escape_string($current_group['id'])."'
ORDER BY col$column $direction
LIMIT $from, $number_of_items";
} else {
if (api_is_allowed_to_edit()) {
$sql = "SELECT DISTINCT
@ -447,10 +452,12 @@ function get_group_user_data($from, $number_of_items, $column, $direction)
u.firstname AS col2,"
)."
u.email AS col3
FROM ".$table_user." u INNER JOIN ".$table_group_user." gu ON (gu.user_id = u.id) AND gu.c_id = $course_id
WHERE gu.group_id = '".Database::escape_string($current_group['id'])."'";
$sql .= " ORDER BY col$column $direction ";
$sql .= " LIMIT $from,$number_of_items";
FROM $table_user u
INNER JOIN $table_group_user gu
ON (gu.user_id = u.id) AND gu.c_id = $course_id
WHERE gu.group_id = '".Database::escape_string($current_group['id'])."'
ORDER BY col$column $direction
LIMIT $from, $number_of_items";
} else {
$sql = "SELECT DISTINCT
user.id AS col0,
@ -461,11 +468,13 @@ function get_group_user_data($from, $number_of_items, $column, $direction)
"user.lastname AS col1,
user.firstname AS col2 "
)."
FROM ".$table_user." user, ".$table_group_user." group_rel_user
WHERE group_rel_user.c_id = $course_id AND group_rel_user.user_id = user.id
AND group_rel_user.group_id = '".Database::escape_string($current_group['id'])."'";
$sql .= " ORDER BY col$column $direction ";
$sql .= " LIMIT $from,$number_of_items";
FROM $table_user user, $table_group_user group_rel_user
WHERE
group_rel_user.c_id = $course_id AND
group_rel_user.user_id = user.id AND
group_rel_user.group_id = '".Database::escape_string($current_group['id'])."'
ORDER BY col$column $direction
LIMIT $from,$number_of_items";
}
}
@ -499,7 +508,7 @@ function email_filter($email)
function user_icon_filter($user_id)
{
$userInfo = api_get_user_info($user_id);
$photo = '<img src="'.$userInfo['avatar'].'" alt="'.$userInfo['complete_name'].'" width="22" height="22" title="'.$userInfo['complete_name'].'" />';
$photo = '<img src="'.$userInfo['avatar'].'" alt="'.$userInfo['complete_name'].'" width="22" height="22" title="'.$userInfo['complete_name'].'" />';
return Display::url($photo, $userInfo['profile_url']);
}

@ -325,7 +325,7 @@ class Attendance
// add link to gradebook
if ($link_to_gradebook && !empty($this->category_id)) {
$description = '';
$link_info = GradebookUtils::is_resource_in_course_gradebook(
$link_info = GradebookUtils::isResourceInCourseGradebook(
$course_code,
7,
$last_id,
@ -398,7 +398,7 @@ class Attendance
// add link to gradebook
if ($link_to_gradebook && !empty($this->category_id)) {
$description = '';
$link_info = GradebookUtils::is_resource_in_course_gradebook(
$link_info = GradebookUtils::isResourceInCourseGradebook(
$course_code,
7,
$attendance_id,

@ -311,7 +311,8 @@ class learnpath
error_log(
'New LP - learnpath::__construct() ' . __LINE__ .
' - object with id ' . $my_item_id . ' set in items[]',
0);
0
);
}
}
break;
@ -1130,7 +1131,12 @@ class learnpath
api_get_user_id()
);
$link_info = GradebookUtils::is_resource_in_course_gradebook(api_get_course_id(), 4 , $id, api_get_session_id());
$link_info = GradebookUtils::isResourceInCourseGradebook(
api_get_course_id(),
4,
$id,
api_get_session_id()
);
if ($link_info !== false) {
GradebookUtils::remove_resource_from_course_gradebook($link_info['id']);
}

@ -100,7 +100,10 @@ if (isset($_GET['form_reply']) || isset($_GET['form_delete'])) {
if (isset($_GET['f']) && $_GET['f'] == 'social') {
$this_section = SECTION_SOCIAL;
$interbreadcrumb[] = array('url' => api_get_path(WEB_PATH).'main/social/home.php', 'name' => get_lang('SocialNetwork'));
$interbreadcrumb[] = array(
'url' => api_get_path(WEB_PATH).'main/social/home.php',
'name' => get_lang('SocialNetwork')
);
$interbreadcrumb[] = array('url' => '#', 'name' => get_lang('Inbox'));
} else {
$this_section = SECTION_MYPROFILE;
@ -109,14 +112,14 @@ if (isset($_GET['f']) && $_GET['f'] == 'social') {
$social_parameter = '';
if ((isset($_GET['f']) && $_GET['f'] == 'social') ||
api_get_setting('allow_social_tool') == 'true'
if ((isset($_GET['f']) && $_GET['f'] === 'social') ||
api_get_setting('allow_social_tool') === 'true'
) {
$social_parameter = '?f=social';
} else {
$actions = null;
//Comes from normal profile
if (api_get_setting('allow_social_tool') == 'true' && api_get_setting('allow_message_tool') == 'true') {
if (api_get_setting('allow_social_tool') === 'true' && api_get_setting('allow_message_tool') === 'true') {
$actions .= '<a href="'.api_get_path(WEB_PATH).'main/social/profile.php">'.
Display::return_icon('shared_profile.png', get_lang('ViewSharedProfile')).'</a>';
}
@ -132,7 +135,7 @@ if ((isset($_GET['f']) && $_GET['f'] == 'social') ||
}
//LEFT CONTENT
if (api_get_setting('allow_social_tool') == 'true') {
if (api_get_setting('allow_social_tool') === 'true') {
//Block Social Menu
$social_menu_block = SocialManager::show_social_menu('messages');
}
@ -140,7 +143,7 @@ if (api_get_setting('allow_social_tool') == 'true') {
//Right content
$social_right_content = null;
$keyword = '';
if (api_get_setting('allow_social_tool') == 'true') {
if (api_get_setting('allow_social_tool') === 'true') {
$actionsLeft = '<a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php?f=social">'.
Display::return_icon('new-message.png', get_lang('ComposeMessage'), array(), 32).'</a>';
$actionsLeft .= '<a href="'.api_get_path(WEB_PATH).'main/messages/outbox.php?f=social">'.

@ -107,7 +107,13 @@ function manage_form($default, $select_from_user_list = null, $sent_to = null)
$message_id = isset($_GET['message_id']) ? intval($_GET['message_id']) : null;
$param_f = isset($_GET['f']) && $_GET['f'] == 'social' ? 'social' : null;
$form = new FormValidator('compose_message', null, api_get_self().'?f='.$param_f, null, array('enctype'=>'multipart/form-data'));
$form = new FormValidator(
'compose_message',
null,
api_get_self().'?f='.$param_f,
null,
array('enctype' => 'multipart/form-data')
);
if (empty($group_id)) {
if (isset($select_from_user_list)) {
$form->addText(
@ -140,7 +146,7 @@ function manage_form($default, $select_from_user_list = null, $sent_to = null)
]
);
} else {
$form->addElement('hidden','hidden_user',$default['users'][0],array('id'=>'hidden_user'));
$form->addElement('hidden', 'hidden_user', $default['users'][0], array('id' => 'hidden_user'));
}
}
} else {
@ -148,8 +154,8 @@ function manage_form($default, $select_from_user_list = null, $sent_to = null)
$group_info = $userGroup->get($group_id);
$form->addElement('label', get_lang('ToGroup'), api_xml_http_response_encode($group_info['name']));
$form->addElement('hidden','group_id',$group_id);
$form->addElement('hidden','parent_id',$message_id);
$form->addElement('hidden', 'group_id', $group_id);
$form->addElement('hidden', 'parent_id', $message_id);
}
$form->addText('title', get_lang('Subject'), true);
@ -272,11 +278,11 @@ if ($group_id != 0) {
if ($socialToolIsActive) {
} else {
$social_right_content .= '<div class=actions>';
if (api_get_setting('allow_social_tool') == 'true' && api_get_setting('allow_message_tool') == 'true') {
if (api_get_setting('allow_social_tool') === 'true' && api_get_setting('allow_message_tool') === 'true') {
$social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/social/profile.php">'.
Display::return_icon('shared_profile.png', get_lang('ViewSharedProfile')).'</a>';
}
if (api_get_setting('allow_message_tool') == 'true') {
if (api_get_setting('allow_message_tool') === 'true') {
$social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php">'.
Display::return_icon('message_new.png',get_lang('ComposeMessage')).'</a>';
$social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php">'.
@ -348,7 +354,7 @@ if (!isset($_POST['compose'])) {
}
}
}
if (api_get_setting('allow_social_tool') == 'true') {
if (api_get_setting('allow_social_tool') === 'true') {
$social_right_content .= '</div>';
$social_right_content .= '</div>';
}
@ -357,7 +363,7 @@ $tpl = new Template(get_lang('ComposeMessage'));
// Block Social Avatar
SocialManager::setSocialUserBlock($tpl, $user_id, 'messages');
if (api_get_setting('allow_social_tool') == 'true') {
if (api_get_setting('allow_social_tool') === 'true') {
$tpl->assign('social_menu_block', $social_menu_block);
$tpl->assign('social_right_content', $social_right_content);
$social_layout = $tpl->get_template('social/inbox.tpl');

@ -21,39 +21,35 @@ if (isset($_GET['messages_page_nr'])) {
}
}
if (api_get_setting('allow_message_tool')!='true'){
if (api_get_setting('allow_message_tool') != 'true') {
api_not_allowed();
}
//jquery thickbox already called from main/inc/header.inc.php
$htmlHeadXtra[]='<script language="javascript">
$htmlHeadXtra[] = '<script>
function enviar(miforma) {
if(confirm("'.get_lang('SureYouWantToDeleteSelectedMessages', '').'"))
miforma.submit();
}
function select_all(formita)
{
function select_all(formita) {
for (i=0;i<formita.elements.length;i++)
{
if(formita.elements[i].type == "checkbox")
formita.elements[i].checked=1
}
}
function deselect_all(formita)
{
for (i=0;i<formita.elements.length;i++)
{
if(formita.elements[i].type == "checkbox")
formita.elements[i].checked=0
function deselect_all(formita) {
for (i=0;i<formita.elements.length;i++) {
if(formita.elements[i].type == "checkbox")
formita.elements[i].checked=0
}
}
//-->
</script>';
/*
MAIN CODE
*/
if (isset($_GET['f']) && $_GET['f']=='social') {
if (isset($_GET['f']) && $_GET['f'] === 'social') {
$this_section = SECTION_SOCIAL;
$interbreadcrumb[]= array ('url' => api_get_path(WEB_PATH).'main/social/home.php','name' => get_lang('Social'));
$interbreadcrumb[]= array ('url' => '#','name' => get_lang('Outbox'));
@ -66,13 +62,17 @@ if (isset($_GET['f']) && $_GET['f']=='social') {
$actions = '';
if (api_get_setting('extended_profile') == 'true') {
if (api_get_setting('allow_social_tool') == 'true' && api_get_setting('allow_message_tool') == 'true') {
$actions .= '<a href="'.api_get_path(WEB_PATH).'main/social/profile.php">'.Display::return_icon('shared_profile.png', get_lang('ViewSharedProfile')).'</a>';
$actions .= '<a href="'.api_get_path(WEB_PATH).'main/social/profile.php">'.
Display::return_icon('shared_profile.png', get_lang('ViewSharedProfile')).'</a>';
}
if (api_get_setting('allow_message_tool') == 'true') {
//echo '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php">'.Display::return_icon('inbox.png').' '.get_lang('Messages').'</a>';
$actions .= '<a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php">'.Display::return_icon('message_new.png',get_lang('ComposeMessage')).'</a>';
$actions .= '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php">'.Display::return_icon('inbox.png',get_lang('Inbox')).'</a>';
$actions .= '<a href="'.api_get_path(WEB_PATH).'main/messages/outbox.php">'.Display::return_icon('outbox.png',get_lang('Outbox')).'</a>';
$actions .= '<a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php">'.
Display::return_icon('message_new.png',get_lang('ComposeMessage')).'</a>';
$actions .= '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php">'.
Display::return_icon('inbox.png',get_lang('Inbox')).'</a>';
$actions .= '<a href="'.api_get_path(WEB_PATH).'main/messages/outbox.php">'.
Display::return_icon('outbox.png',get_lang('Outbox')).'</a>';
}
}
@ -81,7 +81,7 @@ $info_delete_outbox =array();
$info_delete_outbox = isset($_GET['form_delete_outbox']) ? explode(',',$_GET['form_delete_outbox']) : '';
$count_delete_outbox = count($info_delete_outbox) - 1;
if (isset($info_delete_outbox[0]) && trim($info_delete_outbox[0])=='delete') {
if (isset($info_delete_outbox[0]) && trim($info_delete_outbox[0]) == 'delete') {
for ($i = 1; $i <= $count_delete_outbox; $i++) {
MessageManager::delete_message_by_user_sender(api_get_user_id(),$info_delete_outbox[$i]);
}

@ -27,11 +27,11 @@ if (isset($_GET['f']) && $_GET['f']=='social') {
if (api_get_setting('extended_profile') == 'true') {
$social_right_content .= '<div class="actions">';
if (api_get_setting('allow_social_tool') == 'true' && api_get_setting('allow_message_tool') == 'true') {
if (api_get_setting('allow_social_tool') === 'true' && api_get_setting('allow_message_tool') === 'true') {
$social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/social/profile.php">'.
Display::return_icon('shared_profile.png', get_lang('ViewSharedProfile')).'</a>';
}
if (api_get_setting('allow_message_tool') == 'true') {
if (api_get_setting('allow_message_tool') === 'true') {
$social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php">'.
Display::return_icon('message_new.png',get_lang('ComposeMessage')).'</a>';
$social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php">'.
@ -56,7 +56,7 @@ if (empty($_GET['id'])) {
$message = '';
// LEFT COLUMN
if (api_get_setting('allow_social_tool') == 'true') {
if (api_get_setting('allow_social_tool') === 'true') {
// Block Social Menu
$social_menu_block = SocialManager::show_social_menu($show_menu);
}
@ -72,7 +72,7 @@ $tpl = new Template(get_lang('View'));
// Block Social Avatar
SocialManager::setSocialUserBlock($tpl, $user_id, $show_menu);
if (api_get_setting('allow_social_tool') == 'true') {
if (api_get_setting('allow_social_tool') === 'true') {
$tpl->assign('social_menu_block', $social_menu_block);
$tpl->assign('social_right_content', $social_right_content);
$social_layout = $tpl->get_template('social/inbox.tpl');

@ -2,7 +2,6 @@
/* For licensing terms, see /license.txt */
// including necessary libraries
$language_file = array('admin', 'registration');
$cidReset = true;
require_once '../inc/global.inc.php';
@ -181,7 +180,7 @@ if ($form->validate()) {
api_get_setting('administratorTelephone')."\n" .
get_lang('Email') ." : ".api_get_setting('emailAdministrator');
$emailbody = nl2br($emailbody);
api_mail_html(
api_get_person_name($userInfo['firstname'], $userInfo['lastname'], null, PERSON_NAME_EMAIL_ADDRESS),
$email,

@ -7,7 +7,6 @@
* refactoring and tighter integration
*/
// Including the global initialization file
require_once '../inc/global.inc.php';
$current_course_tool = TOOL_NOTEBOOK;
@ -20,12 +19,12 @@ api_protect_course_script(true);
// Additional javascript
$htmlHeadXtra[] = NotebookManager::javascript_notebook();
$htmlHeadXtra[] = '<script type="text/javascript">
$htmlHeadXtra[] = '<script>
function setFocus(){
$("#note_title").focus();
$("#note_title").focus();
}
$(document).ready(function () {
setFocus();
setFocus();
});
</script>';
@ -35,12 +34,14 @@ $tool = TOOL_NOTEBOOK;
// Tracking
Event::event_access_tool(TOOL_NOTEBOOK);
$action = isset($_GET['action']) ? $_GET['action'] : '';
// Tool name
if (isset($_GET['action']) && $_GET['action'] == 'addnote') {
if ($action === 'addnote') {
$tool = 'NoteAddNew';
$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('ToolNotebook'));
}
if (isset($_GET['action']) && $_GET['action'] == 'editnote') {
if ($action === 'editnote') {
$tool = 'ModifyNote';
$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('ToolNotebook'));
}
@ -52,7 +53,7 @@ Display::display_header(get_lang(ucfirst($tool)));
Display::display_introduction_section(TOOL_NOTEBOOK);
// Action handling: Adding a note
if (isset($_GET['action']) && $_GET['action'] == 'addnote') {
if ($action === 'addnote') {
if (api_get_session_id() != 0 && !api_is_allowed_to_session_edit(false, true)) {
api_not_allowed();
}
@ -103,7 +104,7 @@ if (isset($_GET['action']) && $_GET['action'] == 'addnote') {
$form->setConstants(array('sec_token' => $token));
$form->display();
}
} elseif (isset($_GET['action']) && $_GET['action'] == 'editnote' && is_numeric($_GET['notebook_id'])) {
} elseif ($action === 'editnote' && is_numeric($_GET['notebook_id'])) {
// Action handling: Editing a note
if (!empty($_GET['isStudentView'])) {
@ -112,12 +113,15 @@ if (isset($_GET['action']) && $_GET['action'] == 'addnote') {
}
// Initialize the object
$form = new FormValidator('note', 'post', api_get_self().'?action='.Security::remove_XSS($_GET['action']).'&notebook_id='.Security::remove_XSS($_GET['notebook_id']));
$form = new FormValidator(
'note',
'post',
api_get_self().'?action='.Security::remove_XSS($_GET['action']).'&notebook_id='.intval($_GET['notebook_id'])
);
// Setting the form elements
$form->addElement('header', '', get_lang('ModifyNote'));
$form->addElement('hidden', 'notebook_id');
$form->addElement('text', 'note_title', get_lang('NoteTitle'), array('size' => '100'));
//$form->applyFilter('note_title', 'html_filter');
$form->addElement('html_editor', 'note_comment', get_lang('NoteComment'), null, api_is_allowed_to_edit()
? array('ToolbarSet' => 'Notebook', 'Width' => '100%', 'Height' => '300')
: array('ToolbarSet' => 'NotebookStudent', 'Width' => '100%', 'Height' => '300', 'UserStatus' => 'student')
@ -154,7 +158,7 @@ if (isset($_GET['action']) && $_GET['action'] == 'addnote') {
$form->setConstants(array('sec_token' => $token));
$form->display();
}
} elseif (isset($_GET['action']) && $_GET['action'] == 'deletenote' && is_numeric($_GET['notebook_id'])) {
} elseif ($action === 'deletenote' && is_numeric($_GET['notebook_id'])) {
// Action handling: deleting a note
$res = NotebookManager::delete_note(Security::remove_XSS($_GET['notebook_id']));
@ -164,28 +168,26 @@ if (isset($_GET['action']) && $_GET['action'] == 'addnote') {
NotebookManager::display_notes();
} elseif (
isset($_GET['action']) && $_GET['action'] == 'changeview' &&
in_array($_GET['view'], array('creation_date', 'update_date', 'title'))
) {
$action === 'changeview' && in_array($_GET['view'], array('creation_date', 'update_date', 'title')) ) {
// Action handling: changing the view (sorting order)
switch ($_GET['view']) {
case 'creation_date':
if (!$_GET['direction'] OR $_GET['direction'] == 'ASC') {
if (!$_GET['direction'] || $_GET['direction'] == 'ASC') {
Display::display_confirmation_message(get_lang('NotesSortedByCreationDateAsc'));
} else {
Display::display_confirmation_message(get_lang('NotesSortedByCreationDateDESC'));
}
break;
case 'update_date':
if (!$_GET['direction'] OR $_GET['direction'] == 'ASC') {
if (!$_GET['direction'] || $_GET['direction'] == 'ASC') {
Display::display_confirmation_message(get_lang('NotesSortedByUpdateDateAsc'));
} else {
Display::display_confirmation_message(get_lang('NotesSortedByUpdateDateDESC'));
}
break;
case 'title':
if (!$_GET['direction'] OR $_GET['direction'] == 'ASC') {
if (!$_GET['direction'] || $_GET['direction'] == 'ASC') {
Display::display_confirmation_message(get_lang('NotesSortedByTitleAsc'));
} else {
Display::display_confirmation_message(get_lang('NotesSortedByTitleDESC'));
@ -198,5 +200,4 @@ if (isset($_GET['action']) && $_GET['action'] == 'addnote') {
NotebookManager::display_notes();
}
// Footer
Display::display_footer();

@ -10,11 +10,10 @@ require_once dirname(__FILE__) . '/../inc/global.inc.php';
function get_suggestions_from_search_engine($q)
{
// if (strlen($q)<2) { return null;}
global $charset;
$json = [];
$table_sfv = Database :: get_main_table(TABLE_MAIN_SPECIFIC_FIELD_VALUES);
$table_sfv = Database:: get_main_table(TABLE_MAIN_SPECIFIC_FIELD_VALUES);
$q = Database::escape_string($q);
$cid = api_get_course_id();
$sql_add = '';
@ -78,8 +77,8 @@ function get_suggestions_from_search_engine($q)
// will create a copy as Yannick - Car - Speed
// in $output[3]
$c = count($output);
for ($i=0;$i<$c; $i++) {
$output[($c+$i)] = $current_field_val;
for ($i = 0; $i < $c; $i++) {
$output[($c + $i)] = $current_field_val;
}
} else {
//no identical field id, continue as usual
@ -87,7 +86,7 @@ function get_suggestions_from_search_engine($q)
if ($c == 0) {
$output[] = $row2['value'].' - ';
} else {
foreach ($output as $i=>$out) {
foreach ($output as $i => $out) {
//use the latest combination of fields
$output[$i] .= $row2['value'].' - ';
}
@ -98,7 +97,7 @@ function get_suggestions_from_search_engine($q)
foreach ($output as $i=>$out) {
if (api_stristr($out,$q) === false) {continue;}
$s = api_convert_encoding(substr($out, 0, -3), 'UTF-8', $charset);
if (!in_array($s,$more_sugg)) {
if (!in_array($s, $more_sugg)) {
$more_sugg[] = $s;
$json[] = [
'id' => $s,
@ -115,6 +114,8 @@ function get_suggestions_from_search_engine($q)
}
$q = strtolower($_GET["term"]);
if (!$q) return;
if (!$q) {
return;
}
//echo $q . "| value\n";
get_suggestions_from_search_engine($q);

@ -1,14 +1,16 @@
<?php
/* For licensing terms, see /license.txt */
use Chamilo\CoreBundle\Entity\ExtraField;
use Chamilo\CourseBundle\Entity\CCourseDescription;
use \Chamilo\CoreBundle\Entity\SequenceResource;
/**
* Session about page
* Show information about a session and its courses
* @author Angel Fernando Quiroz Campos <angel.quiroz@beeznest.com>
* @package chamilo.session
*/
use Chamilo\CoreBundle\Entity\ExtraField;
use Chamilo\CourseBundle\Entity\CCourseDescription;
use \Chamilo\CoreBundle\Entity\SequenceResource;
$cidReset = true;
@ -24,18 +26,12 @@ if (!$session) {
api_not_allowed(true);
}
$sessionCourses = $entityManager->getRepository('ChamiloCoreBundle:Session')
->getCoursesOrderedByPosition($session);
$courses = [];
$entityManager = Database::getManager();
$sessionCourses = $entityManager->getRepository('ChamiloCoreBundle:Session')->getCoursesOrderedByPosition($session);
$fieldsRepo = $entityManager->getRepository('ChamiloCoreBundle:ExtraField');
$fieldTagsRepo = $entityManager->getRepository('ChamiloCoreBundle:ExtraFieldRelTag');
$userRepo = $entityManager->getRepository('ChamiloUserBundle:User');
$sequenceResourceRepo = $entityManager->getRepository(
'ChamiloCoreBundle:SequenceResource'
);
$sequenceResourceRepo = $entityManager->getRepository('ChamiloCoreBundle:SequenceResource');
$tagField = $fieldsRepo->findOneBy([
'extraFieldType' => ExtraField::COURSE_FIELD_TYPE,

@ -5,6 +5,7 @@
* @package chamilo.admin
* @todo use formvalidator
*/
// resetting the course id.
$cidReset = true;
@ -206,162 +207,162 @@ if (!api_is_platform_admin() && api_is_teacher()) {
unset($Courses);
?>
<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?page=<?php echo $page; ?>&id_session=<?php echo $sessionId; ?><?php if(!empty($_GET['add'])) echo '&add=true' ; ?>" style="margin:0px;" <?php if($ajax_search){echo ' onsubmit="valide();"';}?>>
<legend><?php echo $tool_name.' ('.$session_info['name'].')'; ?></legend>
<input type="hidden" name="formSent" value="1" />
<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?page=<?php echo $page; ?>&id_session=<?php echo $sessionId; ?><?php if(!empty($_GET['add'])) echo '&add=true' ; ?>" style="margin:0px;" <?php if($ajax_search){echo ' onsubmit="valide();"';}?>>
<legend><?php echo $tool_name.' ('.$session_info['name'].')'; ?></legend>
<input type="hidden" name="formSent" value="1" />
<?php
if (!empty($errorMsg)) {
Display::display_normal_message($errorMsg); //main API
}
?>
<div id="multiple-add-session" class="row">
<div class="col-md-4">
<label><?php echo get_lang('CourseListInPlatform') ?> :</label>
<?php
if (!($add_type == 'multiple')) {
?>
<input type="text" id="course_to_add" onkeyup="xajax_search_courses(this.value,'single')" class="form-control"/>
<div id="ajax_list_courses_single"></div>
<?php
} else {
?>
<div id="ajax_list_courses_multiple">
<select id="origin" name="NoSessionCoursesList[]" multiple="multiple" size="20" class="form-control">
<?php foreach ($nosessionCourses as $enreg) { ?>
<option value="<?php echo $enreg['id']; ?>" <?php echo 'title="'.htmlspecialchars($enreg['title'].' ('.$enreg['visual_code'].')',ENT_QUOTES).'"'; if(in_array($enreg['code'],$CourseList)) echo 'selected="selected"'; ?>>
<?php echo $enreg['title'].' ('.$enreg['visual_code'].')'; ?>
</option>
<?php } ?>
</select>
</div>
<?php
}
unset($nosessionCourses);
<?php
if (!empty($errorMsg)) {
Display::display_normal_message($errorMsg); //main API
}
?>
<div id="multiple-add-session" class="row">
<div class="col-md-4">
<label><?php echo get_lang('CourseListInPlatform') ?> :</label>
<?php
if (!($add_type == 'multiple')) {
?>
</div>
<div class="col-md-4">
<?php if($add_type == 'multiple') { ?>
<div class="code-course">
<?php echo get_lang('FirstLetterCourse'); ?> :
<select name="firstLetterCourse" onchange = "xajax_search_courses(this.value,'multiple')" class="selectpicker show-tick form-control">
<option value="%">--</option>
<?php
echo Display :: get_alphabet_options();
echo Display :: get_numeric_options(0,9,'');
?>
</select>
</div>
<?php } ?>
<div class="control-course">
<?php
if ($ajax_search) {
?>
<div class="separate-action">
<button class="btn btn-primary" type="button" onclick="remove_item(document.getElementById('destination'))">
<em class="fa fa-chevron-left"></em>
</button>
</div>
<?php
} else {
?>
<div class="separate-action">
<button class="btn btn-primary" type="button" onclick="moveItem(document.getElementById('origin'), document.getElementById('destination'))" onclick="moveItem(document.getElementById('origin'), document.getElementById('destination'))">
<em class="fa fa-chevron-right"></em>
</button>
</div>
<div class="separate-action">
<button class="btn btn-primary" type="button" onclick="moveItem(document.getElementById('destination'), document.getElementById('origin'))" onclick="moveItem(document.getElementById('destination'), document.getElementById('origin'))">
<em class="fa fa-chevron-left"></em>
</button>
</div>
<?php
}
<input type="text" id="course_to_add" onkeyup="xajax_search_courses(this.value,'single')" class="form-control"/>
<div id="ajax_list_courses_single"></div>
<?php
} else {
?>
<div class="separate-action">
<label>
<input type="checkbox" name="copy_evaluation">
<?php echo get_lang('ImportGradebookInCourse'); ?>
</label>
</div>
<?php
echo '<div class="separate-action">';
if (isset($_GET['add'])) {
echo '<button class="btn btn-success" type="button" value="" onclick="valide()" >'.get_lang('NextStep').'</button>';
} else {
echo '<button class="btn btn-success" type="button" value="" onclick="valide()" >'.get_lang('SubscribeCoursesToSession').'</button>';
}
echo '</div>';
<div id="ajax_list_courses_multiple">
<select id="origin" name="NoSessionCoursesList[]" multiple="multiple" size="20" class="form-control">
<?php foreach ($nosessionCourses as $enreg) { ?>
<option value="<?php echo $enreg['id']; ?>" <?php echo 'title="'.htmlspecialchars($enreg['title'].' ('.$enreg['visual_code'].')',ENT_QUOTES).'"'; if(in_array($enreg['code'],$CourseList)) echo 'selected="selected"'; ?>>
<?php echo $enreg['title'].' ('.$enreg['visual_code'].')'; ?>
</option>
<?php } ?>
</select>
</div>
<?php
}
unset($nosessionCourses);
?>
</div>
<div class="col-md-4">
<?php if($add_type == 'multiple') { ?>
<div class="code-course">
<?php echo get_lang('FirstLetterCourse'); ?> :
<select name="firstLetterCourse" onchange = "xajax_search_courses(this.value,'multiple')" class="selectpicker show-tick form-control">
<option value="%">--</option>
<?php
echo Display :: get_alphabet_options();
echo Display :: get_numeric_options(0,9,'');
?>
</select>
</div>
<?php } ?>
<div class="control-course">
<?php
if ($ajax_search) {
?>
<div class="separate-action">
<button class="btn btn-primary" type="button" onclick="remove_item(document.getElementById('destination'))">
<em class="fa fa-chevron-left"></em>
</button>
</div>
<?php
} else {
?>
<div class="separate-action">
<button class="btn btn-primary" type="button" onclick="moveItem(document.getElementById('origin'), document.getElementById('destination'))" onclick="moveItem(document.getElementById('origin'), document.getElementById('destination'))">
<em class="fa fa-chevron-right"></em>
</button>
</div>
<div class="separate-action">
<button class="btn btn-primary" type="button" onclick="moveItem(document.getElementById('destination'), document.getElementById('origin'))" onclick="moveItem(document.getElementById('destination'), document.getElementById('origin'))">
<em class="fa fa-chevron-left"></em>
</button>
</div>
<?php
}
?>
<div class="separate-action">
<label>
<input type="checkbox" name="copy_evaluation">
<?php echo get_lang('ImportGradebookInCourse'); ?>
</label>
</div>
</div>
<div class="col-md-4">
<label><?php echo get_lang('CourseListInSession') ?> :</label>
<select id='destination' name="SessionCoursesList[]" multiple="multiple" size="20" class="form-control">
<?php
foreach($sessionCourses as $enreg) {
?>
<option value="<?php echo $enreg['id']; ?>" title="<?php echo htmlspecialchars($enreg['title'].' ('.$enreg['visual_code'].')',ENT_QUOTES); ?>">
<?php echo $enreg['title'].' ('.$enreg['visual_code'].')'; ?>
</option>
<?php
}
unset($sessionCourses);
?>
</select>
<?php
echo '<div class="separate-action">';
if (isset($_GET['add'])) {
echo '<button class="btn btn-success" type="button" value="" onclick="valide()" >'.get_lang('NextStep').'</button>';
} else {
echo '<button class="btn btn-success" type="button" value="" onclick="valide()" >'.get_lang('SubscribeCoursesToSession').'</button>';
}
echo '</div>';
?>
</div>
</div>
</form>
<script>
function moveItem(origin , destination) {
for(var i = 0 ; i<origin.options.length ; i++) {
if(origin.options[i].selected) {
destination.options[destination.length] = new Option(origin.options[i].text,origin.options[i].value);
origin.options[i]=null;
i = i-1;
<div class="col-md-4">
<label><?php echo get_lang('CourseListInSession') ?> :</label>
<select id='destination' name="SessionCoursesList[]" multiple="multiple" size="20" class="form-control">
<?php
foreach($sessionCourses as $enreg) {
?>
<option value="<?php echo $enreg['id']; ?>" title="<?php echo htmlspecialchars($enreg['title'].' ('.$enreg['visual_code'].')',ENT_QUOTES); ?>">
<?php echo $enreg['title'].' ('.$enreg['visual_code'].')'; ?>
</option>
<?php
}
unset($sessionCourses);
?>
</select>
</div>
</div>
</form>
<script>
function moveItem(origin , destination) {
for(var i = 0 ; i<origin.options.length ; i++) {
if(origin.options[i].selected) {
destination.options[destination.length] = new Option(origin.options[i].text,origin.options[i].value);
origin.options[i]=null;
i = i-1;
}
destination.selectedIndex = -1;
sortOptions(destination.options);
}
destination.selectedIndex = -1;
sortOptions(destination.options);
}
function sortOptions(options) {
newOptions = new Array();
for (i = 0 ; i<options.length ; i++) {
newOptions[i] = options[i];
}
function sortOptions(options) {
newOptions = new Array();
for (i = 0 ; i<options.length ; i++) {
newOptions[i] = options[i];
}
newOptions = newOptions.sort(mysort);
options.length = 0;
newOptions = newOptions.sort(mysort);
options.length = 0;
for(i = 0 ; i < newOptions.length ; i++){
options[i] = newOptions[i];
}
for(i = 0 ; i < newOptions.length ; i++){
options[i] = newOptions[i];
}
}
function mysort(a, b) {
if(a.text.toLowerCase() > b.text.toLowerCase()){
return 1;
}
if(a.text.toLowerCase() < b.text.toLowerCase()){
return -1;
}
return 0;
function mysort(a, b) {
if(a.text.toLowerCase() > b.text.toLowerCase()){
return 1;
}
if(a.text.toLowerCase() < b.text.toLowerCase()){
return -1;
}
return 0;
}
function valide() {
var options = document.getElementById('destination').options;
for (i = 0 ; i<options.length ; i++)
options[i].selected = true;
function valide() {
var options = document.getElementById('destination').options;
for (i = 0 ; i<options.length ; i++)
options[i].selected = true;
document.forms.formulaire.submit();
}
</script>
document.forms.formulaire.submit();
}
</script>
<?php
Display::display_footer();

@ -17,7 +17,6 @@ if (api_get_setting('allow_social_tool') != 'true') {
$this_section = SECTION_SOCIAL;
$htmlHeadXtra[] = '<script>
function delete_friend (element_div) {
id_image=$(element_div).attr("id");
user_id=id_image.split("_");

@ -6,16 +6,15 @@
* @author Julio Montoya <gugli100@gmail.com>
*/
$language_file= 'userInfo';
$cidReset = true;
require_once '../inc/global.inc.php';
api_block_anonymous_users();
if (api_get_setting('allow_social_tool') !='true') {
if (api_get_setting('allow_social_tool') !== 'true') {
api_not_allowed();
}
if (api_get_setting('allow_students_to_create_groups_in_social') == 'false' && !api_is_allowed_to_edit()) {
if (api_get_setting('allow_students_to_create_groups_in_social') === 'false' && !api_is_allowed_to_edit()) {
api_not_allowed();
}

@ -6,13 +6,11 @@
* @author Julio Montoya <gugli100@gmail.com>
*/
// Language files that should be included
$language_file = array('userInfo');
$cidReset = true;
require_once '../inc/global.inc.php';
api_block_anonymous_users();
if (api_get_setting('allow_social_tool') != 'true') {
if (api_get_setting('allow_social_tool') !== 'true') {
api_not_allowed();
}

@ -6,12 +6,11 @@
*/
$cidReset = true;
$language_file = array('userInfo');
require_once '../inc/global.inc.php';
api_block_anonymous_users();
if (api_get_setting('allow_social_tool') !='true') {
if (api_get_setting('allow_social_tool') !== 'true') {
api_not_allowed();
}

@ -7,7 +7,6 @@
*/
$cidReset = true;
$language_file = array('userInfo');
require_once '../inc/global.inc.php';
api_block_anonymous_users();

@ -7,12 +7,11 @@
*/
$cidReset = true;
$language_file = array('userInfo');
require_once '../inc/global.inc.php';
api_block_anonymous_users();
if (api_get_setting('allow_social_tool') !='true') {
if (api_get_setting('allow_social_tool') !== 'true') {
api_not_allowed();
}
$join_url = '';
@ -66,14 +65,14 @@ if (is_array($results) && count($results) > 0) {
$result['description'] = Security::remove_XSS($result['description'], STUDENT, true);
$my_group_list[] = $id;
$name = cut($result['name'], GROUP_TITLE_LENGTH, true);
if ($result['relation_type'] == GROUP_USER_PERMISSION_ADMIN) {
$name .= ' '.Display::return_icon('social_group_admin.png', get_lang('Admin'), array('style'=>'vertical-align:middle'));
} elseif ($result['relation_type'] == GROUP_USER_PERMISSION_MODERATOR) {
$name .= ' '.Display::return_icon('social_group_moderator.png', get_lang('Moderator'), array('style'=>'vertical-align:middle'));
}
$url = '<a href="group_view.php?id='.$id.'">' . $name . '</a>';
$count_users_group = count($usergroup->get_users_by_group($id, false, array(GROUP_USER_PERMISSION_ADMIN, GROUP_USER_PERMISSION_READER, GROUP_USER_PERMISSION_MODERATOR), 0 , 1000));
if ($count_users_group == 1 ) {
$count_users_group = $count_users_group.' '.get_lang('Member');
@ -83,7 +82,7 @@ if (is_array($results) && count($results) > 0) {
$picture = $usergroup->get_picture_group($result['id'], $result['picture'],80);
$result['picture'] = '<img class="social-groups-image" src="'.$picture['file'].'" />';
$members = Display::returnFontAwesomeIcon('user').$count_users_group;
$html = '<div class="row">';
$html .= '<div class="col-md-2">';
@ -101,7 +100,7 @@ if (is_array($results) && count($results) > 0) {
}
$html .= '</div>';
$html .= '</div>';
$grid_item_2 = $html;
$grid_my_groups[]= array($grid_item_2);
}
@ -116,7 +115,7 @@ foreach ($results as $result) {
$result['description'] = Security::remove_XSS($result['description'], STUDENT, true);
$id = $result['id'];
$name = cut($result['name'], GROUP_TITLE_LENGTH, true);
$count_users_group = count($usergroup->get_users_by_group($id, false, array(GROUP_USER_PERMISSION_ADMIN, GROUP_USER_PERMISSION_READER, GROUP_USER_PERMISSION_MODERATOR), 0 , 1000));
if ($count_users_group == 1 ) {
$count_users_group = $count_users_group.' '.get_lang('Member');
@ -125,11 +124,11 @@ foreach ($results as $result) {
}
$url = '<a href="group_view.php?id='.$id.'">' . $name . '</a>';
$picture = $usergroup->get_picture_group($result['id'], $result['picture'],80);
$result['picture'] = '<img class="social-groups-image" src="'.$picture['file'].'" />';
$members = Display::returnFontAwesomeIcon('user').$count_users_group;
$html = '<div class="row">';
$html .= '<div class="col-md-2">';
$html .= $result['picture'];
@ -149,12 +148,12 @@ foreach ($results as $result) {
if (!in_array($id,$my_group_list)) {
$html .= '<a class="btn" href="group_view.php?id='.$id.'&action=join&u='.api_get_user_id().'">'.get_lang('JoinGroup').'</a> ';
}
$html .= '<div class="group-actions" >'.$join_url.'</div>';
$html .= '</div>';
$html .= '</div>';
$grid_item_2 = $html;
$grid_newest_groups[]= array($grid_item_2);
@ -179,7 +178,7 @@ if (is_array($results) && count($results) > 0) {
}
$url = '<a href="group_view.php?id='.$id.'">' . $name . '</a>';
$picture = $usergroup->get_picture_group($result['id'], $result['picture'],80);
$result['picture'] = '<img class="social-groups-image" src="'.$picture['file'].'" />';

@ -206,7 +206,14 @@ if (count($sessionList) > 0) {
$social_session_block = $sessionList;
}
$social_group_block = Display::panelCollapse(get_lang('Group'), $social_group_block, 'sm-groups', null, 'grups-acordion', 'groups-collapse');
$social_group_block = Display::panelCollapse(
get_lang('Group'),
$social_group_block,
'sm-groups',
null,
'grups-acordion',
'groups-collapse'
);
$tpl = new Template(get_lang('SocialNetwork'));

@ -10,7 +10,7 @@ require_once '../inc/global.inc.php';
api_block_anonymous_users();
if (api_get_setting('allow_social_tool') !='true') {
if (api_get_setting('allow_social_tool') !== 'true') {
api_not_allowed();
}

@ -21,7 +21,7 @@ if (isset($_REQUEST['user_friend'])) {
$info_path_friend=array();
$userfriend_id = intval($_REQUEST['user_friend']);
$info_user_friend = api_get_user_info($userfriend_id);
$info_path_friend = UserManager::get_user_picture_path_by_id($userfriend_id,'web');
$info_path_friend = UserManager::get_user_picture_path_by_id($userfriend_id, 'web');
}
$group_id = isset($_GET['group_id']) ? intval($_GET['group_id']) : null;
@ -73,11 +73,11 @@ $form->addElement('hidden', 'token', $tok);
$tpl = new Template(get_lang('Groups'));
if (api_get_setting('allow_message_tool')=='true') {
if (api_get_setting('allow_message_tool') === 'true') {
// Normal message
$user_info = api_get_user_info($userfriend_id);
$height = 180;
if ($allowed_action == 'add_message_group') {
if ($allowed_action === 'add_message_group') {
$form->addElement('text', 'title', get_lang('Title'));
$height = 140;
}

@ -1,10 +1,12 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Show the skills report
* @author Angel Fernando Quiroz Campos <angel.quiroz@beeznest.com>
* @package chamilo.social.skill
*/
require_once '../inc/global.inc.php';
$isStudent = api_is_student();
@ -27,8 +29,8 @@ $tableRows = array();
$tpl = new Template(get_lang('Skills'));
$tplPath = null;
$tpl->assign('allowSkillsTool', api_get_setting('allow_skills_tool') == 'true');
$tpl->assign('allowDrhSkillsManagement', api_get_setting('allow_hr_skills_management') == 'true');
$tpl->assign('allowSkillsTool', api_get_setting('allow_skills_tool') === 'true');
$tpl->assign('allowDrhSkillsManagement', api_get_setting('allow_hr_skills_management') === 'true');
if ($isStudent) {
$sql = "SELECT s.name, sru.acquired_skill_at, c.title, c.directory

@ -12,7 +12,7 @@ $this_section = SECTION_MYPROFILE;
api_block_anonymous_users();
if (api_get_setting('allow_skills_tool') != 'true') {
if (api_get_setting('allow_skills_tool') !== 'true') {
api_not_allowed();
}

@ -10,7 +10,7 @@ require_once '../inc/global.inc.php';
$this_section = SECTION_SOCIAL;
if (api_get_setting('allow_skills_tool') != 'true') {
if (api_get_setting('allow_skills_tool') !== 'true') {
api_not_allowed();
}

@ -71,7 +71,7 @@ if ($_GET['action'] == 'edit' && isset($survey_id) && is_numeric($survey_id)) {
$defaults['survey_id'] = $survey_id;
$defaults['anonymous'] = $survey_data['anonymous'];
$link_info = GradebookUtils::is_resource_in_course_gradebook(
$link_info = GradebookUtils::isResourceInCourseGradebook(
$course_id,
$gradebook_link_type,
$survey_id,

@ -463,7 +463,7 @@ class SurveyManager
$gradebook_link_type = 8;
$link_info = GradebookUtils::is_resource_in_course_gradebook(
$link_info = GradebookUtils::isResourceInCourseGradebook(
$courseCode,
$gradebook_link_type,
$survey_id,

@ -50,7 +50,7 @@ $defaults['new_dir'] = Security::remove_XSS($title);
$there_is_a_end_date = false;
if (Gradebook::is_active()) {
$link_info = GradebookUtils::is_resource_in_course_gradebook(
$link_info = GradebookUtils::isResourceInCourseGradebook(
api_get_course_id(),
LINK_STUDENTPUBLICATION,
$workId

@ -331,7 +331,7 @@ function getWorkList($id, $my_folder_data, $add_in_where_query = null)
$group_id = api_get_group_id();
$is_allowed_to_edit = api_is_allowed_to_edit(null, true);
$linkInfo = GradebookUtils::is_resource_in_course_gradebook(
$linkInfo = GradebookUtils::isResourceInCourseGradebook(
api_get_course_id(),
3,
$id,
@ -840,7 +840,7 @@ function deleteDirWork($id)
WHERE c_id = $course_id AND publication_id = $id";
Database::query($sql);
$link_info = GradebookUtils::is_resource_in_course_gradebook(
$link_info = GradebookUtils::isResourceInCourseGradebook(
api_get_course_id(),
3,
$id,
@ -4013,7 +4013,7 @@ function updatePublicationAssignment($workId, $params, $courseInfo, $groupId)
if (!empty($params['category_id'])) {
$link_info = GradebookUtils::is_resource_in_course_gradebook(
$link_info = GradebookUtils::isResourceInCourseGradebook(
$courseInfo['code'],
LINK_STUDENTPUBLICATION,
$workId,

@ -10,9 +10,7 @@ namespace Chamilo\CoreBundle\Component\Editor\CkEditor\Toolbar;
*/
class AgendaStudent extends Basic
{
public $plugins = array(
);
public $plugins = array();
/**
* Get the toolbar config
@ -116,5 +114,4 @@ class AgendaStudent extends Basic
['Toolbarswitch']
];
}
}

@ -10,7 +10,6 @@ namespace Chamilo\CoreBundle\Component\Editor\CkEditor\Toolbar;
*/
class Announcements extends Basic
{
/**
* Get the toolbar config
* @return array
@ -75,5 +74,4 @@ class Announcements extends Basic
['Toolbarswitch']
];
}
}

@ -5,7 +5,7 @@ namespace Chamilo\CoreBundle\Component\Editor\CkEditor\Toolbar;
/**
* AssessmentsIntroduction toolbar configuration
*
*
* @package Chamilo\CoreBundle\Component\Editor\CkEditor\Toolbar
*/
class AssessmentsIntroduction extends Basic
@ -61,5 +61,4 @@ class AssessmentsIntroduction extends Basic
['Toolbarswitch']
];
}
}

@ -137,6 +137,7 @@ class Editor
array('\r', '\n', '\x3c', '\x3e', '\x26'),
addslashes($var)
).'"';
break;
case 'array':
// Arrays in JSON can't be associative. If the array is empty or if it
// has sequential whole number keys starting with 0, it's not associative
@ -149,6 +150,7 @@ class Editor
return '[ '.implode(', ', $output).' ]';
}
break;
case 'object':
// Otherwise, fall through to convert the array as an object.
$output = array();

Loading…
Cancel
Save