Fixing attendance calendar view

skala
Julio Montoya 14 years ago
parent 59f6e54cc0
commit ef8c2961f1
  1. 42
      main/attendance/attendance_sheet.php
  2. 26
      main/attendance/index.php
  3. 5
      main/css/base.css

@ -94,7 +94,9 @@ if (api_is_allowed_to_edit(null, true)) {
// Copy row width from whole table // Copy row width from whole table
floatingHeaderRow.css("width", $(this).css("width")); floatingHeaderRow.css("width", $(this).css("width"));
floatingHeaderRow.css("visibility", "visible"); floatingHeaderRow.css("visibility", "visible");
floatingHeaderRow.css("z-index", "1000");
originalHeaderRow.css("height", "80px");
} else { } else {
floatingHeaderRow.css("visibility", "hidden"); floatingHeaderRow.css("visibility", "hidden");
floatingHeaderRow.css("top", "0px"); floatingHeaderRow.css("top", "0px");
@ -103,21 +105,21 @@ if (api_is_allowed_to_edit(null, true)) {
} }
$(document).ready(function() { $(document).ready(function() {
$("table.tableWithFloatingHeader").each(function() { $("table.tableWithFloatingHeader").each(function() {
$(this).wrap("<div class=\"divTableWithFloatingHeader\" style=\"position:relative\"></div>"); $(this).wrap("<div class=\"divTableWithFloatingHeader\" style=\"position:relative\"></div>");
var originalHeaderRow = $("tr:first", this) var originalHeaderRow = $("tr:first", this)
originalHeaderRow.before(originalHeaderRow.clone()); originalHeaderRow.before(originalHeaderRow.clone());
var clonedHeaderRow = $("tr:first", this) var clonedHeaderRow = $("tr:first", this)
clonedHeaderRow.addClass("tableFloatingHeader"); clonedHeaderRow.addClass("tableFloatingHeader");
clonedHeaderRow.css("position", "absolute"); clonedHeaderRow.css("position", "absolute");
clonedHeaderRow.css("top", "0px"); clonedHeaderRow.css("top", "0px");
clonedHeaderRow.css("left", $(this).css("margin-left")); clonedHeaderRow.css("left", $(this).css("margin-left"));
clonedHeaderRow.css("visibility", "hidden"); clonedHeaderRow.css("visibility", "hidden");
originalHeaderRow.addClass("tableFloatingHeaderOriginal"); originalHeaderRow.addClass("tableFloatingHeaderOriginal");
}); });
UpdateTableHeaders(); UpdateTableHeaders();
$(window).scroll(UpdateTableHeaders); $(window).scroll(UpdateTableHeaders);
@ -132,7 +134,7 @@ if (api_is_allowed_to_edit(null, true)) {
<table class="tableWithFloatingHeader data_table" width="100%"> <table class="tableWithFloatingHeader data_table" width="100%">
<thead> <thead>
<tr class="tableFloatingHeader" style="position: absolute; top: 0px; left: 0px; visibility: hidden; margin:0px;padding:0px" > <tr class="tableFloatingHeader" style="position: absolute; top: 0px; left: 0px; visibility: hidden; margin:0px;padding:0px" >
<th height="65px" width="10px"><?php echo '#'; ?></th> <th width="10px"><?php echo '#'; ?></th>
<th width="10px"><?php echo get_lang('Photo')?></th> <th width="10px"><?php echo get_lang('Photo')?></th>
<th width="100px"><?php echo get_lang('LastName')?></th> <th width="100px"><?php echo get_lang('LastName')?></th>
<th width="100px"><?php echo get_lang('FirstName')?></th> <th width="100px"><?php echo get_lang('FirstName')?></th>
@ -201,13 +203,13 @@ if (api_is_allowed_to_edit(null, true)) {
$img_lock = Display::return_icon('unlock.gif',get_lang('DateLock'),array('class'=>'img_unlock','id'=>'datetime_column_'.$calendar['id'])); $img_lock = Display::return_icon('unlock.gif',get_lang('DateLock'),array('class'=>'img_unlock','id'=>'datetime_column_'.$calendar['id']));
} }
$result .= '<th height="65px" width="500px" style="padding:1px 5px;" >'; $result .= '<th height="80px" width="800px">';
$result .= '<center><div style="font-size:10px;width:80px;">'.$datetime.'&nbsp;'; $result .= '<center><div style="font-size:10px;width:80px;">'.$datetime.'&nbsp;';
$result .= '<span id="attendance_lock" style="cursor:pointer">'.(!$is_locked_attendance || api_is_platform_admin()?$img_lock:'').'</span>'; $result .= '<span id="attendance_lock" style="cursor:pointer">'.(!$is_locked_attendance || api_is_platform_admin()?$img_lock:'').'</span>';
$result .= '<br /><input type="checkbox" class="checkbox_head_'.$calendar['id'].'" id="checkbox_head_'.$calendar['id'].'" '.$disabled_check.' checked="checked" />'.$input_hidden.'</div></center></th>'; $result .= '<br /><input type="checkbox" class="checkbox_head_'.$calendar['id'].'" id="checkbox_head_'.$calendar['id'].'" '.$disabled_check.' checked="checked" />'.$input_hidden.'</div></center></th>';
} }
} else { } else {
$result = '<th height="65px" width="2000px"><span><a href="index.php?'.api_get_cidreq().'&action=calendar_list&attendance_id='.$attendance_id.$param_gradebook.'">'; $result = '<th width="2000px"><span><a href="index.php?'.api_get_cidreq().'&action=calendar_list&attendance_id='.$attendance_id.$param_gradebook.'">';
$result .=Display::return_icon('attendance_calendar.png',get_lang('AttendanceCalendar'),'','32').' '.get_lang('GoToAttendanceCalendar').'</a></span></th>'; $result .=Display::return_icon('attendance_calendar.png',get_lang('AttendanceCalendar'),'','32').' '.get_lang('GoToAttendanceCalendar').'</a></span></th>';
} }
?> ?>
@ -250,7 +252,7 @@ if (api_is_allowed_to_edit(null, true)) {
$disabled = 'disabled'; $disabled = 'disabled';
$style_td = ''; $style_td = '';
if ($next_attendance_calendar_id == $calendar['id']) { if ($next_attendance_calendar_id == $calendar['id']) {
$style_td = 'background-color:#e1e1e1'; $style_td = 'background-color:#F6F38C;opacity:0.4';
$disabled = ''; $disabled = '';
} }
?> ?>

@ -74,7 +74,10 @@ if (!empty($attendance_id)) {
$htmlHeadXtra[] = '<script language="javascript"> $htmlHeadXtra[] = '<script language="javascript">
$(function() { $(function() {
$("table th img").click(function() { $("table th img").click(function() {
var col_id = this.id; var col_id = this.id;
var col_split = col_id.split("_"); var col_split = col_id.split("_");
@ -85,8 +88,8 @@ $(function() {
//lock //lock
$(".checkbox_head_"+calendar_id).attr("disabled", true); $(".checkbox_head_"+calendar_id).attr("disabled", true);
$(".row_odd td.checkboxes_col_"+calendar_id).css({"background-color":"#F9F9F9", "border-left":"none","border-right":"none"}); $(".row_odd td.checkboxes_col_"+calendar_id).css({"opacity":"1","background-color":"#F9F9F9", "border-left":"none","border-right":"none"});
$(".row_even td.checkboxes_col_"+calendar_id).css({"background-color":"#FFF", "border-left":"none","border-right":"none"}); $(".row_even td.checkboxes_col_"+calendar_id).css({"opacity":"1","background-color":"#FFF", "border-left":"none","border-right":"none"});
$(".checkboxes_col_"+calendar_id+" input:checkbox").attr("disabled",true); $(".checkboxes_col_"+calendar_id+" input:checkbox").attr("disabled",true);
$(this).attr("src","'.api_get_path(WEB_CODE_PATH).'img/lock.gif"); $(this).attr("src","'.api_get_path(WEB_CODE_PATH).'img/lock.gif");
$(this).attr("title","'.get_lang('DateUnLock').'"); $(this).attr("title","'.get_lang('DateUnLock').'");
@ -95,13 +98,26 @@ $(function() {
$("#hidden_input_"+calendar_id).attr("value",""); $("#hidden_input_"+calendar_id).attr("value","");
$("#hidden_input_"+calendar_id).attr("disabled",true); $("#hidden_input_"+calendar_id).attr("disabled",true);
return false; return false;
} else { } else {
//unlock //Unlock
$(".checkbox_head_"+calendar_id).attr("disabled", false); $(".checkbox_head_"+calendar_id).attr("disabled", false);
$(".checkbox_head_"+calendar_id).removeAttr("disabled"); $(".checkbox_head_"+calendar_id).removeAttr("disabled");
$(".checkboxes_col_"+calendar_id).css({"opacity":"0.4","background-color":"#F6F38C", "border-left":"1px #EEEE00 solid", "border-right":"1px #EEEE00 solid", "z-index":"1" });
$(".checkboxes_col_"+calendar_id).mouseover(function() {
//$(".checkbox_head_"+calendar_id).removeAttr("opacity");
//$(".checkboxes_col_"+calendar_id).css({"opacity":"0.7","background-color":"#F6F38C", "border-left":"1px #EEEE00 solid", "border-right":"1px #EEEE00 solid" });
});
$(".checkboxes_col_"+calendar_id).mouseout(function() {
//$(".checkboxes_col_"+calendar_id).css({"opacity":"0.4","background-color":"#F6F38C", "border-left":"1px #EEEE00 solid", "border-right":"1px #EEEE00 solid" });
});
$(".checkboxes_col_"+calendar_id).css({"background-color":"#e1e1e1", "border-left":"1px #CCC solid", "border-right":"1px #CCC solid" });
$(".checkboxes_col_"+calendar_id+" input:checkbox").attr("disabled",false); $(".checkboxes_col_"+calendar_id+" input:checkbox").attr("disabled",false);
$(this).attr("src","'.api_get_path(WEB_CODE_PATH).'img/unlock.gif"); $(this).attr("src","'.api_get_path(WEB_CODE_PATH).'img/unlock.gif");
$(this).attr("title","'.get_lang('DateLock').'"); $(this).attr("title","'.get_lang('DateLock').'");

@ -2187,4 +2187,9 @@ div.admin_section h4 {
padding-right:10px; padding-right:10px;
background-repeat:repeat-y; background-repeat:repeat-y;
overflow:hidden; overflow:hidden;
}
.tableFloatingHeaderOriginal th, .tableWithFloatingHeader th{
height:80px;
} }
Loading…
Cancel
Save