phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] CVS: property/inc class.bocommon.inc.php,1.15,1.16 cl


From: Sigurd Nes <address@hidden>
Subject: [Phpgroupware-cvs] CVS: property/inc class.bocommon.inc.php,1.15,1.16 class.boequipment.inc.php,1.4,1.5 class.soequipment.inc.php,1.4,1.5 class.uiequipment.inc.php,1.3,1.4
Date: Sun, 16 Feb 2003 17:27:04 -0500

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

Modified Files:
        class.bocommon.inc.php class.boequipment.inc.php 
        class.soequipment.inc.php class.uiequipment.inc.php 
Log Message:
no message

Index: class.bocommon.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.bocommon.inc.php,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -r1.15 -r1.16
*** class.bocommon.inc.php      15 Feb 2003 19:51:39 -0000      1.15
--- class.bocommon.inc.php      16 Feb 2003 22:27:00 -0000      1.16
***************
*** 576,582 ****
                function add_leading_zero($num)
                {
! echo 'num ' .$num .'<br>' ;
!                       $id_type = "hex";
! 
  //                    global $id_type;
  
--- 576,581 ----
                function add_leading_zero($num)
                {
! //echo 'num ' .$num .'<br>' ;
! //                    $id_type = "hex";
  //                    global $id_type;
  

Index: class.boequipment.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.boequipment.inc.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** class.boequipment.inc.php   15 Feb 2003 23:06:15 -0000      1.4
--- class.boequipment.inc.php   16 Feb 2003 22:27:01 -0000      1.5
***************
*** 202,215 ****
                        if ($action=='edit')
                        {
!                               if ($equipment['equipment_id'] != 0 )
                                {
!                                       if 
($this->so->check_equipment($equipment['equipment_id']))
!                                       {
!                                               $receipt = 
$this->so->edit($equipment);
!                                       }
!                                       else
!                                       {
!                                               
$receipt['error'][]=array('msg'=>lang('This equipment_id ID does not exist!'));
!                                       }
                                }
                        }
--- 202,212 ----
                        if ($action=='edit')
                        {
!                               if 
($this->so->check_equipment($equipment['equipment_id']))
                                {
!                                       $receipt = $this->so->edit($equipment);
!                               }
!                               else
!                               {
!                                       
$receipt['error'][]=array('msg'=>lang('This equipment_id ID does not exist!'));
                                }
                        }
***************
*** 231,234 ****
--- 228,236 ----
                }
  
+ 
+               function read_single_equipment_type($equipment_type_id)
+               {
+                       return 
$this->so->read_single_equipment_type($equipment_type_id);
+               }
  
                function delete($equipment_id)

Index: class.soequipment.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.soequipment.inc.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** class.soequipment.inc.php   15 Feb 2003 23:06:15 -0000      1.4
--- class.soequipment.inc.php   16 Feb 2003 22:27:01 -0000      1.5
***************
*** 136,139 ****
--- 136,141 ----
                        . " WHERE  $filtermethod $querymethod  ";
  
+                       $this->db2->query($sql,__LINE__,__FILE__);
+                       $this->total_records = $this->db2->num_rows();
                        $this->db->limit_query($sql . 
$ordermethod,$start,__LINE__,__FILE__);
  
***************
*** 199,203 ****
                        }
  
-                       $this->total_records = count($equipment_list);
                        return $equipment_list;
                }
--- 201,204 ----
***************
*** 249,252 ****
--- 250,259 ----
                }
  
