phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] sms inc/class.bosms.inc.php inc/class.sms.inc.p...


From: Sigurd Nes
Subject: [Phpgroupware-cvs] sms inc/class.bosms.inc.php inc/class.sms.inc.p...
Date: Thu, 18 May 2006 09:48:38 +0000

CVSROOT:        /sources/phpgroupware
Module name:    sms
Branch:         
Changes by:     Sigurd Nes <address@hidden>     06/05/18 09:48:38

Modified files:
        inc            : class.bosms.inc.php class.sms.inc.php 
                         class.sosms.inc.php class.uisms.inc.php 
        setup          : default_records.inc.php 
        templates/base : sms.xsl 

Log message:
        

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/sms/inc/class.bosms.inc.php.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/sms/inc/class.sms.inc.php.diff?tr1=1.4&tr2=1.5&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/sms/inc/class.sosms.inc.php.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/sms/inc/class.uisms.inc.php.diff?tr1=1.5&tr2=1.6&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/sms/setup/default_records.inc.php.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/sms/templates/base/sms.xsl.diff?tr1=1.2&tr2=1.3&r1=text&r2=text

Patches:
Index: sms/inc/class.bosms.inc.php
diff -u sms/inc/class.bosms.inc.php:1.3 sms/inc/class.bosms.inc.php:1.4
--- sms/inc/class.bosms.inc.php:1.3     Wed May 17 20:23:25 2006
+++ sms/inc/class.bosms.inc.php Thu May 18 09:48:38 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package hrm
        * @subpackage place
-       * @version $Id: class.bosms.inc.php,v 1.3 2006/05/17 20:23:25 sigurdne 
Exp $
+       * @version $Id: class.bosms.inc.php,v 1.4 2006/05/18 09:48:38 sigurdne 
Exp $
        */
 
        /**
@@ -39,6 +39,7 @@
                {
                        $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->sms              = 
CreateObject($this->currentapp.'.sms');
+                       $this->so               = 
CreateObject($this->currentapp.'.sosms');
        //              $this->bocommon         = 
CreateObject($this->currentapp.'.bocommon');
 
                        $this->account          = 
$GLOBALS['phpgw_info']['user']['account_id'];
@@ -114,12 +115,12 @@
                }
 
 
-               function read()
+               function read_outbox()
                {
-                       $place_info = $this->so->read(array('start' => 
$this->start,'query' => $this->query,'sort' => $this->sort,'order' => 
$this->order,
+                       $outbox = $this->so->read_outbox(array('start' => 
$this->start,'query' => $this->query,'sort' => $this->sort,'order' => 
$this->order,
                                                                                
        'allrows'=>$this->allrows));
                        $this->total_records = $this->so->total_records;
-                       return $place_info;
+                       return $outbox;
                }
 
                function read_single($id)
@@ -137,7 +138,6 @@
 
                function send_sms($values)
                {
-
                        $username = 
$GLOBALS['phpgw']->accounts->id2name($this->account);
                        
                        $p_num = $values['p_num'];
@@ -180,9 +180,9 @@
                        return $receipt;
                }
 
-               function delete($id)
+               function delete_out($id)
                {
-                       $this->so->delete($id);
+                       $this->so->delete_out($id);
                }
 
                function select_category_list($format='',$selected='')
Index: sms/inc/class.sms.inc.php
diff -u sms/inc/class.sms.inc.php:1.4 sms/inc/class.sms.inc.php:1.5
--- sms/inc/class.sms.inc.php:1.4       Wed May 17 20:23:25 2006
+++ sms/inc/class.sms.inc.php   Thu May 18 09:48:38 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package sms
        * @subpackage sms
-       * @version $Id: class.sms.inc.php,v 1.4 2006/05/17 20:23:25 sigurdne 
Exp $
+       * @version $Id: class.sms.inc.php,v 1.5 2006/05/18 09:48:38 sigurdne 
Exp $
        */
 
        /**
@@ -321,7 +321,7 @@
        */
        //              $sender = $GLOBALS['phpgw_info']['user']['fullname'];
                        
-                       $sender = ' -' . 
$GLOBALS['phpgw_info']['user']['account_lid'];
+                       $sender = ' - ' . 
$GLOBALS['phpgw_info']['user']['account_lid'];
                        return $sender;
                }
                
