phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] [20850] update sms


From: Sigurd Nes
Subject: [Phpgroupware-cvs] [20850] update sms
Date: Fri, 20 Nov 2009 10:29:19 +0000

Revision: 20850
          
http://svn.sv.gnu.org/viewvc/?view=rev&root=phpgroupware&revision=20850
Author:   sigurdne
Date:     2009-11-20 10:29:19 +0000 (Fri, 20 Nov 2009)
Log Message:
-----------
update sms

Modified Paths:
--------------
    people/sigurdne/modules/sms/trunk/addressbook.php
    people/sigurdne/modules/sms/trunk/inc/class.boautoreply.inc.php
    people/sigurdne/modules/sms/trunk/inc/class.bocommand.inc.php
    people/sigurdne/modules/sms/trunk/inc/class.bocommon.inc.php
    people/sigurdne/modules/sms/trunk/inc/class.boconfig.inc.php
    people/sigurdne/modules/sms/trunk/inc/class.bopoll.inc.php
    people/sigurdne/modules/sms/trunk/inc/class.bosms.inc.php
    people/sigurdne/modules/sms/trunk/inc/class.menu.inc.php
    people/sigurdne/modules/sms/trunk/inc/class.sms.inc.php
    people/sigurdne/modules/sms/trunk/inc/class.socommand.inc.php
    people/sigurdne/modules/sms/trunk/inc/class.soconfig.inc.php
    people/sigurdne/modules/sms/trunk/inc/class.sopoll.inc.php
    people/sigurdne/modules/sms/trunk/inc/class.uiautoreply.inc.php
    people/sigurdne/modules/sms/trunk/inc/class.uiboard.inc.php
    people/sigurdne/modules/sms/trunk/inc/class.uicommand.inc.php
    people/sigurdne/modules/sms/trunk/inc/class.uiconfig.inc.php
    people/sigurdne/modules/sms/trunk/inc/class.uicustom.inc.php
    people/sigurdne/modules/sms/trunk/inc/class.uipoll.inc.php
    people/sigurdne/modules/sms/trunk/inc/class.uisms.inc.php
    people/sigurdne/modules/sms/trunk/inc/config.php
    people/sigurdne/modules/sms/trunk/inc/hook_admin.inc.php
    people/sigurdne/modules/sms/trunk/inc/hook_settings.inc.php
    people/sigurdne/modules/sms/trunk/index.php
    people/sigurdne/modules/sms/trunk/init.php
    people/sigurdne/modules/sms/trunk/setup/default_records.inc.php
    people/sigurdne/modules/sms/trunk/setup/setup.inc.php
    people/sigurdne/modules/sms/trunk/setup/tables_current.inc.php
    people/sigurdne/modules/sms/trunk/setup/tables_update.inc.php

Added Paths:
-----------
    people/sigurdne/modules/sms/trunk/bin/README
    people/sigurdne/modules/sms/trunk/bin/default/
    people/sigurdne/modules/sms/trunk/bin/default/config_BR
    people/sigurdne/modules/sms/trunk/bin/default/config_BR_log
    people/sigurdne/modules/sms/trunk/bin/default/config_SD
    people/sigurdne/modules/sms/trunk/bin/default/config_SD_log
    people/sigurdne/modules/sms/trunk/bin/default/config_ST
    people/sigurdne/modules/sms/trunk/bin/default/config_STATUS_log
    people/sigurdne/modules/sms/trunk/bin/default/config_ST_log
    people/sigurdne/modules/sms/trunk/bin/default/config_VASK
    people/sigurdne/modules/sms/trunk/bin/default/config_VASK_log
    people/sigurdne/modules/sms/trunk/bin/default/log_firealarm.php
    people/sigurdne/modules/sms/trunk/bin/default/receipt_service_agreement.php
    people/sigurdne/modules/sms/trunk/bin/default/set_workorder_status.php
    people/sigurdne/modules/sms/trunk/inc/plugin/gateway/carrot/
    people/sigurdne/modules/sms/trunk/inc/plugin/gateway/carrot/README
    
people/sigurdne/modules/sms/trunk/inc/plugin/gateway/carrot/SMSGatewayService.php
    people/sigurdne/modules/sms/trunk/inc/plugin/gateway/carrot/fn.php

Modified: people/sigurdne/modules/sms/trunk/addressbook.php
===================================================================
--- people/sigurdne/modules/sms/trunk/addressbook.php   2009-11-20 10:29:14 UTC 
(rev 20849)
+++ people/sigurdne/modules/sms/trunk/addressbook.php   2009-11-20 10:29:19 UTC 
(rev 20850)
@@ -10,10 +10,10 @@
        */
 
        $GLOBALS['phpgw_info']['flags'] = array(
-               'noheader' => True,
-               'nonavbar' => True,
+               'noheader' => true,
+               'nonavbar' => true,
                'currentapp' => 'sms',
-               'enable_nextmatchs_class' => True
+               'enable_nextmatchs_class' => true
        );
 
        /**
@@ -34,7 +34,7 @@
        $c = CreateObject('phpgwapi.categories');
        $GLOBALS['phpgw_info']['flags']['currentapp'] = 'sms';
        
-       $include_personal = True;
+       $include_personal = true;
        
        $charset = $GLOBALS['phpgw']->translation->translate('charset');
        $GLOBALS['phpgw']->template->set_var('charset',$charset);
@@ -143,7 +143,7 @@
        
$GLOBALS['phpgw']->template->set_var('sort_company',$GLOBALS['phpgw']->nextmatchs->show_sort_order($sort,'org_name',$order,'/'.$GLOBALS['phpgw_info']['flags']['currentapp'].'/addressbook.php',lang('Company')));
        $GLOBALS['phpgw']->template->set_var('lang_email',lang('Select work 
email address'));
        $GLOBALS['phpgw']->template->set_var('lang_hemail',lang('Select home 
email address'));
-       
$GLOBALS['phpgw']->template->set_var('cats_list',$c->formated_list('select','all',$cat_id,'True'));
+       
$GLOBALS['phpgw']->template->set_var('cats_list',$c->formated_list('select','all',$cat_id,'true'));
        $GLOBALS['phpgw']->template->set_var('lang_select',lang('Select'));
        
        
//$GLOBALS['phpgw']->template->set_var('cats_action',$GLOBALS['phpgw']->link('/'.$GLOBALS['phpgw_info']['flags']['currentapp'].'/addressbook.php',"sort=$sort&order=$order&filter=$filter&start=$start&query=$query&cat_id=$cat_id"));
@@ -192,7 +192,7 @@
                $tmp_email  = get_comm_value($entries[$i]['contact_id'], 'work 
email', $entries_comm);
                $tmp_hemail = get_comm_value($entries[$i]['contact_id'], 'home 
email', $entries_comm);
                if (($personal_part == '') ||
-                       ($include_personal == False))
+                       ($include_personal == false))
                {
                        $id     = $entries[$i]['contact_id'];
                        $email  = $tmp_email;
@@ -232,12 +232,12 @@
                $GLOBALS['phpgw']->template->set_var('email',$email);
                $GLOBALS['phpgw']->template->set_var('hemail',$hemail);
 
-               
$GLOBALS['phpgw']->template->parse('list','addressbook_list',True);
+               
$GLOBALS['phpgw']->template->parse('list','addressbook_list',true);
        }
        // --------------------------- end record declaration 
---------------------------
 
        $GLOBALS['phpgw']->template->set_var('lang_done',lang('Done'));
-       $GLOBALS['phpgw']->template->parse('out','addressbook_list_t',True);
+       $GLOBALS['phpgw']->template->parse('out','addressbook_list_t',true);
        $GLOBALS['phpgw']->template->p('out');
 
        $GLOBALS['phpgw']->common->phpgw_exit();
@@ -257,4 +257,4 @@
                        }       
                }
        }
-?>
+

Added: people/sigurdne/modules/sms/trunk/bin/README
===================================================================
--- people/sigurdne/modules/sms/trunk/bin/README                                
(rev 0)
+++ people/sigurdne/modules/sms/trunk/bin/README        2009-11-20 10:29:19 UTC 
(rev 20850)
@@ -0,0 +1 @@
+The custom functions are separated by the phpgw_domain - for mulitple domains 
- one has to create one catalog for each domain.

Added: people/sigurdne/modules/sms/trunk/bin/default/config_BR
===================================================================
--- people/sigurdne/modules/sms/trunk/bin/default/config_BR                     
        (rev 0)
+++ people/sigurdne/modules/sms/trunk/bin/default/config_BR     2009-11-20 
10:29:19 UTC (rev 20850)
@@ -0,0 +1,61 @@
+<?php
+       /**
+       * phpGroupWare - sms: A SMS Gateway
+       *
+       * @author Sigurd Nes <address@hidden>
+       * @copyright Copyright (C) 2003-2005 Free Software Foundation, Inc. 
http://www.fsf.org/
+       * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
+       * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
+       * @package sms
+       * @subpackage sms
+       * @version $Id: config_VASK 18297 2007-10-03 13:34:09Z sigurdne $
+       */
+
+       /**
+        * Description
+        * @package sms
+        * Config values for SMS-command "BR" - (Br\xF8yting) "snow clearing" 
in Norwegian - as example - as it is configured at BBB 
+        */
+
+       $agreement = array(48089,48329);
+
+       $limit = array
+                       (
+                               48089 => ' AND id > 0 AND id < 131',
+                               48329 => ' AND id > 0 AND id < 43'
+                       );
+
+       if(isset($param[0]) && $param[0])
+       {
+               $location_code = implode('',$param);
+
+               foreach ($agreement as $agreement_id)
+               {
+                       $sql = "SELECT id from fm_s_agreement_detail WHERE 
agreement_id = $agreement_id AND location_code ilike '" . $location_code . "%'";
+                       $this->db->query($sql,__LINE__,__FILE__);
+                       if($this->db->f('id'))
+                       {
+                               break;
+                       }
+                       else
+                       {
+                               $agreement_id = false;
+                       }
+               }
+       }
+
+       $id_field = 'location_code';
+       $target_field = 'kvittering';
+       $location_id = $GLOBALS['phpgw']->locations->get_id('property', 
'.s_agreement.detail');
+
+       if($agreement_id && isset($param[0]) && $param[0])
+       {
+               $location_code = implode('',$param);
+               $filter = "WHERE agreement_id = $agreement_id AND location_code 
ilike '" . $location_code . "%'" . $limit[$agreement_id];
+       }
+       
+       $this->db->query("SELECT id FROM phpgw_cust_attribute WHERE column_name 
= '$target_field' AND location_id = $location_id",__LINE__,__FILE__);
+       $this->db->next_record();
+       $attrib_id = $this->db->f('id');
+       $receipt= 'Br\xF8yting: ';      
+?>

Added: people/sigurdne/modules/sms/trunk/bin/default/config_BR_log
===================================================================
--- people/sigurdne/modules/sms/trunk/bin/default/config_BR_log                 
        (rev 0)
+++ people/sigurdne/modules/sms/trunk/bin/default/config_BR_log 2009-11-20 
10:29:19 UTC (rev 20850)
@@ -0,0 +1,43 @@
+<?php
+       /**
+       * phpGroupWare - sms: A SMS Gateway
+       *
+       * @author Sigurd Nes <address@hidden>
+       * @copyright Copyright (C) 2003-2005 Free Software Foundation, Inc. 
http://www.fsf.org/
+       * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
+       * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
+       * @package sms
+       * @subpackage sms
+       * @version $Id: config_VASK 18297 2007-10-03 13:34:09Z sigurdne $
+       */
+
+       /**
+        * Description
+        * @package sms
+        * Config values for SMS-command "BR" - (Br\xF8yting) "snow clearing" 
in Norwegian - as example - as it is configured at BBB
+        * This file is for redirecting from log items to the subject of the 
log 
+        */
+
+       $agreement = array(48089,48329);
+
+       foreach ($agreement as $agreement_id)
+       {
+               $sql = "SELECT id from fm_s_agreement_detail WHERE agreement_id 
= $agreement_id AND location_code ilike '" . $param . "%'";
+               $this->db->query($sql,__LINE__,__FILE__);
+               if($this->db->f('id'))
+               {
+                       break;
+               }
+               else
+               {
+                       $agreement_id = 0;
+               }
+       }
+       
+       $link_data = array
+       (
+               'menuaction' => 'property.uis_agreement.view',
+               'id'            => $agreement_id
+       );
+       
+?>

Added: people/sigurdne/modules/sms/trunk/bin/default/config_SD
===================================================================
--- people/sigurdne/modules/sms/trunk/bin/default/config_SD                     
        (rev 0)
+++ people/sigurdne/modules/sms/trunk/bin/default/config_SD     2009-11-20 
10:29:19 UTC (rev 20850)
@@ -0,0 +1,34 @@
+<?php
+       /**
+       * phpGroupWare - sms: A SMS Gateway
+       *
+       * @author Sigurd Nes <address@hidden>
+       * @copyright Copyright (C) 2003-2005 Free Software Foundation, Inc. 
http://www.fsf.org/
+       * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
+       * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
+       * @package sms
+       * @subpackage sms
+       * @version $Id: config_SD 18284 2007-09-25 08:17:17Z sigurdne $
+       */
+
+       /**
+        * Description
+        * @package sms
+        * Config values for SMS-command "SD" - short for "noxious animal in 
Norwegian" - as example - as it is configured at BBB 
+        */
+
+       $agreement_id = 31793;
+       $id_field = 'location_code';
+       $target_field = 'kvittering';
+       $location_id = $GLOBALS['phpgw']->locations->get_id('property', 
'.s_agreement.detail');
+
+       if($agreement_id && isset($param[0]) && $param[0])
+       {
+               $filter = "WHERE agreement_id = $agreement_id AND location_code 
ilike '" . $param[0] . "%'";
+       }
+       
+       $this->db->query("SELECT id FROM phpgw_cust_attribute WHERE column_name 
= '$target_field' AND location_id = $location_id",__LINE__,__FILE__);
+       $this->db->next_record();
+       $attrib_id = $this->db->f('id');
+       
+?>

Added: people/sigurdne/modules/sms/trunk/bin/default/config_SD_log
===================================================================
--- people/sigurdne/modules/sms/trunk/bin/default/config_SD_log                 
        (rev 0)
+++ people/sigurdne/modules/sms/trunk/bin/default/config_SD_log 2009-11-20 
10:29:19 UTC (rev 20850)
@@ -0,0 +1,29 @@
+<?php
+       /**
+       * phpGroupWare - sms: A SMS Gateway
+       *
+       * @author Sigurd Nes <address@hidden>
+       * @copyright Copyright (C) 2003-2005 Free Software Foundation, Inc. 
http://www.fsf.org/
+       * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
+       * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
+       * @package sms
+       * @subpackage sms
+       * @version $Id: config_VASK 18297 2007-10-03 13:34:09Z sigurdne $
+       */
+
+       /**
+        * Description
+        * @package sms
+        * Config values for SMS-command "SD" - short for "noxious animal in 
Norwegian" - as example - as it is configured at BBB 
+        * This file is for redirecting from log items to the subject of the 
log 
+        */
+
+       $agreement_id = '31793';
+
+       $link_data = array
+       (
+               'menuaction' => 'property.uis_agreement.view',
+               'id'            => $agreement_id
+       );
+
+?>

Added: people/sigurdne/modules/sms/trunk/bin/default/config_ST
===================================================================
--- people/sigurdne/modules/sms/trunk/bin/default/config_ST                     
        (rev 0)
+++ people/sigurdne/modules/sms/trunk/bin/default/config_ST     2009-11-20 
10:29:19 UTC (rev 20850)
@@ -0,0 +1,58 @@
+<?php
+       /**
+       * phpGroupWare - sms: A SMS Gateway
+       *
+       * @author Sigurd Nes <address@hidden>
+       * @copyright Copyright (C) 2003-2005 Free Software Foundation, Inc. 
http://www.fsf.org/
+       * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
+       * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
+       * @package sms
+       * @subpackage sms
+       * @version $Id: config_VASK 18297 2007-10-03 13:34:09Z sigurdne $
+       */
+
+       /**
+        * Description
+        * @package sms
+        * Config values for SMS-command "ST" - (Str\xF8ing) "sanding the ice" 
in Norwegian - as example - as it is configured at BBB 
+        */
+
+       $agreement = array(48089,48329);
+
+       $limit = array
+                       (
+                               48089 => ' AND id > 0 AND id < 131',
+                               48329 => ' AND id > 0 AND id < 43'
+                       );
+
+       if(isset($param[0]) && $param[0])
+       {
+               $location_code = implode('',$param);
+
+               foreach ($agreement as $candidate)
+               {
+                       $sql = "SELECT count(id) as found from 
fm_s_agreement_detail WHERE agreement_id = $candidate AND location_code ilike 
'" . $location_code . "%'";
+                       $this->db->query($sql,__LINE__,__FILE__);
+                       $this->db->next_record();
+                       if($this->db->f('found'))
+                       {
+                               $agreement_id = $candidate;
+                               break;
+                       }
+               }
+       }
+
+       $id_field = 'location_code';
+       $target_field = 'kvittering';
+       $location_id = $GLOBALS['phpgw']->locations->get_id('property', 
'.s_agreement.detail');
+
+       if($agreement_id && isset($param[0]) && $param[0])
+       {
+               $location_code = implode('',$param);
+               $filter = "WHERE agreement_id = $agreement_id AND location_code 
ilike '" . $location_code . "%'" . $limit[$agreement_id];
+       }
+
+       $this->db->query("SELECT id FROM phpgw_cust_attribute WHERE column_name 
= '$target_field' AND location_id = $location_id",__LINE__,__FILE__);
+       $this->db->next_record();
+       $attrib_id = $this->db->f('id');
+       $receipt=  utf8_encode('Str\xF8ing: ');

Added: people/sigurdne/modules/sms/trunk/bin/default/config_STATUS_log
===================================================================
--- people/sigurdne/modules/sms/trunk/bin/default/config_STATUS_log             
                (rev 0)
+++ people/sigurdne/modules/sms/trunk/bin/default/config_STATUS_log     
2009-11-20 10:29:19 UTC (rev 20850)
@@ -0,0 +1,29 @@
+<?php
+       /**
+       * phpGroupWare - sms: A SMS Gateway
+       *
+       * @author Sigurd Nes <address@hidden>
+       * @copyright Copyright (C) 2003-2005 Free Software Foundation, Inc. 
http://www.fsf.org/
+       * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
+       * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
+       * @package sms
+       * @subpackage sms
+       * @version $Id: config_VASK 18297 2007-10-03 13:34:09Z sigurdne $
+       */
+
+       /**
+        * Description
+        * @package sms
+        * Config values for SMS-command "STATUS" - (setting status of 
workorders) as example - as it is configured at BBB
+        * This file is for redirecting from log items to the subject of the 
log 
+        */
+
+       $param          = explode(' ' , $param);        
+
+       $link_data = array
+       (
+               'menuaction' => 'property.uiworkorder.view',
+               'id'            => $param[0]
+       );
+
+?>

Added: people/sigurdne/modules/sms/trunk/bin/default/config_ST_log
===================================================================
--- people/sigurdne/modules/sms/trunk/bin/default/config_ST_log                 
        (rev 0)
+++ people/sigurdne/modules/sms/trunk/bin/default/config_ST_log 2009-11-20 
10:29:19 UTC (rev 20850)
@@ -0,0 +1,42 @@
+<?php
+       /**
+       * phpGroupWare - sms: A SMS Gateway
+       *
+       * @author Sigurd Nes <address@hidden>
+       * @copyright Copyright (C) 2003-2005 Free Software Foundation, Inc. 
http://www.fsf.org/
+       * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
+       * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
+       * @package sms
+       * @subpackage sms
+       * @version $Id: config_VASK 18297 2007-10-03 13:34:09Z sigurdne $
+       */
+
+       /**
+        * Description
+        * @package sms
+        * Config values for SMS-command "ST" - (Str\xF8ing) "sanding the ice" 
in Norwegian - as example - as it is configured at BBB 
+        * This file is for redirecting from log items to the subject of the 
log 
+        */
+
+       $agreement = array(48089,48329);
+
+       foreach ($agreement as $agreement_id)
+       {
+               $sql = "SELECT id from fm_s_agreement_detail WHERE agreement_id 
= $agreement_id AND location_code ilike '" . $param . "%'";
+               $this->db->query($sql,__LINE__,__FILE__);
+               $this->db->next_record();
+               if($this->db->f('id'))
+               {
+                       break;
+               }
+               else
+               {
+                       $agreement_id = 0;
+               }
+       }
+       
+       $link_data = array
+       (
+               'menuaction' => 'property.uis_agreement.view',
+               'id'            => $agreement_id
+       );

Added: people/sigurdne/modules/sms/trunk/bin/default/config_VASK
===================================================================
--- people/sigurdne/modules/sms/trunk/bin/default/config_VASK                   
        (rev 0)
+++ people/sigurdne/modules/sms/trunk/bin/default/config_VASK   2009-11-20 
10:29:19 UTC (rev 20850)
@@ -0,0 +1,33 @@
+<?php
+       /**
+       * phpGroupWare - sms: A SMS Gateway
+       *
+       * @author Sigurd Nes <address@hidden>
+       * @copyright Copyright (C) 2003-2005 Free Software Foundation, Inc. 
http://www.fsf.org/
+       * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
+       * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
+       * @package sms
+       * @subpackage sms
+       * @version $Id: config_VASK 18297 2007-10-03 13:34:09Z sigurdne $
+       */
+
+       /**
+        * Description
+        * @package sms
+        * Config values for SMS-command "VASK" - cleaning in Norwegian - as 
example - as it is configured at BBB 
+        */
+
+       $agreement_id = '22331';
+       $id_field = 'location_code';
+       $target_field = 'kvittering';
+       $location_id = $GLOBALS['phpgw']->locations->get_id('property', 
'.s_agreement.detail');
+
+       if($agreement_id && isset($param[0]) && $param[0])
+       {
+               $location_code = implode('',$param);
+               $filter = "WHERE agreement_id = $agreement_id AND location_code 
ilike '" . $location_code . "%'";
+       }
+       
+       $this->db->query("SELECT id FROM phpgw_cust_attribute WHERE column_name 
= '$target_field' AND location_id = $location_id",__LINE__,__FILE__);
+       $this->db->next_record();
+       $attrib_id = $this->db->f('id');

Added: people/sigurdne/modules/sms/trunk/bin/default/config_VASK_log
===================================================================
--- people/sigurdne/modules/sms/trunk/bin/default/config_VASK_log               
                (rev 0)
+++ people/sigurdne/modules/sms/trunk/bin/default/config_VASK_log       
2009-11-20 10:29:19 UTC (rev 20850)
@@ -0,0 +1,29 @@
+<?php
+       /**
+       * phpGroupWare - sms: A SMS Gateway
+       *
+       * @author Sigurd Nes <address@hidden>
+       * @copyright Copyright (C) 2003-2005 Free Software Foundation, Inc. 
http://www.fsf.org/
+       * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
+       * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
+       * @package sms
+       * @subpackage sms
+       * @version $Id: config_VASK 18297 2007-10-03 13:34:09Z sigurdne $
+       */
+
+       /**
+        * Description
+        * @package sms
+        * Config values for SMS-command "VASK" - cleaning in Norwegian - as 
example - as it is configured at BBB
+        * This file is for redirecting from log items to the subject of the 
log 
+        */
+
+       $agreement_id = '22331';
+
+       $link_data = array
+       (
+               'menuaction' => 'property.uis_agreement.view',
+               'id'            => $agreement_id
+       );
+
+?>

Added: people/sigurdne/modules/sms/trunk/bin/default/log_firealarm.php
===================================================================
--- people/sigurdne/modules/sms/trunk/bin/default/log_firealarm.php             
                (rev 0)
+++ people/sigurdne/modules/sms/trunk/bin/default/log_firealarm.php     
2009-11-20 10:29:19 UTC (rev 20850)
@@ -0,0 +1,54 @@
+<?php
+       /**
+       * phpGroupWare - sms: A SMS Gateway
+       *
+       * @author Sigurd Nes <address@hidden>
+       * @copyright Copyright (C) 2003-2005 Free Software Foundation, Inc. 
http://www.fsf.org/
+       * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
+       * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
+       * @package sms
+       * @subpackage sms
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package sms
+        */
+
+       $entity_id  = 1;
+       $cat_id = 2;
+       $id_field ='securitnet_nr';
+       $dateformat= "Y-m-d"; //postgres
+       $target_field = 'last_alarm';
+
+       $entity_table = 'fm_entity_' . $entity_id .'_' . $cat_id;
+
+       $location_id = $GLOBALS['phpgw']->locations->get_id('property', 
".entity.{$entity_id}.{$cat_id}");
+
+       $this->db->query("SELECT id FROM phpgw_cust_attribute WHERE column_name 
= '$target_field' AND location_id = $location_id",__LINE__,__FILE__);
+
+       $this->db->next_record();
+       $attrib_id = $this->db->f('id');
+
+       $param  = explode(' ' , $command_param);
+
+       if (ctype_digit($param[0]))
+       {
+               $id     = $param[0];
+       //      $status = $status_code[$param[1]];
+
+               $this->db->query("SELECT id as record_id  FROM $entity_table 
WHERE $id_field='$id'",__LINE__,__FILE__);
+               if($this->db->next_record())
+               {
+                       $record_id = $this->db->f('record_id');
+                       $date = date($dateformat,time());
+
+                       $this->db->query("UPDATE $entity_table set last_alarm 
='$date' WHERE $id_field='$id'" ,__LINE__,__FILE__);
+                       $historylog     = 
CreateObject('property.historylog','entity_' . $entity_id .'_' . $cat_id);
+       // temporary - fix this
+                       $historylog->account = 6;
+                       $historylog->add('SO',$record_id,$date,False, 
$attrib_id);
+                       $command_output = 'success';
+               }
+       }


Property changes on: 
people/sigurdne/modules/sms/trunk/bin/default/log_firealarm.php
___________________________________________________________________
Added: svn:keywords
   + Id Revision
Added: svn:eol-style
   + native

Added: 
people/sigurdne/modules/sms/trunk/bin/default/receipt_service_agreement.php
===================================================================
--- people/sigurdne/modules/sms/trunk/bin/default/receipt_service_agreement.php 
                        (rev 0)
+++ people/sigurdne/modules/sms/trunk/bin/default/receipt_service_agreement.php 
2009-11-20 10:29:19 UTC (rev 20850)
@@ -0,0 +1,43 @@
+<?php
+       /**
+       * phpGroupWare - sms: A SMS Gateway
+       *
+       * @author Sigurd Nes <address@hidden>
+       * @copyright Copyright (C) 2003-2005 Free Software Foundation, Inc. 
http://www.fsf.org/
+       * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
+       * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
+       * @package sms
+       * @subpackage sms
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package sms
+        */
+
+       $param          = explode(' ' , $command_param);
+       $receipt ='';
+
+       include(PHPGW_SERVER_ROOT . 
"/sms/bin/{$GLOBALS['phpgw_info']['user']['domain']}/config_" . 
strtoupper(basename($command_code)));
+       if(isset($filter) && $filter)
+       {
+               $sql = "SELECT id from fm_s_agreement_detail $filter";
+               $this->db->query($sql,__LINE__,__FILE__);
+
+               if($this->db->next_record() && $agreement_id && $attrib_id)
+               {
+                       $id = $this->db->f('id');
+                       $value = $receipt . $sms_datetime . ' (' . $sms_sender 
. ')';
+
+                       $this->db->query("UPDATE fm_s_agreement_detail set 
$target_field = '$value' WHERE agreement_id = $agreement_id AND  id=$id" 
,__LINE__,__FILE__);
+                       $historylog     = 
CreateObject('property.historylog','s_agreement');
+                       $historylog->account = 6;
+                       $historylog->add('SO',$agreement_id ,$receipt . 
$sms_sender,False, $attrib_id,strtotime($sms_datetime),$id);
+                       $command_output = 'success';
+                       $this->account = 6;
+                       $this->websend2pv('Admin',$sms_sender,'Takk for det! - 
Melding er mottatt','text','0');
+               }
+       }
+
+


Property changes on: 
people/sigurdne/modules/sms/trunk/bin/default/receipt_service_agreement.php
___________________________________________________________________
Added: svn:keywords
   + Id Revision
Added: svn:eol-style
   + native

Added: people/sigurdne/modules/sms/trunk/bin/default/set_workorder_status.php
===================================================================
--- people/sigurdne/modules/sms/trunk/bin/default/set_workorder_status.php      
                        (rev 0)
+++ people/sigurdne/modules/sms/trunk/bin/default/set_workorder_status.php      
2009-11-20 10:29:19 UTC (rev 20850)
@@ -0,0 +1,42 @@
+<?php
+       /**
+       * phpGroupWare - sms: A SMS Gateway
+       *
+       * @author Sigurd Nes <address@hidden>
+       * @copyright Copyright (C) 2003-2005 Free Software Foundation, Inc. 
http://www.fsf.org/
+       * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
+       * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
+       * @package sms
+       * @subpackage sms
+       * @version $Id$
+       */
+
+       /**
+        * Description
+        * @package sms
+        */
+
+       $status_code = array(
+               1 => 'closed',
+               2 => 'ikke_tilgang',
+               3 => 'i_arbeid',
+       );
+
+       $param          = explode(' ' , $command_param);
+
+       if (ctype_digit($param[0]) && ctype_digit($param[1]))
+       {
+               $workorder_id   = $param[0];
+               $status         = $status_code[$param[1]];
+
+               $this->db->query("SELECT status FROM fm_workorder where 
id='$workorder_id'",__LINE__,__FILE__);
+               if($this->db->next_record())
+               {
+                       $this->db->query("UPDATE fm_workorder set status = 
'$status' WHERE id='$workorder_id'" ,__LINE__,__FILE__);
+                       $historylog     = 
CreateObject('property.historylog','workorder');
+       // temporary - fix this
+                       $historylog->account = 6;
+                       $historylog->add('S',$workorder_id,$status . ': endret 
av: ' . $sms_sender);
+                       $command_output = 'success';
+               }
+       }


Property changes on: 
people/sigurdne/modules/sms/trunk/bin/default/set_workorder_status.php
___________________________________________________________________
Added: svn:keywords
   + Id Revision
Added: svn:eol-style
   + native

Modified: people/sigurdne/modules/sms/trunk/inc/class.boautoreply.inc.php
===================================================================
--- people/sigurdne/modules/sms/trunk/inc/class.boautoreply.inc.php     
2009-11-20 10:29:14 UTC (rev 20849)
+++ people/sigurdne/modules/sms/trunk/inc/class.boautoreply.inc.php     
2009-11-20 10:29:19 UTC (rev 20850)
@@ -27,15 +27,15 @@
 
                var $public_functions = array
                (
-                       'read'                  => True,
-                       'read_single'           => True,
-                       'save'                  => True,
-                       'delete'                => True,
-                       'check_perms'           => True
+                       'read'                  => true,
+                       'read_single'           => true,
+                       'save'                  => true,
+                       'delete'                => true,
+                       'check_perms'           => true
                );
 
 
-               function sms_boautoreply($session=False)
+               function sms_boautoreply($session=false)
                {
                //      $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->so               = 
CreateObject('sms.soautoreply');
@@ -44,7 +44,7 @@
                        if ($session)
                        {
                                $this->read_sessiondata();
-                               $this->use_session = True;
+                               $this->use_session = true;
                        }
 
                        $start  = phpgw::get_var('start', 'int', 'REQUEST', 0);

Modified: people/sigurdne/modules/sms/trunk/inc/class.bocommand.inc.php
===================================================================
--- people/sigurdne/modules/sms/trunk/inc/class.bocommand.inc.php       
2009-11-20 10:29:14 UTC (rev 20849)
+++ people/sigurdne/modules/sms/trunk/inc/class.bocommand.inc.php       
2009-11-20 10:29:19 UTC (rev 20850)
@@ -27,14 +27,14 @@
 
                var $public_functions = array
                (
-                       'read'                  => True,
-                       'read_single'           => True,
-                       'save'                  => True,
-                       'delete'                => True,
-                       'check_perms'           => True
+                       'read'                  => true,
+                       'read_single'           => true,
+                       'save'                  => true,
+                       'delete'                => true,
+                       'check_perms'           => true
                );
 
-               function sms_bocommand($session=False)
+               function sms_bocommand($session=false)
                {
                //      $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->so               = CreateObject('sms.socommand');
@@ -43,7 +43,7 @@
                        if ($session)
                        {
                                $this->read_sessiondata();
-                               $this->use_session = True;
+                               $this->use_session = true;
                        }
 
                        $start  = phpgw::get_var('start', 'int', 'REQUEST', 0);

Modified: people/sigurdne/modules/sms/trunk/inc/class.bocommon.inc.php
===================================================================
--- people/sigurdne/modules/sms/trunk/inc/class.bocommon.inc.php        
2009-11-20 10:29:14 UTC (rev 20849)
+++ people/sigurdne/modules/sms/trunk/inc/class.bocommon.inc.php        
2009-11-20 10:29:19 UTC (rev 20850)
@@ -29,8 +29,8 @@
 
                var $public_functions = array
                (
-                       'select_part_of_town'   => True,
-                       'menu'  => True,
+                       'select_part_of_town'   => true,
+                       'menu'  => true,
                );
 
                var $soap_functions = array(
@@ -102,7 +102,7 @@
                        {
                                foreach($receipt['error'] as $errors)
                                {
-                                       $msgbox_data_error += 
array($errors['msg']=> False);
+                                       $msgbox_data_error += 
array($errors['msg']=> false);
                                }
                        }
 
@@ -112,7 +112,7 @@
                        {
                                foreach($receipt['message'] as $messages)
                                {
-                                       $msgbox_data_message += 
array($messages['msg']=> True);
+                                       $msgbox_data_message += 
array($messages['msg']=> true);
                                }
                        }
 
@@ -249,7 +249,7 @@
                        {
                                foreach($extra as $extra_user)
                                {
-                                       $users_extra[]=array
+                                       $all_users[]=array
                                        (
                                                'account_id' => $extra_user,
                                                'account_firstname' => 
lang($extra_user)
@@ -257,42 +257,46 @@
                                }
                        }
 
-                       $accounts       = CreateObject('phpgwapi.accounts');
+                       $accounts = & $GLOBALS['phpgw']->accounts;
                        $users = $accounts->get_list('accounts', $start, $sort, 
$order, $query,$offset);
                        unset($accounts);
-                       if (is_array($users_extra) && is_array($users))
+                       if (isset($all_users) && is_array($all_users) && 
is_array($users))
                        {
-                               $users = $users_extra + $users;
+                               foreach($users as $user)
+                               {
+                                       $all_users[] = array
+                                       (
+                                               'user_id'       => $user->id,
+                                               'name'          => 
$user->__toString(),
+                                       );
+                               }
                        }
 
-                       if (isSet($users) AND is_array($users))
+                       if (count($all_users)>0)
                        {
-                               foreach($users as $user)
+                               foreach($all_users as $user)
                                {
                                        $sel_user = '';
-                                       if ($user['account_id']==$selected)
+                                       if ($user['user_id'] == $selected)
                                        {
-                                               $sel_user = 'selected';
-                                       }
-
                                        $user_list[] = array
                                        (
-                                               'user_id'       => 
$user['account_id'],
-                                               'name'          => 
$user['account_lastname'].' '.$user['account_firstname'],
-                                               'selected'      => $sel_user
+                                                       'user_id'       => 
$user['user_id'],
+                                                       'name'          => 
$user['name'],
+                                                       'selected'      => 
'selected'
                                        );
                                }
-                       }
-
-                       $user_count= count($user_list);
-                       for ($i=0;$i<$user_count;$i++)
-                       {
-                               if ($user_list[$i]['selected'] != 'selected')
+                                       else
                                {
-                                       unset($user_list[$i]['selected']);
+                                               $user_list[] = array
+                                               (
+                                                       'user_id'       => 
$user['user_id'],
+                                                       'name'          => 
$user['name'],
+                                               );
+                                       
+                                       }
                                }
                        }
-
 //_debug_array($user_list);
                        return $user_list;
                }
@@ -309,23 +313,24 @@
                                        break;
                        }
 
-                       $accounts       = CreateObject('phpgwapi.accounts');
+                       $accounts       = & $GLOBALS['phpgw']->accounts;
+
                        $users = $accounts->get_list('groups', $start, $sort, 
$order, $query,$offset);
                        unset($accounts);
-                       if (isSet($users) AND is_array($users))
+                       if (isset($users) AND is_array($users))
                        {
                                foreach($users as $user)
                                {
                                        $sel_user = '';
-                                       if ($user['account_id']==$selected)
+                                       if ($user->id == $selected)
                                        {
                                                $sel_user = 'selected';
                                        }
 
                                        $user_list[] = array
                                        (
-                                               'id'    => $user['account_id'],
-                                               'name'          => 
$user['account_firstname'],
+                                               'id'    => $user->id,
+                                               'name'          => 
$user->firstname,
                                                'selected'      => $sel_user
                                        );
                                }

Modified: people/sigurdne/modules/sms/trunk/inc/class.boconfig.inc.php
===================================================================
--- people/sigurdne/modules/sms/trunk/inc/class.boconfig.inc.php        
2009-11-20 10:29:14 UTC (rev 20849)
+++ people/sigurdne/modules/sms/trunk/inc/class.boconfig.inc.php        
2009-11-20 10:29:19 UTC (rev 20850)
@@ -27,11 +27,11 @@
 
                var $public_functions = array
                (
-                       'read'                  => True,
-                       'read_single'           => True,
-                       'save'                  => True,
-                       'delete'                => True,
-                       'check_perms'           => True
+                       'read'                  => true,
+                       'read_single'           => true,
+                       'save'                  => true,
+                       'delete'                => true,
+                       'check_perms'           => true
                );
 
                var $soap_functions = array(
@@ -53,7 +53,7 @@
                        )
                );
 
-               function sms_boconfig($session=False)
+               function sms_boconfig($session=false)
                {
                //      $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->so               = CreateObject('sms.soconfig');
@@ -62,7 +62,7 @@
                        if ($session)
                        {
                                $this->read_sessiondata();
-                               $this->use_session = True;
+                               $this->use_session = true;
                        }
 
                        $start  = phpgw::get_var('start', 'int', 'REQUEST', 0);
@@ -273,6 +273,8 @@
                        $input_type[0]['name'] = 'text';
                        $input_type[1]['id'] = 'listbox';
                        $input_type[1]['name'] = 'listbox';
+                       $input_type[2]['id'] = 'password';
+                       $input_type[2]['name'] = 'Password';
                        
                        return 
$this->bocommon->select_list($selected,$input_type);
 

Modified: people/sigurdne/modules/sms/trunk/inc/class.bopoll.inc.php
===================================================================
--- people/sigurdne/modules/sms/trunk/inc/class.bopoll.inc.php  2009-11-20 
10:29:14 UTC (rev 20849)
+++ people/sigurdne/modules/sms/trunk/inc/class.bopoll.inc.php  2009-11-20 
10:29:19 UTC (rev 20850)
@@ -27,14 +27,14 @@
 
                var $public_functions = array
                (
-                       'read'                  => True,
-                       'read_single'           => True,
-                       'save'                  => True,
-                       'delete'                => True,
-                       'check_perms'           => True
+                       'read'                  => true,
+                       'read_single'           => true,
+                       'save'                  => true,
+                       'delete'                => true,
+                       'check_perms'           => true
                );
 
-               function sms_bopoll($session=False)
+               function sms_bopoll($session=false)
                {
                //      $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->so               = CreateObject('sms.sopoll');
@@ -43,7 +43,7 @@
                        if ($session)
                        {
                                $this->read_sessiondata();
-                               $this->use_session = True;
+                               $this->use_session = true;
                        }
 
                        $start  = phpgw::get_var('start', 'int', 'REQUEST', 0);

Modified: people/sigurdne/modules/sms/trunk/inc/class.bosms.inc.php
===================================================================
--- people/sigurdne/modules/sms/trunk/inc/class.bosms.inc.php   2009-11-20 
10:29:14 UTC (rev 20849)
+++ people/sigurdne/modules/sms/trunk/inc/class.bosms.inc.php   2009-11-20 
10:29:19 UTC (rev 20850)
@@ -28,15 +28,15 @@
 
                var $public_functions = array
                (
-                       'read'                  => True,
-                       'read_single'           => True,
-                       'save'                  => True,
-                       'delete'                => True,
-                       'check_perms'           => True
+                       'read'                  => true,
+                       'read_single'           => true,
+                       'save'                  => true,
+                       'delete'                => true,
+                       'check_perms'           => true
                );
 
 
-               function bosms($session=False)
+               function bosms($session=false)
                {
                //      $this->currentapp       = 
'sms';//$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->sms              = CreateObject('sms.sms');
@@ -48,7 +48,7 @@
                        if ($session)
                        {
                                $this->read_sessiondata();
-                               $this->use_session = True;
+                               $this->use_session = true;
                        }
 
                        $start  = phpgw::get_var('start', 'int', 'REQUEST', 0);

Modified: people/sigurdne/modules/sms/trunk/inc/class.menu.inc.php
===================================================================
--- people/sigurdne/modules/sms/trunk/inc/class.menu.inc.php    2009-11-20 
10:29:14 UTC (rev 20849)
+++ people/sigurdne/modules/sms/trunk/inc/class.menu.inc.php    2009-11-20 
10:29:19 UTC (rev 20850)
@@ -22,7 +22,7 @@
 
                var $public_functions = array
                (
-                       'links' => True,
+                       'links' => true,
                );
 
                function sms_menu($sub='')
@@ -80,6 +80,11 @@
                                        (
                                                'text'  => lang('Daemon manual 
refresh'),
                                                'url'   => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'sms.uiconfig.daemon_manual'))
+                                       ),
+                                       'acl'   => array
+                                       (
+                                               'text'  => 
$GLOBALS['phpgw']->translation->translate('Configure Access Permissions', 
array(), true),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'preferences.uiadmin_acl.list_acl', 'acl_app' => 'sms'))
                                        )
                                );
                        }

Modified: people/sigurdne/modules/sms/trunk/inc/class.sms.inc.php
===================================================================
--- people/sigurdne/modules/sms/trunk/inc/class.sms.inc.php     2009-11-20 
10:29:14 UTC (rev 20849)
+++ people/sigurdne/modules/sms/trunk/inc/class.sms.inc.php     2009-11-20 
10:29:19 UTC (rev 20850)
@@ -19,13 +19,13 @@
 
 //     _debug_array ($GLOBALS['phpgw_info']['sms_config']);
 
-       $apps_path['base']      = PHPGW_SERVER_ROOT . '/' . 'sms';
-       $apps_path['libs']      = $apps_path['base'] . '/' . 'lib';
-       $apps_path['plug']      = $apps_path['base'] . '/' . 'inc' . '/' . 
'plugin';
-       $apps_path['inc']       = $apps_path['base'] . '/' . 'inc';
+       $apps_path['base']      = PHPGW_SERVER_ROOT . '/sms';
+       $apps_path['libs']      = $apps_path['base'] . '/lib';
+       $apps_path['plug']      = $apps_path['base'] . '/inc/plugin';
+       $apps_path['inc']       = $apps_path['base'] . '/inc';
        
        // SMS command security parameter
-       $feat_command_path['bin']       = $apps_path['base']."/bin";
+       $feat_command_path['bin']       = 
"{$apps_path['base']}/bin/{$GLOBALS['phpgw_info']['user']['domain']}";
        $GLOBALS['phpgw_info']['sms_config']['common']['apps_path'] = 
$apps_path;
        $GLOBALS['phpgw_info']['sms_config']['common']['feat_command_path'] = 
$feat_command_path;
 
@@ -33,12 +33,12 @@
        {
                $path_to_sms = dirname(__FILE__);
 
-               include_once($path_to_sms . '/' . 'config.php');
+               include_once($path_to_sms . '/config.php');
        }
 
-       if (file_exists($apps_path['inc'] . '/' . 'plugin' . '/' . 'gateway' . 
'/' . $GLOBALS['phpgw_info']['sms_config']['common']['gateway_module']. 
"/fn.php"))
+       if 
(file_exists("{$apps_path['inc']}/plugin/gateway/{$GLOBALS['phpgw_info']['sms_config']['common']['gateway_module']}/fn.php"))
        {
-               include_once($apps_path['inc'] . '/' . 'plugin' . '/' . 
'gateway' . '/'. 
$GLOBALS['phpgw_info']['sms_config']['common']['gateway_module']. "/fn.php");
+               
include_once("{$apps_path['inc']}/plugin/gateway/{$GLOBALS['phpgw_info']['sms_config']['common']['gateway_module']}/fn.php");
        }
        else
        {
@@ -129,7 +129,7 @@
                {
                        
                //      $GLOBALS['phpgw']->preferences->account_id = 
$this->account;
-               //      $GLOBALS['phpgw']->preferences->read_repository();
+               //      $GLOBALS['phpgw']->preferences->read();
                        $mobile = 
$GLOBALS['phpgw_info']['user']['preferences']['sms']['cellphone'];
                        return $mobile;
                }
@@ -201,13 +201,13 @@
                                $c_sms_to = 
str_replace("\"","",$array_sms_to[$i]);
                                $message = $this->db->db_addslashes($message);
                        
-                               $db_query = "INSERT INTO 
phpgw_sms_tblSMSOutgoing 
+                               $db_query = "INSERT INTO 
phpgw_sms_tblsmsoutgoing
                                        
(uid,p_gateway,p_src,p_dst,p_footer,p_msg,p_datetime,p_sms_type,unicode) 
                                        VALUES 
('$uid','$gateway_module','$mobile_sender','$c_sms_to','$sms_sender','$message','$datetime_now','$sms_type','$unicode')";
                
                                $GLOBALS['phpgw']->db->transaction_begin();
                                
$GLOBALS['phpgw']->db->query($db_query,__LINE__,__FILE__);
-                               $smslog_id = 
$GLOBALS['phpgw']->db->get_last_insert_id('phpgw_sms_tblSMSOutgoing','smslog_id');
+                               $smslog_id = 
$GLOBALS['phpgw']->db->get_last_insert_id('phpgw_sms_tblsmsoutgoing','smslog_id');
                                $GLOBALS['phpgw']->db->transaction_commit();
                
                                $gp_code = "PV";
@@ -270,7 +270,7 @@
                                        $sms_to = str_replace("\"","",$sms_to);
                                        $the_msg = "$sms_to\n$sms_msg";
                                        $db_query1 = "
-                                       INSERT INTO phpgw_sms_tblSMSOutgoing 
+                                       INSERT INTO phpgw_sms_tblsmsoutgoing
                                        
(uid,p_gateway,p_src,p_dst,p_footer,p_msg,p_datetime,p_gpid,p_sms_type) 
                                        VALUES 
('$uid','$gateway_module','$mobile_sender','$sms_to','$sms_sender','$message','$datetime_now','$gpid','$sms_type')
                                        ";
@@ -335,7 +335,7 @@
                                                        $sms_to = 
str_replace("\"","",$sms_to);
                                                        $send_code = 
md5(mktime().$sms_to);
                                                        $db_query1 = "
-                                                       INSERT INTO 
phpgw_sms_tblSMSOutgoing (uid,p_src,p_dst,p_footer,p_msg,p_datetime,p_gpid) 
+                                                       INSERT INTO 
phpgw_sms_tblsmsoutgoing (uid,p_src,p_dst,p_footer,p_msg,p_datetime,p_gpid)
                                                        VALUES 
('$uid','$mobile_sender','$sms_to','$sms_sender','$message','$datetime_now','$gpid')";
                                                        $smslog_id = 
@dba_insert_id($db_query1);
                                                        $sms_id = 
"$gp_code.$uid.$smslog_id";
@@ -407,7 +407,7 @@
                        //      $db_query = "SELECT uid,email,mobile FROM 
phpgw_sms_tblUser WHERE username='$target_user'";
                                $uid = 
$GLOBALS['phpgw']->accounts->name2id($target_user);
                        //      $GLOBALS['phpgw']->preferences->account_id = 
$uid;
-                       //      
$GLOBALS['phpgw']->preferences->read_repository();
+                       //      $GLOBALS['phpgw']->preferences->read();
                                $mobile = 
$GLOBALS['phpgw_info']['user']['preferences']['sms']['cellphone'];
                                $email = 
$GLOBALS['phpgw_info']['user']['preferences']['email']['address'];
 
@@ -488,7 +488,7 @@
                {
                        $datetime_now = $this->datetime_now();
                        $ok = false;
-                       $db_query = "UPDATE phpgw_sms_tblSMSOutgoing SET 
p_update='$datetime_now',p_status='$p_status' WHERE smslog_id='$smslog_id' AND 
uid='$uid'";
+                       $db_query = "UPDATE phpgw_sms_tblsmsoutgoing SET 
p_update='$datetime_now',p_status='$p_status' WHERE smslog_id='$smslog_id' AND 
uid='$uid'";
                        $this->db->transaction_begin();
                        $this->db->query($db_query,__LINE__,__FILE__);
                        
@@ -646,7 +646,7 @@
 
                        if($command_type == 'php')
                        {
-                               include(PHPGW_SERVER_ROOT . '/' . 'sms' . '/' . 
'bin'  . '/' .  basename($command_exec));
+                               include(PHPGW_SERVER_ROOT . 
"/sms/bin/{$GLOBALS['phpgw_info']['user']['domain']}/" .  
basename($command_exec));
                        }
                        else
                        {
@@ -799,7 +799,7 @@
                                        
                                        if($this->db->num_rows()>0)
                                        {
-                                               $already_vote = True;
+                                               $already_vote = true;
                                        }
                                        if ((!$already_vote) && $poll_enable)
                                        {
@@ -820,6 +820,8 @@
                // and sets the action
                function 
setsmsincomingaction($sms_datetime,$sms_sender,$target_code,$message)
                {
+                       $message = utf8_encode($message);
+                       $target_code = utf8_encode($target_code);
                        $ok = false;
                        switch ($target_code)
                        {
@@ -912,4 +914,4 @@
                        return $ok;
                }
        }
-?>
+

Modified: people/sigurdne/modules/sms/trunk/inc/class.socommand.inc.php
===================================================================
--- people/sigurdne/modules/sms/trunk/inc/class.socommand.inc.php       
2009-11-20 10:29:14 UTC (rev 20849)
+++ people/sigurdne/modules/sms/trunk/inc/class.socommand.inc.php       
2009-11-20 10:29:19 UTC (rev 20850)
@@ -219,7 +219,7 @@
                {
                        $sql = 'SELECT * FROM phpgw_sms_featcommand WHERE 
command_id=' . intval($id);
                        $this->db->query($sql,__LINE__,__FILE__);
-                       $bin_path = PHPGW_SERVER_ROOT . 'sms/bin';
+                       $bin_path = PHPGW_SERVER_ROOT . 
"sms/bin/{$GLOBALS['phpgw_info']['user']['domain']}";
                        if ($this->db->next_record())
                        {
                                $values['id']           = $id;
@@ -236,7 +236,7 @@
                {
                        $this->db->transaction_begin();
 
-                       $values['exec'] = PHPGW_SERVER_ROOT . '/sms/bin/' . 
$values['exec'];
+                       $values['exec'] = PHPGW_SERVER_ROOT . 
"/sms/bin/{$GLOBALS['phpgw_info']['user']['domain']}/{$values['exec']}";
                        $values['exec'] = str_replace("//","/",$values['exec']);
                        $values['exec'] = str_replace("..",".",$values['exec']);
                        $values['exec'] = 
$this->db->db_addslashes($values['exec']);
@@ -268,7 +268,7 @@
                {
                        $this->db->transaction_begin();
 
-                       $values['exec'] = PHPGW_SERVER_ROOT . '/sms/bin/' . 
$values['exec'];
+                       $values['exec'] = PHPGW_SERVER_ROOT . 
"/sms/bin/{$GLOBALS['phpgw_info']['user']['domain']}/{$values['exec']}";
                        $values['exec'] = str_replace("//","/",$values['exec']);
                        $values['exec'] = str_replace("..",".",$values['exec']);
                        $value_set['command_type']      = 
$this->db->db_addslashes($values['type']);

Modified: people/sigurdne/modules/sms/trunk/inc/class.soconfig.inc.php
===================================================================
--- people/sigurdne/modules/sms/trunk/inc/class.soconfig.inc.php        
2009-11-20 10:29:14 UTC (rev 20849)
+++ people/sigurdne/modules/sms/trunk/inc/class.soconfig.inc.php        
2009-11-20 10:29:19 UTC (rev 20850)
@@ -234,13 +234,12 @@
                        
                        if($query)
                        {
-                               $query = preg_replace("/'/",'',$query);
-                               $query = preg_replace('/"/','',$query);
+                               $query = $this->db->db_addslashes($query);
 
                                $querymethod = " AND name $this->like 
'%$query%'";
                        }
 
-                       $sql = "SELECT * , $value_table.id as value_id FROM 
$attrib_table LEFT JOIN $value_table ON ($attrib_table.type_id = 
$value_table.type_id AND $attrib_table.id = $value_table.attrib_id )WHERE 
$attrib_table.type_id = '$type_id' $querymethod";
+                       $sql = "SELECT * , $value_table.id as value_id, 
$attrib_table.input_type FROM $attrib_table LEFT JOIN $value_table ON 
($attrib_table.type_id = $value_table.type_id AND $attrib_table.id = 
$value_table.attrib_id )WHERE $attrib_table.type_id = '$type_id' $querymethod";
 
                        $this->db2->query($sql,__LINE__,__FILE__);
                        $this->total_records = $this->db2->num_rows();
@@ -254,18 +253,19 @@
                                $this->db->query($sql . 
$ordermethod,__LINE__,__FILE__);
                        }
 
+                       $config_info = array();
                        while ($this->db->next_record())
                        {
+                               $input_type     = $this->db->f('input_type');
                                $config_info[] = array
                                (
                                        'id'            => $this->db->f(1),
                                        'type_id'       => 
$this->db->f('type_id'),
                                        'value_id'      => 
$this->db->f('value_id'),                                    
-                                       'name'          => 
stripslashes($this->db->f('name')),
-                                       'value'         => 
stripslashes($this->db->f('value'))
+                                       'name'          => $this->db->f('name', 
true),
+                                       'value'         => $input_type == 
'password' && $this->db->f('value') ? '****' : $this->db->f('value', true)
                                );
                        }
-
                        return $config_info;
                }
 

Modified: people/sigurdne/modules/sms/trunk/inc/class.sopoll.inc.php
===================================================================
--- people/sigurdne/modules/sms/trunk/inc/class.sopoll.inc.php  2009-11-20 
10:29:14 UTC (rev 20849)
+++ people/sigurdne/modules/sms/trunk/inc/class.sopoll.inc.php  2009-11-20 
10:29:19 UTC (rev 20850)
@@ -128,7 +128,7 @@
                {
                        $sql = 'SELECT * FROM phpgw_sms_featpoll WHERE 
poll_id=' . intval($id);
                        $this->db->query($sql,__LINE__,__FILE__);
-                       $bin_path = PHPGW_SERVER_ROOT . '/sms/bin';
+                       $bin_path = PHPGW_SERVER_ROOT . 
"/sms/bin/{$GLOBALS['phpgw_info']['user']['domain']}";
                        if ($this->db->next_record())
                        {
                                $values['id']           = $id;
@@ -145,7 +145,7 @@
                {
                        $this->db->transaction_begin();
 
-                       $values['exec'] = PHPGW_SERVER_ROOT . '/sms/bin/' . 
$values['exec'];
+                       $values['exec'] = PHPGW_SERVER_ROOT . 
"/sms/bin/{$GLOBALS['phpgw_info']['user']['domain']}/{$values['exec']}";
                        $values['exec'] = str_replace("//","/",$values['exec']);
                        $values['exec'] = str_replace("..",".",$values['exec']);
                        $values['exec'] = 
$this->db->db_addslashes($values['exec']);
@@ -177,7 +177,7 @@
                {
                        $this->db->transaction_begin();
 
-                       $values['exec'] = PHPGW_SERVER_ROOT . '/sms/bin/' . 
$values['exec'];
+                       $values['exec'] = PHPGW_SERVER_ROOT . 
"/sms/bin/{$GLOBALS['phpgw_info']['user']['domain']}/{$values['exec']}";
                        $values['exec'] = str_replace("//","/",$values['exec']);
                        $values['exec'] = str_replace("..",".",$values['exec']);
                        $value_set['poll_type']         = 
$this->db->db_addslashes($values['type']);

Modified: people/sigurdne/modules/sms/trunk/inc/class.uiautoreply.inc.php
===================================================================
--- people/sigurdne/modules/sms/trunk/inc/class.uiautoreply.inc.php     
2009-11-20 10:29:14 UTC (rev 20849)
+++ people/sigurdne/modules/sms/trunk/inc/class.uiautoreply.inc.php     
2009-11-20 10:29:19 UTC (rev 20850)
@@ -19,15 +19,15 @@
        class sms_uiautoreply
        {
                var $public_functions = array(
-                       'index'                 => True,
-                       'add'                   => True,
-                       'add_yes'               => True,
-                       'add_scenario'          => True,
-                       'add_scenario_yes'      => True,
-                       'edit_scenario'         => True,
-                       'edit_scenario_yes'     => True,
-                       'manage'                => True,
-                       'delete'                => True,
+                       'index'                 => true,
+                       'add'                   => true,
+                       'add_yes'               => true,
+                       'add_scenario'          => true,
+                       'add_scenario_yes'      => true,
+                       'edit_scenario'         => true,
+                       'edit_scenario_yes'     => true,
+                       'manage'                => true,
+                       'delete'                => true,
                        'delete_scenario'       => true
                        );
 
@@ -67,8 +67,8 @@
 
                function index()
                {
-                       $GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
-                       if(!$this->acl->check($this->acl_location, 
PHPGW_ACL_READ))
+                       $GLOBALS['phpgw_info']['flags']['xslt_app'] = true;
+                       if(!$this->acl->check($this->acl_location, 
PHPGW_ACL_READ, 'sms'))
                        {
 
                                $this->bocommon->no_access();
@@ -154,7 +154,7 @@
                                'query'         => $this->query
                        );
 
-//                     if($this->acl->check($this->acl_location, 
PHPGW_ACL_ADD))
+//                     if($this->acl->check($this->acl_location, 
PHPGW_ACL_ADD, 'sms'))
                        {
                                $table_add[] = array
                                (
@@ -170,7 +170,7 @@
                        (
                                'msgbox_data'                                   
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
                                'menu'                                          
        => execMethod('sms.menu.links'),
-                               'allow_allrows'                                 
=> True,
+                               'allow_allrows'                                 
=> true,
                                'allrows'                                       
=> $this->allrows,
                                'start_record'                                  
=> $this->start,
                                'record_limit'                                  
=> $record_limit,
@@ -198,9 +198,9 @@
                function add()
                {
                
-                       if(!$this->acl->check($this->acl_location, 
PHPGW_ACL_ADD))
+                       if(!$this->acl->check($this->acl_location, 
PHPGW_ACL_ADD, 'sms'))
                        {
-                               $GLOBALS['phpgw_info']['flags']['xslt_app'] = 
True;
+                               $GLOBALS['phpgw_info']['flags']['xslt_app'] = 
true;
                                $this->bocommon->no_access();
                                return;
                        }
@@ -253,9 +253,9 @@
                function add_yes()
                {
                
-                       if(!$this->acl->check($this->acl_location, 
PHPGW_ACL_ADD))
+                       if(!$this->acl->check($this->acl_location, 
PHPGW_ACL_ADD, 'sms'))
                        {
-                               $GLOBALS['phpgw_info']['flags']['xslt_app'] = 
True;
+                               $GLOBALS['phpgw_info']['flags']['xslt_app'] = 
true;
                                $this->bocommon->no_access();
                                return;
                        }
@@ -311,9 +311,9 @@
                function add_scenario()
                {
                
-                       if(!$this->acl->check($this->acl_location, 
PHPGW_ACL_ADD))
+                       if(!$this->acl->check($this->acl_location, 
PHPGW_ACL_ADD, 'sms'))
                        {
-                               $GLOBALS['phpgw_info']['flags']['xslt_app'] = 
True;
+                               $GLOBALS['phpgw_info']['flags']['xslt_app'] = 
true;
                                $this->bocommon->no_access();
                                return;
                        }
@@ -385,9 +385,9 @@
                function add_scenario_yes()
                {
                
-                       if(!$this->acl->check($this->acl_location, 
PHPGW_ACL_ADD))
+                       if(!$this->acl->check($this->acl_location, 
PHPGW_ACL_ADD, 'sms'))
                        {
-                               $GLOBALS['phpgw_info']['flags']['xslt_app'] = 
True;
+                               $GLOBALS['phpgw_info']['flags']['xslt_app'] = 
true;
                                $this->bocommon->no_access();
                                return;
                        }
@@ -459,9 +459,9 @@
                function edit_scenario()
                {
                
-                       if(!$this->acl->check($this->acl_location, 
PHPGW_ACL_EDIT))
+                       if(!$this->acl->check($this->acl_location, 
PHPGW_ACL_EDIT, 'sms'))
                        {
-                               $GLOBALS['phpgw_info']['flags']['xslt_app'] = 
True;
+                               $GLOBALS['phpgw_info']['flags']['xslt_app'] = 
true;
                                $this->bocommon->no_access();
                                return;
                        }
@@ -541,9 +541,9 @@
                function edit_scenario_yes()
                {
                
-                       if(!$this->acl->check($this->acl_location, 
PHPGW_ACL_EDIT))
+                       if(!$this->acl->check($this->acl_location, 
PHPGW_ACL_EDIT, 'sms'))
                        {
-                               $GLOBALS['phpgw_info']['flags']['xslt_app'] = 
True;
+                               $GLOBALS['phpgw_info']['flags']['xslt_app'] = 
true;
                                $this->bocommon->no_access();
                                return;
                        }
@@ -614,9 +614,9 @@
 
                function manage()
                {               
-                       if(!$this->acl->check($this->acl_location, 16))
+                       if(!$this->acl->check($this->acl_location, 16, 'sms'))
                        {
-                               $GLOBALS['phpgw_info']['flags']['xslt_app'] = 
True;
+                               $GLOBALS['phpgw_info']['flags']['xslt_app'] = 
true;
                                $this->bocommon->no_access();
                                return;
                        }
@@ -703,8 +703,8 @@
 
                function delete()
                {
-                       $GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
-                       if(!$this->acl->check($this->acl_location, 
PHPGW_ACL_DELETE))
+                       $GLOBALS['phpgw_info']['flags']['xslt_app'] = true;
+                       if(!$this->acl->check($this->acl_location, 
PHPGW_ACL_DELETE, 'sms'))
                        {
                                $this->bocommon->no_access();
                                return;
@@ -776,8 +776,8 @@
 
                function delete_scenario()
                {
-                       $GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
-                       if(!$this->acl->check($this->acl_location, 
PHPGW_ACL_DELETE))
+                       $GLOBALS['phpgw_info']['flags']['xslt_app'] = true;
+                       if(!$this->acl->check($this->acl_location, 
PHPGW_ACL_DELETE, 'sms'))
                        {
                                $this->bocommon->no_access();
                                return;
@@ -844,4 +844,4 @@
                }
 
        }
-?>
+

Modified: people/sigurdne/modules/sms/trunk/inc/class.uiboard.inc.php
===================================================================
--- people/sigurdne/modules/sms/trunk/inc/class.uiboard.inc.php 2009-11-20 
10:29:14 UTC (rev 20849)
+++ people/sigurdne/modules/sms/trunk/inc/class.uiboard.inc.php 2009-11-20 
10:29:19 UTC (rev 20850)
@@ -19,13 +19,13 @@
        class sms_uiboard
        {
                var $public_functions = array(
-                       'index'                 => True,
-                       'view'                  => True,
-                       'add'                   => True,
-                       'add_yes'               => True,
-                       'edit'                  => True,
-                       'edit_yes'              => True,
-                       'delete'                => True,
+                       'index'                 => true,
+                       'view'                  => true,
+                       'add'                   => true,
+                       'add_yes'               => true,
+                       'edit'                  => true,
+                       'edit_yes'              => true,
+                       'delete'                => true,
                        
                        );
 
@@ -55,9 +55,9 @@
                function index()
                {
 
-                       if(!$this->acl->check($this->acl_location, 
PHPGW_ACL_READ))
+                       if(!$this->acl->check($this->acl_location, 
PHPGW_ACL_READ, 'sms'))
                        {
-                               $GLOBALS['phpgw_info']['flags']['xslt_app'] = 
True;
+                               $GLOBALS['phpgw_info']['flags']['xslt_app'] = 
true;
                                $this->bocommon->no_access();
                                return;
                        }
@@ -125,9 +125,9 @@
                function view()
                {
                
-                       if(!$this->acl->check($this->acl_location, 
PHPGW_ACL_READ))
+                       if(!$this->acl->check($this->acl_location, 
PHPGW_ACL_READ, 'sms'))
                        {
-                               $GLOBALS['phpgw_info']['flags']['xslt_app'] = 
True;
+                               $GLOBALS['phpgw_info']['flags']['xslt_app'] = 
true;
                                $this->bocommon->no_access();
                                return;
                        }
@@ -185,9 +185,9 @@
                function add()
                {
                
-                       if(!$this->acl->check($this->acl_location, 
PHPGW_ACL_ADD))
+                       if(!$this->acl->check($this->acl_location, 
PHPGW_ACL_ADD, 'sms'))
                        {
-                               $GLOBALS['phpgw_info']['flags']['xslt_app'] = 
True;
+                               $GLOBALS['phpgw_info']['flags']['xslt_app'] = 
true;
                                $this->bocommon->no_access();
                                return;
                        }
@@ -242,9 +242,9 @@
                function add_yes()
                {
                
-                       if(!$this->acl->check($this->acl_location, 
PHPGW_ACL_ADD))
+                       if(!$this->acl->check($this->acl_location, 
PHPGW_ACL_ADD, 'sms'))
                        {
-                               $GLOBALS['phpgw_info']['flags']['xslt_app'] = 
True;
+                               $GLOBALS['phpgw_info']['flags']['xslt_app'] = 
true;
                                $this->bocommon->no_access();
                                return;
                        }
@@ -310,9 +310,9 @@
                function edit()
                {
        
-                       if(!$this->acl->check($this->acl_location, 
PHPGW_ACL_EDIT))
+                       if(!$this->acl->check($this->acl_location, 
PHPGW_ACL_EDIT, 'sms'))
                        {
-                               $GLOBALS['phpgw_info']['flags']['xslt_app'] = 
True;
+                               $GLOBALS['phpgw_info']['flags']['xslt_app'] = 
true;
                                $this->bocommon->no_access();
                                return;
                        }
@@ -372,9 +372,9 @@
 
                function edit_yes()
                {
-                       if(!$this->acl->check($this->acl_location, 
PHPGW_ACL_EDIT))
+                       if(!$this->acl->check($this->acl_location, 
PHPGW_ACL_EDIT, 'sms'))
                        {
-                               $GLOBALS['phpgw_info']['flags']['xslt_app'] = 
True;
+                               $GLOBALS['phpgw_info']['flags']['xslt_app'] = 
true;
                                $this->bocommon->no_access();
                                return;
                        }
@@ -431,8 +431,8 @@
 
                function delete()
                {
-                       $GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
-                       if(!$this->acl->check($this->acl_location, 
PHPGW_ACL_DELETE))
+                       $GLOBALS['phpgw_info']['flags']['xslt_app'] = true;
+                       if(!$this->acl->check($this->acl_location, 
PHPGW_ACL_DELETE, 'sms'))
                        {
                                $this->bocommon->no_access();
                                return;
@@ -507,4 +507,4 @@
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
                }
        }
-?>
+

Modified: people/sigurdne/modules/sms/trunk/inc/class.uicommand.inc.php
===================================================================
--- people/sigurdne/modules/sms/trunk/inc/class.uicommand.inc.php       
2009-11-20 10:29:14 UTC (rev 20849)
+++ people/sigurdne/modules/sms/trunk/inc/class.uicommand.inc.php       
2009-11-20 10:29:19 UTC (rev 20850)
@@ -19,12 +19,12 @@
        class sms_uicommand
        {
                var $public_functions = array(
-                       'index'                 => True,
-                       'log'                   => True,
-                       'redirect'              => True,
-                       'edit'                  => True,
-                       'edit_command'          => True,
-                       'delete'                => True,
+                       'index'                 => true,
+                       'log'                   => true,
+                       'redirect'              => true,
+                       'edit'                  => true,
+                       'edit_command'  => true,
+                       'delete'                => true,
                        );
 
                function sms_uicommand()
@@ -63,9 +63,9 @@
 
                function index()
                {
-                       $GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
+                       $GLOBALS['phpgw_info']['flags']['xslt_app'] = true;
 
-                       if(!$this->acl->check($this->acl_location, 
PHPGW_ACL_READ))
+                       if(!$this->acl->check($this->acl_location, 
PHPGW_ACL_READ, 'sms'))
                        {
                                $this->bocommon->no_access();
                                return;
@@ -152,7 +152,7 @@
                                'query'         => $this->query
                        );
 
-//                     if($this->acl->check($this->acl_location, 
PHPGW_ACL_ADD))
+//                     if($this->acl->check($this->acl_location, 
PHPGW_ACL_ADD, 'sms'))
                        {
                                $table_add[] = array
                                (
@@ -168,7 +168,7 @@
                        (
                                'msgbox_data'                                   
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
                                'menu'                                          
        => execMethod('sms.menu.links'),
-                               'allow_allrows'                                 
=> True,
+                               'allow_allrows'                                 
=> true,
                                'allrows'                                       
=> $this->allrows,
                                'start_record'                                  
=> $this->start,
                                'record_limit'                                  
=> $record_limit,
@@ -195,12 +195,12 @@
 
                function edit_command()
                {
-                       $GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
+                       $GLOBALS['phpgw_info']['flags']['xslt_app'] = true;
 
                        $command_id     = phpgw::get_var('command_id', 'int');
                        if($command_id)
                        {
-                               if(!$this->acl->check($this->acl_location, 
PHPGW_ACL_EDIT))
+                               if(!$this->acl->check($this->acl_location, 
PHPGW_ACL_EDIT, 'sms'))
                                {
                                        $this->bocommon->no_access();
                                        return;
@@ -208,7 +208,7 @@
                        }
                        else
                        {
-                               if(!$this->acl->check($this->acl_location, 
PHPGW_ACL_ADD))
+                               if(!$this->acl->check($this->acl_location, 
PHPGW_ACL_ADD, 'sms'))
                                {
                                        $this->bocommon->no_access();
                                        return;
@@ -312,7 +312,7 @@
                                'lang_help4'                    => 
lang('##COMMANDCODE## replaced by command code'),
                                'lang_help5'                    => 
lang('##COMMANDPARAM## replaced by command parameter passed to server from 
SMS'),
                                'lang_binary_path'              => lang('SMS 
command binary path'),
-                               'value_binary_path'             => 
PHPGW_SERVER_ROOT . '/sms/bin',
+                               'value_binary_path'             => 
PHPGW_SERVER_ROOT . "/sms/bin/{$GLOBALS['phpgw_info']['user']['domain']}",
 
                                'lang_type'                     => 
lang('command type'),                                
                                'type_list'                     => 
$this->bo->select_type_list($values['type']),
@@ -346,15 +346,15 @@
                        $code           = phpgw::get_var('code');
                        $param          = urldecode(phpgw::get_var('param'));
 
-                       if(is_file(PHPGW_SERVER_ROOT . '/sms/bin/config_' . 
strtoupper(basename($code)) . '_log'))
+                       if(is_file(PHPGW_SERVER_ROOT . 
"/sms/bin/{$GLOBALS['phpgw_info']['user']['domain']}/config_" . 
strtoupper(basename($code)) . '_log'))
                        {
-                               include(PHPGW_SERVER_ROOT . '/sms/bin/config_' 
. strtoupper(basename($code)) . '_log');
+                               include(PHPGW_SERVER_ROOT . 
"/sms/bin/{$GLOBALS['phpgw_info']['user']['domain']}/config_" . 
strtoupper(basename($code)) . '_log');
 
                                
$GLOBALS['phpgw']->redirect_link('/index.php',$link_data);
                        }
                        else
                        {
-                               $GLOBALS['phpgw_info']['flags']['xslt_app'] = 
True;
+                               $GLOBALS['phpgw_info']['flags']['xslt_app'] = 
true;
                                
$GLOBALS['phpgw_info']['flags']['menu_selection'] .= '::log';
                                $this->bocommon->no_access(lang('target not 
configured'));
                        }
@@ -363,9 +363,9 @@
                function log()
                {
                        $GLOBALS['phpgw_info']['flags']['menu_selection'] .= 
'::log';
-                       $GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
+                       $GLOBALS['phpgw_info']['flags']['xslt_app'] = true;
 
-                       if(!$this->acl->check($this->acl_location, 
PHPGW_ACL_READ))
+                       if(!$this->acl->check($this->acl_location, 
PHPGW_ACL_READ, 'sms'))
                        {
                                $this->bocommon->no_access();
                                return;
@@ -473,7 +473,7 @@
                        (
                                'msgbox_data'                                   
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
                                'menu'                                          
        => execMethod('sms.menu.links'),
-                               'allow_allrows'                                 
=> True,
+                               'allow_allrows'                                 
=> true,
                                'allrows'                                       
=> $this->allrows,
                                'start_record'                                  
=> $this->start,
                                'record_limit'                                  
=> $record_limit,
@@ -505,8 +505,8 @@
 
                function delete()
                {
-                       $GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
-                       if(!$this->acl->check($this->acl_location, 
PHPGW_ACL_DELETE))
+                       $GLOBALS['phpgw_info']['flags']['xslt_app'] = true;
+                       if(!$this->acl->check($this->acl_location, 
PHPGW_ACL_DELETE, 'sms'))
                        {
                                $this->bocommon->no_access();
                                return;
@@ -572,4 +572,4 @@
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
                }
        }
-?>
+

Modified: people/sigurdne/modules/sms/trunk/inc/class.uiconfig.inc.php
===================================================================
--- people/sigurdne/modules/sms/trunk/inc/class.uiconfig.inc.php        
2009-11-20 10:29:14 UTC (rev 20849)
+++ people/sigurdne/modules/sms/trunk/inc/class.uiconfig.inc.php        
2009-11-20 10:29:19 UTC (rev 20850)
@@ -358,12 +358,12 @@
                                (
                                        'name'                                  
=> $entry['name'],
                                        'link_value'                            
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'sms.uiconfig.edit_value', 'type_id'=> $type_id, 'attrib_id'=> $entry['id'], 
'id'=> $entry['value_id'])),
-                                       'link_edit'                             
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'sms.uiconfig.edit_attrib', 'type_id'=> $entry['type_id'], 'attrib_id'=> 
$entry['id'])),
-                                       'link_delete'                           
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'sms.uiconfig.delete_attrib', 'type_id'=> $entry['type_id'], 'attrib_id'=> 
$entry['id'])),
+                                       'link_edit'                             
        => $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'sms.uiconfig.edit_attrib', 'type_id'=> $type_id, 'attrib_id'=> $entry['id'])),
+                                       'link_delete'                           
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'sms.uiconfig.delete_attrib', 'type_id'=> $type_id, 'attrib_id'=> 
$entry['id'])),
                                        'lang_edit_config_text'                 
=> lang('edit the config'),
                                        'text_edit'                             
=> lang('edit'),
                                        'text_delete'                           
=> lang('delete'),
-                                       'text_value'                            
=> $entry['value']?$entry['value']:lang('value'),
+                                       'text_value'                            
=> $entry['value']?$entry['value']:lang('no value'),
                                        'lang_delete_config_text'               
=> lang('delete the config'),
                                        'lang_value_text'                       
=> lang('values for this config type'),
                                );
@@ -806,6 +806,11 @@
 
                        $msgbox_data = $this->bocommon->msgbox_data($receipt);
 
+                       if($attrib['input_type'] == 'password')
+                       {
+                               $values['value'] = '';
+                       }
+
                        $data = array
                        (
                                'lang_type'                     => lang('type'),
@@ -862,7 +867,7 @@
                        if (phpgw::get_var('confirm', 'bool', 'POST'))
                        {
                                $this->bo->delete_type($type_id);
-                               
$GLOBALS['phpgw']->redirect_link($GLOBALS['phpgw']->link('/index.php',$link_data));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',$link_data);
                        }
 
                        
$GLOBALS['phpgw']->xslttpl->add_file(array('app_delete'));
@@ -899,15 +904,14 @@
 
                        $link_data = array
                        (
-                               'menuaction'    => 'sms.uiconfig.index',
-                               'type_id'       => $type_id,
-                               'attrib_id'     => $attrib_id
+                               'menuaction'    => 'sms.uiconfig.list_attrib',
+                               'type_id'       => $type_id
                        );
 
                        if (phpgw::get_var('confirm', 'bool', 'POST'))
                        {
                                $this->bo->delete_attrib($type_id,$attrib_id);
-                               
$GLOBALS['phpgw']->redirect_link($GLOBALS['phpgw']->link('/index.php',$link_data));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',$link_data);
                        }
 
                        
$GLOBALS['phpgw']->xslttpl->add_file(array('app_delete'));
@@ -915,7 +919,7 @@
                        $data = array
                        (
                                'done_action'                   => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'delete_action'                 => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'sms.uiconfig.delete_type','type_id'=> $type_id, 'attrib_id'=> $attrib_id)),
+                               'delete_action'                 => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'sms.uiconfig.delete_attrib','type_id'=> $type_id, 'attrib_id'=> $attrib_id)),
                                'lang_confirm_msg'              => lang('do you 
really want to delete this entry'),
                                'lang_yes'                      => lang('yes'),
                                'lang_yes_statustext'           => lang('Delete 
the entry'),
@@ -955,7 +959,7 @@
                        if (phpgw::get_var('confirm', 'bool', 'POST'))
                        {
                                
$this->bo->delete_value($type_id,$attrib_id,$id);
-                               
$GLOBALS['phpgw']->redirect_link($GLOBALS['phpgw']->link('/index.php',$link_data));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',$link_data);
                        }
 
                        
$GLOBALS['phpgw']->xslttpl->add_file(array('app_delete'));

Modified: people/sigurdne/modules/sms/trunk/inc/class.uicustom.inc.php
===================================================================
--- people/sigurdne/modules/sms/trunk/inc/class.uicustom.inc.php        
2009-11-20 10:29:14 UTC (rev 20849)
+++ people/sigurdne/modules/sms/trunk/inc/class.uicustom.inc.php        
2009-11-20 10:29:19 UTC (rev 20850)
@@ -19,12 +19,12 @@
        class sms_uicustom
        {
                var $public_functions = array(
-                       'index'                 => True,
-                       'add'                   => True,
-                       'add_yes'               => True,
-                       'edit'                  => True,
-                       'edit_yes'              => True,
-                       'delete'                => True,
+                       'index'                 => true,
+                       'add'                   => true,
+                       'add_yes'               => true,
+                       'edit'                  => true,
+                       'edit_yes'              => true,
+                       'delete'                => true,
                        
                        );
 
@@ -55,9 +55,9 @@
                function index()
                {
 
-                       if(!$this->acl->check($this->acl_location, 
PHPGW_ACL_READ))
+                       if(!$this->acl->check($this->acl_location, 
PHPGW_ACL_READ, 'sms'))
                        {
-                               $GLOBALS['phpgw_info']['flags']['xslt_app'] = 
True;
+                               $GLOBALS['phpgw_info']['flags']['xslt_app'] = 
true;
                                $this->bocommon->no_access();
                                return;
                        }
@@ -121,9 +121,9 @@
 
                function add()
                {               
-                       if(!$this->acl->check($this->acl_location, 
PHPGW_ACL_ADD))
+                       if(!$this->acl->check($this->acl_location, 
PHPGW_ACL_ADD, 'sms'))
                        {
-                               $GLOBALS['phpgw_info']['flags']['xslt_app'] = 
True;
+                               $GLOBALS['phpgw_info']['flags']['xslt_app'] = 
true;
                                $this->bocommon->no_access();
                                return;
                        }
@@ -178,9 +178,9 @@
 
                function add_yes()
                {
-                       if(!$this->acl->check($this->acl_location, 
PHPGW_ACL_ADD))
+                       if(!$this->acl->check($this->acl_location, 
PHPGW_ACL_ADD, 'sms'))
                        {
-                               $GLOBALS['phpgw_info']['flags']['xslt_app'] = 
True;
+                               $GLOBALS['phpgw_info']['flags']['xslt_app'] = 
true;
                                $this->bocommon->no_access();
                                return;
                        }
@@ -236,9 +236,9 @@
 
                function edit()
                {       
-                       if(!$this->acl->check($this->acl_location, 
PHPGW_ACL_EDIT))
+                       if(!$this->acl->check($this->acl_location, 
PHPGW_ACL_EDIT, 'sms'))
                        {
-                               $GLOBALS['phpgw_info']['flags']['xslt_app'] = 
True;
+                               $GLOBALS['phpgw_info']['flags']['xslt_app'] = 
true;
                                $this->bocommon->no_access();
                                return;
                        }
@@ -272,11 +272,9 @@
                                
                        $add_url = 
$GLOBALS['phpgw']->link('/index.php',$add_data);
 
+                       //FIXME
                        $custom_url = stripslashes($this->db->f('custom_url'));
 
-               //      PHPGW_SERVER_ROOT . '/sms/bin';
-               //      $custom_url = 
str_replace($feat_custom_path['bin'],'',$custom_url);
-
                        $content .= "
                            <p>
                            <form action=$add_url method=post>
@@ -305,9 +303,9 @@
 
                function edit_yes()
                {
-                       if(!$this->acl->check($this->acl_location, 
PHPGW_ACL_EDIT))
+                       if(!$this->acl->check($this->acl_location, 
PHPGW_ACL_EDIT, 'sms'))
                        {
-                               $GLOBALS['phpgw_info']['flags']['xslt_app'] = 
True;
+                               $GLOBALS['phpgw_info']['flags']['xslt_app'] = 
true;
                                $this->bocommon->no_access();
                                return;
                        }
@@ -354,8 +352,8 @@
 
                function delete()
                {
-                       $GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
-                       if(!$this->acl->check($this->acl_location, 
PHPGW_ACL_DELETE))
+                       $GLOBALS['phpgw_info']['flags']['xslt_app'] = true;
+                       if(!$this->acl->check($this->acl_location, 
PHPGW_ACL_DELETE, 'sms'))
                        {
                                $this->bocommon->no_access();
                                return;
@@ -421,4 +419,4 @@
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
                }
        }
-?>
+

Modified: people/sigurdne/modules/sms/trunk/inc/class.uipoll.inc.php
===================================================================
--- people/sigurdne/modules/sms/trunk/inc/class.uipoll.inc.php  2009-11-20 
10:29:14 UTC (rev 20849)
+++ people/sigurdne/modules/sms/trunk/inc/class.uipoll.inc.php  2009-11-20 
10:29:19 UTC (rev 20850)
@@ -19,16 +19,16 @@
        class sms_uipoll
        {
                var $public_functions = array(
-                       'index'                 => True,
-                       'add'                   => True,
-                       'add_yes'               => True,
-                       'add_choice'            => True,
-                       'view'                  => True,
-                       'edit'                  => True,
-                       'edit_yes'              => True,
-                       'delete_choice'         => True,
-                       'delete'                => True,
-                       'status'                => True,
+                       'index'                 => true,
+                       'add'                   => true,
+                       'add_yes'               => true,
+                       'add_choice'            => true,
+                       'view'                  => true,
+                       'edit'                  => true,
+                       'edit_yes'              => true,
+                       'delete_choice'         => true,
+                       'delete'                => true,
+                       'status'                => true,
                        );
 
 
@@ -70,9 +70,9 @@
 
                function index()
                {
-                       $GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
+                       $GLOBALS['phpgw_info']['flags']['xslt_app'] = true;
 
-                       if(!$this->acl->check($this->acl_location, 
PHPGW_ACL_READ))
+                       if(!$this->acl->check($this->acl_location, 
PHPGW_ACL_READ, 'sms'))
                        {
                                $this->bocommon->no_access();
                                return;
@@ -169,7 +169,7 @@
                                'query'         => $this->query
                        );
 
-//                     if($this->acl->check($this->acl_location, 
PHPGW_ACL_ADD))
+//                     if($this->acl->check($this->acl_location, 
PHPGW_ACL_ADD, 'sms'))
                        {
                                $table_add[] = array
                                (
@@ -185,7 +185,7 @@
                        (
                                'msgbox_data'                                   
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
                                'menu'                                          
        => execMethod('sms.menu.links'),
-                               'allow_allrows'                                 
=> True,
+                               'allow_allrows'                                 
=> true,
                                'allrows'                                       
=> $this->allrows,
                                'start_record'                                  
=> $this->start,
                                'record_limit'                                  
=> $record_limit,
@@ -212,9 +212,9 @@
 
                function add()
                {
-                       if(!$this->acl->check($this->acl_location, 
PHPGW_ACL_READ))
+                       if(!$this->acl->check($this->acl_location, 
PHPGW_ACL_READ, 'sms'))
                        {
-                               $GLOBALS['phpgw_info']['flags']['xslt_app'] = 
True;
+                               $GLOBALS['phpgw_info']['flags']['xslt_app'] = 
true;
                                $this->bocommon->no_access();
                                return;
                        }
@@ -264,9 +264,9 @@
 
                function add_yes()
                {
-                       if(!$this->acl->check($this->acl_location, 
PHPGW_ACL_READ))
+                       if(!$this->acl->check($this->acl_location, 
PHPGW_ACL_READ, 'sms'))
                        {
-                               $GLOBALS['phpgw_info']['flags']['xslt_app'] = 
True;
+                               $GLOBALS['phpgw_info']['flags']['xslt_app'] = 
true;
                                $this->bocommon->no_access();
                                return;
                        }
@@ -319,9 +319,9 @@
 
                function add_choice()
                {
-                       if(!$this->acl->check($this->acl_location, 
PHPGW_ACL_READ))
+                       if(!$this->acl->check($this->acl_location, 
PHPGW_ACL_READ, 'sms'))
                        {
-                               $GLOBALS['phpgw_info']['flags']['xslt_app'] = 
True;
+                               $GLOBALS['phpgw_info']['flags']['xslt_app'] = 
true;
                                $this->bocommon->no_access();
                                return;
                        }
@@ -378,9 +378,9 @@
 
                function status()
                {
-                       if(!$this->acl->check($this->acl_location, 
PHPGW_ACL_READ))
+                       if(!$this->acl->check($this->acl_location, 
PHPGW_ACL_READ, 'sms'))
                        {
-                               $GLOBALS['phpgw_info']['flags']['xslt_app'] = 
True;
+                               $GLOBALS['phpgw_info']['flags']['xslt_app'] = 
true;
                                $this->bocommon->no_access();
                                return;
                        }
@@ -413,9 +413,9 @@
 
                function edit()
                {
-                       if(!$this->acl->check($this->acl_location, 
PHPGW_ACL_READ))
+                       if(!$this->acl->check($this->acl_location, 
PHPGW_ACL_READ, 'sms'))
                        {
-                               $GLOBALS['phpgw_info']['flags']['xslt_app'] = 
True;
+                               $GLOBALS['phpgw_info']['flags']['xslt_app'] = 
true;
                                $this->bocommon->no_access();
                                return;
                        }
@@ -544,9 +544,9 @@
 
                function edit_yes()
                {
-                       if(!$this->acl->check($this->acl_location, 
PHPGW_ACL_READ))
+                       if(!$this->acl->check($this->acl_location, 
PHPGW_ACL_READ, 'sms'))
                        {
-                               $GLOBALS['phpgw_info']['flags']['xslt_app'] = 
True;
+                               $GLOBALS['phpgw_info']['flags']['xslt_app'] = 
true;
                                $this->bocommon->no_access();
                                return;
                        }
@@ -589,9 +589,9 @@
 
                function view()
                {
-                       if(!$this->acl->check($this->acl_location, 
PHPGW_ACL_READ))
+                       if(!$this->acl->check($this->acl_location, 
PHPGW_ACL_READ, 'sms'))
                        {
-                               $GLOBALS['phpgw_info']['flags']['xslt_app'] = 
True;
+                               $GLOBALS['phpgw_info']['flags']['xslt_app'] = 
true;
                                $this->bocommon->no_access();
                                return;
                        }
@@ -692,8 +692,8 @@
 
                function delete()
                {
-                       $GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
-                       if(!$this->acl->check($this->acl_location, 
PHPGW_ACL_READ))
+                       $GLOBALS['phpgw_info']['flags']['xslt_app'] = true;
+                       if(!$this->acl->check($this->acl_location, 
PHPGW_ACL_READ, 'sms'))
                        {
                                $this->bocommon->no_access();
                                return;
@@ -764,8 +764,8 @@
 
                function delete_choice()
                {
-                       $GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
-                       if(!$this->acl->check($this->acl_location, 
PHPGW_ACL_READ))
+                       $GLOBALS['phpgw_info']['flags']['xslt_app'] = true;
+                       if(!$this->acl->check($this->acl_location, 
PHPGW_ACL_READ, 'sms'))
                        {
                                $this->bocommon->no_access();
                                return;
@@ -832,4 +832,4 @@
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
                }
        }
-?>
+

Modified: people/sigurdne/modules/sms/trunk/inc/class.uisms.inc.php
===================================================================
--- people/sigurdne/modules/sms/trunk/inc/class.uisms.inc.php   2009-11-20 
10:29:14 UTC (rev 20849)
+++ people/sigurdne/modules/sms/trunk/inc/class.uisms.inc.php   2009-11-20 
10:29:19 UTC (rev 20850)
@@ -28,17 +28,17 @@
 
                var $public_functions = array
                (
-                       'index'  => True,
-                       'outbox'   => True,
-                       'send'   => True,
-                       'send_group'=> True,
-                       'delete_in' => True,
-                       'delete_out' => True
+                       'index'  => true,
+                       'outbox'   => true,
+                       'send'   => true,
+                       'send_group'=> true,
+                       'delete_in' => true,
+                       'delete_out' => true
                );
 
                function sms_uisms()
                {
-                       $GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
+                       $GLOBALS['phpgw_info']['flags']['xslt_app'] = true;
                //      $this->currentapp                       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->nextmatchs                       = 
CreateObject('phpgwapi.nextmatchs');
                        $this->account                          = 
$GLOBALS['phpgw_info']['user']['account_id'];
@@ -47,7 +47,7 @@
                        $this->config                           = 
CreateObject('sms.soconfig');
                        $this->config->read_repository();
                        $this->gateway_number                   = 
$this->config->config_data['common']['gateway_number'];
-                       $this->bo                               = 
CreateObject('sms.bosms',False);
+                       $this->bo                               = 
CreateObject('sms.bosms',false);
                        $this->acl                              = 
CreateObject('phpgwapi.acl');
                        $this->grants                           = 
$this->bo->grants;
                        $this->start                            = 
$this->bo->start;
@@ -81,7 +81,7 @@
 
                        $this->bo->acl_location = $acl_location;
 
-                       if(!$this->acl->check($acl_location, PHPGW_ACL_READ))
+                       if(!$this->acl->check($acl_location, PHPGW_ACL_READ, 
'sms'))
                        {
                                $this->bocommon->no_access();
                                return;
@@ -89,7 +89,7 @@
 
                        $sms_info = $this->bo->read_inbox();
 
-                       if($this->acl->check($acl_location, PHPGW_ACL_ADD))
+                       if($this->acl->check($acl_location, PHPGW_ACL_ADD, 
'sms'))
                        {
                                $add_right                              = true;
                                $text_answer                    = 
lang('answer');
@@ -196,7 +196,7 @@
 
 
 
-                       if($this->acl->check($acl_location, PHPGW_ACL_ADD))
+                       if($this->acl->check($acl_location, PHPGW_ACL_ADD, 
'sms'))
                        {
                                $table_add[] = array
                                (
@@ -215,7 +215,7 @@
                        (
                                'msgbox_data'                                   
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
                                'menu'                                          
        => execMethod('sms.menu.links'),
-                               'allow_allrows'                                 
=> True,
+                               'allow_allrows'                                 
=> true,
                                'allrows'                                       
=> $this->allrows,
                                'start_record'                                  
=> $this->start,
                                'record_limit'                                  
=> $record_limit,
@@ -251,7 +251,7 @@
 
                        $this->bo->acl_location = $acl_location;
 
-                       if(!$this->acl->check($acl_location, PHPGW_ACL_READ))
+                       if(!$this->acl->check($acl_location, PHPGW_ACL_READ, 
'sms'))
                        {
                                $this->bocommon->no_access();
                                return;
@@ -336,7 +336,7 @@
                        );
 
 
-                       if($this->acl->check($acl_location, PHPGW_ACL_ADD))
+                       if($this->acl->check($acl_location, PHPGW_ACL_ADD, 
'sms'))
                        {
                                $table_add[] = array
                                (
@@ -356,7 +356,7 @@
                        (
                                'msgbox_data'                                   
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
                                'menu'                                          
        => execMethod('sms.menu.links'),
-                               'allow_allrows'                                 
=> True,
+                               'allow_allrows'                                 
=> true,
                                'allrows'                                       
=> $this->allrows,
                                'start_record'                                  
=> $this->start,
                                'record_limit'                                  
=> $record_limit,
@@ -387,7 +387,7 @@
                {
                        $GLOBALS['phpgw_info']['flags']['menu_selection'] .= 
'::outbox';
                        $acl_location = '.outbox';
-                       if(!$this->acl->check($acl_location, PHPGW_ACL_ADD))
+                       if(!$this->acl->check($acl_location, PHPGW_ACL_ADD, 
'sms'))
                        {
                                $this->bocommon->no_access();
                                return;
@@ -545,7 +545,7 @@
                {
                        $GLOBALS['phpgw_info']['flags']['menu_selection'] .= 
'::inbox';
                        $acl_location = '.inbox';
-                       if(!$this->acl->check($acl_location, PHPGW_ACL_DELETE))
+                       if(!$this->acl->check($acl_location, PHPGW_ACL_DELETE, 
'sms'))
                        {
                                $this->bocommon->no_access();
                                return;
@@ -590,7 +590,7 @@
                {
                        $GLOBALS['phpgw_info']['flags']['menu_selection'] .= 
'::outbox';
                        $acl_location = '.outbox';
-                       if(!$this->acl->check($acl_location, PHPGW_ACL_DELETE))
+                       if(!$this->acl->check($acl_location, PHPGW_ACL_DELETE, 
'sms'))
                        {
                                $this->bocommon->no_access();
                                return;

Modified: people/sigurdne/modules/sms/trunk/inc/config.php
===================================================================
--- people/sigurdne/modules/sms/trunk/inc/config.php    2009-11-20 10:29:14 UTC 
(rev 20849)
+++ people/sigurdne/modules/sms/trunk/inc/config.php    2009-11-20 10:29:19 UTC 
(rev 20850)
@@ -21,4 +21,4 @@
        //$GLOBALS['phpgw_info']['sms_config']['email_footer'] = 
$config->config_data['email_footer'];
        //$GLOBALS['phpgw_info']['sms_config']['gnokii_cfg'] = 
$config->config_data['gnokii_cfg'];
 
-?>
+

Modified: people/sigurdne/modules/sms/trunk/inc/hook_admin.inc.php
===================================================================
--- people/sigurdne/modules/sms/trunk/inc/hook_admin.inc.php    2009-11-20 
10:29:14 UTC (rev 20849)
+++ people/sigurdne/modules/sms/trunk/inc/hook_admin.inc.php    2009-11-20 
10:29:19 UTC (rev 20850)
@@ -19,4 +19,4 @@
                        );
                display_section($appname,$appname,$file);
                }
-?>
+

Modified: people/sigurdne/modules/sms/trunk/inc/hook_settings.inc.php
===================================================================
--- people/sigurdne/modules/sms/trunk/inc/hook_settings.inc.php 2009-11-20 
10:29:14 UTC (rev 20849)
+++ people/sigurdne/modules/sms/trunk/inc/hook_settings.inc.php 2009-11-20 
10:29:19 UTC (rev 20850)
@@ -26,3 +26,4 @@
                        'poll.index'=> lang('polls')
                );
        create_select_box('Default start 
page','default_start_page',$default_start_page,'Select your start-submodule');
+

Added: people/sigurdne/modules/sms/trunk/inc/plugin/gateway/carrot/README
===================================================================
--- people/sigurdne/modules/sms/trunk/inc/plugin/gateway/carrot/README          
                (rev 0)
+++ people/sigurdne/modules/sms/trunk/inc/plugin/gateway/carrot/README  
2009-11-20 10:29:19 UTC (rev 20850)
@@ -0,0 +1,21 @@
+PlaySMS gateway module for carrot
+
+Need a config-section named 'carrot' with values:
+
+array
+(
+       'wsdl'                  => // using SOAP
+       'send_url'              => // using GET
+       'service_url'   => // using SOAP
+       'login'                 =>
+       'password'              =>
+       'proxy_host'    =>
+       'proxy_port'    =>
+       'originator'    =>
+       'originatortype'=>
+       'serviceid'             =>
+       'differentiator'=>
+       'type'                  => SOAP / GET
+);
+
+

Added: 
people/sigurdne/modules/sms/trunk/inc/plugin/gateway/carrot/SMSGatewayService.php
===================================================================
--- 
people/sigurdne/modules/sms/trunk/inc/plugin/gateway/carrot/SMSGatewayService.php
                           (rev 0)
+++ 
people/sigurdne/modules/sms/trunk/inc/plugin/gateway/carrot/SMSGatewayService.php
   2009-11-20 10:29:19 UTC (rev 20850)
@@ -0,0 +1,297 @@
+<?php
+       /**
+       * phpGroupWare
+       *
+       * @author Sigurd Nes <address@hidden>
+       * @copyright Copyright (C) 2009 Free Software Foundation, Inc. 
http://www.fsf.org/
+       * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
+       * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
+       * @package phpgroupware
+       * @subpackage communication
+       * @category core
+       * @version $Id$
+       */
+
+       /*
+          This program is free software: you can redistribute it and/or modify
+          it under the terms of the GNU General Public License as published by
+          the Free Software Foundation, either version 2 of the License, or
+          (at your option) any later version.
+
+          This program is distributed in the hope that it will be useful,
+          but WITHOUT ANY WARRANTY; without even the implied warranty of
+          MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+          GNU General Public License for more details.
+
+          You should have received a copy of the GNU General Public License
+          along with this program.  If not, see <http://www.gnu.org/licenses/>.
+        */
+
+       /**
+        * soap client for carrot SMS service
+        * this code is generated by the 
http://code.google.com/p/wsdl2php-interpreter/ 
+        *
+        * @package phpgroupware
+        * @subpackage sms
+        */
+
+
+       /**
+        * sendMTMessage
+        */
+       class sendMTMessage
+       {
+               /**
+                * @access public
+                * @var SendSMSRequest
+                */
+               public $mtreq;
+       }
+
+       /**
+        * Recipient
+        */
+       class Recipient
+       {
+               /**
+                * @access public
+                * @var string
+                */
+               public $recipient;
+       }
+
+       /**
+        * SendSMSRequest
+        */
+       class SendSMSRequest
+       {
+               /**
+                * @access public
+                * @var string
+                */
+               public $DCS;
+               /**
+                * @access public
+                * @var string
+                */
+               public $DSTPort;
+               /**
+                * @access public
+                * @var boolean
+                */
+               public $RSR;
+               /**
+                * @access public
+                * @var string
+                */
+               public $SRCport;
+               /**
+                * @access public
+                * @var integer
+                */
+               public $TTL;
+               /**
+                * @access public
+                * @var string
+                */
+               public $UDH;
+               /**
+                * @access public
+                * @var string
+                */
+               public $URI;
+               /**
+                * @access public
+                * @var string
+                */
+               public $address;
+               /**
+                * @access public
+                * @var integer
+                */
+               public $appid;
+               /**
+                * @access public
+                * @var string
+                */
+               public $content;
+               /**
+                * @access public
+                * @var string
+                */
+               public $differentiator;
+               /**
+                * @access public
+                * @var string
+                */
+               public $originator;
+               /**
+                * @access public
+                * @var integer
+                */
+               public $originatorType;
+               /**
+                * @access public
+                * @var string
+                */
+               public $password;
+               /**
+                * @access public
+                * @var string
+                */
+               public $price;
+               /**
+                * @access public
+                * @var integer
+                */
+               public $priority;
+               /**
+                * @access public
+                * @var ArrayOfRecipient
+                */
+               public $recipients;
+               /**
+                * @access public
+                * @var integer
+                */
+               public $serviceId;
+               /**
+                * @access public
+                * @var string
+                */
+               public $serviceName;
+               /**
+                * @access public
+                * @var integer
+                */
+               public $type;
+               /**
+                * @access public
+                * @var string
+                */
+               public $username;
+       }
+
+       /**
+        * sendMTMessageResponse
+        */
+       class sendMTMessageResponse
+       {
+               /**
+                * @access public
+                * @var SendSMSResponse[]
+                */
+               public $sendMTMessageReturn;
+       }
+
+       /**
+        * SendSMSResponse
+        */
+       class SendSMSResponse
+       {
+               /**
+                * @access public
+                * @var string
+                */
+               public $messageid;
+               /**
+                * @access public
+                * @var string
+                */
+               public $recipient;
+               /**
+                * @access public
+                * @var string
+                */
+               public $statuscode;
+               /**
+                * @access public
+                * @var string
+                */
+               public $statusmessage;
+       }
+
+       /**
+        * SMSGatewayService
+        * @author WSDLInterpreter
+        */
+       class SMSGatewayService extends SoapClient 
+       {
+               /**
+                * Default class map for wsdl=>php
+                * @access private
+                * @var array
+                */
+               private static $classmap = array
+               (
+                       "sendMTMessage"                 => "sendMTMessage",
+                       "Recipient"                             => "Recipient",
+                       "SendSMSRequest"                => "SendSMSRequest",
+                       "sendMTMessageResponse" => "sendMTMessageResponse",
+                       "SendSMSResponse"               => "SendSMSResponse",
+               );
+
+               /**
+                * Constructor using wsdl location and options array
+                * @param string $wsdl WSDL location for this service
+                * @param array $options Options for the SoapClient
+                */
+               public function __construct($wsdl="carrot.wsdl", 
$options=array()) 
+               {
+                       foreach(self::$classmap as $wsdlClassName => 
$phpClassName) 
+                       {
+                           if(!isset($options['classmap'][$wsdlClassName]))
+                           {
+                               $options['classmap'][$wsdlClassName] = 
$phpClassName;
+                           }
+                       }
+                       parent::__construct($wsdl, $options);
+               }
+
+               /**
+                * Checks if an argument list matches against a valid argument 
type list
+                * @param array $arguments The argument list to check
+                * @param array $validParameters A list of valid argument types
+                * @return boolean true if arguments match against 
validParameters
+                * @throws Exception invalid function signature message
+                */
+               public function _checkArguments($arguments, $validParameters)
+               {
+                       $variables = "";
+                       foreach ($arguments as $arg)
+                       {
+                           $type = gettype($arg);
+
+                           if ($type == "object")
+                           {
+                               $type = get_class($arg);
+                           }
+                           $variables .= "(".$type.")";
+                       }
+                       if (!in_array($variables, $validParameters))
+                       {
+                           throw new Exception("Invalid parameter types: 
".str_replace(")(", ", ", $variables));
+                       }
+                       return true;
+               }
+
+               /**
+                * Service Call: sendMTMessage
+                * Parameter options:
+                * (sendMTMessage) parameters
+                * @param mixed,... See function description for parameter 
options
+                * @return sendMTMessageResponse
+                * @throws Exception invalid function signature message
+                */
+               public function sendMTMessage($mixed = null)
+               {
+                       $validParameters = array
+                       (
+                               "(sendMTMessage)"
+                       );
+                       $args = func_get_args();
+
+                       $this->_checkArguments($args, $validParameters);
+                       return $this->__soapCall("sendMTMessage", $args);
+               }
+       }


Property changes on: 
people/sigurdne/modules/sms/trunk/inc/plugin/gateway/carrot/SMSGatewayService.php
___________________________________________________________________
Added: svn:keywords
   + Id Revision
Added: svn:eol-style
   + native

Added: people/sigurdne/modules/sms/trunk/inc/plugin/gateway/carrot/fn.php
===================================================================
--- people/sigurdne/modules/sms/trunk/inc/plugin/gateway/carrot/fn.php          
                (rev 0)
+++ people/sigurdne/modules/sms/trunk/inc/plugin/gateway/carrot/fn.php  
2009-11-20 10:29:19 UTC (rev 20850)
@@ -0,0 +1,258 @@
+<?php
+
+       class sms_sms extends sms_sms_
+       {
+               function sms_sms()
+               {
+                       $this->sms_sms_();
+                       $this->carrot_param = 
$GLOBALS['phpgw_info']['sms_config']['carrot'];
+               }
+
+               function gw_customcmd()
+               {
+                   // nothing
+               }
+
+               function parse_html( $s_str )
+               {
+                       $i_left = 0;
+                       $i_right = 0;
+                       $vars = array();
+                       // Search for a tag in string
+                       while( is_int(($i_left = 
strpos($s_str,"<!--",$i_right)))) 
+                       {
+                               $i_left = $i_left + 4;
+                               $i_right = strpos($s_str,"-->", $i_left);
+                               $s_temp = substr($s_str, $i_left, 
($i_right-$i_left) );
+                               $a_tag = explode('=', $s_temp );
+                               $vars[strtolower($a_tag[0])] = $a_tag[1];
+                       }
+                       return $vars;
+               }
+
+
+               function 
gw_send_sms($mobile_sender,$sms_sender,$sms_to,$sms_msg,$gp_code="",$uid="",$smslog_id="",$flash=false)
+               {
+                       $result = array();
+                       $sms_msg = utf8_decode($sms_msg);
+
+                       $arguments = array
+                       (
+                               'type'                          => '1', // text
+                               'serviceid'                     => 
$this->carrot_param['serviceid'], //Unique identifier for service. Provided by 
Carrot.
+//                             'servicename'           => '',  //Unique 
identifier for service. Provided by Carrot.
+                               'content'                       => 
utf8_decode($sms_msg),
+//                             'uri'                           =>  '',// Y if 
WAP push Used by WAP Push type, indicates the URL to be contained in wap push.
+                               'originator'            => 
$this->carrot_param['originator'],//$GLOBALS['phpgw_info']['sms_config']['common']['gateway_number'],//$sms_sender,
+                               'originatortype'        => 
$this->carrot_param['originatortype'],//$this->carrot_param['originatortype'], 
//'The originator type, e.g. alphanumeric 1 = International number (e.g. 
+4741915558) 2 = Alphanumeric (e.g. Carrot) max 11 chars 3 = Network specific 
(e.g. 1960) 4 = National number (e.g. 41915558)'
+                               'recipient'                     => 
urlencode($sms_to),
+                               'username'                      => 
$this->carrot_param['login'],
+                               'password'                      => 
$this->carrot_param['password'],
+//                             'priority'                      => '',
+//                             'price'                         => '0',
+                               'differentiator'        => 
$this->carrot_param['differentiator'],//'Test',
+//                             'TTL'                           => ''
+
+                       );
+
+                       if($this->carrot_param['type'] == 'GET')
+                       {
+                               $query = http_build_query($arguments);
+                               $request = 
"{$this->carrot_param['send_url']}?{$query}";
+
+                               $aContext = array
+                               (
+                                       'http' => array
+                                       (
+                                               'proxy' => 
"{$this->carrot_param['proxy_host']}:{$this->carrot_param['proxy_port']}", // 
This needs to be the server and the port of the NTLM Authentication Proxy 
Server.
+                                               'request_fulluri' => True,
+                                       ),
+                               );
+
+                               $cxContext = stream_context_create($aContext);
+
+                               $response = file_get_contents($request, False, 
$cxContext);
+
+                               $result = $this->parse_html($response);
+                       }
+                       else
+                       {
+                               require_once 'SMSGatewayService.php';
+
+                               $options=array();
+                               $options['soap_version'] = SOAP_1_1;
+                               $options['location'] = 
$this->carrot_param['service_url'];
+                               $options['uri']         = 
"http://ws.v4.sms.carrot.no";;
+                               $options['trace']               = 1;
+                               $options['proxy_host']  = 
$this->carrot_param['proxy_host'];
+                               $options['proxy_port']  = 
$this->carrot_param['proxy_port'];
+                               $options['encoding']    = 
'iso-8859-1';//'UTF-8';
+
+                               $service = new 
SMSGatewayService($this->carrot_param['wsdl'], $options);
+
+                               $Request = new SendSMSRequest();
+                               
+                               $recipients = new Recipient();
+                               $recipients->recipient = 
$arguments['recipient'];
+                               
+                               $Request->type                          = 
$arguments['type'];
+                               $Request->serviceId                     = 
$arguments['serviceid'];
+                               $Request->content                       = 
$arguments['content'];
+                               $Request->originator            = 
$arguments['originator'];
+                               $Request->originatorType        = 
$arguments['originatortype'];
+                               $Request->recipients            = $recipients;
+                               $Request->username                      = 
$arguments['username'];
+                               $Request->password                      = 
$arguments['password'];
+                               $Request->differentiator        = 
$arguments['differentiator'];
+
+                               $sendMTMessage = new sendMTMessage();
+                               $sendMTMessage->mtreq = $Request;
+                               
+                               $sendMTMessageResponse = 
$service->sendMTMessage($sendMTMessage);
+                               
+                               $result['statuscode'] = 
$sendMTMessageResponse->sendMTMessageReturn->statuscode;
+                               $result['messageid'] = 
$sendMTMessageResponse->sendMTMessageReturn->messageid;
+                       }
+
+                   // p_status :
+                   // 0 = pending
+                   // 1 = delivered
+                   // 2 = failed
+
+                       if($result['statuscode'] == 1)
+                       {
+                           $this->setsmsdeliverystatus($smslog_id,$uid,1);     
                
+                       }
+                       else if($result['statuscode'] == 5)
+                       {
+                           $this->setsmsdeliverystatus($smslog_id,$uid,2);     
                
+                       }
+
+                       if($result['statuscode'] == 1)
+                       {
+                               return true;
+                       }
+               }
+
+               function 
gw_set_delivery_status($gp_code="",$uid="",$smslog_id="",$p_datetime="",$p_update="")
+               {
+return;
+                   // p_status :
+                   // 0 = pending
+                   // 1 = delivered
+                   // 2 = failed
+
+                       if($result['statuscode'] == 1)
+                       {
+                           $this->setsmsdeliverystatus($smslog_id,$uid,1);     
                
+                       }
+                       else if($result['statuscode'] == 5)
+                       {
+                           $this->setsmsdeliverystatus($smslog_id,$uid,2);     
                
+                       }
+
+                   return;
+               }
+
+
+               function check_for_new_mail()
+               {
+                       if(!isset($this->carrot_param['email_user']) || ! 
$this->carrot_param['email_user'])
+                       {
+                           throw new Exception('Email user not defined');      
                
+                       }
+
+                       $account_id = 
$GLOBALS['phpgw']->accounts->name2id($this->carrot_param['email_user']);
+
+                       $GLOBALS['phpgw_info']['user']['account_id'] = 
$account_id;
+                       $GLOBALS['phpgw']->preferences->account_id = 
$account_id;
+                       $pref = $GLOBALS['phpgw']->preferences->read();
+                       
$GLOBALS['phpgw_info']['user']['preferences']['felamimail'] = 
isset($pref['felamimail']) ? $pref['felamimail'] : '';
+
+                       $boPreferences  = 
CreateObject('felamimail.bopreferences');
+                       $boPreferences->setProfileActive(true,2); //2 for 
selected user
+                       $bofelamimail   = 
CreateObject('felamimail.bofelamimail');
+
+                       $connectionStatus = $bofelamimail->openConnection();
+                       $headers = $bofelamimail->getHeaders('INBOX', 1, 
$maxMessages = 15, $sort = 0, $_reverse = 1, $_filter = array('string' => '', 
'type' => 'quick', 'status' => 'unseen'));
+
+                       $sms = array();
+                       $j = 0;
+                       if (isset($headers['header']) && 
is_array($headers['header']))
+                       {
+                               foreach ($headers['header'] as $header)
+                               {
+                                       if(!$header['seen'])
+                                       {
+                                               $sms[$j]['uid'] = 
$header['uid'];
+                                               $sms[$j]['message'] = 
utf8_encode($header['subject']);
+                                               $bodyParts = 
$bofelamimail->getMessageBody($header['uid']);
+                                               $sms[$j]['message'] .= "\n";
+                                               for($i=0; $i<count($bodyParts); 
$i++ )
+                                               {
+                                                       $sms[$j]['message'] .= 
utf8_encode($bodyParts[$i]['body']) . "\n";
+                                               }
+
+                                               $sms[$j]['message'] = 
substr($sms[$j]['message'],0,160);
+                                               $j++;
+                                       }
+                               }
+                       }
+
+                       foreach($sms as $entry)
+                       {
+                               $sms_datetime   = $entry[''];
+                               $sms_sender             = $entry[''];
+                               $target_code    = $entry[''];
+                               $message                = $entry['message'];
+                               
+                               if 
(!parent::setsmsincomingaction($sms_datetime,$sms_sender,$target_code,$message))
+                               {
+                                       $bofelamimail->flagMessages($_flag = 
'unread', array($entry['uid']));
+                               }                       
+                       }
+
+                       if($connectionStatus == 'true')
+                       {
+                               $bofelamimail->closeConnection();
+                       }
+               }
+
+
+               function gw_set_incoming_action()
+               {
+                       $this->check_for_new_mail();
+                       
+return;
+                   $handle = @opendir($this->carrot_param[path] . 
"/cache/smsd");
+                   while ($sms_in_file = @readdir($handle))
+                   {
+                               if (preg_match("/^ERR.in/i",$sms_in_file) && 
!preg_match("/^[.]/",$sms_in_file))
+                               {
+                                   $fn = $this->carrot_param[path] . 
"/cache/smsd/$sms_in_file";
+                                   $tobe_deleted = $fn;
+                                   $lines = @file ($fn);
+                                   $sms_datetime = trim($lines[0]);
+                                   $sms_sender = trim($lines[1]);
+                                   $message = "";
+                                   for ($lc=2;$lc<count($lines);$lc++)
+                                   {
+                                       $message .= trim($lines[$lc]);
+                                   }
+                                   $array_target_code = explode(" ",$message);
+                                   $target_code = 
strtoupper(trim($array_target_code[0]));
+                                   $message = $array_target_code[1];
+                                   for ($i=2;$i<count($array_target_code);$i++)
+                                   {
+                                               $message .= " 
".$array_target_code[$i];
+                                   }
+                                   // collected:
+                                   // $sms_datetime, $sms_sender, 
$target_code, $message
+                                   if 
($this->setsmsincomingaction($sms_datetime,$sms_sender,$target_code,$message))
+                                   {
+                                               @unlink($tobe_deleted);
+                                   }
+                               }
+                   }
+               }
+       }


Property changes on: 
people/sigurdne/modules/sms/trunk/inc/plugin/gateway/carrot/fn.php
___________________________________________________________________
Added: svn:keywords
   + Id Revision
Added: svn:eol-style
   + native

Modified: people/sigurdne/modules/sms/trunk/index.php
===================================================================
--- people/sigurdne/modules/sms/trunk/index.php 2009-11-20 10:29:14 UTC (rev 
20849)
+++ people/sigurdne/modules/sms/trunk/index.php 2009-11-20 10:29:19 UTC (rev 
20850)
@@ -21,8 +21,8 @@
        $currentapp='sms';
 
        $GLOBALS['phpgw_info']['flags'] = array(
-               'noheader'   => True,
-               'nonavbar'   => True,
+               'noheader'   => true,
+               'nonavbar'   => true,
                'currentapp'    => $currentapp
                );
 

Modified: people/sigurdne/modules/sms/trunk/init.php
===================================================================
--- people/sigurdne/modules/sms/trunk/init.php  2009-11-20 10:29:14 UTC (rev 
20849)
+++ people/sigurdne/modules/sms/trunk/init.php  2009-11-20 10:29:19 UTC (rev 
20850)
@@ -5,13 +5,14 @@
 
        $GLOBALS['phpgw_info']['flags'] = array(
                'currentapp' => 'login',
-               'noapi'      => True            // this stops header.inc.php to 
include phpgwapi/inc/function.inc.php
+               'noapi'      => true            // this stops header.inc.php to 
include phpgwapi/inc/function.inc.php
        );
        include($path_to_phpgroupware.'/header.inc.php');
        unset($GLOBALS['phpgw_info']['flags']['noapi']);
        $db_type = $GLOBALS['phpgw_domain'][$_GET['domain']]['db_type'];
        $GLOBALS['phpgw_info']['server']['sessions_type'] = 'db';
        include(PHPGW_API_INC.'/functions.inc.php');
+       $GLOBALS['phpgw_info']['user']['domain'] = $_GET['domain'];
        
        // more configuration
        $apps_config['multilogin']      = 1; // 0 for single session login; 1 
for multi session login

Modified: people/sigurdne/modules/sms/trunk/setup/default_records.inc.php
===================================================================
--- people/sigurdne/modules/sms/trunk/setup/default_records.inc.php     
2009-11-20 10:29:14 UTC (rev 20849)
+++ people/sigurdne/modules/sms/trunk/setup/default_records.inc.php     
2009-11-20 10:29:19 UTC (rev 20850)
@@ -18,16 +18,22 @@
         */
 
 
-       $GLOBALS['phpgw_setup']->oProc->query("DELETE from phpgw_acl_location 
WHERE appname ='sms'");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_acl_location 
(appname,id, descr) VALUES ('sms', '.', 'Top')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_acl_location 
(appname,id, descr, allow_grant) VALUES ('sms', '.inbox', 'InBox',1)");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_acl_location 
(appname,id, descr, allow_grant) VALUES ('sms', '.outbox', 'OutBox',1)");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_acl_location 
(appname,id, descr) VALUES ('sms', '.autoreply', 'Autoreply')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_acl_location 
(appname,id, descr) VALUES ('sms', '.board', 'Board')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_acl_location 
(appname,id, descr) VALUES ('sms', '.command', 'Command')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_acl_location 
(appname,id, descr) VALUES ('sms', '.custom', 'Custom')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_acl_location 
(appname,id, descr) VALUES ('sms', '.poll', 'Poll')");
+       //$app_id = $GLOBALS['phpgw']->applications->name2id('sms');
+       $GLOBALS['phpgw_setup']->oProc->query("SELECT app_id FROM 
phpgw_applications WHERE app_name = 'sms'");
+       $GLOBALS['phpgw_setup']->oProc->next_record();
+       $app_id = $GLOBALS['phpgw_setup']->oProc->f('app_id');
 
+
+       $GLOBALS['phpgw_setup']->oProc->query("DELETE FROM phpgw_locations 
where app_id = {$app_id} AND name != 'run'");
+       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_locations 
(app_id, name, descr) VALUES ({$app_id}, '.', 'Top')");
+       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_locations 
(app_id, name, descr, allow_grant) VALUES ({$app_id}, '.inbox', 'InBox',1)");
+       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_locations 
(app_id, name, descr, allow_grant) VALUES ({$app_id}, '.outbox', 'OutBox',1)");
+       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_locations 
(app_id, name, descr) VALUES ({$app_id}, '.autoreply', 'Autoreply')");
+       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_locations 
(app_id, name, descr) VALUES ({$app_id}, '.board', 'Board')");
+       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_locations 
(app_id, name, descr) VALUES ({$app_id}, '.command', 'Command')");
+       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_locations 
(app_id, name, descr) VALUES ({$app_id}, '.custom', 'Custom')");
+       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_locations 
(app_id, name, descr) VALUES ({$app_id}, '.poll', 'Poll')");
+
 // -- start config
 
        $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_config_type (id,name, descr) VALUES ('1', 'common', 'common config 
values')");
@@ -35,6 +41,7 @@
        $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_config_type (id,name, descr) VALUES ('3', 'clickatell', 'The 
clickatell Gateway')");
        $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_config_type (id,name, descr) VALUES ('4', 'uplink', 'The Uplink 
Gateway')");
        $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_config_type (id,name, descr) VALUES ('5', 'kannel', 'The Kannel 
Gateway')");
+       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_config_type (id,name, descr) VALUES ('6', 'carrot', 'The Carrot 
Gateway')");
        
        $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_config_attrib (type_id,id,input_type,name, descr) VALUES ('1', 
'1','listbox', 'gateway_module', 'Active gateway module')");
        $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_config_attrib (type_id,id,input_type,name, descr) VALUES ('1', '2', 
'text', 'gateway_number', 'Gateway number')");
@@ -62,10 +69,27 @@
        $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_config_attrib (type_id,id,input_type,name, descr) VALUES (5, 6, 
'text', 'phpgwsms_web', 'phpgwsms Web URL')");
        $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_config_attrib (type_id,id,input_type,name, descr) VALUES (5, 7, 
'text', 'incoming_path', 'Kannel incoming path')");
 
+       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_config_attrib (type_id,id,input_type,name, descr) VALUES (6, 1, 
'text', 'wsdl', 'Carrot wsdl')");
+       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_config_attrib (type_id,id,input_type,name, descr) VALUES (6, 2, 
'text', 'send_url', 'send url using GET')");
+       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_config_attrib (type_id,id,input_type,name, descr) VALUES (6, 3, 
'text', 'service_url', 'service_url using SOAP')");
+       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_config_attrib (type_id,id,input_type,name, descr) VALUES (6, 4, 
'text', 'login', 'Carrot login')");
+       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_config_attrib (type_id,id,input_type,name, descr) VALUES (6, 5, 
'password', 'password', 'Carrot password')");
+       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_config_attrib (type_id,id,input_type,name, descr) VALUES (6, 6, 
'text', 'proxy_host', 'proxy_host')");
+       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_config_attrib (type_id,id,input_type,name, descr) VALUES (6, 7, 
'text', 'proxy_port', 'proxy_port')");
+       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_config_attrib (type_id,id,input_type,name, descr) VALUES (6, 8, 
'text', 'originator', 'originator')");
+       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_config_attrib (type_id,id,input_type,name, descr) VALUES (6, 9, 
'text', 'originatortype', 'originatortype')");
+       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_config_attrib (type_id,id,input_type,name, descr) VALUES (6, 10, 
'text', 'serviceid', 'serviceid')");
+       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_config_attrib (type_id,id,input_type,name, descr) VALUES (6, 11, 
'text', 'differentiator', 'differentiator')");
+       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_config_attrib (type_id,id,input_type,name, descr) VALUES (6, 12, 
'listbox', 'type', 'Send type')");
+
+
        $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_config_choice (type_id,attrib_id,id,value) VALUES (1, 1, 1, 
'gnokii')");
        $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_config_choice (type_id,attrib_id,id,value) VALUES (1, 1, 2, 
'clickatell')");
        $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_config_choice (type_id,attrib_id,id,value) VALUES (1, 1, 3, 
'uplink')");
        $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_config_choice (type_id,attrib_id,id,value) VALUES (1, 1, 4, 
'kannel')");
+       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_config_choice (type_id,attrib_id,id,value) VALUES (1, 1, 5, 
'Carrot')");
+       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_config_choice (type_id,attrib_id,id,value) VALUES (6, 12, 1, 'GET')");
+       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_config_choice (type_id,attrib_id,id,value) VALUES (6, 12, 2, 
'SOAP')");
        
        $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_config_value (type_id,attrib_id,id,value) VALUES (1, 1, 1, 
'gnokii')");
        $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_config_value (type_id,attrib_id,id,value) VALUES (1, 2, 1, 
'99999999')");
@@ -103,7 +127,7 @@
        $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_featautoreply_scenario 
(autoreply_id,autoreply_scenario_param1,autoreply_scenario_param2,autoreply_scenario_param3,autoreply_scenario_param4,autoreply_scenario_param5,autoreply_scenario_param6,autoreply_scenario_param7,autoreply_scenario_result)
 VALUES (1,'WEBMAIL','PASSWORD','ERROR','','','','','Please use forgot password 
link, and follow given instructions')");
 
        $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_sms_featboard 
(uid,board_code,board_forward_email,board_pref_template) VALUES 
(1,'PHP','address@hidden','<font color=black 
size=-1><b>##SENDER##</b></font><br><font color=black 
size=-2><i>##DATETIME##</i></font><br><font color=black 
size=-1>##MESSAGE##</font>')");
-       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_featcommand (uid,command_code,command_exec) VALUES 
(1,'UPTIME','/home/playsms/public_html/phpgroupware/sms/bin/uptime.sh 
##SMSSENDER##')");
+//     $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_featcommand (uid,command_code,command_exec) VALUES 
(1,'UPTIME','/home/playsms/public_html/phpgroupware/sms/bin/uptime.sh 
##SMSSENDER##')");
 
        $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_sms_featcustom 
(uid,custom_code,custom_url) VALUES 
(1,'CURR','http://www.ngoprek.org/currency.php?toeuro=##CUSTOMPARAM##&sender=##SMSSENDER##')");
 

Modified: people/sigurdne/modules/sms/trunk/setup/setup.inc.php
===================================================================
--- people/sigurdne/modules/sms/trunk/setup/setup.inc.php       2009-11-20 
10:29:14 UTC (rev 20849)
+++ people/sigurdne/modules/sms/trunk/setup/setup.inc.php       2009-11-20 
10:29:19 UTC (rev 20850)
@@ -10,14 +10,13 @@
        */
 
        $setup_info['sms']['name']      = 'sms';
-       $setup_info['sms']['title']= 'SMS';
-       $setup_info['sms']['version']   = '0.9.17.506';
+       $setup_info['sms']['version']   = '0.9.17.508';
        $setup_info['sms']['app_order'] = 8;
        $setup_info['sms']['enable']    = 1;
        $setup_info['sms']['app_group'] = 'office';
        $setup_info['sms']['description'] = 'sms gateway';
 
-       $setup_info['sms']['author'][] = array
+       $setup_info['sms']['author'] = array
        (
                'name'  => 'Sigurd Nes',
                'email' => 'address@hidden'

Modified: people/sigurdne/modules/sms/trunk/setup/tables_current.inc.php
===================================================================
--- people/sigurdne/modules/sms/trunk/setup/tables_current.inc.php      
2009-11-20 10:29:14 UTC (rev 20849)
+++ people/sigurdne/modules/sms/trunk/setup/tables_current.inc.php      
2009-11-20 10:29:19 UTC (rev 20850)
@@ -43,12 +43,12 @@
                                'autoreply_scenario_id' => array('type' => 
'auto','nullable' => False),
                                'autoreply_id' => array('type' => 'int', 
'precision' => 4,'nullable' => False,'default' => '0'),
                                'autoreply_scenario_param1' => array('type' => 
'varchar', 'precision' => 20,'nullable' => False),
-                               'autoreply_scenario_param2' => array('type' => 
'varchar', 'precision' => 20,'nullable' => False),
-                               'autoreply_scenario_param3' => array('type' => 
'varchar', 'precision' => 20,'nullable' => False),
-                               'autoreply_scenario_param4' => array('type' => 
'varchar', 'precision' => 20,'nullable' => False),
-                               'autoreply_scenario_param5' => array('type' => 
'varchar', 'precision' => 20,'nullable' => False),
-                               'autoreply_scenario_param6' => array('type' => 
'varchar', 'precision' => 20,'nullable' => False),
-                               'autoreply_scenario_param7' => array('type' => 
'varchar', 'precision' => 20,'nullable' => False),
+                               'autoreply_scenario_param2' => array('type' => 
'varchar', 'precision' => 20,'nullable' => true),
+                               'autoreply_scenario_param3' => array('type' => 
'varchar', 'precision' => 20,'nullable' => true),
+                               'autoreply_scenario_param4' => array('type' => 
'varchar', 'precision' => 20,'nullable' => true),
+                               'autoreply_scenario_param5' => array('type' => 
'varchar', 'precision' => 20,'nullable' => true),
+                               'autoreply_scenario_param6' => array('type' => 
'varchar', 'precision' => 20,'nullable' => true),
+                               'autoreply_scenario_param7' => array('type' => 
'varchar', 'precision' => 20,'nullable' => true),
                                'autoreply_scenario_result' => array('type' => 
'varchar', 'precision' => 130,'nullable' => False)
                        ),
                        'pk' => array('autoreply_scenario_id'),
@@ -313,9 +313,9 @@
                                'flag_deleted' => array('type' => 'int', 
'precision' => 2,'nullable' => False,'default' => '0'),
                                'uid' => array('type' => 'int', 'precision' => 
4,'nullable' => False,'default' => '0'),
                                'p_gateway' => array('type' => 'varchar', 
'precision' => 100,'nullable' => False),
-                               'p_src' => array('type' => 'varchar', 
'precision' => 100,'nullable' => False),
+                               'p_src' => array('type' => 'varchar', 
'precision' => 100,'nullable' => true),
                                'p_dst' => array('type' => 'varchar', 
'precision' => 100,'nullable' => False),
-                               'p_footer' => array('type' => 'varchar', 
'precision' => 11,'nullable' => False),
+                               'p_footer' => array('type' => 'varchar', 
'precision' => 11,'nullable' => true),
                                'p_msg' => array('type' => 'varchar', 
'precision' => 250,'nullable' => False),
                                'p_datetime' => array('type' => 
'timestamp','nullable' => False,'default' => 'current_timestamp'),
                                'p_update' => array('type' => 'timestamp', 
'precision' => 20,'nullable' => true),

Modified: people/sigurdne/modules/sms/trunk/setup/tables_update.inc.php
===================================================================
--- people/sigurdne/modules/sms/trunk/setup/tables_update.inc.php       
2009-11-20 10:29:14 UTC (rev 20849)
+++ people/sigurdne/modules/sms/trunk/setup/tables_update.inc.php       
2009-11-20 10:29:19 UTC (rev 20850)
@@ -208,3 +208,61 @@
                $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit();
                return $GLOBALS['setup_info']['sms']['currentver'];
        }
+       
+       /**
+       * Update property version from 0.9.17.506 to 0.9.17.507
+       */
+
+       $test[] = '0.9.17.506';
+       function sms_upgrade0_9_17_506()
+       {
+               $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+               
$GLOBALS['phpgw_setup']->oProc->AlterColumn('phpgw_sms_featautoreply_scenario','autoreply_scenario_param2',array('type'
 => 'varchar', 'precision' => 20,'nullable' => true));
+               
$GLOBALS['phpgw_setup']->oProc->AlterColumn('phpgw_sms_featautoreply_scenario','autoreply_scenario_param3',array('type'
 => 'varchar', 'precision' => 20,'nullable' => true));
+               
$GLOBALS['phpgw_setup']->oProc->AlterColumn('phpgw_sms_featautoreply_scenario','autoreply_scenario_param4',array('type'
 => 'varchar', 'precision' => 20,'nullable' => true));
+               
$GLOBALS['phpgw_setup']->oProc->AlterColumn('phpgw_sms_featautoreply_scenario','autoreply_scenario_param5',array('type'
 => 'varchar', 'precision' => 20,'nullable' => true));
+               
$GLOBALS['phpgw_setup']->oProc->AlterColumn('phpgw_sms_featautoreply_scenario','autoreply_scenario_param6',array('type'
 => 'varchar', 'precision' => 20,'nullable' => true));
+               
$GLOBALS['phpgw_setup']->oProc->AlterColumn('phpgw_sms_featautoreply_scenario','autoreply_scenario_param7',array('type'
 => 'varchar', 'precision' => 20,'nullable' => true));
+
+               
$GLOBALS['phpgw_setup']->oProc->AlterColumn('phpgw_sms_tblsmsoutgoing','p_src',array('type'
 => 'varchar', 'precision' => 100,'nullable' => true));
+               
$GLOBALS['phpgw_setup']->oProc->AlterColumn('phpgw_sms_tblsmsoutgoing','p_footer',array('type'
 => 'varchar', 'precision' => 11,'nullable' => true));
+
+               if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+               {
+                       $GLOBALS['setup_info']['sms']['currentver'] = 
'0.9.17.507';
+                       return $GLOBALS['setup_info']['sms']['currentver'];
+               }
+       }
+
+       /**
+       * Update property version from 0.9.17.507 to 0.9.17.508
+       */
+
+       $test[] = '0.9.17.507';
+       function sms_upgrade0_9_17_507()
+       {
+               $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+
+               $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_config_attrib (type_id,id,input_type,name, descr) VALUES (6, 1, 
'text', 'wsdl', 'Carrot wsdl')");
+               $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_config_attrib (type_id,id,input_type,name, descr) VALUES (6, 2, 
'text', 'send_url', 'send url using GET')");
+               $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_config_attrib (type_id,id,input_type,name, descr) VALUES (6, 3, 
'text', 'service_url', 'service_url using SOAP')");
+               $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_config_attrib (type_id,id,input_type,name, descr) VALUES (6, 4, 
'text', 'login', 'Carrot login')");
+               $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_config_attrib (type_id,id,input_type,name, descr) VALUES (6, 5, 
'password', 'password', 'Carrot password')");
+               $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_config_attrib (type_id,id,input_type,name, descr) VALUES (6, 6, 
'text', 'proxy_host', 'proxy_host')");
+               $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_config_attrib (type_id,id,input_type,name, descr) VALUES (6, 7, 
'text', 'proxy_port', 'proxy_port')");
+               $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_config_attrib (type_id,id,input_type,name, descr) VALUES (6, 8, 
'text', 'originator', 'originator')");
+               $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_config_attrib (type_id,id,input_type,name, descr) VALUES (6, 9, 
'text', 'originatortype', 'originatortype')");
+               $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_config_attrib (type_id,id,input_type,name, descr) VALUES (6, 10, 
'text', 'serviceid', 'serviceid')");
+               $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_config_attrib (type_id,id,input_type,name, descr) VALUES (6, 11, 
'text', 'differentiator', 'differentiator')");
+               $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_config_attrib (type_id,id,input_type,name, descr) VALUES (6, 12, 
'listbox', 'type', 'Send type')");
+
+               $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_config_choice (type_id,attrib_id,id,value) VALUES (6, 12, 1, 'GET')");
+               $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
phpgw_sms_config_choice (type_id,attrib_id,id,value) VALUES (6, 12, 2, 
'SOAP')");
+
+               if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+               {
+                       $GLOBALS['setup_info']['sms']['currentver'] = 
'0.9.17.507';
+                       return $GLOBALS['setup_info']['sms']['currentver'];
+               }
+       }
+





reply via email to

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