Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- calendar/common/wbtools.php | 2 ++
- calendar/cronjobs/eventchk.php | 3 ++-
- calendar/pages/event.php | 9 +++++----
- calendar/pages/eventcheck.php | 3 ++-
- 4 files changed, 11 insertions(+), 6 deletions(-)
- diff --git a/calendar/common/wbtools.php b/calendar/common/wbtools.php
- index 74d03dd..64103c0 100644
- --- a/calendar/common/wbtools.php
- +++ b/calendar/common/wbtools.php
- @@ -109,6 +109,8 @@ function createDbTable($tableName, $calID='x') { //create database table
- a_date DATE NOT NULL DEFAULT '9999-00-00',
- m_date DATE NOT NULL DEFAULT '9999-00-00',
- status TINYINT(1) NOT NULL DEFAULT '0',
- + a_time DATE NOT NULL DEFAULT '99:00:00',
- + m_time DATE NOT NULL DEFAULT '99:00:00',
- PRIMARY KEY (event_id)
- )");
- break;
- diff --git a/calendar/cronjobs/eventchk.php b/calendar/cronjobs/eventchk.php
- index 62553f6..2f84fd9 100644
- --- a/calendar/cronjobs/eventchk.php
- +++ b/calendar/cronjobs/eventchk.php
- @@ -21,12 +21,13 @@ function cronEventChk() {
- //initialize
- $todayD = date("Y-m-d");
- + $todayT = date("H:i:s");
- $expireD = date("Y-m-d",time() - ($set['eventExp'] * 86400)); //expire date
- //delete events (set status to -1) which expired >= $set['eventExp'] days ago
- $result = dbQuery("UPDATE [db]events e
- INNER JOIN [db]categories c ON c.category_id = e.category_id
- - SET e.status = -1, e.m_date = '".$todayD."'
- + SET e.status = -1, e.m_date = '".$todayD."', e.m_time = '".$todayT."'
- WHERE ((c.rpeat = 0 AND e.r_type = 0 AND (IF(e.e_date != '9999-00-00', e.e_date, e.s_date) <= '$expireD')) OR e.r_until <= '$expireD')
- ");
- $nrDeleted = mysql_affected_rows();
- diff --git a/calendar/pages/event.php b/calendar/pages/event.php
- index ca4ceab..e0cf472 100644
- --- a/calendar/pages/event.php
- +++ b/calendar/pages/event.php
- @@ -247,6 +247,7 @@ if($tit != "Demande" && $tit != "Proposition" && $tit != "Acceptation") $tit = "
- $non = isset($_POST['non']) ? ($_POST['non'] == 'yes' ? 1 : 0) : 0; //notify now
- $oUid = isset($_POST['oUid']) ? $_POST['oUid'] : $uid; //remember original user ID
- $todayD = date("Y-m-d");
- +$todayT = date("H:i:s");
- //check rights
- $mayEdit = ($privs > 2 or ($privs == 2 and $uid == $_SESSION['uid'])) ? true : false; //edit rights
- @@ -366,7 +367,7 @@ if ($mayEdit) { //last minute rights check
- //update tables
- if ($mode == "add_exe") { //add new event
- - $q = "INSERT INTO [db]events VALUES (NULL,DEFAULT,'$titEsc','$desEsc',$cid,'$venEsc',$uid,DEFAULT,$apd,$pri,DEFAULT,'$sdate','$edate',DEFAULT,'$stime','$etime',$r_t,$r_i,$r_p,$r_m,'$runtil',$not,'$nml','".$todayD."',DEFAULT,DEFAULT)";
- + $q = "INSERT INTO [db]events VALUES (NULL,DEFAULT,'$titEsc','$desEsc',$cid,'$venEsc',$uid,DEFAULT,$apd,$pri,DEFAULT,'$sdate','$edate',DEFAULT,'$stime','$etime',$r_t,$r_i,$r_p,$r_m,'$runtil',$not,'$nml','".$todayD."',DEFAULT,DEFAULT, '$todayT', DEFAULT)";
- $result = dbQuery($q); //add to events table
- $eid = mysql_insert_id(); //set id to new event
- $cMsg .= $xx['evt_confirm_added'];
- @@ -375,14 +376,14 @@ if ($mayEdit) { //last minute rights check
- $mda = $todayD;
- if ($editN != 1) { //update the series
- $q = "UPDATE [db]events
- - SET title='$titEsc', venue='$venEsc', description='$desEsc', approved=$apd, private=$pri, category_id=$cid, user_id=$uid, not_mail='$nml', editor='$uname', s_date='$sdate', e_date='$edate', s_time='$stime', e_time='$etime', r_type=$r_t, r_interval=$r_i, r_period=$r_p, r_month=$r_m, r_until='$runtil', notify=$not, m_date='$todayD'
- + SET title='$titEsc', venue='$venEsc', description='$desEsc', approved=$apd, private=$pri, category_id=$cid, user_id=$uid, not_mail='$nml', editor='$uname', s_date='$sdate', e_date='$edate', s_time='$stime', e_time='$etime', r_type=$r_t, r_interval=$r_i, r_period=$r_p, r_month=$r_m, r_until='$runtil', notify=$not, m_date='$todayD', m_time = '$todayT'
- WHERE event_id=$eid";
- $result = dbQuery($q); //update events table
- $cMsg .= $xx['evt_confirm_saved'];
- } else { //update 1 occurrence
- $xda .= ';'.$evD;
- - $result = dbQuery("UPDATE [db]events SET x_dates='$xda', editor='$uname', m_date='$todayD' WHERE event_id=$eid"); //exclude date from series
- - $q = "INSERT INTO [db]events VALUES (NULL,DEFAULT,'$titEsc','$desEsc',$cid,'$venEsc',$uid,'".$uname."',$apd,$pri,DEFAULT,'$sdate','$edate',DEFAULT,'$stime','$etime',$r_t,$r_i,$r_p,$r_m,'$runtil',$not,'$nml','".$ada."','".$todayD."',DEFAULT)";
- + $result = dbQuery("UPDATE [db]events SET x_dates='$xda', editor='$uname', m_date='$todayD', m_time = '$todayT' WHERE event_id=$eid"); //exclude date from series
- + $q = "INSERT INTO [db]events VALUES (NULL,DEFAULT,'$titEsc','$desEsc',$cid,'$venEsc',$uid,'".$uname."',$apd,$pri,DEFAULT,'$sdate','$edate',DEFAULT,'$stime','$etime',$r_t,$r_i,$r_p,$r_m,'$runtil',$not,'$nml','".$ada."','".$todayD."',DEFAULT, '$todayT', DEFAULT)";
- $result = dbQuery($q); //add new event
- $eid = mysql_insert_id(); //set id to new event
- $editN = 0;
- diff --git a/calendar/pages/eventcheck.php b/calendar/pages/eventcheck.php
- index f120d81..1a3f902 100644
- --- a/calendar/pages/eventcheck.php
- +++ b/calendar/pages/eventcheck.php
- @@ -56,6 +56,7 @@ if (!isset($_POST['checkExe'])) { //get event details
- //update database
- if (isset($_POST['checkExe'])) {
- $mda = date("Y-m-d");
- + $todayT = date("H:i:s");
- //set checked
- if ($chk) {
- if (!strpos($chd, $evD)) { $chd .= ";$evD"; } //check
- @@ -63,7 +64,7 @@ if (isset($_POST['checkExe'])) {
- $chd = str_replace(";$evD",'',$chd);
- }
- $q = "UPDATE [db]events
- - SET checked='$chd', editor='$uname', m_date='$mda'
- + SET checked='$chd', editor='$uname', m_date='$mda', m_time = '$todayT'
- WHERE event_id=$eid";
- $result = dbQuery($q); //update events table
- //refresh calendar and close event window
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement