fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [10607] Property: project types


From: Sigurd Nes
Subject: [Fmsystem-commits] [10607] Property: project types
Date: Mon, 17 Dec 2012 14:04:17 +0000

Revision: 10607
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=10607
Author:   sigurdne
Date:     2012-12-17 14:04:13 +0000 (Mon, 17 Dec 2012)
Log Message:
-----------
Property: project types

Modified Paths:
--------------
    trunk/property/inc/class.boproject.inc.php
    trunk/property/inc/class.soproject.inc.php
    trunk/property/inc/class.uicondition_survey.inc.php
    trunk/property/inc/class.uiproject.inc.php
    trunk/property/js/yahoo/project.edit.js
    trunk/property/js/yahoo/project.index.js
    trunk/property/setup/phpgw_no.lang
    trunk/property/setup/tables_current.inc.php
    trunk/property/setup/tables_update.inc.php
    trunk/property/templates/base/project.xsl

Modified: trunk/property/inc/class.boproject.inc.php
===================================================================
--- trunk/property/inc/class.boproject.inc.php  2012-12-17 13:28:26 UTC (rev 
10606)
+++ trunk/property/inc/class.boproject.inc.php  2012-12-17 14:04:13 UTC (rev 
10607)
@@ -42,6 +42,7 @@
                var $order;
                var $cat_id;
                var $allrows;
+               var $project_type_id;
 
                var $public_functions = array
                        (
@@ -78,6 +79,8 @@
                        $wo_hour_cat_id                 = 
phpgw::get_var('wo_hour_cat_id', 'int');
                        $district_id                    = 
phpgw::get_var('district_id', 'int');
                        $criteria_id                    = 
phpgw::get_var('criteria_id', 'int');
+                       $project_type_id                = 
phpgw::get_var('project_type_id', 'int');
+
                        $this->allrows                  = 
phpgw::get_var('allrows', 'bool');
 
                        $this->start                    = $start ? $start : 0;
@@ -122,6 +125,10 @@
                        {
                                $this->criteria_id = $criteria_id;
                        }
+                       if(isset($_POST['project_type_id']) || 
isset($_GET['project_type_id']))
+                       {
+                               $this->project_type_id = $project_type_id;
+                       }
                }
 
                function save_sessiondata($data)
@@ -147,6 +154,7 @@
                        $this->wo_hour_cat_id   = 
isset($data['wo_hour_cat_id'])?$data['wo_hour_cat_id']:'';
                        $this->district_id              = 
isset($data['district_id'])?$data['district_id']:'';
                        $this->criteria_id              = 
isset($data['criteria_id'])?$data['criteria_id']:'';
+                       $this->project_type_id  = 
isset($data['project_type_id'])?$data['project_type_id']:'';
                }
 
                function column_list($selected = array())
@@ -208,6 +216,30 @@
                        return $columns;
                }
 
+               public function get_project_types($selected)
+               {
+                       $values = array
+                       (
+                               array
+                               (
+                                       'id'    => 1,
+                                       'name'  => lang('operation')
+                               ),
+                               array
+                               (
+                                       'id'    => 2,
+                                       'name'  => lang('investment')
+                               ),
+                               array
+                               (
+                                       'id'    => 3,
+                                       'name'  => lang('buffer')
+                               ),
+                       
+                       );
+                       return $this->bocommon->select_list($selected, $values);
+               }
+
                function select_status_list($format='',$selected='')
                {
                        switch($format)
@@ -414,7 +446,9 @@
                        $project = $this->so->read(array('start' => 
$this->start,'query' => $this->query,'sort' => $this->sort,'order' => 
$this->order,
                                'filter' => $this->filter,'cat_id' => 
$this->cat_id,'status_id' => $this->status_id,'wo_hour_cat_id' => 
$this->wo_hour_cat_id,
                                
'start_date'=>$start_date,'end_date'=>$end_date,'allrows'=>isset($data['allrows'])
 ? $data['allrows'] : '','dry_run' => $data['dry_run'],
-                               'district_id' => $this->district_id, 'criteria' 
=> $this->get_criteria($this->criteria_id)));
+                               'district_id' => $this->district_id, 'criteria' 
=> $this->get_criteria($this->criteria_id),
+                               'project_type_id'       => 
$this->project_type_id));
+
                        $this->total_records = $this->so->total_records;
 
                        $dateformat = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];

Modified: trunk/property/inc/class.soproject.inc.php
===================================================================
--- trunk/property/inc/class.soproject.inc.php  2012-12-17 13:28:26 UTC (rev 
10606)
+++ trunk/property/inc/class.soproject.inc.php  2012-12-17 14:04:13 UTC (rev 
10607)
@@ -117,6 +117,7 @@
                        $district_id    = 
isset($data['district_id'])?$data['district_id']:'';
                        $dry_run                = isset($data['dry_run']) ? 
$data['dry_run'] : '';
                        $criteria               = isset($data['criteria']) && 
$data['criteria'] ? $data['criteria'] : array();
+                       $project_type_id = $data['project_type_id'] ? 
(int)$data['project_type_id']:0;
 
                        $sql = $this->bocommon->fm_cache('sql_project_' . 
!!$wo_hour_cat_id);
 
@@ -475,10 +476,15 @@
                                $where= 'AND';
                        }
 
+                       if($project_type_id)
+                       {
+                               $filtermethod .= " {$where} 
fm_project.project_type_id={$project_type_id}";
+                               $where= 'AND';
+                       }
 
                        if($wo_hour_cat_id)
                        {
-                               $filtermethod .= " $where 
fm_wo_hours_category.id=$wo_hour_cat_id ";
+                               $filtermethod .= " $where 
fm_wo_hours_category.id=$wo_hour_cat_id";
                                $where= 'AND';
                        }
 
