phpgroupware-cvs
[Top][All Lists]
Advanced

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

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


From: Sigurd Nes <address@hidden>
Subject: [Phpgroupware-cvs] CVS: property/inc class.borequest.inc.php,1.1,1.2 class.sorequest.inc.php,1.1,1.2 class.uirequest.inc.php,1.1,1.2
Date: Mon, 14 Apr 2003 03:24:24 -0400

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

Modified Files:
        class.borequest.inc.php class.sorequest.inc.php 
        class.uirequest.inc.php 
Log Message:
no message

Index: class.borequest.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.borequest.inc.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** class.borequest.inc.php     12 Apr 2003 17:55:03 -0000      1.1
--- class.borequest.inc.php     14 Apr 2003 07:24:22 -0000      1.2
***************
*** 335,338 ****
--- 335,347 ----
                }
  
+               function read_priority_key()
+               {
+                       return  $this->so->read_priority_key();
+               }
+ 
+               function update_priority_key($values)
+               {
+                       return  $this->so->update_priority_key($values);
+               }
  
                function read()

Index: class.sorequest.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.sorequest.inc.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** class.sorequest.inc.php     12 Apr 2003 17:55:03 -0000      1.1
--- class.sorequest.inc.php     14 Apr 2003 07:24:22 -0000      1.2
***************
*** 47,50 ****
--- 47,120 ----
                }
  
