phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] sms inc/class.uisms.inc.php inc/class.bocommon....


From: Sigurd Nes
Subject: [Phpgroupware-cvs] sms inc/class.uisms.inc.php inc/class.bocommon....
Date: Mon, 15 May 2006 13:22:39 +0000

CVSROOT:        /sources/phpgroupware
Module name:    sms
Branch:         
Changes by:     Sigurd Nes <address@hidden>     06/05/15 13:22:39

Modified files:
        inc            : class.uisms.inc.php 
Added files:
        inc            : class.bocommon.inc.php class.menu.inc.php 
        templates/base : app_delete.xsl cat_filter.xsl cat_select.xsl 
                         filter_filter.xsl menu.xsl nextmatchs.xsl 
                         no_access.xsl search_field.xsl sms.xsl 

Log message:
        

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/sms/inc/class.bocommon.inc.php?rev=1.1
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/sms/inc/class.menu.inc.php?rev=1.1
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/sms/inc/class.uisms.inc.php.diff?tr1=1.1.1.1&tr2=1.2&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/sms/templates/base/app_delete.xsl?rev=1.1
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/sms/templates/base/cat_filter.xsl?rev=1.1
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/sms/templates/base/cat_select.xsl?rev=1.1
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/sms/templates/base/filter_filter.xsl?rev=1.1
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/sms/templates/base/menu.xsl?rev=1.1
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/sms/templates/base/nextmatchs.xsl?rev=1.1
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/sms/templates/base/no_access.xsl?rev=1.1
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/sms/templates/base/search_field.xsl?rev=1.1
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/sms/templates/base/sms.xsl?rev=1.1

