[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] property/inc/custom forward_mail_as_sms.php
From: |
Sigurd Nes |
Subject: |
[Phpgroupware-cvs] property/inc/custom forward_mail_as_sms.php |
Date: |
Mon, 26 Feb 2007 22:20:07 +0000 |
CVSROOT: /sources/phpgroupware
Module name: property
Changes by: Sigurd Nes <sigurdne> 07/02/26 22:20:07
Modified files:
inc/custom : forward_mail_as_sms.php
Log message:
make this work
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/property/inc/custom/forward_mail_as_sms.php?cvsroot=phpgroupware&r1=1.1&r2=1.2
Patches:
Index: forward_mail_as_sms.php
===================================================================
RCS file: /sources/phpgroupware/property/inc/custom/forward_mail_as_sms.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- forward_mail_as_sms.php 26 Feb 2007 13:42:13 -0000 1.1
+++ forward_mail_as_sms.php 26 Feb 2007 22:20:07 -0000 1.2
@@ -8,7 +8,7 @@
* @internal Development of this application was funded by
http://www.bergen.kommune.no/bbb_/ekstern/
* @package property
* @subpackage custom
- * @version $Id: forward_mail_as_sms.php,v 1.1 2007/02/26 13:42:13
sigurdne Exp $
+ * @version $Id: forward_mail_as_sms.php,v 1.2 2007/02/26 22:20:07
sigurdne Exp $
*/
/**
@@ -25,17 +25,11 @@
$this->currentapp =
$GLOBALS['phpgw_info']['flags']['currentapp'];
$this->bocommon =
CreateObject($this->currentapp.'.bocommon');
$this->db =
$this->bocommon->new_db();
- $this->db2 =
$this->bocommon->new_db();
-
- $this->join = $this->bocommon->join;
- $this->left_join = $this->bocommon->left_join;
- $this->like = $this->bocommon->like;
-
}
function pre_run($data='')
{
- if($data['enabled']==1)
+ if(isset($data['enabled']) && $data['enabled']==1)
{
$confirm = True;
$cron = True;
@@ -44,10 +38,11 @@
{
$confirm =
get_var('confirm',array('POST'));
$execute =
get_var('execute',array('GET'));
+ $cron = false;
}
- if ($confirm)
+ if (isset($confirm) && $confirm)
{
$this->execute($cron);
}
@@ -70,14 +65,14 @@
if(!$execute)
{
- $lang_confirm_msg = 'Vil du virkelig
utføre denne operasjonen';
+ $lang_confirm_msg = lang('Do you want to
execute this action?');
}
$lang_yes = lang('yes');
$GLOBALS['phpgw']->xslttpl->add_file(array('confirm_custom'));
- $msgbox_data =
$this->bocommon->msgbox_data($this->receipt);
+ $msgbox_data =
isset($this->receipt)?$this->bocommon->msgbox_data($this->receipt):'';
$data = array
(
@@ -130,16 +125,11 @@
function check_for_new_mail()
{
-
$data =
$GLOBALS['phpgw']->session->appsession('session_data','mail2sms');
-//_debug_array($data);
$GLOBALS['phpgw_info']['user']['account_id'] =
$data['account_id'];
-
$GLOBALS['phpgw']->preferences->account_id =
$data['account_id'];
$pref =
$GLOBALS['phpgw']->preferences->read_repository();
-
$GLOBALS['phpgw_info']['user']['preferences']['felamimail'] =
$pref['felamimail'];
-
-//_debug_array($pref);
+
$GLOBALS['phpgw_info']['user']['preferences']['felamimail'] =
isset($pref['felamimail']) ? $pref['felamimail'] : '';
$bofelamimail =
CreateObject('felamimail.bofelamimail');
$connectionStatus = $bofelamimail->openConnection();
@@ -152,11 +142,12 @@
{
$sms[$j]['message'] =
$header['subject'];
$bodyParts =
$bofelamimail->getMessageBody($header['uid']);
- $sms[$j]['message'] = "\n";
+ $sms[$j]['message'] .= "\n";
for($i=0; $i<count($bodyParts); $i++ )
{
- $sms[$j]['message'] =
$bodyParts[$i]['message'];
+ $sms[$j]['message'] .=
$bodyParts[$i]['body'];
}
+
$sms[$j]['message'] =
substr($sms[$j]['message'],0,160);
$j++;
}
@@ -167,7 +158,6 @@
}
$bosms = CreateObject('sms.bosms',False);
-
if(isset($sms) && is_array($sms))
{
foreach ($sms as $entry)
@@ -179,7 +169,6 @@
$msg = $j . ' messages er sendt';
$this->receipt['message'][]=array('msg'=> $msg);
return $msg;
-
}
}
?>