fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [7543] Merge 7539:7542 from trunk


From: Sigurd Nes
Subject: [Fmsystem-commits] [7543] Merge 7539:7542 from trunk
Date: Wed, 31 Aug 2011 18:23:56 +0000

Revision: 7543
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=7543
Author:   sigurdne
Date:     2011-08-31 18:23:56 +0000 (Wed, 31 Aug 2011)
Log Message:
-----------
Merge 7539:7542 from trunk

Modified Paths:
--------------
    
branches/Version-1_0-branch/catch/inc/custom/default/update_location_at_record.php
    branches/Version-1_0-branch/property/inc/class.borequest.inc.php
    branches/Version-1_0-branch/property/inc/class.sorequest.inc.php
    branches/Version-1_0-branch/property/inc/class.uirequest.inc.php
    branches/Version-1_0-branch/property/setup/phpgw_no.lang
    branches/Version-1_0-branch/property/templates/base/request.xsl

Removed Paths:
-------------
    
branches/Version-1_0-branch/catch/inc/custom/default/update_location_at_record_nlsh.php

Property Changed:
----------------
    branches/Version-1_0-branch/


Property changes on: branches/Version-1_0-branch
___________________________________________________________________
Modified: svn:mergeinfo
   - 
/trunk:6439-6441,6443,6445-6447,6449-6464,6466-6468,6470-6474,6476-6477,6479-6480,6483-6488,6490-6491,6493-6494,6496-6501,6503-6504,6506,6508,6510-6511,6513,6515-6516,6518,6520-6524,6526-6528,6533-6534,6536-6541,6543-6565,6567,6569,6571-6576,6578,6580-6586,6588-6596,6598-6600,6602-6604,6606-6607,6609-6611,6613-6625,6629-6639,6641-6643,6645-6646,6648,6650-6654,6656-6659,6661-6663,6665-6666,6668-6669,6672-6673,6675,6677-6678,6680,6682-6686,6688-6717,6719,6721-6722,6724-6728,6730,6732-6734,6736-6739,6741,6743,6745-6746,6748-6756,6758-6762,6764,6766-6788,6790,6792-6798,6800-6814,6816-6819,6821-6822,6824-6826,6828-6837,6839,6841,6843-6849,6851,6853-6869,6871-6874,6876-6877,6879,6881,6883,6885-6886,6888-6893,6895-6897,6899-6901,6903,6905-6907,6909,6911-6929,6931-6936,6938-6947,6949,6951,6953,6955-6956,6958-6959,6961-6968,6970-6971,6973-6974,6976-6978,6980,6982-7017,7019-7025,7027-7035,7037-7039,7041-7045,7047-7055,7057,7059-7065,7067-7069,7071,7073,7075-7076,7078,7080-7081,7083,7085,7087,7089-7097,7099-7102,7104-7105,7107-7111,7113-7120,7122-7124,7126-7129,7131,7133-7141,7143,7145-7146,7148-7150,7152-7153,7155-7158,7160-7164,7166-7167,7169-7170,7172,7174,7176,7178,7180-7181,7183,7185,7187-7188,7190,7192-7196,7198-7199,7201-7203,7205,7207,7209-7210,7212,7214,7216-7217,7219-7222,7224-7226,7228-7229,7231,7233-7234,7236-7238,7240-7241,7243-7244,7246,7248,7250,7252-7256,7258-7259,7261-7264,7266-7273,7275-7279,7281-7332,7334-7338,7340-7348,7350,7352-7353,7355-7361,7363-7366,7368-7370,7372,7374,7376,7378,7380-7386,7388-7400,7402,7404-7433,7435-7439,7441-7446,7448-7458,7460-7469,7471-7483,7485-7487,7489-7490,7492,7494,7496-7497,7499,7501-7502,7504,7506-7507,7509-7511,7513-7517,7519-7521,7523,7525,7527-7529,7531,7533,7535-7538
   + 
