phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] CVS: property/inc class.bocategory.inc.php,1.1,1.2 cl


From: Sigurd Nes <address@hidden>
Subject: [Phpgroupware-cvs] CVS: property/inc class.bocategory.inc.php,1.1,1.2 class.socategory.inc.php,1.1,1.2 class.uicategory.inc.php,1.1,1.2
Date: Thu, 08 May 2003 06:47:53 -0400

Update of /cvsroot/phpgroupware/property/inc
In directory subversions:/tmp/cvs-serv30094/inc

Modified Files:
        class.bocategory.inc.php class.socategory.inc.php 
        class.uicategory.inc.php 
Log Message:
no message

Index: class.bocategory.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.bocategory.inc.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** class.bocategory.inc.php    8 May 2003 09:53:16 -0000       1.1
--- class.bocategory.inc.php    8 May 2003 10:47:51 -0000       1.2
***************
*** 96,105 ****
                function read($type='')
                {
!                       $standard = $this->so->read(array('start' => 
$this->start,'query' => $this->query,'sort' => $this->sort,'order' => 
$this->order,
                                                                                
        'type' => $type,'allrows'=>$this->allrows));
  
                        $this->total_records = $this->so->total_records;
  
!                       return $standard;
                }
  
--- 96,105 ----
                function read($type='')
                {
!                       $category = $this->so->read(array('start' => 
$this->start,'query' => $this->query,'sort' => $this->sort,'order' => 
$this->order,
                                                                                
        'type' => $type,'allrows'=>$this->allrows));
  
                        $this->total_records = $this->so->total_records;
  
!                       return $category;
                }
  
***************
*** 114,133 ****
                }
  
!               function save($standard,$action='',$type ='')
                {
                        if ($action=='edit')
                        {
!                               if ($standard['id'] != '')
                                {
  
!                                       $message = 
$this->so->edit($standard,$type);
                                }
                        }
                        else
                        {
!                               $message = $this->so->add($standard,$type);
                        }
-                       return $message;
  
                }
  
--- 114,133 ----
                }
  
!               function save($category,$action='',$type ='')
                {
                        if ($action=='edit')
                        {
!                               if ($category['id'] != '')
                                {
  
!                                       $receipt = 
$this->so->edit($category,$type);
                                }
                        }
                        else
                        {
!                               $receipt = $this->so->add($category,$type);
                        }
  
+                       return $receipt;
                }
  

Index: class.socategory.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.socategory.inc.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** class.socategory.inc.php    8 May 2003 09:53:16 -0000       1.1
--- class.socategory.inc.php    8 May 2003 10:47:51 -0000       1.2
***************
*** 86,90 ****
                        while ($this->db->next_record())
                        {
!                               $standard[] = array
                                (
                                        'id'    => $this->db->f('id'),
--- 86,90 ----
                        while ($this->db->next_record())
                        {
!                               $category[] = array
                                (
                                        'id'    => $this->db->f('id'),
***************
*** 92,96 ****
                                );
                        }
!                       return $standard;
                }
  
--- 92,96 ----
                                );
                        }
!                       return $category;
                }
  
***************
*** 157,192 ****
                        if ($this->db->next_record())
                        {
!                               $standard['id']                 = 
$this->db->f('id');
!                               $standard['descr']                              
= $this->db->f('descr');
  
!                               return $standard;
                        }
                }
  
!               function add($standard,$type)
                {
                        $table = $this->select_table($type);
  
!                       $standard['descr'] = 
$this->db->db_addslashes($standard['descr']);
  
                        $this->db->query("INSERT INTO $table (id, descr) "
!                               . "VALUES ('" . $standard['id'] . "','" . 
$standard['descr']. "')",__LINE__,__FILE__);
  
!                       $message = lang('standard has been saved');
!                       return $message;
                }
  