@@ -796,6 +802,7 @@
                                $project = array
                                        (
                                                'project_id'                    
=> $this->db->f('id'),
+                                               'project_type_id'               
=> $this->db->f('project_type_id'),
                                                'title'                         
        => $this->db->f('title'),
                                                'name'                          
        => $this->db->f('name'),
                                                'location_code'                 
=> $this->db->f('location_code'),
@@ -998,6 +1005,7 @@
                        $values= array
                                (
                                        $id,
+                                       $project['project_type_id'],
                                        $project['project_group'],
                                        $project['name'],
                                        'public',
@@ -1026,7 +1034,7 @@
 
                        $values = $this->db->validate_insert($values);
 
-                       $this->db->query("INSERT INTO fm_project 
(id,project_group,name,access,category,entry_date,start_date,end_date,coordinator,status,"
+                       $this->db->query("INSERT INTO fm_project 
(id,project_type_id,project_group,name,access,category,entry_date,start_date,end_date,coordinator,status,"
                                . 
"descr,budget,reserve,location_code,address,key_deliver,key_fetch,other_branch,key_responsible,user_id,ecodimb,account_group,contact_id,inherit_location,periodization_id
 $cols) "
                                . "VALUES ($values $vals )",__LINE__,__FILE__);
 
@@ -1177,6 +1185,7 @@
                        $project['name'] = 
$this->db->db_addslashes($project['name']);
 
                        $value_set=array(
+                               'project_type_id'       => 
$project['project_type_id'],
                                'project_group'         => 
$project['project_group'],
                                'name'                          => 
$project['name'],
                                'status'                        => 
$project['status'],
@@ -1239,9 +1248,17 @@
                                'closed_b_period' => 
isset($project['closed_b_period']) && $project['closed_b_period'] ? 
$project['closed_b_period'] : array(),
                                'closed_orig_b_period' => 
isset($project['closed_orig_b_period']) && $project['closed_orig_b_period'] ? 
$project['closed_orig_b_period'] : array()
                        );
+                       $_active_period = array
+                       (
+                               'active_b_period' => 
isset($project['active_b_period']) && $project['active_b_period'] ? 
$project['active_b_period'] : array(),
+                               'active_orig_b_period' => 
isset($project['active_orig_b_period']) && $project['active_orig_b_period'] ? 
$project['active_orig_b_period'] : array()
+                       );
 
                        $this->close_period_from_budget($project['id'], 
$_closed_period);
+                       $this->activate_period_from_budget($project['id'], 
$_active_period);
+
                        unset($_close_period);
+                       unset($_active_period);
 
                        if($project['delete_b_period'])
                        {
@@ -1451,7 +1468,9 @@
                                                'budget'                        
=> (int)$this->db->f('budget'),
                                                'user_id'                       
=> $this->db->f('user_id'),
                                                'entry_date'            => 
$this->db->f('entry_date'),
-                                               'modified_date'         => 
$this->db->f('modified_date')
+                                               'modified_date'         => 
$this->db->f('modified_date'),
+                                               'closed'                        
=> $this->db->f('closed'),
+                                               'active'                        
=> $this->db->f('active')
                                        );
                                }
 
@@ -1474,7 +1493,10 @@
                                                        'budget'                
        => $entry['budget'],
                                                        'user_id'               
        => $entry['user_id'],
                                                        'entry_date'            
=> $entry['entry_date'],
-                                                       'modified_date'         
=> $entry['modified_date']
+                                                       'modified_date'         
=> $entry['modified_date'],
+                                                       'closed'                
        => $entry['closed'],
+                                                       'active'                
        => $entry['active']
+
                                                );
                                                $cols = implode(',', 
array_keys($value_set));
                                                $values = 
$this->db->validate_insert(array_values($value_set));
@@ -1601,7 +1623,8 @@
                                        'budget'                        => 
$budget,
                                        'user_id'                       => 
$this->account,
                                        'entry_date'            => $now,
-                                       'modified_date'         => $now
+                                       'modified_date'         => $now,
+                                       'active'                        => 1
                                );
 
                                $cols = implode(',', array_keys($value_set));
@@ -1616,27 +1639,23 @@
                {
                        $project_id = (int) $project_id;
                        $closed_period = array();
+                       $active_period = array();
                        $project_budget = array();
                        $project_order_amount = array();
 
-
                        $sql = "SELECT * FROM fm_project_budget WHERE 
project_id = {$project_id}";
                        $this->db->query($sql,__LINE__,__FILE__);
 
                        while ($this->db->next_record())
                        {
-                               $year = $this->db->f('year');
-                               $month = $this->db->f('month');
-               //              $period = $month ? $year . sprintf("%02s", 
$month) : $year . date('m');
-                               $period = $year . sprintf("%02s", $month);
+                               $period = $this->db->f('year') . 
sprintf("%02s", $this->db->f('month'));
                                
                                $project_budget[$period] = 
(int)$this->db->f('budget');
                                $project_order_amount[$period] = 
$this->db->f('order_amount');
                                $closed_period[$period] = 
!!$this->db->f('closed');
+                               $active_period[$period] = 
!!$this->db->f('active');
                        }
-                       unset($year);                   
 
-
                        $sql = "SELECT id AS order_id FROM fm_workorder WHERE 
project_id = {$project_id}";
                        $this->db->query($sql,__LINE__,__FILE__);
 
@@ -1659,7 +1678,6 @@
                                        $periode = $this->db->f('periode');
 
                                        $year = substr( $periode, 0, 4 );
-       //                              $month = substr( $periode, 4, 2 );
 
                                        $_found = false;
                                        if(isset($project_budget[$periode]))
@@ -1693,7 +1711,6 @@
                                {
                                        $periode = $this->db->f('periode');
                                        $year = substr( $periode, 0, 4 );
-       //                              $month = substr( $periode, 4, 2 );
                                        if(!$periode)
                                        {
                                                $year = date('Y');
@@ -1823,7 +1840,7 @@
                        $sort_period = array();
                        $values = array();
 
-                       foreach ($project_budget as $period => $budget)
+                       foreach ($project_budget as $period => $_budget)
                        {
                                $_sum_orders = 0;
                                $_actual_cost = 0;
@@ -1835,7 +1852,7 @@
                                                $_sum_orders += 
$order['amount'];
                        //                      $_sum_orders -= 
$order['actual_cost'];
 
-                                               if($budget >= 0)
+                                               if($_budget >= 0)
                                                {
                                                        
if($order['actual_cost'] >= 0)
                                                        {
@@ -1869,7 +1886,6 @@
                                                {
                                                        $_sum_orders = 0;
                                                }
-
                                        }
 
                                        unset($orders[$period]);
@@ -1877,11 +1893,11 @@
 
                                $values[] = array
                                (
-                                       'project_id'            => $project_id,
-                                       'period'                        => 
$period,
-                                       'budget'                        => 
$budget,
-                                       'sum_orders'            => $_sum_orders,
-                                       'actual_cost'           => 
$_actual_cost,
+                                       'project_id'                    => 
$project_id,
+                                       'period'                                
=> $period,
+                                       'budget'                                
=> $_budget,
+                                       'sum_orders'                    => 
$_sum_orders,
+                                       'actual_cost'                   => 
$_actual_cost,
                                );
 
                                $sort_period[] = $period;
@@ -1922,15 +1938,16 @@
                                        {
                                                $_sum_orders = 0;
                                        }
+
                                }
 
                                $values[] = array
                                (
-                                       'project_id'            => $project_id,
-                                       'period'                        => 
$period,
-                                       'budget'                        => 0,
-                                       'sum_orders'            => $_sum_orders,
-                                       'actual_cost'           => 
$_actual_cost,
+                                       'project_id'                    => 
$project_id,
+                                       'period'                                
=> $period,
+                                       'budget'                                
=> 0,
+                                       'sum_orders'                    => 
$_sum_orders,
+                                       'actual_cost'                   => 
$_actual_cost,
                                );
 
                                $sort_period[] = $period;
@@ -1947,11 +1964,20 @@
                                $entry['year'] = substr( $entry['period'], 0, 4 
);
                                $month = substr( $entry['period'], 4, 2 );
                                $entry['month'] = $month == '00' ? '' : $month;
-                               $entry['diff'] = $entry['budget'] - 
$entry['sum_orders'] - $entry['actual_cost'];
+                               if($active_period[$entry['period']])
+                               {
+                                       $entry['diff'] = $entry['budget'] - 
$entry['sum_orders'] - $entry['actual_cost'];                               
+                               }
+                               else
+                               {
+                                       $entry['diff'] =  0;
+                               }
+
                                $deviation = $entry['budget'] - 
$entry['actual_cost'];
                                $entry['deviation'] = $deviation;
                                $entry['deviation_percent'] = 
$deviation/$entry['budget'] * 100;
                                $entry['closed'] = 
$closed_period[$entry['period']];
+                               $entry['active'] = 
$active_period[$entry['period']];
                        }
 
 //_debug_array( $values);die();
@@ -2010,6 +2036,47 @@
 
                }
 
+               function activate_period_from_budget($project_id, $data)
+               {
+                       $project_id = (int) $project_id;
+                       $close_period = array();
+                       $open_period = array();
+
+                       foreach($data['active_orig_b_period'] as $period)
+                       {
+                               if(!in_array($period, $data['active_b_period']))
+                               {
+                                       $inactive_period[] = $period;
+                               }
+                       }
+
+                       foreach($data['active_b_period'] as $period)
+                       {
+                               if(!in_array($period, 
$data['active_orig_b_period']))
+                               {
+                                       $active_period[] = $period;
+                               }
+                       }
+
+                       foreach ($active_period as $period)
+                       {
+                               $when = explode('_', $period);
+                               $sql = "UPDATE fm_project_budget SET active = 1 
WHERE project_id = {$project_id} AND year =" . (int) $when[0] . ' AND month = ' 
. (int) $when[1];
+                               $this->db->query($sql,__LINE__,__FILE__);
+                       }
+
+                       foreach ($inactive_period as $period)
+                       {
+                               $when = explode('_', $period);
+                               $sql = "UPDATE fm_project_budget SET active = 0 
WHERE project_id = {$project_id} AND year =" . (int) $when[0] . ' AND month = ' 
. (int) $when[1];
+                               $this->db->query($sql,__LINE__,__FILE__);
+                       }
+//_debug_array($close_period);
+//_debug_array($open_period);die();
+
+
+               }
+
                function 
update_request_status($project_id='',$status='',$category=0,$coordinator=0)
                {
                        $historylog_r   = 
CreateObject('property.historylog','request');

Modified: trunk/property/inc/class.uicondition_survey.inc.php
===================================================================
--- trunk/property/inc/class.uicondition_survey.inc.php 2012-12-17 13:28:26 UTC 
(rev 10606)
+++ trunk/property/inc/class.uicondition_survey.inc.php 2012-12-17 14:04:13 UTC 
(rev 10607)
@@ -82,7 +82,22 @@
                        }
 
                        $values = $this->query();
-                       _debug_array($values);
+
+                       $descr = array();
+                       $columns = array();
+                       $columns[]      = 'id';
+                       $columns[]      = 'title';
+                       $columns[]      = 'descr';
+                       $columns[]      = 'address';
+                       $columns[]      = 'cnt';
+
+                       foreach($columns as $_column)
+                       {
+                               $descr[] = lang(str_replace('_', ' ', 
$_column));
+                       }
+
+                       $this->bocommon->download($values,$columns,$descr);
+
                }
 
 

Modified: trunk/property/inc/class.uiproject.inc.php
===================================================================
--- trunk/property/inc/class.uiproject.inc.php  2012-12-17 13:28:26 UTC (rev 
10606)
+++ trunk/property/inc/class.uiproject.inc.php  2012-12-17 14:04:13 UTC (rev 
10607)
@@ -53,6 +53,7 @@
                var $currentapp;
                var $district_id;
                var $criteria_id;
+               var $project_type_id;
 
                var $public_functions = array
                        (
@@ -97,23 +98,25 @@
                        $this->district_id              = 
$this->bo->district_id;
                        $this->user_id                  = $this->bo->user_id;
                        $this->criteria_id              = 
$this->bo->criteria_id;
+                       $this->project_type_id  = $this->bo->project_type_id;
                }
 
                function save_sessiondata()
                {
                        $data = array
                                (
-                                       'start'                 => $this->start,
-                                       'query'                 => $this->query,
-                                       'sort'                  => $this->sort,
-                                       'order'                 => $this->order,
-                                       'filter'                => 
$this->filter,
-                                       'cat_id'                => 
$this->cat_id,
-                                       'status_id'             => 
$this->status_id,
-                                       'wo_hour_cat_id'=> 
$this->wo_hour_cat_id,
-                                       'district_id'   => $this->district_id,
-                                       'user_id'               => 
$this->user_id,
-                                       'criteria_id'   => $this->criteria_id
+                                       'start'                         => 
$this->start,
+                                       'query'                         => 
$this->query,
+                                       'sort'                          => 
$this->sort,
+                                       'order'                         => 
$this->order,
+                                       'filter'                        => 
$this->filter,
+                                       'cat_id'                        => 
$this->cat_id,
+                                       'status_id'                     => 
$this->status_id,
+                                       'wo_hour_cat_id'        => 
$this->wo_hour_cat_id,
+                                       'district_id'           => 
$this->district_id,
+                                       'user_id'                       => 
$this->user_id,
+                                       'criteria_id'           => 
$this->criteria_id,
+                                       'project_type_id'       => 
$this->project_type_id
                                );
                        $this->bo->save_sessiondata($data);
                }
@@ -227,6 +230,7 @@
                                        ."cat_id:'{$this->cat_id}',"
                                        ."user_id:'{$this->user_id}',"
                                        ."criteria_id:'{$this->criteria_id}',"
+                                       
."project_type_id:':{$this->project_type_id}',"
                                        
."wo_hour_cat_id:'{$this->wo_hour_cat_id}',"
                                        ."second_display:1,"
                                        ."status_id:'{$this->status_id}'";
@@ -252,30 +256,33 @@
                                                        'second_display'=>true
                                );
  */
