[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] property/inc/class.boalarm.inc.php, 1.5
From: |
nomail |
Subject: |
[Phpgroupware-cvs] property/inc/class.boalarm.inc.php, 1.5 |
Date: |
Tue, 13 Jul 2004 22:55:26 +0200 |
Update of /property/inc
Modified Files:
Branch:
class.boalarm.inc.php
date: 2004/07/13 20:55:26; author: sigurdne; state: Exp; lines: +104 -8
Log Message:
no message
=====================================================================
Index: property/inc/class.boalarm.inc.php
diff -u property/inc/class.boalarm.inc.php:1.4
property/inc/class.boalarm.inc.php:1.5
--- property/inc/class.boalarm.inc.php:1.4 Sun Jul 4 17:24:39 2004
+++ property/inc/class.boalarm.inc.php Tue Jul 13 20:55:26 2004
@@ -34,17 +34,109 @@
$GLOBALS['phpgw']->asyncservice =
CreateObject('phpgwapi.asyncservice');
}
$this->async = &$GLOBALS['phpgw']->asyncservice;
+ $this->so =
CreateObject($this->currentapp.'.soalarm');
$this->bocommon =
CreateObject($this->currentapp.'.bocommon');
+ if ($session)
+ {
+ $this->read_sessiondata();
+ $this->use_session = True;
+ }
+
+ $start = get_var('start',array('POST','GET'));
+ $query = get_var('query',array('POST','GET'));
+ $sort = get_var('sort',array('POST','GET'));
+ $order = get_var('order',array('POST','GET'));
+ $filter = get_var('filter',array('POST','GET'));
+ $cat_id = get_var('cat_id',array('POST','GET'));
+ $method_id =
get_var('method_id',array('POST','GET'));
+ $allrows =
get_var('allrows',array('POST','GET'));
+
+ if ($start)
+ {
+ $this->start=$start;
+ }
+ else
+ {
+ $this->start=0;
+ }
+
+ if(isset($query))
+ {
+ $this->query = $query;
+ }
+ if(!empty($filter))
+ {
+ $this->filter = $filter;
+ }
+ if(isset($sort))
+ {
+ $this->sort = $sort;
+ }
+ if(isset($order))
+ {
+ $this->order = $order;
+ }
+ if(isset($cat_id) && !empty($cat_id))
+ {
+ $this->cat_id = $cat_id;
+ }
+ else
+ {
+ unset($this->cat_id);
+ }
+ if(isset($method_id) && !empty($method_id))
+ {
+ $this->method_id = $method_id;
+ }
+ else
+ {
+ unset($this->method_id);
+ }
+ if(isset($allrows))
+ {
+ $this->allrows = $allrows;
+ }
}
- function read()
+ function save_sessiondata($data)
{
- $jobs = $this->async->read('%');
-/* foreach($jobs as $job)
+ if ($this->use_session)
{
- $list[]=$job;
+
$GLOBALS['phpgw']->session->appsession('session_data','owner',$data);
}
-*/ return $jobs;
+ }
+
+ function read_sessiondata()
+ {
+ $data =
$GLOBALS['phpgw']->session->appsession('session_data','owner');
+
+ $this->start = $data['start'];
+ $this->query = $data['query'];
+ $this->filter = $data['filter'];
+ $this->sort = $data['sort'];
+ $this->order = $data['order'];
+ $this->cat_id = $data['cat_id'];
+ $this->method_id = $data['method_id'];
+ }
+
+
+ function select_method_list($selected='')
+ {
+ $list = $this->so->select_method_list();
+ $list = $this->bocommon->select_list($selected,$list);
+ return $list;
+ }
+
+ function read_single_method($id)
+ {
+ return $this->so->read_single_method($id);
+ }
+
+ function read()
+ {
+ $jobs = $this->so->read(array(id=>'%'));
+ $this->total_records = $this->so->total_records;
+ return $jobs;
}
/*!
@@ -140,8 +232,12 @@
@param $cal_id Id of the calendar-entry
@param $alarm array with fields: text, owner, enabled, ..
*/
- function save_alarm($alarm_type,$entity_id,$alarm)
+ function save_alarm($alarm_type,$entity_id,$alarm,$method='')
{
+ if(!$method)
+ {
+ $method = $this->currentapp
.'.boalarm.send_alarm';
+ }
// echo "<p>save_alarm(entity_id=$entity_id, alarm=";
print_r($alarm); echo ")</p>\n";
if (!($id = $alarm['id']))
{
@@ -160,7 +256,7 @@
}
$alarm[$alarm_type.'_id'] = $entity_id; // we
need the back-reference
- if
(!$this->async->set_timer($alarm['time'],$id,$this->currentapp
.'.boalarm.send_alarm',$alarm))
+ if
(!$this->async->set_timer($alarm['time'],$id,$method,$alarm))
{
return False;
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] property/inc/class.boalarm.inc.php, 1.5,
nomail <=