Note: this list is kept only as a demonstration for CVSNotice. For the latest CVS notices, see the Xaraya and Postnuke sites
View Statistics - Next Notice - Previous NoticeDirectory filter : [ all ] / postnuke_modules / postcalendar [ view in CVS ]
| Date | Directory [filter] | File(s) [view] | Author [filter] |
| 04 Oct 2002 19:31:18 | postnuke_modules/postcalendar | pnuser.php,1.62,1.63 pnuserapi.php,1.113,1.114 | Roger Raymond |
| beginnings of shared calendars | |||
Update of /home/cvsroot/postnuke_modules/postcalendar
In directory ns7.hostnuke.net:/tmp/cvs-serv1538
Modified Files:
pnuser.php pnuserapi.php
Log Message:
beginnings of shared calendars
Index: pnuser.php
===================================================================
RCS file: /home/cvsroot/postnuke_modules/postcalendar/pnuser.php,v
retrieving revision 1.62
retrieving revision 1.63
diff -C2 -d -r1.62 -r1.63
*** pnuser.php 2 Oct 2002 20:55:58 -0000 1.62
--- pnuser.php 4 Oct 2002 19:31:15 -0000 1.63
***************
*** 217,223 ****
if($form_action == 'preview') {
! if (!pnSecConfirmAuthKey()) {
! die(_NO_DIRECT_ACCESS);
! }
// check for required fields
$required_vars = array('event_subject','event_desc');
--- 217,222 ----
if($form_action == 'preview') {
! // check authid
! if (!pnSecConfirmAuthKey()) { die(_NO_DIRECT_ACCESS); }
// check for required fields
$required_vars = array('event_subject','event_desc');
***************
*** 319,325 ****
if($form_action == 'commit') {
! if (!pnSecConfirmAuthKey()) {
! die(_NO_DIRECT_ACCESS);
! }
// 04/14/02 pascal berger: events submitted by admins are immediately approved
if($allowdirectsubmit || pnSecAuthAction(0, 'PostCalendar::', '::', ACCESS_ADMIN)) {
--- 318,322 ----
if($form_action == 'commit') {
! if (!pnSecConfirmAuthKey()) { die(_NO_DIRECT_ACCESS); }
// 04/14/02 pascal berger: events submitted by admins are immediately approved
if($allowdirectsubmit || pnSecAuthAction(0, 'PostCalendar::', '::', ACCESS_ADMIN)) {
***************
*** 353,378 ****
'event_city','event_state','event_postal'));
$sql = "INSERT INTO $events_table (
! $events_column[title],
! $events_column[time],
! $events_column[hometext],
! $events_column[topic],
! $events_column[informant],
! $events_column[eventDate],
! $events_column[endDate],
! $events_column[recurrtype],
! $events_column[recurrfreq],
! $events_column[startTime],
! $events_column[alldayevent],
! $events_column[catid],
! $events_column[location],
! $events_column[conttel],
! $events_column[contname],
! $events_column[contemail],
! $events_column[website],
! $events_column[fee],
! $events_column[eventstatus],
! $events_column[recurrspec],
! $events_column[duration])
VALUES (
'".pnVarPrepForStore($event_subject)."',
--- 350,384 ----
'event_city','event_state','event_postal'));
+ if(pnUserLoggedIn()) {
+ $event_userid = pnUserGetVar('uid');
+ } else {
+ $event_userid = 0;
+ }
+
+
$sql = "INSERT INTO $events_table (
! pc_title,
! pc_time,
! pc_hometext,
! pc_topic,
! pc_informant,
! pc_eventDate,
! pc_endDate,
! pc_recurrtype,
! pc_recurrfreq,
! pc_startTime,
! pc_alldayevent,
! pc_catid,
! pc_location,
! pc_conttel,
! pc_contname,
! pc_contemail,
! pc_website,
! pc_fee,
! pc_eventstatus,
! pc_recurrspec,
! pc_duration,
! pc_sharing,
! pc_aid)
VALUES (
'".pnVarPrepForStore($event_subject)."',
***************
*** 396,400 ****
'".pnVarPrepForStore($event_status)."',
'".pnVarPrepForStore($event_recurrspec)."',
! '".pnVarPrepForStore($event_duration)."'
)";
--- 402,408 ----
'".pnVarPrepForStore($event_status)."',
'".pnVarPrepForStore($event_recurrspec)."',
! '".pnVarPrepForStore($event_duration)."',
! '".pnVarPrepForStore($event_sharing)."',
! '".pnVarPrepForStore($event_userid)."'
)";
***************
*** 405,408 ****
--- 413,417 ----
$output->Text(_PC_EVENT_SUBMISSION_FAILED);
$output->Linebreak(2);
+ $output->Text($dbconn->ErrorMsg());
} else {
$output->Text(_PC_EVENT_SUBMISSION_SUCCESS);
***************
*** 441,450 ****
$tpl->assign('TPL_NAME',$template_name);
$tpl->assign('FUNCTION',pnVarCleanFromInput('func'));
- //$tpl->assign('DayView', _CALDAYLINK);
- //$tpl->assign('WeekView', _CALWEEKLINK);
- //$tpl->assign('MonthView', _CALMONTHLINK);
- //$tpl->assign('YearView', _CALYEARLINK);
- //$tpl->assign('Submit', _CALSUBMITEVENT);
- //$tpl->assign('Search', _CALSEARCHEVENT);
$tpl->assign('ModuleName', $modinfo['displayname']);
$tpl->assign('ModuleDirectory', $modinfo['directory']);
--- 450,453 ----
***************
*** 615,621 ****
$tpl->assign('InputEventCategory', 'event_category');
//=================================================================
! // PARSE event_sharing_block (N/A)
//=================================================================
- /*
$data = array('0' => array('0',_PC_SHARE_PRIVATE),
'1' => array('1',_PC_SHARE_PUBLIC),
--- 618,623 ----
$tpl->assign('InputEventCategory', 'event_category');
//=================================================================
! // PARSE event_sharing_block
//=================================================================
$data = array('0' => array('0',_PC_SHARE_PRIVATE),
'1' => array('1',_PC_SHARE_PUBLIC),
***************
*** 633,637 ****
$tpl->assign('EventSharingTitle', _PC_SHARING);
$tpl->assign('InputEventSharing','event_sharing');
- */
//=================================================================
// previously used location pulldown and javascript controls
--- 635,638 ----
Index: pnuserapi.php
===================================================================
RCS file: /home/cvsroot/postnuke_modules/postcalendar/pnuserapi.php,v
retrieving revision 1.113
retrieving revision 1.114
diff -C2 -d -r1.113 -r1.114
*** pnuserapi.php 2 Oct 2002 21:02:03 -0000 1.113
--- pnuserapi.php 4 Oct 2002 19:31:15 -0000 1.114
***************
*** 550,557 ****
$output->SetInputMode(_PNH_VERBATIMINPUT);
- // let's load the User API so we can use it
- if(!pnModAPILoad('postcalendar','user')) {
- die('Could not load PostCalendar user API');
- }
// let's get the DB information
pnModDBInfoLoad('postcalendar');
--- 550,553 ----
***************
*** 757,764 ****
$output->SetInputMode(_PNH_VERBATIMINPUT);
- // let's load the User API so we can use it
- if(!pnModAPILoad('postcalendar','user')) {
- die('Could not load PostCalendar user API');
- }
// let's get the DB information
pnModDBInfoLoad('postcalendar');
--- 753,756 ----
***************
*** 1099,1102 ****
--- 1091,1109 ----
{
extract($args);
+ $username = pnVarCleanFromInput('username');
+ $userid = '0';
+
+ // here we add the userid of the user specified to the IN
+ if(!empty($username)) {
+ // get the userid for the username specified
+ $userinfo = pnUserGetAll();
+ foreach($userinfo as $users) {
+ $uname = $users['uname'];
+ if(strtolower($uname) == strtolower($username)) {
+ $userid = $users['uid'];
+ break;
+ }
+ }
+ }
if(!isset($eventstatus)) {
***************
*** 1145,1148 ****
--- 1152,1156 ----
a.$column[website],
a.$column[fee],
+ a.pc_sharing,
b.$catcolumn[catcolor],
b.$catcolumn[catname],
***************
*** 1154,1160 ****
}
$sql .= "AND (a.$column[endDate] >= '$start' OR a.$column[endDate] = '0000-00-00'))
! AND b.$catcolumn[catid] = a.$column[catid]
! ORDER BY a.$column[eventDate], a.$column[startTime] ASC";
if(isset($limit)) $sql .= " LIMIT 0,$limit";
--- 1162,1176 ----
}
$sql .= "AND (a.$column[endDate] >= '$start' OR a.$column[endDate] = '0000-00-00'))
! AND b.$catcolumn[catid] = a.$column[catid] ";
! // grab anonymous or global events
! if($userid == 0) {
! $sql .= "AND (((a.pc_aid = $userid OR a.pc_aid = '') AND (a.pc_sharing = 1 OR a.pc_sharing = 2 OR a.pc_sharing = ''))
! OR (a.pc_sharing = 3)) ";
! } else {
! $sql .= "AND (a.pc_aid = $userid AND (a.pc_sharing = 1 OR a.pc_sharing = 2 OR a.pc_sharing = 3)) ";
! }
! $sql .= "ORDER BY a.$column[eventDate], a.$column[startTime] ASC";
+ //print($sql);
if(isset($limit)) $sql .= " LIMIT 0,$limit";
***************
*** 1177,1181 ****
$tmp['recurrspec'], $tmp['topic'], $tmp['alldayevent'],
$tmp['location'], $tmp['conttel'], $tmp['contname'],
! $tmp['contemail'], $tmp['website'], $tmp['fee'],
$tmp['catcolor'], $tmp['catname'], $tmp['catdesc']) = $result->fields;
--- 1193,1197 ----
$tmp['recurrspec'], $tmp['topic'], $tmp['alldayevent'],
$tmp['location'], $tmp['conttel'], $tmp['contname'],
! $tmp['contemail'], $tmp['website'], $tmp['fee'],$tmp['sharing'],
$tmp['catcolor'], $tmp['catname'], $tmp['catdesc']) = $result->fields;
***************
*** 1196,1226 ****
// add event to the array if we passed the permissions check
! $events[$i]['eid'] = $tmp['eid'];
! $events[$i]['uname'] = $tmp['uname'];
! $events[$i]['uid'] = $userid;
! $events[$i]['catid'] = $tmp['catid'];
! $events[$i]['title'] = pnVarPrepHTMLDisplay(postcalendar_removeScriptTags($tmp['title']));
! $events[$i]['time'] = $tmp['time'];
! $events[$i]['hometext'] = pnVarPrepHTMLDisplay(postcalendar_removeScriptTags($tmp['hometext']));
! $events[$i]['eventDate'] = $tmp['eventDate'];
! $events[$i]['duration'] = $tmp['duration'];
! @list($events[$i]['duration_hours'],$dmin) = @explode('.',($tmp['duration']/60/60));
! $events[$i]['duration_minutes'] = 60*($dmin/100);
! $events[$i]['endDate'] = $tmp['endDate'];
! $events[$i]['startTime'] = $tmp['startTime'];
! $events[$i]['recurrtype'] = $tmp['recurrtype'];
! $events[$i]['recurrfreq'] = $tmp['recurrfreq'];
! $events[$i]['recurrspec'] = $tmp['recurrspec'];
! $events[$i]['topic'] = $tmp['topic'];
! $events[$i]['alldayevent'] = $tmp['alldayevent'];
! $events[$i]['location'] = pnVarPrepHTMLDisplay(postcalendar_removeScriptTags($tmp['location']));
! $events[$i]['conttel'] = pnVarPrepHTMLDisplay(postcalendar_removeScriptTags($tmp['conttel']));
! $events[$i]['contname'] = pnVarPrepHTMLDisplay(postcalendar_removeScriptTags($tmp['contname']));
! $events[$i]['contemail'] = pnVarPrepHTMLDisplay(postcalendar_removeScriptTags($tmp['contemail']));
! $events[$i]['website'] = pnVarPrepHTMLDisplay(postcalendar_removeScriptTags($tmp['website']));
! $events[$i]['fee'] = pnVarPrepHTMLDisplay(postcalendar_removeScriptTags($tmp['fee']));
! $events[$i]['catcolor'] = $tmp['catcolor'];
! $events[$i]['catname'] = $tmp['catname'];
! $events[$i]['catdesc'] = $tmp['catdesc'];
$i++;
}
--- 1212,1279 ----
// add event to the array if we passed the permissions check
!
! // is this a public event to be shown as busy?
! // if it's an event for the logged in user do else statement
! if($tmp['sharing'] == 2 && pnUserGetVar('uid') != $userid) {
! // make it not display any information
! $events[$i]['eid'] = $tmp['eid'];
! $events[$i]['uname'] = $tmp['uname'];
! $events[$i]['uid'] = $userid;
! $events[$i]['catid'] = $tmp['catid'];
! $events[$i]['title'] = 'busy'; //pnVarPrepHTMLDisplay(postcalendar_removeScriptTags($tmp['title']));
! $events[$i]['time'] = $tmp['time'];
! $events[$i]['hometext'] = 'i am busy during this time'; pnVarPrepHTMLDisplay(postcalendar_removeScriptTags($tmp['hometext']));
! $events[$i]['eventDate'] = $tmp['eventDate'];
! $events[$i]['duration'] = $tmp['duration'];
! @list($events[$i]['duration_hours'],$dmin) = @explode('.',($tmp['duration']/60/60));
! $events[$i]['duration_minutes'] = 60*($dmin/100);
! $events[$i]['endDate'] = $tmp['endDate'];
! $events[$i]['startTime'] = $tmp['startTime'];
! $events[$i]['recurrtype'] = $tmp['recurrtype'];
! $events[$i]['recurrfreq'] = $tmp['recurrfreq'];
! $events[$i]['recurrspec'] = $tmp['recurrspec'];
! $events[$i]['topic'] = $tmp['topic'];
! $events[$i]['alldayevent'] = $tmp['alldayevent'];
! $events[$i]['location'] = ''; //pnVarPrepHTMLDisplay(postcalendar_removeScriptTags($tmp['location']));
! $events[$i]['conttel'] = ''; //pnVarPrepHTMLDisplay(postcalendar_removeScriptTags($tmp['conttel']));
! $events[$i]['contname'] = ''; //pnVarPrepHTMLDisplay(postcalendar_removeScriptTags($tmp['contname']));
! $events[$i]['contemail'] = ''; //pnVarPrepHTMLDisplay(postcalendar_removeScriptTags($tmp['contemail']));
! $events[$i]['website'] = ''; //pnVarPrepHTMLDisplay(postcalendar_removeScriptTags($tmp['website']));
! $events[$i]['fee'] = ''; //pnVarPrepHTMLDisplay(postcalendar_removeScriptTags($tmp['fee']));
! $events[$i]['catcolor'] = $tmp['catcolor'];
! $events[$i]['catname'] = $tmp['catname'];
! $events[$i]['catdesc'] = $tmp['catdesc'];
! $events[$i]['sharing'] = $tmp['sharing'];
! } else {
! $events[$i]['eid'] = $tmp['eid'];
! $events[$i]['uname'] = $tmp['uname'];
! $events[$i]['uid'] = $userid;
! $events[$i]['catid'] = $tmp['catid'];
! $events[$i]['title'] = pnVarPrepHTMLDisplay(postcalendar_removeScriptTags($tmp['title']));
! $events[$i]['time'] = $tmp['time'];
! $events[$i]['hometext'] = pnVarPrepHTMLDisplay(postcalendar_removeScriptTags($tmp['hometext']));
! $events[$i]['eventDate'] = $tmp['eventDate'];
! $events[$i]['duration'] = $tmp['duration'];
! @list($events[$i]['duration_hours'],$dmin) = @explode('.',($tmp['duration']/60/60));
! $events[$i]['duration_minutes'] = 60*($dmin/100);
! $events[$i]['endDate'] = $tmp['endDate'];
! $events[$i]['startTime'] = $tmp['startTime'];
! $events[$i]['recurrtype'] = $tmp['recurrtype'];
! $events[$i]['recurrfreq'] = $tmp['recurrfreq'];
! $events[$i]['recurrspec'] = $tmp['recurrspec'];
! $events[$i]['topic'] = $tmp['topic'];
! $events[$i]['alldayevent'] = $tmp['alldayevent'];
! $events[$i]['location'] = pnVarPrepHTMLDisplay(postcalendar_removeScriptTags($tmp['location']));
! $events[$i]['conttel'] = pnVarPrepHTMLDisplay(postcalendar_removeScriptTags($tmp['conttel']));
! $events[$i]['contname'] = pnVarPrepHTMLDisplay(postcalendar_removeScriptTags($tmp['contname']));
! $events[$i]['contemail'] = pnVarPrepHTMLDisplay(postcalendar_removeScriptTags($tmp['contemail']));
! $events[$i]['website'] = pnVarPrepHTMLDisplay(postcalendar_removeScriptTags($tmp['website']));
! $events[$i]['fee'] = pnVarPrepHTMLDisplay(postcalendar_removeScriptTags($tmp['fee']));
! $events[$i]['catcolor'] = $tmp['catcolor'];
! $events[$i]['catname'] = $tmp['catname'];
! $events[$i]['catdesc'] = $tmp['catdesc'];
! $events[$i]['sharing'] = $tmp['sharing'];
! }
!
$i++;
}
View Statistics - Next Notice - Previous Notice
| Visit Developer Site - Browse CVS Repository |
Syndicate via backend.rss (max. once per hour please) | Powered by CVSNotice 0.1.3 |