/trunk:6439-6441,6443,6445-6447,6449-6464,6466-6468,6470-6474,6476-6477,6479-6480,6483-6488,6490-6491,6493-6494,6496-6501,6503-6504,6506,6508,6510-6511,6513,6515-6516,6518,6520-6524,6526-6528,6533-6534,6536-6541,6543-6565,6567,6569,6571-6576,6578,6580-6586,6588-6596,6598-6600,6602-6604,6606-6607,6609-6611,6613-6625,6629-6639,6641-6643,6645-6646,6648,6650-6654,6656-6659,6661-6663,6665-6666,6668-6669,6672-6673,6675,6677-6678,6680,6682-6686,6688-6717,6719,6721-6722,6724-6728,6730,6732-6734,6736-6739,6741,6743,6745-6746,6748-6756,6758-6762,6764,6766-6788,6790,6792-6798,6800-6814,6816-6819,6821-6822,6824-6826,6828-6837,6839,6841,6843-6849,6851,6853-6869,6871-6874,6876-6877,6879,6881,6883,6885-6886,6888-6893,6895-6897,6899-6901,6903,6905-6907,6909,6911-6929,6931-6936,6938-6947,6949,6951,6953,6955-6956,6958-6959,6961-6968,6970-6971,6973-6974,6976-6978,6980,6982-7017,7019-7025,7027-7035,7037-7039,7041-7045,7047-7055,7057,7059-7065,7067-7069,7071,7073,7075-7076,7078,7080-7081,7083,7085,7087,7089-7097,7099-7102,7104-7105,7107-7111,7113-7120,7122-7124,7126-7129,7131,7133-7141,7143,7145-7146,7148-7150,7152-7153,7155-7158,7160-7164,7166-7167,7169-7170,7172,7174,7176,7178,7180-7181,7183,7185,7187-7188,7190,7192-7196,7198-7199,7201-7203,7205,7207,7209-7210,7212,7214,7216-7217,7219-7222,7224-7226,7228-7229,7231,7233-7234,7236-7238,7240-7241,7243-7244,7246,7248,7250,7252-7256,7258-7259,7261-7264,7266-7273,7275-7279,7281-7332,7334-7338,7340-7348,7350,7352-7353,7355-7361,7363-7366,7368-7370,7372,7374,7376,7378,7380-7386,7388-7400,7402,7404-7433,7435-7439,7441-7446,7448-7458,7460-7469,7471-7483,7485-7487,7489-7490,7492,7494,7496-7497,7499,7501-7502,7504,7506-7507,7509-7511,7513-7517,7519-7521,7523,7525,7527-7529,7531,7533,7535-7538,7540-7542

Modified: 
branches/Version-1_0-branch/catch/inc/custom/default/update_location_at_record.php
===================================================================
--- 
branches/Version-1_0-branch/catch/inc/custom/default/update_location_at_record.php
  2011-08-31 18:20:22 UTC (rev 7542)
+++ 
branches/Version-1_0-branch/catch/inc/custom/default/update_location_at_record.php
  2011-08-31 18:23:56 UTC (rev 7543)
@@ -1,56 +1,116 @@
 <?php
                if(!isset($this->db) || !is_object($this->db))
                {
-                       $this->db           = & $GLOBALS['phpgw']->db;
+                       $this->db               = & $GLOBALS['phpgw']->db;
+                       $this->like             = & $this->db->like;            
                }
-               
+
+               $this->db2              = clone($this->db);
+
                if(!isset($target_table) || !$target_table)
                {
                        $target_table = 
"fm_{$this->type_app[$this->type]}_{$entity_id}_{$cat_id}";
                }
-               
+
                $ids = array();