@@ -546,6 +546,8 @@
                        {
                        $c_sms_to = str_replace("\'","",$array_sms_to[$i]);
                        $c_sms_to = str_replace("\"","",$array_sms_to[$i]);
+                       $message = $this->db->db_addslashes($message);
+                       
                        $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')";
Index: sms/inc/class.sosms.inc.php
diff -u sms/inc/class.sosms.inc.php:1.1 sms/inc/class.sosms.inc.php:1.2
--- sms/inc/class.sosms.inc.php:1.1     Wed May 17 20:23:25 2006
+++ sms/inc/class.sosms.inc.php Thu May 18 09:48:38 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package hrm
        * @subpackage place
-       * @version $Id: class.sosms.inc.php,v 1.1 2006/05/17 20:23:25 sigurdne 
Exp $
+       * @version $Id: class.sosms.inc.php,v 1.2 2006/05/18 09:48:38 sigurdne 
Exp $
        */
 
        /**
@@ -28,16 +28,16 @@
                        $this->currentapp       = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        $this->account          = 
$GLOBALS['phpgw_info']['user']['account_id'];
                        $this->bocommon = 
CreateObject($this->currentapp.'.bocommon');
-                       $this->db               = $GLOBALS['phpgw']->db;
+                       $this->db               = clone($GLOBALS['phpgw']->db);
                        $this->db2              = clone($this->db);
 
-                       $this->grants   = 
$GLOBALS['phpgw']->acl->get_grants('hrm');
-                       $this->left_join                = 
$this->bocommon->left_join;
-                       $this->join                     = $this->bocommon->join;
-                       $this->like                     = $this->bocommon->like;
+                       $this->grants           = 
$GLOBALS['phpgw']->acl->get_grants('sms');
+                       $this->left_join        = $this->db->left_join;
+                       $this->join             = $this->db->join;
+                       $this->like             = $this->db->like;
                }
 
-               function read($data)
+               function read_outbox($data)
                {
                        if(is_array($data))
                        {
@@ -57,25 +57,42 @@
 
                        if ($order)
                        {
-                               $ordermethod = " order by $order $sort";
+                               $ordermethod = " ORDER BY $order $sort";
 
                        }
                        else
                        {
-                               $ordermethod = ' order by name asc';
+                               $ordermethod = ' ORDER BY smslog_id DESC';
                        }
 
-                       $table = 'phpgw_hrm_training_place';
+                       $table = 'phpgw_sms_tblsmsoutgoing';
+
+
+                       $where= 'WHERE';
+                       
+                       if (is_array($this->grants))
+                       {
+                               while (list($user) = each($this->grants))
+                               {
+                                       $public_user_list[] = $user;
+                               }
+                               reset($public_user_list);
+                               $filtermethod .= " $where ( $table.uid IN(" . 
implode(',',$public_user_list) . "))";
+
+                               $where= 'AND';
+                       }
+
+
 
                        if($query)
                        {
                                $query = ereg_replace("'",'',$query);
                                $query = ereg_replace('"','',$query);
 
-                               $querymethod = " WHERE name $this->like 
'%$query%'";
+                               $querymethod = " AND p_dst $this->like 
'%$query%'";
                        }
 
-                       $sql = "SELECT * FROM $table $querymethod";
+                       $sql = "SELECT * FROM $table $filtermethod AND 
flag_deleted='0' $querymethod";
 
                        $this->db2->query($sql,__LINE__,__FILE__);
                        $this->total_records = $this->db2->num_rows();
@@ -89,17 +106,30 @@
                                $this->db->query($sql . 
$ordermethod,__LINE__,__FILE__);
                        }
 
+                       
+                       $status_array = array(
+                                       0 => lang('pending'),
+                                       1 => lang('sent'),
+                                       2 => lang('failed'),
+                                       3 => lang('delivered')
+                                       );
+
                        while ($this->db->next_record())
                        {
-                               $place_info[] = array
+                               $outbox[] = array
                                (
-                                       'id'    => $this->db->f('id'),
-                                       'name'  => 
stripslashes($this->db->f('name')),
-                                       'descr' => 
stripslashes($this->db->f('descr'))
+                                       'id'            => 
$this->db->f('smslog_id'),
+                                       'p_dst'         => 
stripslashes($this->db->f('p_dst')),
+                                       'user'          => 
$GLOBALS['phpgw']->accounts->id2name($this->db->f('uid')),
+                                       'dst_group'     => 
$GLOBALS['phpgw']->accounts->id2name($this->db->f('p_gpid')),
+                                       'entry_time'    => 
$this->db->f('p_datetime'),
+                                       'message'       => 
stripslashes($this->db->f('p_msg')),
+                                       'status'        => 
$status_array[$this->db->f('p_status')],
+                                       'grants'        => 
(int)$this->grants[$this->db->f('uid')]
                                );
-                       }
 
-                       return $place_info;
+                       }
+                       return $outbox;
                }
 
 
@@ -187,7 +217,6 @@
 
                        $value_set      = 
$this->bocommon->validate_db_update($value_set);
 
-
                        $this->db->query("UPDATE phpgw_hrm_training_place set 
$value_set WHERE id=" . $values['place_id'],__LINE__,__FILE__);
 
                        $this->db->transaction_commit();
@@ -198,10 +227,9 @@
                        return $receipt;
                }
 
-               function delete($id)
+               function delete_out($id)
                {
-
-                       $this->db->query('DELETE FROM phpgw_hrm_training_place 
WHERE id='  . intval($id),__LINE__,__FILE__);
+                       $this->db->query("UPDATE phpgw_sms_tblsmsoutgoing SET 
flag_deleted='1' WHERE smslog_id="  . intval($id),__LINE__,__FILE__);
                }
 
                function select_place_list()
Index: sms/inc/class.uisms.inc.php
diff -u sms/inc/class.uisms.inc.php:1.5 sms/inc/class.uisms.inc.php:1.6
--- sms/inc/class.uisms.inc.php:1.5     Wed May 17 20:23:25 2006
+++ sms/inc/class.uisms.inc.php Thu May 18 09:48:38 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package sms
        * @subpackage sms
-       * @version $Id: class.uisms.inc.php,v 1.5 2006/05/17 20:23:25 sigurdne 
Exp $
+       * @version $Id: class.uisms.inc.php,v 1.6 2006/05/18 09:48:38 sigurdne 
Exp $
        */
 
        /**
@@ -32,7 +32,7 @@
                        'outbox'   => True,
                        'send'   => True,
                        'send_group'=> True,
-                       'delete' => True
+                       'delete_out' => True
                );
 
                function uisms()
@@ -140,10 +140,10 @@
                        (
                                'lang_send'                     => lang('Send 
text SMS'),
                                'lang_send_statustext'          => lang('send 
single'),
-                               'send_action'                   => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uisms.send'),
+                               'send_action'                   => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uisms.send&from=index'),
                                'lang_send_group'               => lang('Send 
broadcast SMS'),
                                'lang_send_group_statustext'    => lang('send 
group'),
-                               'send_group_action'             => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uisms.send_group'),
+                               'send_group_action'             => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uisms.send_group&from=index'),
                        );
 
                        $msgbox_data = $this->bocommon->msgbox_data($receipt);
@@ -190,23 +190,22 @@
                        $receipt = 
$GLOBALS['phpgw']->session->appsession('session_data','sms_send_receipt');
                        
$GLOBALS['phpgw']->session->appsession('session_data','sms_send_receipt','');
 
-       //              $sms_info = $this->bo->read();
+                       $sms_info = $this->bo->read_outbox();
 
                        while (is_array($sms_info) && list(,$entry) = 
each($sms_info))
                        {
-
                                $content[] = array
                                (
-                                       'name'                                  
=> $entry['name'],
-                                       'link_edit'                             
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uisms.edit&sms_id='
 . $entry['id']),
-                                       'link_delete'                           
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uisms.delete&sms_id='
 . $entry['id']),
-                                       'link_view'                             
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uisms.view&sms_id='
 . $entry['id']),
-                                       'lang_view_place_text'                  
=> lang('view the place'),
-                                       'lang_edit_place_text'                  
=> lang('edit the place'),
-                                       'text_view'                             
=> lang('view'),
-                                       'text_edit'                             
=> lang('edit'),
+                                       'id'                                    
=> $entry['id'],
+                                       'receiver'                              
=> $entry['p_dst'],
+                                       'user'                                  
=> $entry['user'],
+                                       'message'                               
=> $entry['message'],
+                                       'dst_group'                             
=> $entry['dst_group'],
+                                       'entry_time'                            
=> $entry['entry_time'],
+                                       'status'                                
=> $entry['status'],
+                                       'link_delete'                           
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uisms.delete_out&id='
 . $entry['id']),
                                        'text_delete'                           
=> lang('delete'),
-                                       'lang_delete_place_text'                
=> lang('delete the place'),
+                                       'lang_delete_sms_text'                  
=> lang('delete the sms from outbox'),
                                );
                        }
 
@@ -215,10 +214,10 @@
                        $table_header[] = array
                        (
 
-                               'sort_name'     => 
$this->nextmatchs->show_sort_order(array
+                               'sort_entry_time'       => 
$this->nextmatchs->show_sort_order(array
                                                                                
(
                                                                                
        'sort'  => $this->sort,
-                                                                               
        'var'   =>      'name',
+                                                                               
        'var'   =>      'p_datetime',
                                                                                
        'order' =>      $this->order,
                                                                                
        'extra'         => array('menuaction'   => 
$this->currentapp.'.uisms.outbox',
                                                                                
                                'query'         =>$this->query,
@@ -226,8 +225,13 @@
                                                                                
                                'allrows' => $this->allrows)
                                                                                
)),
                                'lang_delete'   => lang('delete'),
-                               'lang_edit'     => lang('edit'),
-                               'lang_view'     => lang('view'),
+                               'lang_id'       => lang('id'),
+                               'lang_user'     => lang('user'),
+                               'lang_group'    => lang('group'),
+                               'lang_entry_time'=> lang('time'),
+                               'lang_status'   => lang('status'),
+                               'lang_receiver' => lang('receiver'),
+                               'lang_message'  => lang('message'),
                        );
 
                        if(!$this->allrows)
@@ -253,10 +257,10 @@
                        (
                                'lang_send'                     => lang('Send 
text SMS'),
                                'lang_send_statustext'          => lang('send 
single'),
-                               'send_action'                   => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uisms.send'),
+                               'send_action'                   => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uisms.send&from=outbox'),
                                'lang_send_group'               => lang('Send 
broadcast SMS'),
                                'lang_send_group_statustext'    => lang('send 
group'),
-                               'send_group_action'             => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uisms.send_group'),
+                               'send_group_action'             => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uisms.send_group&from=outbox'),
                        );
 
                        $msgbox_data = $this->bocommon->msgbox_data($receipt);
@@ -269,24 +273,24 @@
                                'allrows'                                       
=> $this->allrows,
                                'start_record'                                  
=> $this->start,
                                'record_limit'                                  
=> $record_limit,
-                               'num_records'                                   
=> count($place_info),
+                               'num_records'                                   
=> count($sms_info),
                                'all_records'                                   
=> $this->bo->total_records,
-                               'link_url'                                      
        => $GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'img_path'                                      
        => $GLOBALS['phpgw']->common->get_image_path('phpgwapi','default'),
+                               'link_url'                                      
=> $GLOBALS['phpgw']->link('/index.php',$link_data),
+                               'img_path'                                      
=> $GLOBALS['phpgw']->common->get_image_path('phpgwapi','default'),
                                'lang_searchfield_statustext'   => lang('Enter 
the search string. To show all entries, empty this field and press the SUBMIT 
button again'),
                                'lang_searchbutton_statustext'  => lang('Submit 
the search string'),
-                               'query'                                         
        => $this->query,
+                               'query'                                         
=> $this->query,
                                'lang_search'                                   
=> lang('search'),
-                               'table_header'                                  
=> $table_header,
+                               'table_header_outbox'                           
        => $table_header,
                                'table_add'                                     
=> $table_add,
-                               'values'                                        
        => $content
+                               'values_outbox'                                 
=> $content
                        );
 
                        $appname                                        = 
lang('outbox');
                        $function_msg                                   = 
lang('list outbox');
 
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
-                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list' => $data));
+                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list_outbox' => $data));
                        $this->save_sessiondata();
 
 
@@ -294,8 +298,10 @@
 
                function send()
                {
-                       $values                         = 
get_var('values',array('POST'));
-                       
+                       $values         = get_var('values',array('POST'));
+                       $from           = get_var('from',array('POST','GET'));
+                       $from           = $from?$from:'index';
+
                        $GLOBALS['phpgw']->xslttpl->add_file(array('sms'));
 
                        $max_length = 160;
@@ -327,13 +333,13 @@
                                                if ($values['save'])
                                                {
                                                        
$GLOBALS['phpgw']->session->appsession('session_data','sms_send_receipt',$receipt);
-                                                       
$GLOBALS['phpgw']->redirect_link('/index.php','menuaction='.$this->currentapp.'.uisms.index&sms_id='
 . $sms_id);
+                                                       
$GLOBALS['phpgw']->redirect_link('/index.php','menuaction='.$this->currentapp.'.uisms.'
 . $from);
                                                }
                                        }
                                }
                                else
                                {
-                                       
$GLOBALS['phpgw']->redirect_link('/index.php','menuaction='.$this->currentapp.'.uisms.index');
+                                       
$GLOBALS['phpgw']->redirect_link('/index.php','menuaction='.$this->currentapp.'.uisms.'
 . $from);
                                }
                        }
 
@@ -356,7 +362,8 @@
                        $link_data = array
                        (
                                'menuaction'    => 
$this->currentapp.'.uisms.send',
-                               'sms_id'        => $sms_id
+                               'sms_id'        => $sms_id,
+                               'from'  => $from
                        );
 
                        $msgbox_data = $this->bocommon->msgbox_data($receipt);
@@ -434,6 +441,42 @@
                }
 
 
+               function delete_out()
+               {
+                       $id             = get_var('id',array('POST','GET'));
+                       $confirm        = get_var('confirm',array('POST'));
+
+                       $link_data = array
+                       (
+                               'menuaction' => 
$this->currentapp.'.uisms.outbox'
+                       );
+
+                       if (get_var('confirm',array('POST')))
+                       {
+                               $this->bo->delete_out($id);
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',$link_data);
+                       }
+
+                       
$GLOBALS['phpgw']->xslttpl->add_file(array('app_delete'));
+
+                       $data = array
+                       (
+                               'done_action'                   => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
+                               'delete_action'                 => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uisms.delete_out&id='
 . $id),
+                               'lang_confirm_msg'              => lang('do you 
really want to delete this entry'),
+                               'lang_yes'                      => lang('yes'),
+                               'lang_yes_statustext'           => lang('Delete 
the entry'),
+                               'lang_no_statustext'            => lang('Back 
to the list'),
+                               'lang_no'                       => lang('no')
+                       );
+
+                       $appname                                = 
lang('outbox');
+                       $function_msg                           = 
lang('delete');
+
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
+               }
+
 
 
        }
Index: sms/setup/default_records.inc.php
diff -u sms/setup/default_records.inc.php:1.2 
sms/setup/default_records.inc.php:1.3
--- sms/setup/default_records.inc.php:1.2       Tue May 16 19:45:49 2006
+++ sms/setup/default_records.inc.php   Thu May 18 09:48:38 2006
@@ -8,7 +8,7 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
        * @package sms
        * @subpackage setup
-       * @version $Id: default_records.inc.php,v 1.2 2006/05/16 19:45:49 
sigurdne Exp $
+       * @version $Id: default_records.inc.php,v 1.3 2006/05/18 09:48:38 
sigurdne Exp $
        */
 
 
@@ -61,8 +61,8 @@
 $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_sms_tblconfig_main 
(cfg_web_title, cfg_email_service, cfg_email_footer, cfg_gateway_module, 
cfg_gateway_number) VALUES ('PlaySMS MPS (Mobile Portal System)', 
'address@hidden', 'PlaySMS MPS (Mobile Portal System)', 'gnokii', '')");
 
 
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_sms_tblsmsoutgoing ( 
flag_deleted, uid, p_gateway, p_src, p_dst, p_footer, p_msg, p_datetime, 
p_update, p_status, p_gpid, p_credit, p_sms_type, unicode) VALUES ( 0, 1, 
'gnokii', '+628568809027', '+628562283138', ' - anton', 'Hi u there, good 
morning!!', '2004-12-12 2:39:13', '0000-00-00 00:00:00', 0, 0, 0, 'text', 0)");
-$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_sms_tblsmsoutgoing ( 
flag_deleted, uid, p_gateway, p_src, p_dst, p_footer, p_msg, p_datetime, 
p_update, p_status, p_gpid, p_credit, p_sms_type, unicode) VALUES ( 0, 1, 
'gnokii', '+628568809027', '+628562205510', ' - anton', 'Hi u there, good 
morning!!', '2004-12-12 2:39:13', '0000-00-00 00:00:00', 0, 0, 0, 'text', 0)");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_sms_tblsmsoutgoing ( 
flag_deleted, uid, p_gateway, p_src, p_dst, p_footer, p_msg, p_datetime, 
p_status, p_gpid, p_credit, p_sms_type, unicode) VALUES ( 0, 1, 'gnokii', 
'+628568809027', '+628562283138', ' - anton', 'Hi u there, good morning!!', 
'2004-12-12 2:39:13', 0, 0, 0, 'text', 0)");
+$GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_sms_tblsmsoutgoing ( 
flag_deleted, uid, p_gateway, p_src, p_dst, p_footer, p_msg, p_datetime, 
p_status, p_gpid, p_credit, p_sms_type, unicode) VALUES ( 0, 1, 'gnokii', 
'+628568809027', '+628562205510', ' - anton', 'Hi u there, good morning!!', 
'2004-12-12 2:39:13', 0, 0, 0, 'text', 0)");
 $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO phpgw_sms_tblsmsoutgoing ( 
flag_deleted, uid, p_gateway, p_src, p_dst, p_footer, p_msg, p_datetime, 
p_update, p_status, p_gpid, p_credit, p_sms_type, unicode) VALUES ( 0, 1, 
'uplink', '+628568809027', '+628568809027', '- anton', 'Hello my dear me, 
testing testing the message', '2004-12-12 2:54:12', '2004-12-12 2:55:11', 1, 0, 
0, 'text', 0)");
 
 
Index: sms/templates/base/sms.xsl
diff -u sms/templates/base/sms.xsl:1.2 sms/templates/base/sms.xsl:1.3
--- sms/templates/base/sms.xsl:1.2      Tue May 16 13:56:05 2006
+++ sms/templates/base/sms.xsl  Thu May 18 09:48:38 2006
@@ -1,4 +1,4 @@
-<!-- $Id: sms.xsl,v 1.2 2006/05/16 13:56:05 sigurdne Exp $ -->
+<!-- $Id: sms.xsl,v 1.3 2006/05/18 09:48:38 sigurdne Exp $ -->
 
        <xsl:template name="app_data">
                <xsl:choose>
@@ -8,6 +8,9 @@
                        <xsl:when test="edit">
                                <xsl:apply-templates select="send_group"/>
                        </xsl:when>
+                       <xsl:when test="list_outbox">
+                               <xsl:apply-templates select="list_outbox"/>
+                       </xsl:when>
                        <xsl:otherwise>
                                <xsl:apply-templates select="list"/>
                        </xsl:otherwise>
@@ -103,9 +106,118 @@
                        </tr>
        </xsl:template>
 
+       <xsl:template match="list_outbox">
+               
+               <xsl:call-template name="menu"/> 
+               <table width="100%" cellpadding="2" cellspacing="2" 
align="center">
+                       <xsl:choose>
+                               <xsl:when test="msgbox_data != ''">
+                                       <tr>
+                                               <td align="left" colspan="3">
+                                                       <xsl:call-template 
name="msgbox"/>
+                                               </td>
+                                       </tr>
+                               </xsl:when>
+                       </xsl:choose>
+                       <tr>
+                               <td align="right">
+                                       <xsl:call-template name="search_field"/>
+                               </td>
+                       </tr>
+                       <tr>
+                               <td colspan="3" width="100%">
+                                       <xsl:call-template name="nextmatchs"/>
+                                       <!--    <xsl:with-param 
name="nextmatchs_params"/>
+                                       </xsl:call-template> -->
+                               </td>
+                       </tr>
+               </table>
+               <table width="100%" cellpadding="2" cellspacing="2" 
align="center">
+                               <xsl:apply-templates 
select="table_header_outbox"/>
+                               <xsl:apply-templates select="values_outbox"/>
+                               <xsl:apply-templates select="table_add"/>
+               </table>
+       </xsl:template>
+
+       <xsl:template match="table_header_outbox">
+               <xsl:variable name="sort_entry_time"><xsl:value-of 
select="sort_entry_time"/></xsl:variable>
+               <tr class="th">
+                       <td class="th_text" width="1%" align="right">
+                               <xsl:value-of select="lang_id"/>
+                       </td>
+
+                       <td class="th_text" width="10%" align="center">
+                               <a href="{$sort_entry_time}"><xsl:value-of 
select="lang_entry_time"/></a>
+                       </td>
+
+                       <td class="th_text" width="5%" align="center">
+                               <xsl:value-of select="lang_receiver"/>
+                       </td>
+                       <td class="th_text" width="50%" align="center">
+                               <xsl:value-of select="lang_message"/>
+                       </td>
+
+                       <td class="th_text" width="5%" align="center">
+                               <xsl:value-of select="lang_status"/>
+                       </td>
+                       <td class="th_text" width="5%" align="center">
+                               <xsl:value-of select="lang_group"/>
+                       </td>
+                       <td class="th_text" width="5%" align="center">
+                               <xsl:value-of select="lang_delete"/>
+                       </td>
+               </tr>
+       </xsl:template>
+
+       <xsl:template match="values_outbox">
+               <xsl:variable name="lang_delete_sms_text"><xsl:value-of 
select="lang_delete_place_text"/></xsl:variable>
+
+                       <tr>
+                               <xsl:attribute name="class">
+                                       <xsl:choose>
+                                               <xsl:when test="@class">
+                                                       <xsl:value-of 
select="@class"/>
+                                               </xsl:when>
+                                               <xsl:when test="position() mod 
2 = 0">
+                                                       
<xsl:text>row_off</xsl:text>
+                                               </xsl:when>
+                                               <xsl:otherwise>
+                                                       
<xsl:text>row_on</xsl:text>
+                                               </xsl:otherwise>
+                                       </xsl:choose>
+                               </xsl:attribute>
+
+                               <td align="right">
+                                       <xsl:value-of select="id"/>
+                               </td>
+
+                               <td align="right">
+                                       <xsl:value-of select="entry_time"/>
+                               </td>
+                               <td align="right">
+                                       <xsl:value-of select="receiver"/>
+                               </td>
+                               <td align="left">
+                                       <xsl:value-of select="message"/>
+                               </td>
+                               <td align="right">
+                                       <xsl:value-of select="status"/>
+                               </td>
+                               <td align="right">
+                                       <xsl:value-of select="group"/>
+                               </td>
+
+                               <td align="center">
+                                       <xsl:variable 
name="link_delete"><xsl:value-of select="link_delete"/></xsl:variable>
+                                       <a href="{$link_delete}" 
onMouseover="window.status='{$lang_delete_sms_text}';return true;" 
onMouseout="window.status='';return true;"><xsl:value-of 
select="text_delete"/></a>
+                               </td>
+                       </tr>
+       </xsl:template>
+
+
        <xsl:template match="table_add">
                        <tr>
-                               <td>
+                               <td colspan = '3'>
                                        <xsl:variable 
name="send_action"><xsl:value-of select="send_action"/></xsl:variable>
                                        <xsl:variable 
name="lang_send"><xsl:value-of select="lang_send"/></xsl:variable>
                                        <form method="post" 
action="{$send_action}">
@@ -200,7 +312,7 @@
 
                        <tr>
                                <td  colspan = "2">
-                                       <input type="checkbox" name="msg_flash" 
value="1" onMouseout="window.status='';return true;">
+                                       <input type="checkbox" name="msg_flash" 
value="on" onMouseout="window.status='';return true;">
                                        </input>
                                        <xsl:text> </xsl:text>
                                        <xsl:value-of 
select="lang_send_as_flash"/>
@@ -208,7 +320,7 @@
                        </tr>   
                        <tr>
                                <td  colspan = "2">
-                                       <input type="checkbox" 
name="msg_unicode" value="1" onMouseout="window.status='';return true;">
+                                       <input type="checkbox" 
name="msg_unicode" value="on" onMouseout="window.status='';return true;">
                                        </input>
                                        <xsl:text> </xsl:text>
                                        <xsl:value-of 
select="lang_send_as_unicode"/>




reply via email to

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