Adding some fixes in the calendar view + fixing bug when adding an event in the work tool

skala
Julio Montoya 15 years ago
parent 28f5a1128e
commit 84e1901be9
  1. 8
      main/admin/calendar.php
  2. 134
      main/calendar/agenda.inc.php
  3. 7
      main/calendar/agenda.php
  4. 68
      main/calendar/myagenda.inc.php
  5. 33
      main/css/base.css
  6. 32
      main/work/work.php

@ -209,14 +209,6 @@ if (api_is_allowed_to_edit(false,true)) {
$event_stop = (int) $_POST['end_fyear'].'-'.(int) $_POST['end_fmonth'].'-'.(int) $_POST['end_fday'].' '.(int) $_POST['end_fhour'].':'.(int) $_POST['end_fminute'].':00';
$id = agenda_add_item($course_info,$_POST['title'],$_POST['content'],$event_start,$event_stop,$_POST['selectedform'],false,$_POST['file_comment']);
/*
if(!empty($_POST['repeat'])) {
$end_y = intval($_POST['repeat_end_year']);
$end_m = intval($_POST['repeat_end_month']);
$end_d = intval($_POST['repeat_end_day']);
$end = mktime(23, 59, 59, $end_m, $end_d, $end_y);
$res = agenda_add_repeat_item($course_info,$id,$_POST['repeat_type'],$end,null,$_POST['file_comment']);
}*/
display_agenda_items();
} else {
show_add_form();

@ -166,10 +166,8 @@ function get_calendar_items($month, $year) {
$session_condition
GROUP BY ip.ref
ORDER BY start_date ".$_SESSION['sort'];
}
// A.3 you are a course admin without any group or user filter
} // A.3 you are a course admin without any group or user filter
else {
// A.3.a you are a course admin without user or group filter but WITH studentview
// => see all the messages of all the users and groups without editing possibilities
if ($_GET['isStudentView']=='true') {
@ -375,6 +373,7 @@ function display_minimonthcalendar($agendaitems, $month, $year, $monthName) {
/**
* show the calender of the given month
* @author: Patrick Cool <patrick.cool@UGent.be>, Ghent University
* @author Julio Montoya - adding some nice styles
* @param integer $month: the integer value of the month we are viewing
* @param integer $year: the 4-digit year indication e.g. 2005
* @return html code
@ -385,7 +384,7 @@ function display_monthcalendar($month, $year) {
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);
$data = get_calendar_items($month, $year);
//Handle leap year
$numberofdays = array(0,31,28,31,30,31,30,31,31,30,31,30,31);
@ -424,7 +423,6 @@ function display_monthcalendar($month, $year) {
if (($curday == -1) && ($ii==$startdayofweek)) {
$curday = 1;
}
if (($curday>0)&&($curday<=$numberofdays[$month])) {
$bgcolor = $ii<5 ? 'class="row_odd"' : 'class="row_even"';
@ -433,7 +431,8 @@ function display_monthcalendar($month, $year) {
if (key_exists($curday, $data)) {
foreach ($data[$curday] as $key=>$agenda_item) {
$dayheader = "<a href='".api_get_self()."?".api_get_cidreq()."&amp;sort=asc&amp;toolgroup=".Security::remove_XSS($_GET['toolgroup'])."&amp;view=list&amp;origin=$origin&amp;month=$month&amp;year=$year&amp;day=$curday#$curday'>".$curday."</a>";
//$day_url = "<a href='".api_get_self()."?".api_get_cidreq()."&amp;sort=asc&amp;toolgroup=".Security::remove_XSS($_GET['toolgroup'])."&amp;view=list&amp;origin=$origin&amp;month=$month&amp;year=$year&amp;day=$curday#$curday'>".$curday."</a>";
$dayheader = Display::div($curday, array('class'=>'agenda_day'));
$some_content = false;
foreach ($agenda_item as $key=>$value) {
@ -444,56 +443,61 @@ function display_monthcalendar($month, $year) {
$some_content = true;
$start_time = api_convert_and_format_date($value['start_date'], TIME_NO_SEC_FORMAT);
$end_time = api_convert_and_format_date($value['end_date'], TIME_NO_SEC_FORMAT);
//Setting a personal event to green
$personal_start = $personal_end = '';
if ($value['calendar_type'] == 'personal') {
$personal_start = '<div style="color:green;">'.get_lang('MyAgenda');
$personal_end = '</div>';
} elseif ($value['calendar_type'] == 'global') {
$personal_start = '<div style="color:red;">'.get_lang('GlobalEvent');
$personal_end = '</div>';
$end_time = '';
if (!empty($value['end_date']) && $value['end_date'] != '0000-00-00 00:00:00') {
$end_time = api_convert_and_format_date($value['end_date'], DATE_TIME_FORMAT_LONG);
}
$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 /><i>'.$start_time.'</i>&nbsp;</i>';
} else {
$dayheader .= '<br /><i>'.$start_time.'</i>&nbsp;-&nbsp;<i>'.$end_time.'&nbsp;</i>';
}
$dayheader .= '<br />';
$dayheader .= $value['title'];
$dayheader .= '<br/>';
switch($value['calendar_type']) {
case 'personal':
$bg_color = '#58E24C';
$subtitle = get_lang('MyAgenda');
$time = '<i>'.$start_time.'</i>&nbsp;';
break;
case 'global':
$bg_color = '#FD553D';
if (!empty($end_time)) {
$time = '<i>'.$start_time.'</i>&nbsp;-&nbsp;<i>'.$end_time.'&nbsp;</i>';
} else {
$time = '<i>'.$start_time.'</i>&nbsp;';
}
$subtitle = get_lang('GlobalEvent');
break;
case 'course':
$bg_color = '#FFF';
$subtitle = get_lang('Course');
if (!empty($end_time)) {
$time = '<i>'.$start_time.'</i>&nbsp;-&nbsp;<i>'.$end_time.'&nbsp;</i>';
} else {
$time = '<i>'.$start_time.'</i>&nbsp;';
}
break;
/*case 'work':
$bg_color = '#FDAC3D';
$subtitle = get_lang('Work');
$time = '<i>'.$start_time.'</i>&nbsp;-&nbsp;<i>'.$end_time.'&nbsp;</i>';
break;*/
default:
//$time = '<i>'.$start_time.'</i>&nbsp;-&nbsp;<i>'.$end_time.'&nbsp;</i>';
break;
}
$dayheader .= $personal_end;
} else {
//$dayheader=$curday;
//Setting a personal event to green
$dayheader.= '<div class="rounded_div_agenda" style="background-color:'.$bg_color.';">';
$value['title'] = Display::tag('strong', $value['title']);
$dayheader .= $time.' - '.$subtitle.'<br />'.$value['title'];
$dayheader .= '</div>';
}
}
//Do not show links with no content
if (!$some_content) {
$dayheader = $curday;
}
}
}
//var_dump($dayheader);
if (($curday==$today['mday']) && ($year ==$today['year'])&&($month == $today['mon'])) {
echo '<td class="days_today"'.$bgcolor.' style="height:122px;width:10%">'.$dayheader;
} else {
$class = 'days_week';
if (!is_numeric($dayheader)) {
$class = 'days_week_selected';
}
echo '<td class="'.$class.'" '.$bgcolor.' style="height:122px;width:10%">'.$dayheader;
}
echo '</td>';
@ -2974,8 +2978,6 @@ function show_add_form($id = '') {
}
function get_agendaitems($month, $year) {
global $_configuration;
$items = array ();
$month = Database::escape_string($month);
$year = Database::escape_string($year);
@ -3037,22 +3039,12 @@ function get_agendaitems($month, $year) {
$mycourse = api_get_course_info();
$result = Database::query($sqlquery);
global $_configuration;
$root_url = $_configuration['root_web'];
if ($_configuration['multiple_access_urls']) {
$access_url_id = api_get_current_access_url_id();
if ($access_url_id != -1 ) {
$url = api_get_access_url($access_url_id);
$root_url = $url['url'];
}
}
while ($item = Database::fetch_array($result))
{
while ($item = Database::fetch_array($result)) {
$agendaday_string = api_convert_and_format_date($item['start_date'], "%d", date_default_timezone_get());
$agendaday = intval($agendaday_string);
$time = api_convert_and_format_date($item['start_date'], TIME_NO_SEC_FORMAT);
$URL = $root_url.'main/calendar/agenda.php?cidReq='.$mycourse['id']."&amp;day=$agendaday&amp;month=$month&amp;year=$year#$agendaday"; // RH //Patrick Cool: to highlight the relevant agenda item
$URL = api_get_path(WEB_CODE_PATH).'calendar/agenda.php?cidReq='.$mycourse['id']."&amp;day=$agendaday&amp;month=$month&amp;year=$year#$agendaday"; // RH //Patrick Cool: to highlight the relevant agenda item
$items[$agendaday][$item['start_time']] .= '<i>'.$time.'</i> <a href="'.$URL.'" title="'.$mycourse['name'].'">'.$mycourse['official_code'].'</a> '.$item['title'].'<br />';
}
@ -3345,7 +3337,6 @@ function display_weekcalendar($agendaitems, $month, $year, $weekdaynames, $month
* Show the monthcalender of the given month
*/
function get_day_agendaitems($courses_dbs, $month, $year, $day) {
global $_configuration;
global $setting_agenda_link;
$items = array ();
@ -3427,9 +3418,7 @@ function get_day_agendaitems($courses_dbs, $month, $year, $day) {
} else {
$agenda_link = Display::return_icon('course_home.png','&nbsp;','',22);
}
//$URL = $_configuration['root_web'].$mycours["dir"]."/";
$URL = api_get_path(WEB_PATH).'main/calendar/agenda.php?cidReq='.urlencode($array_course_info["code"])."&amp;day=$day&amp;month=$month&amp;year=$year#$day"; // RH //Patrick Cool: to highlight the relevant agenda item
$URL = api_get_path(WEB_CODE_PATH).'calendar/agenda.php?cidReq='.urlencode($array_course_info["code"])."&amp;day=$day&amp;month=$month&amp;year=$year#$day"; // RH //Patrick Cool: to highlight the relevant agenda item
$items[$halfhour][] .= "<i>".$hours.":".$minutes."</i> <a href=\"$URL\" title=\"".$array_course_info['title']."\">".$agenda_link."</a> ".$item['title']."<br />";
}
@ -3450,7 +3439,6 @@ function get_day_agendaitems($courses_dbs, $month, $year, $day) {
* Return agenda items of the week
*/
function get_week_agendaitems($courses_dbs, $month, $year, $week = '') {
global $_configuration;
global $setting_agenda_link;
$TABLEAGENDA = Database :: get_course_table(TABLE_AGENDA);
@ -3540,7 +3528,7 @@ function get_week_agendaitems($courses_dbs, $month, $year, $week = '') {
$agenda_link = Display::return_icon('course_home.png','&nbsp;','',22);
}
$URL = $_configuration['root_web']."main/calendar/agenda.php?cidReq=".urlencode($array_course_info["code"])."&amp;day=$agendaday&amp;month=$month&amp;year=$year#$agendaday"; // RH //Patrick Cool: to highlight the relevant agenda item
$URL = api_get_path(WEB_CODE_PATH)."calendar/agenda.php?cidReq=".urlencode($array_course_info["code"])."&amp;day=$agendaday&amp;month=$month&amp;year=$year#$agendaday"; // RH //Patrick Cool: to highlight the relevant agenda item
//Display the events in agenda
$items[$agendaday][$item['start_date']] .= "<i>$start_time - $end_time</i> <a href=\"$URL\" title=\"".$array_course_info["title"]."\">".$agenda_link."</a>";
$items[$agendaday][$item['start_date']] .= "<div>".$item['title']."</div><br>";
@ -4275,7 +4263,7 @@ function add_year($timestamp,$num=1)
* @param int Parent id (optional)
* @return int The new item's DB ID
*/
function agenda_add_item($course_info, $title, $content, $db_start_date, $db_end_date,$to=array(), $parent_id=null,$file_comment='') {
function agenda_add_item($course_info, $title, $content, $db_start_date, $db_end_date, $to = array(), $parent_id = null, $file_comment='') {
$user_id = api_get_user_id();
// database table definitions
@ -4288,8 +4276,9 @@ function agenda_add_item($course_info, $title, $content, $db_start_date, $db_end
$content = Database::escape_string($content);
$db_start_date = api_get_utc_datetime($db_start_date);
$start_date = Database::escape_string($db_start_date);
$db_end_date = api_get_utc_datetime($db_end_date);
if (!empty($db_end_date)) {
$db_end_date = api_get_utc_datetime($db_end_date);
}
$end_date = Database::escape_string($db_end_date);
$id_session = api_get_session_id();
@ -4309,11 +4298,10 @@ function agenda_add_item($course_info, $title, $content, $db_start_date, $db_end
if ($count > 0) {
return false;
}
$sql = "INSERT INTO ".$t_agenda." (title,content, start_date, end_date".(!empty($parent_id)?',parent_event_id':'').", session_id)
VALUES('".$title."','".$content."', '".$start_date."','".$end_date."'".(!empty($parent_id)?','.((int)$parent_id):'').", '".$id_session."')";
$result = Database::query($sql) or die (Database::error());
$result = Database::query($sql);
$last_id = Database::insert_id();
// add a attachment file in agenda
@ -4665,7 +4653,6 @@ function get_global_agenda_items($agendaitems, $day = "", $month = "", $year = "
$day = Database::escape_string($day);
// 1. creating the SQL statement for getting the personal agenda items in MONTH view
global $_configuration;
$current_access_url_id = 1;
if ($_configuration['multiple_access_urls']) {
$current_access_url_id = api_get_current_access_url_id();
@ -4718,17 +4705,18 @@ function get_global_agenda_items($agendaitems, $day = "", $month = "", $year = "
$second = $agendatime[2];
// if the student has specified a course we a add a link to that course
if ($item['course'] <> "") {
$url = $_configuration['root_web']."main/admin/agenda.php?cidReq=".urlencode($item['course'])."&amp;day=$day&amp;month=$month&amp;year=$year#$day"; // RH //Patrick Cool: to highlight the relevant agenda item
$url = api_get_path(WEB_CODE_PATH)."admin/agenda.php?cidReq=".urlencode($item['course'])."&amp;day=$day&amp;month=$month&amp;year=$year#$day"; // RH //Patrick Cool: to highlight the relevant agenda item
$course_link = "<a href=\"$url\" title=\"".$item['course']."\">".$item['course']."</a>";
} else {
$course_link = "";
}
// Creating the array that will be returned. If we have week or month view we have an array with the date as the key
// if we have a day_view we use a half hour as index => key 33 = 16h30
if ($type !== "day_view") // This is the array construction for the WEEK or MONTH view
{
if ($type !== "day_view") {
// This is the array construction for the WEEK or MONTH view
//Display the Agenda global in the tab agenda (administrator)
$agendaitems[$day] .= "".get_lang('StartTimeWindow')."&nbsp;<i>$hour:$minute</i>&nbsp;-&nbsp;";
$agendaitems[$day] .= "<i>$hour:$minute</i>&nbsp;-&nbsp;";
$agendaitems[$day] .= "<b>".get_lang('GlobalEvent')."</b>";
$agendaitems[$day] .= "<div>".$item['title']."</div><br>";
} else {
@ -4740,7 +4728,7 @@ function get_global_agenda_items($agendaitems, $day = "", $month = "", $year = "
//$agendaitems[$halfhour] .= "<div><i>$hour:$minute</i> <b>".get_lang('Evento Global'). ": </b><a href=\"myagenda.php?action=view&amp;view=personal&amp;day=$day&amp;month=$month&amp;year=$year&amp;id=".$item['id']."#".$item['id']."\" class=\"personal_agenda\">".$item['title']."</a></div>";
if (!is_array($agendaitems[$halfhour]))
$content = $agendaitems[$halfhour];
$agendaitems[$halfhour] = $content."<div><i>$hour:$minute</i> <b>".get_lang('GlobalEvent'). ": </b>".$item['title']."</div>";
$agendaitems[$halfhour] = $content."<div><i>$hour:$minute</i> <b>".get_lang('GlobalEvent'). ": </b>".$item['title']."</div>";
}
}
//print_r($agendaitems);

@ -297,9 +297,7 @@ if ($_GET['view'] == 'month' || $_SESSION['view'] == 'month' ) {
} else {
echo '<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>';
echo '<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr>';
// THE LEFT PART
if (empty($_GET['origin']) or $_GET['origin']!='learnpath') {
@ -325,7 +323,6 @@ 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']) {
case 'importical' :
if (isset($_POST['ical_submit'])) {
@ -384,7 +381,7 @@ if (!$_GET['action'] || $_GET['action']=='showall' || $_GET['action']=='showcur
if(!empty($_GET['agenda_id'])) {
display_one_agenda_item($_GET['agenda_id']);
} else {
display_agenda_items($select_month, $select_year);
display_agenda_items($select_month, $select_year);
}
} else {
display_monthcalendar($select_month, $select_year);

@ -1,4 +1,4 @@
<?php //$Id: agenda.php 16490 2008-10-10 14:29:52Z elixir_inter $
<?php
/* For licensing terms, see /license.txt */
/**
@author: Patrick Cool <patrick.cool@UGent.be>, Ghent University
@ -107,8 +107,8 @@ function get_myagendaitems($courses_dbs, $month, $year) {
$items[$agendaday]=array();
}
$time = api_convert_and_format_date($item['start_date'], TIME_NO_SEC_FORMAT);
$end_time = api_convert_and_format_date($item['end_date'], TIME_NO_SEC_FORMAT);
$URL = api_get_path(WEB_PATH)."main/calendar/agenda.php?cidReq=".urlencode($array_course_info["code"])."&amp;day=$agendaday&amp;month=$month&amp;year=$year#$agendaday"; // RH //Patrick Cool: to highlight the relevant agenda item
$end_time = api_convert_and_format_date($item['end_date'], DATE_TIME_FORMAT_LONG);
$URL = api_get_path(WEB_CODE_PATH)."calendar/agenda.php?cidReq=".urlencode($array_course_info["code"])."&amp;day=$agendaday&amp;month=$month&amp;year=$year#$agendaday"; // RH //Patrick Cool: to highlight the relevant agenda item
if ($setting_agenda_link == 'coursecode') {
$title=$array_course_info['title'];
$agenda_link = api_substr($title, 0, 14);
@ -181,7 +181,7 @@ function display_mymonthcalendar($agendaitems, $month, $year, $weekdaynames=arra
$curday = 1;
}
if (($curday > 0) && ($curday <= $numberofdays[$month])) {
$bgcolor = $ii < 5 ? $class = 'class="days_week" style="height:122px;width:10%;"' : $class = 'class="days_weekend" style="width:10%;"';
$bgcolor = $class = 'class="days_week"';
$dayheader = "<b>$curday</b><br />";
if (($curday == $today['mday']) && ($year == $today['year']) && ($month == $today['mon'])) {
$dayheader = "<b>$curday</b><br />";
@ -189,12 +189,47 @@ function display_mymonthcalendar($agendaitems, $month, $year, $weekdaynames=arra
}
echo "<td ".$class.">".$dayheader;
if (!empty($agendaitems[$curday])) {
echo "<span class=\"agendaitem\">".$agendaitems[$curday]."</span>";
$data = $agendaitems[$curday];
/*
$start_time = api_convert_and_format_date($value['start_date'], TIME_NO_SEC_FORMAT);
$end_time = api_convert_and_format_date($value['end_date'], DATE_TIME_FORMAT_LONG);
$value = null;
switch($value['calendar_type']) {
case 'personal':
$bg_color = '#58E24C';
$subtitle = get_lang('MyAgenda');
$time = '<i>'.$start_time.'</i>&nbsp;</i>';
break;
case 'global':
$bg_color = '#FD553D';
$time = '<i>'.$start_time.'</i>&nbsp;-&nbsp;<i>'.$end_time.'&nbsp;</i>';
$subtitle = get_lang('GlobalEvent');
break;
case 'course':
$bg_color = '#FFF';
$subtitle = get_lang('Course');
$time = '<i>'.$start_time.'</i>&nbsp;-&nbsp;<i>'.$end_time.'&nbsp;</i>';
break;
default:
//$time = '<i>'.$start_time.'</i>&nbsp;-&nbsp;<i>'.$end_time.'&nbsp;</i>';
break;
}*/
//Setting a personal event to green
$result = '<div class="rounded_div_agenda" style="background-color:'.$bg_color.';">';
$value['title'] = Display::tag('strong', $value['title']);
//$result .= $time.' - '.$subtitle.'<br />'.$value['title'];
$result .= $data;
$result .= '</div>';
echo $result;
}
echo "</td>";
$curday ++;
} else {
echo "<td>&nbsp;</td>";
echo "<td></td>";
}
}
echo "</tr>";
@ -553,8 +588,6 @@ function get_courses_of_user() {
* This function retrieves all the personal agenda items and add them to the agenda items found by the other functions.
*/
function get_personal_agenda_items($agendaitems, $day = "", $month = "", $year = "", $week = "", $type) {
global $_configuration;
$tbl_personal_agenda = Database :: get_user_personal_table(TABLE_PERSONAL_AGENDA);
// 1. creating the SQL statement for getting the personal agenda items in MONTH view
if ($type == "month_view" or $type == "") // we are in month view
@ -585,22 +618,6 @@ function get_personal_agenda_items($agendaitems, $day = "", $month = "", $year =
$end_filter = $year."-".$month."-".$day." 23:59:59";
$sql = " SELECT * FROM ".$tbl_personal_agenda." WHERE user='".api_get_user_id()."' AND date>='".$start_filter."' AND date<='".$end_filter."'";
}
//echo "day:".$day."/";
//echo "month:".$month."/";
//echo "year:".$year."/";
//echo "week:".$week."/";
//echo $type."<p>";
//echo "<pre>".$sql."</pre>";
global $_configuration;
$root_url = $_configuration['root_web'];
if ($_configuration['multiple_access_urls']) {
$access_url_id = api_get_current_access_url_id();
if ($access_url_id != -1 ) {
$url = api_get_access_url($access_url_id);
$root_url = $url['url'];
}
}
$result = Database::query($sql);
while ($item = Database::fetch_array($result)) {
@ -620,7 +637,7 @@ function get_personal_agenda_items($agendaitems, $day = "", $month = "", $year =
$second = $agendatime[2];
// if the student has specified a course we a add a link to that course
if ($item['course'] <> "") {
$url = $root_url."main/calendar/agenda.php?cidReq=".urlencode($item['course'])."&amp;day=$day&amp;month=$month&amp;year=$year#$day"; // RH //Patrick Cool: to highlight the relevant agenda item
$url = api_get_path(WEB_CODE_PATH)."calendar/agenda.php?cidReq=".urlencode($item['course'])."&amp;day=$day&amp;month=$month&amp;year=$year#$day"; // RH //Patrick Cool: to highlight the relevant agenda item
$course_link = "<a href=\"$url\" title=\"".$item['course']."\">".$item['course']."</a>";
} else {
$course_link = "";
@ -835,7 +852,6 @@ function show_simple_personal_agenda($user_id) {
} else {
return $content;
}
}
/**

@ -90,10 +90,10 @@ input.maininput:focus {
background: none repeat scroll 0 0 #FFFFFF;
border: 1px solid #E5E5E5;
-webkit-border-radius: 11px 11px 11px 11px;
-opera-border-radius: 11px 11px 11px 11px;
-moz-border-radius: 11px 11px 11px 11px;
border-radius: 11px 11px 11px 11px;
-webkit-border-radius: 11px;
-opera-border-radius: 11px;
-moz-border-radius: 11px;
border-radius: 11px;
-webkit-box-shadow: 0 4px 18px #C8C8C8;
-opera-box-shadow: 0 4px 18px #C8C8C8;
@ -105,3 +105,28 @@ input.maininput:focus {
margin: 10px 8px 15px 15px;
padding: 16px 12px 5px;
}
.rounded_div_agenda {
background: none repeat scroll 0 0 #FFFFFF;
-webkit-border-radius: 11px;
-opera-border-radius: 11px;
-moz-border-radius: 11px;
border-radius: 11px;
-webkit-box-shadow: 0 4px 18px #C8C8C8;
-opera-box-shadow: 0 4px 18px #C8C8C8;
-moz-box-shadow: 0 4px 18px #C8C8C8;
box-shadow: 0 4px 18px #C8C8C8;
float: left;
height: auto;
margin: 10px 8px 15px 15px;
padding: 8px;
width: 80%;
}
.agenda_day {
float:left;
margin:5px;
}

@ -537,15 +537,15 @@ if (!empty($_REQUEST['new_dir'])) {
require_once api_get_path(SYS_CODE_PATH).'calendar/agenda.inc.php';
require_once api_get_path(SYS_CODE_PATH).'resourcelinker/resourcelinker.inc.php';
$course = isset($course_info) ? $course_info : null;
$date = api_get_utc_datetime();
$date = time();
$title = Security::remove_XSS($_POST['new_dir']);
if (!empty($_POST['type1'])) {
$date = api_get_utc_datetime(get_date_from_select('expires'));
$date = get_date_from_select('expires');
$title = sprintf(get_lang('HandingOverOfTaskX'),Security::remove_XSS($_POST['new_dir']));
}
$content = '<a href="'.api_get_self().'?'.api_get_cidreq().'&amp;curdirpath='.substr(Security::remove_XSS($dir_name_sql), 1).'" >'.Security::remove_XSS($_POST['new_dir']).'</a> - '.Security::remove_XSS($_POST['description']);
$agenda_id = agenda_add_item($course, $title, $content, $date, $date, array('GROUP:'.$toolgroup), 0);
$agenda_id = agenda_add_item($course, $title, $content, $date, '', array('GROUP:'.$toolgroup), 0);
}
$sql_add_publication = "INSERT INTO " . $work_table . " SET " .
"url = '".Database::escape_string($dir_name_sql)."',
@ -583,12 +583,12 @@ if (!empty($_REQUEST['new_dir'])) {
if (!empty($_POST['type1']) || !empty($_POST['type2'])) {
$enable_calification = isset($_POST['enable_calification']) ? (int)$_POST['enable_calification'] : null;
$sql_add_homework = "INSERT INTO $TSTDPUBASG SET " .
"expires_on = '".((isset($_POST['type1']) && $_POST['type1']==1) ? api_get_utc_datetime(get_date_from_select('expires')) : '0000-00-00 00:00:00'). "',
ends_on = '".((isset($_POST['type2']) && $_POST['type2']==1) ? api_get_utc_datetime(get_date_from_select('ends')) : '0000-00-00 00:00:00')."',
add_to_calendar = '$agenda_id',
enable_qualification = '".$enable_calification."',
publication_id = '".$id."'";
$sql_add_homework = "INSERT INTO $TSTDPUBASG SET
expires_on = '".((isset($_POST['type1']) && $_POST['type1']==1) ? api_get_utc_datetime(get_date_from_select('expires')) : '0000-00-00 00:00:00'). "',
ends_on = '".((isset($_POST['type2']) && $_POST['type2']==1) ? api_get_utc_datetime(get_date_from_select('ends')) : '0000-00-00 00:00:00')."',
add_to_calendar = '$agenda_id',
enable_qualification = '".$enable_calification."',
publication_id = '".$id."'";
Database::query($sql_add_homework);
$sql_add_publication = "UPDATE ".$work_table." SET "."has_properties = ".Database::insert_id().", view_properties = 1 ".' where id = '.$id;
@ -596,12 +596,12 @@ if (!empty($_REQUEST['new_dir'])) {
} else {
$sql_add_homework = "INSERT INTO $TSTDPUBASG SET " .
"expires_on = '0000-00-00 00:00:00',
ends_on = '0000-00-00 00:00:00',
add_to_calendar = '$agenda_id',
enable_qualification = '".(isset($_POST['enable_calification'])?(int)$_POST['enable_calification']:'')."',
publication_id = '".$id."'";
$sql_add_homework = "INSERT INTO $TSTDPUBASG SET
expires_on = '0000-00-00 00:00:00',
ends_on = '0000-00-00 00:00:00',
add_to_calendar = '$agenda_id',
enable_qualification = '".(isset($_POST['enable_calification'])?(int)$_POST['enable_calification']:'')."',
publication_id = '".$id."'";
Database::query($sql_add_homework);
$sql_add_publication = "UPDATE ".$work_table." SET "."has_properties = ".Database::insert_id().", view_properties = 0 ".' where id = '.$id;
@ -623,7 +623,7 @@ if (!empty($_REQUEST['new_dir'])) {
// end features
if(api_get_course_setting('email_alert_students_on_new_homework') == 1) {
if (api_get_course_setting('email_alert_students_on_new_homework') == 1) {
send_email_on_homework_creation(api_get_course_id());
}

Loading…
Cancel
Save