From: <sy...@us...> - 2008-10-20 16:21:31
|
Revision: 15237 http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=15237&view=rev Author: sylvieg Date: 2008-10-20 16:21:21 +0000 (Mon, 20 Oct 2008) Log Message: ----------- [FIX]calendar: friendly error message when no calendar exist Modified Paths: -------------- trunk/tiki-calendar_edit_item.php Modified: trunk/tiki-calendar_edit_item.php =================================================================== --- trunk/tiki-calendar_edit_item.php 2008-10-20 15:53:06 UTC (rev 15236) +++ trunk/tiki-calendar_edit_item.php 2008-10-20 16:21:21 UTC (rev 15237) @@ -53,6 +53,11 @@ $caladd = array(); $rawcals = $calendarlib->list_calendars(); +if ($rawcals['cant'] == 0 && $tiki_p_admin_calendar == 'y') { + $smarty->assign('msg', tra('You need to create one calendar')); + $smarty->display("error.tpl"); + die; +} foreach ($rawcals["data"] as $cal_id=>$cal_data) { if ($tiki_p_admin == 'y') { $cal_data["tiki_p_view_calendar"] = 'y'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gi...@us...> - 2008-11-10 00:28:38
|
Revision: 15584 http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=15584&view=rev Author: gillesm Date: 2008-11-10 00:28:34 +0000 (Mon, 10 Nov 2008) Log Message: ----------- [ENH] Calendar implementation of group alert notification Modified Paths: -------------- trunk/tiki-calendar_edit_item.php Modified: trunk/tiki-calendar_edit_item.php =================================================================== --- trunk/tiki-calendar_edit_item.php 2008-11-09 23:54:09 UTC (rev 15583) +++ trunk/tiki-calendar_edit_item.php 2008-11-10 00:28:34 UTC (rev 15584) @@ -206,17 +206,8 @@ or (!empty($save['calitemId']) and $caladd["$newcalid"]['tiki_p_change_events'])) { if (empty($save['name'])) $save['name'] = tra("event without name"); - $calendarlib->set_item($user,$save['calitemId'],$save); - foreach ( $_REQUEST['listtoalert'] as $user ){ - $email=$userlib->get_user_email($user); - if ( ! empty($email) ){ - include_once ('lib/webmail/tikimaillib.php'); - $mail = new TikiMail(); - $mail->setText("There is a changement in calendar (message will be redefined)"); - $mail->setSubject("You are alerted of a changement" ); - $mail->send(array($email)); - } - } + $calitemId=$calendarlib->set_item($user,$save['calitemId'],$save); + $groupalertlib->Notify($_REQUEST['listtoalert'],"tiki-calendar_edit_item.php?viewcalitemId=".$calitemId); header('Location: tiki-calendar.php'); die; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sy...@us...> - 2008-11-26 00:00:18
|
Revision: 15761 http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=15761&view=rev Author: sylvieg Date: 2008-11-26 00:00:08 +0000 (Wed, 26 Nov 2008) Log Message: ----------- oops Modified Paths: -------------- trunk/tiki-calendar_edit_item.php Modified: trunk/tiki-calendar_edit_item.php =================================================================== --- trunk/tiki-calendar_edit_item.php 2008-11-25 23:32:59 UTC (rev 15760) +++ trunk/tiki-calendar_edit_item.php 2008-11-26 00:00:08 UTC (rev 15761) @@ -131,7 +131,7 @@ if ( ! isset($_REQUEST["calendarId"]) ) { if (isset($_REQUEST['calitemId'])) { $calID = $calendarlib->get_calendarid($_REQUEST['calitemId']); - } elseif (isset(S_REQUEST['viewcalitemId'])) { + } elseif (isset($_REQUEST['viewcalitemId'])) { $calID = $calendarlib->get_calendarid($_REQUEST['viewcalitemId']); } } elseif (isset($_REQUEST['calendarId'])) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ny...@us...> - 2008-12-13 12:10:00
|
Revision: 16028 http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=16028&view=rev Author: nyloth Date: 2008-12-13 12:09:56 +0000 (Sat, 13 Dec 2008) Log Message: ----------- [FIX] calendar: fix saved hours of allday events + do not redirect to main page when error + remove duplicated 'impossibleDates' code Modified Paths: -------------- trunk/tiki-calendar_edit_item.php Modified: trunk/tiki-calendar_edit_item.php =================================================================== --- trunk/tiki-calendar_edit_item.php 2008-12-13 12:06:58 UTC (rev 16027) +++ trunk/tiki-calendar_edit_item.php 2008-12-13 12:09:56 UTC (rev 16028) @@ -183,38 +183,59 @@ $_REQUEST['end_date_Month'] = TikiLib::date_format("%m", $save['date_end']); $_REQUEST['end_date_Day'] = TikiLib::date_format("%d", $save['date_end']); $_REQUEST['end_date_Year'] = TikiLib::date_format("%Y", $save['date_end']); + } - } $save['allday'] = (isset($_REQUEST['allday']) && $_REQUEST['allday'] == 'true') ? 1 : 0; - $save['start'] = TikiLib::make_time( - $_REQUEST['start_Hour'], - $_REQUEST['start_Minute'], - 0, - $_REQUEST['start_date_Month'], - $_REQUEST['start_date_Day'], - $_REQUEST['start_date_Year'] - ); + if ($_REQUEST['allday'] == 'true') { + $save['start'] = TikiLib::make_time( + 0, + 0, + 0, + $_REQUEST['start_date_Month'], + $_REQUEST['start_date_Day'], + $_REQUEST['start_date_Year'] + ); - if ($save['end_or_duration'] == 'duration') { - $save['duration'] = max(0, $_REQUEST['duration_Hour']*60*60 + $_REQUEST['duration_Minute']*60); - $save['end'] = $save['start'] + $save['duration']; + if ($save['end_or_duration'] == 'duration') { + $save['duration'] = 86399; + $save['end'] = $save['start'] + $save['duration']; + } else { + $save['end'] = TikiLib::make_time( + 23, + 59, + 59, + $_REQUEST['end_date_Month'], + $_REQUEST['end_date_Day'], + $_REQUEST['end_date_Year'] + ); + $save['duration'] = max(0, $save['end'] - $save['start']); + } } else { - $save['end'] = TikiLib::make_time( - $_REQUEST['end_Hour'], - $_REQUEST['end_Minute'], + $save['start'] = TikiLib::make_time( + $_REQUEST['start_Hour'], + $_REQUEST['start_Minute'], 0, - $_REQUEST['end_date_Month'], - $_REQUEST['end_date_Day'], - $_REQUEST['end_date_Year'] + $_REQUEST['start_date_Month'], + $_REQUEST['start_date_Day'], + $_REQUEST['start_date_Year'] ); - $save['duration'] = max(0, $save['end'] - $save['start']); + + if ($save['end_or_duration'] == 'duration') { + $save['duration'] = max(0, $_REQUEST['duration_Hour']*60*60 + $_REQUEST['duration_Minute']*60); + $save['end'] = $save['start'] + $save['duration']; + } else { + $save['end'] = TikiLib::make_time( + $_REQUEST['end_Hour'], + $_REQUEST['end_Minute'], + 0, + $_REQUEST['end_date_Month'], + $_REQUEST['end_date_Day'], + $_REQUEST['end_date_Year'] + ); + $save['duration'] = max(0, $save['end'] - $save['start']); + } } } -$impossibleDates = false; -if (isset($save['start']) && isset($save['end'])) { - if (($save['end'] - $save['start']) < 0) - $impossibleDates = true; -} $impossibleDates = false; if (isset($save['start']) && isset($save['end'])) { @@ -227,7 +248,7 @@ $newcalid = $save['calendarId']; if ((empty($save['calitemId']) and $caladd["$newcalid"]['tiki_p_add_events']) - or (!empty($save['calitemId']) and $caladd["$newcalid"]['tiki_p_change_events'])) { + or (!empty($save['calitemId']) and $caladd["$newcalid"]['tiki_p_change_events'])) { if (empty($save['name'])) $save['name'] = tra("event without name"); if (empty($save['priority'])) $save['priority'] = 0; @@ -257,22 +278,22 @@ switch($_POST['recurrenceType']) { case "weekly": $calRecurrence->setWeekly(true); - $calRecurrence->setWeekday($_POST['weekday']); - $calRecurrence->setMonthly(false); - $calRecurrence->setYearly(false); - break; + $calRecurrence->setWeekday($_POST['weekday']); + $calRecurrence->setMonthly(false); + $calRecurrence->setYearly(false); + break; case "monthly": $calRecurrence->setWeekly(false); - $calRecurrence->setMonthly(true); - $calRecurrence->setDayOfMonth($_POST['dayOfMonth']); - $calRecurrence->setYearly(false); - break; + $calRecurrence->setMonthly(true); + $calRecurrence->setDayOfMonth($_POST['dayOfMonth']); + $calRecurrence->setYearly(false); + break; case "yearly": $calRecurrence->setWeekly(false); - $calRecurrence->setMonthly(false); - $calRecurrence->setYearly(true); - $calRecurrence->setDateOfYear(str_pad($_POST['dateOfYear_month'],2,'0',STR_PAD_LEFT) . str_pad($_POST['dateOfYear_day'],2,'0',STR_PAD_LEFT)); - break; + $calRecurrence->setMonthly(false); + $calRecurrence->setYearly(true); + $calRecurrence->setDateOfYear(str_pad($_POST['dateOfYear_month'],2,'0',STR_PAD_LEFT) . str_pad($_POST['dateOfYear_day'],2,'0',STR_PAD_LEFT)); + break; } $calRecurrence->setStartPeriod($_POST['startPeriod']); if ($_POST['endType'] == "dt") @@ -292,8 +313,6 @@ $save['changed'] = true; } $calitemId = $calendarlib->set_item($user,$save['calitemId'],$save); - header('Location: tiki-calendar.php'); - die; } if ($prefs['feature_groupalert'] == 'y') { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ny...@us...> - 2008-12-18 21:22:42
|
Revision: 16094 http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=16094&view=rev Author: nyloth Date: 2008-12-18 21:22:37 +0000 (Thu, 18 Dec 2008) Log Message: ----------- [FIX] calendars: fix saving a recurring event without specifying a status (if no status is specified, use the default status of the calendar or 'confirmed' if not set) Modified Paths: -------------- trunk/tiki-calendar_edit_item.php Modified: trunk/tiki-calendar_edit_item.php =================================================================== --- trunk/tiki-calendar_edit_item.php 2008-12-18 21:12:56 UTC (rev 16093) +++ trunk/tiki-calendar_edit_item.php 2008-12-18 21:22:37 UTC (rev 16094) @@ -251,6 +251,13 @@ or (!empty($save['calitemId']) and $caladd["$newcalid"]['tiki_p_change_events'])) { if (empty($save['name'])) $save['name'] = tra("event without name"); if (empty($save['priority'])) $save['priority'] = 0; + if (empty($save['status'])) { + if (empty($calendar['defaulteventstatus'])) { + $save['status'] = 1; // Confirmed + } else { + $save['status'] = $calendar['defaulteventstatus']; + } + } if (array_key_exists('recurrent',$_POST) && ($_POST['recurrent'] == 1) && $_POST['affect']!='event') { $impossibleDates = false; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sy...@us...> - 2009-06-12 23:00:33
|
Revision: 19459 http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=19459&view=rev Author: sylvieg Date: 2009-06-12 22:59:33 +0000 (Fri, 12 Jun 2009) Log Message: ----------- notice Modified Paths: -------------- trunk/tiki-calendar_edit_item.php Modified: trunk/tiki-calendar_edit_item.php =================================================================== --- trunk/tiki-calendar_edit_item.php 2009-06-12 22:12:37 UTC (rev 19458) +++ trunk/tiki-calendar_edit_item.php 2009-06-12 22:59:33 UTC (rev 19459) @@ -529,7 +529,7 @@ global $wikilib; include_once('lib/wiki/wikilib.php'); $plugins = $wikilib->list_plugins(true, 'editwiki'); $smarty->assign_by_ref('plugins', $plugins); -$smarty->assign('headtitle',tra('Calendar event : ').$calitem[name]); +$smarty->assign('headtitle',tra('Calendar event : ').$calitem['name']); $smarty->assign('impossibleDates',$impossibleDates); $smarty->assign('mid', 'tiki-calendar_edit_item.tpl'); $smarty->display("tiki.tpl"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lph...@us...> - 2009-08-02 12:25:14
|
Revision: 20483 http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=20483&view=rev Author: lphuberdeau Date: 2009-08-02 12:25:04 +0000 (Sun, 02 Aug 2009) Log Message: ----------- [FIX] Enabling permission checking Modified Paths: -------------- trunk/tiki-calendar_edit_item.php Modified: trunk/tiki-calendar_edit_item.php =================================================================== --- trunk/tiki-calendar_edit_item.php 2009-08-02 12:22:56 UTC (rev 20482) +++ trunk/tiki-calendar_edit_item.php 2009-08-02 12:25:04 UTC (rev 20483) @@ -22,23 +22,9 @@ if ($prefs['feature_ajax'] == "y") { require_once ('lib/ajax/ajaxlib.php'); } -/* -if (isset($_REQUEST['calendarId']) and $userlib->object_has_one_permission($_REQUEST['calendarId'],'calendar')) { - if ($tiki_p_admin != 'y') { - $perms = $userlib->get_permissions(0, -1, 'permName_desc', '', 'calendar'); - foreach ($perms["data"] as $perm) { - $permName = $perm["permName"]; - if ($userlib->object_has_permission($user, $calendarId, 'calendar', $permName)) { - $$permName = 'y'; - $smarty->assign("$permName", 'y'); - } else { - $$permName = 'n'; - $smarty->assign("$permName", 'n'); - } - } - } +if (isset($_REQUEST['calendarId']) ) { + $tikilib->get_perm_object($_REQUEST['calendarId'],'calendar'); } -*/ $daysnames = array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Satursday"); $monthnames = array("","January","February","March","April","May","June","July","August","September","October","November","December"); @@ -49,17 +35,6 @@ $smarty->assign('recurrent', ''); $hours_minmax = ''; -if ($tiki_p_admin_calendar == 'y') { - $tiki_p_add_events = 'y'; - $smarty->assign('tiki_p_add_events','y'); - $tiki_p_change_events = 'y'; - $smarty->assign('tiki_p_change_events','y'); - $tiki_p_view_events = 'y'; - $smarty->assign('tiki_p_view_events','y'); - $tiki_p_view_calendar = 'y'; - $smarty->assign('tiki_p_view_calendar','y'); -} - $caladd = array(); $rawcals = $calendarlib->list_calendars(); if ($rawcals['cant'] == 0 && $tiki_p_admin_calendar == 'y') { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ch...@us...> - 2009-10-22 07:12:16
|
Revision: 22563 http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=22563&view=rev Author: chealer Date: 2009-10-22 07:12:09 +0000 (Thu, 22 Oct 2009) Log Message: ----------- [SEC] calendar item: hopefully defuck perms checking and personal calendars handling Modified Paths: -------------- trunk/tiki-calendar_edit_item.php Modified: trunk/tiki-calendar_edit_item.php =================================================================== --- trunk/tiki-calendar_edit_item.php 2009-10-22 05:46:25 UTC (rev 22562) +++ trunk/tiki-calendar_edit_item.php 2009-10-22 07:12:09 UTC (rev 22563) @@ -22,9 +22,6 @@ if ($prefs['feature_ajax'] == "y") { require_once ('lib/ajax/ajaxlib.php'); } -if (isset($_REQUEST['calendarId']) ) { - $tikilib->get_perm_object($_REQUEST['calendarId'],'calendar'); -} $daysnames = array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Satursday"); $monthnames = array("","January","February","March","April","May","June","July","August","September","October","November","December"); @@ -49,22 +46,22 @@ $cal_id = $cal_data['calendarId']; $calperms = Perms::get( array( 'type' => 'calendar', 'object' => $cal_id ) ); if ($cal_data["personal"] == "y") { - if ($user) { + if ($user && $user == $cal_data["user"]) { $cal_data["tiki_p_view_calendar"] = 'y'; $cal_data["tiki_p_view_events"] = 'y'; $cal_data["tiki_p_add_events"] = 'y'; $cal_data["tiki_p_change_events"] = 'y'; } else { $cal_data["tiki_p_view_calendar"] = 'n'; - $cal_data["tiki_p_view_events"] = 'y'; + $cal_data["tiki_p_view_events"] = 'n'; $cal_data["tiki_p_add_events"] = 'n'; $cal_data["tiki_p_change_events"] = 'n'; } } else { - $cal_data["tiki_p_view_calendar"] = $calperms->view_calendar; - $cal_data["tiki_p_view_events"] = $calperms->view_events; - $cal_data["tiki_p_add_events"] = $calperms->add_events; - $cal_data["tiki_p_change_events"] = $calperms->change_events; + $cal_data["tiki_p_view_calendar"] = $calperms->view_calendar ? "y" : "n"; + $cal_data["tiki_p_view_events"] = $calperms->view_events ? "y" : "n"; + $cal_data["tiki_p_add_events"] = $calperms->add_events ? "y" : "n"; + $cal_data["tiki_p_change_events"] = $calperms->change_events ? "y" : "n"; } $caladd["$cal_id"] = $cal_data; @@ -100,6 +97,14 @@ } $tikilib->get_perm_object( $calID, 'calendar' ); +$calendar = $calendarlib->get_calendar($calID); +if ($calendar['personal'] == 'y') { + $ownCal = ($user && $user == $calendar["user"]) ? 'y' : 'n'; + $tiki_p_view_calendar = $ownCal; + $tiki_p_view_events = $ownCal; + $tiki_p_add_events = $ownCal; + $tiki_p_change_events = $ownCal; +} if( $tiki_p_view_calendar != 'y' ) { $smarty->assign('errortype', 401); @@ -185,8 +190,8 @@ if (isset($_POST['act'])) { if (empty($save['user'])) $save['user'] = $user; $newcalid = $save['calendarId']; - if ((empty($save['calitemId']) and $caladd["$newcalid"]['tiki_p_add_events']) - or (!empty($save['calitemId']) and $caladd["$newcalid"]['tiki_p_change_events'])) { + if ((empty($save['calitemId']) and $caladd["$newcalid"]['tiki_p_add_events'] == 'y') + or (!empty($save['calitemId']) and $caladd["$newcalid"]['tiki_p_change_events'] == 'y')) { if (empty($save['name'])) $save['name'] = tra("event without name"); if (empty($save['priority'])) $save['priority'] = 0; if (empty($save['status'])) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sy...@us...> - 2009-11-01 15:08:56
|
Revision: 22778 http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=22778&view=rev Author: sylvieg Date: 2009-11-01 15:08:48 +0000 (Sun, 01 Nov 2009) Log Message: ----------- [FIX]calendar: priority default is 1 Modified Paths: -------------- trunk/tiki-calendar_edit_item.php Modified: trunk/tiki-calendar_edit_item.php =================================================================== --- trunk/tiki-calendar_edit_item.php 2009-10-31 20:08:48 UTC (rev 22777) +++ trunk/tiki-calendar_edit_item.php 2009-11-01 15:08:48 UTC (rev 22778) @@ -193,7 +193,7 @@ if ((empty($save['calitemId']) and $caladd["$newcalid"]['tiki_p_add_events'] == 'y') or (!empty($save['calitemId']) and $caladd["$newcalid"]['tiki_p_change_events'] == 'y')) { if (empty($save['name'])) $save['name'] = tra("event without name"); - if (empty($save['priority'])) $save['priority'] = 0; + if (empty($save['priority'])) $save['priority'] = 1; if (empty($save['status'])) { if (empty($calendar['defaulteventstatus'])) { $save['status'] = 1; // Confirmed This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <m_...@us...> - 2010-01-10 22:51:06
|
Revision: 24246 http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=24246&view=rev Author: m_stef Date: 2010-01-10 22:50:48 +0000 (Sun, 10 Jan 2010) Log Message: ----------- [fix] when impossible date was specified for an event (start>end), upon saving you lose all your form entries and are returned to the calendar view. after the fix you are presented with a preview of the item with a nice warning. Modified Paths: -------------- trunk/tiki-calendar_edit_item.php Modified: trunk/tiki-calendar_edit_item.php =================================================================== --- trunk/tiki-calendar_edit_item.php 2010-01-10 21:39:00 UTC (rev 24245) +++ trunk/tiki-calendar_edit_item.php 2010-01-10 22:50:48 UTC (rev 24246) @@ -265,14 +265,13 @@ $save['changed'] = true; } $calitemId = $calendarlib->set_item($user,$save['calitemId'],$save); - } - if ($prefs['feature_groupalert'] == 'y') { - $groupalertlib->Notify($_REQUEST['listtoalert'],"tiki-calendar_edit_item.php?viewcalitemId=".$calitemId); + if ($prefs['feature_groupalert'] == 'y') { + $groupalertlib->Notify($_REQUEST['listtoalert'],"tiki-calendar_edit_item.php?viewcalitemId=".$calitemId); + } + header('Location: tiki-calendar.php?todate='.$save['start']); + die; } - - header('Location: tiki-calendar.php?todate='.$save['start']); - die; } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <xa...@us...> - 2010-01-17 13:33:25
|
Revision: 24443 http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=24443&view=rev Author: xavidp Date: 2010-01-17 13:33:13 +0000 (Sun, 17 Jan 2010) Log Message: ----------- [MOD]Spam protection: when aonymous is allowed to add or change events in calendars, the ip is logged at syslog to allow banning ip's if needed. Also antibot code checked only when saving (not when changing calendar, or previewing). No check on deletion of events for anons (if allowed) since bots are not known to use JS buttons. Modified Paths: -------------- trunk/tiki-calendar_edit_item.php Modified: trunk/tiki-calendar_edit_item.php =================================================================== --- trunk/tiki-calendar_edit_item.php 2010-01-17 09:50:19 UTC (rev 24442) +++ trunk/tiki-calendar_edit_item.php 2010-01-17 13:33:13 UTC (rev 24443) @@ -121,13 +121,6 @@ if (isset($_REQUEST['act']) || isset($_REQUEST['preview']) || isset($_REQUEST['changeCal'])) { - if (empty($user) && $prefs['feature_antibot'] == 'y' && (!isset($_SESSION['random_number']) || $_SESSION['random_number'] != $_REQUEST['antibotcode'])) { - $smarty->assign('msg', tra("You have mistyped the anti-bot verification code; please try again.")); - $smarty->assign('errortype', 'no_redirect_login'); - $smarty->display("error.tpl"); - die; - } - $save = $_POST['save']; // Take care of timestamps dates coming from jscalendar if ( isset($save['date_start']) || isset($save['date_end']) ) { @@ -198,6 +191,13 @@ } if (isset($_POST['act'])) { + // Check antibot code if anonymous and allowed + if (empty($user) && $prefs['feature_antibot'] == 'y' && (!isset($_SESSION['random_number']) || $_SESSION['random_number'] != $_REQUEST['antibotcode'])) { + $smarty->assign('msg', tra("You have mistyped the anti-bot verification code; please try again.")); + $smarty->assign('errortype', 'no_redirect_login'); + $smarty->display("error.tpl"); + die; + } if (empty($save['user'])) $save['user'] = $user; $newcalid = $save['calendarId']; if ((empty($save['calitemId']) and $caladd["$newcalid"]['tiki_p_add_events'] == 'y') @@ -263,6 +263,13 @@ } $calRecurrence->setUser($save['user']); $calRecurrence->save($_POST['affect'] == 'all'); + // Save the ip at the log for the addition of new calendar items when done by anonymous users + if (empty($user) && empty($save['calitemId']) && $caladd["$newcalid"]['tiki_p_add_events']) { + $logslib->add_log('calendar','Recurrent calendar item starting on '.$_POST['startPeriod'].' added to calendar '.$save['calendarId']); + } + if (empty($user) && !empty($save['calitemId']) and $caladd["$newcalid"]['tiki_p_change_events']) { + $logslib->add_log('calendar','Recurrent calendar item starting on '.$_POST['startPeriod'].' changed in calendar '.$save['calendarId']); + } header('Location: tiki-calendar.php?todate='.$save['start']); die; } @@ -273,7 +280,13 @@ $save['changed'] = true; } $calitemId = $calendarlib->set_item($user,$save['calitemId'],$save); - + // Save the ip at the log for the addition of new calendar items when done by anonymous users + if (empty($user) && empty($save['calitemId']) && $caladd["$newcalid"]['tiki_p_add_events']) { + $logslib->add_log('calendar','Calendar item '.$calitemId.' added to calendar '.$save['calendarId']); + } + if (empty($user) && !empty($save['calitemId']) and $caladd["$newcalid"]['tiki_p_change_events']) { + $logslib->add_log('calendar','Calendar item '.$calitemId.' changed in calendar '.$save['calendarId']); + } if ($prefs['feature_groupalert'] == 'y') { $groupalertlib->Notify($_REQUEST['listtoalert'],"tiki-calendar_edit_item.php?viewcalitemId=".$calitemId); } @@ -285,11 +298,15 @@ } if (isset($_REQUEST["delete"]) and ($_REQUEST["delete"]) and isset($_REQUEST["calitemId"]) and $tiki_p_change_events == 'y') { + // There is no check for valid antibot code if anonymous allowed to delete events since this comes from a JS button at the tpl and bots are not know to use JS $area = 'delcalevent'; if ($prefs['feature_ticketlib2'] != 'y' or (isset($_POST['daconfirm']) and isset($_SESSION["ticket_$area"]))) { key_check($area); $calitem = $calendarlib->get_item($_REQUEST['calitemId']); $calendarlib->drop_item($user, $_REQUEST["calitemId"]); + if (empty($user)) { + $logslib->add_log('calendar','Calendar item '.$_REQUEST['calitemId'].' deleted'); + } $_REQUEST["calitemId"] = 0; header('Location: tiki-calendar.php?todate='.$calitem['start']); die; @@ -297,8 +314,12 @@ key_get($area); } } elseif (isset($_REQUEST["delete"]) and ($_REQUEST["delete"]) and isset($_REQUEST["recurrenceId"]) and $tiki_p_change_events == 'y') { + // There is no check for valid antibot code if anonymous allowed to delete events since this comes from a JS button at the tpl and bots are not know to use JS $calRec = new CalRecurrence($_REQUEST['recurrenceId']); $calRec->delete(); + if (empty($user)) { + $logslib->add_log('calendar','Recurrent calendar items (recurrenceId = '.$_REQUEST["recurrenceId"].') deleted'); + } $_REQUEST["recurrenceTypeId"] = 0; $_REQUEST["calitemId"] = 0; header('Location: tiki-calendar.php'); @@ -312,9 +333,19 @@ } else { $calendarlib->drop_item($user, $_REQUEST['drop']); } + if (empty($user)) { + $logslib->add_log('calendar','Calendar item/s '.$_REQUEST['calitemId'].' droped'); + } header('Location: tiki-calendar.php'); die; } elseif (isset($_REQUEST['duplicate']) and $tiki_p_add_events == 'y') { + // Check antibot code if anonymous and allowed + if (empty($user) && $prefs['feature_antibot'] == 'y' && (!isset($_SESSION['random_number']) || $_SESSION['random_number'] != $_REQUEST['antibotcode'])) { + $smarty->assign('msg', tra("You have mistyped the anti-bot verification code; please try again.")); + $smarty->assign('errortype', 'no_redirect_login'); + $smarty->display("error.tpl"); + die; + } $calitem = $calendarlib->get_item($_REQUEST['calitemId']); $calitem['calendarId'] = $calID; $calitem['calitemId'] = 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: Stephane C. <se...@lo...> - 2010-01-17 13:59:31
|
Le Sun, Jan 17, 2010 at 01:33:14PM +0000, xa...@us... écrivait : > Revision: 24443 > http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=24443&view=rev > Author: xavidp > Date: 2010-01-17 13:33:13 +0000 (Sun, 17 Jan 2010) > > Log Message: > ----------- > [MOD]Spam protection: when aonymous is allowed to add or change events in calendars, the ip is logged at syslog to allow banning ip's if needed. Also antibot code checked only when saving (not when changing calendar, or previewing). No check on deletion of events for anons (if allowed) since bots are not known to use JS buttons. > > Modified Paths: > -------------- > trunk/tiki-calendar_edit_item.php > > Modified: trunk/tiki-calendar_edit_item.php > =================================================================== > --- trunk/tiki-calendar_edit_item.php 2010-01-17 09:50:19 UTC (rev 24442) > +++ trunk/tiki-calendar_edit_item.php 2010-01-17 13:33:13 UTC (rev 24443) > @@ -121,13 +121,6 @@ > > if (isset($_REQUEST['act']) || isset($_REQUEST['preview']) || isset($_REQUEST['changeCal'])) { > > - if (empty($user) && $prefs['feature_antibot'] == 'y' && (!isset($_SESSION['random_number']) || $_SESSION['random_number'] != $_REQUEST['antibotcode'])) { > - $smarty->assign('msg', tra("You have mistyped the anti-bot verification code; please try again.")); > - $smarty->assign('errortype', 'no_redirect_login'); > - $smarty->display("error.tpl"); > - die; > - } > - > $save = $_POST['save']; > // Take care of timestamps dates coming from jscalendar > if ( isset($save['date_start']) || isset($save['date_end']) ) { > @@ -198,6 +191,13 @@ > } > > if (isset($_POST['act'])) { > + // Check antibot code if anonymous and allowed > + if (empty($user) && $prefs['feature_antibot'] == 'y' && (!isset($_SESSION['random_number']) || $_SESSION['random_number'] != $_REQUEST['antibotcode'])) { > + $smarty->assign('msg', tra("You have mistyped the anti-bot verification code; please try again.")); > + $smarty->assign('errortype', 'no_redirect_login'); > + $smarty->display("error.tpl"); > + die; > + } > if (empty($save['user'])) $save['user'] = $user; > $newcalid = $save['calendarId']; > if ((empty($save['calitemId']) and $caladd["$newcalid"]['tiki_p_add_events'] == 'y') > @@ -263,6 +263,13 @@ > } > $calRecurrence->setUser($save['user']); > $calRecurrence->save($_POST['affect'] == 'all'); > + // Save the ip at the log for the addition of new calendar items when done by anonymous users > + if (empty($user) && empty($save['calitemId']) && $caladd["$newcalid"]['tiki_p_add_events']) { > + $logslib->add_log('calendar','Recurrent calendar item starting on '.$_POST['startPeriod'].' added to calendar '.$save['calendarId']); > + } > + if (empty($user) && !empty($save['calitemId']) and $caladd["$newcalid"]['tiki_p_change_events']) { > + $logslib->add_log('calendar','Recurrent calendar item starting on '.$_POST['startPeriod'].' changed in calendar '.$save['calendarId']); > + } > header('Location: tiki-calendar.php?todate='.$save['start']); > die; > } > @@ -273,7 +280,13 @@ > $save['changed'] = true; > } > $calitemId = $calendarlib->set_item($user,$save['calitemId'],$save); > - > + // Save the ip at the log for the addition of new calendar items when done by anonymous users > + if (empty($user) && empty($save['calitemId']) && $caladd["$newcalid"]['tiki_p_add_events']) { > + $logslib->add_log('calendar','Calendar item '.$calitemId.' added to calendar '.$save['calendarId']); > + } > + if (empty($user) && !empty($save['calitemId']) and $caladd["$newcalid"]['tiki_p_change_events']) { > + $logslib->add_log('calendar','Calendar item '.$calitemId.' changed in calendar '.$save['calendarId']); > + } > if ($prefs['feature_groupalert'] == 'y') { > $groupalertlib->Notify($_REQUEST['listtoalert'],"tiki-calendar_edit_item.php?viewcalitemId=".$calitemId); > } > @@ -285,11 +298,15 @@ > } > > if (isset($_REQUEST["delete"]) and ($_REQUEST["delete"]) and isset($_REQUEST["calitemId"]) and $tiki_p_change_events == 'y') { > + // There is no check for valid antibot code if anonymous allowed to delete events since this comes from a JS button at the tpl and bots are not know to use JS > $area = 'delcalevent'; > if ($prefs['feature_ticketlib2'] != 'y' or (isset($_POST['daconfirm']) and isset($_SESSION["ticket_$area"]))) { > key_check($area); > $calitem = $calendarlib->get_item($_REQUEST['calitemId']); > $calendarlib->drop_item($user, $_REQUEST["calitemId"]); > + if (empty($user)) { > + $logslib->add_log('calendar','Calendar item '.$_REQUEST['calitemId'].' deleted'); > + } This should be added to $calendarlib->drop_item to be generic > $_REQUEST["calitemId"] = 0; > header('Location: tiki-calendar.php?todate='.$calitem['start']); > die; > @@ -297,8 +314,12 @@ > key_get($area); > } > } elseif (isset($_REQUEST["delete"]) and ($_REQUEST["delete"]) and isset($_REQUEST["recurrenceId"]) and $tiki_p_change_events == 'y') { > + // There is no check for valid antibot code if anonymous allowed to delete events since this comes from a JS button at the tpl and bots are not know to use JS > $calRec = new CalRecurrence($_REQUEST['recurrenceId']); > $calRec->delete(); > + if (empty($user)) { > + $logslib->add_log('calendar','Recurrent calendar items (recurrenceId = '.$_REQUEST["recurrenceId"].') deleted'); > + } This should be added to $calRec->delete() to be generic > $_REQUEST["recurrenceTypeId"] = 0; > $_REQUEST["calitemId"] = 0; > header('Location: tiki-calendar.php'); > @@ -312,9 +333,19 @@ > } else { > $calendarlib->drop_item($user, $_REQUEST['drop']); > } > + if (empty($user)) { > + $logslib->add_log('calendar','Calendar item/s '.$_REQUEST['calitemId'].' droped'); > + } Ditto... > header('Location: tiki-calendar.php'); > die; > } elseif (isset($_REQUEST['duplicate']) and $tiki_p_add_events == 'y') { > + // Check antibot code if anonymous and allowed > + if (empty($user) && $prefs['feature_antibot'] == 'y' && (!isset($_SESSION['random_number']) || $_SESSION['random_number'] != $_REQUEST['antibotcode'])) { > + $smarty->assign('msg', tra("You have mistyped the anti-bot verification code; please try again.")); > + $smarty->assign('errortype', 'no_redirect_login'); > + $smarty->display("error.tpl"); > + die; > + } > $calitem = $calendarlib->get_item($_REQUEST['calitemId']); > $calitem['calendarId'] = $calID; > $calitem['calitemId'] = 0; > A+ -- Stéphane Casset LOGIDÉE sàrl Se faire plaisir d'apprendre 1a, rue Pasteur Tel : +33 388 23 69 77 ca...@lo... F-67540 OSTWALD Fax : +33 388 23 69 77 http://logidee.com |
From: <sy...@us...> - 2011-01-14 19:14:14
|
Revision: 31911 http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=31911&view=rev Author: sylvieg Date: 2011-01-14 19:14:07 +0000 (Fri, 14 Jan 2011) Log Message: ----------- [FIX]calendar: fix personal calendar (partial rollback 22563). A personal calendar is shared by everybody that can see it - but user sees only his events Modified Paths: -------------- trunk/tiki-calendar_edit_item.php Modified: trunk/tiki-calendar_edit_item.php =================================================================== --- trunk/tiki-calendar_edit_item.php 2011-01-14 18:48:03 UTC (rev 31910) +++ trunk/tiki-calendar_edit_item.php 2011-01-14 19:14:07 UTC (rev 31911) @@ -43,14 +43,14 @@ $cal_id = $cal_data['calendarId']; $calperms = Perms::get( array( 'type' => 'calendar', 'object' => $cal_id ) ); if ($cal_data["personal"] == "y") { - if ($user && $user == $cal_data["user"]) { + if ($user) { $cal_data["tiki_p_view_calendar"] = 'y'; $cal_data["tiki_p_view_events"] = 'y'; $cal_data["tiki_p_add_events"] = 'y'; $cal_data["tiki_p_change_events"] = 'y'; } else { $cal_data["tiki_p_view_calendar"] = 'n'; - $cal_data["tiki_p_view_events"] = 'n'; + $cal_data["tiki_p_view_events"] = 'y'; $cal_data["tiki_p_add_events"] = 'n'; $cal_data["tiki_p_change_events"] = 'n'; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sy...@us...> - 2011-01-21 12:31:12
|
Revision: 32057 http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=32057&view=rev Author: sylvieg Date: 2011-01-21 12:31:06 +0000 (Fri, 21 Jan 2011) Log Message: ----------- notice Modified Paths: -------------- trunk/tiki-calendar_edit_item.php Modified: trunk/tiki-calendar_edit_item.php =================================================================== --- trunk/tiki-calendar_edit_item.php 2011-01-21 12:27:48 UTC (rev 32056) +++ trunk/tiki-calendar_edit_item.php 2011-01-21 12:31:06 UTC (rev 32057) @@ -121,7 +121,7 @@ } $save['allday'] = (isset($_REQUEST['allday']) && $_REQUEST['allday'] == 'true') ? 1 : 0; - if ($_REQUEST['allday'] == 'true') { + if (isset($_REQUEST['allday']) && $_REQUEST['allday'] == 'true') { $save['start'] = TikiLib::make_time( 0, 0, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <li...@us...> - 2011-01-22 22:57:04
|
Revision: 32094 http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=32094&view=rev Author: lindonb Date: 2011-01-22 22:56:55 +0000 (Sat, 22 Jan 2011) Log Message: ----------- [FIX] Tentative status (status = 0) wasn't sticking because code was checking if empty rather than isset. Modified Paths: -------------- trunk/tiki-calendar_edit_item.php Modified: trunk/tiki-calendar_edit_item.php =================================================================== --- trunk/tiki-calendar_edit_item.php 2011-01-22 22:43:04 UTC (rev 32093) +++ trunk/tiki-calendar_edit_item.php 2011-01-22 22:56:55 UTC (rev 32094) @@ -217,7 +217,7 @@ or (!empty($save['calitemId']) and $caladd["$newcalid"]['tiki_p_change_events'] == 'y')) { if (empty($save['name'])) $save['name'] = tra("event without name"); if (empty($save['priority'])) $save['priority'] = 1; - if (empty($save['status'])) { + if (!isset($save['status'])) { if (empty($calendar['defaulteventstatus'])) { $save['status'] = 1; // Confirmed } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sy...@us...> - 2011-01-24 12:11:17
|
Revision: 32104 http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=32104&view=rev Author: sylvieg Date: 2011-01-24 12:11:10 +0000 (Mon, 24 Jan 2011) Log Message: ----------- [FIX]calendar: can edit personal item Modified Paths: -------------- trunk/tiki-calendar_edit_item.php Modified: trunk/tiki-calendar_edit_item.php =================================================================== --- trunk/tiki-calendar_edit_item.php 2011-01-24 02:40:23 UTC (rev 32103) +++ trunk/tiki-calendar_edit_item.php 2011-01-24 12:11:10 UTC (rev 32104) @@ -92,15 +92,6 @@ } $tikilib->get_perm_object( $calID, 'calendar' ); -$calendar = $calendarlib->get_calendar($calID); -if ($calendar['personal'] == 'y') { - $ownCal = ($user && $user == $calendar["user"]) ? 'y' : 'n'; - $tiki_p_view_calendar = $ownCal; - $tiki_p_view_events = $ownCal; - $tiki_p_add_events = $ownCal; - $tiki_p_change_events = $ownCal; -} - $access->check_permission('tiki_p_view_calendar'); if (isset($_REQUEST['save']) && !isset($_REQUEST['preview']) && !isset($_REQUEST['act'])) { @@ -465,6 +456,12 @@ $smarty->display("error.tpl"); die; } +if (!empty($id) && $calendar['personal'] == 'y' && $calitem['user'] != $user) { + $smarty->assign('errortype', 401); + $smarty->assign('msg', tra("You do not have permission to view this page")); + $smarty->display("error.tpl"); + die; +} if (!empty($calendar['eventstatus'])) { $calitem['status'] = $calendar['eventstatus']; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <li...@us...> - 2011-02-21 01:29:37
|
Revision: 32942 http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=32942&view=rev Author: lindonb Date: 2011-02-21 01:29:30 +0000 (Mon, 21 Feb 2011) Log Message: ----------- [FIX] To convert 12-hour clock hours to 24-hour scale, do not add 12 hours to 12pm and replace 12am with 0 to calculate unixtime properly. Modified Paths: -------------- trunk/tiki-calendar_edit_item.php Modified: trunk/tiki-calendar_edit_item.php =================================================================== --- trunk/tiki-calendar_edit_item.php 2011-02-21 00:25:25 UTC (rev 32941) +++ trunk/tiki-calendar_edit_item.php 2011-02-21 01:29:30 UTC (rev 32942) @@ -137,8 +137,14 @@ $save['duration'] = max(0, $save['end'] - $save['start']); } } else { - if (!empty($_REQUEST['start_Meridian']) && $_REQUEST['start_Meridian'] == 'pm') { - $_REQUEST['start_Hour'] += 12; + //Convert 12-hour clock hours to 24-hour scale to compute time + if (!empty($_REQUEST['start_Meridian'])) { + if ($_REQUEST['start_Meridian'] == 'pm' && $_REQUEST['start_Hour'] != 12) { + $_REQUEST['start_Hour'] += 12; + } + if ($_REQUEST['start_Meridian'] == 'am' && $_REQUEST['start_Hour'] == 12) { + $_REQUEST['start_Hour'] = 0; + } } $save['start'] = TikiLib::make_time( $_REQUEST['start_Hour'], @@ -153,8 +159,14 @@ $save['duration'] = max(0, $_REQUEST['duration_Hour']*60*60 + $_REQUEST['duration_Minute']*60); $save['end'] = $save['start'] + $save['duration']; } else { - if (!empty($_REQUEST['end_Meridian']) && $_REQUEST['end_Meridian'] == 'pm') { - $_REQUEST['end_Hour'] += 12; + //Convert 12-hour clock hours to 24-hour scale to compute time + if (!empty($_REQUEST['end_Meridian'])) { + if ($_REQUEST['end_Meridian'] == 'pm' && $_REQUEST['end_Meridian'] != 12) { + $_REQUEST['end_Hour'] += 12; + } + if ($_REQUEST['end_Meridian'] == 'am' && $_REQUEST['end_Meridian'] == 12) { + $_REQUEST['end_Hour'] = 0; + } } $save['end'] = TikiLib::make_time( $_REQUEST['end_Hour'], This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: Marc L. <ma...@ma...> - 2011-02-22 09:14:51
|
Isn't there something in Smarty or PHP that handles this conversion? Tks! On 2011-02-21 9:09 PM, <li...@us...> wrote: Revision: 32942 http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=32942&view=rev Author: lindonb Date: 2011-02-21 01:29:30 +0000 (Mon, 21 Feb 2011) Log Message: ----------- [FIX] To convert 12-hour clock hours to 24-hour scale, do not add 12 hours to 12pm and replace 12am with 0 to calculate unixtime properly. Modified Paths: -------------- trunk/tiki-calendar_edit_item.php Modified: trunk/tiki-calendar_edit_item.php =================================================================== --- trunk/tiki-calendar_edit_item.php 2011-02-21 00:25:25 UTC (rev 32941) +++ trunk/tiki-calendar_edit_item.php 2011-02-21 01:29:30 UTC (rev 32942) @@ -137,8 +137,14 @@ $save['duration'] = max(0, $save['end'] - $save['start']); } } else { - if (!empty($_REQUEST['start_Meridian']) && $_REQUEST['start_Meridian'] == 'pm') { - $_REQUEST['start_Hour'] += 12; + //Convert 12-hour clock hours to 24-hour scale to compute time + if (!empty($_REQUEST['start_Meridian'])) { + if ($_REQUEST['start_Meridian'] == 'pm' && $_REQUEST['start_Hour'] != 12) { + $_REQUEST['start_Hour'] += 12; + } + if ($_REQUEST['start_Meridian'] == 'am' && $_REQUEST['start_Hour'] == 12) { + $_REQUEST['start_Hour'] = 0; + } } $save['start'] = TikiLib::make_time( $_REQUEST['start_Hour'], @@ -153,8 +159,14 @@ $save['duration'] = max(0, $_REQUEST['duration_Hour']*60*60 + $_REQUEST['duration_Minute']*60); $save['end'] = $save['start'] + $save['duration']; } else { - if (!empty($_REQUEST['end_Meridian']) && $_REQUEST['end_Meridian'] == 'pm') { - $_REQUEST['end_Hour'] += 12; + //Convert 12-hour clock hours to 24-hour scale to compute time + if (!empty($_REQUEST['end_Meridian'])) { + if ($_REQUEST['end_Meridian'] == 'pm' && $_REQUEST['end_Meridian'] != 12) { + $_REQUEST['end_Hour'] += 12; + } + if ($_REQUEST['end_Meridian'] == 'am' && $_REQUEST['end_Meridian'] == 12) { + $_REQUEST['end_Hour'] = 0; + } } $save['end'] = TikiLib::make_time( $_REQUEST['end_Hour'], This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: Pinpoint memory and threading errors before they happen. Find and fix more than 250 security defects in the development cycle. Locate bottlenecks in serial and parallel code that limit performance. http://p.sf.net/sfu/intel-dev2devfeb _______________________________________________ Tikiwiki-cvs mailing list Tik...@li... https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs |
From: lindon <lin...@fr...> - 2011-02-23 03:13:20
|
Yes. Will fix it. Thanks! lindon On Tue, Feb 22, 2011 at 4:14 AM, Marc Laporte <ma...@ma...> wrote: > Isn't there something in Smarty or PHP that handles this conversion? > > Tks! > > On 2011-02-21 9:09 PM, <li...@us...> wrote: > > Revision: 32942 > http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=32942&view=rev > Author: lindonb > Date: 2011-02-21 01:29:30 +0000 (Mon, 21 Feb 2011) > > Log Message: > ----------- > [FIX] To convert 12-hour clock hours to 24-hour scale, do not add 12 hours > to 12pm and replace 12am with 0 to calculate unixtime properly. > > Modified Paths: > -------------- > trunk/tiki-calendar_edit_item.php > > Modified: trunk/tiki-calendar_edit_item.php > =================================================================== > --- trunk/tiki-calendar_edit_item.php 2011-02-21 00:25:25 UTC (rev 32941) > +++ trunk/tiki-calendar_edit_item.php 2011-02-21 01:29:30 UTC (rev 32942) > @@ -137,8 +137,14 @@ > $save['duration'] = max(0, $save['end'] - > $save['start']); > } > } else { > - if (!empty($_REQUEST['start_Meridian']) && > $_REQUEST['start_Meridian'] == 'pm') { > - $_REQUEST['start_Hour'] += 12; > + //Convert 12-hour clock hours to 24-hour scale to compute > time > + if (!empty($_REQUEST['start_Meridian'])) { > + if ($_REQUEST['start_Meridian'] == 'pm' && > $_REQUEST['start_Hour'] != 12) { > + $_REQUEST['start_Hour'] += 12; > + } > + if ($_REQUEST['start_Meridian'] == 'am' && > $_REQUEST['start_Hour'] == 12) { > + $_REQUEST['start_Hour'] = 0; > + } > } > $save['start'] = TikiLib::make_time( > $_REQUEST['start_Hour'], > @@ -153,8 +159,14 @@ > $save['duration'] = max(0, > $_REQUEST['duration_Hour']*60*60 + $_REQUEST['duration_Minute']*60); > $save['end'] = $save['start'] + $save['duration']; > } else { > - if (!empty($_REQUEST['end_Meridian']) && > $_REQUEST['end_Meridian'] == 'pm') { > - $_REQUEST['end_Hour'] += 12; > + //Convert 12-hour clock hours to 24-hour scale to > compute time > + if (!empty($_REQUEST['end_Meridian'])) { > + if ($_REQUEST['end_Meridian'] == 'pm' && > $_REQUEST['end_Meridian'] != 12) { > + $_REQUEST['end_Hour'] += 12; > + } > + if ($_REQUEST['end_Meridian'] == 'am' && > $_REQUEST['end_Meridian'] == 12) { > + $_REQUEST['end_Hour'] = 0; > + } > } > $save['end'] = TikiLib::make_time( > $_REQUEST['end_Hour'], > > > This was sent by the SourceForge.net collaborative development platform, > the world's largest Open Source development site. > > > ------------------------------------------------------------------------------ > The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: > Pinpoint memory and threading errors before they happen. > Find and fix more than 250 security defects in the development cycle. > Locate bottlenecks in serial and parallel code that limit performance. > http://p.sf.net/sfu/intel-dev2devfeb > _______________________________________________ > Tikiwiki-cvs mailing list > Tik...@li... > https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs > > > > ------------------------------------------------------------------------------ > Index, Search & Analyze Logs and other IT data in Real-Time with Splunk > Collect, index and harness all the fast moving IT data generated by your > applications, servers and devices whether physical, virtual or in the > cloud. > Deliver compliance at lower cost and gain new business insights. > Free Software Download: http://p.sf.net/sfu/splunk-dev2dev > _______________________________________________ > Tikiwiki-cvs mailing list > Tik...@li... > https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs > > |
From: <cha...@us...> - 2012-02-27 13:28:35
|
Revision: 39965 http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=39965&view=rev Author: changi67 Date: 2012-02-27 13:28:24 +0000 (Mon, 27 Feb 2012) Log Message: ----------- [ENH] Code quality : http://quality.tiki.org/job/Tikitrunk/406/violations/file/svn/tiki-calendar_edit_item.php/ Modified Paths: -------------- trunk/tiki-calendar_edit_item.php Modified: trunk/tiki-calendar_edit_item.php =================================================================== --- trunk/tiki-calendar_edit_item.php 2012-02-27 12:40:04 UTC (rev 39964) +++ trunk/tiki-calendar_edit_item.php 2012-02-27 13:28:24 UTC (rev 39965) @@ -21,11 +21,11 @@ $daysnames = array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Satursday"); $daysnames_abr = array("Su","Mo","Tu","We","Th","Fr","Sa"); $monthnames = array("","January","February","March","April","May","June","July","August","September","October","November","December"); -$smarty->assign('daysnames',$daysnames); -$smarty->assign('daysnames_abr',$daysnames_abr); -$smarty->assign('monthnames',$monthnames); +$smarty->assign('daysnames', $daysnames); +$smarty->assign('daysnames_abr', $daysnames_abr); +$smarty->assign('monthnames', $monthnames); -$smarty->assign('edit',false); +$smarty->assign('edit', false); $smarty->assign('recurrent', ''); $hours_minmax = ''; @@ -37,11 +37,11 @@ die; } -$rawcals['data'] = Perms::filter( array( 'type' => 'calendar' ), 'object', $rawcals['data'], array( 'object' => 'calendarId' ), 'view_calendar' ); +$rawcals['data'] = Perms::filter(array( 'type' => 'calendar' ), 'object', $rawcals['data'], array( 'object' => 'calendarId' ), 'view_calendar'); foreach ($rawcals["data"] as $cal_data) { $cal_id = $cal_data['calendarId']; - $calperms = Perms::get( array( 'type' => 'calendar', 'object' => $cal_id ) ); + $calperms = Perms::get(array( 'type' => 'calendar', 'object' => $cal_id )); if ($cal_data["personal"] == "y") { if ($user) { $cal_data["tiki_p_view_calendar"] = 'y'; @@ -65,7 +65,7 @@ $calID = $cal_id; } } -$smarty->assign('listcals',$caladd); +$smarty->assign('listcals', $caladd); if ( ! isset($_REQUEST["calendarId"]) ) { if (isset($_REQUEST['calitemId'])) { @@ -80,18 +80,18 @@ } if ($prefs['feature_groupalert'] == 'y' && !empty($calID) ) { - $groupforalert=$groupalertlib->GetGroup ('calendar',$calID); + $groupforalert=$groupalertlib->GetGroup('calendar', $calID); $showeachuser = ''; if ( $groupforalert != '' ) { - $showeachuser=$groupalertlib->GetShowEachUser('calendar',$calID, $groupforalert) ; - $listusertoalert=$userlib->get_users(0,-1,'login_asc','','',false,$groupforalert,'') ; - $smarty->assign_by_ref('listusertoalert',$listusertoalert['data']); + $showeachuser=$groupalertlib->GetShowEachUser('calendar', $calID, $groupforalert); + $listusertoalert=$userlib->get_users(0, -1, 'login_asc', '', '', false, $groupforalert, ''); + $smarty->assign_by_ref('listusertoalert', $listusertoalert['data']); } - $smarty->assign_by_ref('groupforalert',$groupforalert); - $smarty->assign_by_ref('showeachuser',$showeachuser); + $smarty->assign_by_ref('groupforalert', $groupforalert); + $smarty->assign_by_ref('showeachuser', $showeachuser); } -$tikilib->get_perm_object( $calID, 'calendar' ); +$tikilib->get_perm_object($calID, 'calendar'); $access->check_permission('tiki_p_view_calendar'); $calitemId = !empty($_REQUEST['save']['calitemId'])?$_REQUEST['save']['calitemId']:(!empty($_REQUEST['calitemId'])?$_REQUEST['calitemId']:(!empty($_REQUEST['viewcalitemId'])?$_REQUEST['viewcalitemId']:0)); @@ -100,11 +100,11 @@ if ($calitem['user'] == $user) { $smarty->assign('tiki_p_change_events', 'y'); $tiki_p_change_events = 'y'; - if (!empty($_REQUEST['save']['calendarId'])) { + if (!empty($_REQUEST['save']['calendarId'])) { $caladd[$_REQUEST['save']['calendarId']]['tiki_p_change_events'] = $caladd[$_REQUEST['save']['calendarId']]['tiki_p_add_events']; } $caladd[$calitem['calendarId']]['tiki_p_change_events'] = 'y'; - } + } } if (isset($_REQUEST['save']) && !isset($_REQUEST['preview']) && !isset($_REQUEST['act'])) { @@ -127,12 +127,12 @@ $save['allday'] = (isset($_REQUEST['allday']) && $_REQUEST['allday'] == 'true') ? 1 : 0; if (isset($_REQUEST['allday']) && $_REQUEST['allday'] == 'true') { $save['start'] = TikiLib::make_time( - 0, - 0, - 0, - $_REQUEST['start_date_Month'], - $_REQUEST['start_date_Day'], - $_REQUEST['start_date_Year'] + 0, + 0, + 0, + $_REQUEST['start_date_Month'], + $_REQUEST['start_date_Day'], + $_REQUEST['start_date_Year'] ); if ($save['end_or_duration'] == 'duration') { @@ -140,12 +140,12 @@ $save['end'] = $save['start'] + $save['duration']; } else { $save['end'] = TikiLib::make_time( - 23, - 59, - 59, - $_REQUEST['end_date_Month'], - $_REQUEST['end_date_Day'], - $_REQUEST['end_date_Year'] + 23, + 59, + 59, + $_REQUEST['end_date_Month'], + $_REQUEST['end_date_Day'], + $_REQUEST['end_date_Year'] ); $save['duration'] = max(0, $save['end'] - $save['start']); } @@ -155,12 +155,12 @@ $_REQUEST['start_Hour'] = date('H', strtotime($_REQUEST['start_Hour'] . ':00 ' . $_REQUEST['start_Meridian'])); } $save['start'] = TikiLib::make_time( - $_REQUEST['start_Hour'], - $_REQUEST['start_Minute'], - 0, - $_REQUEST['start_date_Month'], - $_REQUEST['start_date_Day'], - $_REQUEST['start_date_Year'] + $_REQUEST['start_Hour'], + $_REQUEST['start_Minute'], + 0, + $_REQUEST['start_date_Month'], + $_REQUEST['start_date_Day'], + $_REQUEST['start_date_Year'] ); if ($save['end_or_duration'] == 'duration') { @@ -172,12 +172,12 @@ $_REQUEST['end_Hour'] = date('H', strtotime($_REQUEST['end_Hour'] . ':00 ' . $_REQUEST['end_Meridian'])); } $save['end'] = TikiLib::make_time( - $_REQUEST['end_Hour'], - $_REQUEST['end_Minute'], - 0, - $_REQUEST['end_date_Month'], - $_REQUEST['end_date_Day'], - $_REQUEST['end_date_Year'] + $_REQUEST['end_Hour'], + $_REQUEST['end_Minute'], + 0, + $_REQUEST['end_date_Month'], + $_REQUEST['end_date_Day'], + $_REQUEST['end_date_Year'] ); $save['duration'] = max(0, $save['end'] - $save['start']); } @@ -212,7 +212,7 @@ } } - if (array_key_exists('recurrent',$_POST) && ($_POST['recurrent'] == 1) && $_POST['affect']!='event') { + if (array_key_exists('recurrent', $_POST) && ($_POST['recurrent'] == 1) && $_POST['affect']!='event') { $impossibleDates = false; if ($_POST['end_Hour'] < $_POST['start_Hour']) { $impossibleDates = true; @@ -223,8 +223,8 @@ if (!$impossibleDates) { $calRecurrence = new CalRecurrence($_POST['recurrenceId'] ? $_POST['recurrenceId'] : -1); $calRecurrence->setCalendarId($save['calendarId']); - $calRecurrence->setStart($_POST['start_Hour'] . str_pad($_POST['start_Minute'],2,'0',STR_PAD_LEFT)); - $calRecurrence->setEnd($_POST['end_Hour'] . str_pad($_POST['end_Minute'],2,'0',STR_PAD_LEFT)); + $calRecurrence->setStart($_POST['start_Hour'] . str_pad($_POST['start_Minute'], 2, '0', STR_PAD_LEFT)); + $calRecurrence->setEnd($_POST['end_Hour'] . str_pad($_POST['end_Minute'], 2, '0', STR_PAD_LEFT)); $calRecurrence->setAllday($save['allday'] == 1); $calRecurrence->setLocationId($save['locationId']); $calRecurrence->setCategoryId($save['categoryId']); @@ -241,19 +241,19 @@ $calRecurrence->setWeekday($_POST['weekday']); $calRecurrence->setMonthly(false); $calRecurrence->setYearly(false); - break; + break; case "monthly": $calRecurrence->setWeekly(false); $calRecurrence->setMonthly(true); $calRecurrence->setDayOfMonth($_POST['dayOfMonth']); $calRecurrence->setYearly(false); - break; + break; case "yearly": $calRecurrence->setWeekly(false); $calRecurrence->setMonthly(false); $calRecurrence->setYearly(true); - $calRecurrence->setDateOfYear(str_pad($_POST['dateOfYear_month'],2,'0',STR_PAD_LEFT) . str_pad($_POST['dateOfYear_day'],2,'0',STR_PAD_LEFT)); - break; + $calRecurrence->setDateOfYear(str_pad($_POST['dateOfYear_month'], 2, '0', STR_PAD_LEFT) . str_pad($_POST['dateOfYear_day'], 2, '0', STR_PAD_LEFT)); + break; } $calRecurrence->setStartPeriod($_POST['startPeriod']); if ($_POST['endType'] == "dt") @@ -263,35 +263,35 @@ } $calRecurrence->setUser($save['user']); $calRecurrence->save($_POST['affect'] == 'all'); - // Save the ip at the log for the addition of new calendar items when done by anonymous users - if (empty($user) && empty($save['calitemId']) && $caladd["$newcalid"]['tiki_p_add_events']) { - $logslib->add_log('calendar','Recurrent calendar item starting on '.$_POST['startPeriod'].' added to calendar '.$save['calendarId']); - } - if (empty($user) && !empty($save['calitemId']) and $caladd["$newcalid"]['tiki_p_change_events']) { - $logslib->add_log('calendar','Recurrent calendar item starting on '.$_POST['startPeriod'].' changed in calendar '.$save['calendarId']); - } + // Save the ip at the log for the addition of new calendar items when done by anonymous users + if (empty($user) && empty($save['calitemId']) && $caladd["$newcalid"]['tiki_p_add_events']) { + $logslib->add_log('calendar', 'Recurrent calendar item starting on '.$_POST['startPeriod'].' added to calendar '.$save['calendarId']); + } + if (empty($user) && !empty($save['calitemId']) and $caladd["$newcalid"]['tiki_p_change_events']) { + $logslib->add_log('calendar', 'Recurrent calendar item starting on '.$_POST['startPeriod'].' changed in calendar '.$save['calendarId']); + } header('Location: tiki-calendar.php?todate='.$save['start']); die; } } else { if (!$impossibleDates) { - if (array_key_exists('recurrenceId',$_POST)) { + if (array_key_exists('recurrenceId', $_POST)) { $save['recurrenceId'] = $_POST['recurrenceId']; $save['changed'] = true; } - $calitemId = $calendarlib->set_item($user,$save['calitemId'],$save); - // Save the ip at the log for the addition of new calendar items when done by anonymous users - if (empty($user) && empty($save['calitemId']) && $caladd["$newcalid"]['tiki_p_add_events']) { - $logslib->add_log('calendar','Calendar item '.$calitemId.' added to calendar '.$save['calendarId']); - } - if (empty($user) && !empty($save['calitemId']) and $caladd["$newcalid"]['tiki_p_change_events']) { - $logslib->add_log('calendar','Calendar item '.$calitemId.' changed in calendar '.$save['calendarId']); - } - if ($prefs['feature_groupalert'] == 'y') { - $groupalertlib->Notify($_REQUEST['listtoalert'],"tiki-calendar_edit_item.php?viewcalitemId=".$calitemId); - } - header('Location: tiki-calendar.php?todate='.$save['start']); - die; + $calitemId = $calendarlib->set_item($user, $save['calitemId'], $save); + // Save the ip at the log for the addition of new calendar items when done by anonymous users + if (empty($user) && empty($save['calitemId']) && $caladd["$newcalid"]['tiki_p_add_events']) { + $logslib->add_log('calendar', 'Calendar item '.$calitemId.' added to calendar '.$save['calendarId']); + } + if (empty($user) && !empty($save['calitemId']) and $caladd["$newcalid"]['tiki_p_change_events']) { + $logslib->add_log('calendar', 'Calendar item '.$calitemId.' changed in calendar '.$save['calendarId']); + } + if ($prefs['feature_groupalert'] == 'y') { + $groupalertlib->Notify($_REQUEST['listtoalert'], "tiki-calendar_edit_item.php?viewcalitemId=".$calitemId); + } + header('Location: tiki-calendar.php?todate='.$save['start']); + die; } } } @@ -319,7 +319,7 @@ $calitem = $calendarlib->get_item($_REQUEST['calitemId']); $calendarlib->drop_item($user, $_REQUEST["calitemId"]); if (empty($user)) { - $logslib->add_log('calendar','Calendar item '.$_REQUEST['calitemId'].' deleted'); + $logslib->add_log('calendar', 'Calendar item '.$_REQUEST['calitemId'].' deleted'); } $_REQUEST["calitemId"] = 0; header('Location: tiki-calendar.php?todate='.$calitem['start']); @@ -329,7 +329,7 @@ $calRec = new CalRecurrence($_REQUEST['recurrenceId']); $calRec->delete(); if (empty($user)) { - $logslib->add_log('calendar','Recurrent calendar items (recurrenceId = '.$_REQUEST["recurrenceId"].') deleted'); + $logslib->add_log('calendar', 'Recurrent calendar items (recurrenceId = '.$_REQUEST["recurrenceId"].') deleted'); } $_REQUEST["recurrenceTypeId"] = 0; $_REQUEST["calitemId"] = 0; @@ -345,11 +345,11 @@ $calendarlib->drop_item($user, $_REQUEST['drop']); } if (empty($user)) { - $logslib->add_log('calendar','Calendar item/s '.$_REQUEST['calitemId'].' droped'); + $logslib->add_log('calendar', 'Calendar item/s '.$_REQUEST['calitemId'].' droped'); } header('Location: tiki-calendar.php'); die; -} elseif (isset($_REQUEST['duplicate']) and $tiki_p_add_events == 'y') { +} elseif (isset($_REQUEST['duplicate']) and $tiki_p_add_events == 'y') { // Check antibot code if anonymous and allowed if (empty($user) && $prefs['feature_antibot'] == 'y' && (!$captchalib->validate())) { $smarty->assign('msg', $captchalib->getErrors()); @@ -360,14 +360,14 @@ $calitem = $calendarlib->get_item($_REQUEST['calitemId']); $calitem['calendarId'] = $calID; $calitem['calitemId'] = 0; - $calendarlib->set_item($user,0,$calitem); + $calendarlib->set_item($user, 0, $calitem); $id = 0; if (isset($_REQUEST['calId'])) { $calendar = $calendarlib->get_calendar($_REQUEST['calId']); - } else { + } else { $calendar = $calendarlib->get_calendar($calitem['calendarId']); - } - $smarty->assign('edit',true); + } + $smarty->assign('edit', true); $hour_minmax = abs(ceil(($calendar['startday']-1)/(60*60))) . '-' . ceil(($calendar['endday'])/(60*60)); } elseif (isset($_REQUEST['preview']) || $impossibleDates) { $save['parsed'] = $tikilib->parse_data($save['description'], array('is_html' => $prefs['calendar_description_is_html'] === 'y')); @@ -393,14 +393,14 @@ $smarty->assign_by_ref('recurrence', $recurrence); $calendar = $calendarlib->get_calendar($calitem['calendarId']); - $smarty->assign('edit',true); + $smarty->assign('edit', true); $smarty->assign('preview', isset($_REQUEST['preview'])); } elseif (isset($_REQUEST['changeCal'])) { $calitem = $save; $calendar = $calendarlib->get_calendar($calitem['calendarId']); if (empty($save['calitemId'])) $calitem['allday'] = $calendar['allday']=='y'?true: false; - $smarty->assign('edit',true); + $smarty->assign('edit', true); $id = isset($save['calitemId'])?$save['calitemId']: 0; $hour_minmax = ceil(($calendar['startday'])/(60*60)).'-'. ceil(($calendar['endday'])/(60*60)); $smarty->assign('changeCal', isset($_REQUEST['changeCal'])); @@ -413,7 +413,7 @@ $calitem = $calendarlib->get_item($_REQUEST['calitemId']); $id = $_REQUEST['calitemId']; $calendar = $calendarlib->get_calendar($calitem['calendarId']); - $smarty->assign('edit',true); + $smarty->assign('edit', true); $hour_minmax = ceil(($calendar['startday'])/(60*60)).'-'. ceil(($calendar['endday'])/(60*60)); //Add event buttons - either button on top of page or one of the buttons on a specific day } elseif (isset($calID) and $tiki_p_add_events == 'y') { @@ -425,20 +425,20 @@ } //if current time of day is within the calendar day (between startday and endday), then use now as start, otherwise use beginning of calendar day $now_start = TikiLib::make_time( - abs(ceil($calendar['startday']/(60*60))), - 0, - 0, - TikiLib::date_format('%m', $now), - TikiLib::date_format('%d', $now), - TikiLib::date_format('%Y', $now) + abs(ceil($calendar['startday']/(60*60))), + 0, + 0, + TikiLib::date_format('%m', $now), + TikiLib::date_format('%d', $now), + TikiLib::date_format('%Y', $now) ); $now_end = TikiLib::make_time( - abs(ceil($calendar['endday']/(60*60))), - 0, - 0, - TikiLib::date_format('%m', $now), - TikiLib::date_format('%d', $now), - TikiLib::date_format('%Y', $now) + abs(ceil($calendar['endday']/(60*60))), + 0, + 0, + TikiLib::date_format('%m', $now), + TikiLib::date_format('%d', $now), + TikiLib::date_format('%Y', $now) ); $now_start = ($now_start <= $now && ($now_start + (60*60)) < $now_end) ? $now : $now_start; @@ -464,7 +464,7 @@ ); $hour_minmax = abs(ceil(($calendar['startday']-1)/(60*60))). '-' . ceil(($calendar['endday'])/(60*60)); $id = 0; - $smarty->assign('edit',true); + $smarty->assign('edit', true); } else { $smarty->assign('errortype', 401); $smarty->assign('msg', tra("You do not have permission to view this page")); @@ -513,9 +513,9 @@ } $smarty->assign('listlanguages', $languages); -$smarty->assign('listpriorities',array('0','1','2','3','4','5','6','7','8','9')); -$smarty->assign('listprioritycolors',array('fff','fdd','fcc','fbb','faa','f99','e88','d77','c66','b66','a66')); -$smarty->assign('listroles',array('0'=>'','1'=>tra('required'),'2'=>tra('optional'),'3'=>tra('non participant'))); +$smarty->assign('listpriorities', array('0','1','2','3','4','5','6','7','8','9')); +$smarty->assign('listprioritycolors', array('fff','fdd','fcc','fbb','faa','f99','e88','d77','c66','b66','a66')); +$smarty->assign('listroles', array('0'=>'','1'=>tra('required'),'2'=>tra('optional'),'3'=>tra('non participant'))); if ($prefs['feature_theme_control'] == 'y') { @@ -524,7 +524,7 @@ include('tiki-tc.php'); } -$headerlib->add_cssfile('css/calendar.css',20); +$headerlib->add_cssfile('css/calendar.css', 20); $smarty->assign('referer', empty($_SERVER['HTTP_REFERER']) || strpos($_SERVER['HTTP_REFERER'], 'tiki-calendar_edit_item.php') !== false ? 'tiki-calendar.php' : $_SERVER['HTTP_REFERER']); $smarty->assign('myurl', 'tiki-calendar_edit_item.php'); @@ -532,10 +532,10 @@ $smarty->assign('hour_minmax', $hour_minmax); if ($calitem['recurrenceId'] > 0) { $cr = new CalRecurrence($calitem['recurrenceId']); - $smarty->assign('recurrence',$cr->toArray()); + $smarty->assign('recurrence', $cr->toArray()); } -$headerlib->add_js(' -function checkDateOfYear(day,month) { +$headerlib->add_js( +'function checkDateOfYear(day,month) { var mName = new Array("-","'.tra('January').'","'.tra('February').'","'.tra('March').'","'.tra('April').'","'.tra('May').'","'.tra('June').'","'.tra('July').'","'.tra('August').'","'.tra('September').'","'.tra('October').'","'.tra('November').'","'.tra('December').'}"); var error = false; if (month == 4 || month == 6 || month == 9 || month == 11) @@ -549,18 +549,18 @@ } else { document.getElementById("errorDateOfYear").innerHTML = ""; } -} -'); +}' +); $smarty->assign('calitem', $calitem); $smarty->assign('calendar', $calendar); $smarty->assign('calendarId', $calID); -if (array_key_exists('CalendarViewGroups',$_SESSION) && count($_SESSION['CalendarViewGroups']) == 1) - $smarty->assign('calendarView',$_SESSION['CalendarViewGroups'][0]); +if (array_key_exists('CalendarViewGroups', $_SESSION) && count($_SESSION['CalendarViewGroups']) == 1) + $smarty->assign('calendarView', $_SESSION['CalendarViewGroups'][0]); global $wikilib; include_once('lib/wiki/wikilib.php'); $plugins = $wikilib->list_plugins(true, 'editwiki'); $smarty->assign_by_ref('plugins', $plugins); -$smarty->assign('impossibleDates',$impossibleDates); +$smarty->assign('impossibleDates', $impossibleDates); if ( !empty($_REQUEST['fullcalendar']) ) { $smarty->display('calendar.tpl'); } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jon...@us...> - 2017-09-26 08:20:20
|
Revision: 64006 http://sourceforge.net/p/tikiwiki/code/64006 Author: jonnybradley Date: 2017-09-26 08:20:18 +0000 (Tue, 26 Sep 2017) Log Message: ----------- [FIX] calendar: Fix non-all-day calendar event creation Modified Paths: -------------- trunk/tiki-calendar_edit_item.php Modified: trunk/tiki-calendar_edit_item.php =================================================================== --- trunk/tiki-calendar_edit_item.php 2017-09-26 01:58:23 UTC (rev 64005) +++ trunk/tiki-calendar_edit_item.php 2017-09-26 08:20:18 UTC (rev 64006) @@ -247,7 +247,7 @@ $calRecurrence->setCalendarId($save['calendarId']); $calRecurrence->setStart($_POST['start_Hour'] . str_pad($_POST['start_Minute'], 2, '0', STR_PAD_LEFT)); $calRecurrence->setEnd($_POST['end_Hour'] . str_pad($_POST['end_Minute'], 2, '0', STR_PAD_LEFT)); - $calRecurrence->setAllday($save['allday'] == 1); + $calRecurrence->setAllday($save['allday']); $calRecurrence->setLocationId($save['locationId']); $calRecurrence->setCategoryId($save['categoryId']); $calRecurrence->setNlId(0); //TODO : What id nlId ? This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jon...@us...> - 2018-08-02 10:43:53
|
Revision: 67108 http://sourceforge.net/p/tikiwiki/code/67108 Author: jonnybradley Date: 2018-08-02 10:43:51 +0000 (Thu, 02 Aug 2018) Log Message: ----------- [FIX] calendar: Fix preview on recurring events Modified Paths: -------------- trunk/tiki-calendar_edit_item.php Modified: trunk/tiki-calendar_edit_item.php =================================================================== --- trunk/tiki-calendar_edit_item.php 2018-08-01 12:06:14 UTC (rev 67107) +++ trunk/tiki-calendar_edit_item.php 2018-08-02 10:43:51 UTC (rev 67108) @@ -420,11 +420,11 @@ $save['parsed'] = TikiLib::lib('parser')->parse_data($save['description'], ['is_html' => $prefs['calendar_description_is_html'] === 'y']); $save['parsedName'] = TikiLib::lib('parser')->parse_data($save['name']); $id = isset($save['calitemId']) ? isset($save['calitemId']) : ''; + $save['recurrenceId'] = isset($_POST['recurrenceId']) ? $_POST['recurrenceId'] : ''; $calitem = $save; - $calitem['recurrenceId'] = ''; $recurrence = [ - 'id' => '', + 'id' => $calitem['recurrenceId'], 'weekly' => isset($_POST['recurrenceType']) && $_POST['recurrenceType'] == 'weekly', 'weekday' => isset($_POST['weekday']) ? $_POST['weekday'] : '', 'monthly' => isset($_POST['recurrenceType']) && $_POST['recurrenceType'] == 'monthly', This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |