Home · Links · Contact Us
Home arrow Forums
Home
Features
FAQ
Screen Shots
Modules
Themes
Demos
Documentation
Forums
Contact Us
Download
Purchase
Quotes

" ... I want to tell you that your thyme product is functional and valuable beyond words. I cannot imagine why any portal would be without it. It is the cornerstone of our new project ..."

" ... Thanks for such a complete project, its making my job much easier. ..."

" ... I have now deployed 4 different calendars and our users love them ... "

" ... Easy to install and use and a great look/design. ..."

" ... This has to be the easiest to use program I think I've had to deal with at all this year. ..."


  FAQFAQ    SearchSearch  RegisterRegister   Log inLog in 
Reminder Changes

 
Post new topic   Reply to topic     Forum Index -> Modules
View previous topic :: View next topic  
Author Message
Guest






PostPosted: Thu Dec 08, 2005 10:22 pm    Post subject: Reminder Changes Reply with quote

Has anyone changed the reminder text to allow the person to assign more than 2 reminders and set the reminders for other users?
Back to top
patrick



Joined: 10 Sep 2005
Posts: 70

PostPosted: Sat Dec 10, 2005 8:30 pm    Post subject: Reply with quote

No one has developed this. We could help you change Thyme if you wish.
Back to top
View user's profile Send private message
Guest






PostPosted: Fri Dec 16, 2005 2:42 pm    Post subject: Reply with quote

I should have a version done by the end of the day.

It will also include the ability to assign the reminder to anyone else.
Back to top
Guest






PostPosted: Fri Dec 16, 2005 9:48 pm    Post subject: Reply with quote

The down and dirty way to do it is modify the include/reminders.php file as such. It would be much slicker to add a global field to setup some sort of loop. But assuming you want to go to 5 reminders or something this is plenty.

I am struggling to get the choice to add anyone to the reminder list. The problem is i have setup the Mambo auth module and that is complicating issues beyond the simple solution (which would be very easy).

/* vim: set expandtab tabstop=4 shiftwidth=4: */
//
// +----------------------------------------------------------------------+
// | Copyright (c) 2004-2005 eXtrovert Software |
// +----------------------------------------------------------------------+
// | This source file is subject to the license you agreed to when this |
// | software package was installed. A copy of the license has also been |
// | distributed with this software. See LICENSE.txt under the base |
// | install directory. If you do not have a copy of this license file, |
// | or obtained this software through a 3rd party without agreeing to |
// | the license, please cease using this software and send an e-mail to |
// | license@extrosoft.com. |
// +----------------------------------------------------------------------+
//
// $Id: reminders.php,v 1.11 2005/08/26 18:44:55 ian Exp $
//

global $_cal_dbpref;

if($_cal_event->override_id)
$rid = $_cal_event->override_id;
else
$rid = $_cal_event->id;


$reminders = $_cal_sql->query("select * from {$_cal_dbpref}Reminders where uid = ". $_cal_user->id .
" and eid = ". $rid ." order by remindtime desc");

