fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [10744] property: set default status on project / ord


From: Sigurd Nes
Subject: [Fmsystem-commits] [10744] property: set default status on project / order on asking for approval
Date: Sun, 03 Feb 2013 15:55:53 +0000

Revision: 10744
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=10744
Author:   sigurdne
Date:     2013-02-03 15:55:52 +0000 (Sun, 03 Feb 2013)
Log Message:
-----------
property: set default status on project / order on asking for approval

Modified Paths:
--------------
    trunk/property/inc/class.uiproject.inc.php
    trunk/property/inc/class.uiworkorder.inc.php
    trunk/property/inc/hook_config.inc.php
    trunk/property/templates/base/config.tpl
    trunk/property/templates/base/status_select.xsl

Modified: trunk/property/inc/class.uiproject.inc.php
===================================================================
--- trunk/property/inc/class.uiproject.inc.php  2013-02-03 14:08:14 UTC (rev 
10743)
+++ trunk/property/inc/class.uiproject.inc.php  2013-02-03 15:55:52 UTC (rev 
10744)
@@ -193,7 +193,7 @@
                        $GLOBALS['phpgw_info']['flags']['menu_selection'] .= 
'::project';
                        if($this->cat_id)
                        {
-                               
$GLOBALS['phpgw_info']['flags']['menu_selection'] .= "::{$this->cat_id}";       
                
+                               
$GLOBALS['phpgw_info']['flags']['menu_selection'] .= "::{$this->cat_id}";
                        }
 
                        if(!$this->acl_read)
@@ -387,7 +387,7 @@
                                                                ),
                                                                array
                                                                (
-                                                                       'id' => 
'sel_filter', 
+                                                                       'id' => 
'sel_filter',
                                                                        'name' 
=> 'filter',
                                                                        'value' 
=> lang('User'),
                                                                        'type' 
=> 'select',
@@ -829,7 +829,7 @@
 
                        if($dry_run)
                        {
-                               $datatable['pagination']['records_returned'] = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'];           
         
+                               $datatable['pagination']['records_returned'] = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'];
                        }
                        else
                        {
@@ -1003,7 +1003,7 @@
 
                                if(!$id)
                                {
-                                       phpgwapi_cache::message_set('ID is 
required for the function uiproject::view()', 'error'); 
+                                       phpgwapi_cache::message_set('ID is 
required for the function uiproject::view()', 'error');
                                        
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uiproject.index'));
                                }
                        }
@@ -1141,7 +1141,7 @@
                                        );
                                }
 
-       
+
                                $save='';
                                if (isset($values['save']))
                                {
@@ -1167,7 +1167,7 @@
                                                        $error_id=true;
                                                }
                                        }
-       
+
                                        if(!isset($values['location']))
                                        {
                                                
$receipt['error'][]=array('msg'=>lang('Please select a location !'));
@@ -1271,6 +1271,14 @@
                                                }
                                        }
 
+                                       if ($values['approval'] && 
$values['mail_address'] && $config->config_data['project_approval'])
+                                       {
+                                               
if(isset($config->config_data['project_approval_status']) && 
$config->config_data['project_approval_status'])
+                                               {
+                                                       $values['status'] = 
$config->config_data['project_approval_status'];
+                                               }
+                                       }
+
                                        if($id)
                                        {
                                                $values['id'] = $id;
@@ -1315,7 +1323,7 @@
                                                        {
                                                                
$bofiles->create_document_dir("project/$id");
                                                                
$bofiles->vfs->override_acl = 1;
-       
+
                                                                
if(!$bofiles->vfs->cp (array (
                                                                        'from'  
=> $_FILES['file']['tmp_name'],
                                                                        'to'    
=> $to_file,
@@ -1400,14 +1408,14 @@
                                                                        }
                                                                }
                                                        }
-                                               
+
                                                        $notify_list = 
execMethod('property.notify.read', array
                                                                (
                                                                        
'location_id'           => $location_id,
                                                                        
'location_item_id'      => $id
                                                                )
                                                        );
-                                               
+
                                                        $subject=lang('project 
%1 has been edited',$id);
 
                                                        
if(isset($GLOBALS['phpgw_info']['user']['apps']['sms']))
@@ -1425,13 +1433,13 @@
                                                                        }
                                                                }
                                                                unset($entry);
-       
+
                                                                if($toarray_sms)
                                                                {
-                                                                       
$historylog->add('MS',$id,implode(',',$toarray_sms));                           
                
+                                                                       
$historylog->add('MS',$id,implode(',',$toarray_sms));
                                                                }
                                                        }
