Updating UI

skala
Julio Montoya 15 years ago
parent 255beecd69
commit 49964fea8b
  1. 48
      main/attendance/attendance_calendar.php
  2. 6
      main/attendance/attendance_list.php
  3. 2
      main/attendance/attendance_sheet.php
  4. 34
      main/course_progress/thematic.php
  5. 7
      main/course_progress/thematic_plan.php
  6. 26
      main/inc/lib/attendance.lib.php

@ -54,30 +54,30 @@ if (isset($action) && $action == 'calendar_add') {
$form->addElement('datepicker', 'date_time', '', array('form_name'=>'attendance_calendar_add'), 5);
$defaults['date_time'] = date('Y-m-d H:i',api_strtotime(api_get_local_time()));
$form->addElement('html','<br /><br />');
$form->addElement('html','<br /><br />');
$form->addElement('html', '<div id="repeat_check">&nbsp;'. get_lang('RepeatDate').'<input type="checkbox" name="repeat" '.($repeat?'checked="checked"':'').' onclick="javascript: if(this.checked){document.getElementById(\'repeat-date-attendance\').style.display=\'block\';}else{document.getElementById(\'repeat-date-attendance\').style.display=\'none\';}"/>');
if ($repeat) {
$form->addElement('html', '<div id="repeat-date-attendance" style="display:block">');
} else {
$form->addElement('html', '<div id="repeat-date-attendance" style="display:none">');
}
$form->addElement('html', '<table>');
$a_repeat_type = array('daily'=>get_lang('RepeatDaily'), 'weekly'=>get_lang('RepeatWeekly'), 'monthlyByDate'=>get_lang('RepeatMonthlyByDate'));
$form->addElement('html', '<tr><td>'.get_lang('RepeatType').'</td><td>');
$form->addElement('select', 'repeat_type', '', $a_repeat_type);
$form->addElement('html', '</td></tr>');
$form->addElement('html', '<div id="repeat_check">&nbsp;'. get_lang('RepeatDate').'<input type="checkbox" name="repeat" '.($repeat?'checked="checked"':'').' onclick="javascript: if(this.checked){document.getElementById(\'repeat-date-attendance\').style.display=\'block\';}else{document.getElementById(\'repeat-date-attendance\').style.display=\'none\';}"/>');
if ($repeat) {
$form->addElement('html', '<div id="repeat-date-attendance" style="display:block">');
} else {
$form->addElement('html', '<div id="repeat-date-attendance" style="display:none">');
}
$form->addElement('html', '<table>');
$a_repeat_type = array('daily'=>get_lang('RepeatDaily'), 'weekly'=>get_lang('RepeatWeekly'), 'monthlyByDate'=>get_lang('RepeatMonthlyByDate'));
$form->addElement('html', '<tr><td>'.get_lang('RepeatType').'</td><td>');
$form->addElement('select', 'repeat_type', '', $a_repeat_type);
$form->addElement('html', '</td></tr>');
$form->addElement('html', '<tr><td>'.get_lang('RepeatEnd').'</td><td>');
$form->addElement('datepickerdate', 'end_date_time', '', array('form_name'=>'attendance_calendar_add'));
$defaults['end_date_time'] = date('Y-m-d 12:00:00');
$form->addElement('html', '</td></tr>');
$form->addElement('html', '</table>');
$form->addElement('html', '</div>');
$form->addElement('html', '</div>');
$form->addElement('html','<br /><br />');
$form->addElement('html', '<tr><td>'.get_lang('RepeatEnd').'</td><td>');
$form->addElement('datepickerdate', 'end_date_time', '', array('form_name'=>'attendance_calendar_add'));
$defaults['end_date_time'] = date('Y-m-d 12:00:00');
$form->addElement('html', '</td></tr>');
$form->addElement('html', '</table>');
$form->addElement('html', '</div>');
$form->addElement('html', '</div>');
$form->addElement('html','<br /><br />');
$form->addElement('html','<div class="clear"></div>');
$form->addElement('style_submit_button', null, get_lang('Save'), 'class="save"');
@ -106,8 +106,8 @@ if (isset($action) && $action == 'calendar_add') {
echo Display::return_icon('lp_calendar_event.png',get_lang('DateTime')).' '.$calendar['date_time'].'&nbsp;';
if (!$is_locked_attendance || api_is_platform_admin()) {
echo '<span style="margin-left:20px;">';
echo '<a href="index.php?'.api_get_cidreq().'&action=calendar_edit&calendar_id='.intval($calendar['id']).'&attendance_id='.$attendance_id.$param_gradebook.'">'.Display::return_icon('edit.gif', get_lang('Edit'), array('style'=>'vertical-align:middle')).'</a>&nbsp;';
echo '<a onclick="javascript:if(!confirm(\''.get_lang('AreYouSureToDelete').'\')) return false;" href="index.php?'.api_get_cidreq().$param_gradebook.'&action=calendar_delete&calendar_id='.intval($calendar['id']).'&attendance_id='.$attendance_id.'">'.Display::return_icon('delete.gif', get_lang('Delete'), array('style'=>'vertical-align:middle')).'</a>';
echo '<a href="index.php?'.api_get_cidreq().'&action=calendar_edit&calendar_id='.intval($calendar['id']).'&attendance_id='.$attendance_id.$param_gradebook.'">'.Display::return_icon('edit.png', get_lang('Edit'), array('style'=>'vertical-align:middle'), 22).'</a>&nbsp;';
echo '<a onclick="javascript:if(!confirm(\''.get_lang('AreYouSureToDelete').'\')) return false;" href="index.php?'.api_get_cidreq().$param_gradebook.'&action=calendar_delete&calendar_id='.intval($calendar['id']).'&attendance_id='.$attendance_id.'">'.Display::return_icon('delete.png', get_lang('Delete'), array('style'=>'vertical-align:middle'), 22).'</a>';
echo '</span>';
}
}

@ -30,8 +30,4 @@ if (api_is_allowed_to_edit(null, true)) {
$table->set_header(4, get_lang('Actions'), false,array('style'=>'text-align:center'));
$table->set_form_actions(array ('attendance_delete_select' => get_lang('DeleteAllAttendances')));
}
$table->display();
?>
$table->display();

@ -105,7 +105,7 @@ if (api_is_allowed_to_edit(null, true)) {
<form method="post" action="index.php?action=attendance_sheet_add&<?php echo api_get_cidreq().$param_gradebook.$param_filter ?>&attendance_id=<?php echo $attendance_id?>" >
<div class="attendance-sheet-content" style="width:100%;background-color:#E1E1E1;border:1px solid gray;margin-top:20px;">
<div class="attendance-sheet-content" style="width:100%;background-color:#E1E1E1;margin-top:20px;">
<div class="divTableWithFloatingHeader attendance-users-table" style="width:45%;float:left;margin:0px;padding:0px;">
<table class="tableWithFloatingHeader data_table" width="100%">
<thead>

@ -91,7 +91,7 @@ if ($action == 'thematic_list') {
echo '<tr>';
// display thematic title
echo '<td><div id="titlethematic" ><strong>'.Security::remove_XSS($thematic['title'], STUDENT).'</strong></div><div>'.Security::remove_XSS($thematic['content'], STUDENT).'</div></td>';
echo '<td><h2>'.Security::remove_XSS($thematic['title'], STUDENT).'</h2><div>'.Security::remove_XSS($thematic['content'], STUDENT).'</div></td>';
// display thematic plan data
echo '<td>';
@ -115,19 +115,24 @@ if ($action == 'thematic_list') {
$default_thematic_plan_title[$item] = $new_thematic_plan_data[$item]['title'];
}
}
$no_data = true;
if (!empty($default_thematic_plan_title)) {
foreach ($default_thematic_plan_title as $id=>$title) {
//avoid others
if ($title == 'Others' && empty($thematic_plan_data[$thematic['id']][$id]['description'])) { continue;}
if(isset($thematic_plan_data[$thematic['id']][$id]['title'])) {
echo '<div id="titlethematic" ><strong>'.Security::remove_XSS($thematic_plan_data[$thematic['id']][$id]['title'], STUDENT).'</strong></div><div>'.Security::remove_XSS($thematic_plan_data[$thematic['id']][$id]['description'], STUDENT).'</div>';
if ($title == 'Others' && empty($thematic_plan_data[$thematic['id']][$id]['description'])) { continue; }
if (!empty($thematic_plan_data[$thematic['id']][$id]['title']) && !empty($thematic_plan_data[$thematic['id']][$id]['description'])) {
echo '<h3>'.Security::remove_XSS($thematic_plan_data[$thematic['id']][$id]['title'], STUDENT).'</h3><div>';
echo Security::remove_XSS($thematic_plan_data[$thematic['id']][$id]['description'], STUDENT).'</div>';
$no_data = false;
} else {
echo '<div id="titlethematic" ><strong>'.$title.'</strong></div><br />';
//echo '<h3>'.$title.'</strong></h3><br />';
}
}
} else {
echo '<div><em>'.get_lang('StillDoNotHaveAThematicPlan').'</em></div>';
}
}
if ($no_data) {
echo '<div><em>'.get_lang('StillDoNotHaveAThematicPlan').'</em></div>';
}
echo '</td>';
// display thematic advance data
@ -135,10 +140,10 @@ if ($action == 'thematic_list') {
if (api_is_allowed_to_edit(null, true) && api_get_session_id() == $thematic['session_id']) {
echo '<div style="text-align:right"><a href="index.php?'.api_get_cidreq().'&origin=thematic_details&action=thematic_advance_list&thematic_id='.$thematic['id'].'">'.Display::return_icon('lp_quiz.png',get_lang('EditThematicAdvance'),array('style'=>'vertical-align:middle')).'</a></div><br />';
}
echo '<table width="100%">';
//if (api_is_allowed_to_edit(null, true) && api_get_session_id() == $thematic['session_id']) {
if (!empty($thematic_advance_data[$thematic['id']])) {
echo '<table width="100%">';
foreach ($thematic_advance_data[$thematic['id']] as $thematic_advance) {
$thematic_advance['start_date'] = api_get_local_time($thematic_advance['start_date']);
$thematic_advance['start_date'] = api_format_date($thematic_advance['start_date'], DATE_TIME_FORMAT_LONG);
@ -169,14 +174,13 @@ if ($action == 'thematic_list') {
echo '<td><center>-</center></td>';
}
}
}
}
echo '</tr>';
}
echo '</table>';
} else {
echo '<tr><td width="90%"><div><em>'.get_lang('ThereIsNoAThematicAdvance').'</em></div></td><td>&nbsp;</td>';
}
echo '</table>';
echo '<div><em>'.get_lang('ThereIsNoAThematicAdvance').'</em></div>';
}
echo '</td>';
echo '</tr>';
} //End for

