phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] property/inc/class.boalarm.inc.php, 1.2


From: nomail
Subject: [Phpgroupware-cvs] property/inc/class.boalarm.inc.php, 1.2
Date: Wed, 30 Jun 2004 00:04:51 +0200

Update of /property/inc
Modified Files:
        Branch: 
          class.boalarm.inc.php

date: 2004/06/29 22:04:51;  author: sigurdne;  state: Exp;  lines: +16 -14

Log Message:
no message
=====================================================================
Index: property/inc/class.boalarm.inc.php
diff -u property/inc/class.boalarm.inc.php:1.1 
property/inc/class.boalarm.inc.php:1.2
--- property/inc/class.boalarm.inc.php:1.1      Tue Jun 29 12:49:58 2004
+++ property/inc/class.boalarm.inc.php  Tue Jun 29 22:04:51 2004
@@ -19,6 +19,11 @@
        class boalarm
        {
 
+               var $public_functions = array
+               (
+                       'send_alarm' => True
+               );
+
                function boalarm()
                {
 
@@ -28,7 +33,7 @@
                                $GLOBALS['phpgw']->asyncservice = 
CreateObject('phpgwapi.asyncservice');
                        }
                        $this->async = &$GLOBALS['phpgw']->asyncservice;
-
+                       $this->bocommon                         = 
CreateObject($this->currentapp.'.bocommon');
                }
 
                /*!
@@ -175,10 +180,12 @@
                        }
 
                        $alarm = Array(
-                               'time'    => ($event['start_date'] - $time), 
//($etime=$this->bo->maketime($event['start'])) - $time,
+                               'time'    => ($event['alarm_date'] - $time), 
//($etime=$this->bo->maketime($event['start'])) - $time,
                                'offset'  => $time,
                                'owner'   => $owner,
-                               'enabled' => 1
+                               'enabled' => 1,
+                               'event_id' => $event['id'],
+                               'event_name' => $event['name']
                        );
                        $alarm['id'] = 
$this->save_alarm($alarm_type,$event['id'],$alarm);
 //_debug_array($alarm);
@@ -223,7 +230,7 @@
                function send_alarm($alarm)
                {
 
-                       //echo "<p>bocalendar::send_alarm("; print_r($alarm); 
echo ")</p>\n";
+//                     echo "<p>boalarm::send_alarm("; print_r($alarm); echo 
")</p>\n";
                        $GLOBALS['phpgw_info']['user']['account_id'] = 
$this->owner = $alarm['owner'];
 
                        if (!$alarm['enabled'] || !$alarm['owner'])
@@ -238,7 +245,7 @@
                        $members = array();
 
                        // build subject
-                       $subject = lang('Alarm');
+                       $subject = lang('Alarm').': '.$alarm['event_name'];
 
                        $prefs_user = 
$this->bocommon->create_preferences($this->currentapp,$alarm['owner']);
 
@@ -267,13 +274,9 @@
        //-----------from--------
                // build body
                        $body  = '';
-                       $body .= lang('Alarm').' #'.$alarm['alarm_id']."\n";
-//                     $body .= lang('Date Opened').': '.$timestampopened."\n";
-//                     $body .= lang('Category').': '. 
$this->get_category_name($ticket['cat_id']) ."\n";
-//                     $body .= lang('Subject').': '. $ticket['subject'] ."\n";
-//                     $body .= lang('Location').': '. 
$ticket['location_code'] ."\n";
-//                     $body .= lang('Address').': '. $ticket['address'] ."\n";
-
+                       $body .= lang('Alarm').' #'.$alarm['event_id']."\n";
+                       $body .= lang('Name').': '.$alarm['event_name']."\n";
+                       $body .= lang('Deadline').': '. 
$GLOBALS['phpgw']->common->show_date(($alarm['time']+$alarm['offset'])) ."\n";
                        $body .= lang('Assigned To').': 
'.$GLOBALS['phpgw']->accounts->id2name($alarm['owner'])."\n";
 
                        // add assigned to recipients
@@ -286,7 +289,6 @@
                        {
                                if ($members[$i]['account_id'])
                                {
-                       //              $prefs = 
$GLOBALS['phpgw']->preferences->create_email_preferences($members[$i]['account_id']);
                                        $prefs = 
$this->bocommon->create_preferences($this->currentapp,$members[$i]['account_id']);
                                        if (strlen($prefs['email'])> 
(strlen($members[$i]['account_name'])+1))
                                        {




reply via email to

[Prev in Thread] Current Thread [Next in Thread]