-                               $values_combo_box[0]  = 
$this->bocommon->select_district_list('filter',$this->district_id);
+                               $values_combo_box[0]  = 
$this->bo->get_project_types($this->project_type_id);
+                               array_unshift ($values_combo_box[0],array 
('id'=>'','name'=> lang('project type')));
+
+                               $values_combo_box[1]  = 
$this->bocommon->select_district_list('filter',$this->district_id);
                                $default_value = array 
('id'=>'','name'=>lang('no district'));
-                               array_unshift 
($values_combo_box[0],$default_value);
+                               array_unshift 
($values_combo_box[1],$default_value);
 
-                               $values_combo_box[1] = 
$this->cats->formatted_xslt_list(array('format'=>'filter','selected' => 
$this->cat_id,'globals' => True));
+                               $values_combo_box[2] = 
$this->cats->formatted_xslt_list(array('format'=>'filter','selected' => 
$this->cat_id,'globals' => True));
                                $default_value = array ('cat_id'=>'','name'=> 
lang('no category'));
-                               array_unshift 
($values_combo_box[1]['cat_list'],$default_value);
+                               array_unshift 
($values_combo_box[2]['cat_list'],$default_value);
 
-                               $values_combo_box[2]  = 
$this->bo->select_status_list('filter',$this->status_id);
-                               array_unshift ($values_combo_box[2],array 
('id'=>'all','name'=> lang('all')));
-                               array_unshift ($values_combo_box[2],array 
('id'=>'open','name'=> lang('open')));
+                               $values_combo_box[3]  = 
$this->bo->select_status_list('filter',$this->status_id);
+                               array_unshift ($values_combo_box[3],array 
('id'=>'all','name'=> lang('all')));
+                               array_unshift ($values_combo_box[3],array 
('id'=>'open','name'=> lang('open')));
 