Patches:
Index: sms/inc/class.uisms.inc.php
diff -u sms/inc/class.uisms.inc.php:1.1.1.1 sms/inc/class.uisms.inc.php:1.2
--- sms/inc/class.uisms.inc.php:1.1.1.1 Mon May 15 10:29:23 2006
+++ sms/inc/class.uisms.inc.php Mon May 15 13:22:39 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.1.1.1 2006/05/15 10:29:23 
sigurdne Exp $
+       * @version $Id: class.uisms.inc.php,v 1.2 2006/05/15 13:22:39 sigurdne 
Exp $
        */
 
        /**
@@ -29,9 +29,9 @@
                var $public_functions = array
                (
                        'index'  => True,
-                       'view'   => True,
-                       'training'=> True,
-                       'edit'   => True,
+                       'outbox'   => True,
+                       'send'   => True,
+                       'send_group'=> True,
                        'delete' => True
                );
 
@@ -42,10 +42,9 @@
                        $this->nextmatchs                       = 
CreateObject('phpgwapi.nextmatchs');
                        $this->account                          = 
$GLOBALS['phpgw_info']['user']['account_id'];
 //                     $this->bo                               = 
CreateObject($this->currentapp.'.bosms',False);
-//                     $this->bocommon                         = 
CreateObject($this->currentapp.'.bocommon');
+                       $this->bocommon                 = 
CreateObject($this->currentapp.'.bocommon');
 //                     $this->bocategory                       = 
CreateObject($this->currentapp.'.bocategory');
-//                     $this->menu                             = 
CreateObject($this->currentapp.'.menu');
-                       $this->menu->sub                        ='sms';
+                       $this->menu                             = 
CreateObject($this->currentapp.'.menu');
                        $this->grants                           = 
$this->bo->grants;
                        $this->start                            = 
$this->bo->start;
                        $this->query                            = 
$this->bo->query;
@@ -64,12 +63,339 @@
                                'order'         => $this->order,
                        );
 
-                       $this->bo->save_sessiondata($data);
+       //              $this->bo->save_sessiondata($data);
                }
 
                function index()
                {
+                       
$GLOBALS['phpgw']->xslttpl->add_file(array('sms','nextmatchs','menu',
+                                                                               
'search_field'));
+
+                       $this->menu->sub='.inbox';
+                       $links = $this->menu->links();
+
+       //              $sms_info = $this->bo->read();
+
+                       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'),
+                                       'text_delete'                           
=> lang('delete'),
+                                       'lang_delete_place_text'                
=> lang('delete the place'),
+                               );
+                       }
+
+//_debug_array($content);
+
+                       $table_header[] = array
+                       (
+
+                               'sort_name'     => 
$this->nextmatchs->show_sort_order(array
+                                                                               
(
+                                                                               
        'sort'  => $this->sort,
+                                                                               
        'var'   =>      'name',
+                                                                               
        'order' =>      $this->order,
+                                                                               
        'extra'         => array('menuaction'   => 
$this->currentapp.'.uisms.index',
+                                                                               
                                'query'         =>$this->query,
+                                                                               
                                'cat_id'        =>$this->cat_id,
+                                                                               
                                'allrows' => $this->allrows)
+                                                                               
)),
+                               'lang_delete'   => lang('delete'),
+                               'lang_edit'     => lang('edit'),
+                               'lang_view'     => lang('view'),
+                       );
+
+                       if(!$this->allrows)
+                       {
+                               $record_limit   = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'];
+                       }
+                       else
+                       {
+                               $record_limit   = $this->bo->total_records;
+                       }
+
+                       $link_data = array
+                       (
+                               'menuaction'    => 
$this->currentapp.'.uisms.index',
+                                               'sort'                  
=>$this->sort,
+                                               'order'                 
=>$this->order,
+                                               'cat_id'                
=>$this->cat_id,
+                                               'filter'                
=>$this->filter,
+                                               'query'                 
=>$this->query
+                       );
+
+                       $table_add[] = array
+                       (
+                               'lang_send'                     => lang('Send 
text SMS'),
+                               'lang_send_statustext'          => lang('send 
single'),
+                               'send_action'                   => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uisms.send'),
+                               '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'),
+                       );
+
+                       $msgbox_data = $this->bocommon->msgbox_data($receipt);
+
+                       $data = array
+                       (
+                               'msgbox_data'                                   
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
+                               'links'                                         
=> $links,
+                               'allow_allrows'                                 
=> True,
+                               'allrows'                                       
=> $this->allrows,
+                               'start_record'                                  
=> $this->start,
+                               'record_limit'                                  
=> $record_limit,
+                               'num_records'                                   
=> count($place_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'),
+                               '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,
+                               'lang_search'                                   
=> lang('search'),
+                               'table_header'                                  
=> $table_header,
+                               'table_add'                                     
=> $table_add,
+                               'values'                                        
        => $content
+                       );
+
+                       $appname                                        = 
lang('inbox');
+                       $function_msg                                   = 
lang('list inbox');
+
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('list' => $data));
+                       $this->save_sessiondata();
 
                }
+
+               function outbox()
+               {
+                       
$GLOBALS['phpgw']->xslttpl->add_file(array('sms','nextmatchs','menu',
+                                                                               
'search_field'));
+                       $this->menu->sub='.outbox';
+                       $links = $this->menu->links();
+
+       //              $sms_info = $this->bo->read();
+
+                       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'),
+                                       'text_delete'                           
=> lang('delete'),
+                                       'lang_delete_place_text'                
=> lang('delete the place'),
+                               );
+                       }
+
+//_debug_array($content);
+
+                       $table_header[] = array
+                       (
+
+                               'sort_name'     => 
$this->nextmatchs->show_sort_order(array
+                                                                               
(
+                                                                               
        'sort'  => $this->sort,
+                                                                               
        'var'   =>      'name',
+                                                                               
        'order' =>      $this->order,
+                                                                               
        'extra'         => array('menuaction'   => 
$this->currentapp.'.uisms.outbox',
+                                                                               
                                'query'         =>$this->query,
+                                                                               
                                'cat_id'        =>$this->cat_id,
+                                                                               
                                'allrows' => $this->allrows)
+                                                                               
)),
+                               'lang_delete'   => lang('delete'),
+                               'lang_edit'     => lang('edit'),
+                               'lang_view'     => lang('view'),
+                       );
+
+                       if(!$this->allrows)
+                       {
+                               $record_limit   = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'];
+                       }
+                       else
+                       {
+                               $record_limit   = $this->bo->total_records;
+                       }
+
+                       $link_data = array
+                       (
+                               'menuaction'    => 
$this->currentapp.'.uisms.outbox',
+                                               'sort'                  
=>$this->sort,
+                                               'order'                 
=>$this->order,
+                                               'cat_id'                
=>$this->cat_id,
+                                               'filter'                
=>$this->filter,
+                                               'query'                 
=>$this->query
+                       );
+
+                       $table_add[] = array
+                       (
+                               'lang_send'                     => lang('Send 
text SMS'),
+                               'lang_send_statustext'          => lang('send 
single'),
+                               'send_action'                   => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uisms.send'),
+                               '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'),
+                       );
+
+                       $msgbox_data = $this->bocommon->msgbox_data($receipt);
+
+                       $data = array
+                       (
+                               'msgbox_data'                                   
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
+                               'links'                                         
=> $links,
+                               'allow_allrows'                                 
=> True,
+                               'allrows'                                       
=> $this->allrows,
+                               'start_record'                                  
=> $this->start,
+                               'record_limit'                                  
=> $record_limit,
+                               'num_records'                                   
=> count($place_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'),
+                               '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,
+                               'lang_search'                                   
=> lang('search'),
+                               'table_header'                                  
=> $table_header,
+                               'table_add'                                     
=> $table_add,
+                               'values'                                        
        => $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));
+                       $this->save_sessiondata();
+
+               }
+
+               function send()
+               {
+                       $sms_id = get_var('sms_id',array('POST','GET'));
+                       $values         = get_var('values',array('POST'));
+
+                       $GLOBALS['phpgw']->xslttpl->add_file(array('sms'));
+
+                       if (is_array($values))
+                       {
+                               if ($values['save'] || $values['apply'])
+                               {
+
+                                       if(!$values['name'])
+                                       {
+                                               
$receipt['error'][]=array('msg'=>lang('Please enter a name !'));
+                                       }
+                                       if(!$values['address'])
+                                       {
+                                               
$receipt['error'][]=array('msg'=>lang('Please enter an address !'));
+                                       }
+                                       if(!$values['zip'])
+                                       {
+                                               
$receipt['error'][]=array('msg'=>lang('Please enter a zip code !'));
+                                       }
+                                       if(!$values['town'])
+                                       {
+                                               
$receipt['error'][]=array('msg'=>lang('Please enter a town !'));
+                                       }
+
+                                       if($sms_id)
+                                       {
+                                               $values['sms_id']=$sms_id;
+                                               $action='edit';
+                                       }
+
+                                       if(!$receipt['error'])
+                                       {
+                                               $receipt = 
$this->bo->save($values,$action);
+                                               $sms_id = $receipt['sms_id'];
+
+                                               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);
+                                               }
+                                       }
+                               }
+                               else
+                               {
+                                       
$GLOBALS['phpgw']->redirect_link('/index.php','menuaction='.$this->currentapp.'.uisms.send&sms_id='
 . $sms_id);
+                               }
+                       }
+
+
+                       if ($sms_id)
+                       {
+                               if(!$receipt['error'])
+                               {
+                                       $values = 
$this->bo->read_single($sms_id);
+                               }
+                               $function_msg = lang('edit place');
+                               $action='edit';
+                       }
+                       else
+                       {
+                               $function_msg = lang('add place');
+                               $action='add';
+                       }
+
+                       $link_data = array
+                       (
+                               'menuaction'    => 
$this->currentapp.'.uisms.outbox',
+                               'sms_id'        => $sms_id
+                       );
+
+                       $msgbox_data = $this->bocommon->msgbox_data($receipt);
+
+
+                       $data = array
+                       (
+                               'value_title'                   => 
$values['title'],
+                               'value_entry_date'              => 
$values['entry_date'],
+                               'value_name'                    => 
$values['name'],
+                               'value_address'                 => 
$values['address'],
+                               'value_zip'                     => 
$values['zip'],
+                               'value_town'                    => 
$values['town'],
+                               'value_remark'                  => 
$values['remark'],
+
+                               'lang_entry_date'               => lang('Entry 
date'),
+                               'lang_name'                     => lang('name'),
+                               'lang_address'                  => 
lang('address'),
+                               'lang_zip'                      => lang('zip'),
+                               'lang_town'                     => lang('town'),
+                               'lang_remark'                   => 
lang('remark'),
+
+                               'msgbox_data'                   => 
$GLOBALS['phpgw']->common->msgbox($msgbox_data),
+                               'form_action'                   => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
+                               'lang_id'                       => 
lang('training ID'),
+                               'lang_save'                     => lang('save'),
+                               'lang_cancel'                   => 
lang('cancel'),
+                               'value_id'                      => $sms_id,
+                               'lang_done_status_text'         => lang('Back 
to the list'),
+                               'lang_save_status_text'         => lang('Save 
the training'),
+                               'lang_apply'                    => 
lang('apply'),
+                               'lang_apply_status_text'        => lang('Apply 
the values'),
+                       );
+
+                       $appname                                        = 
lang('Place');
+
+                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
+                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('send' => $data));
+               }
+
+
 
        }




reply via email to

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