-                                               
+
                                                        reset($notify_list);
                                                        foreach($notify_list as 
$entry)
                                                        {
@@ -1502,7 +1510,7 @@
                        if(isset($bypass_error) || ((!isset($receipt['error']) 
|| $add_request) && !$bypass) && $id)
                        {
                                $_transfer_new_project = 
isset($values['new_project_id']) && $values['new_project_id'] ? true : false;
-                               
+
                                $values = $this->bo->read_single($id);
 
                                if(!isset($values['origin']))
@@ -1647,7 +1655,7 @@
                                if(isset($config->config_data['invoice_acl']) 
&& $config->config_data['invoice_acl'] == 'dimb')
                                {
                                        $supervisor_id = 
$invoice->get_default_dimb_role_user(2, $values['ecodimb']);
-                                       $prefs = 
$this->bocommon->create_preferences('property',$supervisor_id);                 
               
+                                       $prefs = 
$this->bocommon->create_preferences('property',$supervisor_id);
                                        $supervisor_email[] = array
                                        (
                                                'id'      => $supervisor_id,
@@ -1759,7 +1767,7 @@
                                'project_group_descr'   => 
$values['project_group_descr']));
 
 
-                       //---datatable 
settings---------------------------------------------------      
+                       //---datatable 
settings---------------------------------------------------
 
                        $sum_actual_cost = 0;
                        $sum_oblications = 0;
@@ -1782,7 +1790,7 @@
                                        }
 
                                        $checked = $b_entry['closed'] ? 
'checked="checked"' : '';
-                                       $checked2 = $b_entry['active'] ? 
'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}'>";
@@ -1790,7 +1798,7 @@
                                        $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>";
-                                       
+
                                }
                                unset($b_entry);
                        }
@@ -1830,7 +1838,7 @@
                                $content_budget = 
$this->bo->get_buffer_budget($id);
                                foreach($content_budget as & $b_entry)
                                {
-                                       $b_entry['entry_date'] = 
$GLOBALS['phpgw']->common->show_date($b_entry['entry_date'],$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
                            
+                                       $b_entry['entry_date'] = 
$GLOBALS['phpgw']->common->show_date($b_entry['entry_date'],$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
                                }
                                unset($b_entry);
                        }
@@ -1900,7 +1908,7 @@
                                                                                
                                array('key' => 
'status','label'=>lang('Status'),'sortable'=>true,'resizeable'=>true)))
                                );
 
-               
+
                        $invoices = array();
                        if ($id)
                        {
@@ -1918,7 +1926,7 @@
                                        'voucher_out_id'                => 
$entry['voucher_out_id'],
                                        'workorder_id'                  => 
$entry['workorder_id'],
                                        'status'                                
=> $entry['status'],
-                                       'invoice_id'                    => 
$entry['invoice_id'],                                        
+                                       'invoice_id'                    => 
$entry['invoice_id'],
                                        'budget_account'                => 
$entry['budget_account'],
                                        'dima'                                  
=> $entry['dima'],
                                        'dimb'                                  
=> $entry['dimb'],
@@ -1932,7 +1940,7 @@
                                        'budget_responsible'    => 
$entry['budget_responsible'],
                                        'budsjettsigndato'              => 
$entry['budsjettsigndato'] ? 
$GLOBALS['phpgw']->common->show_date(strtotime($entry['budsjettsigndato']),$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'])
 : '',
                                        'transfer_time'                 => 
$entry['transfer_time'] ? 
$GLOBALS['phpgw']->common->show_date(strtotime($entry['transfer_time']),$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'])
 : '',
-                               );      
+                               );
                        }
 
                        $datavalues[2] = array