-                               $values_combo_box[3]  = 
$this->bocommon->select_category_list(array('format'=>'filter','selected' => 
$this->wo_hour_cat_id,'type' =>'wo_hours','order'=>'id'));
+                               $values_combo_box[4]  = 
$this->bocommon->select_category_list(array('format'=>'filter','selected' => 
$this->wo_hour_cat_id,'type' =>'wo_hours','order'=>'id'));
                                $default_value = array 
('id'=>'','name'=>lang('no hour category'));
-                               array_unshift 
($values_combo_box[3],$default_value);
+                               array_unshift 
($values_combo_box[4],$default_value);
 
-                               $values_combo_box[4]  = 
$this->bo->get_criteria_list($this->criteria_id);
+                               $values_combo_box[5]  = 
$this->bo->get_criteria_list($this->criteria_id);
                                $default_value = array 
('id'=>'','name'=>lang('no criteria'));
-                               array_unshift 
($values_combo_box[4],$default_value);
+                               array_unshift 
($values_combo_box[5],$default_value);
 
-                               $values_combo_box[5]  = 
$this->bo->get_user_list($this->filter);
-                               array_unshift 
($values_combo_box[5],array('id'=>$GLOBALS['phpgw_info']['user']['account_id'],'name'=>lang('mine
 projects')));
+                               $values_combo_box[6]  = 
$this->bo->get_user_list($this->filter);
+                               array_unshift 
($values_combo_box[6],array('id'=>$GLOBALS['phpgw_info']['user']['account_id'],'name'=>lang('mine
 projects')));
                                $default_value = array 
('id'=>'','name'=>lang('no user'));
-                               array_unshift 
($values_combo_box[5],$default_value);
+                               array_unshift 
($values_combo_box[6],$default_value);
 
 
                                $datatable['actions']['form'] = array
@@ -298,12 +305,21 @@
                                                        (
                                                                array
                                                                ( //boton       
DISTRICT
+                                                                       'id' => 
'btn_project_type',
+                                                                       'name' 
=> 'project_type_id',
+                                                                       'value' 
=> lang('project type'),
+                                                                       'type' 
=> 'button',
+                                                                       'style' 
=> 'filter',
+                                                                       
'tab_index' => 1
+                                                               ),
+                                                               array
+                                                               ( //boton       
DISTRICT
                                                                        'id' => 
'btn_district_id',
                                                                        'name' 
=> 'district_id',
                                                                        'value' 
=> lang('district'),
                                                                        'type' 
=> 'button',
                                                                        'style' 
=> 'filter',
-                                                                       
'tab_index' => 1
+                                                                       
'tab_index' => 2
                                                                ),
                                                                array
                                                                ( //boton       
CATEGORY
@@ -312,7 +328,7 @@
                                                                        'value' 
=> lang('Category'),
                                                                        'type' 
=> 'button',
                                                                        'style' 
=> 'filter',
-                                                                       
'tab_index' => 2
+                                                                       
'tab_index' => 3
                                                                ),
                                                                array
                                                                ( //boton       
STATUS
@@ -321,7 +337,7 @@
                                                                        'value' 
=> lang('Status'),
                                                                        'type' 
=> 'button',
                                                                        'style' 
=> 'filter',
-                                                                       
'tab_index' => 3
+                                                                       
'tab_index' => 4
                                                                ),
                                                                array
                                                                ( //boton       
HOUR CATEGORY
@@ -330,7 +346,7 @@
                                                                        'value' 
=> lang('Hour category'),
                                                                        'type' 
=> 'button',
                                                                        'style' 
=> 'filter',
-                                                                       
'tab_index' => 4
+                                                                       
'tab_index' => 5
                                                                ),
                                                                array
                                                                ( //boton       
search criteria
@@ -339,7 +355,7 @@
                                                                        'value' 
=> lang('search criteria'),
                                                                        'type' 
=> 'button',
                                                                        'style' 
=> 'filter',
-                                                                       
'tab_index' => 5
+                                                                       
'tab_index' => 6
                                                                ),/*
                                                                array
                                                                ( //boton       
USER
@@ -348,7 +364,7 @@
                                                                        'value' 
=> lang('User'),
                                                                        'type' 
=> 'button',
                                                                        'style' 
=> 'filter',
-                                                                       
'tab_index' => 5
+                                                                       
'tab_index' => 6
                                                                ),*/
                                                                        array
                                                                        ( 
//boton       USER
@@ -360,7 +376,7 @@
                                                                                
'style' => 'filter',
                                                                                
'values' => $values_combo_box[5],
                                                                                
'onchange'=> 'onChangeSelect("filter");',
-                                                                               
'tab_index' => 6
+                                                                               
'tab_index' => 7
                                                                        ),
                                                                //for link 
"columns", next to Export button
                                                                array
@@ -373,21 +389,21 @@
                                                                                
'menuaction' => 'property.uiproject.columns'
                                                                        
))."','','width=300,height=600,scrollbars=1')",
                                                                        'value' 
=> lang('columns'),
-                                                                       
'tab_index' => 12
+                                                                       
'tab_index' => 13
                                                                ),
                                                                array
                                                                (
                                                                        'type'  
=> 'button',
                                                                        'id'    
=> 'btn_export',
                                                                        'value' 
=> lang('download'),
-                                                                       
'tab_index' => 11
+                                                                       
'tab_index' => 12
                                                                ),
                                                                array
                                                                (
                                                                        'type'  
=> 'button',
                                                                        'id'    
=> 'btn_new',
                                                                        'value' 
=> lang('add'),
-                                                                       
'tab_index' => 10
+                                                                       
'tab_index' => 11
                                                                ),
                                                                array
                                                                ( //hidden 
start_date
@@ -415,7 +431,7 @@
                                                                                
'menuaction' => 'property.uiproject.date_search')
                                                                        
)."','','width=350,height=250')",
                                                                        'value' 
=> lang('Date search'),
-                                                                       
'tab_index' => 9
+                                                                       
'tab_index' => 10
                                                                ),
                                                                // FIXME test 
on lightbox for date search
                        /*
@@ -434,7 +450,7 @@
                                                                        'name' 
=> 'search',
                                                                        'value' 
   => lang('search'),
                                                                        'type' 
=> 'button',
-                                                                       
'tab_index' => 8
+                                                                       
'tab_index' => 9
                                                                ),
                                                                array
                                                                ( // TEXT INPUT
@@ -444,7 +460,7 @@
                                                                        'type' 
=> 'text',
                                                                        
'onkeypress' => 'return pulsar(event)',
                                                                        'size'  
  => 28,
-                                                                       
'tab_index' => 7
+                                                                       
'tab_index' => 8
                                                                ),
                                                        ),
                                                        'hidden_value' => array
@@ -457,12 +473,12 @@
                                                                array
                                                                ( //div values  
combo_box_1
                                                                        'id' => 
'values_combo_box_1',
-                                                                       'value' 
=> $this->bocommon->select2String($values_combo_box[1]['cat_list'], 'cat_id') 
//i.e.  id,value/id,vale/
+                                                                       'value' 
=> $this->bocommon->select2String($values_combo_box[1])
                                                                ),
                                                                array
                                                                ( //div values  
combo_box_2
                                                                        'id' => 
'values_combo_box_2',
-                                                                       'value' 
=> $this->bocommon->select2String($values_combo_box[2])
+                                                                       'value' 
=> $this->bocommon->select2String($values_combo_box[2]['cat_list'], 'cat_id') 
//i.e.  id,value/id,vale/
                                                                ),
                                                                array
                                                                ( //div values  
combo_box_3
@@ -473,6 +489,11 @@
                                                                ( //div values  
combo_box_4
                                                                        'id' => 
'values_combo_box_4',
                                                                        'value' 
=> $this->bocommon->select2String($values_combo_box[4])
+                                                               ),
+                                                               array
+                                                               ( //div values  
combo_box_5
+                                                                       'id' => 
'values_combo_box_5',
+                                                                       'value' 
=> $this->bocommon->select2String($values_combo_box[5])
                                                                )/*,
                                                                array
                                                                ( //div values  
combo_box_5
@@ -1427,7 +1448,7 @@
                                        $values['origin'] = '';
                                }
 
-                               if(!isset($values['workorder_budget']) && $save 
&& !$_transfer_new_project)
+                               if(!isset($values['workorder_budget']) && $save 
&& !$_transfer_new_project && !$values['project_type_id']==3)
                                {
                                        
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uiworkorder.edit', 'project_id'=> $id));
                                }
@@ -1681,14 +1702,20 @@
                        {
                                $content_budget = $this->bo->get_budget($id);
                                $lang_delete = lang('Check to delete period');
-                               $lang_delete = lang('Check to close period');
+                               $lang_close = lang('Check to close period');
+                               $lang_active = lang('Check to activate period');
+
                                foreach($content_budget as & $b_entry)
                                {
                                        $checked = $b_entry['closed'] ? 
'checked="checked"' : '';
-                                       
+                                       $checked2 = $b_entry['active'] ? 
'checked="checked"' : '';                                      
+
+                                       $b_entry['flag_active'] = 
$b_entry['active'];
                                        $b_entry['delete_year'] = "<input 
type='checkbox' name='values[delete_b_period][]' 
value='{$b_entry['year']}_{$b_entry['month']}' title='{$lang_delete}'>";
                                        $b_entry['closed'] = "<input 
type='checkbox' name='values[closed_b_period][]' 
value='{$b_entry['year']}_{$b_entry['month']}' title='{$lang_close}' $checked>";
                                        $b_entry['closed_orig'] = "<input 
type='checkbox' name='values[closed_orig_b_period][]' 
value='{$b_entry['year']}_{$b_entry['month']}' $checked>";
+                                       $b_entry['active'] = "<input 
type='checkbox' name='values[active_b_period][]' 
value='{$b_entry['year']}_{$b_entry['month']}' title='{$lang_active}' 
$checked2>";
+                                       $b_entry['active_orig'] = "<input 
type='checkbox' name='values[active_orig_b_period][]' 
value='{$b_entry['year']}_{$b_entry['month']}' $checked2>";
                                        $value_remainder -= 
$b_entry['sum_orders'];
                                        $value_remainder -= 
$b_entry['actual_cost'];
                                }
@@ -1724,9 +1751,19 @@
                                                                                
                                array('key' => 
'deviation_percent','label'=>lang('deviation') . '::' . 
lang('percent'),'sortable'=>false,'resizeable'=>true,'formatter'=>'FormatterAmount2'),
                                                                                
                                array('key' => 
'closed','label'=>lang('closed'),'sortable'=>false,'resizeable'=>true,'formatter'=>'FormatterCenter'),
                                                                                
                                array('key' => 'closed_orig','hidden' => true),
+                                                                               
                                array('key' => 
'active','label'=>lang('active'),'sortable'=>false,'resizeable'=>true,'formatter'=>'FormatterCenter'),
+                                                                               
                                array('key' => 'active_orig','hidden' => true),
+                                                                               
                                array('key' => 'flag_active','hidden' => true),
                                                                                
                                array('key' => 
'delete_year','label'=>lang('Delete'),'sortable'=>false,'resizeable'=>true,'formatter'=>'FormatterCenter')))
                                );
 
+/*
+                                                                               
                                array('key' => 'subtract_sum_orders','hidden' 
=> true),
+                                                                               
                                array('key' => 'subtract_actual_cost','hidden' 
=> true),
+                                                                               
                                array('key' => 'subtract_budget','hidden' => 
true),
+
+*/
+
 //_debug_array($values['workorder_budget']);die();
                        $datavalues[1] = array
                                (
@@ -1884,8 +1921,31 @@
 
                        $periodization_list = 
$this->bo->get_periodizations_with_outline();
 
+                       $sub_entry_action_data = array();
+
+                       if($id && !$values['project_type_id']==3)
+                       {
+                               $sub_entry_action_data = array
+                               (
+                                       'menuaction'    => 
'property.uiworkorder.edit',
+                                       'project_id'    => $id
+                               );
+                       }
+                       else if($id && $values['project_type_id']==3)
+                       {
+                               $sub_entry_action_data = array
+                               (
+                                       'menuaction'    => 
'property.uiproject.edit',
+                                       'bypass'                => 1,
+                                       'parent_id'             => $id,
+                                       'origin'                => '.project',
+                                       'origin_id'             => $id
+                               );
+                       }
+
                        $data = array
                                (
+                                       'project_types'                         
                => array('options' => 
$this->bo->get_project_types($values['project_type_id'])),
                                        'inherit_location'                      
                => $id ? $values['inherit_location'] : 1,
                                        'mode'                                  
                        => $mode,
                                        'suppressmeter'                         
                => isset($config->config_data['project_suppressmeter']) && 
$config->config_data['project_suppressmeter'] ? 1 : '',
@@ -1912,9 +1972,11 @@
                                        'lang_delete_request_statustext'        
=> lang('Check to delete this request from this project'),
                                        'link_select_request'                   
        => $GLOBALS['phpgw']->link('/index.php',$link_request_data),
                                        'link_request'                          
                => $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uirequest.view')),
-                                       'add_workorder_action'                  
        => $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiworkorder.edit')),
-                                       'lang_add_workorder'                    
        => lang('Add workorder'),
-                                       'lang_add_workorder_statustext'         
=> lang('Add a workorder to this project'),
+
+                                       'add_sub_entry_action'                  
        => $GLOBALS['phpgw']->link('/index.php', $sub_entry_action_data ),
+
+                                       'lang_add_sub_entry'                    
        => $values['project_type_id']==3 ? lang('add project') : lang('Add 
workorder'),
+                                       'lang_add_sub_entry_statustext'         
=> $values['project_type_id']==3 ? lang('add a project to this buffer') : 
lang('Add a workorder to this project'),
                                        'lang_no_workorders'                    
        => lang('No workorder budget'),
                                        'workorder_link'                        
                => $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiworkorder.edit')),
                                        'record_history'                        
                => $record_history,
@@ -2128,6 +2190,7 @@
                        {
                                $ids = 
array_values(explode(',',trim($id_to_update,',')));
                        }
+
                        else
                        {
                                $ids = array();
@@ -2422,7 +2485,7 @@
                                'myColumnDefs'                                  
        => $myColumnDefs,
                                'myButtons'                                     
                => $myButtons,
                                'msgbox_data'                                   
        => $GLOBALS['phpgw']->common->msgbox($msgbox_data),
-                               'add_workorder_action'                          
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiworkorder.edit')),
+                               'add_sub_entry_action'                          
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiworkorder.edit')),
                                'lang_start_date_statustext'            => 
lang('Select the estimated end date for the Project'),
                                'lang_start_date'                               
        => lang('Project start date'),
                                'value_start_date'                              
        => $values['start_date'],

Modified: trunk/property/js/yahoo/project.edit.js
===================================================================
--- trunk/property/js/yahoo/project.edit.js     2012-12-17 13:28:26 UTC (rev 
10606)
+++ trunk/property/js/yahoo/project.edit.js     2012-12-17 14:04:13 UTC (rev 
10607)
@@ -90,14 +90,37 @@
        }
 
 
/********************************************************************************/
+
+       this.getTotalSum_active = 
function(name_column,round,paginator,datatable)
+       {
+               if(!paginator.getPageRecords())
+               {
+                       return '0,00';
+               }
+               begin = end = 0;
+               end = datatable.getRecordSet().getLength();
+
+               tmp_sum = 0;
+               for(i = begin; i < end; i++)
+               {
+                       
if(datatable.getRecordSet().getRecords(0)[i].getData('flag_active'))
+                       {
+                               tmp_sum = tmp_sum + 
parseFloat(datatable.getRecordSet().getRecords(0)[i].getData(name_column));
+                       }
+               }
+
+               return tmp_sum = YAHOO.util.Number.format(tmp_sum, 
{decimalPlaces:round, decimalSeparator:",", thousandsSeparator:" "});
+       }
+
+
        this.addFooterDatatable0 = function(paginator,datatable)
        {
                //call getTotalSum(name of column) in property.js
-               tmp_sum1 = getTotalSum('budget',0,paginator,datatable);
-               tmp_sum2 = getTotalSum('sum_orders',0,paginator,datatable);
-               tmp_sum3 = getTotalSum('actual_cost',0,paginator,datatable);
-               tmp_sum4 = getTotalSum('diff',0,paginator,datatable);
-               tmp_sum5 = getTotalSum('deviation',0,paginator,datatable);
+               tmp_sum1 = getTotalSum_active('budget',0,paginator,datatable);
+               tmp_sum2 = 
getTotalSum_active('sum_orders',0,paginator,datatable);
+               tmp_sum3 = 
getTotalSum_active('actual_cost',0,paginator,datatable);
+               tmp_sum4 = getTotalSum_active('diff',0,paginator,datatable);
+               tmp_sum5 = 
getTotalSum_active('deviation',0,paginator,datatable);
 
                if(typeof(tableYUI0)=='undefined')
                {
@@ -119,7 +142,7 @@
                td_sum(tmp_sum3);
                td_sum(tmp_sum4);
                td_sum(tmp_sum5);
-               td_empty(4);
+               td_empty(7);
 
                myfoot = tableYUI0.createTFoot();
                myfoot.setAttribute("id","myfoot");

Modified: trunk/property/js/yahoo/project.index.js
===================================================================
--- trunk/property/js/yahoo/project.index.js    2012-12-17 13:28:26 UTC (rev 
10606)
+++ trunk/property/js/yahoo/project.index.js    2012-12-17 14:04:13 UTC (rev 
10607)
@@ -2,14 +2,15 @@
 // Declaration of location.index vars
 //--------------------------------------------------------
        //define SelectButton
-       var oMenuButton_0, oMenuButton_1, oMenuButton_2, oMenuButton_3, 
oMenuButton_4;
+       var oMenuButton_0, oMenuButton_1, oMenuButton_2, oMenuButton_3, 
oMenuButton_4, oMenuButton_5;
        var selectsButtons = [
-       {order:0, 
var_URL:'district_id',name:'btn_district_id',style:'districtbutton',dependiente:''},
-       {order:1, 
var_URL:'cat_id',name:'btn_cat_id',style:'categorybutton',dependiente:''},
-       {order:2, 
var_URL:'status_id',name:'btn_status_id',style:'districtbutton',dependiente:''},
-       {order:3, 
var_URL:'wo_hour_cat_id',name:'btn_hour_category_id',style:'partOFTownbutton',dependiente:''},
+       {order:0, 
var_URL:'project_type_id',name:'btn_project_type',style:'districtbutton',dependiente:''},
+       {order:1, 
var_URL:'district_id',name:'btn_district_id',style:'districtbutton',dependiente:''},
+       {order:2, 
var_URL:'cat_id',name:'btn_cat_id',style:'categorybutton',dependiente:''},
+       {order:3, 
var_URL:'status_id',name:'btn_status_id',style:'districtbutton',dependiente:''},
+       {order:4, 
var_URL:'wo_hour_cat_id',name:'btn_hour_category_id',style:'partOFTownbutton',dependiente:''},
 //     {order:4, var_URL:'filter', 
name:'btn_user_id',style:'ownerIdbutton',dependiente:''},
-       {order:4, var_URL:'criteria_id', 
name:'btn_criteria_id',style:'criteriabutton',dependiente:''}
+       {order:5, var_URL:'criteria_id', 
name:'btn_criteria_id',style:'criteriabutton',dependiente:''}
        ];
 
        // define buttons
@@ -81,41 +82,48 @@
        {
                if(flag_particular_setting=='init')
                {
-                       //district
-                       index = 
locate_in_array_options(0,"value",path_values.district_id);
+                       //project_type
+                       index = 
locate_in_array_options(0,"value",path_values.project_type_id);
                        if(index)
                        {
                                oMenuButton_0.set("label", ("<em>" + 
array_options[0][index][1] + "</em>"));
                        }
 
-                       //category
-                       index = 
locate_in_array_options(1,"value",path_values.cat_id);
+                       //district
+                       index = 
locate_in_array_options(1,"value",path_values.district_id);
                        if(index)
                        {
                                oMenuButton_1.set("label", ("<em>" + 
array_options[1][index][1] + "</em>"));
                        }
 
-                       //status
-                       index = 
locate_in_array_options(2,"value",path_values.status_id);
+                       //category
+                       index = 
locate_in_array_options(2,"value",path_values.cat_id);
                        if(index)
                        {
                                oMenuButton_2.set("label", ("<em>" + 
array_options[2][index][1] + "</em>"));
                        }
 
-                       //wo_hour_cat_id
-                       index = 
locate_in_array_options(3,"value",path_values.wo_hour_cat_id);
+                       //status
+                       index = 
locate_in_array_options(3,"value",path_values.status_id);
                        if(index)
                        {
                                oMenuButton_3.set("label", ("<em>" + 
array_options[3][index][1] + "</em>"));
                        }
 
-                       //criteria
-                       index = 
locate_in_array_options(4,"value",path_values.criteria_id);
+                       //wo_hour_cat_id
+                       index = 
locate_in_array_options(4,"value",path_values.wo_hour_cat_id);
                        if(index)
                        {
                                oMenuButton_4.set("label", ("<em>" + 
array_options[4][index][1] + "</em>"));
                        }
 
+                       //criteria
+                       index = 
locate_in_array_options(5,"value",path_values.criteria_id);
+                       if(index)
+                       {
+                               oMenuButton_5.set("label", ("<em>" + 
array_options[5][index][1] + "</em>"));
+                       }
+
 /*
                        //user
                        index = 
locate_in_array_options(4,"value",path_values.user_id);

Modified: trunk/property/setup/phpgw_no.lang
===================================================================
--- trunk/property/setup/phpgw_no.lang  2012-12-17 13:28:26 UTC (rev 10606)
+++ trunk/property/setup/phpgw_no.lang  2012-12-17 14:04:13 UTC (rev 10607)
@@ -227,6 +227,7 @@
 billable rate changed  property        no      Fakturerbar sats endret
 billable hours has been updated        property        no      Egne timer er 
oppdatert
 bill per unit  property        no      Pris pr enhet, ex mva
+buffer property        no      Buffer
 bulk update status     property        no      Masseoppdatering av status
 branch property        no      Fag
 b - responsible        property        no      Anviser
@@ -1164,6 +1165,7 @@
 open edit in new window        property        no      Åpne endring i nytt 
vindu
 open JasperReport %1 in new window     property        no      Åpne 
JasperReport %1 i nytt vindu
 open view in new window        property        no      Åpne visning i nytt 
vindu
+operation      property        no      Drift
 order  property        no      Bestilling
 order approval revoked property        no      Bestillingsgodkjenning opphevet
 order approved property        no      Bestilling godkjent
@@ -1294,6 +1296,7 @@
 prizing        property        no      Priser
 probability    property        no      Sannsynlighet
 project        property        no      prosjekt
+project type   property        no      Prosjekt type
 .project       property        no      Prosjekt
 project.condition_survey       property        no      Tilstandsanalyse
 project.workorder      property        no      Prosjekt::Bestilling

Modified: trunk/property/setup/tables_current.inc.php
===================================================================
--- trunk/property/setup/tables_current.inc.php 2012-12-17 13:28:26 UTC (rev 
10606)
+++ trunk/property/setup/tables_current.inc.php 2012-12-17 14:04:13 UTC (rev 
10607)
@@ -1481,6 +1481,8 @@
                'fm_project' => array(
                        'fd' => array(
                                'id' => array('type' => 'int','precision' => 
'4','nullable' => False),
+                               'parent_id' => array('type' => 
'int','precision' => '4','nullable' => true),
+                               'project_type_id' => array('type' => 
'int','precision' => '2','nullable' => true),
                                'name' => array('type' => 'varchar','precision' 
=> '255','nullable' => False),
                                'user_id' => array('type' => 'int','precision' 
=> '4','nullable' => False),
                                'access' => array('type' => 
'varchar','precision' => '7','nullable' => True),
@@ -1530,6 +1532,7 @@
                                'budget' => array('type' => 
'decimal','precision' => '20','scale' => '2','nullable' => True,'default' => 
'0.00'),
                                'order_amount' => array('type' => 
'decimal','precision' => '20','scale' => '2','nullable' => True,'default' => 
'0.00'),
                                'closed' => array('type' => 'int','precision' 
=> 2,'nullable' => True),
+                               'active' => array('type' => 'int','precision' 
=> 2,'nullable' => True),
                                'user_id' => array('type' => 'int','precision' 
=> 4,'nullable' => True),
                                'entry_date' => array('type' => 
'int','precision' => 4,'nullable' => True),
                                'modified_date' => array('type' => 
'int','precision' => 4,'nullable' => True)

Modified: trunk/property/setup/tables_update.inc.php
===================================================================
--- trunk/property/setup/tables_update.inc.php  2012-12-17 13:28:26 UTC (rev 
10606)
+++ trunk/property/setup/tables_update.inc.php  2012-12-17 14:04:13 UTC (rev 
10607)
@@ -7011,3 +7011,43 @@
                        return $GLOBALS['setup_info']['property']['currentver'];
                }
        }
+
+       /**
+       * Update property version from 0.9.17.657 to 0.9.17.658
+       * Add project types
+       */
+       $test[] = '0.9.17.657';
+       function property_upgrade0_9_17_657()
+       {
+               $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+
+               
$GLOBALS['phpgw_setup']->oProc->AddColumn('fm_project','parent_id',array(
+                       'type'          => 'int',
+                       'precision'     => 4,
+                       'nullable'      => true
+                       )
+               );
+
+               
$GLOBALS['phpgw_setup']->oProc->AddColumn('fm_project','project_type_id',array(
+                       'type'          => 'int',
+                       'precision'     => 2,
+                       'nullable'      => true
+                       )
+               );
+
+               
$GLOBALS['phpgw_setup']->oProc->AddColumn('fm_project_budget','active',array(
+                       'type'          => 'int',
+                       'precision'     => 2,
+                       'nullable'      => true
+                       )
+               );
+
+// tabell for fm_project_buffer_budget
+
+               if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+               {
+                       $GLOBALS['setup_info']['property']['currentver'] = 
'0.9.17.658';
+                       return $GLOBALS['setup_info']['property']['currentver'];
+               }
+       }
+

Modified: trunk/property/templates/base/project.xsl
===================================================================
--- trunk/property/templates/base/project.xsl   2012-12-17 13:28:26 UTC (rev 
10606)
+++ trunk/property/templates/base/project.xsl   2012-12-17 14:04:13 UTC (rev 
10607)
@@ -36,9 +36,9 @@
                <script type="text/javascript">
                        self.name="first_Window";
                        <xsl:value-of select="lookup_functions"/>
-                       function add_workorder()
+                       function add_sub_entry()
                        {
-                               document.add_workorder_form.submit();
+                               document.add_sub_entry_form.submit();
                        }
                </script>
                <table cellpadding="2" cellspacing="2" align="center">
@@ -54,12 +54,12 @@
                        <xsl:choose>
                                <xsl:when test="value_project_id &gt; 0  and 
mode='edit'">
                                        <td valign="top">
-                                               <xsl:variable 
name="lang_add_workorder">
-                                                       <xsl:value-of 
select="lang_add_workorder"/>
+                                               <xsl:variable 
name="lang_add_sub_entry">
+                                                       <xsl:value-of 
select="lang_add_sub_entry"/>
                                                </xsl:variable>
-                                               <input type="button" 
name="add_workorder" value="{$lang_add_workorder}" onClick="add_workorder()">
+                                               <input type="button" 
name="add_sub_entry" value="{$lang_add_sub_entry}" onClick="add_sub_entry()">
                                                        <xsl:attribute 
name="title">
-                                                               <xsl:value-of 
select="lang_add_workorder_statustext"/>
+                                                               <xsl:value-of 
select="lang_add_sub_entry_statustext"/>
                                                        </xsl:attribute>
                                                </input>
                                        </td>
@@ -169,6 +169,22 @@
                                                        </xsl:choose>
                                                        <tr>
                                                                <td 
valign="top">
+                                                                       
<xsl:value-of select="php:function('lang', 'project type')"/>
+                                                               </td>
+                                                               <td>
+                                                                       <select 
name="values[project_type_id]">
+                                                                               
<xsl:attribute name="title">
+                                                                               
        <xsl:value-of select="php:function('lang', 'project type')"/>
+                                                                               
</xsl:attribute>
+                                                                               
<option value="0">
+                                                                               
        <xsl:value-of select="php:function('lang', 'select')"/>
+                                                                               
</option>
+                                                                               
<xsl:apply-templates select="project_types/options"/>
+                                                                       
</select>
+                                                               </td>
+                                                       </tr>
+                                                       <tr>
+                                                               <td 
valign="top">
                                                                        
<xsl:value-of select="lang_name"/>
                                                                </td>
                                                                <td>
@@ -714,8 +730,8 @@
                <!-- AQUI VA EL SCRIPT -->
                <xsl:choose>
                        <xsl:when test="mode='edit'">
-                               <xsl:variable 
name="add_workorder_action"><xsl:value-of 
select="add_workorder_action"/>&amp;project_id=<xsl:value-of 
select="value_project_id"/></xsl:variable>
-                               <form method="post" name="add_workorder_form" 
action="{$add_workorder_action}">
+                               <xsl:variable 
name="add_sub_entry_action"><xsl:value-of 
select="add_sub_entry_action"/></xsl:variable>
+                               <form method="post" name="add_sub_entry_form" 
action="{$add_sub_entry_action}">
                                </form>
                        </xsl:when>
                </xsl:choose>




reply via email to

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