@ -26,9 +26,6 @@ foreach($thematic_simple_list as $item) {
$i=1;
echo '<h2>'.$thematic_data['title'].'</h2>';
echo $thematic_data['content'];
echo '<div class="actions" style="margin-bottom:30px">';
if ($action == 'thematic_plan_edit') {
@ -39,6 +36,10 @@ if ($action == 'thematic_plan_edit') {
}
echo '</div>';
echo Display::tag('h2', $thematic_data['title']);
echo $thematic_data['content'];
if ($message == 'ok') {
Display::display_normal_message(get_lang('ThematicSectionHasBeenCreatedSuccessfull'));
}

@ -22,10 +22,10 @@ class Attendance
private $attendance_qualify_title;
private $attendance_weight;
// constants
// constants
const DONE_ATTENDANCE_LOG_TYPE = 'done_attendance_sheet';
CONST UPDATED_ATTENDANCE_LOG_TYPE = 'updated_attendance_sheet';
const LOCKED_ATTENDANCE_LOG_TYPE = 'locked_attendance_sheet';
const UPDATED_ATTENDANCE_LOG_TYPE = 'updated_attendance_sheet';
const LOCKED_ATTENDANCE_LOG_TYPE = 'locked_attendance_sheet';
public function __construct() {}
@ -123,16 +123,16 @@ class Attendance
$actions .= '<center>';
if (api_is_platform_admin()) {
$actions .= '<a href="index.php?'.api_get_cidreq().'&action=attendance_edit&attendance_id='.$attendance[0].$param_gradebook.'">'.Display::return_icon('edit.gif',get_lang('Edit')).'</a>&nbsp;';
$actions .= '<a onclick="javascript:if(!confirm(\''.get_lang('AreYouSureToDelete').'\')) return false;" href="index.php?'.api_get_cidreq().'&action=attendance_delete&attendance_id='.$attendance[0].$param_gradebook.'">'.Display::return_icon('delete.gif',get_lang('Delete')).'</a>';
$actions .= '<a href="index.php?'.api_get_cidreq().'&action=attendance_edit&attendance_id='.$attendance[0].$param_gradebook.'">'.Display::return_icon('edit.png',get_lang('Edit'), array(), 22).'</a>&nbsp;';
$actions .= '<a onclick="javascript:if(!confirm(\''.get_lang('AreYouSureToDelete').'\')) return false;" href="index.php?'.api_get_cidreq().'&action=attendance_delete&attendance_id='.$attendance[0].$param_gradebook.'">'.Display::return_icon('delete.png',get_lang('Delete'), array(), 22).'</a>';
} else {
$is_locked_attendance = self::is_locked_attendance($attendance[0]);
if ($is_locked_attendance) {
$actions .= Display::return_icon('edit_na.gif',get_lang('Edit')).'&nbsp;';
$actions .= Display::return_icon('delete_na.gif',get_lang('Delete'));
} else {
$actions .= '<a href="index.php?'.api_get_cidreq().'&action=attendance_edit&attendance_id='.$attendance[0].$param_gradebook.'">'.Display::return_icon('edit.gif',get_lang('Edit')).'</a>&nbsp;';
$actions .= '<a onclick="javascript:if(!confirm(\''.get_lang('AreYouSureToDelete').'\')) return false;" href="index.php?'.api_get_cidreq().'&action=attendance_delete&attendance_id='.$attendance[0].$param_gradebook.'">'.Display::return_icon('delete.gif',get_lang('Delete')).'</a>';
$actions .= '<a href="index.php?'.api_get_cidreq().'&action=attendance_edit&attendance_id='.$attendance[0].$param_gradebook.'">'.Display::return_icon('edit.png',get_lang('Edit'), array(), 22).'</a>&nbsp;';
$actions .= '<a onclick="javascript:if(!confirm(\''.get_lang('AreYouSureToDelete').'\')) return false;" href="index.php?'.api_get_cidreq().'&action=attendance_delete&attendance_id='.$attendance[0].$param_gradebook.'">'.Display::return_icon('delete.png',get_lang('Delete'), array(), 22).'</a>';
}
}
@ -402,12 +402,12 @@ class Attendance
$users_absent = array_diff($user_ids,$users_present);
$affected_rows = 0;
// get last edit type
$calendar_data = $this->get_attendance_calendar_by_id($calendar_id);
$lastedit_type = self::DONE_ATTENDANCE_LOG_TYPE;
if ($calendar_data['done_attendance']) {
$lastedit_type = self::UPDATED_ATTENDANCE_LOG_TYPE;
}
// get last edit type
$calendar_data = $this->get_attendance_calendar_by_id($calendar_id);
$lastedit_type = self::DONE_ATTENDANCE_LOG_TYPE;
if ($calendar_data['done_attendance']) {
$lastedit_type = self::UPDATED_ATTENDANCE_LOG_TYPE;
}
// save users present in class
foreach ($users_present as $user_present) {

Loading…
Cancel
Save