phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] CVS: property/inc class.bostandard_entity.inc.php,1.


From: Sigurd Nes <address@hidden>
Subject: [Phpgroupware-cvs] CVS: property/inc class.bostandard_entity.inc.php,1.2,1.3 class.sostandard_entity.inc.php,1.2,1.3 class.uistandard_entity.inc.php,1.2,1.3
Date: Sat, 14 Dec 2002 14:02:21 -0500

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

Modified Files:
        class.bostandard_entity.inc.php 
        class.sostandard_entity.inc.php 
        class.uistandard_entity.inc.php 
Log Message:
no message

Index: class.bostandard_entity.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.bostandard_entity.inc.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** class.bostandard_entity.inc.php     14 Dec 2002 09:00:12 -0000      1.2
--- class.bostandard_entity.inc.php     14 Dec 2002 19:02:18 -0000      1.3
***************
*** 122,128 ****
                }
  
!               function delete($id,$type)
                {
!                       $this->so->delete($id,$type);
                }
  
--- 122,128 ----
                }
  
!               function delete($id,$type,$attrib)
                {
!                       $this->so->delete($id,$type,$attrib);
                }
  

Index: class.sostandard_entity.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.sostandard_entity.inc.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** class.sostandard_entity.inc.php     14 Dec 2002 09:00:14 -0000      1.2
--- class.sostandard_entity.inc.php     14 Dec 2002 19:02:18 -0000      1.3
***************
*** 143,160 ****
                function add($standard,$type)
                {
!                       $table = $this->select_table($type);
  
!                       $standard['id'] = $this->socommon->next_id($table);
!                       $standard['num'] = 
$this->db->db_addslashes($standard['num']);
!                       $standard['descr'] = 
$this->db->db_addslashes($standard['descr']);
! 
!                       $this->db->query("INSERT INTO $table (id, num, descr) "
!                               . "VALUES ('" . $standard['id'] . "','" . 
$standard['num'] . "','" . $standard['descr']. "')",__LINE__,__FILE__);
! 
!                       $receipt = array(
!                               'id'            => $standard['id'],
!                               'message'       => lang('standard has been 
saved')
!                       );
  
                        return $receipt;
                }
--- 143,178 ----
                function add($standard,$type)
                {
!                       $errorcount = 0;
  
!                       if (!$standard['num'])
!                       {
!                               $error[$errorcount++] = array('msg'=>lang('Name 
not entered!'));
!                       }
! 
!                       if (! $error)
!                       {
!                               $table = $this->select_table($type);
! 
!                               $standard['id'] = 
$this->socommon->next_id($table);
!                               $standard['num'] = 
$this->db->db_addslashes($standard['num']);
!                               $standard['descr'] = 
$this->db->db_addslashes($standard['descr']);
! 
!                               $this->db->query("INSERT INTO $table (id, num, 
descr) "
!                                       . "VALUES ('" . $standard['id'] . "','" 
. $standard['num'] . "','" . $standard['descr']. "')",__LINE__,__FILE__);
! 
!                               $receipt = array(
!                                       'id'            => $standard['id'],
!                                       'message'       => lang('standard has 
been saved')
!                               );
!                       }
!                       else
!                       {
!                               $receipt = array(
!                                       'error'         => $error,
!                                       'message'       => lang('Attribute has 
NOT been saved')
!                               );
!                       }
  
+ //_debug_array($receipt);
                        return $receipt;
                }
***************
*** 162,182 ****
                function edit($standard,$type)
                {
  
!                       $table = $this->select_table($type);
  
!                       $standard['num'] = 
$this->db->db_addslashes($standard['num']);
!                       $standard['descr'] = 
$this->db->db_addslashes($standard['descr']);
  
!                       $this->db->query("UPDATE $table set descr='" . 
$standard['descr'] . "', num='". $standard['num']
                                                        . "' WHERE id='" . 
$standard['id']. "'",__LINE__,__FILE__);
  
!                       $message = lang('standard has been edited');
!                       return $message;
                }
  
!               function delete($id,$type)
                {
!                       $table = $this->select_table($type);
! 
                        $this->db->query("DELETE FROM $table WHERE id='" . $id 
. "'",__LINE__,__FILE__);
                }
--- 180,229 ----
                function edit($standard,$type)
                {
+                       $errorcount = 0;
  
!                       if (!$standard['num'])
!                       {
!                               $error[$errorcount++] = array('msg'=>lang('Name 
not entered!'));
!                       }
  
!                       if (! $error)
!                       {
!                               $table = $this->select_table($type);
  
!                               $standard['num'] = 
$this->db->db_addslashes($standard['num']);
!                               $standard['descr'] = 
$this->db->db_addslashes($standard['descr']);
! 
!                               $this->db->query("UPDATE $table set descr='" . 
$standard['descr'] . "', num='". $standard['num']
                                                        . "' WHERE id='" . 
$standard['id']. "'",__LINE__,__FILE__);
  
! 
!                               $receipt = array(
!                                       'message'       => lang('Standard has 
been edited')
!                               );
!                       }
!                       else
!                       {
!                               $receipt = array(
!                                       'error'         => $error,
!                                       'message'       => lang('Standard has 
NOT been edited')
!                               );
!                       }
! 
!                       return $receipt;
                }
  
!               function delete($id,$type,$attrib)
                {
!                       if($attrib)
!                       {
!                               $table = $this->select_table_attrib($type);
!                       }
!                       else
!                       {
! 
!                               $table                  = 
$this->select_table($type);
!                               $attrib_table   = 
$this->select_table_attrib($type);
!                               $this->db->query("DELETE FROM $attrib_table 
WHERE type_id='" . $id . "'",__LINE__,__FILE__);
!                       }
                        $this->db->query("DELETE FROM $table WHERE id='" . $id 
. "'",__LINE__,__FILE__);
                }

Index: class.uistandard_entity.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.uistandard_entity.inc.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** class.uistandard_entity.inc.php     14 Dec 2002 09:00:14 -0000      1.2
--- class.uistandard_entity.inc.php     14 Dec 2002 19:02:18 -0000      1.3
***************
*** 25,29 ****
                        'list_attribute'        => True,
                        'edit_attrib'           => True,
-                       'delete_attrib'         => True
                );
  
--- 25,28 ----
***************
*** 180,188 ****
  
  
!                               $message = 
$this->bo->save($values,$action,$type);
                                if(!$id)
                                {
!                                       $id=$message['id'];
!                                       $message=$message['message'];
                                }
  
--- 179,186 ----
  
  
!                               $receipt = 
$this->bo->save($values,$action,$type);
                                if(!$id)
                                {
!                                       $id=$receipt['id'];
                                }
  
***************
*** 222,226 ****
                                'value_id'                                      
        => $id,
                                'value_num'                                     
        => $standard['num'],
!                               'message'                                       
        => $message,
                                'lang_id_standardtext'                  => 
lang('Enter the standard ID'),
                                'lang_descr_standardtext'               => 
lang('Enter a description the standard'),
--- 220,225 ----
                                'value_id'                                      
        => $id,
                                'value_num'                                     
        => $standard['num'],
!                               'message'                                       
        => $receipt['message'],
!                               'error'                                         
        => $receipt['error'],
                                'lang_id_standardtext'                  => 
lang('Enter the standard ID'),
                                'lang_descr_standardtext'               => 
lang('Enter a description the standard'),
***************
*** 238,259 ****
                function delete()
                {
!                       $type   = get_var('type',array('POST','GET'));
!                       $id             = get_var('id',array('POST','GET'));
!                       $confirm                = 
get_var('confirm',array('POST'));
  
                        $link_data = array
                        (
!                               'menuaction' => 
$this->currentapp.'.uistandard_entity.index',
!                               'type' => $type
                        );
  
                        if (get_var('confirm',array('POST')))
                        {
!                               $this->bo->delete($id,$type);
                                Header('Location: ' . 
$GLOBALS['phpgw']->link('/index.php',$link_data));
                        }
  
                        
$GLOBALS['phpgw']->xslttpl->add_file(array($GLOBALS['phpgw']->common->get_tpl_dir('phpgwapi','default')
 . SEP . 'app_delete',
!                                                                               
$GLOBALS['phpgw']->common->get_tpl_dir('phpgwapi','default') . SEP . 
'app_header'));
  
                        $data = array
--- 237,269 ----
                function delete()
                {
!                       $attrib         = get_var('attrib',array('POST','GET'));
!                       $type           = get_var('type',array('POST','GET'));
!                       $type_id        = 
get_var('type_id',array('POST','GET'));
!                       $id                     = 
get_var('id',array('POST','GET'));
!                       $confirm        = get_var('confirm',array('POST'));
  
+                       if($attrib)
+                       {
+                               $function='list_attribute';
+                       }
+                       else
+                       {
+                               $function='index';
+                       }
                        $link_data = array
                        (
!                               'menuaction' => 
$this->currentapp.'.uistandard_entity.'.$function,
!                               'type' => $type,
!                               'type_id' => $type_id
                        );
  
                        if (get_var('confirm',array('POST')))
                        {
!                               $this->bo->delete($id,$type,$attrib);
                                Header('Location: ' . 
$GLOBALS['phpgw']->link('/index.php',$link_data));
                        }
  
                        
$GLOBALS['phpgw']->xslttpl->add_file(array($GLOBALS['phpgw']->common->get_tpl_dir('phpgwapi','default')
 . SEP . 'app_delete',
!                                                                       
$GLOBALS['phpgw']->common->get_tpl_dir('phpgwapi','default') . SEP . 
'app_header'));
  
                        $data = array
***************
*** 262,266 ****
                                'function_msg'                  => lang('delete 
standard'),
                                'done_action'                   => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
!                               'delete_action'                 => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uistandard_entity.delete&id='
 . $id.'&type='.$type),
                                'lang_confirm_msg'              => lang('do you 
really want to delete this entry'),
                                'lang_yes'                              => 
lang('yes'),
--- 272,276 ----
                                'function_msg'                  => lang('delete 
standard'),
                                'done_action'                   => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
!                               'delete_action'                 => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uistandard_entity.delete&id='
 . $id.'&type='.$type.'&type_id='.$type_id),
                                'lang_confirm_msg'              => lang('do you 
really want to delete this entry'),
                                'lang_yes'                              => 
lang('yes'),
***************
*** 301,305 ****
                                        'first'                                 
        => $first,
                                        'link_edit'                             
        => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uistandard_entity.edit_attrib&id='
 . $attrib['id'].'&type='.$type.'&type_id='.$type_id),
!                                       'link_delete'                           
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uistandard_entity.delete_attrib&id='
 . $attrib['id'].'&type='.$type),
                                        'lang_view_attribtext'          => 
lang('view the attrib'),
                                        'lang_attribute_attribtext'     => 
lang('attributes for the attrib'). ' ' . lang($type),
--- 311,315 ----
                                        'first'                                 
        => $first,
                                        'link_edit'                             
        => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uistandard_entity.edit_attrib&id='
 . $attrib['id'].'&type='.$type.'&type_id='.$type_id),
!                                       'link_delete'                           
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uistandard_entity.delete&id='
 . $attrib['id'].'&type='.$type.'&type_id='.$type_id.'&attrib=true'),
                                        'lang_view_attribtext'          => 
lang('view the attrib'),
                                        'lang_attribute_attribtext'     => 
lang('attributes for the attrib'). ' ' . lang($type),
***************
*** 456,496 ****
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit_attrib' => $data));
                }
-               function delete_attrib()
-               {
-                       $type   = get_var('type',array('POST','GET'));
-                       $id             = get_var('id',array('POST','GET'));
-                       $confirm                = 
get_var('confirm',array('POST'));
- 
-                       $link_data = array
-                       (
-                               'menuaction' => 
$this->currentapp.'.uistandard_entity.index',
-                               'type' => $type
-                       );
- 
-                       if (get_var('confirm',array('POST')))
-                       {
-                               $this->bo->delete($id,$type);
-                               Header('Location: ' . 
$GLOBALS['phpgw']->link('/index.php',$link_data));
-                       }
- 
-                       
$GLOBALS['phpgw']->xslttpl->add_file(array($GLOBALS['phpgw']->common->get_tpl_dir('phpgwapi','default')
 . SEP . 'app_delete',
-                                                                               
$GLOBALS['phpgw']->common->get_tpl_dir('phpgwapi','default') . SEP . 
'app_header'));
- 
-                       $data = array
-                       (
-                               'appname'                               => 
lang($type),
-                               'function_msg'                  => lang('delete 
standard'),
-                               'done_action'                   => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'delete_action'                 => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uistandard_entity.delete&id='
 . $id.'&type='.$type),
-                               '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')
-                       );
- 
-                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
-               }
- 
  
        }
--- 466,469 ----




reply via email to

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