!               function edit($standard,$type)
                {
  
                        $table = $this->select_table($type);
  
!                       $standard['descr'] = 
$this->db->db_addslashes($standard['descr']);
  
!                       $this->db->query("UPDATE $table set descr='" . 
$standard['descr']
!                                                       . "' WHERE id='" . 
$standard['id']. "'",__LINE__,__FILE__);
  
!                       $message = lang('standard has been edited');
!                       return $message;
                }
  
--- 157,193 ----
                        if ($this->db->next_record())
                        {
!                               $category['id']                 = 
$this->db->f('id');
!                               $category['descr']                              
= $this->db->f('descr');
  
!                               return $category;
                        }
                }
  
!               function add($category,$type)
                {
                        $table = $this->select_table($type);
  
!                       $category['descr'] = 
$this->db->db_addslashes($category['descr']);
  
                        $this->db->query("INSERT INTO $table (id, descr) "
!                               . "VALUES ('" . $category['id'] . "','" . 
$category['descr']. "')",__LINE__,__FILE__);
  
!                       $receipt['message'][]=array('msg'=>lang('category has 
been saved'));
!                       return $receipt;
                }
  
!               function edit($category,$type)
                {
  
                        $table = $this->select_table($type);
  
!                       $category['descr'] = 
$this->db->db_addslashes($category['descr']);
  
!                       $this->db->query("UPDATE $table set descr='" . 
$category['descr']
!                                                       . "' WHERE id='" . 
$category['id']. "'",__LINE__,__FILE__);
  
! 
!                       $receipt['message'][]=array('msg'=>lang('category has 
been edited'));
!                       return $receipt;
                }
  

Index: class.uicategory.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.uicategory.inc.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** class.uicategory.inc.php    8 May 2003 09:53:16 -0000       1.1
--- class.uicategory.inc.php    8 May 2003 10:47:51 -0000       1.2
***************
*** 63,82 ****
                                                                                
'search_field'));
  
!                       $standard_list = $this->bo->read($type);
  
!                       while (is_array($standard_list) && list(,$standard) = 
each($standard_list))
                        {
!                               $words = split(' ',$standard['descr']);
                                $first = "$words[0] $words[1] $words[2] 
$words[3]";
  
                                $content[] = array
                                (
!                                       'id'                                    
=> $standard['id'],
                                        'first'                                 
        => $first,
!                                       'link_edit'                             
        => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uicategory.edit&id='
 . $standard['id'].'&type='.$type),
!                                       'link_delete'                           
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uicategory.delete&id='
 . $standard['id'].'&type='.$type),
!                                       'lang_view_standardtext'        => 
lang('view the standard'),
!                                       'lang_edit_standardtext'        => 
lang('edit the standard'),
!                                       'lang_delete_standardtext'      => 
lang('delete the standard'),
                                        'text_view'                             
        => lang('view'),
                                        'text_edit'                             
        => lang('edit'),
--- 63,82 ----
                                                                                
'search_field'));
  
!                       $category_list = $this->bo->read($type);
  
!                       while (is_array($category_list) && list(,$category) = 
each($category_list))
                        {
!                               $words = split(' ',$category['descr']);
                                $first = "$words[0] $words[1] $words[2] 
$words[3]";
  
                                $content[] = array
                                (
!                                       'id'                                    
=> $category['id'],
                                        'first'                                 
        => $first,
!                                       'link_edit'                             
        => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uicategory.edit&id='
 . $category['id'].'&type='.$type),
!                                       'link_delete'                           
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uicategory.delete&id='
 . $category['id'].'&type='.$type),
!                                       'lang_view_categorytext'        => 
lang('view the category'),
!                                       'lang_edit_categorytext'        => 
lang('edit the category'),
!                                       'lang_delete_categorytext'      => 
lang('delete the category'),
                                        'text_view'                             
        => lang('view'),
                                        'text_edit'                             
        => lang('edit'),
