1.10.x
aragonc 11 years ago
commit 325da3b410
  1. 1
      home/home_menu.html
  2. 9
      main/attendance/attendance_add.php
  3. 24
      main/attendance/attendance_calendar.php
  4. 41
      main/attendance/attendance_controller.php
  5. 50
      main/attendance/attendance_sheet.php
  6. 2
      main/course_description/course_description_controller.php
  7. 38
      main/course_info/infocours.php
  8. 156
      main/css/base.css
  9. 2
      main/dropbox/dropbox_functions.inc.php
  10. 13
      main/group/group.php
  11. 2
      main/group/member_settings.php
  12. 6
      main/group/settings.php
  13. 4
      main/group/tutor_settings.php
  14. 1
      main/inc/lib/add_course.lib.inc.php
  15. 188
      main/inc/lib/attendance.lib.php
  16. 1
      main/inc/lib/database.constants.inc.php
  17. 39
      main/inc/lib/display.lib.php
  18. 4
      main/inc/lib/formvalidator/Element/DatePicker.php
  19. 4
      main/inc/lib/formvalidator/Element/DateTimePicker.php
  20. 46
      main/inc/lib/formvalidator/FormValidator.class.php
  21. 92
      main/inc/lib/groupmanager.lib.php
  22. 10
      main/inc/lib/pdf.lib.php
  23. 1
      main/inc/lib/pear/HTML/QuickForm/button.php
  24. 1
      main/inc/lib/template.lib.php
  25. 4
      main/inc/lib/userportal.lib.php
  26. 14
      main/install/db_main.sql
  27. 7
      main/install/migrate-db-1.9.0-1.10.0-pre.sql
  28. 7
      main/template/default/layout/layout_2_col.tpl
  29. 1
      main/template/default/layout/main.tpl
  30. 8
      main/template/default/layout/main_header.tpl
  31. 1
      main/template/default/layout/show_footer.tpl

@ -1 +1,2 @@
<li class="hide_menu"><a href="http://www.google.com.pe" target="_blank"><span>Ir a google</span></a></li>
<li class="forum-btn"><a href="http://www.chamilo.org/forum" target="_self">Forum</a></li>

