1.9.x
Yannick Warnier 10 years ago
commit be3d76b667
  1. 78
      main/auth/inscription.php
  2. 19
      main/document/showinframes.php
  3. 4
      main/dropbox/dropbox_functions.inc.php
  4. 3
      main/exercice/exercise_history.php
  5. 388
      main/group/group_space.php
  6. 33
      main/inc/ajax/model.ajax.php
  7. 2
      main/inc/ajax/user_manager.ajax.php
  8. 2
      main/inc/lib/add_course.lib.inc.php
  9. 2
      main/inc/lib/course.lib.php
  10. 12
      main/inc/lib/course_request.lib.php
  11. 15
      main/inc/lib/tracking.lib.php
  12. 2
      main/install/configuration.dist.php
  13. 4
      main/template/default/layout/layout_1_col.tpl
  14. 2
      main/template/default/layout/main.tpl
  15. 4
      main/template/default/layout/main_footer.tpl
  16. 2
      main/template/default/layout/show_footer.tpl
  17. 2
      main/user/user_add.php
  18. 2
      main/work/student_work.php
  19. 13
      main/work/work.lib.php
  20. 4
      main/work/work.php
  21. 43
      main/work/work_list.php
  22. 187
      main/work/work_list_all.php

@ -10,7 +10,8 @@ use \ChamiloSession as Session;
$language_file = array('registration', 'admin'); $language_file = array('registration', 'admin');
if (!empty($_POST['language'])) { //quick hack to adapt the registration form result to the selected registration language //quick hack to adapt the registration form result to the selected registration language
if (!empty($_POST['language'])) {
$_GET['language'] = $_POST['language']; $_GET['language'] = $_POST['language'];
} }
require_once '../inc/global.inc.php'; require_once '../inc/global.inc.php';
@ -44,7 +45,7 @@ if (api_get_setting('allow_terms_conditions') == 'true') {
$user_already_registered_show_terms = false; $user_already_registered_show_terms = false;
} }
//Direct Link Subscription feature #5299 // Direct Link Subscription feature #5299
$course_code_redirect = isset($_REQUEST['c']) && !empty($_REQUEST['c']) ? $_REQUEST['c'] : null; $course_code_redirect = isset($_REQUEST['c']) && !empty($_REQUEST['c']) ? $_REQUEST['c'] : null;
$exercise_redirect = isset($_REQUEST['e']) && !empty($_REQUEST['e']) ? $_REQUEST['e'] : null; $exercise_redirect = isset($_REQUEST['e']) && !empty($_REQUEST['e']) ? $_REQUEST['e'] : null;
@ -54,7 +55,6 @@ if (!empty($course_code_redirect)) {
} }
if ($user_already_registered_show_terms == false) { if ($user_already_registered_show_terms == false) {
if (api_is_western_name_order()) { if (api_is_western_name_order()) {
// FIRST NAME and LAST NAME // FIRST NAME and LAST NAME
$form->addElement('text', 'firstname', get_lang('FirstName'), array('size' => 40)); $form->addElement('text', 'firstname', get_lang('FirstName'), array('size' => 40));
@ -157,20 +157,18 @@ if ($user_already_registered_show_terms == false) {
$allowCaptcha = isset($_configuration['allow_captcha']) ? $_configuration['allow_captcha'] : false; $allowCaptcha = isset($_configuration['allow_captcha']) ? $_configuration['allow_captcha'] : false;
if ($allowCaptcha) { if ($allowCaptcha) {
$ajax = api_get_path(WEB_AJAX_PATH).'form.ajax.php?a=get_captcha'; $ajax = api_get_path(WEB_AJAX_PATH).'form.ajax.php?a=get_captcha';
$options = array( $options = array(
'width' => 220, 'width' => 220,
'height' => 90, 'height' => 90,
'callback' => $ajax.'&var='.basename(__FILE__, '.php'), 'callback' => $ajax.'&var='.basename(__FILE__, '.php'),
'sessionVar' => basename(__FILE__, '.php'), 'sessionVar' => basename(__FILE__, '.php'),
'imageOptions' => array( 'imageOptions' => array(
'font_size' => 20, 'font_size' => 20,
'font_path' => api_get_path(LIBRARY_PATH).'pchart/fonts/', 'font_path' => api_get_path(LIBRARY_PATH).'pchart/fonts/',
'font_file' => 'tahoma.ttf', 'font_file' => 'tahoma.ttf',
//'output' => 'gif' //'output' => 'gif'
) )
); );
$captcha_question = $form->addElement('CAPTCHA_Image', 'captcha_question', '', $options); $captcha_question = $form->addElement('CAPTCHA_Image', 'captcha_question', '', $options);
@ -183,29 +181,45 @@ if ($user_already_registered_show_terms == false) {
} }
// EXTENDED FIELDS // EXTENDED FIELDS
if (api_get_setting('extended_profile') == 'true' && api_get_setting('extendedprofile_registration', 'mycomptetences') == 'true') { if (api_get_setting('extended_profile') == 'true' &&
api_get_setting('extendedprofile_registration', 'mycomptetences') == 'true'
) {
$form->add_html_editor('competences', get_lang('MyCompetences'), false, false, array('ToolbarSet' => 'register', 'Width' => '100%', 'Height' => '130')); $form->add_html_editor('competences', get_lang('MyCompetences'), false, false, array('ToolbarSet' => 'register', 'Width' => '100%', 'Height' => '130'));
} }
if (api_get_setting('extended_profile') == 'true' && api_get_setting('extendedprofile_registration', 'mydiplomas') == 'true') { if (api_get_setting('extended_profile') == 'true' &&
api_get_setting('extendedprofile_registration', 'mydiplomas') == 'true'
) {
$form->add_html_editor('diplomas', get_lang('MyDiplomas'), false, false, array('ToolbarSet' => 'register', 'Width' => '100%', 'Height' => '130')); $form->add_html_editor('diplomas', get_lang('MyDiplomas'), false, false, array('ToolbarSet' => 'register', 'Width' => '100%', 'Height' => '130'));
} }
if (api_get_setting('extended_profile') == 'true' && api_get_setting('extendedprofile_registration', 'myteach') == 'true') { if (api_get_setting('extended_profile') == 'true' &&
api_get_setting('extendedprofile_registration', 'myteach') == 'true'
) {
$form->add_html_editor('teach', get_lang('MyTeach'), false, false, array('ToolbarSet' => 'register', 'Width' => '100%', 'Height' => '130')); $form->add_html_editor('teach', get_lang('MyTeach'), false, false, array('ToolbarSet' => 'register', 'Width' => '100%', 'Height' => '130'));
} }
if (api_get_setting('extended_profile') == 'true' && api_get_setting('extendedprofile_registration', 'mypersonalopenarea') == 'true') { if (api_get_setting('extended_profile') == 'true' &&
api_get_setting('extendedprofile_registration', 'mypersonalopenarea') == 'true'
) {
$form->add_html_editor('openarea', get_lang('MyPersonalOpenArea'), false, false, array('ToolbarSet' => 'register', 'Width' => '100%', 'Height' => '130')); $form->add_html_editor('openarea', get_lang('MyPersonalOpenArea'), false, false, array('ToolbarSet' => 'register', 'Width' => '100%', 'Height' => '130'));
} }
if (api_get_setting('extended_profile') == 'true') { if (api_get_setting('extended_profile') == 'true') {
if (api_get_setting('extendedprofile_registration', 'mycomptetences') == 'true' && api_get_setting('extendedprofile_registrationrequired', 'mycomptetences') == 'true') { if (api_get_setting('extendedprofile_registration', 'mycomptetences') == 'true' &&
api_get_setting('extendedprofile_registrationrequired', 'mycomptetences') == 'true'
) {
$form->addRule('competences', get_lang('ThisFieldIsRequired'), 'required'); $form->addRule('competences', get_lang('ThisFieldIsRequired'), 'required');
} }
if (api_get_setting('extendedprofile_registration', 'mydiplomas') == 'true' && api_get_setting('extendedprofile_registrationrequired', 'mydiplomas') == 'true') { if (api_get_setting('extendedprofile_registration', 'mydiplomas') == 'true' &&
api_get_setting('extendedprofile_registrationrequired', 'mydiplomas') == 'true'
) {
$form->addRule('diplomas', get_lang('ThisFieldIsRequired'), 'required'); $form->addRule('diplomas', get_lang('ThisFieldIsRequired'), 'required');
} }
if (api_get_setting('extendedprofile_registration', 'myteach') == 'true' && api_get_setting('extendedprofile_registrationrequired', 'myteach') == 'true') { if (api_get_setting('extendedprofile_registration', 'myteach') == 'true' &&
api_get_setting('extendedprofile_registrationrequired', 'myteach') == 'true'
) {
$form->addRule('teach', get_lang('ThisFieldIsRequired'), 'required'); $form->addRule('teach', get_lang('ThisFieldIsRequired'), 'required');
} }
if (api_get_setting('extendedprofile_registration', 'mypersonalopenarea') == 'true' && api_get_setting('extendedprofile_registrationrequired', 'mypersonalopenarea') == 'true') { if (api_get_setting('extendedprofile_registration', 'mypersonalopenarea') == 'true' &&
api_get_setting('extendedprofile_registrationrequired', 'mypersonalopenarea') == 'true'
) {
$form->addRule('openarea', get_lang('ThisFieldIsRequired'), 'required'); $form->addRule('openarea', get_lang('ThisFieldIsRequired'), 'required');
} }
} }
@ -340,8 +354,13 @@ if (api_get_setting('allow_terms_conditions') == 'true') {
$form->addElement('hidden', 'legal_info', $term_preview['legal_id'].':'.$term_preview['language_id']); $form->addElement('hidden', 'legal_info', $term_preview['legal_id'].':'.$term_preview['language_id']);
if ($term_preview['type'] == 1) { if ($term_preview['type'] == 1) {
$form->addElement('checkbox', 'legal_accept', null, get_lang('IHaveReadAndAgree').'&nbsp;<a href="inscription.php?legal" target="_blank">'.get_lang('TermsAndConditions').'</a>'); $form->addElement(
$form->addRule('legal_accept', get_lang('ThisFieldIsRequired'), 'required'); 'checkbox',
'legal_accept',
null,
get_lang('IHaveReadAndAgree').'&nbsp;<a href="inscription.php?legal" target="_blank">'.get_lang('TermsAndConditions').'</a>'
);
$form->addRule('legal_accept', get_lang('ThisFieldIsRequired'), 'required');
} else { } else {
$preview = LegalManager::show_last_condition($term_preview); $preview = LegalManager::show_last_condition($term_preview);
$form->addElement('label', null, $preview); $form->addElement('label', null, $preview);
@ -466,7 +485,9 @@ if ($form->validate()) {
// if there is a default duration of a valid account then we have to change the expiration_date accordingly // if there is a default duration of a valid account then we have to change the expiration_date accordingly
if (api_get_setting('account_valid_duration') != '') { if (api_get_setting('account_valid_duration') != '') {
$sql = "UPDATE ".Database::get_main_table(TABLE_MAIN_USER)." SET expiration_date='registration_date+1' WHERE user_id='".$user_id."'"; $sql = "UPDATE ".Database::get_main_table(TABLE_MAIN_USER)."
SET expiration_date='registration_date+1'
WHERE user_id='".$user_id."'";
Database::query($sql); Database::query($sql);
} }
@ -692,7 +713,10 @@ if ($form->validate()) {
Session::erase('exercise_redirect'); Session::erase('exercise_redirect');
if (CustomPages::enabled()) { if (CustomPages::enabled()) {
CustomPages::display(CustomPages::REGISTRATION_FEEDBACK, array('info' => $text_after_registration)); CustomPages::display(
CustomPages::REGISTRATION_FEEDBACK,
array('info' => $text_after_registration)
);
} else { } else {
Display :: display_header($tool_name); Display :: display_header($tool_name);
echo Display::page_header($tool_name); echo Display::page_header($tool_name);

@ -32,11 +32,11 @@ $noPHP_SELF = true;
$header_file = isset($_GET['file']) ? Security::remove_XSS($_GET['file']) : null; $header_file = isset($_GET['file']) ? Security::remove_XSS($_GET['file']) : null;
$document_id = intval($_GET['id']); $document_id = intval($_GET['id']);
$course_info = api_get_course_info(); $courseInfo = api_get_course_info();
$course_code = api_get_course_id(); $course_code = api_get_course_id();
$session_id = api_get_session_id(); $session_id = api_get_session_id();
if (empty($course_info)) { if (empty($courseInfo)) {
api_not_allowed(true); api_not_allowed(true);
} }
@ -44,7 +44,7 @@ $show_web_odf = false;
// Generate path // Generate path
if (!$document_id) { if (!$document_id) {
$document_id = DocumentManager::get_document_id($course_info, $header_file); $document_id = DocumentManager::get_document_id($courseInfo, $header_file);
} }
$document_data = DocumentManager::get_document_data_by_id( $document_data = DocumentManager::get_document_data_by_id(
$document_id, $document_id,
@ -74,7 +74,7 @@ $path_array = array_map('urldecode', $path_array);
$header_file = implode('/', $path_array); $header_file = implode('/', $path_array);
$file = Security::remove_XSS(urldecode($document_data['path'])); $file = Security::remove_XSS(urldecode($document_data['path']));
$file_root = $course_info['path'].'/document'.str_replace('%2F', '/', $file); $file_root = $courseInfo['path'].'/document'.str_replace('%2F', '/', $file);
$file_url_sys = api_get_path(SYS_COURSE_PATH).$file_root; $file_url_sys = api_get_path(SYS_COURSE_PATH).$file_root;
$file_url_web = api_get_path(WEB_COURSE_PATH).$file_root; $file_url_web = api_get_path(WEB_COURSE_PATH).$file_root;
@ -330,7 +330,7 @@ Display::display_header('');
echo '<div align="center">'; echo '<div align="center">';
$file_url = api_get_path(WEB_COURSE_PATH).$_course['path'].'/document'.$header_file; $file_url = api_get_path(WEB_COURSE_PATH).$courseInfo['path'].'/document'.$header_file;
$file_url_web = $file_url.'?'.api_get_cidreq(); $file_url_web = $file_url.'?'.api_get_cidreq();
if (!$is_nanogong_available) { if (!$is_nanogong_available) {
@ -340,9 +340,14 @@ if (!$is_nanogong_available) {
} }
if ($show_web_odf) { if ($show_web_odf) {
$browser = api_get_navigator();
$pdfUrl = api_get_path(WEB_LIBRARY_PATH) . 'javascript/ViewerJS/index.html#' . $file_url;
if ($browser['name'] == 'Mozilla') {
$pdfUrl = $file_url;
}
echo '<div id="viewerJS">'; echo '<div id="viewerJS">';
echo '<iframe id="viewerJSContent" frameborder="0" allowfullscreen="allowfullscreen" style="width:100%;" echo '<iframe id="viewerJSContent" frameborder="0" allowfullscreen="allowfullscreen" webkitallowfullscreen style="width:100%;"
src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/ViewerJS/index.html#'.$file_url.'"> src="' . $pdfUrl. '">
</iframe>'; </iframe>';
echo '</div>'; echo '</div>';
} else { } else {

@ -880,7 +880,7 @@ function store_add_dropbox()
foreach ($new_work_recipients as $recipient_id) { foreach ($new_work_recipients as $recipient_id) {
$recipent_temp = UserManager :: get_user_info_by_id($recipient_id); $recipent_temp = UserManager :: get_user_info_by_id($recipient_id);
$additionalParameters = array( $additionalParameters = array(
'smsType' => NEW_FILE_SHARED_COURSE_BY, 'smsType' => ClockworksmsPlugin::NEW_FILE_SHARED_COURSE_BY,
'userId' => $recipient_id, 'userId' => $recipient_id,
'courseTitle' => $_course['title'], 'courseTitle' => $_course['title'],
'userUsername' => $recipent_temp['username'] 'userUsername' => $recipent_temp['username']
@ -890,7 +890,7 @@ function store_add_dropbox()
$recipent_temp['firstname'].' '.$recipent_temp['lastname'], $recipent_temp['firstname'].' '.$recipent_temp['lastname'],
null, null,
PERSON_NAME_EMAIL_ADDRESS PERSON_NAME_EMAIL_ADDRESS
), ),
$recipent_temp['email'], $recipent_temp['email'],
get_lang('NewDropboxFileUploaded'), get_lang('NewDropboxFileUploaded'),
get_lang('NewDropboxFileUploadedContent').' '.api_get_path(WEB_CODE_PATH). get_lang('NewDropboxFileUploadedContent').' '.api_get_path(WEB_CODE_PATH).

@ -26,7 +26,6 @@ $show=(isset($_GET['show']) && $_GET['show'] == 'result')?'result':'test'; // mo
*/ */
require_once api_get_path(LIBRARY_PATH).'document.lib.php'; require_once api_get_path(LIBRARY_PATH).'document.lib.php';
//include(api_get_path(LIBRARY_PATH).'mail.lib.inc.php');
/* Constants and variables */ /* Constants and variables */
$is_allowedToEdit = api_is_allowed_to_edit(null,true); $is_allowedToEdit = api_is_allowed_to_edit(null,true);
@ -65,7 +64,7 @@ echo '</div>';
<tr class="row_odd"> <tr class="row_odd">
<th><?php echo get_lang('Question'); ?></th> <th><?php echo get_lang('Question'); ?></th>
<th width="50px"><?php echo get_lang('Value'); ?></th> <th width="50px"><?php echo get_lang('Value'); ?></th>
<th><?php echo get_lang('Feedback'); ?></th> <th><?php echo get_lang('Feedback'); ?></th>
<th><?php echo get_lang('Author'); ?></th> <th><?php echo get_lang('Author'); ?></th>
<th width="160px"><?php echo get_lang('Date'); ?></th> <th width="160px"><?php echo get_lang('Date'); ?></th>
</tr> </tr>

@ -9,8 +9,6 @@
* @todo Display error message if no group ID specified * @todo Display error message if no group ID specified
*/ */
/* INIT SECTION */
// Name of the language file that needs to be included // Name of the language file that needs to be included
$language_file = 'group'; $language_file = 'group';
@ -21,7 +19,6 @@ $current_course_tool = TOOL_GROUP;
api_protect_course_script(true); api_protect_course_script(true);
/* Libraries & config files */ /* Libraries & config files */
require_once api_get_path(SYS_CODE_PATH).'forum/forumfunction.inc.php'; require_once api_get_path(SYS_CODE_PATH).'forum/forumfunction.inc.php';
require_once api_get_path(SYS_CODE_PATH).'forum/forumconfig.inc.php'; require_once api_get_path(SYS_CODE_PATH).'forum/forumconfig.inc.php';
@ -32,7 +29,7 @@ $user_id = api_get_user_id();
$current_group = GroupManager :: get_group_properties($group_id); $current_group = GroupManager :: get_group_properties($group_id);
if (empty($current_group)) { if (empty($current_group)) {
api_not_allowed(true); api_not_allowed(true);
} }
$this_section = SECTION_COURSES; $this_section = SECTION_COURSES;
@ -45,11 +42,11 @@ $forums_of_groups = get_forums_of_group($current_group['id']);
$forum_state_public = 0; $forum_state_public = 0;
if (is_array($forums_of_groups)) { if (is_array($forums_of_groups)) {
foreach ($forums_of_groups as $key => $value) { foreach ($forums_of_groups as $key => $value) {
if ($value['forum_group_public_private'] == 'public') { if ($value['forum_group_public_private'] == 'public') {
$forum_state_public = 1; $forum_state_public = 1;
} }
} }
} }
if ($current_group['doc_state'] != 1 && if ($current_group['doc_state'] != 1 &&
@ -60,10 +57,10 @@ if ($current_group['doc_state'] != 1 &&
$current_group['chat_state'] != 1 && $current_group['chat_state'] != 1 &&
$forum_state_public != 1 $forum_state_public != 1
) { ) {
if (!api_is_allowed_to_edit(null,true) && if (!api_is_allowed_to_edit(null,true) &&
!GroupManager::is_user_in_group($user_id, $group_id)) { !GroupManager::is_user_in_group($user_id, $group_id)) {
api_not_allowed($print_headers); api_not_allowed($print_headers);
} }
} }
/* Header */ /* Header */
@ -79,7 +76,9 @@ Display::display_introduction_section(TOOL_GROUP);
/* /*
* User wants to register in this group * User wants to register in this group
*/ */
if (!empty($_GET['selfReg']) && GroupManager :: is_self_registration_allowed($user_id, $current_group['id'])) { if (!empty($_GET['selfReg']) &&
GroupManager :: is_self_registration_allowed($user_id, $current_group['id'])
) {
GroupManager :: subscribe_users($user_id, $current_group['id']); GroupManager :: subscribe_users($user_id, $current_group['id']);
Display :: display_normal_message(get_lang('GroupNowMember')); Display :: display_normal_message(get_lang('GroupNowMember'));
} }
@ -87,20 +86,24 @@ if (!empty($_GET['selfReg']) && GroupManager :: is_self_registration_allowed($us
/* /*
* User wants to unregister from this group * User wants to unregister from this group
*/ */
if (!empty($_GET['selfUnReg']) && GroupManager :: is_self_unregistration_allowed($user_id, $current_group['id'])) { if (!empty($_GET['selfUnReg']) &&
GroupManager :: is_self_unregistration_allowed($user_id, $current_group['id'])
) {
GroupManager :: unsubscribe_users($user_id, $current_group['id']); GroupManager :: unsubscribe_users($user_id, $current_group['id']);
Display::display_normal_message(get_lang('StudentDeletesHimself')); Display::display_normal_message(get_lang('StudentDeletesHimself'));
} }
echo '<div class="actions">'; echo '<div class="actions">';
echo '<a href="group.php">'.Display::return_icon('back.png',get_lang('BackToGroupList'),'',ICON_SIZE_MEDIUM).'</a>'; echo '<a href="group.php">'.
Display::return_icon('back.png',get_lang('BackToGroupList'),'',ICON_SIZE_MEDIUM).
'</a>';
/* /*
* Register to group * Register to group
*/ */
$subscribe_group = ''; $subscribe_group = '';
if (GroupManager :: is_self_registration_allowed($user_id, $current_group['id'])) { if (GroupManager :: is_self_registration_allowed($user_id, $current_group['id'])) {
$subscribe_group = '<a class="btn" href="'.api_get_self().'?selfReg=1&amp;group_id='.$current_group['id'].'" onclick="javascript: if(!confirm('."'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"), ENT_QUOTES))."'".')) return false;">'. $subscribe_group = '<a class="btn" href="'.api_get_self().'?selfReg=1&amp;group_id='.$current_group['id'].'" onclick="javascript: if(!confirm('."'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"), ENT_QUOTES))."'".')) return false;">'.
get_lang("RegIntoGroup").'</a>'; get_lang("RegIntoGroup").'</a>';
} }
@ -109,17 +112,17 @@ if (GroupManager :: is_self_registration_allowed($user_id, $current_group['id'])
*/ */
$unsubscribe_group = ''; $unsubscribe_group = '';
if (GroupManager :: is_self_unregistration_allowed($user_id, $current_group['id'])) { if (GroupManager :: is_self_unregistration_allowed($user_id, $current_group['id'])) {
$unsubscribe_group = '<a class="btn" href="'.api_get_self().'?selfUnReg=1" onclick="javascript: if(!confirm('."'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES))."'".')) return false;">'. $unsubscribe_group = '<a class="btn" href="'.api_get_self().'?selfUnReg=1" onclick="javascript: if(!confirm('."'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES))."'".')) return false;">'.
get_lang("StudentUnsubscribe").'</a>'; get_lang("StudentUnsubscribe").'</a>';
} }
echo '&nbsp;</div>'; echo '&nbsp;</div>';
if (isset($_GET['action'])) { if (isset($_GET['action'])) {
switch ($_GET['action']) { switch ($_GET['action']) {
case 'show_msg': case 'show_msg':
Display::display_normal_message(Security::remove_XSS($_GET['msg'])); Display::display_normal_message(Security::remove_XSS($_GET['msg']));
break; break;
} }
} }
/* Main Display Area */ /* Main Display Area */
@ -146,7 +149,7 @@ echo Display::page_header(
); );
if (!empty($current_group['description'])) { if (!empty($current_group['description'])) {
echo '<p>'.Security::remove_XSS($current_group['description']).'</p>'; echo '<p>'.Security::remove_XSS($current_group['description']).'</p>';
} }
/* /*
@ -160,11 +163,11 @@ if (api_is_allowed_to_edit(false, true) OR
// Link to the forum of this group // Link to the forum of this group
$forums_of_groups = get_forums_of_group($current_group['id']); $forums_of_groups = get_forums_of_group($current_group['id']);
if (is_array($forums_of_groups)) { if (is_array($forums_of_groups)) {
if ($current_group['forum_state'] != GroupManager::TOOL_NOT_AVAILABLE ) { if ($current_group['forum_state'] != GroupManager::TOOL_NOT_AVAILABLE ) {
foreach ($forums_of_groups as $key => $value) { foreach ($forums_of_groups as $key => $value) {
//*!empty($user_subscribe_to_current_group) && */ //*!empty($user_subscribe_to_current_group) && */
if ($value['forum_group_public_private'] == 'public' || if ($value['forum_group_public_private'] == 'public' ||
($value['forum_group_public_private'] == 'private') || ($value['forum_group_public_private'] == 'private') ||
!empty($user_is_tutor) || !empty($user_is_tutor) ||
api_is_allowed_to_edit(false, true) api_is_allowed_to_edit(false, true)
@ -172,139 +175,144 @@ if (api_is_allowed_to_edit(false, true) OR
$actions_array[] = array( $actions_array[] = array(
'url' => '../forum/viewforum.php?forum='.$value['forum_id'].'&gidReq='.Security::remove_XSS($current_group['id']).'&amp;origin=group', 'url' => '../forum/viewforum.php?forum='.$value['forum_id'].'&gidReq='.Security::remove_XSS($current_group['id']).'&amp;origin=group',
'content' => Display::return_icon('forum.png', get_lang('Forum').': '.$value['forum_title'] , array(), 32) 'content' => Display::return_icon('forum.png', get_lang('Forum').': '.$value['forum_title'] , array(), 32)
); );
} }
} }
} }
} }
if ($current_group['doc_state'] != GroupManager::TOOL_NOT_AVAILABLE) { if ($current_group['doc_state'] != GroupManager::TOOL_NOT_AVAILABLE) {
// Link to the documents area of this group // Link to the documents area of this group
$actions_array[] = array( $actions_array[] = array(
'url' => '../document/document.php?'.api_get_cidreq(), 'url' => '../document/document.php?'.api_get_cidreq(),
'content' => Display::return_icon('folder.png', get_lang('GroupDocument'), array(), 32) '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) {
// Link to a group-specific part of agenda
$groupFilter = null;
if (!empty($group_id)) {
$groupFilter = "&type=course&user_id=GROUP:$group_id";
}
// Link to a group-specific part of agenda
$actions_array[] = array( $actions_array[] = array(
'url' => '../calendar/agenda.php?'.api_get_cidreq(), 'url' => '../calendar/agenda_js.php?'.api_get_cidreq().$groupFilter,
'content' => Display::return_icon('agenda.png', get_lang('GroupCalendar'), array(), 32) 'content' => Display::return_icon('agenda.png', get_lang('GroupCalendar'), array(), 32)
); );
} }
if ($current_group['work_state'] != GroupManager::TOOL_NOT_AVAILABLE) { if ($current_group['work_state'] != GroupManager::TOOL_NOT_AVAILABLE) {
// Link to the works area of this group // Link to the works area of this group
$actions_array[] = array( $actions_array[] = array(
'url' => '../work/work.php?'.api_get_cidreq(), 'url' => '../work/work.php?'.api_get_cidreq(),
'content' => Display::return_icon('work.png', get_lang('GroupWork'), array(), 32) 'content' => Display::return_icon('work.png', get_lang('GroupWork'), array(), 32)
); );
} }
if ($current_group['announcements_state'] != GroupManager::TOOL_NOT_AVAILABLE) { if ($current_group['announcements_state'] != GroupManager::TOOL_NOT_AVAILABLE) {
// Link to a group-specific part of announcements // Link to a group-specific part of announcements
$actions_array[] = array( $actions_array[] = array(
'url' => '../announcements/announcements.php?'.api_get_cidreq(), 'url' => '../announcements/announcements.php?'.api_get_cidreq(),
'content' => Display::return_icon('announce.png', get_lang('GroupAnnouncements'), array(), 32) 'content' => Display::return_icon('announce.png', get_lang('GroupAnnouncements'), array(), 32)
); );
} }
if ($current_group['wiki_state'] != GroupManager::TOOL_NOT_AVAILABLE) { if ($current_group['wiki_state'] != GroupManager::TOOL_NOT_AVAILABLE) {
// Link to the wiki area of this group // Link to the wiki area of this group
$actions_array[] = array( $actions_array[] = array(
'url' => '../wiki/index.php?'.api_get_cidreq().'&amp;action=show&amp;title=index&amp;session_id='.api_get_session_id().'&amp;group_id='.$current_group['id'], 'url' => '../wiki/index.php?'.api_get_cidreq().'&amp;action=show&amp;title=index&amp;session_id='.api_get_session_id().'&amp;group_id='.$current_group['id'],
'content' => Display::return_icon('wiki.png', get_lang('GroupWiki'), array(), 32) 'content' => Display::return_icon('wiki.png', get_lang('GroupWiki'), array(), 32)
); );
} }
if ($current_group['chat_state'] != GroupManager::TOOL_NOT_AVAILABLE) { if ($current_group['chat_state'] != GroupManager::TOOL_NOT_AVAILABLE) {
// Link to the chat area of this group // Link to the chat area of this group
if (api_get_course_setting('allow_open_chat_window')) { if (api_get_course_setting('allow_open_chat_window')) {
$actions_array[] = array( $actions_array[] = array(
'url' => "javascript: void(0);\" onclick=\"window.open('../chat/chat.php?".api_get_cidreq()."&amp;toolgroup=".$current_group['id']."','window_chat_group_".$_SESSION['_cid']."_".$_SESSION['_gid']."','height=380, width=625, left=2, top=2, toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, directories=no, status=no') \"", 'url' => "javascript: void(0);\" onclick=\"window.open('../chat/chat.php?".api_get_cidreq()."&amp;toolgroup=".$current_group['id']."','window_chat_group_".$_SESSION['_cid']."_".$_SESSION['_gid']."','height=380, width=625, left=2, top=2, toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, directories=no, status=no') \"",
'content' => Display::return_icon('chat.png', get_lang('Chat'), array(), 32) 'content' => Display::return_icon('chat.png', get_lang('Chat'), array(), 32)
); );
} else { } else {
$actions_array[] = array( $actions_array[] = array(
'url' => "../chat/chat.php?".api_get_cidreq()."&amp;toolgroup=".$current_group['id'], 'url' => "../chat/chat.php?".api_get_cidreq()."&amp;toolgroup=".$current_group['id'],
'content' => Display::return_icon('chat.png', get_lang('Chat'), array(), 32) 'content' => Display::return_icon('chat.png', get_lang('Chat'), array(), 32)
); );
} }
} }
if (!empty($actions_array)) { if (!empty($actions_array)) {
echo Display::actions($actions_array); echo Display::actions($actions_array);
} }
} else { } else {
$actions_array = array(); $actions_array = array();
// Link to the forum of this group // Link to the forum of this group
$forums_of_groups = get_forums_of_group($current_group['id']); $forums_of_groups = get_forums_of_group($current_group['id']);
if (is_array($forums_of_groups)) { if (is_array($forums_of_groups)) {
if ( $current_group['forum_state'] == GroupManager::TOOL_PUBLIC ) { if ( $current_group['forum_state'] == GroupManager::TOOL_PUBLIC ) {
foreach ($forums_of_groups as $key => $value) { foreach ($forums_of_groups as $key => $value) {
if ($value['forum_group_public_private'] == 'public' ) { if ($value['forum_group_public_private'] == 'public' ) {
$actions_array[] = array( $actions_array[] = array(
'url' => '../forum/viewforum.php?cidReq='.api_get_course_id().'&forum='.$value['forum_id'].'&gidReq='.Security::remove_XSS($current_group['id']).'&amp;origin=group', 'url' => '../forum/viewforum.php?cidReq='.api_get_course_id().'&forum='.$value['forum_id'].'&gidReq='.Security::remove_XSS($current_group['id']).'&amp;origin=group',
'content' => Display::return_icon('forum.png', get_lang('GroupForum'), array(), ICON_SIZE_MEDIUM) 'content' => Display::return_icon('forum.png', get_lang('GroupForum'), array(), ICON_SIZE_MEDIUM)
); );
} }
} }
} }
} }
if ($current_group['doc_state'] == GroupManager::TOOL_PUBLIC) { if ($current_group['doc_state'] == GroupManager::TOOL_PUBLIC) {
// Link to the documents area of this group // Link to the documents area of this group
$actions_array[] = array( $actions_array[] = array(
'url' => '../document/document.php?'.api_get_cidreq().'&amp;origin='.$origin, 'url' => '../document/document.php?'.api_get_cidreq().'&amp;origin='.$origin,
'content' => Display::return_icon('folder.png', get_lang('GroupDocument'), array(), ICON_SIZE_MEDIUM) 'content' => Display::return_icon('folder.png', get_lang('GroupDocument'), array(), ICON_SIZE_MEDIUM)
); );
} }
if ($current_group['calendar_state'] == GroupManager::TOOL_PUBLIC) { if ($current_group['calendar_state'] == GroupManager::TOOL_PUBLIC) {
// Link to a group-specific part of agenda // Link to a group-specific part of agenda
$actions_array[] = array( $actions_array[] = array(
'url' => '../calendar/agenda.php?'.api_get_cidreq(), 'url' => '../calendar/agenda.php?'.api_get_cidreq(),
'content' => Display::return_icon('agenda.png', get_lang('GroupCalendar'), array(), ICON_SIZE_MEDIUM) 'content' => Display::return_icon('agenda.png', get_lang('GroupCalendar'), array(), ICON_SIZE_MEDIUM)
); );
} }
if ($current_group['work_state'] == GroupManager::TOOL_PUBLIC) { if ($current_group['work_state'] == GroupManager::TOOL_PUBLIC) {
// Link to the works area of this group // Link to the works area of this group
$actions_array[] = array( $actions_array[] = array(
'url' => '../work/work.php?'.api_get_cidreq(), 'url' => '../work/work.php?'.api_get_cidreq(),
'content' => Display::return_icon('work.png', get_lang('GroupWork'), array(), ICON_SIZE_MEDIUM) 'content' => Display::return_icon('work.png', get_lang('GroupWork'), array(), ICON_SIZE_MEDIUM)
); );
} }
if ($current_group['announcements_state'] == GroupManager::TOOL_PUBLIC) { if ($current_group['announcements_state'] == GroupManager::TOOL_PUBLIC) {
// Link to a group-specific part of announcements // Link to a group-specific part of announcements
$actions_array[] = array( $actions_array[] = array(
'url' => '../announcements/announcements.php?'.api_get_cidreq(), 'url' => '../announcements/announcements.php?'.api_get_cidreq(),
'content' => Display::return_icon('announce.png', get_lang('GroupAnnouncements'), array(), ICON_SIZE_MEDIUM) 'content' => Display::return_icon('announce.png', get_lang('GroupAnnouncements'), array(), ICON_SIZE_MEDIUM)
); );
} }
if ($current_group['wiki_state'] == GroupManager::TOOL_PUBLIC) { if ($current_group['wiki_state'] == GroupManager::TOOL_PUBLIC) {
// Link to the wiki area of this group // Link to the wiki area of this group
$actions_array[] = array( $actions_array[] = array(
'url' => '../wiki/index.php?'.api_get_cidreq().'&amp;action=show&amp;title=index&amp;session_id='.api_get_session_id().'&amp;group_id='.$current_group['id'], 'url' => '../wiki/index.php?'.api_get_cidreq().'&amp;action=show&amp;title=index&amp;session_id='.api_get_session_id().'&amp;group_id='.$current_group['id'],
'content' => Display::return_icon('wiki.png', get_lang('GroupWiki'), array(), 32) 'content' => Display::return_icon('wiki.png', get_lang('GroupWiki'), array(), 32)
); );
} }
if ($current_group['chat_state'] == GroupManager::TOOL_PUBLIC ) { if ($current_group['chat_state'] == GroupManager::TOOL_PUBLIC ) {
// Link to the chat area of this group // Link to the chat area of this group
if (api_get_course_setting('allow_open_chat_window')) { if (api_get_course_setting('allow_open_chat_window')) {
$actions_array[] = array( $actions_array[] = array(
'url' => "javascript: void(0);\" onclick=\"window.open('../chat/chat.php?".api_get_cidreq()."&amp;toolgroup=".$current_group['id']."','window_chat_group_".$_SESSION['_cid']."_".$_SESSION['_gid']."','height=380, width=625, left=2, top=2, toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, directories=no, status=no') \"", 'url' => "javascript: void(0);\" onclick=\"window.open('../chat/chat.php?".api_get_cidreq()."&amp;toolgroup=".$current_group['id']."','window_chat_group_".$_SESSION['_cid']."_".$_SESSION['_gid']."','height=380, width=625, left=2, top=2, toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, directories=no, status=no') \"",
'content' => Display::return_icon('chat.png', get_lang('Chat'), array(), 32) 'content' => Display::return_icon('chat.png', get_lang('Chat'), array(), 32)
); );
} else { } else {
$actions_array[] = array( $actions_array[] = array(
'url' => "../chat/chat.php?".api_get_cidreq()."&amp;toolgroup=".$current_group['id'], 'url' => "../chat/chat.php?".api_get_cidreq()."&amp;toolgroup=".$current_group['id'],
'content' => Display::return_icon('chat.png', get_lang('Chat'), array(), 32) 'content' => Display::return_icon('chat.png', get_lang('Chat'), array(), 32)
); );
} }
} }
if (!empty($actions_array)) { if (!empty($actions_array)) {
echo Display::actions($actions_array); echo Display::actions($actions_array);
} }
} }
/* /*
@ -314,27 +322,27 @@ $tutors = GroupManager::get_subscribed_tutors($current_group['id']);
$tutor_info = ''; $tutor_info = '';
if (count($tutors) == 0) { if (count($tutors) == 0) {
$tutor_info = get_lang('GroupNoneMasc'); $tutor_info = get_lang('GroupNoneMasc');
} else { } else {
isset($origin) ? $my_origin = $origin:$my_origin=''; isset($origin) ? $my_origin = $origin:$my_origin='';
$tutor_info .= '<ul class="thumbnails">'; $tutor_info .= '<ul class="thumbnails">';
foreach ($tutors as $index => $tutor) { foreach ($tutors as $index => $tutor) {
$tab_user_info = api_get_user_info($tutor['user_id']); $tab_user_info = api_get_user_info($tutor['user_id']);
$username = api_htmlentities(sprintf(get_lang('LoginX'), $tab_user_info['username']), ENT_QUOTES); $username = api_htmlentities(sprintf(get_lang('LoginX'), $tab_user_info['username']), ENT_QUOTES);
$image_path = UserManager::get_user_picture_path_by_id($tutor['user_id'], 'web', false, true); $image_path = UserManager::get_user_picture_path_by_id($tutor['user_id'], 'web', false, true);
$image_repository = $image_path['dir']; $image_repository = $image_path['dir'];
$existing_image = $image_path['file']; $existing_image = $image_path['file'];
$completeName = api_get_person_name($tutor['firstname'], $tutor['lastname']); $completeName = api_get_person_name($tutor['firstname'], $tutor['lastname']);
$photo = '<img src="'.$image_repository.$existing_image.'" alt="'.$completeName.'" width="32" height="32" title="'.$completeName.'" />'; $photo = '<img src="'.$image_repository.$existing_image.'" alt="'.$completeName.'" width="32" height="32" title="'.$completeName.'" />';
$tutor_info .= '<li><a href="'.api_get_path(WEB_CODE_PATH).'user/userInfo.php?origin='.$my_origin.'&amp;uInfo='.$tutor['user_id'].'">'. $tutor_info .= '<li><a href="'.api_get_path(WEB_CODE_PATH).'user/userInfo.php?origin='.$my_origin.'&amp;uInfo='.$tutor['user_id'].'">'.
$photo.'&nbsp;'.$completeName.'</a></li>'; $photo.'&nbsp;'.$completeName.'</a></li>';
} }
$tutor_info .= '</ul>'; $tutor_info .= '</ul>';
} }
echo Display::page_subheader(get_lang('GroupTutors')); echo Display::page_subheader(get_lang('GroupTutors'));
if (!empty($tutor_info)) { if (!empty($tutor_info)) {
echo $tutor_info; echo $tutor_info;
} }
echo '<br />'; echo '<br />';
@ -351,21 +359,21 @@ $parameters = array('cidReq' => $my_cidreq, 'origin'=> $my_origin, 'gidReq' => $
$table->set_additional_parameters($parameters); $table->set_additional_parameters($parameters);
$table->set_header(0, ''); $table->set_header(0, '');
if (api_is_western_name_order()) { if (api_is_western_name_order()) {
$table->set_header(1, get_lang('FirstName')); $table->set_header(1, get_lang('FirstName'));
$table->set_header(2, get_lang('LastName')); $table->set_header(2, get_lang('LastName'));
} else { } else {
$table->set_header(1, get_lang('LastName')); $table->set_header(1, get_lang('LastName'));
$table->set_header(2, get_lang('FirstName')); $table->set_header(2, get_lang('FirstName'));
} }
if (api_get_setting('show_email_addresses') == 'true') { if (api_get_setting('show_email_addresses') == 'true') {
$table->set_header(3, get_lang('Email')); $table->set_header(3, get_lang('Email'));
$table->set_column_filter(3, 'email_filter'); $table->set_column_filter(3, 'email_filter');
} else { } else {
if (api_is_allowed_to_edit() == 'true') { if (api_is_allowed_to_edit() == 'true') {
$table->set_header(3, get_lang('Email')); $table->set_header(3, get_lang('Email'));
$table->set_column_filter(3, 'email_filter'); $table->set_column_filter(3, 'email_filter');
} }
} }
//the order of these calls is important //the order of these calls is important
$table->set_column_filter(1, 'user_name_filter'); $table->set_column_filter(1, 'user_name_filter');
@ -381,19 +389,21 @@ $table->display();
* @author Patrick Cool <patrick.cool@UGent.be>, Ghent University, Belgium * @author Patrick Cool <patrick.cool@UGent.be>, Ghent University, Belgium
* @version April 2008 * @version April 2008
*/ */
function get_number_of_group_users() { function get_number_of_group_users()
global $current_group; {
global $current_group;
$course_id = api_get_course_int_id(); $course_id = api_get_course_int_id();
// Database table definition // Database table definition
$table_group_user = Database :: get_course_table(TABLE_GROUP_USER); $table_group_user = Database :: get_course_table(TABLE_GROUP_USER);
// Query // Query
$sql = "SELECT count(id) AS number_of_users FROM ".$table_group_user." $sql = "SELECT count(id) AS number_of_users
WHERE c_id = $course_id AND group_id='".Database::escape_string($current_group['id'])."'"; FROM ".$table_group_user."
$result = Database::query($sql); WHERE c_id = $course_id AND group_id='".Database::escape_string($current_group['id'])."'";
$return = Database::fetch_array($result,'ASSOC'); $result = Database::query($sql);
return $return['number_of_users']; $return = Database::fetch_array($result,'ASSOC');
return $return['number_of_users'];
} }
/** /**
@ -408,80 +418,82 @@ function get_number_of_group_users() {
* @author Patrick Cool <patrick.cool@UGent.be>, Ghent University, Belgium * @author Patrick Cool <patrick.cool@UGent.be>, Ghent University, Belgium
* @version April 2008 * @version April 2008
*/ */
function get_group_user_data($from, $number_of_items, $column, $direction) { function get_group_user_data($from, $number_of_items, $column, $direction)
global $current_group; {
global $current_group;
// Database table definition // Database table definition
$table_group_user = Database :: get_course_table(TABLE_GROUP_USER); $table_group_user = Database :: get_course_table(TABLE_GROUP_USER);
$table_user = Database :: get_main_table(TABLE_MAIN_USER); $table_user = Database :: get_main_table(TABLE_MAIN_USER);
$course_id = api_get_course_int_id(); $course_id = api_get_course_int_id();
// Query // Query
if (api_get_setting('show_email_addresses') == 'true') { if (api_get_setting('show_email_addresses') == 'true') {
$sql = "SELECT user.user_id AS col0, $sql = "SELECT user.user_id AS col0,
".(api_is_western_name_order() ? ".(api_is_western_name_order() ?
"user.firstname AS col1, "user.firstname AS col1,
user.lastname AS col2," user.lastname AS col2,"
: :
"user.lastname AS col1, "user.lastname AS col1,
user.firstname AS col2," user.firstname AS col2,"
)." )."
user.email AS col3 user.email AS col3
FROM ".$table_user." user, ".$table_group_user." group_rel_user 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.user_id WHERE group_rel_user.c_id = $course_id AND group_rel_user.user_id = user.user_id
AND group_rel_user.group_id = '".Database::escape_string($current_group['id'])."'"; AND group_rel_user.group_id = '".Database::escape_string($current_group['id'])."'";
$sql .= " ORDER BY col$column $direction "; $sql .= " ORDER BY col$column $direction ";
$sql .= " LIMIT $from,$number_of_items"; $sql .= " LIMIT $from,$number_of_items";
} else { } else {
if (api_is_allowed_to_edit()) { if (api_is_allowed_to_edit()) {
$sql = "SELECT DISTINCT $sql = "SELECT DISTINCT
u.user_id AS col0, u.user_id AS col0,
".(api_is_western_name_order() ? ".(api_is_western_name_order() ?
"u.firstname AS col1, "u.firstname AS col1,
u.lastname AS col2," u.lastname AS col2,"
: :
"u.lastname AS col1, "u.lastname AS col1,
u.firstname AS col2," u.firstname AS col2,"
)." )."
u.email AS col3 u.email AS col3
FROM ".$table_user." u INNER JOIN ".$table_group_user." gu ON (gu.user_id = u.user_id) AND gu.c_id = $course_id FROM ".$table_user." u INNER JOIN ".$table_group_user." gu ON (gu.user_id = u.user_id) AND gu.c_id = $course_id
WHERE gu.group_id = '".Database::escape_string($current_group['id'])."'"; WHERE gu.group_id = '".Database::escape_string($current_group['id'])."'";
$sql .= " ORDER BY col$column $direction "; $sql .= " ORDER BY col$column $direction ";
$sql .= " LIMIT $from,$number_of_items"; $sql .= " LIMIT $from,$number_of_items";
} else { } else {
$sql = "SELECT DISTINCT $sql = "SELECT DISTINCT
user.user_id AS col0, user.user_id AS col0,
". (api_is_western_name_order() ? ". (api_is_western_name_order() ?
"user.firstname AS col1, "user.firstname AS col1,
user.lastname AS col2 " user.lastname AS col2 "
: :
"user.lastname AS col1, "user.lastname AS col1,
user.firstname AS col2 " user.firstname AS col2 "
)." )."
FROM ".$table_user." user, ".$table_group_user." group_rel_user 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.user_id WHERE group_rel_user.c_id = $course_id AND group_rel_user.user_id = user.user_id
AND group_rel_user.group_id = '".Database::escape_string($current_group['id'])."'"; AND group_rel_user.group_id = '".Database::escape_string($current_group['id'])."'";
$sql .= " ORDER BY col$column $direction "; $sql .= " ORDER BY col$column $direction ";
$sql .= " LIMIT $from,$number_of_items"; $sql .= " LIMIT $from,$number_of_items";
} }
} }
$return = array(); $return = array();
$result = Database::query($sql); $result = Database::query($sql);
while ($row = Database::fetch_row($result)) { while ($row = Database::fetch_row($result)) {
$return[] = $row; $return[] = $row;
} }
return $return; return $return;
} }
/** /**
* Returns a mailto-link * Returns a mailto-link
* @param string $email An email-address * @param string $email An email-address
* @return string HTML-code with a mailto-link * @return string HTML-code with a mailto-link
*/ */
function email_filter($email) { function email_filter($email)
return Display :: encrypted_mailto_link($email, $email); {
return Display :: encrypted_mailto_link($email, $email);
} }
/** /**
@ -493,14 +505,15 @@ function email_filter($email) {
* @author Patrick Cool <patrick.cool@UGent.be>, Ghent University, Belgium * @author Patrick Cool <patrick.cool@UGent.be>, Ghent University, Belgium
* @version April 2008 * @version April 2008
*/ */
function user_icon_filter($user_id) { function user_icon_filter($user_id)
global $origin; {
$userinfo = api_get_user_info($user_id); global $origin;
$image_path = UserManager::get_user_picture_path_by_id($user_id, 'web', false, true); $userinfo = api_get_user_info($user_id);
$image_repository = $image_path['dir']; $image_path = UserManager::get_user_picture_path_by_id($user_id, 'web', false, true);
$existing_image = $image_path['file']; $image_repository = $image_path['dir'];
$photo = '<center><img src="'.$image_repository.$existing_image.'" alt="'.$userinfo['complete_name'].'" width="22" height="22" title="'.$userinfo['complete_name'].'" /></center>'; $existing_image = $image_path['file'];
return '<a href="../user/userInfo.php?origin='.$origin.'&amp;uInfo='.$user_id.'">'.$photo; $photo = '<center><img src="'.$image_repository.$existing_image.'" alt="'.$userinfo['complete_name'].'" width="22" height="22" title="'.$userinfo['complete_name'].'" /></center>';
return '<a href="../user/userInfo.php?origin='.$origin.'&amp;uInfo='.$user_id.'">'.$photo;
} }
/** /**
@ -513,7 +526,8 @@ function user_icon_filter($user_id) {
* @param array Row of the "sortable table" as it is at the time of function call - we extract the user ID from there * @param array Row of the "sortable table" as it is at the time of function call - we extract the user ID from there
* @return string HTML link * @return string HTML link
*/ */
function user_name_filter($name, $url_params, $row) { function user_name_filter($name, $url_params, $row)
{
$tab_user_info = api_get_user_info($row[0]); $tab_user_info = api_get_user_info($row[0]);
$username = api_htmlentities(sprintf(get_lang('LoginX'), $tab_user_info['username']), ENT_QUOTES); $username = api_htmlentities(sprintf(get_lang('LoginX'), $tab_user_info['username']), ENT_QUOTES);
return '<a href="../user/userInfo.php?uInfo='.$row[0].'&amp;'.$url_params.'" title="'.$username.'">'.$name.'</a>'; return '<a href="../user/userInfo.php?uInfo='.$row[0].'&amp;'.$url_params.'" title="'.$username.'">'.$name.'</a>';
@ -522,5 +536,5 @@ function user_name_filter($name, $url_params, $row) {
// Footer // Footer
$orig = isset($origin) ? $origin : ''; $orig = isset($origin) ? $origin : '';
if ($orig != 'learnpath') { if ($orig != 'learnpath') {
Display::display_footer(); Display::display_footer();
} }

@ -578,10 +578,36 @@ switch ($action) {
case 'get_work_user_list_all': case 'get_work_user_list_all':
if (isset($_GET['type']) && $_GET['type'] == 'simple') { if (isset($_GET['type']) && $_GET['type'] == 'simple') {
$columns = array( $columns = array(
'type', 'firstname', 'lastname', 'title', 'qualification', 'sent_date', 'qualificator_id', 'actions' 'type',
'firstname',
'lastname',
'title',
'qualification',
'sent_date',
'qualificator_id',
'actions'
); );
} else { } else {
$columns = array('type', 'firstname', 'lastname', 'title', 'sent_date', 'actions');
$columns = array(
'type',
'firstname',
'lastname',
'title',
'sent_date',
'actions'
);
if (ALLOW_USER_COMMENTS) {
$columns = array(
'type',
'firstname',
'lastname',
'title',
'qualification',
'sent_date',
'actions'
);
}
} }
$result = get_work_user_list($start, $limit, $sidx, $sord, $work_id, $whereCondition); $result = get_work_user_list($start, $limit, $sidx, $sord, $work_id, $whereCondition);
break; break;
@ -603,6 +629,9 @@ switch ($action) {
); );
} else { } else {
$columns = array('type', 'title', 'sent_date', 'actions'); $columns = array('type', 'title', 'sent_date', 'actions');
if (ALLOW_USER_COMMENTS) {
$columns = array('type', 'title', 'qualification', 'sent_date', 'actions');
}
} }
$documents = getAllDocumentToWork($work_id, api_get_course_int_id()); $documents = getAllDocumentToWork($work_id, api_get_course_int_id());

@ -96,7 +96,7 @@ switch ($action) {
$emailbody.=api_get_person_name(api_get_setting('administratorName'), api_get_setting('administratorSurname'))."\n". get_lang('Manager'). " ".api_get_setting('siteName')."\nT. ".api_get_setting('administratorTelephone')."\n" .get_lang('Email') ." : ".api_get_setting('emailAdministrator'); $emailbody.=api_get_person_name(api_get_setting('administratorName'), api_get_setting('administratorSurname'))."\n". get_lang('Manager'). " ".api_get_setting('siteName')."\nT. ".api_get_setting('administratorTelephone')."\n" .get_lang('Email') ." : ".api_get_setting('emailAdministrator');
$additionalParameters = array( $additionalParameters = array(
'smsType' => ACCOUNT_APPROVED_CONNECT, 'smsType' => ClockworksmsPlugin::ACCOUNT_APPROVED_CONNECT,
'userId' => $user_id 'userId' => $user_id
); );

@ -2916,7 +2916,7 @@ function register_course($params)
$userInfo = api_get_user_info($user_id); $userInfo = api_get_user_info($user_id);
$additionalParameters = array( $additionalParameters = array(
'smsType' => NEW_COURSE_BEEN_CREATED, 'smsType' => ClockworksmsPlugin::NEW_COURSE_BEEN_CREATED,
'userId' => $user_id, 'userId' => $user_id,
'courseName' => $title, 'courseName' => $title,
'creatorUsername' => $userInfo['username'] 'creatorUsername' => $userInfo['username']

@ -2512,7 +2512,7 @@ class CourseManager
$email_admin = api_get_setting('emailAdministrator'); $email_admin = api_get_setting('emailAdministrator');
$additionalParameters = array( $additionalParameters = array(
'smsType' => NEW_USER_SUBSCRIBED_COURSE, 'smsType' => ClockworksmsPlugin::NEW_USER_SUBSCRIBED_COURSE,
'userId' => $tutor['user_id'], 'userId' => $tutor['user_id'],
'userUsername' => $student['username'], 'userUsername' => $student['username'],
'courseCode' => $course_code 'courseCode' => $course_code

@ -147,7 +147,7 @@ class CourseRequestManager {
$userInfo = api_get_user_info($user_id); $userInfo = api_get_user_info($user_id);
$additionalParameters = array( $additionalParameters = array(
'smsType' => NEW_COURSE_SUGGESTED_TEACHER, 'smsType' => ClockworksmsPlugin::NEW_COURSE_SUGGESTED_TEACHER,
'userId' => $user_id, 'userId' => $user_id,
'userUsername' => $userInfo['username'] 'userUsername' => $userInfo['username']
); );
@ -184,7 +184,7 @@ class CourseRequestManager {
$recipient_email_teacher = $sender_email_teacher; $recipient_email_teacher = $sender_email_teacher;
$additionalParameters = array( $additionalParameters = array(
'smsType' => COURSE_OPENING_REQUEST_CODE_REGISTERED, 'smsType' => ClockworksmsPlugin::COURSE_OPENING_REQUEST_CODE_REGISTERED,
'userId' => $user_info['user_id'], 'userId' => $user_info['user_id'],
'courseCode' => $wanted_code 'courseCode' => $wanted_code
); );
@ -452,7 +452,7 @@ class CourseRequestManager {
$extra_headers = 'Bcc: '.$sender_email; $extra_headers = 'Bcc: '.$sender_email;
$additionalParameters = array( $additionalParameters = array(
'smsType' => COURSE_OPENING_REQUEST_CODE_APPROVED, 'smsType' => ClockworksmsPlugin::COURSE_OPENING_REQUEST_CODE_APPROVED,
'userId' => $user_id, 'userId' => $user_id,
'courseCode' => $course_info['code'] 'courseCode' => $course_info['code']
); );
@ -482,9 +482,7 @@ class CourseRequestManager {
*/ */
public static function reject_course_request($id) public static function reject_course_request($id)
{ {
$id = (int)$id; $id = (int)$id;
// Retrieve request's data // Retrieve request's data
$course_request_info = self::get_course_request_info($id); $course_request_info = self::get_course_request_info($id);
if (!is_array($course_request_info)) { if (!is_array($course_request_info)) {
@ -534,7 +532,7 @@ class CourseRequestManager {
$extra_headers = 'Bcc: '.$sender_email; $extra_headers = 'Bcc: '.$sender_email;
$additionalParameters = array( $additionalParameters = array(
'smsType' => COURSE_OPENING_REQUEST_CODE_REJECTED, 'smsType' => ClockworksmsPlugin::COURSE_OPENING_REQUEST_CODE_REJECTED,
'userId' => $user_id, 'userId' => $user_id,
'courseCode' => $code 'courseCode' => $code
); );
@ -614,7 +612,7 @@ class CourseRequestManager {
$extra_headers = 'Bcc: '.$sender_email; $extra_headers = 'Bcc: '.$sender_email;
$additionalParameters = array( $additionalParameters = array(
'smsType' => COURSE_OPENING_REQUEST_CODE, 'smsType' => ClockworksmsPlugin::COURSE_OPENING_REQUEST_CODE,
'userId' => $user_id, 'userId' => $user_id,
'courseCode' => $code 'courseCode' => $code
); );

@ -1822,14 +1822,19 @@ class Tracking
if (!empty($exercise_list)) { if (!empty($exercise_list)) {
foreach ($exercise_list as $exercise_data) { foreach ($exercise_list as $exercise_data) {
$exercise_id = $exercise_data['id']; $exercise_id = $exercise_data['id'];
$best_attempt = get_best_attempt_exercise_results_per_user($user_id, $exercise_id , $course_code, $session_id); $best_attempt = get_best_attempt_exercise_results_per_user(
$user_id,
$exercise_id,
$course_code,
$session_id
);
if (!empty($best_attempt)) { if (!empty($best_attempt) && !empty($best_attempt['exe_weighting'])) {
$result += $best_attempt['exe_result']/$best_attempt['exe_weighting']; $result += $best_attempt['exe_result']/$best_attempt['exe_weighting'];
} }
} }
$result = $result/ count($exercise_list); $result = $result / count($exercise_list);
$result = round($result, 2)*100; $result = round($result, 2) * 100;
} }
return $result.'%'; return $result.'%';
@ -1979,7 +1984,7 @@ class Tracking
$row = Database::fetch_row($rs); $row = Database::fetch_row($rs);
$totalAnnouncements = $row[0]; $totalAnnouncements = $row[0];
} }
$tutor = get_user_info_by_id($teacher['id_user']); $tutor = api_get_user_info($teacher['id_user']);
$data[] = array( $data[] = array(
'course' => $course['title'], 'course' => $course['title'],
'session' => $teacher['name'], 'session' => $teacher['name'],

@ -255,5 +255,5 @@ $_configuration['system_stable'] = NEW_VERSION_STABLE;
// Aspell Settings // Aspell Settings
//$_configuration['aspell_bin'] = '/usr/bin/hunspell'; //$_configuration['aspell_bin'] = '/usr/bin/hunspell';
//$_configuration['aspell_lang'] = 'en_US'; //$_configuration['aspell_lang'] = 'en_US';
//$_configuration['aspell_opts'] = '-a --lang=$lang --encoding=utf-8 -H --rem-sgml-check=alt'; //$_configuration['aspell_opts'] = '-a -d en_GB -H -i utf-8';
//$_configuration['aspell_temp_dir'] = './'; //$_configuration['aspell_temp_dir'] = './';

@ -2,7 +2,6 @@
{# 1 column #} {# 1 column #}
{% block body %} {% block body %}
{# Plugin main top #} {# Plugin main top #}
{% if plugin_main_top %} {% if plugin_main_top %}
<div id="plugin_main_top" class="span12"> <div id="plugin_main_top" class="span12">
@ -19,7 +18,6 @@
<div class="span12"> <div class="span12">
{% include "default/layout/page_body.tpl" %} {% include "default/layout/page_body.tpl" %}
{% block content %} {% block content %}
{% if content is not null %} {% if content is not null %}
<section id="main_content"> <section id="main_content">
@ -43,4 +41,4 @@
{{ plugin_main_bottom }} {{ plugin_main_bottom }}
</div> </div>
{% endif %} {% endif %}
{% endblock %} {% endblock %}

@ -14,6 +14,8 @@
</div> <!-- end of #row" --> </div> <!-- end of #row" -->
</div> <!-- end of #main" --> </div> <!-- end of #main" -->
<div class="push"></div> <div class="push"></div>
</div> <!-- end of #page section -->
</div> <!-- end of #wrapper section -->
{% endif %} {% endif %}
{% include "default/layout/main_footer.tpl" %} {% include "default/layout/main_footer.tpl" %}
{% endblock %} {% endblock %}

@ -1,7 +1,5 @@
</div> <!-- end of #wrapper section -->
</div> <!-- end of #page section -->
{% if show_footer == true %} {% if show_footer == true %}
{% include "default/layout/footer.tpl" %} {% include "default/layout/footer.tpl" %}
{% endif %} {% endif %}
</body> </body>
</html> </html>

@ -20,7 +20,9 @@
</div> <!-- end of #row" --> </div> <!-- end of #row" -->
</div> <!-- end of #main" --> </div> <!-- end of #main" -->
<div class="push"></div> <div class="push"></div>
</div> <!-- end of #page section -->
</div> <!-- end of #wrapper section --> </div> <!-- end of #wrapper section -->
{% endif %} {% endif %}
{% include "default/layout/main_footer.tpl" %} {% include "default/layout/main_footer.tpl" %}

@ -204,7 +204,7 @@ if($register) {
} }
$additionalParameters = array( $additionalParameters = array(
'smsType' => BEEN_SUBSCRIBED_COURSE, 'smsType' => ClockworksmsPlugin::BEEN_SUBSCRIBED_COURSE,
'userId' => $user_id, 'userId' => $user_id,
'courseTitle' => $currentCourseName 'courseTitle' => $currentCourseName
); );

@ -162,7 +162,7 @@ foreach ($workPerUser as $work) {
$column++; $column++;
$score = '-'; $score = '-';
if (!empty($scoreWeight)) { if (!empty($scoreWeight)) {
$score = strip_tags($userResult['qualification']); $score = $userResult['qualification'];
} }
$table->setCellContents($row, $column, $score); $table->setCellContents($row, $column, $score);
$column++; $column++;

@ -2179,7 +2179,6 @@ function get_work_user_list(
$locked = api_resource_is_locked_by_gradebook($work_id, LINK_STUDENTPUBLICATION); $locked = api_resource_is_locked_by_gradebook($work_id, LINK_STUDENTPUBLICATION);
if (!empty($work_data)) { if (!empty($work_data)) {
if (!empty($group_id)) { if (!empty($group_id)) {
$extra_conditions = " work.post_group_id = '".intval($group_id)."' "; $extra_conditions = " work.post_group_id = '".intval($group_id)."' ";
// set to select only messages posted by the user's group // set to select only messages posted by the user's group
@ -2343,11 +2342,13 @@ function get_work_user_list(
$send_to = Portfolio::share('work', $work['id'], array('style' => 'white-space:nowrap;')); $send_to = Portfolio::share('work', $work['id'], array('style' => 'white-space:nowrap;'));
$count = getWorkCommentCount($item_id, $course_info);
$feedback = null; $feedback = null;
$count = getWorkCommentCount($item_id, $course_info);
if (!is_null($count)) { if (!is_null($count) && !empty($count)) {
$feedback = ' <br /><a href="'.$url.'view.php?'.api_get_cidreq().'&id='.$item_id.'" title="'.get_lang('View').'">'. if ($qualification_exists) {
$feedback .= "<br />";
}
$feedback .= '<a href="'.$url.'view.php?'.api_get_cidreq().'&id='.$item_id.'" title="'.get_lang('View').'">'.
Display::label($count.' '.get_lang('Feedback'), 'info').'</a> '; Display::label($count.' '.get_lang('Feedback'), 'info').'</a> ';
} }
@ -2503,7 +2504,7 @@ function send_email_on_homework_creation($course_id)
$emailbody .= "\n\n".api_get_person_name($currentUser["firstname"], $currentUser["lastname"]); $emailbody .= "\n\n".api_get_person_name($currentUser["firstname"], $currentUser["lastname"]);
$additionalParameters = array( $additionalParameters = array(
'smsType' => ASSIGNMENT_BEEN_CREATED_COURSE, 'smsType' => ClockworksmsPlugin::ASSIGNMENT_BEEN_CREATED_COURSE,
'userId' => $student["user_id"], 'userId' => $student["user_id"],
'courseTitle' => $course_id 'courseTitle' => $course_id
); );

@ -223,9 +223,9 @@ switch ($action) {
'success' 'success'
); );
Session::write('message', $message); Session::write('message', $message);
header('Location: '.$currentUrl);
exit;
} }
header('Location: '.$currentUrl);
exit;
} }
break; break;
case 'move': case 'move':

@ -124,7 +124,7 @@ if (!empty($work_data['enable_qualification']) && !empty($check_qualification))
get_lang('Actions') get_lang('Actions')
); );
$column_model = array ( $column_model = array(
array('name'=>'type', 'index'=>'file', 'width'=>'5', 'align'=>'left', 'search' => 'false', 'sortable' => 'false'), array('name'=>'type', 'index'=>'file', 'width'=>'5', 'align'=>'left', 'search' => 'false', 'sortable' => 'false'),
array('name'=>'title', 'index'=>'title', 'width'=>'40', 'align'=>'left', 'search' => 'false', 'wrap_cell' => 'true'), array('name'=>'title', 'index'=>'title', 'width'=>'40', 'align'=>'left', 'search' => 'false', 'wrap_cell' => 'true'),
array('name'=>'qualification', 'index'=>'qualification', 'width'=>'10', 'align'=>'left', 'search' => 'true'), array('name'=>'qualification', 'index'=>'qualification', 'width'=>'10', 'align'=>'left', 'search' => 'true'),
@ -135,30 +135,45 @@ if (!empty($work_data['enable_qualification']) && !empty($check_qualification))
} else { } else {
$type = 'complex'; $type = 'complex';
$columns = array( $columns = array(
get_lang('Type'), get_lang('Type'),
get_lang('Title'), get_lang('Title'),
get_lang('Date'), get_lang('Date'),
get_lang('Actions') get_lang('Actions')
); );
$column_model = array ( $column_model = array(
array('name'=>'type', 'index'=>'file', 'width'=>'5', 'align'=>'left', 'search' => 'false', 'sortable' => 'false'), array('name'=>'type', 'index'=>'file', 'width'=>'5', 'align'=>'left', 'search' => 'false', 'sortable' => 'false'),
array('name'=>'title', 'index'=>'title', 'width'=>'60', 'align'=>'left', 'search' => 'false', 'wrap_cell' => "true"), array('name'=>'title', 'index'=>'title', 'width'=>'60', 'align'=>'left', 'search' => 'false', 'wrap_cell' => "true"),
array('name'=>'sent_date', 'index'=>'sent_date', 'width'=>'30', 'align'=>'left', 'search' => 'true', 'wrap_cell' => 'true', 'sortable'=>'false'), array('name'=>'sent_date', 'index'=>'sent_date', 'width'=>'30', 'align'=>'left', 'search' => 'true', 'wrap_cell' => 'true', 'sortable'=>'false'),
array('name'=>'actions', 'index'=>'actions', 'width'=>'20', 'align'=>'left', 'search' => 'false', 'sortable'=>'false') array('name'=>'actions', 'index'=>'actions', 'width'=>'20', 'align'=>'left', 'search' => 'false', 'sortable'=>'false')
); );
}
$extra_params = array(); if (ALLOW_USER_COMMENTS) {
$columns = array(
get_lang('Type'),
get_lang('Title'),
get_lang('Feedback'),
get_lang('Date'),
get_lang('Actions')
);
// Auto width $column_model = array(
$extra_params['autowidth'] = 'true'; array('name'=>'type', 'index'=>'file', 'width'=>'5', 'align'=>'left', 'search' => 'false', 'sortable' => 'false'),
array('name'=>'title', 'index'=>'title', 'width'=>'60', 'align'=>'left', 'search' => 'false', 'wrap_cell' => "true"),
array('name'=>'qualification', 'index'=>'qualification', 'width'=>'10', 'align'=>'left', 'search' => 'true'),
array('name'=>'sent_date', 'index'=>'sent_date', 'width'=>'30', 'align'=>'left', 'search' => 'true', 'wrap_cell' => 'true', 'sortable'=>'false'),
array('name'=>'actions', 'index'=>'actions', 'width'=>'20', 'align'=>'left', 'search' => 'false', 'sortable'=>'false')
);
}
}
// Height $extra_params = array(
$extra_params['height'] = 'auto'; 'autowidth' => 'true',
'height' => 'auto',
'sortname' => 'firstname'
);
$extra_params['sortname'] = 'firstname';
$url = api_get_path(WEB_AJAX_PATH).'model.ajax.php?a=get_work_user_list&work_id='.$workId.'&type='.$type; $url = api_get_path(WEB_AJAX_PATH).'model.ajax.php?a=get_work_user_list&work_id='.$workId.'&type='.$type;
?> ?>
<script> <script>

@ -35,7 +35,10 @@ if (!api_is_allowed_to_edit()) {
$tool_name = get_lang('StudentPublications'); $tool_name = get_lang('StudentPublications');
$group_id = api_get_group_id(); $group_id = api_get_group_id();
$courseInfo = api_get_course_info(); $courseInfo = api_get_course_info();
$courseCode = $courseInfo['code'];
$sessionId = api_get_session_id();
$htmlHeadXtra[] = api_get_jqgrid_js(); $htmlHeadXtra[] = api_get_jqgrid_js();
$user_id = api_get_user_id();
if (!empty($group_id)) { if (!empty($group_id)) {
$group_properties = GroupManager :: get_group_properties($group_id); $group_properties = GroupManager :: get_group_properties($group_id);
@ -57,12 +60,12 @@ if (!empty($group_id)) {
} }
$interbreadcrumb[] = array( $interbreadcrumb[] = array(
'url' => api_get_path(WEB_CODE_PATH).'group/group.php', 'url' => api_get_path(WEB_CODE_PATH).'group/group.php?'.api_get_cidreq(),
'name' => get_lang('Groups') 'name' => get_lang('Groups')
); );
$interbreadcrumb[] = array( $interbreadcrumb[] = array(
'url' => api_get_path(WEB_CODE_PATH).'group/group_space.php?gidReq='.$group_id, 'url' => api_get_path(WEB_CODE_PATH).'group/group_space.php?'.api_get_cidreq(),
'name' => get_lang('GroupSpace').' '.$group_properties['name'] 'name' => get_lang('GroupSpace').' '.$group_properties['name']
); );
} }
@ -78,58 +81,117 @@ $interbreadcrumb[] = array(
$error_message = null; $error_message = null;
Display :: display_header(null);
$action = isset($_REQUEST['action']) ? $_REQUEST['action'] : null; $action = isset($_REQUEST['action']) ? $_REQUEST['action'] : null;
$item_id = isset($_REQUEST['item_id']) ? intval($_REQUEST['item_id']) : null; $itemId = isset($_REQUEST['item_id']) ? intval($_REQUEST['item_id']) : null;
$message = null;
switch ($action) {
case 'delete':
/* Delete document */
if ($itemId) {
$fileDeleted = deleteWorkItem($itemId, $courseInfo);
if (!$fileDeleted) {
$message = Display::return_message(get_lang('YouAreNotAllowedToDeleteThisDocument'), 'error');
} else {
$message = Display::return_message(get_lang('TheDocumentHasBeenDeleted'), 'confirmation');
}
}
break;
case 'make_visible':
/* Visible */
if ($is_allowed_to_edit) {
if (!empty($itemId)) {
if (isset($itemId) && $itemId == 'all') {
} else {
makeVisible($itemId, $courseInfo);
$message = Display::return_message(get_lang('FileVisible'), 'confirmation');
}
}
}
break;
case 'make_invisible':
/* Invisible */
if (!empty($itemId)) {
if (isset($itemId) && $itemId == 'all') {
} else {
makeInvisible($itemId, $courseInfo);
$message = Display::return_message(get_lang('FileInvisible'), 'confirmation');
}
}
break;
case 'export_pdf':
$pdf = new PDF();
/* Delete document */ $header = get_lang('Course').': '.$courseInfo['title'];
if ($action == 'delete' && $item_id) { $teachers = CourseManager::get_teacher_list_from_course_code_to_string(
$file_deleted = deleteWorkItem($item_id, $_course); $courseCode
if (!$file_deleted) { );
Display::display_error_message(get_lang('YouAreNotAllowedToDeleteThisDocument'));
} else {
Display::display_confirmation_message(get_lang('TheDocumentHasBeenDeleted'));
}
}
/* Visible */ if (!empty($sessionId)) {
if ($is_allowed_to_edit && $action == 'make_visible') { $sessionInfo = api_get_session_info($sessionId);
if (!empty($item_id)) { $header .= ' - '.$sessionInfo['name'];
if (isset($item_id) && $item_id == 'all') { $header .= '<br />'.$sessionInfo['description'];
} else { $teachers = SessionManager::getCoachesByCourseSessionToString(
makeVisible($item_id, $courseInfo); $sessionId,
Display::display_confirmation_message(get_lang('FileVisible')); $courseCode
);
} }
}
}
if ($is_allowed_to_edit && $action == 'make_invisible') { $header .= '<br />'.get_lang('Teachers').': '.$teachers;
$header .= '<br />'.get_lang('Date').': '.api_get_local_time();
/* Invisible */ if (!empty($my_folder_data['expires_on'])) {
if (!empty($item_id)) { $header .= '<br />' . get_lang('ExpiryDate') . ': ' . api_get_local_time($my_folder_data['expires_on']);
if (isset($item_id) && $item_id == 'all') {
} else {
makeInvisible($item_id, $courseInfo);
Display::display_confirmation_message(get_lang('FileInvisible'));
} }
}
if (ADD_DOCUMENT_TO_WORK) {
$documents = getAllDocumentToWork(
$my_folder_data['id'],
$courseInfo['real_id']
);
foreach ($documents as $document) {
$document['document_id'];
}
VAR_DUMP($documents);
$studentWorks = getAllUserToWork(
$my_folder_data['id'],
$courseInfo['real_id']
);
VAR_DUMP($studentWorks);
}
VAR_DUMP($my_folder_data);exit;
$pdf->content_to_pdf($header, null, $my_folder_data['title'], $courseCode);
exit;
break;
} }
Display :: display_header(null);
echo $message;
$documentsAddedInWork = getAllDocumentsFromWorkToString($workId, $courseInfo); $documentsAddedInWork = getAllDocumentsFromWorkToString($workId, $courseInfo);
echo '<div class="actions">'; echo '<div class="actions">';
echo '<a href="'.api_get_path(WEB_CODE_PATH).'work/work.php?'.api_get_cidreq().'">'. echo '<a href="'.api_get_path(WEB_CODE_PATH).'work/work.php?'.api_get_cidreq().'">'.
Display::return_icon('back.png', get_lang('BackToWorksList'),'',ICON_SIZE_MEDIUM).'</a>'; Display::return_icon('back.png', get_lang('BackToWorksList'), '', ICON_SIZE_MEDIUM).'</a>';
if (api_is_allowed_to_session_edit(false, true) && !empty($workId)) { if (api_is_allowed_to_session_edit(false, true) && !empty($workId)) {
/*echo '<a href="'.api_get_path(WEB_CODE_PATH).'work/upload.php?'.api_get_cidreq().'&id='.$workId.'">'; /*echo '<a href="'.api_get_path(WEB_CODE_PATH).'work/upload.php?'.api_get_cidreq().'&id='.$workId.'">';
echo Display::return_icon('upload_file.png', get_lang('UploadADocument'), '', ICON_SIZE_MEDIUM).'</a>';*/ echo Display::return_icon('upload_file.png', get_lang('UploadADocument'), '', ICON_SIZE_MEDIUM).'</a>';*/
if (ADD_DOCUMENT_TO_WORK) { if (ADD_DOCUMENT_TO_WORK) {
echo '<a href="'.api_get_path(WEB_CODE_PATH).'work/add_document.php?'.api_get_cidreq().'&id='.$workId.'">'; echo '<a href="'.api_get_path(WEB_CODE_PATH).'work/add_document.php?'.api_get_cidreq().'&id='.$workId.'">';
echo Display::return_icon('new_document.png', get_lang('AddDocument'), '', ICON_SIZE_MEDIUM).'</a>'; echo Display::return_icon('new_document.png', get_lang('AddDocument'), '', ICON_SIZE_MEDIUM).'</a>';
echo '<a href="'.api_get_path(WEB_CODE_PATH).'work/add_user.php?'.api_get_cidreq().'&id='.$workId.'">'; echo '<a href="'.api_get_path(WEB_CODE_PATH).'work/add_user.php?'.api_get_cidreq().'&id='.$workId.'">';
echo Display::return_icon('user.png', get_lang('AddUsers'), '', ICON_SIZE_MEDIUM).'</a>'; echo Display::return_icon('user.png', get_lang('AddUsers'), '', ICON_SIZE_MEDIUM).'</a>';
echo '<a href="'.api_get_path(WEB_CODE_PATH).'work/work_list_all.php?'.api_get_cidreq().'&id='.$workId.'&action=export_pdf">';
echo Display::return_icon('pdf.png', get_lang('Export'), '', ICON_SIZE_MEDIUM).'</a>';
} }
$display_output = '<a href="'.api_get_path(WEB_CODE_PATH).'work/work_missing.php?'.api_get_cidreq().'&amp;id='.$workId.'&amp;list=without">'. $display_output = '<a href="'.api_get_path(WEB_CODE_PATH).'work/work_missing.php?'.api_get_cidreq().'&amp;id='.$workId.'&amp;list=without">'.
@ -141,7 +203,6 @@ if (api_is_allowed_to_session_edit(false, true) && !empty($workId)) {
} }
echo $display_output; echo $display_output;
echo '<a href="'.api_get_path(WEB_CODE_PATH).'work/edit_work.php?'.api_get_cidreq().'&id='.$workId.'">'; echo '<a href="'.api_get_path(WEB_CODE_PATH).'work/edit_work.php?'.api_get_cidreq().'&id='.$workId.'">';
echo Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_MEDIUM).'</a>'; echo Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_MEDIUM).'</a>';
} }
@ -174,12 +235,25 @@ if (!empty($work_data['enable_qualification']) &&
get_lang('FirstName'), get_lang('FirstName'),
get_lang('LastName'), get_lang('LastName'),
get_lang('Title'), get_lang('Title'),
get_lang('Feedback'), get_lang('Score'),
get_lang('Date'), get_lang('Date'),
get_lang('Status'), get_lang('Status'),
get_lang('Actions') get_lang('Actions')
); );
if (ALLOW_USER_COMMENTS) {
$columns = array(
get_lang('Type'),
get_lang('FirstName'),
get_lang('LastName'),
get_lang('Title'),
get_lang('Feedback'),
get_lang('Date'),
get_lang('Status'),
get_lang('Actions')
);
}
$column_model = array( $column_model = array(
array('name'=>'type', 'index'=>'file', 'width'=>'8', 'align'=>'left', 'search' => 'false', 'sortable' => 'false'), array('name'=>'type', 'index'=>'file', 'width'=>'8', 'align'=>'left', 'search' => 'false', 'sortable' => 'false'),
array('name'=>'firstname', 'index'=>'firstname', 'width'=>'35', 'align'=>'left', 'search' => 'true'), array('name'=>'firstname', 'index'=>'firstname', 'width'=>'35', 'align'=>'left', 'search' => 'true'),
@ -203,23 +277,42 @@ if (!empty($work_data['enable_qualification']) &&
); );
$column_model = array( $column_model = array(
array('name'=>'type', 'index'=>'file', 'width'=>'8', 'align'=>'left', 'search' => 'false', 'sortable' => 'false'), array('name'=>'type', 'index'=>'file', 'width'=>'8', 'align'=>'left', 'search' => 'false', 'sortable' => 'false'),
array('name'=>'firstname', 'index'=>'firstname', 'width'=>'35', 'align'=>'left', 'search' => 'true'), array('name'=>'firstname', 'index'=>'firstname', 'width'=>'35', 'align'=>'left', 'search' => 'true'),
array('name'=>'lastname', 'index'=>'lastname', 'width'=>'35', 'align'=>'left', 'search' => 'true'), array('name'=>'lastname', 'index'=>'lastname', 'width'=>'35', 'align'=>'left', 'search' => 'true'),
array('name'=>'title', 'index'=>'title', 'width'=>'40', 'align'=>'left', 'search' => 'false', 'wrap_cell' => "true"), array('name'=>'title', 'index'=>'title', 'width'=>'40', 'align'=>'left', 'search' => 'false', 'wrap_cell' => "true"),
array('name'=>'sent_date', 'index'=>'sent_date', 'width'=>'45', 'align'=>'left', 'search' => 'true', 'wrap_cell' => 'true'), array('name'=>'sent_date', 'index'=>'sent_date', 'width'=>'45', 'align'=>'left', 'search' => 'true', 'wrap_cell' => 'true'),
array('name'=>'actions', 'index'=>'actions', 'width'=>'40', 'align'=>'left', 'search' => 'false', 'sortable'=>'false', 'wrap_cell' => 'true') array('name'=>'actions', 'index'=>'actions', 'width'=>'40', 'align'=>'left', 'search' => 'false', 'sortable'=>'false', 'wrap_cell' => 'true')
); );
}
$extra_params = array(); if (ALLOW_USER_COMMENTS) {
$columns = array(
get_lang('Type'),
get_lang('FirstName'),
get_lang('LastName'),
get_lang('Title'),
get_lang('Feedback'),
get_lang('Date'),
get_lang('Actions')
);
// Auto-width $column_model = array(
$extra_params['autowidth'] = 'true'; array('name'=>'type', 'index'=>'file', 'width'=>'8', 'align'=>'left', 'search' => 'false', 'sortable' => 'false'),
array('name'=>'firstname', 'index'=>'firstname', 'width'=>'35', 'align'=>'left', 'search' => 'true'),
array('name'=>'lastname', 'index'=>'lastname', 'width'=>'35', 'align'=>'left', 'search' => 'true'),
array('name'=>'title', 'index'=>'title', 'width'=>'40', 'align'=>'left', 'search' => 'false', 'wrap_cell' => "true"),
array('name'=>'qualification', 'index'=>'qualification', 'width'=>'25', 'align'=>'left', 'search' => 'true'),
array('name'=>'sent_date', 'index'=>'sent_date', 'width'=>'45', 'align'=>'left', 'search' => 'true', 'wrap_cell' => 'true'),
array('name'=>'actions', 'index'=>'actions', 'width'=>'40', 'align'=>'left', 'search' => 'false', 'sortable'=>'false', 'wrap_cell' => 'true')
);
}
}
// height auto $extra_params = array(
$extra_params['height'] = 'auto'; 'autowidth' => 'true',
$extra_params['sortname'] = 'firstname'; 'height' => 'auto',
'sortname' => 'firstname'
);
$url = api_get_path(WEB_AJAX_PATH).'model.ajax.php?a=get_work_user_list_all&work_id='.$workId.'&type='.$type; $url = api_get_path(WEB_AJAX_PATH).'model.ajax.php?a=get_work_user_list_all&work_id='.$workId.'&type='.$type;
?> ?>

Loading…
Cancel
Save