######################
#
## CHECK FOR UPDATES
#
######################
if($_REQUEST['event_action'] == _UPDATE_) {


# 1ST REMINDER
if($_REQUEST['remind1']) {


$rtime = ($_REQUEST['remind1_days'] * 1440) + ($_REQUEST['remind1_time_hr'] * 60) + ($_REQUEST['remind1_time_min']);

# UPDATE
if($_REQUEST['remind1id']) {
$_cal_sql->query("update {$_cal_dbpref}Reminders set remindtime = ". $rtime .", contact = ".
$_cal_sql->escape_string($_REQUEST['remind1_email']) ." where id = ".
$_cal_sql->escape_string($_REQUEST['remind1id']));

# INSERT
} else {
$_cal_sql->query("insert into {$_cal_dbpref}Reminders (eid, uid, remindtime, contact) values (".
$rid .",". $_cal_user->id . ",". $rtime .",".
$_cal_sql->escape_string($_REQUEST['remind1_email']) .")");
}

# REMIND ID BUT NOT CHECKED
} else if($_REQUEST['remind1id']) {

$_cal_sql->query("delete from {$_cal_dbpref}Reminders
where id = ". $_cal_sql->escape_string($_REQUEST['remind1id']));

}

# 2ND REMINDER
if($_REQUEST['remind2']) {


$rtime = ($_REQUEST['remind2_days'] * 1440) + ($_REQUEST['remind2_time_hr'] * 60) + ($_REQUEST['remind2_time_min']);

# UPDATE
if($_REQUEST['remind2id']) {
$_cal_sql->query("update {$_cal_dbpref}Reminders set remindtime = ". $rtime .", contact = ".
$_REQUEST['remind2_email'] ." where id = ". $_cal_sql->escape_string($_REQUEST['remind2id']));

# INSERT
} else {
$_cal_sql->query("insert into {$_cal_dbpref}Reminders (eid, uid, remindtime, contact) values (".
$rid .",". $_cal_user->id . ",". $rtime .",". $_cal_sql->escape_string($_REQUEST['remind2_email']) .")");
}

# REMIND ID BUT NOT CHECKED
} elseif($_REQUEST['remind2id']) {

$_cal_sql->query("delete from {$_cal_dbpref}Reminders
where id = ". $_cal_sql->escape_string($_REQUEST['remind2id']));

}

$reminders = $_cal_sql->query("select * from {$_cal_dbpref}Reminders where uid = ". $_cal_user->id .
" and eid = ". $rid ." order by remindtime");


}

#EMF Start
# 3rd REMINDER
if($_REQUEST['remind3']) {


$rtime = ($_REQUEST['remind3_days'] * 1440) + ($_REQUEST['remind3_time_hr'] * 60) + ($_REQUEST['remind3_time_min']);

# UPDATE
if($_REQUEST['remind3id']) {
$_cal_sql->query("update {$_cal_dbpref}Reminders set remindtime = ". $rtime .", contact = ".
$_cal_sql->escape_string($_REQUEST['remind3_email']) ." where id = ".
$_cal_sql->escape_string($_REQUEST['remind3id']));

# INSERT
} else {
$_cal_sql->query("insert into {$_cal_dbpref}Reminders (eid, uid, remindtime, contact) values (".
$rid .",". $_cal_user->id . ",". $rtime .",".
$_cal_sql->escape_string($_REQUEST['remind3_email']) .")");
}

# REMIND ID BUT NOT CHECKED
} else if($_REQUEST['remind3id']) {

$_cal_sql->query("delete from {$_cal_dbpref}Reminders
where id = ". $_cal_sql->escape_string($_REQUEST['remind3id']));

}
#EMF Stopped


#EMF Start Assign to Anyone
$eml_list = array(0 => $_cal_user->email);
$eml_list += $_cal_sql->query("select id, email from {$_cal_dbpref}ContactOpts where uid = ".
$_cal_user->id, true);
#EMF Stop Assign to Anyone

####################
#
## FORM DEFAULTS
#
####################
$_cal_form->defaults['remind1'] = isset($reminders[0]);
$_cal_form->defaults['remind2'] = isset($reminders[1]);
$_cal_form->defaults['remind3'] = isset($reminders[2]);

$_cal_form->defaults['remind1_days'] = intval($reminders[0]['remindtime'] / 1440);
$_cal_form->defualts['remind2_days'] = intval($reminders[1]['remindtime'] / 1440);
$_cal_form->defualts['remind3_days'] = intval($reminders[2]['remindtime'] / 1440);

$_cal_form->defaults['remind1_email'] = $reminders[0]['contact'];
$_cal_form->defaults['remind2_email'] = $reminders[1]['contact'];
$_cal_form->defaults['remind3_email'] = $reminders[2]['contact'];

$_cal_form->defaults['remind1_time_hr'] = intval(($reminders[0]['remindtime'] % 1440) / 60);
$_cal_form->defaults['remind2_time_hr'] = intval(($reminders[1]['remindtime'] % 1440) / 60);
$_cal_form->defaults['remind3_time_hr'] = intval(($reminders[2]['remindtime'] % 1440) / 60);

$_cal_form->defaults['remind1_time_min'] = $reminders[0]['remindtime'] % 60;
$_cal_form->defaults['remind2_time_min'] = $reminders[1]['remindtime'] % 60;
$_cal_form->defaults['remind3_time_min'] = $reminders[2]['remindtime'] % 60;


####################
#
## PRINT FORM
#
#####################

$_cal_tmpl->row_header_width = 0;

$_cal_tmpl->section_row("", $_cal_form->checkbox('remind1') ." " .
$_cal_form->select("remind1_days", range(0,15)) ." ". _DAYS_ ." ".
$_cal_form->durationselect("remind1_time") ." ". $_cal_form->print_hidden("remind1id", $reminders[0]['id']) .
_BEFORE_EVENT_ . " ". $_cal_form->select("remind1_email", $eml_list));

$_cal_tmpl->section_row("", $_cal_form->checkbox('remind2') ." " .
$_cal_form->select("remind2_days", range(0,15)) ." ". _DAYS_ ." ".
$_cal_form->durationselect("remind2_time") ." ". $_cal_form->print_hidden("remind2id", $reminders[1]['id']) .
_BEFORE_EVENT_ . " ". $_cal_form->select("remind2_email", $eml_list));

#EMF STart
$_cal_tmpl->section_row("", $_cal_form->checkbox('remind3') ." " .
$_cal_form->select("remind3_days", range(0,15)) ." ". _DAYS_ ." ".
$_cal_form->durationselect("remind3_time") ." ". $_cal_form->print_hidden("remind3id", $reminders[2]['id']) .
_BEFORE_EVENT_ . " ". $_cal_form->select("remind3_email", $eml_list));
#EMF Stop

$_cal_tmpl->toolbar("",$_cal_form->submit("event_action",_UPDATE_),"");
Back to top
esoft_ian



Joined: 12 Sep 2005
Posts: 5275

PostPosted: Fri Dec 16, 2005 11:08 pm    Post subject: Reply with quote

It would probably be easier to do something like this:

---------------------------------
Reminders
----------------------------------
(existing reminder list)
-------------------------
User - Remind User
------------------------
userid - 5 minutes before [Update] [ Remove ]
userid - 10 minute sbefore [Update] [Remove]

[Add]
-----------------------

Clicking on add brings up a pop-up where you may search for users, (this is described in a response to your previous post). The pop-up performs the main window's javascript function specified in $_REQUEST['callback'] with the id of the user selected. The javascript function submits a form, check for this in your code and add the user to the reminders. The user is added to the reminder list with a default remind time .. let's say 1 hour or whatever you want.

With multiple users, this would have to be changed:

$reminders = $_cal_sql->query("select * from {$_cal_dbpref}Reminders where uid = ". $_cal_user->id ." and eid = ". $rid ." order by remindtime desc");

to:

$reminders = $_cal_sql->query("select * from {$_cal_dbpref}Reminders where eid = ". $rid ." order by remindtime desc");

That will give you a list of all the reminders for that event. Now each reminder in $reminders will have a 'uid' which you can get user info from, eg:

foreach($reminders as $r) {

$user->id = $r['uid'];
_ex_auth_get_user($user);

# here is where you'd actually print out all your reminders
echo("user's userid is {$user->userid}");
}


Let me know if you have any other questions or if these things aren't clear.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Modules All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
© 2005 eXtrovert software unless otherwise noted. All rights reserved.
Portions © 2004 Ben Brown. All rights reserved.
Trademarks are property of their respective owners.