+               function read_single_equipment_type($equipment_type_id)
+               {
+                       $this->db->query("SELECT name FROM fm_equipment_type  
where id='$equipment_type_id'");
+                       $this->db->next_record();
+                       return $this->db->f('name');
+               }
  
                function generate_id($equipment_type)
***************
*** 257,267 ****
                        $this->db->next_record();
                        $prefix = $this->db->f('prefix');
  
!                       $prefix = $prefix . $year . '-';
! //                    $prefix = 'E-' . $year . '-';
                        $pos    = strlen($prefix);
                        $this->db->query("select max(equipment_id) from 
fm_equipment where equipment_id like ('$prefix%')");
                        $this->db->next_record();
- //echo 'f ' .$this->db->f(0) .'<br>' ;
  
                        $max = 
$this->bocommon->add_leading_zero(substr($this->db->f(0),$pos));
--- 264,273 ----
                        $this->db->next_record();
                        $prefix = $this->db->f('prefix');
+ //echo 'prefix ' .$prefix .'<br>' ;
  
! //                    $prefix = $prefix . $year . '-';
                        $pos    = strlen($prefix);
                        $this->db->query("select max(equipment_id) from 
fm_equipment where equipment_id like ('$prefix%')");
                        $this->db->next_record();
  
                        $max = 
$this->bocommon->add_leading_zero(substr($this->db->f(0),$pos));
***************
*** 274,278 ****
  
                        $equipment['descr'] = 
$this->db->db_addslashes($equipment['descr']);
! _debug_array($equipment);
                        $this->db->query("INSERT INTO fm_equipment 
(equipment_id,lifetime,status,equipment_type_id,cost,date,descr,location_code, 
property_id,property_name,building_id,entrance_id,floor,apartment_id,street_name,street_number,vendor_id,owner)
 "
                                . "VALUES ('"
--- 280,284 ----
  
                        $equipment['descr'] = 
$this->db->db_addslashes($equipment['descr']);
! //_debug_array($equipment);
                        $this->db->query("INSERT INTO fm_equipment 
(equipment_id,lifetime,status,equipment_type_id,cost,date,descr,location_code, 
property_id,property_name,building_id,entrance_id,floor,apartment_id,street_name,street_number,vendor_id,owner)
 "
                                . "VALUES ('"
***************
*** 327,333 ****
                }
  
!               function delete($property_id,$equipment_id )
                {
!                       $this->db->query('DELETE FROM boei_bygg WHERE 
objekt_id=' . $property_id . ' and bygg_id=' . $equipment_id,__LINE__,__FILE__);
                }
        }
--- 333,340 ----
                }
  
!               function delete($equipment_id )
                {
!                       $this->db->query("DELETE FROM fm_equipment WHERE 
equipment_id='" . $equipment_id . "'",__LINE__,__FILE__);
!                       $this->db->query("DELETE FROM fm_equipment_attrib WHERE 
equipment_id='" . $equipment_id . "'",__LINE__,__FILE__);
                }
        }

Index: class.uiequipment.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.uiequipment.inc.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** class.uiequipment.inc.php   15 Feb 2003 19:51:39 -0000      1.3
--- class.uiequipment.inc.php   16 Feb 2003 22:27:01 -0000      1.4
***************
*** 149,153 ****
                                                                                
(
                                                                                
        'sort'  => $this->sort,
!                                                                               
        'var'   =>      'street',
                                                                                
        'order' =>      $this->order,
                                                                                
        'extra'         => array('menuaction'           => 
$this->currentapp.'.uiequipment.index',
--- 149,153 ----
                                                                                
(
                                                                                
        'sort'  => $this->sort,
!                                                                               
        'var'   =>      'street_name',
                                                                                
        'order' =>      $this->order,
                                                                                
        'extra'         => array('menuaction'           => 
$this->currentapp.'.uiequipment.index',
***************
*** 250,253 ****
--- 250,268 ----
                        if ($values['save'])
                        {
+                               if(!$values['cat_id'])
+                               {
+                                       
$receipt['error'][]=array('msg'=>lang('Please select equipment type !'));
+                               }
+ 
+                               if(!$values['status'])
+                               {
+                                       
$receipt['error'][]=array('msg'=>lang('Please select a status !'));
+                               }
+ 
+                               if(!$values['generate_id'] && 
!$values['equipment_id'] && !$id)
+                               {
+                                       
$receipt['error'][]=array('msg'=>lang('Please either select GENERATE ID or type 
a Equipment ID !'));
+                               }
+ 
                                if($id)
                                {
***************
*** 257,270 ****
                                else
                                {
!                                       if ($values['generate_id'])
                                        {
!                                               
$values['equipment_id']=$this->so->generate_id($equipment['cat_id']);
                                        }
                                }
  
! //_debug_array($values);
!                               $receipt = 
$this->bo->save($values,$action,$err);
!                               $id = $values['equipment_id'];
!                               $function_msg = lang('edit equipment');
                        }
                        else
--- 272,288 ----
                                else
                                {
!                                       if ($values['generate_id'] && 
!$receipt['error'])
                                        {
!                                               
$values['equipment_id']=$this->so->generate_id($values['cat_id']);
                                        }
                                }
  
!                               if(!$receipt['error'])
!                               {
! _debug_array($values);
!                                       $receipt = 
$this->bo->save($values,$action,$err);
!                                       $id = $values['equipment_id'];
!                                       $function_msg = lang('edit equipment');
!                               }
                        }
                        else
***************
*** 272,277 ****
                                if ($id)
                                {
!                                       $values = $this->bo->read_single($id);
!                                       $function_msg = lang('edit equipment');
                                }
                                else
--- 290,295 ----
                                if ($id)
                                {
!                                       $values                 = 
$this->bo->read_single($id);
!                                       $function_msg   = lang('edit 
equipment');
                                }
                                else
***************
*** 302,310 ****
                                                'vendor_name'   => 
$values['vendor_name']));
  
!                       if($receipt['error'] && !$action=='edit')
                        {
                                $err=true;
                        }
  
                        $link_data = array
                        (
--- 320,337 ----
                                                'vendor_name'   => 
$values['vendor_name']));
  
!                       if($values['equipment_id'])
!                       {
!                               $cat_text               = 
$this->bo->read_single_equipment_type($values['cat_id']);
!                       }
! 
! 
!                       if($receipt['error'])
                        {
                                $err=true;
+                               unset($values['equipment_id']);
+                               unset($id);
                        }
  
+ 
                        $link_data = array
                        (
***************
*** 327,330 ****
--- 354,358 ----
                        $data = array
                        (
+                               'generate_id'                                   
=> $values['generate_id'],
                                'link_calendar_date'                    => 
'setDateField(document.form.date);top.newWin=window.open('."'.".'/'.$this->currentapp.'/inc/calendar.html'."'".','."'".'cal'."'".','."'dependent=yes,width=210,height=230,screenX=200,screenY=300,titlebar=yes'".')',
                                'calendar_gif'                                  
=> './'.$this->currentapp.'/templates/default/images/calendar.gif',
***************
*** 353,363 ****
                                'value_equipment_id'                    => 
$values['equipment_id'],
                                'lang_equipment_id_statustext'  => lang('Enter 
equipment ID'),
!                               'lang_lifetime'                         => 
lang('Longevity'),
                                'lang_lifetime_statustext'              => 
lang('Enter the expected longevity in years'),
                                'value_lifetime'                                
=> $values['lifetime'],
! 
!                               'value_name'                                    
=> $equipment['name'],
!                               'value_cat'                                     
        => $equipment['cat'],
                                'error'                                         
        => $receipt['error'],
                                'message'                                       
        => $receipt['message'],
                                'lang_descr_statustext'                 => 
lang('Enter a description of the equipment'),
--- 381,390 ----
                                'value_equipment_id'                    => 
$values['equipment_id'],
                                'lang_equipment_id_statustext'  => lang('Enter 
equipment ID'),
!                               'lang_lifetime'                                 
=> lang('Longevity'),
                                'lang_lifetime_statustext'              => 
lang('Enter the expected longevity in years'),
                                'value_lifetime'                                
=> $values['lifetime'],
!                               'cat_text'                                      
        => $cat_text,
                                'error'                                         
        => $receipt['error'],
+                               'error_flag'                                    
=> $err,
                                'message'                                       
        => $receipt['message'],
                                'lang_descr_statustext'                 => 
lang('Enter a description of the equipment'),
***************
*** 369,374 ****
                                'lang_cat_statustext'                   => 
lang('Select the category the equipment belongs to. To do not use a category 
select NO CATEGORY'),
                                'select_name'                                   
=> 'values[cat_id]',
                                'cat_list'                                      
        => 
$this->bocommon->select_category_equipment_list('select',$values['cat_id']),
!                               'status_list'                                   
=> $this->bo->select_status_list('select',$values['status_id']),
                                'select_status_name'                    => 
'values[status]',
                                'lang_no_status'                                
=> lang('Select status'),
--- 396,402 ----
                                'lang_cat_statustext'                   => 
lang('Select the category the equipment belongs to. To do not use a category 
select NO CATEGORY'),
                                'select_name'                                   
=> 'values[cat_id]',
+                               'value_cat_id'                                  
=> $values['cat_id'],
                                'cat_list'                                      
        => 
$this->bocommon->select_category_equipment_list('select',$values['cat_id']),
!                               'status_list'                                   
=> $this->bo->select_status_list('select',$values['status']),
                                'select_status_name'                    => 
'values[status]',
                                'lang_no_status'                                
=> lang('Select status'),
***************
*** 387,391 ****
                function delete()
                {
-                       $property_id = get_var('property_id',array('GET'));
                        $equipment_id = 
get_var('equipment_id',array('POST','GET'));
                        $confirm        = get_var('confirm',array('POST'));
--- 415,418 ----
***************
*** 398,402 ****
                        if (get_var('confirm',array('POST')))
                        {
!                               $this->bo->delete($property_id,$equipment_id);
                                Header('Location: ' . 
$GLOBALS['phpgw']->link('/index.php',$link_data));
                        }
--- 425,429 ----
                        if (get_var('confirm',array('POST')))
                        {
!                               $this->bo->delete($equipment_id);
                                Header('Location: ' . 
$GLOBALS['phpgw']->link('/index.php',$link_data));
                        }
***************
*** 410,414 ****
                                'function_msg'                  => lang('delete 
equipment'),
                                'done_action'                   => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
!                               'delete_action'                 => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiequipment.delete&property_id='
 . $property_id.'&equipment_id=' . $equipment_id),
                                'lang_confirm_msg'              => lang('do you 
really want to delete this entry'),
                                'lang_yes'                              => 
lang('yes'),
--- 437,441 ----
                                'function_msg'                  => lang('delete 
equipment'),
                                'done_action'                   => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
!                               'delete_action'                 => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uiequipment.delete&equipment_id='
 . $equipment_id),
                                'lang_confirm_msg'              => lang('do you 
really want to delete this entry'),
                                'lang_yes'                              => 
lang('yes'),





reply via email to

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