[svn r17478] Implemented of the Global Agenda see FS#3391

skala
Carlos Vargas 18 years ago
parent fc9a875042
commit b9cf6373c7
  1. 3336
      main/admin/calendar.lib.php
  2. 451
      main/admin/calendar.php
  3. 164
      main/admin/calendar_ical_export.php
  4. 239
      main/admin/calendar_tbl_change.js
  5. 159
      main/admin/calendar_view.php
  6. 107
      main/admin/calendar_view_print.php
  7. 3
      main/admin/index.php
  8. 122
      main/calendar/agenda.inc.php
  9. 5
      main/calendar/myagenda.php
  10. 3
      main/inc/lib/database.lib.php
  11. 9
      main/install/dokeos_main.sql
  12. 1
      main/install/migrate-db-1.8.5-1.8.6-pre.sql

File diff suppressed because it is too large Load Diff

@ -0,0 +1,451 @@
<?php // $id: $
/*
==============================================================================
Dokeos - elearning and course management software
Copyright (c) 2008 Dokeos S.A.
For a full list of contributors, see "credits.txt".
The full license can be read in "license.txt".
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
See the GNU General Public License for more details.
Contact: Dokeos, 181 rue Royale, B-1000 Brussels, Belgium, info@dokeos.com
==============================================================================
*/
/**
==============================================================================
* @package dokeos.admin
* @author Carlos Vargas
* This file is the calendar/agenda.php
==============================================================================
*/
// name of the language file that needs to be included
$language_file[] = 'admin';
$language_file[] = 'agenda';
$language_file[] = 'resourcelinker';
// resetting the course id
$cidReset=true;
// including some necessary dokeos files
require('../inc/global.inc.php');
require_once ('../inc/lib/xajax/xajax.inc.php');
$xajax = new xajax();
$xajax->debugOn();
$xajax -> registerFunction ('search_courses');
// setting the section (for the tabs)
$this_section = SECTION_PLATFORM_ADMIN;
// Access restrictions
api_protect_admin_script(true);
// setting breadcrumbs
$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
//$interbreadcrumb[] = array('url' => 'session_list.php','name' => get_lang('SessionList'));
// Database Table Definitions
// $tbl_session_rel_course_rel_user = Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
// $tbl_session = Database::get_main_table(TABLE_MAIN_SESSION);
// $tbl_session_rel_user = Database::get_main_table(TABLE_MAIN_SESSION_USER);
// $tbl_session_rel_course = Database::get_main_table(TABLE_MAIN_SESSION_COURSE);
// $tbl_course = Database::get_main_table(TABLE_MAIN_COURSE);
// setting the name of the tool
$tool_name= get_lang('SubscribeCoursesToSession');
$id_session=intval($_GET['id_session']);
if(!api_is_platform_admin())
{
$sql = 'SELECT session_admin_id FROM '.Database :: get_main_table(TABLE_MAIN_SESSION).' WHERE id='.$id_session;
$rs = api_sql_query($sql,__FILE__,__LINE__);
if(mysql_result($rs,0,0)!=$_user['user_id'])
{
api_not_allowed(true);
}
}
/*
-----------------------------------------------------------
Libraries
-----------------------------------------------------------
*/
// containing the functions for the agenda tool
include "calendar.lib.php";
// some debug functions
include($includePath."/lib/debug.lib.inc.php");
/*==============================================================================
TREATING THE PARAMETERS
1. viewing month only or everything
2. sort ascending or descending
3. showing or hiding the send-to-specific-groups-or-users form
4. filter user or group
============================================================================== */
// 1. show all or show current month?
if (!$_SESSION['show'])
{
$_SESSION['show']="showall";
}
if (!empty($_GET['action']) and $_GET['action']=="showcurrent")
{
$_SESSION['show']="showcurrent";
}
if (!empty($_GET['action']) and $_GET['action']=="showall")
{
$_SESSION['show']="showall";
}
//echo $_SESSION['show'];
// 2. sorting order (ASC or DESC)
if (empty($_GET['sort']) and empty($_SESSION['sort']))
{
$_SESSION['sort']="DESC";
}
if (!empty($_GET['sort']) and $_GET['sort']=="asc")
{
$_SESSION['sort']="ASC";
}
if (!empty($_GET['sort']) and $_GET['sort']=="desc")
{
$_SESSION['sort']="DESC";
}
if (!empty($_GET['view']))
{
$_SESSION['view'] = $_GET['view'];
}
// 3. showing or hiding the send-to-specific-groups-or-users form
$setting_allow_individual_calendar=true;
if (empty($_POST['To']) and empty($_SESSION['allow_individual_calendar']))
{
$_SESSION['allow_individual_calendar']="hide";
}
$allow_individual_calendar_status=$_SESSION['allow_individual_calendar'];
if (!empty($_POST['To']) and ($allow_individual_calendar_status=="hide"))
{
$_SESSION['allow_individual_calendar']="show";
}
if (!empty($_GET['sort']) and ($allow_individual_calendar_status=="show"))
{
$_SESSION['allow_individual_calendar']="hide";
}
// 4. filter user or group
if (!empty($_GET['user']) or !empty($_GET['group']))
{
$_SESSION['user']=(int)$_GET['user'];
$_SESSION['group']=(int)$_GET['group'];
}if ((!empty($_GET['user']) and $_GET['user']=="none") or (!empty($_GET['group']) and $_GET['group']=="none"))
{
api_session_unregister("user");
api_session_unregister("group");
}
if (!$is_courseAdmin){
if (!empty($_GET['toolgroup'])){
$_SESSION['toolgroup']=$_GET['toolgroup'];
$toolgroup=$_GET['toolgroup'];
api_session_register('toolgroup');
}
}
//It comes from the group tools. If it's define it overwrites $_SESSION['group']
if (!empty($_GET['isStudentView']) and $_GET['isStudentView']=="false")
{
api_session_unregister("user");
api_session_unregister("group");
}
$htmlHeadXtra[] = to_javascript();
$htmlHeadXtra[] = user_group_filter_javascript();
// this loads the javascript that is needed for the date popup selection
$htmlHeadXtra[] = "<script src=\"calendar_tbl_change.js\" type=\"text/javascript\" language=\"javascript\"></script>";
// setting the name of the tool
$nameTools = get_lang('Agenda'); // language variable in trad4all.inc.php
// showing the header if we are not in the learning path, if we are in
// the learning path, we do not include the banner so we have to explicitly
// include the stylesheet, which is normally done in the header
if (empty($_GET['origin']) or $_GET['origin'] != 'learnpath')
{
Display::display_header($nameTools,'Agenda');
}
else
{
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"".$clarolineRepositoryWeb."css/default.css\"/>";
}
/* ==============================================================================
TRACKING
============================================================================== */
include('../inc/lib/events.lib.inc.php');
//event_access_tool(TOOL_CALENDAR_EVENT);
/* ==============================================================================
SETTING SOME VARIABLES
============================================================================== */
// Variable definitions
$dateNow = format_locale_date($dateTimeFormatLong);
// Defining the shorts for the days. We use camelcase because these are arrays of language variables
$DaysShort = array (get_lang("SundayShort"), get_lang("MondayShort"), get_lang("TuesdayShort"), get_lang("WednesdayShort"), get_lang("ThursdayShort"), get_lang("FridayShort"), get_lang("SaturdayShort"));
// Defining the days of the week to allow translation of the days. We use camelcase because these are arrays of language variables
$DaysLong = array (get_lang("SundayLong"), get_lang("MondayLong"), get_lang("TuesdayLong"), get_lang("WednesdayLong"), get_lang("ThursdayLong"), get_lang("FridayLong"), get_lang("SaturdayLong"));
// Defining the months of the year to allow translation of the months. We use camelcase because these are arrays of language variables
$MonthsLong = array (get_lang("JanuaryLong"), get_lang("FebruaryLong"), get_lang("MarchLong"), get_lang("AprilLong"), get_lang("MayLong"), get_lang("JuneLong"), get_lang("JulyLong"), get_lang("AugustLong"), get_lang("SeptemberLong"), get_lang("OctoberLong"), get_lang("NovemberLong"), get_lang("DecemberLong"));
// Database table definitions
$TABLEAGENDA = Database::get_main_table(TABLE_MAIN_SYSTEM_CALENDAR);
$TABLE_ITEM_PROPERTY = Database::get_course_table(TABLE_ITEM_PROPERTY);
$tbl_user = Database::get_main_table(TABLE_MAIN_USER);
$tbl_courseUser = Database::get_main_table(TABLE_MAIN_COURSE_USER);
$tbl_group = Database::get_course_table(TABLE_GROUP);
$tbl_groupUser = Database::get_course_table(TABLE_GROUP_USER);
$tbl_session_course_user= Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
/* ==============================================================================
ACCESS RIGHTS
============================================================================== */
// permission stuff - also used by loading from global in agenda.inc.php
$is_allowed_to_edit = is_allowed_to_edit() OR (api_get_course_setting('allow_user_edit_agenda') && !api_is_anonymous());
/* ==============================================================================
TITLE
============================================================================== */
// Displaying the title of the tool
api_display_tool_title($nameTools);
// tool introduction
//Display::display_introduction_section(TOOL_CALENDAR_EVENT);
// insert an anchor (top) so one can jump back to the top of the page
echo "<a name=\"top\"></a>";
/*
==============================================================================
MAIN SECTION
==============================================================================
*/
//setting the default year and month
$select_year = '';
$select_month = '';
if(!empty($_GET['year']))
{
$select_year = (int)$_GET['year'];
}
if(!empty($_GET['month']))
{
$select_month = (int)$_GET['month'];
}
if (empty($select_year) && empty($select_month))
{
$today = getdate();
$select_year = $today['year'];
$select_month = $today['mon'];
}
echo '<div class="actions" style="float:right">';
if (api_is_allowed_to_edit(false,true) OR (api_get_course_setting('allow_user_edit_agenda') && !api_is_anonymous()))
{
display_courseadmin_links();
}
echo '</div><br /><br />';
echo '<table width="100%" border="0" cellspacing="0" cellpadding="0">'
. '<tr>';
// THE LEFT PART
if (empty($_GET['origin']) or $_GET['origin']!='learnpath')
{
echo '<td width="220" height="19" valign="top">';
// 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_upcoming_events') == 'true') {
display_upcoming_events();
}*/
echo '</td>';
echo '<td width="20" background="../img/verticalruler.gif">&nbsp;</td>';
}
$fck_attribute['Width'] = '600';
$fck_attribute['Height'] = '400';
$fck_attribute['ToolbarSet'] = 'Middle';
// THE RIGHT PART
echo '<td valign="top">';
echo '<div class="sort" style="float:right">';
display_student_links();
echo '</div>';
if (api_is_allowed_to_edit(false,true))
{
switch ($_GET['action'])
{
case "add":
if(!empty($_POST['ical_submit'])) {
$course_info = api_get_course_info();
agenda_import_ical($course_info,$_FILES['ical_import']);
if (api_get_setting('display_upcoming_events') == 'true') {
display_upcoming_events();
}
display_agenda_items();
} elseif ($_POST['submit_event']) {
$course_info = api_get_course_info();
$event_start = (int) $_POST['fyear'].'-'.(int) $_POST['fmonth'].'-'.(int) $_POST['fday'].' '.(int) $_POST['fhour'].':'.(int) $_POST['fminute'].':00';
$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']);
}
if (api_get_setting('display_upcoming_events') == 'true') {
display_upcoming_events();
}
display_agenda_items();
} else {
show_add_form();
}
break;
case "edit":
if( ! (api_is_course_coach() && !api_is_element_in_the_session(TOOL_AGENDA, intval($_REQUEST['id']) ) ) )
{ // a coach can only delete an element belonging to his session
if ($_POST['submit_event'])
{ $my_id_attach = (int)$_REQUEST['id_attach'];
$my_file_comment = Database::escape_string($_REQUEST['file_comment']);
store_edited_agenda_item($my_id_attach,$my_file_comment);
if (api_get_setting('display_upcoming_events') == 'true') {
display_upcoming_events();
}
display_agenda_items();
}
else
{
$id=(int)$_GET['id'];
show_add_form($id);
}
}
else
{
if (api_get_setting('display_upcoming_events') == 'true') {
display_upcoming_events();
}
display_agenda_items();
}
break;
case "delete":
$id=(int)$_GET['id'];
if( ! (api_is_course_coach() && !api_is_element_in_the_session(TOOL_AGENDA, $id ) ) )
{ // a coach can only delete an element belonging to his session
delete_agenda_item($id);
}
if (api_get_setting('display_upcoming_events') == 'true') {
display_upcoming_events();
}
display_agenda_items();
break;
case "showhide":
$id=(int)$_GET['id'];
if( ! (api_is_course_coach() && !api_is_element_in_the_session(TOOL_AGENDA, $id ) ) )
{ // a coach can only delete an element belonging to his session
showhide_agenda_item($id);
}
if (api_get_setting('display_upcoming_events') == 'true') {
display_upcoming_events();
}
display_agenda_items();
break;
case "announce": //copying the agenda item into an announcement
$id=(int)$_GET['id'];
if( ! (api_is_course_coach() && !api_is_element_in_the_session(TOOL_AGENDA, $id ) ) )
{ // a coach can only delete an element belonging to his session
$ann_id = store_agenda_item_as_announcement($id);
$tool_group_link = (isset($_SESSION['toolgroup'])?'&toolgroup='.$_SESSION['toolgroup']:'');
echo '<br />';
Display::display_normal_message(get_lang('CopiedAsAnnouncement').'<a href="../announcements/announcements.php?id='.$ann_id.$tool_group_link.'">'.get_lang('NewAnnouncement').'</a>', false);
}
if (api_get_setting('display_upcoming_events') == 'true') {
display_upcoming_events();
}
display_agenda_items();
break;
case "delete_attach": //delete attachment file
$id_attach = (int)$_GET['id_attach'];
if (!empty($id_attach)) {
delete_attachment_file($id_attach);
}
if (api_get_setting('display_upcoming_events') == 'true') {
display_upcoming_events();
}
display_agenda_items();
break;
}
}
// this is for students and whenever the courseaministrator has not chosen any action. It is in fact the default behaviour
if (!$_GET['action'] OR $_GET['action']=="showall" OR $_GET['action']=="showcurrent" OR $_GET['action']=="view")
{
if ($_GET['origin'] != 'learnpath')
{
if (!$_SESSION['view'] OR $_SESSION['view'] <> 'month')
{
if(!empty($_GET['agenda_id']))
{
display_one_agenda_item((int)$_GET['agenda_id']);
}
else
{
display_agenda_items();
}
}
else
{
display_monthcalendar($select_month, $select_year);
}
}
else
{
display_one_agenda_item((int)$_GET['agenda_id']);
}
}
echo "&nbsp;</td></tr></table>";
/*
==============================================================================
FOOTER
==============================================================================
*/
// The footer is displayed only if we are not in the learnpath
if ($_GET['origin'] != 'learnpath')
{
Display::display_footer();
}
?>

