Improving UI in agenda

skala
Julio Montoya 14 years ago
parent 213f327214
commit 7f42b6dff0
  1. 2
      main/admin/calendar.lib.php
  2. 66
      main/calendar/agenda.inc.php
  3. 19
      main/calendar/agenda.php
  4. 28
      main/calendar/myagenda.inc.php
  5. 38
      main/calendar/myagenda.php
  6. 12
      main/css/chamilo/default.css
  7. 13
      main/css/chamilo_electric_blue/default.css
  8. 12
      main/css/chamilo_green/default.css
  9. 12
      main/css/chamilo_orange/default.css
  10. 12
      main/css/chamilo_red/default.css

@ -491,7 +491,7 @@ function display_student_links() {
echo '<a href="'.api_get_self().'?sort=asc&amp;origin='.Security::remove_XSS($_GET['origin']).'">'.Display::return_icon('calendar_normal.png',get_lang('AgendaSortChronologicallyUp'),'','32').'</a>';
}
else {
echo '<a href="'.api_get_self().'?sort=desc&amp;origin='.Security::remove_XSS($_GET['origin']).'">'.Display::return_icon('calendar_inverse.png',get_lang('AgendaSortChronologicallyDown'),'','32').'</a>';
echo '<a href="'.api_get_self().'?sort=desc&amp;origin='.Security::remove_XSS($_GET['origin']).'"> '.Display::return_icon('calendar_inverse.png',get_lang('AgendaSortChronologicallyDown'),'','32').'</a>';
}
}
else {

@ -331,18 +331,16 @@ function display_minimonthcalendar($agendaitems, $month, $year, $monthName) {
{
$curday = 1;
}
if (($curday > 0) && ($curday <= $numberofdays[$month]))
{
if (($curday > 0) && ($curday <= $numberofdays[$month])) {
$bgcolor = $ii < 5 ? $class="class=\"days_week\"" : $class="class=\"days_weekend\"";
$dayheader = "$curday";
if (($curday == $today['mday']) && ($year == $today['year']) && ($month == $today['mon']))
{
if (($curday == $today['mday']) && ($year == $today['year']) && ($month == $today['mon'])) {
$dayheader = "$curday";
$class = "class=\"days_today\"";
}
}
echo "<td ".$class.">";
if (!empty($agendaitems[$curday]))
{
if (!empty($agendaitems[$curday])) {
$month_curday = array();
$items_curday = $agendaitems[$curday][$curday];
@ -359,17 +357,13 @@ function display_minimonthcalendar($agendaitems, $month, $year, $monthName) {
} else {
echo $dayheader;
}
}
else
{
} else {
echo $dayheader;
}
// "a".$dayheader." <span class=\"agendaitem\">".$agendaitems[$curday]."</span>";
echo "</td>";
$curday ++;
}
else
{
} else {
echo "<td>&nbsp;</td>";
}
}
@ -389,7 +383,7 @@ function display_minimonthcalendar($agendaitems, $month, $year, $monthName) {
function display_monthcalendar($month, $year) {
global $MonthsLong;
global $DaysShort;
global $origin;
global $origin;
// Grabbing all the calendar items for this year and storing it in a array + my personal calendar events if exist and if enabled
$data = get_calendar_items($month,$year);
@ -403,16 +397,16 @@ function display_monthcalendar($month, $year) {
//Start the week on monday
$startdayofweek = $dayone['wday']<>0 ? ($dayone['wday']-1) : 6;
$backwardsURL = api_get_self()."?".api_get_cidreq()."&amp;origin=$origin&amp;month=".($month==1 ? 12 : $month-1)."&amp;year=".($month==1 ? $year-1 : $year);
$forewardsURL = api_get_self()."?".api_get_cidreq()."&amp;origin=$origin&amp;month=".($month==12 ? 1 : $month+1)."&amp;year=".($month==12 ? $year+1 : $year);
$backwardsURL = api_get_self()."?".api_get_cidreq()."&view=".Security::remove_XSS($_GET['view'])."&origin=$origin&amp;month=".($month==1 ? 12 : $month-1)."&amp;year=".($month==1 ? $year-1 : $year);
$forewardsURL = api_get_self()."?".api_get_cidreq()."&view=".Security::remove_XSS($_GET['view'])."&origin=$origin&amp;month=".($month==12 ? 1 : $month+1)."&amp;year=".($month==12 ? $year+1 : $year);
$maand_array_maandnummer=$month-1;
echo '<table id="agenda_list">';
echo '<tr>';
echo '<th width="10%"><a href="'.$backwardsURL.'">'.Display::return_icon('action_prev.png',get_lang('Previous')).'</a></th>';
echo '<th width="80%" colspan="5">'.$MonthsLong[$maand_array_maandnummer].' '.$year.'</th>';
echo '<th width="10%"><a href="'.$forewardsURL.'"> '.Display::return_icon('action_next.png',get_lang('Next')).'</a></th>';
echo '<th width="10%"><a href="'.$backwardsURL.'">'.Display::return_icon('action_prev.png',get_lang('Previous'), array(), 32).'</a></th>';
echo '<th width="80%" colspan="5"><br /><h3>'.$MonthsLong[$maand_array_maandnummer].' '.$year.'</h3></th>';
echo '<th width="10%"><a href="'.$forewardsURL.'"> '.Display::return_icon('action_next.png',get_lang('Next'), array(), 32).'</a></th>';
echo '</tr>';
echo '<tr>';
@ -463,16 +457,18 @@ function display_monthcalendar($month, $year) {
$personal_end = '</div>';
}
$dayheader.= $personal_start;
$value['title'] = Display::tag('strong',$value['title']);
if ($value['end_date']=='0000-00-00 00:00:00') {
$dayheader .= '<br />'.get_lang('Work').'<br />';
$dayheader .= $value['title'];
$dayheader .= '<br/>';
} else {
if ($value['calendar_type'] == 'personal') {
$dayheader .= '<br />'.get_lang('StartTimeWindow').'&nbsp;<i>'.$start_time.'</i>&nbsp;</i>';
$dayheader .= '<br /><i>'.$start_time.'</i>&nbsp;</i>';
} else {
$dayheader .= '<br />'.get_lang('StartTimeWindow').'&nbsp;<i>'.$start_time.'</i>&nbsp;-&nbsp;'.get_lang('EndTimeWindow').'&nbsp;<i>'.$end_time.'&nbsp;</i>';
$dayheader .= '<br /><i>'.$start_time.'</i>&nbsp;-&nbsp;<i>'.$end_time.'&nbsp;</i>';
}
$dayheader .= '<br />';
$dayheader .= $value['title'];
@ -493,9 +489,13 @@ function display_monthcalendar($month, $year) {
//var_dump($dayheader);
if (($curday==$today['mday']) && ($year ==$today['year'])&&($month == $today['mon'])) {
echo '<td class="days_today"'.$bgcolor.' style="height:80px;width:10%">'.$dayheader;
echo '<td class="days_today"'.$bgcolor.' style="height:122px;width:10%">'.$dayheader;
} else {
echo '<td class="days_week" '.$bgcolor.' style="height:80px;width:10%">'.$dayheader;
$class = 'days_week';
if (!is_numeric($dayheader)) {
$class = 'days_week_selected';
}
echo '<td class="'.$class.'" '.$bgcolor.' style="height:122px;width:10%">'.$dayheader;
}
echo '</td>';
$curday++;
@ -1501,14 +1501,6 @@ function display_courseadmin_links() {
function display_student_links()
{
global $show;
if ($_SESSION['sort'] == 'DESC')
{
echo "<a href='".api_get_self()."?".api_get_cidreq()."&amp;sort=asc&amp;toolgroup=".Security::remove_XSS($_GET['toolgroup'])."&amp;origin=".Security::remove_XSS($_GET['origin'])."'>".Display::return_icon('calendar_normal.png',get_lang('AgendaSortChronologicallyUp'),'','32')."</a> ";
}
else
{
echo "<a href='".api_get_self()."?".api_get_cidreq()."&amp;sort=desc&amp;toolgroup=".Security::remove_XSS($_GET['toolgroup'])."&amp;origin=".Security::remove_XSS($_GET['origin'])."'>".Display::return_icon('calendar_inverse.png',get_lang('AgendaSortChronologicallyDown'),'','32')."</a> ";
}
// showing the link to show all items or only those of the current month
if ($_SESSION['show']=="showcurrent")
@ -1523,11 +1515,21 @@ function display_student_links()
if ($_SESSION['view'] <> 'month')
{
echo "<a href=\"".api_get_self()."?action=view&amp;toolgroup=".Security::remove_XSS($_GET['toolgroup'])."&amp;view=month\">".Display::return_icon('month_empty.png', get_lang('MonthView'),'','32')."</a> ";
if ($_SESSION['sort'] == 'DESC')
{
echo "<a href='".api_get_self()."?".api_get_cidreq()."&amp;sort=asc&amp;toolgroup=".Security::remove_XSS($_GET['toolgroup'])."&amp;origin=".Security::remove_XSS($_GET['origin'])."'>".Display::return_icon('calendar_normal.png',get_lang('AgendaSortChronologicallyUp'),'','32')."</a> ";
}
else
{
echo "<a href='".api_get_self()."?".api_get_cidreq()."&amp;sort=desc&amp;toolgroup=".Security::remove_XSS($_GET['toolgroup'])."&amp;origin=".Security::remove_XSS($_GET['origin'])."'>". Display::return_icon('calendar_inverse.png',get_lang('AgendaSortChronologicallyDown'),'','32')."</a> ";
}
}
else
{
echo "<a href=\"".api_get_self()."?action=view&amp;toolgroup=".Security::remove_XSS($_GET['toolgroup'])."&amp;view=list\">".Display::return_icon('appointments.png', get_lang('ListView'),'','32')."</a> ";
}
}

@ -293,6 +293,12 @@ if (api_is_allowed_to_edit(false,true) OR (api_get_course_setting('allow_user_ed
}
}
if ($_GET['view'] == 'month' || $_SESSION['view'] == 'month' ) {
} else {
echo '<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>';
@ -302,9 +308,9 @@ if (empty($_GET['origin']) or $_GET['origin']!='learnpath') {
// the small calendar
$MonthName = $MonthsLong[$select_month -1];
$agenda_items=get_calendar_items($select_month,$select_year);
if (api_get_setting('display_mini_month_calendar') == 'true') {
display_minimonthcalendar($agenda_items, $select_month,$select_year, $MonthName);
}
if (api_get_setting('display_mini_month_calendar') == 'true') {
display_minimonthcalendar($agenda_items, $select_month,$select_year, $MonthName);
}
echo '<br />';
if (api_get_setting('display_upcoming_events') == 'true') {
display_upcoming_events();
@ -318,6 +324,7 @@ echo '<td valign="top">';
echo '<div class="sort" style="float:left">';
echo '</div>';
}
if (api_is_allowed_to_edit(false,true) OR (api_get_course_setting('allow_user_edit_agenda') && !api_is_anonymous() && api_is_allowed_to_session_edit(false,true) )) {
switch ($_GET['action']) {
@ -393,8 +400,6 @@ echo '&nbsp;</td></tr></table>';
FOOTER
*/
// The footer is displayed only if we are not in the learnpath
if ($_GET['origin'] != 'learnpath')
{
if ($_GET['origin'] != 'learnpath') {
Display::display_footer();
}
?>
}

@ -119,7 +119,8 @@ function get_myagendaitems($courses_dbs, $month, $year) {
if(!isset($items[$agendaday][$item['start_date']])) {
$items[$agendaday][$item['start_date']] = '';
}
$items[$agendaday][$item['start_date']] .= "".get_lang('StartTimeWindow')."&nbsp;<i>".$time."</i>"."&nbsp;-&nbsp;".get_lang("EndTimeWindow")."&nbsp;<i>".$end_time."</i>&nbsp;";
$items[$agendaday][$item['start_date']] .= "<i>".$time."</i>"."&nbsp;-&nbsp;<i>".$end_time."</i>&nbsp;";
$item['title'] = '<strong>'.$item['title'].'</strong>';
$items[$agendaday][$item['start_date']] .= '<br />'."<a href=\"$URL\" title=\"".Security::remove_XSS($array_course_info['title'])."\">".$agenda_link."</a> ".Security::remove_XSS($item['title'])."<br /> ";
$items[$agendaday][$item['start_date']] .= '<br/>';
}
@ -165,7 +166,7 @@ function display_mymonthcalendar($agendaitems, $month, $year, $weekdaynames=arra
echo '<table id="agenda_list">'.'<tr>';
echo '<th width="10%"><a href="'.$backwardsURL.'">'.Display::return_icon('action_prev.png',get_lang('Previous')).'</a></th>';
echo '<th width="80%" colspan="5">'.$monthName." ".$year.'</th>';
echo '<th width="80%" colspan="5"><br /><h3>'.$monthName." ".$year.'</h3></th>';
echo '<th width="10%"><a href="'.$forewardsURL.'">'.Display::return_icon('action_next.png',get_lang('Next')).'</a></th>';
echo '</tr>';
@ -183,10 +184,10 @@ function display_mymonthcalendar($agendaitems, $month, $year, $weekdaynames=arra
$curday = 1;
}
if (($curday > 0) && ($curday <= $numberofdays[$month])) {
$bgcolor = $ii < 5 ? $class = "class=\"days_week\" style=\"width:10%;\"" : $class = "class=\"days_weekend\" style=\"width:10%;\"";
$bgcolor = $ii < 5 ? $class = 'class="days_week" style="height:122px;width:10%;"' : $class = 'class="days_weekend" style="width:10%;"';
$dayheader = "<b>$curday</b><br />";
if (($curday == $today['mday']) && ($year == $today['year']) && ($month == $today['mon'])) {
$dayheader = "<b>$curday - ".get_lang('Today')."</b><br />";
$dayheader = "<b>$curday</b><br />";
$class = "class=\"days_today\" style=\"width:10%;\"";
}
echo "<td ".$class.">", "".$dayheader;
@ -239,22 +240,17 @@ function display_myminimonthcalendar($agendaitems, $month, $year, $monthName) {
{
$curday = 1;
}
if (($curday > 0) && ($curday <= $numberofdays[$month]))
{
$bgcolor = $ii < 5 ? $class = "class=\"days_week\"" : $class = "class=\"days_weekend\"";
if (($curday > 0) && ($curday <= $numberofdays[$month])) {
$bgcolor = $ii < 5 ? $class = 'class="days_week"' : $class = 'class="days_weekend"';
$dayheader = "$curday";
if (($curday == $today['mday']) && ($year == $today['year']) && ($month == $today['mon']))
{
if (($curday == $today['mday']) && ($year == $today['year']) && ($month == $today['mon'])) {
$dayheader = "$curday";
$class = "class=\"days_today\"";
}
echo "<td ".$class.">";
if (!empty($agendaitems[$curday]))
{
if (!empty($agendaitems[$curday])) {
echo "<a href=\"".api_get_self()."?action=view&amp;view=day&amp;day=".$curday."&amp;month=".$month."&amp;year=".$year."\">".$dayheader."</a>";
}
else
{
} else {
echo $dayheader;
}
// "a".$dayheader." <span class=\"agendaitem\">".$agendaitems[$curday]."</span>";
@ -576,8 +572,8 @@ function get_personal_agenda_items($agendaitems, $day = "", $month = "", $year =
$sql = "SELECT * FROM ".$tbl_personal_agenda." WHERE user='".$_user['user_id']."' and MONTH(date)='".$month."' AND YEAR(date) = '".$year."' ORDER BY date ASC";
}
// 2. creating the SQL statement for getting the personal agenda items in WEEK view
if ($type == "week_view") // we are in week view
{
// we are in week view
if ($type == "week_view") {
$start_end_day_of_week = calculate_start_end_of_week($week, $year);
$start_day = $start_end_day_of_week['start']['day'];
$start_month = $start_end_day_of_week['start']['month'];

@ -156,31 +156,32 @@ if (isset ($_user['user_id'])) {
}
echo "</div>";
echo "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
echo "<tr>";
// output: the small calendar item on the left and the view / add links
echo "<td width=\"220\" valign=\"top\">";
$agendaitems = get_myagendaitems($courses_dbs, $month, $year);
$agendaitems = get_global_agenda_items($agendaitems, $day, $month, $year, $week, "month_view");
if (api_get_setting('allow_personal_agenda') == 'true') {
$agendaitems = get_personal_agenda_items($agendaitems, $day, $month, $year, $week, "month_view");
}
display_myminimonthcalendar($agendaitems, $month, $year, $monthName);
echo "</td>";
// the divider
// OlivierB : the image has a white background, which causes trouble if the portal has another background color. Image should be transparent. ----> echo "<td width=\"20\" background=\"../img/verticalruler.gif\">&nbsp;</td>";
echo "<td width=\"20\">&nbsp;</td>";
// the main area: day, week, month view
echo "<td valign=\"top\">";
if ($process != 'month_view') {
echo "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
echo "<tr>";
// output: the small calendar item on the left and the view / add links
echo "<td width=\"220\" valign=\"top\">";
display_myminimonthcalendar($agendaitems, $month, $year, $monthName);
echo "</td>";
// the divider
// OlivierB : the image has a white background, which causes trouble if the portal has another background color. Image should be transparent. ----> echo "<td width=\"20\" background=\"../img/verticalruler.gif\">&nbsp;</td>";
echo "<td width=\"20\">&nbsp;</td>";
// the main area: day, week, month view
echo "<td valign=\"top\">";
}
switch ($process) {
case 'month_view' :
$agendaitems = get_myagendaitems($courses_dbs, $month, $year);
$agendaitems = get_global_agenda_items($agendaitems, $day, $month, $year, $week, "month_view");
if (api_get_setting("allow_personal_agenda") == "true")
{
if (api_get_setting("allow_personal_agenda") == "true") {
$agendaitems = get_personal_agenda_items($agendaitems, $day, $month, $year, $week, "month_view");
}
display_mymonthcalendar($agendaitems, $month, $year, array(), $monthName);
@ -229,6 +230,7 @@ if (isset ($_user['user_id'])) {
break;
}
}
echo '</td></tr></table>';
Display :: display_footer();
?>
if ($process != 'month_view') {
echo '</td></tr></table>';
}
Display :: display_footer();

@ -1168,6 +1168,15 @@ input.liteoption {
}
/* The cells for the days (1->31) */
#agenda_list .days_week {
height: 40px;
width: 12%;
text-align: left;
vertical-align: top;
border: 1px solid #ccc;
border-collapse: collapse;
background-color: #fff;
}
#agenda_list .days_week_selected {
height: 40px;
width: 12%;
text-align: left;
@ -1176,6 +1185,7 @@ input.liteoption {
border-collapse: collapse;
background-color: #f5f5f5;
}
#agenda_list .days_weekend {
height: 40px;
width: 12%;
@ -1608,7 +1618,7 @@ span.form_error {
border-bottom: 1px solid #DDDDDD;
line-height: normal;
padding: 8px 10px;
text-align: left;
text-align: center;
vertical-align: middle;
background-color: #F2F2F2;
}

@ -1167,8 +1167,19 @@ input.liteoption {
vertical-align: top;
border: 1px solid #264269;
border-collapse: collapse;
background-color: #fff;
}
#agenda_list .days_week_selected {
height: 40px;
width: 12%;
text-align: left;
vertical-align: top;
border: 1px solid #ccc;
border-collapse: collapse;
background-color: #f5f5f5;
}
#agenda_list .days_weekend {
height: 40px;
width: 12%;
@ -1592,7 +1603,7 @@ span.form_error {
border-bottom: 1px solid #DDDDDD;
line-height: normal;
padding: 8px 10px;
text-align: left;
text-align: center;
vertical-align: middle;
background-color: #F2F2F2;
}

@ -1164,6 +1164,15 @@ input.liteoption {
}
/* The cells for the days (1->31) */
#agenda_list .days_week {
height: 40px;
width: 12%;
text-align: left;
vertical-align: top;
border: 1px solid #ccc;
border-collapse: collapse;
background-color: #fff;
}
#agenda_list .days_week_selected {
height: 40px;
width: 12%;
text-align: left;
@ -1172,6 +1181,7 @@ input.liteoption {
border-collapse: collapse;
background-color: #f5f5f5;
}
#agenda_list .days_weekend {
height: 40px;
width: 12%;
@ -1600,7 +1610,7 @@ span.form_error {
border-bottom: 1px solid #DDDDDD;
line-height: normal;
padding: 8px 10px;
text-align: left;
text-align: center;
vertical-align: middle;
background-color: #F2F2F2;
}

@ -1161,8 +1161,18 @@ input.liteoption {
vertical-align: top;
border: 1px solid #264269;
border-collapse: collapse;
background-color: #fff;
}
#agenda_list .days_week_selected {
height: 40px;
width: 12%;
text-align: left;
vertical-align: top;
border: 1px solid #ccc;
border-collapse: collapse;
background-color: #f5f5f5;
}
#agenda_list .days_weekend {
height: 40px;
width: 12%;
@ -1586,7 +1596,7 @@ span.form_error {
border-bottom: 1px solid #DDDDDD;
line-height: normal;
padding: 8px 10px;
text-align: left;
text-align: center;
vertical-align: middle;
background-color: #F2F2F2;
}

@ -1162,6 +1162,15 @@ input.liteoption {
}
/* The cells for the days (1->31) */
#agenda_list .days_week {
height: 40px;
width: 12%;
text-align: left;
vertical-align: top;
border: 1px solid #ccc;
border-collapse: collapse;
background-color: #fff;
}
#agenda_list .days_week_selected {
height: 40px;
width: 12%;
text-align: left;
@ -1170,6 +1179,7 @@ input.liteoption {
border-collapse: collapse;
background-color: #f5f5f5;
}
#agenda_list .days_weekend {
height: 40px;
width: 12%;
@ -1598,7 +1608,7 @@ span.form_error {
border-bottom: 1px solid #DDDDDD;
line-height: normal;
padding: 8px 10px;
text-align: left;
text-align: center;
vertical-align: middle;
background-color: #F2F2F2;
}

Loading…
Cancel
Save