本文整理汇总了PHP中Reminder类的典型用法代码示例。如果您正苦于以下问题:PHP Reminder类的具体用法?PHP Reminder怎么用?PHP Reminder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Reminder类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: reminder
public function reminder($id_user)
{
$i = 0;
if (Zend_Registry::isRegistered('Zend_Translate')) {
$translator = Zend_Registry::get('Zend_Translate');
}
if (!$id_user || $id_user == null) {
$modelReminder = new Reminder();
$dataReminders = $modelReminder->fetchToSendEmailAll();
} elseif ($id_user) {
$modelReminder = new Reminder();
$dataReminders = $modelReminder->fetchToSendEmail($id_user);
}
foreach ($dataReminders as $dataReminder) {
$modelUser = new User();
$dataUsers = $modelUser->findOne($dataReminder['created_by']);
$userEmail = $dataUser['email'];
$this->view->description = str_replace("ó", "ó", strip_tags($dataReminder['description']));
$body = $this->view->render('/_mail/reminder.phtml');
$client = new Logic_MailerAdapter();
$client->mail($userEmail, $translator->translate('Reminder') . ' - ' . $dataReminder['title'], array('type' => 1, 'content' => $body));
$modelReminder->setAsSent($dataReminder['id']);
$i++;
}
return $i;
}
示例2: OpportunitiesReminder
function OpportunitiesReminder()
{
$GLOBALS['log']->info('----->Scheduler fired job of type sendEmailReminders()');
require_once "custom/modules/Opportunities/Reminder.php";
$reminder = new Reminder();
return $reminder->process();
}
示例3: getReservations
function getReservations($userid, $start, $end)
{
$return = array();
$values = array($userid, $userid);
$query = 'SELECT r.*, rem.reminder_time, rem.reminderid, ru.* FROM ' . $this->get_table(TBL_RESERVATIONS) . ' r' . ' INNER JOIN ' . $this->get_table(TBL_RESERVATION_USERS) . ' ru ON r.resid = ru.resid' . ' LEFT JOIN ' . $this->get_table(TBL_REMINDERS) . ' rem ON r.resid = rem.resid AND rem.memberid = ?' . ' WHERE ru.memberid = ? AND ru.invited = 0';
if ($start != null) {
$values[] = $start->date;
$values[] = $start->date;
$values[] = $start->time;
$query .= ' AND (r.start_date >= ? OR (r.start_date = ? AND r.starttime >= ?))';
}
if ($end != null) {
$values[] = $end->date;
$values[] = $end->date;
$values[] = $end->time;
$query .= ' AND (r.end_date <= ? OR (r.end_date = ? AND r.endtime <= ?))';
}
$result = $this->db->query($query, $values);
$this->check_for_error($result);
while ($rs = $result->fetchRow()) {
$res = new ReservationResult();
$res->id = $rs['resid'];
$res->start_date = $rs['start_date'];
$res->end_date = $rs['end_date'];
$res->start = $rs['starttime'];
$res->end = $rs['endtime'];
$res->resource = new Resource($rs['machid']);
$res->resource->db = null;
$res->created = $rs['created'];
$res->modified = $rs['modified'];
$res->parentid = $rs['parentid'];
$res->summary = $rs['summary'];
$res->scheduleid = $rs['scheduleid'];
$res->is_pending = $rs['is_pending'];
$res->is_participant = $rs['owner'] == 0;
$reminder = new Reminder($rs['reminderid']);
$reminder->set_reminder_time($rs['reminder_time']);
$res->reminderid = $rs['reminderid'];
$res->reminder_minutes_prior = $reminder->getMinutuesPrior($res);
$users = $this->get_res_users($res->id);
for ($i = 0; $i < count($users); $i++) {
if ($users[$i]['owner'] == 1) {
$res->user = new User($users[$i]['memberid']);
$res->user->db = null;
break;
} else {
$res->users[] = $users[$i];
}
}
$res->resources = $this->get_sup_resources($res->id);
$return[] = $res;
}
$result->free();
return $return;
}
示例4: createFrom
public static function createFrom($when)
{
$new_reminder = new Reminder();
if (is_array($when)) {
// Related to start/end
$new_reminder->is_absolute = FALSE;
$new_reminder->parse_trigger($when);
} else {
// Absolute
$new_reminder->is_absolute = TRUE;
$new_reminder->absdatetime = $when;
}
return $new_reminder;
}
示例5: takeChildFromDOM
protected function takeChildFromDOM($child)
{
$absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
switch ($absoluteNodeName) {
case $this->lookupNamespace('gd') . ':' . 'reminder':
$reminder = new Reminder();
$reminder->transferFromDOM($child);
$this->_reminders[] = $reminder;
break;
default:
parent::takeChildFromDOM($child);
break;
}
}
示例6: saveModel
/**
* [saveModel]
* @param boolean $reminder [description]
* @return [type] [description]
*/
protected function saveModel($reminder = false)
{
if (Input::get('id')) {
$reminder = Reminder::find(Input::get('id'));
}
if (!$reminder) {
$reminder = new Reminder();
}
//$load_company_model = $project->company;
$reminder->project_id = Input::get('project_id');
$reminder->user_id = Input::get('user_id');
$reminder->description = Input::get('description');
$reminder->save();
return $reminder;
}
示例7: IsCandidate
public static function IsCandidate(User $user, $candidate)
{
$profile = $user->profile();
if (!$profile) {
return false;
}
// We only test if the user is in her promotion group for it is too
// expensive to check if she is in the corresponding ML as well.
$res = XDB::query('SELECT COUNT(*)
FROM group_members
WHERE uid = {?} AND asso_id = (SELECT id
FROM groups
WHERE diminutif = {?})', $user->id(), $user->profile()->yearPromo());
$mlCount = $res->fetchOneCell();
if ($mlCount) {
Reminder::MarkCandidateAsAccepted($user->id(), $candidate);
}
if ($mlCount == 0) {
$mlist = MailingList::promo($user->profile()->yearPromo());
try {
$mlist->getMembersLimit(0, 0);
} catch (Exception $e) {
return false;
}
}
return false;
}
示例8: add
/**
* Adds an email to the outgoing mail queue.
*
* @param string $recipient The recipient of this email
* @param array $headers The list of headers that should be sent with this email
* @param string $body The body of the message
* @param integer $save_email_copy Whether to send a copy of this email to a configurable address or not (eventum_sent@)
* @param integer $issue_id The ID of the issue. If false, email will not be associated with issue.
* @param string $type The type of message this is.
* @param integer $sender_usr_id The id of the user sending this email.
* @param integer $type_id The ID of the event that triggered this notification (issue_id, sup_id, not_id, etc)
* @return true, or a PEAR_Error object
*/
public static function add($recipient, $headers, $body, $save_email_copy = 0, $issue_id = false, $type = '', $sender_usr_id = false, $type_id = false)
{
Workflow::modifyMailQueue(Auth::getCurrentProject(false), $recipient, $headers, $body, $issue_id, $type, $sender_usr_id, $type_id);
// avoid sending emails out to users with inactive status
$recipient_email = Mail_Helper::getEmailAddress($recipient);
$usr_id = User::getUserIDByEmail($recipient_email);
if (!empty($usr_id)) {
$user_status = User::getStatusByEmail($recipient_email);
// if user is not set to an active status, then silently ignore
if (!User::isActiveStatus($user_status) && !User::isPendingStatus($user_status)) {
return false;
}
}
$to_usr_id = User::getUserIDByEmail($recipient_email);
$recipient = Mail_Helper::fixAddressQuoting($recipient);
$reminder_addresses = Reminder::_getReminderAlertAddresses();
// add specialized headers
if (!empty($issue_id) && (!empty($to_usr_id) && User::getRoleByUser($to_usr_id, Issue::getProjectID($issue_id)) != User::getRoleID('Customer')) || @in_array(Mail_Helper::getEmailAddress($recipient), $reminder_addresses)) {
$headers += Mail_Helper::getSpecializedHeaders($issue_id, $type, $headers, $sender_usr_id);
}
// try to prevent triggering absence auto responders
$headers['precedence'] = 'bulk';
// the 'classic' way, works with e.g. the unix 'vacation' tool
$headers['Auto-submitted'] = 'auto-generated';
// the RFC 3834 way
if (empty($issue_id)) {
$issue_id = 'null';
}
// if the Date: header is missing, add it.
if (empty($headers['Date'])) {
$headers['Date'] = Mime_Helper::encode(date('D, j M Y H:i:s O'));
}
if (!empty($headers['To'])) {
$headers['To'] = Mail_Helper::fixAddressQuoting($headers['To']);
}
// encode headers and add special mime headers
$headers = Mime_Helper::encodeHeaders($headers);
$res = Mail_Helper::prepareHeaders($headers);
if (Misc::isError($res)) {
Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);
return $res;
}
// convert array of headers into text headers
list(, $text_headers) = $res;
$params = array('maq_save_copy' => $save_email_copy, 'maq_queued_date' => Date_Helper::getCurrentDateGMT(), 'maq_sender_ip_address' => !empty($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : '', 'maq_recipient' => $recipient, 'maq_headers' => $text_headers, 'maq_body' => $body, 'maq_iss_id' => $issue_id, 'maq_subject' => $headers['Subject'], 'maq_type' => $type);
if ($sender_usr_id) {
$params['maq_usr_id'] = $sender_usr_id;
}
if ($type_id) {
$params['maq_type_id'] = $type_id;
}
$stmt = 'INSERT INTO {{%mail_queue}} SET ' . DB_Helper::buildSet($params);
try {
DB_Helper::getInstance()->query($stmt, $params);
} catch (DbException $e) {
return $res;
}
return true;
}
示例9: handle
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
$this->line('Cleaning activations and reminders tables from expired lines ...');
\Activation::removeExpired();
$this->info('✔ Activations table cleaned.');
\Reminder::removeExpired();
$this->info('✔ Reminders table cleaned.');
}
示例10: IsCandidate
public static function IsCandidate(User $user, $candidate)
{
$res = XDB::query("SELECT COUNT(*) AS lists\n FROM register_subs\n WHERE uid = {?} AND type = 'list'", $user->id());
$mlCount = $res->fetchOneCell();
if (!$mlCount) {
Reminder::MarkCandidateAsAccepted($user->id(), $candidate);
}
return $mlCount > 0;
}
示例11: IsCandidate
public static function IsCandidate(User $user, $candidate)
{
require_once 'newsletter.inc.php';
$isSubscribed = NewsLetter::forGroup(NewsLetter::GROUP_AX)->subscriptionState();
if ($isSubscribed) {
Reminder::MarkCandidateAsAccepted($user->id(), $candidate);
}
return !$isSubscribed;
}
示例12: GetByRefNumber
/**
* @param string $refnumber
* @return Reminder[]
*/
public function GetByRefNumber($refnumber)
{
$reminders = array();
$reader = ServiceLocator::GetDatabase()->Query(new GetReminderByRefNumberCommand($refnumber));
if ($row = $reader->GetRow()) {
$reminders = Reminder::FromRow($row);
}
$reader->Free();
return $reminders;
}
示例13: IsCandidate
public static function IsCandidate(User $user, $candidate)
{
if (!$user->checkPerms(User::PERM_MAIL)) {
return false;
}
require_once 'emails.inc.php';
$active = Email::is_active_storage($user, 'imap');
if ($active) {
Reminder::MarkCandidateAsAccepted($user->id(), $candidate);
}
return !$active;
}
示例14: IsCandidate
public static function IsCandidate(User $user, $candidate)
{
if (!$user->checkPerms(User::PERM_MAIL)) {
return false;
}
require_once 'googleapps.inc.php';
$isSubscribed = GoogleAppsAccount::account_status($user->id());
if ($isSubscribed == 'disabled') {
$isSubscribed = false;
}
if ($isSubscribed) {
Reminder::MarkCandidateAsAccepted($user->id(), $candidate);
}
return !$isSubscribed;
}
示例15: jsAlerts
function jsAlerts()
{
global $app_strings;
$this->script .= <<<EOQ
\t\tif (!alertsTimeoutId) {
\t\t checkAlerts();
\t\t}
EOQ;
$this->addActivities();
Reminder::addNotifications($this);
if (!empty($GLOBALS['sugar_config']['enable_timeout_alerts'])) {
$this->addAlert($app_strings['ERROR_JS_ALERT_SYSTEM_CLASS'], $app_strings['ERROR_JS_ALERT_TIMEOUT_TITLE'], '', $app_strings['ERROR_JS_ALERT_TIMEOUT_MSG_1'], (session_cache_expire() - 2) * 60);
$this->addAlert($app_strings['ERROR_JS_ALERT_SYSTEM_CLASS'], $app_strings['ERROR_JS_ALERT_TIMEOUT_TITLE'], '', $app_strings['ERROR_JS_ALERT_TIMEOUT_MSG_2'], session_cache_expire() * 60, 'index.php');
}
}