@ -0,0 +1,164 @@
<?php // $id: $
/*
==============================================================================
Dokeos - elearning and course management software
Copyright (c) 2008 Dokeos S.A.
For a full list of contributors, see "credits.txt".
The full license can be read in "license.txt".
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
See the GNU General Public License for more details.
Contact: Dokeos, 181 rue Royale, B-1000 Brussels, Belgium, info@dokeos.com
==============================================================================
*/
/**
==============================================================================
* @package dokeos.admin
* @author Carlos Vargas
* This file is the calendar/ical_export.php
==============================================================================
*/
/**
* Initialisation
*/
// name of the language file that needs to be included
$language_file = 'agenda';
// we are not inside a course, so we reset the course id
$cidReset = true;
// setting the global file that gets the general configuration, the databases, the languages, ...
require_once ('../inc/global.inc.php');
$this_section = SECTION_MYAGENDA;
api_block_anonymous_users();
require_once (api_get_path(LIBRARY_PATH).'groupmanager.lib.php');
require_once (api_get_path(LIBRARY_PATH).'icalcreator/iCalcreator.class.php');
// setting the name of the tool
$nameTools = get_lang('MyAgenda');
// setting the database variables
//$TABLECOURS = Database :: get_main_table(TABLE_MAIN_COURSE);
//$TABLECOURSUSER = Database :: get_main_table(TABLE_MAIN_COURSE_USER);
//$TABLEAGENDA =Database::get_main_table(TABLE_MAIN_SYSTEM_CALENDAR);
//$TABLE_ITEMPROPERTY = Database :: get_course_table(TABLE_ITEM_PROPERTY);
//$tbl_personal_agenda = Database :: get_user_personal_table(TABLE_PERSONAL_AGENDA);
// the variables for the days and the months
// Defining the shorts for the days
$DaysShort = array (get_lang("SundayShort"), get_lang("MondayShort"), get_lang("TuesdayShort"), get_lang("WednesdayShort"), get_lang("ThursdayShort"), get_lang("FridayShort"), get_lang("SaturdayShort"));
// Defining the days of the week to allow translation of the days
$DaysLong = array (get_lang("SundayLong"), get_lang("MondayLong"), get_lang("TuesdayLong"), get_lang("WednesdayLong"), get_lang("ThursdayLong"), get_lang("FridayLong"), get_lang("SaturdayLong"));
// Defining the months of the year to allow translation of the months
$MonthsLong = array (get_lang("JanuaryLong"), get_lang("FebruaryLong"), get_lang("MarchLong"), get_lang("AprilLong"), get_lang("MayLong"), get_lang("JuneLong"), get_lang("JulyLong"), get_lang("AugustLong"), get_lang("SeptemberLong"), get_lang("OctoberLong"), get_lang("NovemberLong"), get_lang("DecemberLong"));
if(!empty($_GET['id']) && $_GET['id']==strval(intval($_GET['id'])))
{
define('ICAL_LANG',api_get_language_isocode());
if(!empty($_GET['type']))
{
$ical = new vcalendar();
$ical->setConfig('unique_id',api_get_path(WEB_PATH));
$ical->setProperty( 'method', 'PUBLISH' );
$ical->setConfig('url',api_get_path(WEB_PATH));
$vevent = new vevent();
switch($_GET['class'])
{
case 'public':
$vevent->setClass('PUBLIC');
break;
case 'private':
$vevent->setClass('PRIVATE');
break;
case 'confidential':
$vevent->setClass('CONFIDENTIAL');
break;
default:
$vevent->setClass('PRIVATE');
break;
}
switch($_GET['type'])
{
case 'personal':
//require_once (api_get_path(SYS_CODE_PATH).'calendar/myagenda.inc.php');
$ai = get_personal_agenda_item($_GET['id']);
$vevent->setProperty( 'summary', mb_convert_encoding($ai['title'],'UTF-8',$charset));
if(empty($ai['date'])){header('location:'.$_SERVER['REFERER_URI']);}
list($y,$m,$d,$h,$M,$s) = preg_split('/[\s:-]/',$ai['date']);
$vevent->setProperty('dtstart',array('year'=>$y,'month'=>$m,'day'=>$d,'hour'=>$h,'min'=>$M,'sec'=>$s));
if(empty($ai['enddate']))
{
$y2=$y;$m2=$m;$d2=$d;$h2=$h;$M2=$M+15;$s2=$s;
if($M2>60){$M2=$M2-60;$h2+=1;}
}
else
{
list($y2,$m2,$d2,$h2,$M2,$s2) = preg_split('/[\s:-]/',$ai['enddate']);
}
$vevent->setProperty('dtend',array('year'=>$y2,'month'=>$m2,'day'=>$d2,'hour'=>$h2,'min'=>$M2,'sec'=>$s2));
//$vevent->setProperty( 'LOCATION', get_lang('Unknown') ); // property name - case independent
$vevent->setProperty( 'description', mb_convert_encoding($ai['text'],'UTF-8',$charset));
//$vevent->setProperty( 'comment', 'This is a comment' );
$user = api_get_user_info($ai['user']);
$vevent->setProperty('organizer',$user['mail']);
$vevent->setProperty('attendee',$user['mail']);
//$vevent->setProperty( 'rrule', array( 'FREQ' => 'WEEKLY', 'count' => 4));// occurs also four next weeks
$ical->setConfig('filename',$y.$m.$d.$h.$M.$s.'-'.rand(1,1000).'.ics');
$ical->setComponent ($vevent); // add event to calendar
$ical->returnCalendar();
break;
case 'course':
$TABLEAGENDA =Database::get_main_table(TABLE_MAIN_SYSTEM_CALENDAR);
//$TABLE_ITEM_PROPERTY = Database::get_course_table(TABLE_ITEM_PROPERTY);
require_once (api_get_path(SYS_CODE_PATH).'admin/calendar.lib.php');
$ai = get_agenda_item($_GET['id']);
$vevent->setProperty( 'summary', mb_convert_encoding($ai['title'],'UTF-8',$charset));
if(empty($ai['start_date'])){header('location:'.$_SERVER['REFERER_URI']);}
list($y,$m,$d,$h,$M,$s) = preg_split('/[\s:-]/',$ai['start_date']);
$vevent->setProperty('dtstart',array('year'=>$y,'month'=>$m,'day'=>$d,'hour'=>$h,'min'=>$M,'sec'=>$s));
if(empty($ai['end_date']))
{
$y2=$y;$m2=$m;$d2=$d;$h2=$h;$M2=$M+15;$s2=$s;
if($M2>60){$M2=$M2-60;$h2+=1;}
}
else
{
list($y2,$m2,$d2,$h2,$M2,$s2) = preg_split('/[\s:-]/',$ai['end_date']);
}
$vevent->setProperty('dtend',array('year'=>$y2,'month'=>$m2,'day'=>$d2,'hour'=>$h2,'min'=>$M2,'sec'=>$s2));
$vevent->setProperty( 'description', mb_convert_encoding($ai['content'],'UTF-8',$charset));
//$vevent->setProperty( 'comment', 'This is a comment' );
$user = api_get_user_info($ai['user']);
$vevent->setProperty('organizer',$user['mail']);
//$vevent->setProperty('attendee',$user['mail']);
$course = api_get_course_info();
$vevent->setProperty('location', $course['name']); // property name - case independent
if($ai['repeat'])
{
$trans = array('daily'=>'DAILY','weekly'=>'WEEKLY','monthlyByDate'=>'MONTHLY','yearly'=>'YEARLY');
$freq = $trans[$ai['repeat_type']];
list($e_y,$e_m,$e_d) = split('/',date('Y/m/d',$ai['repeat_end']));
$vevent->setProperty('rrule',array('FREQ'=>$freq,'UNTIL'=>array('year'=>$e_y,'month'=>$e_m,'day'=>$e_d),'INTERVAL'=>'1'));
}
//$vevent->setProperty( 'rrule', array( 'FREQ' => 'WEEKLY', 'count' => 4));// occurs also four next weeks
$ical->setConfig('filename',$y.$m.$d.$h.$M.$s.'-'.rand(1,1000).'.ics');
$ical->setComponent ($vevent); // add event to calendar
$ical->returnCalendar();
break;
default:
header('location:'.$_SERVER['REFERER_URI']);
die();
}
}
}
else
{
header('location:'.$_SERVER['REFERER_URI']);
die();
}
?>