+               function read_priority_key()
+               {
+                       $this->db->query("SELECT * FROM 
fm_wo_request_priority_key",__LINE__,__FILE__);
+ 
+                       $this->db->next_record();
+                       $priority_key['safety']                                 
        = $this->db->f('safety');
+                       $priority_key['aesthetics']                             
        = $this->db->f('aesthetics');
+                       $priority_key['indoor_climate']                         
= $this->db->f('indoor_climate');
+                       $priority_key['consequential_damage']           = 
$this->db->f('consequential_damage');
+                       $priority_key['user_gratification']                     
= $this->db->f('user_gratification');
+                       $priority_key['residential_environment']        = 
$this->db->f('residential_environment');
+                       $priority_key['authorities_demands']            = 
$this->db->f('authorities_demands');
+ 
+                       return $priority_key;
+               }
+ 
+ 
+               function update_priority_key($values)
+               {
+ 
+                       $this->db->query("UPDATE fm_wo_request_priority_key set
+                               safety  ='" . $values['safety'] . "',
+                               aesthetics      ='" . $values['aesthetics'] . 
"',
+                               indoor_climate  ='" . $values['indoor_climate'] 
. "',
+                               consequential_damage    ='" . 
$values['consequential_damage'] . "',
+                               user_gratification      ='" . 
$values['user_gratification'] . "',
+                               residential_environment ='" . 
$values['residential_environment'] . "',
+                               authorities_demands     ='" . 
$values['authorities_demands'] ."'",__LINE__,__FILE__);
+ 
+                       $this->update_score($values,'');
+ 
+                       $receipt = lang('priority keys has been updated');
+                       return $receipt;
+ 
+               }
+ 
+ 
+               function update_score($priority_key,$request_id='')
+               {
+ //_debug_array($priority_key);
+                       if(!$priority_key)
+                       {
+                               $priority_key = $this->read_priority_key();
+                       }
+ 
+ 
+                       $safety=str_replace(",",".",$priority_key['safety']);
+                       
$aesthetics=str_replace(",",".",$priority_key['aesthetics']);
+                       
$indoor_climate=str_replace(",",".",$priority_key['indoor_climate']);
+                       
$consequential_damage=str_replace(",",".",$priority_key['consequential_damage']);
+                       
$user_gratification=str_replace(",",".",$priority_key['user_gratification']);
+                       
$residential_environment=str_replace(",",".",$priority_key['residential_environment']);
+                       
$authorities_demands=str_replace(",",".",$priority_key['authorities_demands']);
+ 
+                       if($request_id)
+                       {
+                               $where =" where id = $request_id";
+                       }
+ 
+                       $this->db->query("update fm_wo_request set 
score=($safety* (d_safety*p_safety*(c_safety+1)))"
+                       . "+ ($aesthetics* 
(d_aesthetics*p_aesthetics*(c_aesthetics+1)))"
+                       . "+ ($indoor_climate* 
(d_indoor_climate*p_indoor_climate*(c_indoor_climate+1)))"
+                       . "+ ($consequential_damage* 
(d_consequential_damage*p_consequential_damage*(c_consequential_damage+1)))"
+                       . "+ ($user_gratification* 
(d_user_gratification*p_user_gratification*(c_user_gratification+1)))"
+                       . "+ ($residential_environment* 
(d_residential_environment*p_residential_environment*(c_residential_environment+1)))"
+                       . "+ ($authorities_demands* authorities_demands) $where 
",__LINE__,__FILE__);
+ 
+               }
+ 
+ 
                function read_single_request_category($id='')
                {
***************
*** 176,180 ****
                                (
                                        'request_id'    => $this->db->f('id'),
!                                       'name'                  => 
stripslashes($this->db->f('name')),
                                        'start_date'    => 
$this->db->f('start_date'),
                                        'coordinator'   => 
$this->db->f('coordinator'),
--- 246,250 ----
                                (
                                        'request_id'    => $this->db->f('id'),
!                                       'title'                 => 
stripslashes($this->db->f('title')),
                                        'start_date'    => 
$this->db->f('start_date'),
                                        'coordinator'   => 
$this->db->f('coordinator'),
***************
*** 184,188 ****
                                        'address'               => 
$this->db->f('address'),
                                        'category'              => 
$this->db->f('category'),
!                                       'title'                 => 
$this->db->f('title'),
                                        'grants'                => $ngrants
                                        );
--- 254,258 ----
                                        'address'               => 
$this->db->f('address'),
                                        'category'              => 
$this->db->f('category'),
!                                       'score'                 => 
$this->db->f('score'),
                                        'grants'                => $ngrants
                                        );
***************
*** 235,239 ****
                                $request['p_user_gratification']                
= $this->db->f('p_user_gratification');
                                $request['p_residential_environment']   = 
$this->db->f('p_residential_environment');
!                               $request['auth_demand']                         
        = $this->db->f('authorities_demands');
  
                                $request['power_meter'] = 
$this->soproject->get_power_meter($this->db->f('location_code'));
--- 305,309 ----
                                $request['p_user_gratification']                
= $this->db->f('p_user_gratification');
                                $request['p_residential_environment']   = 
$this->db->f('p_residential_environment');
!                               $request['authorities_demands']                 
                = $this->db->f('authorities_demands');
  
                                $request['power_meter'] = 
$this->soproject->get_power_meter($this->db->f('location_code'));
***************
*** 360,364 ****
                                . $request['p_user_gratification']. "','"
                                . $request['p_residential_environment']. "','"
!                               . $request['auth_demand']. 
"')",__LINE__,__FILE__);
  
  
--- 430,437 ----
                                . $request['p_user_gratification']. "','"
                                . $request['p_residential_environment']. "','"
!                               . $request['authorities_demands']. 
"')",__LINE__,__FILE__);
! 
! 
!                       $this->update_score('',$request['request_id']);
  
  
***************
*** 446,452 ****
                                p_residential_environment       ='" . 
$request['p_residential_environment'] . "',
  
!                               authorities_demands     ='" . 
$request['auth_demand'] . "',
                                address                 ='" . $address
                                . "' WHERE id= '" . $request['request_id'] 
."'",__LINE__,__FILE__);
  
                        if($request['tenant_phone'])
--- 519,527 ----
                                p_residential_environment       ='" . 
$request['p_residential_environment'] . "',
  
!                               authorities_demands     ='" . 
$request['authorities_demands'] . "',
                                address                 ='" . $address
                                . "' WHERE id= '" . $request['request_id'] 