***************
*** 101,105 ****
                                                                                
                                                        'type'  =>$type)
                                                                                
)),
!                               'lang_id'       => lang('standard id'),
                        );
  
--- 101,105 ----
                                                                                
                                                        'type'  =>$type)
                                                                                
)),
!                               'lang_id'       => lang('category id'),
                        );
  
***************
*** 107,114 ****
                        (
                                'lang_add'                              => 
lang('add'),
!                               'lang_add_standardtext' => lang('add a 
standard'),
                                'add_action'                    => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uicategory.edit&type='.$type),
                                'lang_done'                             => 
lang('done'),
!                               'lang_done_standardtext'        => lang('back 
to admin'),
                                'done_action'                   => 
$GLOBALS['phpgw']->link('/admin/index.php')
                        );
--- 107,114 ----
                        (
                                'lang_add'                              => 
lang('add'),
!                               'lang_add_categorytext' => lang('add a 
category'),
                                'add_action'                    => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uicategory.edit&type='.$type),
                                'lang_done'                             => 
lang('done'),
!                               'lang_done_categorytext'        => lang('back 
to admin'),
                                'done_action'                   => 
$GLOBALS['phpgw']->link('/admin/index.php')
                        );
***************
*** 130,139 ****
                                'start_record'                                  
=> $this->start,
                                'record_limit'                                  
=> $record_limit,
!                               'num_records'                                   
=> count($standard_list),
                                'all_records'                                   
=> $this->bo->total_records,
                                'link_url'                                      
        => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uicategory.index&type='.$type),
                                'img_path'                                      
        => $GLOBALS['phpgw']->common->get_image_path('phpgwapi'),
!                               'lang_searchfield_standardtext' => lang('Enter 
the search string. To show all entries, empty this field and press the SUBMIT 
button again'),
!                               'lang_searchbutton_standardtext'        => 
lang('Submit the search string'),
                                'query'                                         
        => $this->query,
                                'lang_search'                                   
=> lang('search'),
--- 130,139 ----
                                'start_record'                                  
=> $this->start,
                                'record_limit'                                  
=> $record_limit,
!                               'num_records'                                   
=> count($category_list),
                                'all_records'                                   
=> $this->bo->total_records,
                                'link_url'                                      
        => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uicategory.index&type='.$type),
                                'img_path'                                      
        => $GLOBALS['phpgw']->common->get_image_path('phpgwapi'),
!                               'lang_searchfield_categorytext' => lang('Enter 
the search string. To show all entries, empty this field and press the SUBMIT 
button again'),
!                               'lang_searchbutton_categorytext'        => 
lang('Submit the search string'),
                                'query'                                         
        => $this->query,
                                'lang_search'                                   
=> lang('search'),
***************
*** 144,148 ****
  
                        $appname                                                
= lang($type);
!                       $function_msg                                   = 
lang('list '.$type.' standard');
  
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
--- 144,148 ----
  
                        $appname                                                
= lang($type);
!                       $function_msg                                   = 
lang('list '.$type.' category');
  
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
***************
*** 161,164 ****
--- 161,170 ----
                        if ($values['save'])
                        {
+                               if(!$id && !ctype_digit($values['id']))
+                               {
+                                       
$receipt['error'][]=array('msg'=>lang('Please enter an integer !'));
+                                       unset($values['id']);
+                               }
+ 
                                if($id)
                                {
***************
*** 171,187 ****
                                }
  
! 
!                               $message = 
$this->bo->save($values,$action,$type);
                        }
  
                        if ($id)
                        {
!                               $standard = $this->bo->read_single($id,$type);
!                               $function_msg = lang('edit standard');
                                $action='edit';
                        }
                        else
                        {
!                               $function_msg = lang('add standard');
                                $action='add';
                        }
--- 177,195 ----
                                }
  
!                               if(!$receipt['error'])
!                               {
!                                       $receipt = 
$this->bo->save($values,$action,$type);
!                               }
                        }
  
                        if ($id)
                        {
!                               $category = $this->bo->read_single($id,$type);
!                               $function_msg = lang('edit category');
                                $action='edit';
                        }
                        else
                        {
!                               $function_msg = lang('add category');
                                $action='add';
                        }
***************
*** 199,203 ****
                                'form_action'                                   
=> $GLOBALS['phpgw']->link('/index.php',$link_data),
                                'done_action'                                   
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uicategory.index&type='.$type),
!                               'lang_id'                               => 
lang('standard ID'),
                                'lang_name'                                     
        => lang('name'),
                                'lang_descr'                                    
=> lang('Descr'),
--- 207,211 ----
                                'form_action'                                   
=> $GLOBALS['phpgw']->link('/index.php',$link_data),
                                'done_action'                                   
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uicategory.index&type='.$type),
!                               'lang_id'                               => 
lang('category ID'),
                                'lang_name'                                     
        => lang('name'),
                                'lang_descr'                                    
=> lang('Descr'),
***************
*** 205,219 ****
                                'lang_done'                                     
        => lang('done'),
                                'value_id'                              => $id,
!                               'value_name'                                    
=> $standard['name'],
!                               'value_generaladdress'                  => 
$standard['general_address'],
!                               'message'                                       
        => $message,
!                               'lang_id_standardtext'  => lang('Enter the 
standard ID'),
!                               'lang_descr_standardtext'                       
=> lang('Enter a description the standard'),
!                               'lang_generaladdress_standardtext'=> 
lang('Enter the general address'),
!                               'lang_done_standardtext'                        
=> lang('Back to the list'),
!                               'lang_save_standardtext'                        
=> lang('Save the standard'),
!                               'type_id'                               => 
$standard['type_id'],
!                               'location_code'                                 
=> $standard['location_code'],
!                               'value_descr'                                   
=> $standard['descr']
  
  
--- 213,228 ----
                                'lang_done'                                     
        => lang('done'),
                                'value_id'                              => $id,
!                               'value_name'                                    
=> $category['name'],
!                               'value_generaladdress'                  => 
$category['general_address'],
!                               'error'                                         
        => $receipt['error'],
!                               'message'                                       
        => $receipt['message'],
!                               'lang_id_categorytext'  => lang('Enter the 
category ID'),
!                               'lang_descr_categorytext'                       
=> lang('Enter a description the category'),
!                               'lang_generaladdress_categorytext'=> 
lang('Enter the general address'),
!                               'lang_done_categorytext'                        
=> lang('Back to the list'),
!                               'lang_save_categorytext'                        
=> lang('Save the category'),
!                               'type_id'                               => 
$category['type_id'],
!                               'location_code'                                 
=> $category['location_code'],
!                               'value_descr'                                   
=> $category['descr']
  
  
***************
*** 252,262 ****
                                'lang_confirm_msg'              => lang('do you 
really want to delete this entry'),
                                'lang_yes'                              => 
lang('yes'),
!                               'lang_yes_standardtext' => lang('Delete the 
entry'),
!                               'lang_no_standardtext'  => lang('Back to the 
list'),
                                'lang_no'                               => 
lang('no')
                        );
  
                        $appname                                                
= lang($type);
!                       $function_msg                                   = 
lang('delete '.$type.' standard');
  
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;
--- 261,271 ----
                                'lang_confirm_msg'              => lang('do you 
really want to delete this entry'),
                                'lang_yes'                              => 
lang('yes'),
!                               'lang_yes_categorytext' => lang('Delete the 
entry'),
!                               'lang_no_categorytext'  => lang('Back to the 
list'),
                                'lang_no'                               => 
lang('no')
                        );
  
                        $appname                                                
= lang($type);
!                       $function_msg                                   = 
lang('delete '.$type.' category');
  
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang($this->currentapp) . ' - ' . $appname . ': ' . $function_msg;





reply via email to

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