-               $this->db->query("SELECT id FROM $target_table WHERE 
location_code is NULL",__LINE__,__FILE__);
+               $this->db->query("SELECT id FROM $target_table WHERE 
(location_code is NULL OR location_code = '') OR (target_id IS NOT NULL AND 
location_id IS NOT NULL AND p_num IS NULL)",__LINE__,__FILE__);
                while ($this->db->next_record())
                {
                        $ids[] = $this->db->f('id');
                }
-               
+
                foreach ($ids as $_id)
                {
+                       $value_set = array();
                        $this->db->query("SELECT * FROM $target_table WHERE id 
= {$_id}",__LINE__,__FILE__);
                        $this->db->next_record();
-               
-                       $loc_fields = array
-                       (
-                               'eiendomid',
-                               'byggid',
-                               'etasjeid',
-                               'bruksenhetid',
-                               'romid'
-                       );
 
-                       $location = array();
-                       $value_set = array();
-                       $j = 1;
-                       foreach ($loc_fields as $loc)
+                       $location_id = $this->db->f('location_id');
+                       $target_id = $this->db->f('target_id');
+
+                       if($location_id  && $target_id)
                        {
-                               if($this->db->f($loc))
+                               $origin = 
$GLOBALS['phpgw']->locations->get_name($location_id);
+                               $origin_table =  
$GLOBALS['phpgw']->locations->get_attrib_table($origin['appname'], 
$origin['location']);
+                               $origin_arr = explode('_', $origin_table);
+                               $p_entity_id = $origin_arr[2];
+                               $p_cat_id = $origin_arr[3];
+                               if($origin_table)
                                {
-                                       $location[] = $this->db->f($loc);
-                                       $value_set["loc{$j}"] = 
$this->db->f($loc);     
+                                       $this->db2->query("SELECT 
location_code, address FROM {$origin_table} WHERE num = 
'{$target_id}'",__LINE__,__FILE__);
+                                       $this->db2->next_record();
+                                       $origin_location_code           = 
$this->db2->f('location_code');
+                                       $origin_address                         
= $this->db2->f('address');
+                                       $value_set['location_code'] = 
$origin_location_code;
+                                       $value_set['p_num']             = 
$target_id;
+                                       $value_set['p_entity_id']       = 
$p_entity_id;
+                                       $value_set['p_cat_id']          = 
$p_cat_id;
+                                       $origin_location_code_arr       = 
explode('-',$origin_location_code);
+                                       if($origin_location_code_arr)
+                                       {
+                                               $j=1;
+                                               
foreach($origin_location_code_arr as $_loc)
+                                               {
+                                                       $value_set["loc{$j}"]   
= $_loc;
+                                                       $j++;
+                                               }
+                                       }
+                                       $value_set['address']   = 
$origin_address;
                                }
-                               else
+                       }
+                       else
+                       {
+                               $loc_fields = array
+                               (
+                                       'eiendomid',
+                                       'byggid',
+                                       'etasjeid',
+                                       'bruksenhetid',
+                                       'romid'
+                               );
+
+                               $location = array();
+                               $j = 1;
+                               foreach ($loc_fields as $loc)
                                {
-                                       break;
+                                       if($this->db->f($loc))
+                                       {
+
+// 8.April 11: 'romid' is now loc5
+/*
+                                               if($loc == 'romid')
+                                               {
+                                                       
$this->db2->query("SELECT loc5 FROM fm_location5 WHERE rom_nr_id = '" . 
$this->db->f($loc) . "' AND location_code {$this->like} '" . implode('-', 
$location) . "%'",__LINE__,__FILE__);
+       
+                                                       
$this->db2->next_record();
+                                                       
if($this->db2->f('loc5'))
+                                                       {
+                                                               $location[] = 
$this->db2->f('loc5');
+                                                               
$value_set["loc{$j}"] = $this->db2->f('loc5');
+                                                       }
+                                               }
+                                               else
+*/
+                                               {
+                                                       $location[] = 
$this->db->f($loc);
+                                                       $value_set["loc{$j}"] = 
$this->db->f($loc);
+                                               }
+                                       }
+                                       else
+                                       {
+                                               break;
+                                       }
+                                       $j++;
                                }
-                               $j++;
+                               if($location)
+                               {
+                                       $value_set['location_code'] = 
implode('-', $location);
+                               }
                        }
-               
-                       if($location)
+
+                       if($value_set)
                        {
-                               $value_set['location_code'] = implode('-', 
$location);
                                $value_set      = 
$this->db->validate_update($value_set);
-                               $this->db->query("UPDATE $target_table SET 
$value_set WHERE id= {$_id}",__LINE__,__FILE__);
+                               $this->db->query("UPDATE $target_table SET 
$value_set WHERE id={$_id}",__LINE__,__FILE__);
                        }
                }

Deleted: 
branches/Version-1_0-branch/catch/inc/custom/default/update_location_at_record_nlsh.php
===================================================================
--- 
branches/Version-1_0-branch/catch/inc/custom/default/update_location_at_record_nlsh.php
     2011-08-31 18:20:22 UTC (rev 7542)
+++ 
branches/Version-1_0-branch/catch/inc/custom/default/update_location_at_record_nlsh.php
     2011-08-31 18:23:56 UTC (rev 7543)
@@ -1,115 +0,0 @@
-<?php
-               if(!isset($this->db) || !is_object($this->db))
-               {
-                       $this->db               = & $GLOBALS['phpgw']->db;
-                       $this->like             = & $this->db->like;            
-               }
-
-               $this->db2              = clone($this->db);
-
-               if(!isset($target_table) || !$target_table)
-               {
-                       $target_table = 
"fm_{$this->type_app[$this->type]}_{$entity_id}_{$cat_id}";
-               }
-
-               $ids = array();
-               $this->db->query("SELECT id FROM $target_table WHERE 
location_code is NULL",__LINE__,__FILE__);
-               while ($this->db->next_record())
-               {
-                       $ids[] = $this->db->f('id');
-               }
-
-               foreach ($ids as $_id)
-               {
-                       $value_set = array();
-                       $this->db->query("SELECT * FROM $target_table WHERE id 
= {$_id}",__LINE__,__FILE__);
-                       $this->db->next_record();
-
-                       $location_id = $this->db->f('location_id');
-                       $target_id = $this->db->f('target_id');
-                       if($location_id  && $target_id)
-                       {
-                               $origin = 
$GLOBALS['phpgw']->locations->get_name($location_id);
-                               $origin_table =  
$GLOBALS['phpgw']->locations->get_attrib_table($origin['appname'], 
$origin['location']);
-                               $origin_arr = explode('_', $origin_table);
-                               $p_entity_id = $origin_arr[2];
-                               $p_cat_id = $origin_arr[3];
-                               if($origin_table)
-                               {
-                                       $this->db2->query("SELECT 
location_code, address FROM {$origin_table} WHERE num = 
'{$target_id}'",__LINE__,__FILE__);
-                                       $this->db2->next_record();
-                                       $origin_location_code           = 
$this->db2->f('location_code');
-                                       $origin_address                         
= $this->db2->f('address');
-                                       $value_set['location_code'] = 
$origin_location_code;
-                                       $value_set['p_num']             = 
$target_id;
-                                       $value_set['p_entity_id']       = 
$p_entity_id;
-                                       $value_set['p_cat_id']          = 
$p_cat_id;
-                                       $origin_location_code_arr       = 
explode('-',$origin_location_code);
-                                       if($origin_location_code_arr)
-                                       {
-                                               $j=1;
-                                               
foreach($origin_location_code_arr as $_loc)
-                                               {
-                                                       $value_set["loc{$j}"]   
= $_loc;
-                                                       $j++;
-                                               }
-                                       }
-                                       $value_set['address']   = 
$origin_address;
-                               }
-                       }
-                       else
-                       {
-                               $loc_fields = array
-                               (
-                                       'eiendomid',
-                                       'byggid',
-                                       'etasjeid',
-                                       'bruksenhetid',
-                                       'romid'
-                               );
-
-                               $location = array();
-                               $j = 1;
-                               foreach ($loc_fields as $loc)
-                               {
-                                       if($this->db->f($loc))
-                                       {
-
-// 8.April 11: 'romid' is now loc5
-/*
-                                               if($loc == 'romid')
-                                               {
-                                                       
$this->db2->query("SELECT loc5 FROM fm_location5 WHERE rom_nr_id = '" . 
$this->db->f($loc) . "' AND location_code {$this->like} '" . implode('-', 
$location) . "%'",__LINE__,__FILE__);
-       
-                                                       
$this->db2->next_record();
-                                                       
if($this->db2->f('loc5'))
-                                                       {
-                                                               $location[] = 
$this->db2->f('loc5');
-                                                               
$value_set["loc{$j}"] = $this->db2->f('loc5');
-                                                       }
-                                               }
-                                               else
-*/
-                                               {
-                                                       $location[] = 
$this->db->f($loc);
-                                                       $value_set["loc{$j}"] = 
$this->db->f($loc);
-                                               }
-                                       }
-                                       else
-                                       {
-                                               break;
-                                       }
-                                       $j++;
-                               }
-                               if($location)
-                               {
-                                       $value_set['location_code'] = 
implode('-', $location);
-                               }
-                       }
-
-                       if($value_set)
-                       {
-                               $value_set      = 
$this->db->validate_update($value_set);
-                               $this->db->query("UPDATE $target_table SET 
$value_set WHERE id={$_id}",__LINE__,__FILE__);
-                       }
-               }

Modified: branches/Version-1_0-branch/property/inc/class.borequest.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.borequest.inc.php    
2011-08-31 18:20:22 UTC (rev 7542)
+++ branches/Version-1_0-branch/property/inc/class.borequest.inc.php    
2011-08-31 18:23:56 UTC (rev 7543)
@@ -304,7 +304,7 @@
                                        'degree'                                
=> array('options' => $this->select_degree_list($conditions[$i]['degree'])),
                                        'probability'                   => 
array('options' => 
$this->select_probability_list($conditions[$i]['probability'])),
                                        'consequence'                   => 
array('options' => 
$this->select_consequence_list($conditions[$i]['consequence'])),
-                                       'condition_type'                => 
$condition_type_list[$i]['id'],
+                                       'condition_type'                => 
(int)$condition_type_list[$i]['id'],
                                        'condition_type_name'   => 
$condition_type_list[$i]['name'],
                                        'condition_type_descr'  => 
$condition_type_list[$i]['descr'],
                                        'failure'                               
=> (int)$conditions[$i]['reference'] - (int)$conditions[$i]['degree'] < 0 ? 'X' 
: '',
@@ -536,25 +536,25 @@
 
                                switch ($value['status'])
                                {
-                               case 'R': $type = lang('Re-opened'); break;
-                               case 'X': $type = lang('Closed');    break;
-                               case 'O': $type = lang('Opened');    break;
-                               case 'A': $type = lang('Re-assigned'); break;
-                               case 'P': $type = lang('Priority changed'); 
break;
-                               case 'CO': $type = lang('Initial Coordinator'); 
break;
-                               case 'C': $type = lang('Coordinator changed'); 
break;
-                               case 'TO': $type = lang('Initial Category'); 
break;
-                               case 'T': $type = lang('Category changed'); 
break;
-                               case 'SO': $type = lang('Initial Status'); 
break;
-                               case 'S': $type = lang('Status changed'); break;
-                               default: break;
+                                       case 'B': $type = lang('Budget 
changed'); break;
+                                       case 'R': $type = lang('Re-opened'); 
break;
+                                       case 'X': $type = lang('Closed');    
break;
+                                       case 'O': $type = lang('Opened');    
break;
+                                       case 'A': $type = lang('Re-assigned'); 
break;
+                                       case 'P': $type = lang('Priority 
changed'); break;
+                                       case 'CO': $type = lang('Initial 
Coordinator'); break;
+                                       case 'C': $type = lang('Coordinator 
changed'); break;
+                                       case 'TO': $type = lang('Initial 
Category'); break;
+                                       case 'T': $type = lang('Category 
changed'); break;
+                                       case 'SO': $type = lang('Initial 
Status'); break;
+                                       case 'S': $type = lang('Status 
changed'); break;
+                                       default: break;
                                }
 
                                
if($value['new_value']=='O'){$value['new_value']=lang('Opened');}
-                                       
if($value['new_value']=='X'){$value['new_value']=lang('Closed');}
+                               
if($value['new_value']=='X'){$value['new_value']=lang('Closed');}
 
-
-                                               
$record_history[$i]['value_action']     = $type?$type:'';
+                               $record_history[$i]['value_action']     = 
$type?$type:'';
                                unset($type);
 
                                if ($value['status'] == 'A')
@@ -568,18 +568,29 @@
                                                
$record_history[$i]['value_new_value']  = 
$GLOBALS['phpgw']->accounts->id2name($value['new_value']);
                                        }
                                }
-                               else if ($value['status'] == 'C' || 
$value['status'] == 'CO')
+                               else if ($value['status'] == 'C')
                                {
                                        $record_history[$i]['value_new_value']  
= $GLOBALS['phpgw']->accounts->id2name($value['new_value']);
+                                       $record_history[$i]['value_old_value']  
= $GLOBALS['phpgw']->accounts->id2name($value['old_value']);
                                }
+                               else if ($value['status'] == 'CO')
+                               {
+                                       $record_history[$i]['value_new_value']  
= $GLOBALS['phpgw']->accounts->id2name($value['new_value']);
+                               }
                                else if ($value['status'] == 'T' || 
$value['status'] == 'TO')
                                {
                                        $category                               
                                = 
$this->cats->return_single($value['new_value']);
                                        $record_history[$i]['value_new_value']  
= $category[0]['name'];
                                }
+                               else if ($value['status'] == 'B' && 
$value['new_value'])
+                               {
+                                       $record_history[$i]['value_new_value']  
=number_format($value['new_value'], 0, ',', ' ');
+                                       $record_history[$i]['value_old_value']  
=number_format($value['old_value'], 0, ',', ' ');
+                               }
                                else if ($value['status'] != 'O' && 
$value['new_value'])
                                {
                                        $record_history[$i]['value_new_value']  
= $value['new_value'];
+                                       $record_history[$i]['value_old_value']  
= $value['old_value'];
                                }
                                else
                                {

Modified: branches/Version-1_0-branch/property/inc/class.sorequest.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.sorequest.inc.php    
2011-08-31 18:20:22 UTC (rev 7542)
+++ branches/Version-1_0-branch/property/inc/class.sorequest.inc.php    
2011-08-31 18:23:56 UTC (rev 7543)
@@ -665,8 +665,8 @@
                        $values = 
$this->bocommon->validate_db_insert(array_values($value_set));
 
                        $this->db->query("INSERT INTO fm_request ({$cols}) 
VALUES ({$values})",__LINE__,__FILE__);
-_debug_array($request);die();
 
+
                        if(isset($request['condition']) && 
is_array($request['condition']))
                        {
                                foreach( $request['condition'] as 
$condition_type => $value_type )
@@ -829,9 +829,10 @@
 
                        $this->db->transaction_begin();
 
-                       $this->db->query("SELECT status,category,coordinator 
FROM fm_request where id='" .$request['id']."'",__LINE__,__FILE__);
+                       $this->db->query("SELECT 
budget,status,category,coordinator FROM fm_request where id='" 
.$request['id']."'",__LINE__,__FILE__);
                        $this->db->next_record();
 
+                       $old_budget                     = 
$this->db->f('budget');
                        $old_status = $this->db->f('status');
                        $old_category = $this->db->f('category');
                        $old_coordinator = $this->db->f('coordinator');
@@ -937,17 +938,22 @@
                        {
                                if ($old_status != $request['status'])
                                {
-                                       
$this->historylog->add('S',$request['id'],$request['status']);
+                                       
$this->historylog->add('S',$request['id'],$request['status'],$old_status);
                                }
                                if ($old_category != $request['cat_id'])
                                {
-                                       
$this->historylog->add('T',$request['id'],$request['cat_id']);
+                                       
$this->historylog->add('T',$request['id'],$request['cat_id'],$old_category);
                                }
-                               if ($old_coordinator != $request['coordinator'])
+                               if ((int)$old_coordinator != 
(int)$request['coordinator'])
                                {
-                                       
$this->historylog->add('C',$request['id'],$request['coordinator']);
+                                       
$this->historylog->add('C',$request['id'],$request['coordinator'],$old_coordinator);
                                }
 
+                               if ($old_budget != $request['budget'])
+                               {
+                                       $this->historylog->add('B', 
$request['id'], $request['budget'], $old_budget);
+                               }
+
                                $receipt['message'][] = 
array('msg'=>lang('request %1 has been edited',$request['id']));
                        }
                        else

Modified: branches/Version-1_0-branch/property/inc/class.uirequest.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.uirequest.inc.php    
2011-08-31 18:20:22 UTC (rev 7542)
+++ branches/Version-1_0-branch/property/inc/class.uirequest.inc.php    
2011-08-31 18:23:56 UTC (rev 7543)
@@ -977,10 +977,14 @@
                                }
 
 
-                               if(isset($values['budget']) && 
$values['budget'] && !ctype_digit($values['budget']))
+                               if(isset($values['budget']) && 
$values['budget'])
                                {
-                                       
$receipt['error'][]=array('msg'=>lang('budget') . ': ' . lang('Please enter an 
integer !'));
-                                       $error_id=true;
+                                       $values['budget'] = str_replace(' ', 
'', $values['budget']);
+                                       if( !ctype_digit($values['budget']))
+                                       {
+                                               
$receipt['error'][]=array('msg'=>lang('budget') . ': ' . lang('Please enter an 
integer !'));
+                                               $error_id=true;
+                                       }
                                }
 
                                if(is_array($values_attribute))
@@ -1228,6 +1232,7 @@
                                        'values'        =>      
json_encode(array(      array('key' => 
'value_date','label'=>lang('Date'),'sortable'=>true,'resizeable'=>true),
                                                                                
                                array('key' => 
'value_user','label'=>lang('User'),'sortable'=>true,'resizeable'=>true),
                                                                                
                                array('key' => 
'value_action','label'=>lang('Action'),'sortable'=>true,'resizeable'=>true),
+                                                                               
                                array('key' => 'value_old_value','label' => 
lang('old value'), 'sortable'=>true,'resizeable'=>true),
                                                                                
                                array('key' => 
'value_new_value','label'=>lang('New 
Value'),'sortable'=>true,'resizeable'=>true)))
                                );
 
@@ -1266,15 +1271,18 @@
 
 
 
+                       $_predisposed = 0;
                        if($this->acl_edit)
                        {
                                $_lang_delete = lang('Check to delete');
                                foreach($values['consume'] as & $consume)
                                {
+                                       $_predisposed = $_predisposed + 
$consume['amount'];
                                        $consume['delete'] = "<input 
type='checkbox' name='values[delete_consume][]' value='{$consume['id']}' 
title='{$_lang_delete}'>";
                                }
                                foreach($values['planning'] as & $planning)
                                {
+                                       $_predisposed = $_predisposed + 
$planning['amount'];
                                        $planning['delete'] = "<input 
type='checkbox' name='values[delete_planning][]' value='{$planning['id']}' 
title='{$_lang_delete}'>";
                                }
 
@@ -1383,7 +1391,7 @@
 
                                        'generate_project_action'               
        => $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiproject.edit')),
                                        'edit_action'                           
                => $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uirequest.edit', 'id'=> $id)),
-                                       'acl_add_project'                       
                => $this->acl->check('.project', PHPGW_ACL_ADD, 'property'),
+                                       'acl_add_project'                       
                => $mode == 'view' ? 0 : $this->acl->check('.project', 
PHPGW_ACL_ADD, 'property'),
                                        'lang_generate_project'                 
        => lang('Generate project'),
                                        'lang_generate_project_statustext'      
=> lang('Generate a project from this request'),
                                        'location_code'                         
                => $values['location_code'],
@@ -1427,8 +1435,9 @@
                                        'value_power_meter'                     
                => $values['power_meter'],
 
                                        'lang_budget'                           
                => lang('Budget'),
-                                       'value_budget'                          
                => $values['budget'],
+                                       'value_budget'                          
                => number_format($values['budget'], 0, ',', ' '),
                                        'lang_budget_statustext'                
        => lang('Enter the budget'),
+                                       'value_diff'                            
                => number_format(((int)$values['budget'] - $_predisposed), 0, 
',', ' '),
 
                                        'location_data'                         
                => $location_data,
                                        'location_type'                         
                => 'form',

Modified: branches/Version-1_0-branch/property/setup/phpgw_no.lang
===================================================================
--- branches/Version-1_0-branch/property/setup/phpgw_no.lang    2011-08-31 
18:20:22 UTC (rev 7542)
+++ branches/Version-1_0-branch/property/setup/phpgw_no.lang    2011-08-31 
18:23:56 UTC (rev 7543)
@@ -187,6 +187,7 @@
 async method   property        no      async metode
 async method has been saved    property        no      async metode er lagret
 async services property        no      Planlagte oppgaver
+at the disposal        property        no      Til disposisjon
 attach file    property        no      Legg til som vedlegg
 attachments    property        no      Vedlegg
 attribute      property        no      Verdier

Modified: branches/Version-1_0-branch/property/templates/base/request.xsl
===================================================================
--- branches/Version-1_0-branch/property/templates/base/request.xsl     
2011-08-31 18:20:22 UTC (rev 7542)
+++ branches/Version-1_0-branch/property/templates/base/request.xsl     
2011-08-31 18:23:56 UTC (rev 7543)
@@ -348,7 +348,16 @@
                                                                </td>
                                                        </tr>
                                                        <tr>
+                                                               <td 
valign="top">
+                                                                       
<xsl:value-of select="php:function('lang', 'at the disposal')" />
+                                                               </td>
                                                                <td>
+                                                                       
<xsl:value-of select="value_diff"/>
+                                                                       
<xsl:text> </xsl:text> [ <xsl:value-of select="currency"/> ]
+                                                               </td>
+                                                       </tr>
+                                                       <tr>
+                                                               <td>
                                                                        
<xsl:value-of select="php:function('lang', 'building part')" />
                                                                </td>
                                                                <td>




reply via email to

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