."'",__LINE__,__FILE__);
+ 
+                       $this->update_score('',$request['request_id']);
  
                        if($request['tenant_phone'])

Index: class.uirequest.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/property/inc/class.uirequest.inc.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** class.uirequest.inc.php     12 Apr 2003 17:55:03 -0000      1.1
--- class.uirequest.inc.php     14 Apr 2003 07:24:22 -0000      1.2
***************
*** 22,29 ****
                var $public_functions = array
                (
!                       'index'  => True,
!                       'view'   => True,
!                       'edit'   => True,
!                       'delete' => True
                );
  
--- 22,30 ----
                var $public_functions = array
                (
!                       'index'                 => True,
!                       'view'                  => True,
!                       'edit'                  => True,
!                       'delete'                => True,
!                       'priority_key'  => True
                );
  
***************
*** 75,79 ****
                                                                                
$GLOBALS['phpgw']->common->get_tpl_dir('phpgwapi','default') . SEP . 
'search_field'));
  
-                       $lookup = get_var('lookup',array('POST','GET'));
                        $links = $this->bocommon->menu();
  
--- 76,79 ----
***************
*** 88,92 ****
                                $content[] = array
                                (
!                                       'name'                                  
        => $request['name'],
                                        'request_id'                            
=> $request['request_id'],
                                        'descr'                                 
        => $request['descr'],
--- 88,92 ----
                                $content[] = array
                                (
!                                       'title'                                 
        => $request['title'],
                                        'request_id'                            
=> $request['request_id'],
                                        'descr'                                 
        => $request['descr'],
***************
*** 99,102 ****
--- 99,103 ----
                                        'start_date'                            
=> $request['start_date'],
                                        'coordinator'                           
=> $request['coordinator'],
+                                       'score'                                 
        => $request['score'],
                                        'link_view'                             
        => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uirequest.view&id='
 . $request['request_id']),
                                        'link_edit'                             
        => 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uirequest.edit&id='
 . $request['request_id']),
***************
*** 127,131 ****
                                                                                
)),
                                'lang_request'  => lang('request'),
!                               'lang_name'             => lang('Name'),
                                'sort_property' => 
$this->nextmatchs->show_sort_order(array
                                                                                
(
--- 128,132 ----
                                                                                
)),
                                'lang_request'  => lang('request'),
!                               'lang_title'            => lang('Title'),
                                'sort_property' => 
$this->nextmatchs->show_sort_order(array
                                                                                
(
***************
*** 137,141 ****
                                                                                
                                                        'district_id'   => 
$this->district_id,
                                                                                
                                                        'filter'                
=>$this->filter,
-                                                                               
                                                        'lookup'                
=>$lookup,
                                                                                
                                                        'query'                 
=>$this->query)
                                                                                
)),
--- 138,141 ----
***************
*** 154,158 ****
                                                                                
                                                        'district_id'   => 
$this->district_id,
                                                                                
                                                        'filter'                
=>$this->filter,
-                                                                               
                                                        'lookup'                
=>$lookup,
                                                                                
                                                        'query'                 
=>$this->query)
                                                                                
)),
--- 154,157 ----
***************
*** 160,163 ****
--- 159,174 ----
                                'lang_start_date'       => lang('Start date'),
                                'lang_coordinator'      => lang('Coordinator'),
+                               'sort_score'    => 
$this->nextmatchs->show_sort_order(array
+                                                                               
(
+                                                                               
        'sort'  => $this->sort,
+                                                                               
        'var'   =>      'score',
+                                                                               
        'order' =>      $this->order,
+                                                                               
        'extra'         => array('menuaction'           => 
$this->currentapp.'.uirequest.index',
+                                                                               
                                                        'cat_id'                
=>$this->cat_id,
+                                                                               
                                                        'district_id'   => 
$this->district_id,
+                                                                               
                                                        'filter'                
=>$this->filter,
+                                                                               
                                                        'query'                 
=>$this->query)
+                                                                               
)),
+                               'lang_score'            => lang('score'),
                                'lang_view'                     => lang('view'),
                                'lang_edit'                     => lang('edit'),