@ -30,10 +30,15 @@ $form->addElement('hidden', 'sec_token', $token);
$form->addText('title', get_lang('Title'), true, array('size'=>'50'));
$form->applyFilter('title','html_filter');
$form->addHtmlEditor('description', get_lang('Description'), false, false, array('ToolbarSet' => 'TrainingDescription', 'Width' => '100%', 'Height' => '150'));
$form->addHtmlEditor(
'description',
get_lang('Description'),
false,
false,
array('ToolbarSet' => 'TrainingDescription', 'Width' => '100%', 'Height' => '150')
);
// Adavanced Parameters
$advanced = '<a href="javascript://" class = "advanced_parameters" ><span id="img_plus_and_minus">&nbsp;'.Display::return_icon('div_show.gif',get_lang('Show'),array('style'=>'vertical-align:middle')).' '.get_lang('AdvancedParameters').'</span></a>';
if ((api_get_session_id() != 0 && Gradebook::is_active()) || api_get_session_id() == 0) {
$form -> addElement('advanced_settings',$advanced);

@ -29,7 +29,6 @@ if (!$is_locked_attendance || api_is_platform_admin()) {
echo '</div>';
}
$message_information = get_lang('AttendanceCalendarDescription');
if (!empty($message_information)) {
@ -48,6 +47,12 @@ if (isset($error_checkdate) && $error_checkdate) {
Display::display_error_message($message, false);
}
$groupList = GroupManager::get_group_list(null, null, 1);
$groupIdList = array('--');
foreach ($groupList as $group) {
$groupIdList[$group['id']] = $group['name'];
}
if (isset($action) && $action == 'calendar_add') {
// calendar add form
$form = new FormValidator(
@ -91,15 +96,19 @@ if (isset($action) && $action == 'calendar_add') {
$defaults['repeat_type'] = 'weekly';
$form->addSelect('groups', get_lang('Group'), $groupIdList);
$form->addButtonCreate(get_lang('Save'));
$form->setDefaults($defaults);
$form->display();
} else {
// calendar list
// Calendar list
echo Display::page_subheader(get_lang('CalendarList'));
echo '<div class="attendance-calendar-list">';
if (!empty($attendance_calendar)) {
foreach ($attendance_calendar as $calendar) {
echo '<div class="attendance-calendar-row">';
if ((isset($action) && $action == 'calendar_edit') &&
(isset($calendar_id) && $calendar_id == $calendar['id'])
@ -112,6 +121,7 @@ if (isset($action) && $action == 'calendar_add') {
'index.php?action=calendar_edit&attendance_id=' . $attendance_id . '&calendar_id=' . $calendar_id . '&' . api_get_cidreq() . $param_gradebook,
''
);
$form->addElement('date_time_picker', 'date_time', '', array('form_name'=>'attendance_calendar_edit'), 5);
$defaults['date_time'] = $calendar['date_time'];
$form->addElement('style_submit_button', null, get_lang('Save'), 'class="save"');
@ -120,7 +130,15 @@ if (isset($action) && $action == 'calendar_add') {
$form->display();
echo '</div>';
} else {
echo Display::return_icon('lp_calendar_event.png', get_lang('DateTime')).' '.substr($calendar['date_time'], 0, strlen($calendar['date_time'])- 3) .'&nbsp;';
echo Display::return_icon(
'lp_calendar_event.png', get_lang('DateTime')
).' '.substr($calendar['date_time'], 0, strlen($calendar['date_time'])- 3) .'&nbsp;';
if (isset($calendar['groups']) && !empty($calendar['groups'])) {
foreach ($calendar['groups'] as $group) {
echo '&nbsp;'.Display::label($groupIdList[$group['group_id']]);
}
}
if (!$is_locked_attendance || api_is_platform_admin()) {
if (api_is_allowed_to_edit()) {
echo '<span style="margin-left:20px;">';

@ -264,10 +264,10 @@ class AttendanceController
$attendance = new Attendance();
$data = array();
$data['attendance_id'] = $attendance_id;
$data['users_in_course'] = $attendance->get_users_rel_course($attendance_id);
$groupId = isset($_REQUEST['group_id']) ? $_REQUEST['group_id'] : null;
$data['users_in_course'] = $attendance->get_users_rel_course($attendance_id, $groupId);
$filter_type = 'today';
if (!empty($_REQUEST['filter'])) {
$filter_type = $_REQUEST['filter'];
}
@ -278,7 +278,6 @@ class AttendanceController
);
if ($edit == true) {
if (api_is_allowed_to_edit(null, true) || $isDrhOfCourse) {
$data['users_presence'] = $attendance->get_users_attendance_sheet($attendance_id);
}
@ -312,24 +311,33 @@ class AttendanceController
if (isset($_POST['check_presence'][$cal_id])) {
$users_present = $_POST['check_presence'][$cal_id];
}
$attendance->attendance_sheet_add($cal_id,$users_present,$attendance_id);
$attendance->attendance_sheet_add(
$cal_id,
$users_present,
$attendance_id
);
}
}
$data['users_in_course'] = $attendance->get_users_rel_course($attendance_id);
$data['users_in_course'] = $attendance->get_users_rel_course($attendance_id, $groupId);
$my_calendar_id = null;
if (is_numeric($filter_type)) {
$my_calendar_id = $filter_type;
$filter_type = 'calendar_id';
}
$data['attendant_calendar'] = $attendance->get_attendance_calendar($attendance_id, $filter_type, $my_calendar_id);
$data['attendant_calendar'] = $attendance->get_attendance_calendar(
$attendance_id,
$filter_type,
$my_calendar_id,
$groupId
);
$data['attendant_calendar_all'] = $attendance->get_attendance_calendar($attendance_id);
$data['users_presence'] = $attendance->get_users_attendance_sheet($attendance_id);
$data['next_attendance_calendar_id'] = $attendance->get_next_attendance_calendar_id($attendance_id);
$data['next_attendance_calendar_datetime'] = $attendance->get_next_attendance_calendar_datetime($attendance_id);
} else {
$data['attendant_calendar_all'] = $attendance->get_attendance_calendar($attendance_id);
$data['attendant_calendar'] = $attendance->get_attendance_calendar($attendance_id, $filter_type);
$data['attendant_calendar'] = $attendance->get_attendance_calendar($attendance_id, $filter_type, null, $groupId);
}
$data['edit_table'] = intval($edit);
@ -354,6 +362,7 @@ class AttendanceController
$data = array();
$data['attendance_id'] = $attendance_id;
$attendance_id = intval($attendance_id);
$groupList = isset($_POST['groups']) ? array($_POST['groups']) : array();
if ($action == 'calendar_add') {
if (strtoupper($_SERVER['REQUEST_METHOD']) == "POST") {
@ -373,7 +382,8 @@ class AttendanceController
$attendance_id,
$start_datetime,
$end_datetime,
$repeat_type
$repeat_type,
$groupList
);
$action = 'calendar_list';
} else {
@ -390,7 +400,7 @@ class AttendanceController
$datetimezone = api_get_utc_datetime($datetime);
if (!empty($datetime)) {
$attendance->set_date_time($datetimezone);
$affected_rows = $attendance->attendance_calendar_add($attendance_id);
$affected_rows = $attendance->attendance_calendar_add($attendance_id, $groupList);
$action = 'calendar_list';
} else {
$data['error_date'] = true;
@ -442,11 +452,11 @@ class AttendanceController
{
$attendance = new Attendance();
$courseInfo = CourseManager::get_course_information($course_id);
$attendance->set_course_id($courseInfo['code']);
$groupId = isset($_REQUEST['group_id']) ? $_REQUEST['group_id'] : null;
$data_array = array();
$data_array['attendance_id'] = $attendance_id;
$data_array['users_in_course'] = $attendance->get_users_rel_course($attendance_id);
$data_array['users_in_course'] = $attendance->get_users_rel_course($attendance_id, $groupId);
$filter_type = 'today';
@ -460,7 +470,7 @@ class AttendanceController
$filter_type = 'calendar_id';
}
$data_array['attendant_calendar'] = $attendance->get_attendance_calendar($attendance_id, $filter_type, $my_calendar_id);
$data_array['attendant_calendar'] = $attendance->get_attendance_calendar($attendance_id, $filter_type, $my_calendar_id, $groupId);
if (api_is_allowed_to_edit(null, true) || api_is_drh()) {
$data_array['users_presence'] = $attendance->get_users_attendance_sheet($attendance_id);
@ -535,10 +545,10 @@ class AttendanceController
$changed = 1;
for ($i= 0; $i <= $rows; $i++) {
$row = $data_table[$i];
$row = isset($data_table[$i]) ? $data_table[$i] : null;
$key = 1;
$max_dates_per_page = 10;
$item = $data_table[$i];
$item = isset($data_table[$i]) ? $data_table[$i] : null;
$count_j = 0;
if (!empty($item)) {
@ -557,14 +567,13 @@ class AttendanceController
}
$content = null;
if (!empty($tables)) {
foreach ($tables as $sub_table) {
$content .= Export::convert_array_to_html($sub_table).'<br /><br />';
}
}
} else {
$content .= Export::convert_array_to_html($data_table, array('header_attributes' => array('align' => 'center')));
$content = Export::convert_array_to_html($data_table, array('header_attributes' => array('align' => 'center')));
}
$params = array(

@ -25,6 +25,8 @@ if (api_is_allowed_to_edit(null, true) ||
$param_gradebook = '&gradebook='.$_SESSION['gradebook'];
}
$groupId = isset($_REQUEST['group_id']) ? intval($_REQUEST['group_id']) : null;
$form = new FormValidator(
'filter',
'post',
@ -46,18 +48,43 @@ if (api_is_allowed_to_edit(null, true) ||
if (!empty($attendant_calendar_all)) {
$values[''] = '---------------';
foreach ($attendant_calendar_all as $attendance_date) {
$includeCalendar = true;
if (isset($attendance_date['groups']) && !empty($groupId)) {
foreach ($attendance_date['groups'] as $group) {
if ($groupId == $group['group_id']) {
$includeCalendar = true;
break;
} else {
$includeCalendar = false;
}
}
}
if ($today == $attendance_date['date']) {
$exists_attendance_today = true;
}
if ($includeCalendar) {
$values[$attendance_date['id']] = $attendance_date['date_time'];
}
}
}
if (!$exists_attendance_today) {
Display::display_warning_message(get_lang('ThereIsNoClassScheduledTodayTryPickingAnotherDay'));
}
$form->addElement('select', 'filter', get_lang('Filter'), $values, array('id' => 'filter_id'));
$groupList = GroupManager::get_group_list(null, null, 1);
$groupIdList = array('--');
foreach ($groupList as $group) {
$groupIdList[$group['id']] = $group['name'];
}
if (!empty($groupList)) {
$form->addSelect('group_id', get_lang('Group'), $groupIdList);
}
$form->addButtonFilter(get_lang('Filter'));
if (isset($_REQUEST['filter'])) {
@ -71,16 +98,21 @@ if (api_is_allowed_to_edit(null, true) ||
$renderer = $form->defaultRenderer();
$renderer->setElementTemplate('{label} {element} ');
$form->setDefaults(array('filter'=>$default_filter));
$form->setDefaults(
array(
'filter' => $default_filter,
'group_id' => $groupId
)
);
if (!$is_locked_attendance || api_is_platform_admin()) {
echo '<div class="actions">';
echo '<a style="float:left;" href="index.php?'.api_get_cidreq().'&action=calendar_list&attendance_id='.$attendance_id.$param_gradebook.'">'.
Display::return_icon('attendance_calendar.png',get_lang('AttendanceCalendar'),'',ICON_SIZE_MEDIUM).'</a>';
if (count($users_in_course) > 0) {
//if (count($users_in_course) > 0) {
$form->display();
}
echo '<a id="pdf_export" style="float:left;" href="index.php?'.api_get_cidreq().'&action=attendance_sheet_export_to_pdf&attendance_id='.$attendance_id.$param_gradebook.'&filter='.$default_filter.'">'.
//}
echo '<a id="pdf_export" style="float:left;" href="index.php?'.api_get_cidreq().'&action=attendance_sheet_export_to_pdf&attendance_id='.$attendance_id.$param_gradebook.'&filter='.$default_filter.'&group_id='.$groupId.'">'.
Display::return_icon('pdf.png',get_lang('ExportToPDF'),'',ICON_SIZE_MEDIUM).'</a>';
echo '</div>';
}
@ -96,10 +128,9 @@ if (api_is_allowed_to_edit(null, true) ||
Display::display_warning_message(get_lang('TheAttendanceSheetIsLocked'), false);
}
$param_filter = '&filter='.Security::remove_XSS($default_filter);
$param_filter = '&filter='.Security::remove_XSS($default_filter).'&group_id='.$groupId;
if (count($users_in_course) > 0) {
?>
<script>
var original_url = '';
@ -195,7 +226,6 @@ if (api_is_allowed_to_edit(null, true) ||
<th width="100px"><?php echo get_lang('AttendancesFaults')?></th>
</tr>
</thead>
<tbody>
<?php
$i = 1;
@ -227,7 +257,6 @@ if (api_is_allowed_to_edit(null, true) ||
</tbody>
</table>
</div>
<?php
echo '<div class="divTableWithFloatingHeader attendance-calendar-table" style="margin:0px;padding:0px;float:left;width:55%;overflow:auto;overflow-y:hidden;">';
@ -278,7 +307,6 @@ if (api_is_allowed_to_edit(null, true) ||
echo $result;
echo '</tr>';
echo '</thead>';
echo '<tbody>';
$i = 0;
foreach ($users_in_course as $user) {
@ -304,7 +332,9 @@ if (api_is_allowed_to_edit(null, true) ||
}
} else {
//if the user wasn't registered at that time, consider unchecked
if ($next_attendance_calendar_datetime == 0 || $calendar['date_time'] < $next_attendance_calendar_datetime) {
if ($next_attendance_calendar_datetime == 0 ||
$calendar['date_time'] < $next_attendance_calendar_datetime
) {
$checked = '';
}
}

@ -34,7 +34,7 @@ class CourseDescriptionController
$course_description->set_session_id($session_id);
$data = array();
$course_description_data = $course_description->get_description_data();
$data['descriptions'] = $course_description_data['descriptions'];
$data['descriptions'] = isset($course_description_data['descriptions']) ? $course_description_data['descriptions'] : null;
$data['default_description_titles'] = $course_description->get_default_description_title();
$data['default_description_title_editable'] = $course_description->get_default_description_title_editable();
$data['default_description_icon'] = $course_description->get_default_description_icon();

@ -162,8 +162,8 @@ $group[]=$form->createElement('SelectTheme', 'course_theme', null, array('class'
$form->addGroup($group, '', array(get_lang("Stylesheets")), '');
$form->addElement('label', get_lang('DocumentQuota'), format_file_size(DocumentManager::get_course_quota()));
$form->addElement('style_submit_button', null,'<i class="fa fa-floppy-o"></i> '. get_lang('SaveSettings'), 'class="btn btn-primary"');
$form->addButtonSave(get_lang('SaveSettings'),'submit_save');
//$form->addElement('style_submit_button', null,'<i class="fa fa-floppy-o"></i> '. get_lang('SaveSettings'), 'class="btn btn-primary"');
$form->addElement('html', '</div></div>');
// COURSE ACCESS
@ -199,8 +199,8 @@ $form->addText('course_registration_password', get_lang('CourseRegistrationPassw
$form->addElement('checkbox', 'activate_legal', array(null, get_lang('ShowALegalNoticeWhenEnteringTheCourse')), get_lang('ActivateLegal'));
$form->addElement('textarea', 'legal', get_lang('CourseLegalAgreement'), array('class'=>'span6', 'rows' => 8));
$form->addElement('style_submit_button', null, '<i class="fa fa-floppy-o"></i> '.get_lang('SaveSettings'), 'class="btn btn-primary"');
$form->addButtonSave(get_lang('SaveSettings'),'submit_save');
//$form->addElement('style_submit_button', null, '<i class="fa fa-floppy-o"></i> '.get_lang('SaveSettings'), 'class="btn btn-primary"');
$form->addElement('html', '</div></div>');
// Documents
@ -212,8 +212,8 @@ if (api_get_setting('documents_default_visibility_defined_in_course') == 'true')
$form->createElement('radio', 'documents_default_visibility', null, get_lang('Invisible'), 'invisible')
);
$form->addGroup($group, '', array(get_lang("DocumentsDefaultVisibility")), '');
$form->addElement('style_submit_button', null,'<i class="fa fa-floppy-o"></i> '.get_lang('SaveSettings'), 'class="btn btn-primary"');
$form->addButtonSave(get_lang('SaveSettings'),'submit_save');
//$form->addElement('style_submit_button', null,'<i class="fa fa-floppy-o"></i> '.get_lang('SaveSettings'), 'class="btn btn-primary"');
$form->addElement('html', '</div></div>');
}
@ -246,7 +246,8 @@ $group = array();
$group[]=$form->createElement('radio', 'email_alert_manager_on_new_quiz', get_lang('QuizEmailAlert'), get_lang('QuizEmailAlertActivate'), 1);
$group[]=$form->createElement('radio', 'email_alert_manager_on_new_quiz', null, get_lang('QuizEmailAlertDeactivate'), 0);
$form->addGroup($group, '', array(get_lang("QuizEmailAlert")), '');
$form->addElement('style_submit_button', null, '<i class="fa fa-floppy-o"></i> '.get_lang('SaveSettings'), 'class="btn btn-primary"');
$form->addButtonSave(get_lang('SaveSettings'),'submit_save');
//$form->addElement('style_submit_button', null, '<i class="fa fa-floppy-o"></i> '.get_lang('SaveSettings'), 'class="btn btn-primary"');
$form->addElement('html', '</div></div>');
@ -272,8 +273,8 @@ $group = array();
$group[]=$form->createElement('radio', 'allow_user_view_user_list', get_lang('AllowUserViewUserList'), get_lang('AllowUserViewUserListActivate'), 1);
$group[]=$form->createElement('radio', 'allow_user_view_user_list', null, get_lang('AllowUserViewUserListDeactivate'), 0);
$form->addGroup($group, '', array(get_lang("AllowUserViewUserList")), '');
$form->addElement('style_submit_button', null, '<i class="fa fa-floppy-o"></i> '.get_lang('SaveSettings'), 'class="btn btn-primary"');
$form->addButtonSave(get_lang('SaveSettings'),'submit_save');
//$form->addElement('style_submit_button', null, '<i class="fa fa-floppy-o"></i> '.get_lang('SaveSettings'), 'class="btn btn-primary"');
$form->addElement('html', '</div></div>');
// CHAT SETTINGS
@ -283,8 +284,8 @@ $group = array();
$group[]=$form->createElement('radio', 'allow_open_chat_window', get_lang('AllowOpenchatWindow'), get_lang('AllowOpenChatWindowActivate'), 1);
$group[]=$form->createElement('radio', 'allow_open_chat_window', null, get_lang('AllowOpenChatWindowDeactivate'), 0);
$form->addGroup($group, '', array(get_lang("AllowOpenchatWindow")), '');
$form->addElement('style_submit_button', null,'<i class="fa fa-floppy-o"></i> '. get_lang('SaveSettings'), 'class="btn btn-primary"');
$form->addButtonSave(get_lang('SaveSettings'),'submit_save');
//$form->addElement('style_submit_button', null,'<i class="fa fa-floppy-o"></i> '. get_lang('SaveSettings'), 'class="btn btn-primary"');
$form->addElement('html', '</div></div>');
// LEARNING PATH
@ -327,7 +328,8 @@ if (isset($_configuration['allow_lp_return_link']) && $_configuration['allow_lp_
}
if (is_settings_editable()) {
$form->addElement('style_submit_button', null, '<i class="fa fa-floppy-o"></i> '.get_lang('SaveSettings'), 'class="btn btn-primary"');
$form->addButtonSave(get_lang('SaveSettings'),'submit_save');
//$form->addElement('style_submit_button', null, '<i class="fa fa-floppy-o"></i> '.get_lang('SaveSettings'), 'class="btn btn-primary"');
} else {
// Is it allowed to edit the course settings?
if (!is_settings_editable()) {
@ -346,8 +348,8 @@ $group[]=$form->createElement('radio', 'display_info_advance_inside_homecourse',
$group[]=$form->createElement('radio', 'display_info_advance_inside_homecourse', null, get_lang('DisplayAboutNextAdvanceNotDoneAndLastDoneAdvance'), 3);
$group[]=$form->createElement('radio', 'display_info_advance_inside_homecourse', null, get_lang('DoNotDisplayAnyAdvance'), 0);
$form->addGroup($group, '', array(get_lang("InfoAboutAdvanceInsideHomeCourse")), '');
$form->addElement('style_submit_button', null,'<i class="fa fa-floppy-o"></i> '.get_lang('SaveSettings'), 'class="btn btn-primary"');
$form->addButtonSave(get_lang('SaveSettings'),'submit_save');
//$form->addElement('style_submit_button', null,'<i class="fa fa-floppy-o"></i> '.get_lang('SaveSettings'), 'class="btn btn-primary"');
$form->addElement('html', '</div></div>');
// Document settings
@ -359,8 +361,8 @@ $group = array(
);
$form->addGroup($group, '', array(get_lang("ShowSystemFolders")), '');
$form->addElement('style_submit_button', null,'<i class="fa fa-floppy-o"></i> '.get_lang('SaveSettings'), 'class="btn btn-primary"');
$form->addButtonSave(get_lang('SaveSettings'),'submit_save');
//$form->addElement('style_submit_button', null,'<i class="fa fa-floppy-o"></i> '.get_lang('SaveSettings'), 'class="btn btn-primary"');
$form->addElement('html', '</div></div>');
// Certificate settings
@ -370,8 +372,8 @@ if (api_get_setting('allow_public_certificates')=='true') {
$group[]=$form->createElement('radio', 'allow_public_certificates', get_lang('AllowPublicCertificates'), get_lang('Yes'), 1);
$group[]=$form->createElement('radio', 'allow_public_certificates', null, get_lang('No'), 0);
$form->addGroup($group, '', array(get_lang("AllowPublicCertificates")), '');
$form->addElement('style_submit_button', null,'<i class="fa fa-floppy-o"></i> '.get_lang('SaveSettings'), 'class="btn btn-primary"');
$form->addButtonSave(get_lang('SaveSettings'),'submit_save');
//$form->addElement('style_submit_button', null,'<i class="fa fa-floppy-o"></i> '.get_lang('SaveSettings'), 'class="btn btn-primary"');
$form->addElement('html', '</div></div>');
}

@ -2,11 +2,10 @@
* Common CSS for all themes
*/
/* @import url('bootstrap.css');*/
/* some changes to the bootstrap.css */
/* when doing a var_dump*/
pre {
margin-top:40px;
}
@ -410,9 +409,9 @@ html, body {
padding: 0;
}
/* the sticky effect */
html {
height: 100%;
position: relative;
min-height: 100%;
}
body {
@ -437,10 +436,15 @@ body {
}
footer {
margin-top: 17px;
padding-top: 17px;
height: 9em;
position: relative;
bottom: 0;
width: 100%;
height: 80px;
background-color: #f5f5f5;
}
#footer_left, #footer_center, #footer_right {
margin: 20px 0 0 0;
}
/* Sticky footer*/
@ -4350,26 +4354,8 @@ a.forum_group_link {
padding-top:8px;
}
footer {
/* Default gray footer */
background-color: #F5F5F5; /* Old browsers */
background-repeat: repeat-x; /* Repeat the gradient */
background-image: -moz-linear-gradient(top, #F5F5F5 0%, #EEEEEE 100%); /* FF3.6+ */
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#F5F5F5), color-stop(100%,#EEEEEE)); /* Chrome,Safari4+ */
background-image: -webkit-linear-gradient(top, #F5F5F5 0%, #EEEEEE 100%); /* Chrome 10+,Safari 5.1+ */
background-image: -ms-linear-gradient(top, #F5F5F5 0%,#EEEEEE 100%); /* IE10+ */
background-image: -o-linear-gradient(top, #F5F5F5 0%,#EEEEEE 100%); /* Opera 11.10+ */
/* Fixes bug in ie8 */
/* filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#F5F5F5', endColorstr='#EEEEEE',GradientType=0 ); */ /* IE6-9 */
background-image: linear-gradient(top, #F5F5F5 0%, #EEEEEE 100%); /* W3C */
}
/* Default LP left column values */
#learning_path_breadcrumb_zone {
}
#learning_path_left_zone {
float:left;
width:315px;
@ -4419,28 +4405,6 @@ footer {
margin:0;
}
.progress .bar {
font-weight: bold;
text-shadow: 0px 1px 1px rgba(0,0,0,1);
}
.progress {
text-align:center;
position: relative;
background: #98bede; /* Old browsers */
background: -moz-linear-gradient(top, #98bede 1%, #deefff 98%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(1%,#98bede), color-stop(98%,#deefff)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #98bede 1%,#deefff 98%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #98bede 1%,#deefff 98%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #98bede 1%,#deefff 98%); /* IE10+ */
background: linear-gradient(to bottom, #98bede 1%,#deefff 98%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#98bede', endColorstr='#deefff',GradientType=0 ); /* IE6-9 */
}
.bar span {
position:absolute;
display: block;
width: 100%;
}
.ui-state-highlight_lp {
border: 1px solid #FEAA18;
@ -4585,104 +4549,6 @@ footer {
box-shadow:none;
}
i.size-32{
width:32px;
height:32px;
line-height: 32px;
margin:0;
padding:0;
border:none;
border-radius: 0;
background-repeat: no-repeat;
background-position:center center;
box-shadow:none;
background-color: transparent;
display:inline-block;
}
i.size-32.icon-new-folder{
background-image: url('../img/icons/32/new_folder.png');
}
i.size-32.icon-new-link{
background-image: url('../img/icons/32/new_link.png');
}
i.size-32.icon-export-csv{
background-image: url('../img/icons/32/export_csv.png');
}
i.size-32.icon-import-csv{
background-image: url('../img/icons/32/import_csv.png');
}
i.size-32.icon-delete-all{
background-image: url('../img/icons/32/delete.png');
}
i.size-32.icon-back{
background-image: url('../img/icons/32/back.png');
}
i.size-32.icon-settings{
background-image: url('../img/icons/32/settings.png');
}
i.size-32.icon-view-detailed{
background-image: url('../img/icons/32/view_detailed.png');
}
i.size-32.icon-view-text{
background-image: url('../img/icons/32/view_text.png');
}
i.size-32.icon-sort-by-created-date{
background-image: url('../img/icons/32/notes_order_by_date_new.png');
}
i.size-32.icon-sort-by-modified-date{
background-image: url('../img/icons/32/notes_order_by_date_mod.png');
}
i.size-32.icon-sort-by-title{
background-image: url('../img/icons/32/notes_order_by_title.png');
}
i.size-32.icon-new-announce{
background-image: url('../img/icons/32/new_announce.png');
}
i.size-22{
width:22px;
height:22px;
line-height: 22px;
margin:0;
padding:0;
border:none;
border-radius: 0;
background-repeat: no-repeat;
background-position:center center;
box-shadow:none;
background-color: transparent;
display:inline-block;
}
i.size-22.icon-edit{
background-image: url('../img/icons/22/edit.png');
}
i.size-22.icon-delete{
background-image: url('../img/icons/22/delete.png');
}
i.icon-collapse{
background-image: url('../img/div_show.gif');
}
i.icon-expand{
background-image: url('../img/div_hide.gif');
}
.announcement {
/* background: none repeat scroll 0 0 #F2F2F2;*/
border: 1px solid #D3D3D3;

@ -578,7 +578,7 @@ function display_add_form($dropbox_unid, $viewReceivedCategory, $viewSentCategor
}
$form->addElement('select', 'recipients', get_lang('SendTo'), $options, array('multiple' => 'multiple', 'size' => '10', 'class' => 'span4'));
$form->addElement('button', 'submitWork', get_lang('Upload'));
$form->addElement('button', 'submitWork', get_lang('Upload'),'paper-plane','btn btn-success');
$form->display();
}

@ -14,9 +14,9 @@
* @author Isaac Flores, code cleaning and improvements
* @package chamilo.group
*/
/* INIT SECTION */
// Name of the language file that needs to be included
$language_file = 'group';
$language_file = array('group', 'document');
require_once '../inc/global.inc.php';
@ -73,6 +73,14 @@ $my_get_id = isset($_GET['id']) ? Security::remove_XSS($_GET['id']) : null;
if (isset($_GET['action']) && $is_allowed_in_course) {
switch ($_GET['action']) {
case 'set_visible':
GroupManager::setVisible($my_get_id);
Display :: display_confirmation_message(get_lang('ItemUpdated'));
break;
case 'set_invisible':
GroupManager::setInvisible($my_get_id);
Display :: display_confirmation_message(get_lang('ItemUpdated'));
break;
case 'self_reg':
if (GroupManager::is_self_registration_allowed($userId, $my_group_id)) {
GroupManager::subscribe_users($userId, $my_group_id);
@ -138,7 +146,6 @@ if (api_is_allowed_to_edit(false, true)) {
GroupManager :: delete_groups($my_get_id);
Display :: display_confirmation_message(get_lang('GroupDel'));
break;
case 'fill_one':
GroupManager :: fill_groups($my_get_id);
Display :: display_confirmation_message(get_lang('GroupFilledGroups'));

@ -178,7 +178,7 @@ $group_members_element = $form->addElement(
$form->addFormRule('check_group_members');
// submit button
$form->addElement('style_submit_button', 'submit', get_lang('SaveSettings'), 'class="save"');
$form->addButtonSave(get_lang('SaveSettings'));
if ($form->validate()) {
$values = $form->exportValues();

@ -11,8 +11,6 @@
* @todo course admin functionality to create groups based on who is in which course (or class).
*/
/* INIT SECTION */
// Name of the language file that needs to be included
$language_file = 'group';
@ -70,7 +68,7 @@ $form->addElement('html', '</div>');
$form->addElement('html', '<div class="span6">');
// Description
$form->addElement('textarea', 'description', get_lang('Description'), array ('class' => 'span6', 'rows' => 6));
$form->addElement('textarea', 'description', get_lang('Description'));
$form->addElement('html', '</div>');
$form->addElement('html', '<div class="span12">');
@ -148,7 +146,7 @@ $form->addGroup($group, '', Display::return_icon('chat.png', get_lang('Chat'), a
$form->addElement('html', '</div>');
$form->addElement('html', '<div class="span12">');
// Submit button
$form->addElement('style_submit_button', 'submit', get_lang('SaveSettings'), 'class="save"');
$form->addButtonSave(get_lang('SaveSettings'));
$form->addElement('html', '</div>');
if ($form->validate()) {

@ -11,8 +11,6 @@
* @todo course admin functionality to create groups based on who is in which course (or class).
*/
/* INIT SECTION */
// Name of the language file that needs to be included
$language_file = 'group';
@ -155,7 +153,7 @@ if (!empty($complete_user_list)) {
$group_tutors_element = $form->addElement('advmultiselect', 'group_tutors', get_lang('GroupTutors'), $possible_users, 'style="width: 280px;"');
// submit button
$form->addElement('style_submit_button', 'submit', get_lang('SaveSettings'), 'class="save"');
$form->addButtonSave(get_lang('SaveSettings'));
if ($form->validate()) {
$values = $form->exportValues();

@ -1162,6 +1162,7 @@ class AddCourse
$add_to_all_tables
id int unsigned NOT NULL auto_increment,
name varchar(100) default NULL,
status tinyint DEFAULT 1,
category_id int unsigned NOT NULL default 0,
description text,
max_student int unsigned NOT NULL default 8,

@ -563,12 +563,16 @@ class Attendance
/**
* Get registered users inside current course
* @param int $attendance_id attendance id for showing attendance result field (optional)
* @param int $groupId
* @return array users data
*/
public function get_users_rel_course($attendance_id = 0)
public function get_users_rel_course($attendance_id = 0, $groupId = null)
{
$current_session_id = api_get_session_id();
$current_course_id = api_get_course_id();
$studentInGroup = array();
if (!empty($current_session_id)) {
$a_course_users = CourseManager:: get_user_list_from_course_code(
$current_course_id,
@ -583,7 +587,17 @@ class Attendance
'',
'lastname'
);
if (!empty($groupId)) {
$students = GroupManager::getStudents($groupId);
if (!empty($students)) {
foreach ($students as $student) {
$studentInGroup[$student['user_id']] = true;
}
}
}
}
// get registered users inside current course
$a_users = array();
foreach ($a_course_users as $key => $user_data) {
@ -591,6 +605,12 @@ class Attendance
$uid = $user_data['user_id'];
$status = $user_data['status'];
if (!empty($groupId)) {
if (!isset($studentInGroup[$uid])) {
continue;
}
}
$user_status_in_session = null;
$user_status_in_course = null;
@ -608,7 +628,13 @@ class Attendance
}
// Not taking into account DRH or COURSEMANAGER
if ($uid <= 1 || $status == DRH || $user_status_in_course == COURSEMANAGER || $user_status_in_session == 2) continue;
if ($uid <= 1 ||
$status == DRH ||
$user_status_in_course == COURSEMANAGER ||
$user_status_in_session == 2
) {
continue;
}
if (!empty($attendance_id)) {
$user_faults = $this->get_faults_of_user($uid, $attendance_id);
@ -621,7 +647,8 @@ class Attendance
$user_profile = UserManager::get_picture_user($uid, $image_path['file'], 22, USER_IMAGE_SIZE_SMALL, ' width="22" height="22" ');
if (!empty($image_path['file'])) {
$photo = '<center><a class="thickbox" href="'.$image_path['dir'].$image_path['file'].'" ><img src="'.$user_profile['file'].'" '.$user_profile['style'].' alt="'.api_get_person_name($user_data['firstname'], $user_data['lastname']).'" title="'.api_get_person_name($user_data['firstname'], $user_data['lastname']).'" /></a></center>';
$photo = '<center><a class="thickbox" href="'.$image_path['dir'].$image_path['file'].'" >
<img src="'.$user_profile['file'].'" '.$user_profile['style'].' alt="'.api_get_person_name($user_data['firstname'], $user_data['lastname']).'" title="'.api_get_person_name($user_data['firstname'], $user_data['lastname']).'" /></a></center>';
} else {
$photo = '<center><img src="'.$user_profile['file'].'" '.$user_profile['style'].' alt="'.api_get_person_name($user_data['firstname'], $user_data['lastname']).'" title="'.api_get_person_name($user_data['firstname'], $user_data['lastname']).'" /></center>';
}
@ -635,6 +662,7 @@ class Attendance
//Sending only 5 items in the array instead of 60
$a_users[$key] = $value;
}
return $a_users;
}
@ -1171,17 +1199,37 @@ class Attendance
/**
* Get all attendance calendar data inside current attendance
* @param int attendance id
* @param int $attendance_id
* @param string $type
* @param int $calendar_id
* @param int $groupId
*
* @return array attendance calendar data
*/
public function get_attendance_calendar($attendance_id, $type = 'all', $calendar_id = null)
{
public function get_attendance_calendar(
$attendance_id,
$type = 'all',
$calendar_id = null,
$groupId = null
) {
global $dateFormatShort, $timeNoSecFormat;
$tbl_attendance_calendar = Database::get_course_table(TABLE_ATTENDANCE_CALENDAR);
$attendance_id = intval($attendance_id);
$course_id = api_get_course_int_id();
$groupCondition = null;
$sql = "SELECT * FROM $tbl_attendance_calendar
WHERE c_id = $course_id AND attendance_id = '$attendance_id' ";
if (!empty($groupId)) {
$groupId = intval($groupId);
$table = Database::get_course_table(TABLE_ATTENDANCE_CALENDAR_REL_GROUP);
$sql = "SELECT c.* FROM $tbl_attendance_calendar c INNER JOIN $table g
ON c.c_id = g.c_id AND c.id = g.calendar_id
WHERE c.c_id = $course_id AND g.group_id = '$groupId' ";
}
if (!in_array($type, array('today', 'all', 'all_done', 'all_not_done','calendar_id'))) {
$type = 'all';
}
@ -1215,6 +1263,7 @@ class Attendance
$row['date_time'] = api_get_local_time($row['date_time']);
$row['date'] = api_format_date($row['date_time'], DATE_FORMAT_SHORT);
$row['time'] = api_format_date($row['date_time'], TIME_NO_SEC_FORMAT);
$row['groups'] = $this->getGroupListByAttendanceCalendar($row['id'], $course_id);
if ($type == 'today') {
if (date('d-m-Y', api_strtotime($row['date_time'], 'UTC')) == date('d-m-Y', time())) {
$data[] = $row;
@ -1302,10 +1351,11 @@ class Attendance
/**
* Add new datetime inside attendance calendar table
* @param int attendance id
* @param int $attendance_id
* @param array $groupList
* @return int affected rows
*/
public function attendance_calendar_add($attendance_id)
public function attendance_calendar_add($attendance_id, $groupList = array())
{
$tbl_attendance_calendar = Database::get_course_table(TABLE_ATTENDANCE_CALENDAR);
$affected_rows = 0;
@ -1319,12 +1369,14 @@ class Attendance
attendance_id = '$attendance_id'";
$rs = Database::query($sql);
if (Database::num_rows($rs) == 0) {
$sql = "INSERT INTO $tbl_attendance_calendar SET
c_id = $course_id,
date_time = '".Database::escape_string($this->date_time)."',
attendance_id = '$attendance_id'";
Database::query($sql);
$params = array(
'c_id' => $course_id,
'date_time' => $this->date_time,
'attendance_id' => $attendance_id
);
$id = Database::insert($tbl_attendance_calendar, $params);
$affected_rows = Database::affected_rows();
$this->addAttendanceCalendarToGroup($id, $course_id, $groupList);
}
// update locked attendance
@ -1337,20 +1389,114 @@ class Attendance
return $affected_rows;
}
/**
* @param int $calendarId
* @param int $courseId
* @param array $groupList
*/
public function addAttendanceCalendarToGroup($calendarId, $courseId, $groupList)
{
if (empty($groupList)) {
return false;
}
$table = Database::get_course_table(TABLE_ATTENDANCE_CALENDAR_REL_GROUP);
foreach ($groupList as $groupId) {
$result = $this->getAttendanceCalendarGroup(
$calendarId,
$courseId,
$groupId
);
if (empty($result)) {
$params = array(
'calendar_id' => $calendarId,
'c_id' => $courseId,
'group_id' => $groupId,
);
Database::insert($table, $params);
}
}
}
/**
* @param int $calendarId
* @param int $courseId
* @param int $groupId
* @return array
*/
public function getGroupListByAttendanceCalendar($calendarId, $courseId)
{
$table = Database::get_course_table(TABLE_ATTENDANCE_CALENDAR_REL_GROUP);
return Database::select(
'*',
$table,
array('where'=>
array(
'calendar_id = ? AND c_id = ?' => array($calendarId, $courseId)
)
)
);
}
/**
* @param int $calendarId
* @param int $courseId
* @param int $groupId
* @return array
*/
public function getAttendanceCalendarGroup($calendarId, $courseId, $groupId)
{
$table = Database::get_course_table(TABLE_ATTENDANCE_CALENDAR_REL_GROUP);
return Database::select(
'*',
$table,
array('where'=>
array(
'calendar_id = ? AND c_id = ? AND group_id = ?' => array($calendarId, $courseId, $groupId)
)
)
);
}
/**
* @param int $calendarId
* @param int $courseId
* @param int $groupId
* @return array
*/
public function deleteAttendanceCalendarGroup($calendarId, $courseId)
{
$table = Database::get_course_table(TABLE_ATTENDANCE_CALENDAR_REL_GROUP);
Database::delete(
$table,
array(
'calendar_id = ? AND c_id = ?' => array($calendarId, $courseId)
)
);
}
/**
* save repeated date inside attendance calendar table
* @param int $attendance_id
* @param int $start_date start date in tms
* @param int $end_date end date in tms
* @param string $repeat_type daily, weekly, monthlyByDate
* @param array $groupList
*/
public function attendance_repeat_calendar_add($attendance_id, $start_date, $end_date, $repeat_type)
{
public function attendance_repeat_calendar_add(
$attendance_id,
$start_date,
$end_date,
$repeat_type,
$groupList = array()
) {
$attendance_id = intval($attendance_id);
// save start date
$datetimezone = api_get_utc_datetime($start_date);
$this->set_date_time($datetimezone);
$res = $this->attendance_calendar_add($attendance_id);
$res = $this->attendance_calendar_add($attendance_id, $groupList);
// 86400 = 24 hours in seconds
// 604800 = 1 week in seconds
@ -1361,7 +1507,7 @@ class Attendance
for ($i = $start_date + 86400; ($i <= $end_date); $i += 86400) {
$datetimezone = api_get_utc_datetime($i);
$this->set_date_time($datetimezone);
$this->attendance_calendar_add($attendance_id);
$this->attendance_calendar_add($attendance_id, $groupList);
$j++;
}
break;
@ -1370,7 +1516,7 @@ class Attendance
for ($i = $start_date + 604800; ($i <= $end_date); $i += 604800) {
$datetimezone = api_get_utc_datetime($i);
$this->set_date_time($datetimezone);
$this->attendance_calendar_add($attendance_id);
$this->attendance_calendar_add($attendance_id, $groupList);
$j++;
}
break;
@ -1380,7 +1526,7 @@ class Attendance
for ($i = $start_date + 2419200; ($i <= $end_date); $i += 2419200) {
$datetimezone = api_get_utc_datetime($i);
$this->set_date_time($datetimezone);
$this->attendance_calendar_add($attendance_id);
$this->attendance_calendar_add($attendance_id, $groupList);
$j++;
}
break;
@ -1481,6 +1627,8 @@ class Attendance
$sql = "DELETE FROM $tbl_attendance_calendar
WHERE c_id = $course_id AND id = '".intval($cal['id'])."'";
Database::query($sql);
$this->deleteAttendanceCalendarGroup($cal['id'], $course_id);
}
}
} else {
@ -1492,6 +1640,8 @@ class Attendance
$sql = "DELETE FROM $tbl_attendance_calendar
WHERE c_id = $course_id AND id = '".intval($calendar_id)."'";
Database::query($sql);
$this->deleteAttendanceCalendarGroup($calendar_id, $course_id);
}
$affected_rows = Database::affected_rows();

@ -303,6 +303,7 @@ define('TABLE_METADATA', 'metadata');
// Attendance Sheet
define('TABLE_ATTENDANCE', 'attendance');
define('TABLE_ATTENDANCE_CALENDAR', 'attendance_calendar');
define('TABLE_ATTENDANCE_CALENDAR_REL_GROUP', 'attendance_calendar_rel_group');
define('TABLE_ATTENDANCE_SHEET_LOG','attendance_sheet_log');
define('TABLE_ATTENDANCE_SHEET', 'attendance_sheet');

@ -59,6 +59,7 @@ class Display
if (isset($origin) && $origin == 'learnpath') {
$showHeader = false;
}
self::$global_template = new Template($tool_name, $showHeader, $showHeader);
// Fixing tools with any help it takes xxx part of main/xxx/index.php
@ -82,12 +83,13 @@ class Display
if (!empty(self::$preview_style)) {
self::$global_template->preview_theme = self::$preview_style;
self::$global_template->set_css_files();
self::$global_template->set_css_custom_files();
self::$global_template->set_js_files();
}
if (!empty($page_header)) {
self::$global_template->assign('header', $page_header);
}
echo self::$global_template->show_header_template();
}
@ -112,7 +114,8 @@ class Display
/**
* Displays the reduced page header (without banner)
*/
public static function set_header() {
public static function set_header()
{
global $show_learnpath;
self::$global_template = new Template($tool_name, false, false, $show_learnpath);
}
@ -120,7 +123,8 @@ class Display
/**
* Display the page footer
*/
public static function display_footer() {
public static function display_footer()
{
echo self::$global_template->show_footer_template();
}
@ -1696,19 +1700,33 @@ class Display
return $html;
}
/**
* @param $percentage
* @param bool $show_percentage
* @param null $extra_info
* @return string
*/
public static function bar_progress($percentage, $show_percentage = true, $extra_info = null)
{
$percentage = intval($percentage);
$div = '<div class="progress progress-striped">
<div class="bar" style="width: '.$percentage.'%;"></div>
</div>';
$div = '<div class="progress">
<div
class="progress-bar progress-bar-striped"
role="progressbar"
aria-valuenow="'.$percentage.'"
aria-valuemin="0"
aria-valuemax="100"
style="width: '.$percentage.'%;"
>';
if ($show_percentage) {
$div .= '<div class="progresstext">'.$percentage.'%</div>';
$div .= $percentage.'%';
} else {
if (!empty($extra_info)) {
$div .= '<div class="progresstext">'.$extra_info.'</div>';
$div .= $extra_info;
}
}
$div .= '</div>';
return $div;
}
@ -1758,7 +1776,7 @@ class Display
* @param string $type
* @return string
*/
public static function label($content, $type = null)
public static function label($content, $type = 'default')
{
$class = '';
switch ($type) {
@ -1777,6 +1795,9 @@ class Display
case 'inverse':
$class = 'label-inverse';
break;
default:
$class = 'label-default';
break;
}
$html = '';

@ -2,7 +2,7 @@
/* For licensing terms, see /license.txt */
/**
* Form element to select a date and hour (with popup datepicker)
* Form element to select a date.
*
* Class DatePicker
*/
@ -18,7 +18,7 @@ class DatePicker extends HTML_QuickForm_text
if (!isset($attributes['id'])) {
$attributes['id'] = $elementName;
}
//$attributes['class'] = '';
$attributes['class'] = 'form-control';
HTML_QuickForm_element::HTML_QuickForm_element($elementName, $elementLabel, $attributes);
$this->_appendName = true;

@ -2,7 +2,7 @@
/* For licensing terms, see /license.txt */
/**
* Form element to select a date and hour (with popup datepicker)
* Form element to select a date and hour.
*/
class DateTimePicker extends HTML_QuickForm_text
{
@ -14,7 +14,7 @@ class DateTimePicker extends HTML_QuickForm_text
if (!isset($attributes['id'])) {
$attributes['id'] = $elementName;
}
$attributes['class'] = 'form-control';
HTML_QuickForm_element::HTML_QuickForm_element($elementName, $elementLabel, $attributes);
$this->_appendName = true;
$this->_type = 'date_time_picker';

@ -2,10 +2,13 @@
/* For licensing terms, see /license.txt */
/**
* Objects of this class can be used to create/manipulate/validate user input.
* Class FormValidator
* create/manipulate/validate user input.
*/
class FormValidator extends HTML_QuickForm
{
const LAYOUT_HORIZONTAL = 'horizontal';
const LAYOUT_INLINE = 'inline';
public $with_progress_bar = false;
/**
@ -15,6 +18,7 @@ class FormValidator extends HTML_QuickForm
* @param string $action (optional Action (default is $PHP_SELF)
* @param string $target (optional Form's target defaults to '_self'
* @param mixed $attributes (optional) Extra attributes for <form> tag
* @param string $layout
* @param bool $trackSubmit (optional) Whether to track if the form was
* submitted by adding a special hidden field (default = true)
*/
@ -24,6 +28,7 @@ class FormValidator extends HTML_QuickForm
$action = '',
$target = '',
$attributes = null,
$layout = self::LAYOUT_HORIZONTAL,
$trackSubmit = true
) {
// Default form class.
@ -31,6 +36,19 @@ class FormValidator extends HTML_QuickForm
$attributes['class'] = 'form-horizontal';
}
if (isset($attributes['class']) && strpos($attributes['class'], 'form-search') !== false) {
$layout = 'inline';
}
switch ($layout) {
case self::LAYOUT_HORIZONTAL:
$attributes['class'] = 'form-horizontal';
break;
case self::LAYOUT_INLINE:
$attributes['class'] = 'form-inline';
break;
}
parent::__construct($name, $method, $action, $target, $attributes, $trackSubmit);
// Load some custom elements and rules
@ -235,12 +253,20 @@ EOT;
);
}
/**
* @param string $label
*/
public function addButtonSave($label, $name = 'submit')
{
return $this->addButton($name, $label, 'floppy-o', 'btn btn-success');
}
/**
* @param string $label
*/
public function addButtonCreate($label, $name = 'submit')
{
$this->addButton($name, $label, 'plus', 'primary');
return $this->addButton($name, $label, 'plus', 'primary');
}
/**
@ -274,8 +300,11 @@ EOT;
* Shortcut to search button
* @param string $label
*/
public function addButtonSearch($label)
public function addButtonSearch($label = null)
{
if (empty($label)) {
$label = get_lang('Search');
}
return $this->addButton('submit', $label, 'search');
}
@ -298,7 +327,7 @@ EOT;
}
/**
* Shortcut to import button
* Shortcut to export button
* @param string $label
*/
public function addButtonExport($label, $name = 'submit')
@ -306,6 +335,15 @@ EOT;
return $this->addButton($name, $label, 'check', 'primary');
}
/**
* Shortcut to filter button
* @param string $label
*/
public function addButtonFilter($label, $name = 'submit')
{
return $this->addButton($name, $label, 'filter', 'primary');
}
/**
* @param string $name
* @param string $label

@ -78,7 +78,7 @@ class GroupManager
* @param string $course_code Default is current course
* @return array An array with all information about the groups.
*/
public static function get_group_list($category = null, $course_code = null)
public static function get_group_list($category = null, $course_code = null, $status = null)
{
$course_info = api_get_course_info($course_code);
$session_id = api_get_session_id();
@ -96,6 +96,7 @@ class GroupManager
g.self_registration_allowed,
g.self_unregistration_allowed,
g.session_id,
g.status,
ug.user_id is_member
FROM $table_group g
LEFT JOIN $table_group_user ug
@ -118,6 +119,10 @@ class GroupManager
$session_condition = api_get_session_condition($session_id, true);
}
if (!is_null($status)) {
$sql .= " AND g.status = '".intval($status)."' ";
}
$sql .= " AND g.c_id = $course_id ";
if (!empty($session_condition)) {
@ -471,6 +476,7 @@ class GroupManager
if ($db_object) {
$result['id'] = $db_object->id;
$result['name'] = $db_object->name;
$result['status'] = $db_object->status;
$result['tutor_id'] = isset($db_object->tutor_id) ? $db_object->tutor_id : null;
$result['description'] = $db_object->description;
$result['maximum_number_of_students'] = $db_object->max_student;
@ -1952,21 +1958,25 @@ class GroupManager
$user_is_in_group = self::is_user_in_group($user_id, $group_id);
// Check group properties
$group_info = self :: get_group_properties($group_id);
$groupInfo = self::get_group_properties($group_id);
if (empty($groupInfo)) {
return false;
}
if (empty($group_info)) {
if (!$user_is_in_group && $groupInfo['status'] == 0) {
return false;
}
if ($group_info[$state_key] == self::TOOL_NOT_AVAILABLE) {
if ($groupInfo[$state_key] == self::TOOL_NOT_AVAILABLE) {
return false;
} elseif ($group_info[$state_key] == self::TOOL_PUBLIC) {
} elseif ($groupInfo[$state_key] == self::TOOL_PUBLIC) {
return true;
} elseif (api_is_allowed_to_edit(false, true)) {
return true;
} elseif ($group_info['tutor_id'] == $user_id) { //this tutor implementation was dropped
} elseif ($groupInfo['tutor_id'] == $user_id) { //this tutor implementation was dropped
return true;
} elseif ($group_info[$state_key] == self::TOOL_PRIVATE && !$user_is_in_group) {
} elseif ($groupInfo[$state_key] == self::TOOL_PRIVATE && !$user_is_in_group) {
return false;
} else {
return $user_is_in_group;
@ -2139,13 +2149,21 @@ class GroupManager
// Create a new table-row
$row = array();
if (!api_is_allowed_to_edit(false, true)) {
if ($this_group['status'] == 0) {
continue;
}
}
// Checkbox
if (api_is_allowed_to_edit(false, true) && count($group_list) > 1) {
$row[] = $this_group['id'];
}
// Group name
if ((api_is_allowed_to_edit(false, true) ||
(
in_array($user_id, $tutorsids_of_group) ||
$this_group['is_member'] ||
self::user_has_access($user_id, $this_group['id'], self::GROUP_TOOL_FORUM) ||
@ -2156,9 +2174,15 @@ class GroupManager
self::user_has_access($user_id, $this_group['id'], self::GROUP_TOOL_WIKI) ||
self::user_has_access($user_id, $this_group['id'], self::GROUP_TOOL_CHAT)
)
)
&& !(api_is_course_coach() && intval($this_group['session_id']) != $session_id)
) {
$group_name = '<a href="group_space.php?cidReq='.api_get_course_id().'&amp;origin='.$orig.'&amp;gidReq='.$this_group['id'].'">'.
$groupNameClass = null;
if ($this_group['status'] == 0) {
$groupNameClass = 'muted';
}
$group_name = '<a class="'.$groupNameClass.'" href="group_space.php?cidReq='.api_get_course_id().'&amp;origin='.$orig.'&amp;gidReq='.$this_group['id'].'">'.
Security::remove_XSS($this_group['name']).'</a> ';
if (!empty($user_id) && !empty($this_group['id_tutor']) && $user_id == $this_group['id_tutor']) {
$group_name .= Display::label(get_lang('OneMyGroups'), 'success');
@ -2218,10 +2242,20 @@ class GroupManager
}
$url = api_get_path(WEB_CODE_PATH).'group/';
// Edit-links
if (api_is_allowed_to_edit(false, true) && !(api_is_course_coach() && intval($this_group['session_id']) != $session_id)) {
if (api_is_allowed_to_edit(false, true) &&
!(api_is_course_coach() && intval($this_group['session_id']) != $session_id)
) {
$edit_actions = '<a href="'.$url.'settings.php?'.api_get_cidreq(true, false).'&gidReq='.$this_group['id'].'" title="'.get_lang('Edit').'">'.
Display::return_icon('edit.png', get_lang('EditGroup'),'',ICON_SIZE_SMALL).'</a>&nbsp;';
if ($this_group['status'] == 1) {
$edit_actions .= '<a href="' . api_get_self() . '?' . api_get_cidreq(true,false) . '&category=' . $category_id . '&amp;action=set_invisible&amp;id=' . $this_group['id'] . '" title="' . get_lang('Hide') . '">' .
Display::return_icon('visible.png', get_lang('Hide'), '', ICON_SIZE_SMALL) . '</a>&nbsp;';
} else {
$edit_actions .= '<a href="' . api_get_self() . '?' . api_get_cidreq(true, false) . '&category=' . $category_id . '&amp;action=set_visible&amp;id=' . $this_group['id'] . '" title="' . get_lang('Show') . '">' .
Display::return_icon('invisible.png', get_lang('Show'), '', ICON_SIZE_SMALL) . '</a>&nbsp;';
}
$edit_actions .= '<a href="'.$url.'member_settings.php?'.api_get_cidreq(true, false).'&gidReq='.$this_group['id'].'" title="'.get_lang('GroupMembers').'">'.
Display::return_icon('user.png', get_lang('GroupMembers'), '', ICON_SIZE_SMALL).'</a>&nbsp;';
@ -2694,7 +2728,45 @@ class GroupManager
$url = api_get_path(WEB_CODE_PATH).'group/group_overview.php?'.api_get_cidreq();
$form = new FormValidator('search_groups', 'get', $url, null, array(), FormValidator::LAYOUT_INLINE);
$form->addElement('text', 'keyword');
$form->addElement('button', 'submit', get_lang('Search'));
$form->addButtonSearch();
return $form->toHtml();
}
/**
* @param int $groupId
* @param int $status
*/
public static function setStatus($groupId, $status)
{
$groupInfo = self::get_group_properties($groupId);
$courseId = api_get_course_int_id();
if (!empty($groupInfo)) {
$table = Database::get_course_table(TABLE_GROUP);
$params = array(
'status' => intval($status)
);
Database::update(
$table,
$params,
array('c_id = ? AND id = ?' => array($courseId, $groupId))
);
}
}
/**
* @param int $groupId
*/
public static function setVisible($groupId)
{
self::setStatus($groupId, 1);
}
/**
* @param int $groupId
*/
public static function setInvisible($groupId)
{
self::setStatus($groupId, 0);
}
}

@ -140,7 +140,12 @@ class PDF
$css_file = api_get_path(TO_SYS, WEB_CSS_PATH).'/print.css';
$css = file_exists($css_file) ? @file_get_contents($css_file) : '';
self::content_to_pdf($html, $css, $this->params['filename'], $this->params['course_code']);
self::content_to_pdf(
$html,
$css,
$this->params['filename'],
$this->params['course_code']
);
}
/**
@ -439,8 +444,7 @@ class PDF
$output_file = 'pdf_'.date('Y-m-d-his').'.pdf';
} else {
$pdf_name = replace_dangerous_char($pdf_name);
// Save temporally into Archive folder
$output_file = api_get_path(SYS_ARCHIVE_PATH) . $pdf_name.'.pdf';
$output_file = $pdf_name.'.pdf';
}
$this->pdf->Output($output_file, $outputMode); // F to save the pdf in a file
if ($outputMode == 'F') {

@ -50,7 +50,6 @@ class HTML_QuickForm_button extends HTML_QuickForm_input
$extra = array(),
$attributes = array()
) {
error_log(print_r(func_get_args(),1));
$icon = !empty($icon) ? $icon : 'check';
$class = !empty($class) ? $class : 'btn btn-default';
if ($class == 'primary') {

@ -332,7 +332,6 @@ class Template
*/
public function set_header($status)
{
$status = false;
$this->show_header = $status;
$this->assign('show_header', $status);

@ -325,12 +325,12 @@ class IndexManager
if (api_get_setting('allow_skills_tool') == 'true') {
$content = '<ul class="nav nav-pills nav-stacked">';
$content .= Display::tag('li', Display::url(get_lang('MySkills'), api_get_path(WEB_CODE_PATH).'social/my_skills_report.php'));
$content .= Display::tag('li', Display::url(Display::return_icon('skill-badges.png',get_lang('MySkills'),null,ICON_SIZE_SMALL).get_lang('MySkills'), api_get_path(WEB_CODE_PATH).'social/my_skills_report.php'));
$allowSkillsManagement = api_get_setting('allow_hr_skills_management') == 'true';
if (($allowSkillsManagement && api_is_drh()) || api_is_platform_admin()) {
$content .= Display::tag('li', Display::url(get_lang('ManageSkills'), api_get_path(WEB_CODE_PATH).'admin/skills_wheel.php'));
$content .= Display::tag('li', Display::url(Display::return_icon('edit-skill.png',get_lang('MySkills'),null,ICON_SIZE_SMALL).get_lang('ManageSkills'), api_get_path(WEB_CODE_PATH).'admin/skills_wheel.php'));
}
$content .= '</ul>';
$html = self::show_right_block(get_lang("Skills"), $content, 'skill_block');

@ -885,7 +885,7 @@ VALUES
('tool_visible_by_default_at_creation','gradebook','checkbox','Tools','true','ToolVisibleByDefaultAtCreationTitle','ToolVisibleByDefaultAtCreationComment',NULL,'Gradebook', 1),
('prevent_session_admins_to_manage_all_users', NULL, 'radio', 'Session', 'false', 'PreventSessionAdminsToManageAllUsersTitle', 'PreventSessionAdminsToManageAllUsersComment', NULL, NULL, 1),
('documents_default_visibility_defined_in_course', NULL,'radio','Tools','false','DocumentsDefaultVisibilityDefinedInCourseTitle','DocumentsDefaultVisibilityDefinedInCourseComment',NULL, NULL, 1),
('chamilo_database_version', NULL, 'textfield',NULL, '1.10.0.19','DatabaseVersion','', NULL, NULL, 0);
('chamilo_database_version', NULL, 'textfield',NULL, '0', 'DatabaseVersion','', NULL, NULL, 0);
UNLOCK TABLES;
/*!40000 ALTER TABLE settings_current ENABLE KEYS */;
@ -3464,6 +3464,7 @@ CREATE TABLE track_e_attempt_coeff (
);
-- Course
DROP TABLE IF EXISTS c_student_publication_rel_document;
CREATE TABLE IF NOT EXISTS c_student_publication_rel_document (id INT PRIMARY KEY NOT NULL AUTO_INCREMENT, work_id INT NOT NULL, document_id INT NOT NULL, c_id INT NOT NULL);
DROP TABLE IF EXISTS c_student_publication_rel_user;
@ -3471,3 +3472,14 @@ CREATE TABLE IF NOT EXISTS c_student_publication_rel_user ( id INT PRIMARY KEY
DROP TABLE IF EXISTS c_student_publication_comment;
CREATE TABLE IF NOT EXISTS c_student_publication_comment ( id INT PRIMARY KEY NOT NULL AUTO_INCREMENT, work_id INT NOT NULL, c_id INT NOT NULL, comment text, file VARCHAR(255), user_id int NOT NULL, sent_at datetime NOT NULL);
DROP TABLE IF EXISTS c_attendance_calendar_rel_group;
CREATE TABLE c_attendance_calendar_rel_group (
id int NOT NULL auto_increment PRIMARY KEY,
c_id INT NOT NULL,
group_id INT NOT NULL,
calendar_id INT NOT NULL
);
-- Version
UPDATE settings_current SET selected_value = '1.10.0.21' WHERE variable = 'chamilo_database_version';

@ -89,17 +89,18 @@ INSERT INTO settings_current (variable, subkey, type, category, selected_value,
INSERT INTO settings_options (variable, value, display_text) VALUES ('documents_default_visibility_defined_in_course', 'true', 'Yes');
INSERT INTO settings_options (variable, value, display_text) VALUES ('documents_default_visibility_defined_in_course', 'false', 'No');
-- Do not move this query
UPDATE settings_current SET selected_value = '1.10.0.19' WHERE variable = 'chamilo_database_version';
-- xxCOURSExx
ALTER TABLE c_survey ADD visible_results INT UNSIGNED DEFAULT 0;
ALTER TABLE c_lp_item ADD COLUMN prerequisite_min_score float;
ALTER TABLE c_lp_item ADD COLUMN prerequisite_max_score float;
ALTER TABLE c_student_publication ADD COLUMN document_id int DEFAULT 0;
ALTER TABLE c_group_info ADD COLUMN status tinyint DEFAULT 1;
CREATE TABLE IF NOT EXISTS c_student_publication_rel_document (id INT PRIMARY KEY NOT NULL AUTO_INCREMENT, work_id INT NOT NULL, document_id INT NOT NULL, c_id INT NOT NULL);
CREATE TABLE IF NOT EXISTS c_student_publication_rel_user (id INT PRIMARY KEY NOT NULL AUTO_INCREMENT, work_id INT NOT NULL, user_id INT NOT NULL, c_id INT NOT NULL);
CREATE TABLE IF NOT EXISTS c_student_publication_comment (id INT PRIMARY KEY NOT NULL AUTO_INCREMENT, work_id INT NOT NULL, c_id INT NOT NULL, comment text, file VARCHAR(255), user_id int NOT NULL, sent_at datetime NOT NULL);
CREATE TABLE IF NOT EXISTS c_attendance_calendar_rel_group (id int NOT NULL auto_increment PRIMARY KEY, c_id INT NOT NULL, group_id INT NOT NULL, calendar_id INT NOT NULL);
-- Do not move this query
UPDATE settings_current SET selected_value = '1.10.0.21' WHERE variable = 'chamilo_database_version';

@ -25,7 +25,6 @@
{% endif %}
{% endblock %}
{# User picture #}
{{ user_image_block }}
@ -40,6 +39,8 @@
{# Course block - teacher #}
{{ teacher_block }}
{# Skills #}
{{ skills_block }}
{# Notice #}
{{ notice_block }}
@ -50,6 +51,7 @@
{# Links that are not added in the tabs #}
{{ navigation_course_links }}
{# Reservation block #}
{{ reservation_block }}
@ -59,8 +61,7 @@
{# Classes #}
{{ classes_block }}
{# Skills #}
{{ skills_block }}
{# Plugin courses sidebar #}
{# Plugins for footer section #}

@ -13,7 +13,6 @@
{% if show_footer == true %}
</div> <!-- end of #row" -->
</div> <!-- end of #main" -->
<div class="push"></div>
</div> <!-- end of #page section -->
</div> <!-- end of #wrapper section -->
{% endif %}

@ -34,6 +34,9 @@
</form>
{% endif %}
{% if show_header == true %}
<div id="page" class="container"><!-- page section -->
{# Bug and help notifications #}
{% block help_notifications %}
@ -105,10 +108,7 @@
{{ breadcrumb }}
{% endblock %}
</section>
<div id="top_main_content">
{# course navigation links/shortcuts need to be activated by the admin #}
{% include template ~ "/layout/course_navigation.tpl" %}
{% endif %}

@ -19,7 +19,6 @@
{% if show_footer == true %}
</div> <!-- end of #row" -->
</div> <!-- end of #main" -->
<div class="push"></div>
</div> <!-- end of #page section -->
</div> <!-- end of #wrapper section -->

Loading…
Cancel
Save