@ -0,0 +1,239 @@
var day;
var month;
var year;
var hour;
var minute;
var second;
var clock_set = 0;
/**
* Opens calendar window.
*
* @param string form name
* @param string field name
*/
function openCalendar(form, field) {
window.open("./calendar_view.php", "calendar", "width=220,height=200,status=no");
day = eval("document." + form + "." + field + "day.options["+ "document." + form + "." + field + "day.selectedIndex].value");
month = eval("document." + form + "." + field + "month.options["+ "document." + form + "." + field + "month.selectedIndex].value");
month = month-1;
year = eval("document." + form + "." + field + "year.options["+ "document." + form + "." + field + "year.selectedIndex].value");
formName = form;
fieldName =field;
}
/**
* Formats number to two digits.
*
* @param int number to format.
*/
function formatNum2(i, valtype) {
f = (i < 10 ? '0' : '') + i;
if (valtype && valtype != '') {
switch(valtype) {
case 'month':
f = (f > 12 ? 12 : f);
break;
case 'day':
f = (f > 31 ? 31 : f);
break;
}
}
return f;
}
/**
* Formats number to four digits.
*
* @param int number to format.
*/
function formatNum4(i) {
return (i < 1000 ? i < 100 ? i < 10 ? '000' : '00' : '0' : '') + i;
}
/**
* Initializes calendar window.
*/
function initCalendar() {
if (!year && !month && !day) {
day = window.opener.day;
month = window.opener.month;
year = window.opener.year;
if (isNaN(year) || isNaN(month) || isNaN(day) || day == 0) {
dt = new Date();
year = dt.getFullYear();
month = dt.getMonth();
day = dt.getDate();
}
} else {
/* Moving in calendar */
if (month > 11) {
month = 0;
year++;
}
if (month < 0) {
month = 11;
year--;
}
}
if (document.getElementById) {
cnt = document.getElementById("calendar_data");
} else if (document.all) {
cnt = document.all["calendar_data"];
}
cnt.innerHTML = "";
str = ""
//heading table
str += '<table class="calendar"><tr><th class="monthyear" width="50%">';
str += '<a href="javascript:month--; initCalendar();">&laquo;</a> ';
str += month_names[month];
str += ' <a href="javascript:month++; initCalendar();">&raquo;</a>';
str += '</th><th class="monthyear" width="50%">';
str += '<a href="javascript:year--; initCalendar();">&laquo;</a> ';
str += year;
str += ' <a href="javascript:year++; initCalendar();">&raquo;</a>';
str += '</th></tr></table>';
str += '<table class="calendar"><tr>';
for (i = 0; i < 7; i++) {
str += "<th class='daynames'>" + day_names[i] + "</th>";
}
str += "</tr>";
var firstDay = new Date(year, month, 1).getDay();
var lastDay = new Date(year, month + 1, 0).getDate();
str += "<tr>";
dayInWeek = 0;
for (i = 0; i < firstDay; i++) {
str += "<td>&nbsp;</td>";
dayInWeek++;
}
for (i = 1; i <= lastDay; i++) {
if (dayInWeek == 7) {
str += "</tr><tr>";
dayInWeek = 0;
}
dispmonth = 1 + month;
actVal = formatNum4(year) + "-" + formatNum2(dispmonth, 'month') + "-" + formatNum2(i, 'day');
if (i == day) {
style = ' class="selected"';
} else {
style = '';
}
str += "<td" + style + "><a href=\"javascript:returnDate(" + i +","+month+","+year + ");\">" + i + "</a></td>"
dayInWeek++;
}
for (i = dayInWeek; i < 7; i++) {
str += "<td>&nbsp;</td>";
}
str += "</tr></table>";
cnt.innerHTML = str;
}
/**
* Returns date from calendar.
*
* @param string date text
*/
function returnDate(d,m,y) {
cmd = "window.opener.document."+window.opener.formName+"."+window.opener.fieldName+"day.selectedIndex = "+(d-1);
eval(cmd);
cmd = "window.opener.document."+window.opener.formName+"."+window.opener.fieldName+"month.selectedIndex = "+m;
eval(cmd);
date = new Date();
year = date.getFullYear()-1;
cmd = "window.opener.document."+window.opener.formName+"."+window.opener.fieldName+"year.selectedIndex = "+(y-year);
eval(cmd);
window.close();
}
function mktime() {
var no, ma = 0, mb = 0, i = 0, d = new Date(), argv = arguments, argc = argv.length;
d.setHours(0,0,0); d.setDate(1); d.setMonth(1); d.setYear(1972);
var dateManip = {
0: function(tt){ return d.setHours(tt); },
1: function(tt){ return d.setMinutes(tt); },
2: function(tt){ set = d.setSeconds(tt); mb = d.getDate() - 1; return set; },
3: function(tt){ set = d.setMonth(parseInt(tt)-1); ma = d.getFullYear() - 1972; return set; },
4: function(tt){ return d.setDate(tt+mb); },
5: function(tt){ return d.setYear(tt+ma); }
};
for( i = 0; i < argc; i++ ){
no = parseInt(argv[i]*1);
if (isNaN(no)) {
return false;
} else {
// arg is number, lets manipulate date object
if(!dateManip[i](no)){
// failed
return false;
}
}
}
return Math.floor(d.getTime()/1000);
}
function validate_date(){
var fday = document.new_calendar_item.fday.value;
var fmonth = document.new_calendar_item.fmonth.value;
var fyear = document.new_calendar_item.fyear.value;
var fhour = document.new_calendar_item.fhour.value;
var fminute = document.new_calendar_item.fminute.value;
var fdate = mktime(fhour,fminute,0,fmonth,fday,fyear)
var end_fday = document.new_calendar_item.end_fday.value;
var end_fmonth = document.new_calendar_item.end_fmonth.value;
var end_fyear = document.new_calendar_item.end_fyear.value;
var end_fhour = document.new_calendar_item.end_fhour.value;
var end_fminute = document.new_calendar_item.end_fminute.value;
var end_fdate = mktime(end_fhour,end_fminute,0,end_fmonth,end_fday,end_fyear)
var title = document.new_calendar_item.title.value;
msg_id1 = document.getElementById(\"msg_error1\");
msg_id2 = document.getElementById(\"msg_error2\");
msg_id3 = document.getElementById(\"msg_error3\");
if(title==\"\"){
msg_id1.style.display =\"block\";
msg_id1.innerHTML=".get_lang('FieldRequired').";
msg_id2.innerHTML=\"\"; msg_id3.innerHTML=\"\";
}
else if(fdate > end_fdate)
{
msg_id2.style.display =\"block\";
msg_id2.innerHTML=".get_lang('DateExpiredNotBeLessDeadLine').";
msg_id1.innerHTML=\"\"; msg_id3.innerHTML=\"\";
}
else if (checkDate(ends_month,ends_day,ends_year) == false)
{
msg_id3.style.display =\"block\";
msg_id3.innerHTML="'.get_lang('InvalidDate').'";
msg_id1.innerHTML=""; msg_id2.innerHTML="";
}
}

@ -0,0 +1,159 @@
<?php // $id: $
/*
==============================================================================
Dokeos - elearning and course management software
Copyright (c) 2008 Dokeos S.A.
For a full list of contributors, see "credits.txt".
The full license can be read in "license.txt".
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
See the GNU General Public License for more details.
Contact: Dokeos, 181 rue Royale, B-1000 Brussels, Belgium, info@dokeos.com
==============================================================================
*/
/**
==============================================================================
* @package dokeos.admin
* @author Carlos Vargas
* This file is the calendar/calendar.php
==============================================================================
*/
// name of the language file that needs to be included
$language_file = 'agenda';
// including the claroline global
include('../inc/global.inc.php');
//session
if(isset($_GET['id_session']))
$_SESSION['id_session'] = $_GET['id_session'];
// the variables for the days and the months
// Defining the shorts for the days
$DaysShort = array(get_lang("SundayShort"), get_lang("MondayShort"), get_lang("TuesdayShort"), get_lang("WednesdayShort"), get_lang("ThursdayShort"), get_lang("FridayShort"), get_lang("SaturdayShort"));
// Defining the days of the week to allow translation of the days
$DaysLong = array(get_lang("SundayLong"), get_lang("MondayLong"), get_lang("TuesdayLong"), get_lang("WednesdayLong"), get_lang("ThursdayLong"), get_lang("FridayLong"), get_lang("SaturdayLong"));
// Defining the months of the year to allow translation of the months
$MonthsLong = array(get_lang("JanuaryLong"), get_lang("FebruaryLong"), get_lang("MarchLong"), get_lang("AprilLong"), get_lang("MayLong"), get_lang("JuneLong"), get_lang("JulyLong"), get_lang("AugustLong"), get_lang("SeptemberLong"), get_lang("OctoberLong"), get_lang("NovemberLong"), get_lang("DecemberLong"));
?>
<html>
<head>
<title>Calendar</title>
<style type="text/css">
table.calendar
{
width: 100%;
font-size: 11px;
font-family: verdana, arial, helvetica, sans-serif;
}
table.calendar .monthyear
{
background-color: #4171B5;
text-align: center;
color: #ffffff;
}
table.calendar .daynames
{
background-color: #D3DFF1;
text-align: center;
}
table.calendar td
{
width: 25px;
height: 25px;
background-color: #f5f5f5;
text-align: center;
}
table.calendar td.selected
{
border: 1px solid #ff0000;
background-color: #FFCECE;
}
table.calendar td a
{
width: 25px;
height: 25px;
text-decoration: none;
}
table.calendar td a:hover
{
background-color: #ffff00;
}
table.calendar .monthyear a
{
text-align: center;
color: #ffffff;
}
table.calendar .monthyear a:hover
{
text-align: center;
color: #ff0000;
background-color: #ffff00;
}
</style>
<script language="JavaScript" type="text/javascript">
<!--
/* added 2004-06-10 by Michael Keck
* we need this for Backwards-Compatibility and resolving problems
* with non DOM browsers, which may have problems with css 2 (like NC 4)
*/
var isDOM = (typeof(document.getElementsByTagName) != 'undefined'
&& typeof(document.createElement) != 'undefined')
? 1 : 0;
var isIE4 = (typeof(document.all) != 'undefined'
&& parseInt(navigator.appVersion) >= 4)
? 1 : 0;
var isNS4 = (typeof(document.layers) != 'undefined')
? 1 : 0;
var capable = (isDOM || isIE4 || isNS4)
? 1 : 0;
// Uggly fix for Opera and Konqueror 2.2 that are half DOM compliant
if (capable) {
if (typeof(window.opera) != 'undefined') {
var browserName = ' ' + navigator.userAgent.toLowerCase();
if ((browserName.indexOf('konqueror 7') == 0)) {
capable = 0;
}
} else if (typeof(navigator.userAgent) != 'undefined') {
var browserName = ' ' + navigator.userAgent.toLowerCase();
if ((browserName.indexOf('konqueror') > 0) && (browserName.indexOf('konqueror/3') == 0)) {
capable = 0;
}
} // end if... else if...
} // end if
//-->
</script>
<script type="text/javascript" src="calendar_tbl_change.js"></script>
<script type="text/javascript">
<!--
var month_names = new Array(
<?php
foreach($MonthsLong as $index => $month)
{
echo '"'.$month.'",';
}
?>
"");
var day_names = new Array(
<?php
foreach($DaysShort as $index => $day)
{
echo '"'.$day.'",';
}
?>
"");
//-->
</script>
</head>
<body onLoad="initCalendar();">
<div id="calendar_data"></div>
<div id="clock_data"></div>
</body>
</html>

@ -0,0 +1,107 @@
<?php // $id: $
/*
==============================================================================
Dokeos - elearning and course management software
Copyright (c) 2008 Dokeos S.A.
For a full list of contributors, see "credits.txt".
The full license can be read in "license.txt".
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
See the GNU General Public License for more details.
Contact: Dokeos, 181 rue Royale, B-1000 Brussels, Belgium, info@dokeos.com
==============================================================================
*/
/**
==============================================================================
* @package dokeos.admin
* @author Carlos Vargas
* This file is the calendar/print.php
==============================================================================
*/
// name of the language file that needs to be included
$language_file = 'agenda';
$id=$_GET['id'];
if(strstr($id,','))
{
$id=explode(',',$id);
$id=array_map('intval',$id);
$id=implode(',',$id);
}
else
{
$id=intval($id);
}
// setting the global file that gets the general configuration, the databases, the languages, ...
require('../inc/global.inc.php');
$TABLEAGENDA = Database::get_main_table(TABLE_MAIN_SYSTEM_CALENDAR);
$sql = "SELECT * FROM $TABLEAGENDA WHERE id IN($id) ORDER BY start_date DESC";
$result = api_sql_query($sql,__FILE__,__LINE__);
?>
<html>
<head>
<title><?php echo get_lang('Print'); ?></title>
<style type="text/css" media="screen, projection">
/*<![CDATA[*/
@import "../css/<?php echo api_get_setting('stylesheets'); ?>/default.css";
/*]]>*/
</style>
</head>
<body style="margin: 15px; padding: 0px;">
<center>
<input type="button" value="<?php echo htmlentities(get_lang('Print'),ENT_QUOTES,$charset); ?>" onClick="javascript:window.print();" />
</center>
<br /><br />
<?php
while($row=Database::fetch_array($result))
{
$row['content'] = $row['content'];
$row['content'] = make_clickable($row['content']);
$row['content'] = text_filter($row['content']);
$row['content'] = str_replace('<a ','<a target="_blank" ',$row['content']);
if(!empty($row['title']))
{
echo '<b>'.$row['title'].'</b><br /><br />';
}
echo get_lang('StartTime').' : ';
echo ucfirst(format_locale_date($dateFormatLong,strtotime($row["start_date"])))."&nbsp;&nbsp;&nbsp;";
echo ucfirst(strftime($timeNoSecFormat,strtotime($row["start_date"])))."";
echo '<br />';
echo get_lang('EndTime').' : ';
echo ucfirst(format_locale_date($dateFormatLong,strtotime($row["end_date"])))."&nbsp;&nbsp;&nbsp;";
echo ucfirst(strftime($timeNoSecFormat,strtotime($row["end_date"])))."";
echo '<br /><br />';
echo $row['content'].'<hr size="1" noshade="noshade" />';
}
?>
<br /><br />
<center>
<input type="button" value="<?php echo htmlentities(get_lang('Print'),ENT_QUOTES,$charset); ?>" onClick="javascript:window.print();" />
</center>
</body>
</html>

@ -1,4 +1,4 @@
<?php // $Id: index.php 16954 2008-11-26 14:41:35Z pcool $
<?php // $Id: index.php 17478 2008-12-29 20:13:08Z cvargas1 $
/*
==============================================================================
Dokeos - elearning and course management software
@ -127,6 +127,7 @@ $keyword_url = Security::remove_XSS((empty($_GET['keyword'])?'':$_GET['keyword']
<li><a href="languages.php"><?php echo get_lang('Languages'); ?></a></li>
<li><a href="configure_homepage.php"><?php echo get_lang('ConfigureHomePage'); ?></a></li>
<li><a href="statistics/index.php"><?php echo get_lang('ToolName'); ?> </a></li>
<li><a href="calendar.php"><?php echo get_lang('GlobalAgenda'); ?> </a></li>
<?php if(!empty($phpMyAdminPath)): ?>
<li><a href="<?php echo $phpMyAdminPath; ?>" target="_blank"><?php echo get_lang("AdminDatabases"); ?></a><br />(<?php echo get_lang("DBManagementOnlyForServerAdmin"); ?>)</li>
<?php endif; ?>

@ -1,4 +1,4 @@
<?php //$Id: agenda.inc.php 17413 2008-12-21 03:44:36Z ivantcholakov $
<?php //$Id: agenda.inc.php 17478 2008-12-29 20:13:08Z cvargas1 $
/*
==============================================================================
@ -65,6 +65,9 @@ function get_calendar_items($month, $year)
{
global $_user, $_course;
global $is_allowed_to_edit;
$month=Database::escape_string($month);
$year=Database::escape_string($year);
// database variables
$TABLEAGENDA=Database::get_course_table(TABLE_AGENDA);
@ -649,6 +652,12 @@ function store_new_agenda_item()
$content=trim($_POST['content']);
$start_date=(int)$_POST['fyear']."-".(int)$_POST['fmonth']."-".(int)$_POST['fday']." ".(int)$_POST['fhour'].":".(int)$_POST['fminute'].":00";
$end_date=(int)$_POST['end_fyear']."-".(int)$_POST['end_fmonth']."-".(int)$_POST['end_fday']." ".(int)$_POST['end_fhour'].":".(int)$_POST['end_fminute'].":00";
$title=Database::escape_string($title);
$content=Database::escape_string($content);
$start_date=Database::escape_string($start_date);
$end_date=Database::escape_string($end_date);
// store in the table calendar_event
$sql = "INSERT INTO ".$TABLEAGENDA."
@ -721,6 +730,8 @@ function store_agenda_item_as_announcement($item_id){
//check params
if(empty($item_id) or $item_id != strval(intval($item_id))){return -1;}
//get the agenda item
$item_id=Database::escape_string($item_id);
$sql = "SELECT * FROM $table_agenda WHERE id = '".$item_id."'";
$res = api_sql_query($sql,__FILE__,__LINE__);
if(Database::num_rows($res)>0){
@ -823,6 +834,9 @@ function sent_to($tool, $id)
global $_course;
$TABLE_ITEM_PROPERTY = Database::get_course_table(TABLE_ITEM_PROPERTY);
$tool=Database::escape_string($tool);
$id=Database::escape_string($id);
$sql="SELECT * FROM $TABLE_ITEM_PROPERTY WHERE tool='".$tool."' AND ref='".$id."'";
$result=api_sql_query($sql,__FILE__,__LINE__);
while ($row=Database::fetch_array($result))
@ -1027,6 +1041,8 @@ function show_user_group_filter_form()
function load_edit_users($tool, $id)
{
global $_course;
$tool=Database::escape_string($tool);
$id=Database::escape_string($id);
$TABLE_ITEM_PROPERTY = Database::get_course_table(TABLE_ITEM_PROPERTY);
$sql="SELECT * FROM $TABLE_ITEM_PROPERTY WHERE tool='$tool' AND ref='$id'";
@ -1062,6 +1078,8 @@ function change_visibility($tool,$id)
{
global $_course;
$TABLE_ITEM_PROPERTY = Database::get_course_table(TABLE_ITEM_PROPERTY);
$tool=Database::escape_string($tool);
$id=Database::escape_string($id);
$sql="SELECT * FROM $TABLE_ITEM_PROPERTY WHERE tool='".TOOL_CALENDAR_EVENT."' AND ref='$id'";
$result=api_sql_query($sql,__FILE__,__LINE__) or die (Database::error());
@ -1148,6 +1166,7 @@ function get_agenda_item($id)
{
global $TABLEAGENDA;
$t_agenda_repeat = Database::get_course_table(TABLE_AGENDA_REPEAT);
$id=Database::escape_string($id);
$item = array();
if(empty($id))
{
@ -1274,6 +1293,11 @@ function store_edited_agenda_item($id_attach,$file_comment)
function save_edit_agenda_item($id,$title,$content,$start_date,$end_date)
{
$TABLEAGENDA = Database::get_course_table(TABLE_AGENDA);
$id=Database::escape_string($id);
$title=Database::escape_string($title);
$content=Database::escape_string($content);
$start_date=Database::escape_string($start_date);
$end_date=Database::escape_string($end_date);
// store the modifications in the table calendar_event
$sql = "UPDATE ".$TABLEAGENDA."
@ -1298,6 +1322,7 @@ function save_edit_agenda_item($id,$title,$content,$start_date,$end_date)
function delete_agenda_item($id)
{
global $_course;
$id=Database::escape_string($id);
if (api_is_allowed_to_edit(false,true) OR (api_get_course_setting('allow_user_edit_agenda') && !api_is_anonymous()))
{
if (!empty($_GET['id']) && isset($_GET['action']) && $_GET['action']=="delete")
@ -1827,6 +1852,7 @@ function display_agenda_items()
function get_attachment($agenda_id) {
$agenda_table_attachment = Database::get_course_table(TABLE_AGENDA_ATTACHMENT);
$agenda_id=Database::escape_string($agenda_id);
$row=array();
$sql = 'SELECT id,path, filename,comment FROM '. $agenda_table_attachment.' WHERE agenda_id = '.(int)$agenda_id.'';
$result=api_sql_query($sql, __FILE__, __LINE__);
@ -4009,6 +4035,7 @@ function delete_attachment_file($id_attach) {
global $_course;
$agenda_table_attachment = Database::get_course_table(TABLE_AGENDA_ATTACHMENT);
$id_attach=Database::escape_string($id_attach);
$sql="DELETE FROM $agenda_table_attachment WHERE id = ".(int)$id_attach;
$result=api_sql_query($sql, __LINE__, __FILE__);
@ -4283,3 +4310,96 @@ function agenda_import_ical($course_info,$file)
}
return true;
}
/**
* This function retrieves one personal agenda item returns it.
* @param array The array containing existing events. We add to this array.
* @param int Day
* @param int Month
* @param int Year (4 digits)
* @param int Week number
* @param string Type of view (month_view, week_view, day_view)
* @return array The results of the database query, or null if not found
*/
function get_global_agenda_items($agendaitems, $day = "", $month = "", $year = "", $week = "", $type)
{
$tbl_global_agenda= Database::get_main_table(TABLE_MAIN_SYSTEM_CALENDAR);
global $_user;
global $_configuration;
$month=Database::escape_string($month);
$year=Database::escape_string($year);
$week=Database::escape_string($week);
$day=Database::escape_string($day);
// 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
{
$sql = "SELECT * FROM ".$tbl_global_agenda." WHERE MONTH(start_date)='".$month."' AND YEAR(start_date) = '".$year."' ORDER BY start_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
{
$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'];
$start_year = $start_end_day_of_week['start']['year'];
$end_day = $start_end_day_of_week['end']['day'];
$end_month = $start_end_day_of_week['end']['month'];
$end_year = $start_end_day_of_week['end']['year'];
// in sql statements you have to use year-month-day for date calculations
$start_filter = $start_year."-".$start_month."-".$start_day." 00:00:00";
$end_filter = $end_year."-".$end_month."-".$end_day." 23:59:59";
$sql = " SELECT * FROM ".$tbl_global_agenda." WHERE start_date>='".$start_filter."' AND start_date<='".$end_filter."'";
}
// 3. creating the SQL statement for getting the personal agenda items in DAY view
if ($type == "day_view") // we are in day view
{
// we could use mysql date() function but this is only available from 4.1 and higher
$start_filter = $year."-".$month."-".$day." 00:00:00";
$end_filter = $year."-".$month."-".$day." 23:59:59";
$sql = " SELECT * FROM ".$tbl_global_agenda." WHERE start_date>='".$start_filter."' AND start_date<='".$end_filter."'";
}
$result = api_sql_query($sql, __FILE__, __LINE__);
while ($item = Database::fetch_array($result))
{
// we break the date field in the database into a date and a time part
$agenda_db_date = explode(" ", $item['start_date']);
$date = $agenda_db_date[0];
$time = $agenda_db_date[1];
// we divide the date part into a day, a month and a year
$agendadate = explode("-", $date);
$year = intval($agendadate[0]);
$month = intval($agendadate[1]);
$day = intval($agendadate[2]);
// we divide the time part into hour, minutes, seconds
$agendatime = explode(":", $time);
$hour = $agendatime[0];
$minute = $agendatime[1];
$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
$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
{
$agendaitems[$day] .= "<div><i>$hour:$minute</i> <b>".get_lang('Evento Global'). ": </b>".$item['title']."</div>";
}
else // this is the array construction for the DAY view
{
$halfhour = 2 * $agendatime['0'];
if ($agendatime['1'] >= '30')
{
$halfhour = $halfhour +1;
}
$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>";
}
}
//print_r($agendaitems);
return $agendaitems;
}

@ -1,4 +1,4 @@
<?php //$Id: myagenda.php 17254 2008-12-12 17:17:19Z cfasanando $
<?php //$Id: myagenda.php 17478 2008-12-29 20:13:08Z cvargas1 $
/*
==============================================================================
Dokeos - elearning and course management software
@ -246,6 +246,7 @@ if (isset ($_user['user_id']))
{
case "month_view" :
$agendaitems = get_myagendaitems($courses_dbs, $month, $year);
$agendaitems = get_global_agenda_items($agendaitems, $day, $month, $year, $week, "month_view");
if (get_setting("allow_personal_agenda") == "true")
{
$agendaitems = get_personal_agenda_items($agendaitems, $day, $month, $year, $week, "month_view");
@ -254,6 +255,7 @@ if (isset ($_user['user_id']))
break;
case "week_view" :
$agendaitems = get_week_agendaitems($courses_dbs, $month, $year, $week);
$agendaitems = get_global_agenda_items($agendaitems, $day, $month, $year, $week, "week_view");
if (get_setting("allow_personal_agenda") == "true")
{
$agendaitems = get_personal_agenda_items($agendaitems, $day, $month, $year, $week, "week_view");
@ -262,6 +264,7 @@ if (isset ($_user['user_id']))
break;
case "day_view" :
$agendaitems = get_day_agendaitems($courses_dbs, $month, $year, $day);
$agendaitems = get_global_agenda_items($agendaitems, $day, $month, $year, $week, "day_view");
if (get_setting("allow_personal_agenda") == "true")
{
$agendaitems = get_personal_agenda_items($agendaitems, $day, $month, $year, $week, "day_view");

@ -1,4 +1,4 @@
<?php // $Id: database.lib.php 17441 2008-12-23 21:19:58Z cfasanando $
<?php // $Id: database.lib.php 17478 2008-12-29 20:13:08Z cvargas1 $
/* See license terms in /dokeos_license.txt */
/**
==============================================================================
@ -54,6 +54,7 @@ define('TABLE_MAIN_USER_FIELD', 'user_field');
define('TABLE_MAIN_USER_FIELD_OPTIONS', 'user_field_options');
define('TABLE_MAIN_USER_FIELD_VALUES', 'user_field_values');
define('TABLE_MAIN_ACCESS_URL', 'access_url');
define('TABLE_MAIN_SYSTEM_CALENDAR', 'sys_calendar');
//statistic database tables
define('TABLE_STATISTIC_TRACK_E_LASTACCESS', 'track_e_lastaccess');

@ -1034,4 +1034,13 @@ CREATE TABLE gradebook_linkeval_log (
type varchar(20) NOT NULL,
user_id_log int NOT NULL,
PRIMARY KEY (id)
);
CREATE TABLE sys_calendar (
id int unsigned NOT NULL auto_increment,
title varchar(200) NOT NULL,
content text,
start_date datetime NOT NULL default '0000-00-00 00:00:00',
end_date datetime NOT NULL default '0000-00-00 00:00:00',
PRIMARY KEY (id)
);

@ -48,6 +48,7 @@ UPDATE TABLE settings_options SET display_text = 'YesWillDeletePermanently' WHER
UPDATE TABLE settings_options SET display_text = 'NoWillDeletePermanently' WHERE variable = 'permanently_remove_deleted_files' and value = 'false';
INSERT INTO settings_options (variable, value, display_text) VALUES ('breadcrumbs_course_homepage','session_name_and_course_title','SessionNameAndCourseTitle');
INSERT INTO course_module (name, link, image, `row`, `column`, position) VALUES ('notebook','notebook/index.php','notebook.gif',2,1,'basic');
CREATE TABLE sys_calendar ( id int unsigned NOT NULL auto_increment, title varchar(200) NOT NULL, content text, start_date datetime NOT NULL default '0000-00-00 00:00:00', end_date datetime NOT NULL default '0000-00-00 00:00:00', PRIMARY KEY (id));
-- xxSTATSxx
ALTER TABLE track_e_exercices ADD status varchar(20) NOT NULL default '';

Loading…
Cancel
Save