@@ -1974,7 +1982,7 @@
                                                                        'count' 
                        => count($myColumnDefs)
                                                                )
                                                        );
-                       
+
                        $datavalues[] = $notify_info['datavalues'];
 
                        $myColumnDefs[3] = $notify_info['column_defs'];
@@ -2020,7 +2028,7 @@
                        $link_view_file = 
$GLOBALS['phpgw']->link('/index.php',$link_file_data);
 
                        $_files = $this->bo->get_files($id);
-                       
+
                        $lang_view_file = lang('click to view file');
                        $lang_delete_file = lang('Check to delete file');
                        $z=0;
@@ -2037,7 +2045,7 @@
                                }
                                $content_files[$z]['delete_file'] = "<input 
type=\"checkbox\" name=\"values[file_action][]\" value=\"{$_file['name']}\" 
title=\"{$lang_delete_file}\">";
                                $z++;
-                       }                                                       
                
+                       }
 
                        $datavalues[5] = array
                        (
@@ -2111,7 +2119,7 @@
 
                        $selected_tab = phpgw::get_var('tab', 'string', 
'REQUEST', 'general');
                        $project_type_id = isset($values['project_type_id']) && 
$values['project_type_id'] ? $values['project_type_id'] : 
$GLOBALS['phpgw_info']['user']['preferences']['property']['default_project_type'];
-                       
+
                        $data = array
                                (
                                        'project_types'                         
                => array('options' => 
$this->bo->get_project_types($project_type_id)),
@@ -2390,7 +2398,7 @@
                        unset($_entry);
                        unset($budget_arr);
 
-//_debug_array($new_budget);die();                     
+//_debug_array($new_budget);die();
                        if(isset($_POST['user_id']))
                        {
                                $user_id        = phpgw::get_var('user_id', 
'int');
@@ -2399,7 +2407,7 @@
                        {
                                $user_id        = $this->account;
                        }
-                       
+
                        if($id_to_update)
                        {
                                $ids = 
array_values(explode(',',trim($id_to_update,',')));
@@ -2450,7 +2458,7 @@
                                                        
if($_budget_entry['active'])
                                                        {
                                                                $_obligation += 
$_budget_entry['sum_oblications'];
-                                                               $_order += 
$_budget_entry['sum_orders'];        
+                                                               $_order += 
$_budget_entry['sum_orders'];
                                                        }
                                                }
 
@@ -2460,7 +2468,7 @@
                                                $entry['new_budget'] .= "<input 
type='hidden' class='myValuesForPHP' id='{$entry['id']}::obligation' 
name='{$entry['id']}::obligation' value='{$_obligation}' ></input>";
                                                $entry['new_budget'] .= "<input 
type='hidden' class='myValuesForPHP' id='{$entry['id']}::order_amount' 
name='{$entry['id']}::order_amount' value='{$_order}'></input>";
                                                $entry['new_budget'] .= "<input 
type='hidden' class='myValuesForPHP' id='{$entry['id']}::latest_year' 
name='{$entry['id']}::latest_year' value='{$entry['latest_year']}'></input>";
-                                               
+
                                        }
                                }
                                else if ($entry['project_type_id'] == 2)
@@ -2511,7 +2519,7 @@
                                        $myColumnDefs[0] = array
                                        (
                                                'name'          => "0",
-                                               'values'        =>      
json_encode(array(      
+                                               'values'        =>      
json_encode(array(
                                                                                
                                array('key' => 
'project_id','label'=>lang('project'),'sortable'=>true,'resizeable'=>true),
                                                                                
                                array('key' => 
'id','label'=>lang('id'),'sortable'=>true,'resizeable'=>true,'formatter'=>'YAHOO.widget.DataTable.formatLink'),
                                                                                
                                array('key' => 
'start_date','label'=>lang('date'),'sortable'=>false,'resizeable'=>true),
@@ -2556,7 +2564,7 @@
                        {
                                array_unshift ($status_list_filter,array 
('id'=>'open','name'=> lang('open')));
                        }
-                       
+
                        $status_list_filter = 
$this->bocommon->select_list($status_filter,$status_list_filter);
 
                        $type_array = array
@@ -2671,7 +2679,7 @@
                                'project_group'                 => 
$values['project_group'],
                                'project_group_descr'   => 
$values['project_group_descr']));
 
-                       //---datatable 
settings---------------------------------------------------      
+                       //---datatable 
settings---------------------------------------------------
 
                        $datavalues[0] = array
                                (
@@ -2719,7 +2727,7 @@
                                                                                
                                array('key' => 
'value_new_value','label'=>lang('new 
value'),'sortable'=>true,'resizeable'=>true)))
                                );
 
-       
+
                        $invoices = array();
                        if ($id)
                        {
@@ -2737,7 +2745,7 @@
                                        'voucher_out_id'                => 
$entry['voucher_out_id'],
                                        'workorder_id'                  => 
$entry['workorder_id'],
                                        'status'                                
=> $entry['status'],
-                                       'invoice_id'                    => 
$entry['invoice_id'],                                        
+                                       'invoice_id'                    => 
$entry['invoice_id'],
                                        'budget_account'                => 
$entry['budget_account'],
                                        'dima'                                  
=> $entry['dima'],
                                        'dimb'                                  
=> $entry['dimb'],
@@ -2750,7 +2758,7 @@
                                        'budget_responsible'    => 
$entry['budget_responsible'],
                                        'budsjettsigndato'              => 
$entry['budsjettsigndato'] ? 
$GLOBALS['phpgw']->common->show_date(strtotime($entry['budsjettsigndato']),$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'])
 : '',
                                        'transfer_time'                 => 
$entry['transfer_time'] ? 
$GLOBALS['phpgw']->common->show_date(strtotime($entry['transfer_time']),$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'])
 : '',
-                               );      
+                               );
                        }
 
                        $datavalues[2] = array

Modified: trunk/property/inc/class.uiworkorder.inc.php
===================================================================
--- trunk/property/inc/class.uiworkorder.inc.php        2013-02-03 14:08:14 UTC 
(rev 10743)
+++ trunk/property/inc/class.uiworkorder.inc.php        2013-02-03 15:55:52 UTC 
(rev 10744)
@@ -748,7 +748,7 @@
 
                        if($dry_run)
                        {
-                               $datatable['pagination']['records_returned'] = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'];           
         
+                               $datatable['pagination']['records_returned'] = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'];
                        }
                        else
                        {
@@ -887,7 +887,7 @@
 
                                if(!$id)
                                {
-                                       phpgwapi_cache::message_set('ID is 
required for the function uiworkorder::view()', 'error'); 
+                                       phpgwapi_cache::message_set('ID is 
required for the function uiworkorder::view()', 'error');
                                        
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uiworkorder.index'));
                                }
                        }
@@ -1042,7 +1042,7 @@
 
                                
if(isset($config->config_data['workorder_require_vendor']) && 
$config->config_data['workorder_require_vendor'] == 1 && !$values['vendor_id'])
                                {
-                                       
$receipt['error'][]=array('msg'=>lang('no vendor'));                            
+                                       
$receipt['error'][]=array('msg'=>lang('no vendor'));
                                }
 
                                if(!$values['b_account_id'])
@@ -1079,6 +1079,14 @@
                                        
$receipt['error'][]=array('msg'=>lang('Percentage addition') . ': ' . 
lang('Please enter an integer !'));
                                }
 
+                               if ($values['approval'] && 
$values['mail_address'] && $config->config_data['workorder_approval'])
+                               {
+                                       
if(isset($config->config_data['workorder_approval_status']) && 
$config->config_data['workorder_approval_status'])
+                                       {
+                                               $values['status'] = 
$config->config_data['workorder_approval_status'];
+                                       }
+                               }
+
                                if($id)
                                {
                                        $values['id']=$id;
@@ -1228,10 +1236,10 @@
 
                                                if($toarray_sms)
                                                {
-                                                       
$historylog->add('MS',$id,implode(',',$toarray_sms));                           
                
+                                                       
$historylog->add('MS',$id,implode(',',$toarray_sms));
                                                }
                                        }
-                                               
+
                                        reset($notify_list);
                                        foreach($notify_list as $entry)
                                        {
@@ -1294,7 +1302,7 @@
                                                );
                                        }
                                        $result['receipt'] = $receipt;
-       
+
                                        return $result;
                                }
 
@@ -1434,7 +1442,7 @@
                                {
                                        $location_template_type='view';
                                }
-                               
+
                                
$location_data=$bolocation->initiate_ui_location(array(
                                        'values'                        => 
$_location_data,
                                        'type_id'                       => 
$mode == 'edit' ? $max_level : 
count(explode('-',$_location_data['location_data']['location_code'])),
@@ -1534,7 +1542,7 @@
                                if(isset($config->config_data['invoice_acl']) 
&& $config->config_data['invoice_acl'] == 'dimb')
                                {
                                        $supervisor_id = 
$invoice->get_default_dimb_role_user(2, $values['ecodimb']);
-                                       $prefs = 
$this->bocommon->create_preferences('property',$supervisor_id);                 
               
+                                       $prefs = 
$this->bocommon->create_preferences('property',$supervisor_id);
                                        $supervisor_email[] = array
                                        (
                                                'id'      => $supervisor_id,
@@ -1653,7 +1661,7 @@
                                        $content_files[$z]['file_name'] = '<a 
href="'.$link_view_file.'&amp;file_name='.$values['files'][$z]['file_name'].'" 
target="_blank" title="'.lang('click to view 
file').'">'.$values['files'][$z]['name'].'</a>';
                                }
                                $content_files[$z]['delete_file'] = '<input 
type="checkbox" name="values[file_action][]" 
value="'.$values['files'][$z]['name'].'" title="'.lang('Check to delete 
file').'">';
-                       }                                                       
                
+                       }
 
                        $datavalues[1] = array
                                (
@@ -1689,7 +1697,7 @@
                                        'voucher_out_id'                => 
$entry['voucher_out_id'],
                                        'status'                                
=> $entry['status'],
                                        'period'                                
=> $entry['period'],
-                                       'invoice_id'                    => 
$entry['invoice_id'],                                        
+                                       'invoice_id'                    => 
$entry['invoice_id'],
                                        'budget_account'                => 
$entry['budget_account'],
                                        'dima'                                  
=> $entry['dima'],
                                        'dimb'                                  
=> $entry['dimb'],
@@ -1704,7 +1712,7 @@
                                        'budget_responsible'    => 
$entry['budget_responsible'],
                                        'budsjettsigndato'              => 
$entry['budsjettsigndato'] ? 
$GLOBALS['phpgw']->common->show_date(strtotime($entry['budsjettsigndato']),$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'])
 : '',
                                        'transfer_time'                 => 
$entry['transfer_time'] ? 
$GLOBALS['phpgw']->common->show_date(strtotime($entry['transfer_time']),$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'])
 : '',
-                               );      
+                               );
                        }
 //_debug_array($content_invoice);
                        $datavalues[2] = array
@@ -1750,7 +1758,7 @@
                                                                        'count' 
                        => count($myColumnDefs)
                                                                )
                                                        );
-                       
+
                        $datavalues[]   = $notify_info['datavalues'];
                        $myColumnDefs[] = $notify_info['column_defs'];
                        $myButtons              = array();
@@ -1766,11 +1774,11 @@
                                        'name'          => "4",
                                        'values'        =>      
json_encode(array(      array('key' => 'value_email',   'label'=>lang('email'), 
'sortable'=>true,'resizeable'=>true),
                                                                                
                                array('key' => 
'value_select','label'=>lang('select'),'sortable'=>false,'resizeable'=>true)))
-                               );      
+                               );
 
 
                        $content_email =  
execMethod('property.bocommon.get_vendor_email', isset($values['vendor_id']) ? 
$values['vendor_id'] : 0 );
-                       
+
                        if(isset($values['mail_recipients']) && 
is_array($values['mail_recipients']))
                        {
                                $_recipients_found = array();
@@ -1808,7 +1816,7 @@
                        foreach($content_budget as & $b_entry)
                        {
                                $checked = $b_entry['closed'] ? 
'checked="checked"' : '';
-                               $checked2 = $b_entry['active'] ? 
'checked="checked"' : '';                                      
+                               $checked2 = $b_entry['active'] ? 
'checked="checked"' : '';
 
                                $b_entry['flag_active'] = $b_entry['active'];
                                $b_entry['delete_period'] = "<input 
type='checkbox' name='values[delete_b_period][]' 
value='{$b_entry['year']}_{$b_entry['month']}' title='{$lang_delete}'>";
@@ -1816,7 +1824,7 @@
                                $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>";
-                                       
+
                        }
                        unset($b_entry);
 
@@ -1874,7 +1882,7 @@
                                }
                        }
 
-/*                     
+/*
                        if(isset($project['cat_id']) && $project['cat_id'])
                        {
                                $catetory = 
$this->cats->return_single($project['cat_id']);
@@ -1894,7 +1902,7 @@
                        {
                                $user['id'] = $user['user_id'];
                        }
-                       
+
                        $value_coordinator = isset($project['coordinator']) ? 
$GLOBALS['phpgw']->accounts->get($project['coordinator'])->__toString() : 
$GLOBALS['phpgw']->accounts->get($this->account)->__toString();
 
                        $year   = date('Y') -1;
@@ -1989,7 +1997,7 @@
                                'lang_calculation'                              
                => lang('Calculation'),
                                'value_calculation'                             
                => (isset($values['calculation'])?$values['calculation']:''),
                                'value_sum_estimated_cost'                      
        => $sum_estimated_cost,
-                                       
+
                                'value_contract_sum'                            
        => isset($receipt['error']) && $receipt['error'] ? 
$_POST['values']['contract_sum'] : '',
 
                                'actual_cost'                                   
                => (isset($values['actual_cost'])?$values['actual_cost']:''),
@@ -2129,7 +2137,7 @@
                        
$GLOBALS['phpgw']->css->add_external_file('phpgwapi/js/yahoo/paginator/assets/skins/sam/paginator.css');
                        
$GLOBALS['phpgw']->css->add_external_file('phpgwapi/js/yahoo/container/assets/skins/sam/container.css');
 
-                       $GLOBALS['phpgw']->js->validate_file( 'yahoo', 
'workorder.edit', 'property' );  
+                       $GLOBALS['phpgw']->js->validate_file( 'yahoo', 
'workorder.edit', 'property' );
                        $GLOBALS['phpgw']->js->validate_file( 'portico', 
'ajax_workorder_edit', 'property' );
                }
 
@@ -2283,7 +2291,7 @@
 
                                
if(!execMethod('property.soXport.check_order',$values['order_id']))
                                {
-                                       
$receipt['error'][]=array('msg'=>lang('Not a valid order!'));                   
                
+                                       
$receipt['error'][]=array('msg'=>lang('Not a valid order!'));
                                }
 
                                if (!$values['amount'])
@@ -2397,7 +2405,7 @@
                                        'tenant'        => false,
                                        'lookup_type'   => 'form',
                                        'lookup_entity' => false,
-                                       'entity_data'   => false 
+                                       'entity_data'   => false
                                )
                        );
 
@@ -2544,7 +2552,7 @@
 
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
-               
+
                }
 
                protected function _generate_tabs($tabs_ = array(), $suppress = 
array(), $selected = 'general')

Modified: trunk/property/inc/hook_config.inc.php
===================================================================
--- trunk/property/inc/hook_config.inc.php      2013-02-03 14:08:14 UTC (rev 
10743)
+++ trunk/property/inc/hook_config.inc.php      2013-02-03 15:55:52 UTC (rev 
10744)
@@ -114,6 +114,64 @@
        }
 
        /**
+       * Get HTML listbox with project status that are to be set when asking 
for approval
+       *
+       * @param $config
+       * @return string HTML checkboxes to be placed in a table
+       */
+       function project_approval_status($config)
+       {
+               $status_entries = 
execMethod('property.soproject.select_status_list');
+
+               $status_assigned = isset($config['project_approval_status']) ? 
$config['project_approval_status'] : array();
+
+               $out = '<option value="">' . lang('none selected') . 
'</option>' . "\n";
+               foreach ( $status_entries as $status)
+               {
+                       $selected = '';
+                       if ( $status_assigned == $status['id'])
+                       {
+                               $selected = 'selected =  "selected"';
+                       }
+
+                       $out .=  <<<HTML
+                       <option 
value='{$status['id']}'{$selected}>{$status['name']}</option>
+HTML;
+               }
+
+               return $out;
+       }
+
+       /**
+       * Get HTML listbox with workorder status that are to be set when asking 
for approval
+       *
+       * @param $config
+       * @return string HTML checkboxes to be placed in a table
+       */
+       function workorder_approval_status($config)
+       {
+               $status_entries = 
execMethod('property.soworkorder.select_status_list');
+
+               $status_assigned = isset($config['workorder_approval_status']) 
? $config['workorder_approval_status'] : array();
+
+               $out = '<option value="">' . lang('none selected') . 
'</option>' . "\n";
+               foreach ( $status_entries as $status)
+               {
+                       $selected = '';
+                       if ( $status_assigned == $status['id'])
+                       {
+                               $selected = 'selected =  "selected"';
+                       }
+
+                       $out .=  <<<HTML
+                       <option 
value='{$status['id']}'{$selected}>{$status['name']}</option>
+HTML;
+               }
+
+               return $out;
+       }
+
+       /**
        * Get HTML listbox with workorder status that are to be set when 
invoice is processed
        *
        * @param $config

Modified: trunk/property/templates/base/config.tpl
===================================================================
--- trunk/property/templates/base/config.tpl    2013-02-03 14:08:14 UTC (rev 
10743)
+++ trunk/property/templates/base/config.tpl    2013-02-03 15:55:52 UTC (rev 
10744)
@@ -96,6 +96,25 @@
                        </select>
                </td>
        </tr>
+               <tr class="row_off">
+                       <td>{lang_project_status_on_approval}:</td>
+                       <td>
+                               <select 
name="newsettings[project_approval_status]">
+                                       {hook_project_approval_status}
+                               </select>
+                       </td>
+               </tr>
+
+               <tr class="row_on">
+                       <td>{lang_workorder_status_on_approval}:</td>
+                       <td>
+                               <select 
name="newsettings[workorder_approval_status]">
+                                       {hook_workorder_approval_status}
+                               </select>
+                       </td>
+               </tr>
+
+
        <tr class="row_off">
                
<td>{lang_workorder_status_that_are_to_be_set_when_invoice_is_processed}:</td>
                <td>

Modified: trunk/property/templates/base/status_select.xsl
===================================================================
--- trunk/property/templates/base/status_select.xsl     2013-02-03 14:08:14 UTC 
(rev 10743)
+++ trunk/property/templates/base/status_select.xsl     2013-02-03 15:55:52 UTC 
(rev 10744)
@@ -6,7 +6,7 @@
                <xsl:variable name="status_name">
                        <xsl:value-of select="status_name"/>
                </xsl:variable>
-               <select name="{$status_name}" class="forms" 
onMouseover="window.status='{$lang_status_statustext}'; return true;" 
onMouseout="window.status='';return true;">
+               <select name="{$status_name}" class="forms" 
title="{$lang_status_statustext}">
                        <option value="">
                                <xsl:value-of select="lang_no_status"/>
                        </option>




reply via email to

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