当前位置: 首页>>代码示例>>PHP>>正文


PHP Notifications::send_stored方法代码示例

本文整理汇总了PHP中Notifications::send_stored方法的典型用法代码示例。如果您正苦于以下问题:PHP Notifications::send_stored方法的具体用法?PHP Notifications::send_stored怎么用?PHP Notifications::send_stored使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Notifications的用法示例。


在下文中一共展示了Notifications::send_stored方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: touch

 //in class.flyspray.conf
 touch(Flyspray::get_tmp_dir() . '/flysprayreminders.run');
 $user = new User(0);
 $now = time();
 ############ Task one: Send reminders ############
 $reminders = $db->x->getAll("SELECT  r.reminder_message AS message, r.*\n                                   FROM  {reminders} r\n                             INNER JOIN  {users}     u ON u.user_id = r.to_user_id\n                             INNER JOIN  {tasks}     t ON r.task_id = t.task_id\n                             INNER JOIN  {projects}  p ON t.project_id = p.project_id\n                                  WHERE  t.is_closed = '0' AND r.start_time < ?\n                                                           AND r.last_sent + r.how_often < ?\n                               ORDER BY  r.reminder_id", null, array(time(), time()));
 foreach ($reminders as $row) {
     if (Notifications::send_now($row['to_user_id'], ADDRESS_USER, NOTIFY_REMINDER, $row)) {
         // Update the database with the time sent
         $db->x->execParam('UPDATE  {reminders}
                     SET  last_sent = ?
                   WHERE  reminder_id = ?', null, array(time(), $row['reminder_id']));
     }
 }
 ############ Task two: send stored notifications ############
 Notifications::send_stored();
 ############ Task three: send project manager digests ############
 $sql = $db->x->getAll('SELECT project_id, project_title, last_digest, project_prefix
                  FROM {projects}
                 WHERE send_digest = 1 AND last_digest < ?', null, time() - 60 * 60 * 24 * 7);
 foreach ($sql as $project) {
     // find out all project managers
     $pms = $db->x->GetCol('SELECT uig.user_id
                       FROM {users_in_groups} uig
                  LEFT JOIN {groups} g ON uig.group_id = g.group_id
                      WHERE g.project_id = ? AND g.manage_project = 1', null, $project['project_id']);
     // Now generate the message, we are interested in opened/reopened, closed and assigned tasks
     $opened = $reopened = $closed = $assigned = array();
     $message = L('digestfor') . ' ' . $project['project_title'] . ":\n\n";
     $evt = $db->x->getAll('SELECT h.event_type, lr.item_name AS resolution_name, t.task_id,
                             t.item_summary, u.user_name, u.real_name, t.prefix_id
开发者ID:negram,项目名称:flyspray,代码行数:31,代码来源:schedule.php


注:本文中的Notifications::send_stored方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。