***************
*** 188,191 ****
--- 199,207 ----
                        $data = array
                        (
+                               'lang_priority_key'                             
=> lang('Priority key'),
+                               'lang_priority_help'                    => 
lang('To alter the priority key'),
+                               'link_priority_key'                             
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uirequest.priority_key'),
+                               'overlib_source'                                
=> './'.$this->currentapp.'/inc/overlib.js',
+ 
                                'link_history'                                  
=> 
$GLOBALS['phpgw']->link('/index.php','menuaction='.$this->currentapp.'.uirequest.index&lookup='
 . $lookup),
                                'lang_history_statustext'               => 
lang('searh for history at this location'),
***************
*** 236,239 ****
--- 252,311 ----
                }
  
+ 
+               function priority_key()
+               {
+                       $GLOBALS['phpgw']->xslttpl->add_file(array('request',
+                                                                               
'headonly',
+                                                                               
$GLOBALS['phpgw']->common->get_tpl_dir('phpgwapi','default') . SEP . 
'app_header'));
+ 
+                       
//$GLOBALS['phpgw']->xslttpl->add_file($this->get_tpl_dir('phpgwapi','default') 
. SEP . 'phpgw_header');
+ 
+                       $values         = get_var('values',array('POST','GET'));
+ 
+                       if($values['update'])
+                       {
+                               $message        = 
$this->bo->update_priority_key($values);
+                       }
+                       else
+                       {
+                               $message        = lang('Edit priority key');
+                       }
+                       $link_data = array
+                       (
+                               'menuaction'            => 
$this->currentapp.'.uirequest.priority_key');
+ 
+                       $priority_key = $this->bo->read_priority_key();
+ 
+ 
+                       $data = array
+                       (
+                               'message'                                       
        => $message,
+                               'form_action'                                   
=> $GLOBALS['phpgw']->link('/index.php',$link_data),
+                               'lang_safety'                                   
=> lang('safety'),
+                               'lang_aesthetics'                               
=> lang('aesthetics'),
+                               'lang_indoor_climate'                   => 
lang('indoor climate'),
+                               'lang_consequential_damage'             => 
lang('consequential damage'),
+                               'lang_user_gratification'               => 
lang('user gratification'),
+                               'lang_residential_environment'  => 
lang('residential environment'),
+                               'lang_authorities_demands'              => 
lang('authorities demands'),
+                               'safety'                                        
        => $priority_key['safety'],
+                               'aesthetics'                                    
=> $priority_key['aesthetics'],
+                               'indoor_climate'                                
=> $priority_key['indoor_climate'],
+                               'consequential_damage'                  => 
$priority_key['consequential_damage'],
+                               'user_gratification'                    => 
$priority_key['user_gratification'],
+                               'residential_environment'               => 
$priority_key['residential_environment'],
+                               'authorities_demands'                   => 
$priority_key['authorities_demands'],
+                               'lang_save'                                     
        => lang('save'),
+                               'select_name'                                   
=> 'period'
+                       );
+ 
+ //_debug_array($data);
+ 
+                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('priority_key' => $data));
+               }
+ 
+ 
+ 
+ 
                function edit()
                {
***************
*** 473,478 ****
  
                                'lang_authorities_demands'                      
                => lang('Authorities Demands'),
!                               'lang_auth_demand_statustext'                   
        => lang('Is there a demand from the authorities to correct this 
condition?'),
!                               'auth_demand'                                   
=> $values['auth_demand']
                        );
  
--- 545,550 ----
  
                                'lang_authorities_demands'                      
                => lang('Authorities Demands'),
!                               'lang_authorities_demands_statustext'           
                => lang('Is there a demand from the authorities to correct this 
condition?'),
!                               'authorities_demands'                           
        => $values['authorities_demands']
                        );
  





reply via email to

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