fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [14725] property: redirekt on save


From: Sigurd Nes
Subject: [Fmsystem-commits] [14725] property: redirekt on save
Date: Thu, 11 Feb 2016 15:48:45 +0000

Revision: 14725
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=14725
Author:   sigurdne
Date:     2016-02-11 15:47:31 +0000 (Thu, 11 Feb 2016)
Log Message:
-----------
property: redirekt on save

Modified Paths:
--------------
    trunk/property/inc/class.uiproject.inc.php

Modified: trunk/property/inc/class.uiproject.inc.php
===================================================================
--- trunk/property/inc/class.uiproject.inc.php  2016-02-11 15:19:48 UTC (rev 
14724)
+++ trunk/property/inc/class.uiproject.inc.php  2016-02-11 15:47:31 UTC (rev 
14725)
@@ -1,34 +1,34 @@
 <?php
        /**
-       * phpGroupWare - property: a Facilities Management System.
-       *
-       * @author Sigurd Nes <address@hidden>
-       * @copyright Copyright (C) 
2003,2004,2005,2006,2007,2008,2009,2010,2011,2012 Free Software Foundation, 
Inc. http://www.fsf.org/
-       * This file is part of phpGroupWare.
-       *
-       * phpGroupWare is free software; you can redistribute it and/or modify
-       * it under the terms of the GNU General Public License as published by
-       * the Free Software Foundation; either version 2 of the License, or
-       * (at your option) any later version.
-       *
-       * phpGroupWare is distributed in the hope that it will be useful,
-       * but WITHOUT ANY WARRANTY; without even the implied warranty of
-       * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-       * GNU General Public License for more details.
-       *
-       * You should have received a copy of the GNU General Public License
-       * along with phpGroupWare; if not, write to the Free Software
-       * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 
 USA
-       *
-       * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
-       * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
-       * @package property
-       * @subpackage project
+        * phpGroupWare - property: a Facilities Management System.
+        *
+        * @author Sigurd Nes <address@hidden>
+        * @copyright Copyright (C) 
2003,2004,2005,2006,2007,2008,2009,2010,2011,2012 Free Software Foundation, 
Inc. http://www.fsf.org/
+        * This file is part of phpGroupWare.
+        *
+        * phpGroupWare is free software; you can redistribute it and/or modify
+        * it under the terms of the GNU General Public License as published by
+        * the Free Software Foundation; either version 2 of the License, or
+        * (at your option) any later version.
+        *
+        * phpGroupWare is distributed in the hope that it will be useful,
+        * but WITHOUT ANY WARRANTY; without even the implied warranty of
+        * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+        * GNU General Public License for more details.
+        *
+        * You should have received a copy of the GNU General Public License
+        * along with phpGroupWare; if not, write to the Free Software
+        * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  
02110-1301  USA
+        *
+        * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
+        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/bbb_/ekstern/
+        * @package property
+        * @subpackage project
         * @version $Id$
-       */
+        */
        /**
-       * Import the jQuery class
-       */
+        * Import the jQuery class
+        */
        phpgw::import_class('phpgwapi.uicommon_jquery');
        phpgw::import_class('phpgwapi.jquery');
 
@@ -58,58 +58,58 @@
                var $public_functions = array
                        (
                        'query' => true,
-                               'download'                                      
        => true,
-                               'index'                                         
        => true,
-                               'view'                                          
        => true,
-                               'edit'                                          
        => true,
+                       'download' => true,
+                       'index' => true,
+                       'view' => true,
+                       'edit' => true,
                        'add' => true,
-                               'delete'                                        
        => true,
+                       'delete' => true,
                        'save' => true,
-                               'date_search'                                   
=> true,
-                               'columns'                                       
        => true,
-                               'bulk_update_status'                    => true,
-                               'project_group'                                 
=> true,
-                               'view_file'                                     
        => true,
-                               'get_orders'                                    
=> true,
-                               'get_vouchers'                                  
=> true,
-                               'check_missing_project_budget'  => true
-                       );
+                       'date_search' => true,
+                       'columns' => true,
+                       'bulk_update_status' => true,
+                       'project_group' => true,
+                       'view_file' => true,
+                       'get_orders' => true,
+                       'get_vouchers' => true,
+                       'check_missing_project_budget' => true
+               );
 
                function __construct()
                {
                        parent::__construct();
 
-               //      $GLOBALS['phpgw_info']['flags']['nonavbar'] = true; // 
menus added where needed via bocommon::get_menu
+                       //      $GLOBALS['phpgw_info']['flags']['nonavbar'] = 
true; // menus added where needed via bocommon::get_menu
                        $GLOBALS['phpgw_info']['flags']['xslt_app'] = true;
                        $GLOBALS['phpgw_info']['flags']['menu_selection'] = 
'property::project';
 
-                       $this->account                  = 
$GLOBALS['phpgw_info']['user']['account_id'];
+                       $this->account = 
$GLOBALS['phpgw_info']['user']['account_id'];
                        $this->bo = CreateObject('property.boproject', true);
-                       $this->bocommon                 = & $this->bo->bocommon;
-                       $this->cats                             = & 
$this->bo->cats;
-                       $this->custom                   = & $this->bo->custom;
+                       $this->bocommon = & $this->bo->bocommon;
+                       $this->cats = & $this->bo->cats;
+                       $this->custom = & $this->bo->custom;
 
-                       $this->acl                              = & 
$GLOBALS['phpgw']->acl;
-                       $this->acl_location             = '.project';
-                       $this->acl_read                 = 
$this->acl->check('.project', PHPGW_ACL_READ, 'property');
-                       $this->acl_add                  = 
$this->acl->check('.project', PHPGW_ACL_ADD, 'property');
-                       $this->acl_edit                 = 
$this->acl->check('.project', PHPGW_ACL_EDIT, 'property');
-                       $this->acl_delete               = 
$this->acl->check('.project', PHPGW_ACL_DELETE, 'property');
-                       $this->acl_manage               = 
$this->acl->check('.project', 16, 'property');
+                       $this->acl = & $GLOBALS['phpgw']->acl;
+                       $this->acl_location = '.project';
+                       $this->acl_read = $this->acl->check('.project', 
PHPGW_ACL_READ, 'property');
+                       $this->acl_add = $this->acl->check('.project', 
PHPGW_ACL_ADD, 'property');
+                       $this->acl_edit = $this->acl->check('.project', 
PHPGW_ACL_EDIT, 'property');
+                       $this->acl_delete = $this->acl->check('.project', 
PHPGW_ACL_DELETE, 'property');
+                       $this->acl_manage = $this->acl->check('.project', 16, 
'property');
 
-                       $this->start                    = $this->bo->start;
-                       $this->query                    = $this->bo->query;
-                       $this->sort                             = 
$this->bo->sort;
-                       $this->order                    = $this->bo->order;
-                       $this->filter                   = $this->bo->filter;
-                       $this->cat_id                   = $this->bo->cat_id;
-                       $this->status_id                = $this->bo->status_id;
-                       $this->wo_hour_cat_id   = $this->bo->wo_hour_cat_id;
-                       $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;
-                       $this->filter_year              = 
$this->bo->filter_year;
+                       $this->start = $this->bo->start;
+                       $this->query = $this->bo->query;
+                       $this->sort = $this->bo->sort;
+                       $this->order = $this->bo->order;
+                       $this->filter = $this->bo->filter;
+                       $this->cat_id = $this->bo->cat_id;
+                       $this->status_id = $this->bo->status_id;
+                       $this->wo_hour_cat_id = $this->bo->wo_hour_cat_id;
+                       $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;
+                       $this->filter_year = $this->bo->filter_year;
                        $this->decimal_separator = ',';
                }
 
@@ -117,19 +117,19 @@
                {
                        $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,
-                                       'project_type_id'       => 
$this->project_type_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);
                }
 
@@ -142,13 +142,13 @@
                        }
 
                        $values = $this->query();
-                       $uicols         = $this->bo->uicols;
+                       $uicols = $this->bo->uicols;
                        $this->bocommon->download($values, $uicols['name'], 
$uicols['descr'], $uicols['input_type']);
                }
 
                function check_missing_project_budget()
                {
-                       $values         = 
$this->bo->get_missing_project_budget();
+                       $values = $this->bo->get_missing_project_budget();
                        $this->bocommon->download($values, array('project_id', 
'year'), array(lang('project'),
                                lang('year')));
                }
@@ -160,7 +160,7 @@
                                $GLOBALS['phpgw']->redirect_link('/index.php', 
array('menuaction' => 'property.uilocation.stop',
                                        'perm' => 1, 'acl_location' => 
$this->acl_location));
                        }
-                       $bofiles        = CreateObject('property.bofiles');
+                       $bofiles = CreateObject('property.bofiles');
                        $bofiles->view_file('project');
                }
 
@@ -172,7 +172,7 @@
                        $GLOBALS['phpgw_info']['flags']['noframework'] = true;
                        $GLOBALS['phpgw_info']['flags']['nofooter'] = true;
 
-                       $values                 = phpgw::get_var('values');
+                       $values = phpgw::get_var('values');
 
                        
$GLOBALS['phpgw']->preferences->set_account_id($this->account, true);
 
@@ -183,26 +183,26 @@
                                $receipt['message'][] = array('msg' => 
lang('columns is updated'));
                        }
 
-                       $function_msg   = lang('Select Column');
+                       $function_msg = lang('Select Column');
 
                        $link_data = array
                                (
-                                       'menuaction'    => 
'property.uiproject.columns',
-                               );
+                               'menuaction' => 'property.uiproject.columns',
+                       );
 
                        $selected = isset($values['columns']) && 
$values['columns'] ? $values['columns'] : array();
                        $msgbox_data = 
$GLOBALS['phpgw']->common->msgbox_data($receipt);
 
                        $data = array
                                (
-                                       'msgbox_data'           => 
$GLOBALS['phpgw']->common->msgbox($msgbox_data),
+                               'msgbox_data' => 
$GLOBALS['phpgw']->common->msgbox($msgbox_data),
                                'column_list' => 
$this->bo->column_list($selected, $this->type_id, $allrows = true),
-                                       'function_msg'          => 
$function_msg,
+                               'function_msg' => $function_msg,
                                'form_action' => 
$GLOBALS['phpgw']->link('/index.php', $link_data),
-                                       'lang_columns'          => 
lang('columns'),
-                                       'lang_none'                     => 
lang('None'),
-                                       'lang_save'                     => 
lang('save'),
-                               );
+                               'lang_columns' => lang('columns'),
+                               'lang_none' => lang('None'),
+                               'lang_save' => lang('save'),
+                       );
 
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
$function_msg;
                        $GLOBALS['phpgw']->xslttpl->set_var('phpgw', 
array('columns' => $data));
@@ -329,22 +329,22 @@
                                        'perm' => 1, 'acl_location' => 
$this->acl_location));
                        }
 
-                       $lookup                 = phpgw::get_var('lookup', 
'bool');
-                       $from                   = phpgw::get_var('from');
+                       $lookup = phpgw::get_var('lookup', 'bool');
+                       $from = phpgw::get_var('from');
 
                        $second_display = phpgw::get_var('second_display', 
'bool');
                        $default_district = 
(isset($GLOBALS['phpgw_info']['user']['preferences']['property']['default_district'])
 ? 
$GLOBALS['phpgw_info']['user']['preferences']['property']['default_district'] : 
'');
 
                        if($default_district && !$second_display && 
!$this->district_id)
                        {
-                               $this->bo->district_id  = $default_district;
-                               $this->district_id              = 
$default_district;
+                               $this->bo->district_id = $default_district;
+                               $this->district_id = $default_district;
                        }
 
                        if(phpgw::get_var('phpgw_return_as') == 'json')
-                               {
+                       {
                                return $this->query();
-                                       }
+                       }
 
                        self::add_javascript('phpgwapi', 'jquery', 
'editable/jquery.jeditable.js');
                        self::add_javascript('phpgwapi', 'jquery', 
'editable/jquery.dataTables.editable.js');
@@ -364,30 +364,30 @@
                                        'toolbar' => array(
                                                'item' => array(
                                                        array(
-                                                                       'type' 
=> 'link',
-                                                                       'value' 
=> lang('columns'),
+                                                               'type' => 
'link',
+                                                               'value' => 
lang('columns'),
                                                                'href' => '#',
                                                                'class' => '',
                                                                'onclick' => 
"JqueryPortico.openPopup({menuaction:'property.uiproject.columns'},{closeAction:'reload'})"
-                                                               ),
-                                                               array
+                                                       ),
+                                                       array
                                                                (
                                                                'type' => 
'date-picker',
-                                                                       'id' => 
'start_date',
+                                                               'id' => 
'start_date',
                                                                'name' => 
'start_date',
                                                                'value' => '',
                                                                'text' => 
lang('from')
-                                                               ),
-                                                               array
-                                                       (
+                                                       ),
+                                                       array
+                                                               (
                                                                'type' => 
'date-picker',
                                                                'id' => 
'end_date',
                                                                'name' => 
'end_date',
                                                                'value' => '',
                                                                'text' => 
lang('to')
-                                                               )
                                                        )
                                                )
+                                       )
                                ),
                                'datatable' => array(
                                        'source' => self::link(array(
@@ -402,14 +402,14 @@
                                                'skip_origin' => true,
                                                'allrows' => true
                                        )),
-                                       'new_item'      => self::link(array(
-                                                                       
'menuaction' => 'property.uiproject.add'
-                                                               )),
+                                       'new_item' => self::link(array(
+                                               'menuaction' => 
'property.uiproject.add'
+                                       )),
                                        'allrows' => true,
                                        'editor_action' => '',
                                        'field' => array()
-                                       )
-                               );
+                               )
+                       );
 
                        $filters = $this->_get_Filters();
                        krsort($filters);
@@ -419,11 +419,11 @@
                        }
 
                        $this->bo->read(array('dry_run' => true));
-                       $uicols = $this->bo->uicols;
+                       $uicols = $this->bo->uicols;
                        $count_uicols_name = count($uicols['name']);
 
                        for($k = 0; $k < $count_uicols_name; $k++)
-                               {
+                       {
                                $params = array
                                        (
                                        'key' => $uicols['name'][$k],
@@ -433,20 +433,20 @@
                                );
 
                                if($uicols['name'][$k] == 'project_id')
-                                                       {
+                               {
                                        $params['formatter'] = 
'JqueryPortico.formatProject';
-                                                       }
+                               }
 
                                if($uicols['name'][$k] == 'ticket')
-                                               {
+                               {
                                        $params['formatter'] = 
'formatLinkTicket';
-                                               }
+                               }
 
                                if($uicols['name'][$k] == 'loc1')
-                                               {
+                               {
                                        # Aca debe ser el Onclick
                                        $params['formatter'] = 
'JqueryPortico.searchLink';
-                                       }
+                               }
 
                                array_push($data['datatable']['field'], 
$params);
                        }
@@ -455,54 +455,54 @@
                        {
                                $parameters = array
                                        (
-                                               'parameter' => array
+                                       'parameter' => array
                                                (
-                                                       array
+                                               array
                                                        (
-                                                               'name'          
=> 'id',
-                                                               'source'        
=> 'project_id'
-                                                       ),
-                                               )
-                                       );
+                                                       'name' => 'id',
+                                                       'source' => 'project_id'
+                                               ),
+                                       )
+                               );
 
                                $parameters2 = array
                                        (
-                                               'parameter' => array
+                                       'parameter' => array
                                                (
-                                                       array
+                                               array
                                                        (
-                                                               'name'          
=> 'project_id',
-                                                               'source'        
=> 'project_id'
-                                                       ),
-                                               )
-                                       );
+                                                       'name' => 'project_id',
+                                                       'source' => 'project_id'
+                                               ),
+                                       )
+                               );
 
                                if($this->acl_read)
                                {
                                        $data['datatable']['actions'][] = array
                                                (
-                                                       'my_name'               
        => 'view',
-                                                       'statustext'            
        => lang('view the project'),
-                                                       'text'          => 
lang('view'),
+                                               'my_name' => 'view',
+                                               'statustext' => lang('view the 
project'),
+                                               'text' => lang('view'),
                                                'action' => 
$GLOBALS['phpgw']->link('/index.php', array
                                                        (
-                                                               'menuaction'    
=> 'property.uiproject.view'
-                                                       )),
+                                                       'menuaction' => 
'property.uiproject.view'
+                                               )),
                                                'parameters' => 
json_encode($parameters)
-                                               );
+                                       );
 
                                        $data['datatable']['actions'][] = array
                                                (
-                                                       'my_name'               
        => 'view',
-                                                       'statustext'            
=> lang('view the project'),
-                                                       'text'                  
        => lang('open view in new window'),
+                                               'my_name' => 'view',
+                                               'statustext' => lang('view the 
project'),
+                                               'text' => lang('open view in 
new window'),
                                                'action' => 
$GLOBALS['phpgw']->link('/index.php', array
                                                        (
                                                        'menuaction' => 
'property.uiproject.view'
-                                                       )),
+                                               )),
                                                'target' => '_blank',
                                                'parameters' => 
json_encode($parameters)
-                                               );
+                                       );
 
                                        $jasper = 
execMethod('property.sojasper.read', array('location_id' => 
$GLOBALS['phpgw']->locations->get_id('property', $this->acl_location)));
 
@@ -510,16 +510,16 @@
                                        {
                                                $data['datatable']['actions'][] 
= array
                                                        (
-                                                               'my_name'       
        => 'edit',
-                                                               'text'          
        => lang('open JasperReport %1 in new window', $report['title']),
+                                                       'my_name' => 'edit',
+                                                       'text' => lang('open 
JasperReport %1 in new window', $report['title']),
                                                        'action' => 
$GLOBALS['phpgw']->link('/index.php', array
                                                                (
-                                                                       
'menuaction'    => 'property.uijasper.view',
+                                                               'menuaction' => 
'property.uijasper.view',
                                                                'jasper_id' => 
$report['id']
-                                                               )),
+                                                       )),
                                                        'target' => '_blank',
                                                        'parameters' => 
json_encode($parameters)
-                                                       );
+                                               );
                                        }
                                }
 
@@ -527,55 +527,55 @@
                                {
                                        $data['datatable']['actions'][] = array
                                                (
-                                                       'my_name'               
        => 'edit',
-                                                       'statustext'            
=> lang('edit the project'),
-                                                       'text'                  
        => lang('edit'),
+                                               'my_name' => 'edit',
+                                               'statustext' => lang('edit the 
project'),
+                                               'text' => lang('edit'),
                                                'action' => 
$GLOBALS['phpgw']->link('/index.php', array
                                                        (
-                                                               'menuaction'    
=> 'property.uiproject.edit'
-                                                       )),
+                                                       'menuaction' => 
'property.uiproject.edit'
+                                               )),
                                                'parameters' => 
json_encode($parameters)
-                                               );
+                                       );
 
                                        $data['datatable']['actions'][] = array
                                                (
-                                                       'my_name'               
        => 'edit',
-                                                       'statustext'            
=> lang('edit the project'),
-                                                       'text'                  
        => lang('open edit in new window'),
+                                               'my_name' => 'edit',
+                                               'statustext' => lang('edit the 
project'),
+                                               'text' => lang('open edit in 
new window'),
                                                'action' => 
$GLOBALS['phpgw']->link('/index.php', array
                                                        (
                                                        'menuaction' => 
'property.uiproject.edit'
-                                                       )),
+                                               )),
                                                'target' => '_blank',
                                                'parameters' => 
json_encode($parameters)
-                                               );
+                                       );
 
                                        $data['datatable']['actions'][] = array
                                                (
-                                                       'my_name'               
        => 'edit',
-                                                       'statustext'            
=> lang('Add a workorder to this project'),
-                                                       'text'                  
        => lang('Add a workorder to this project'),
+                                               'my_name' => 'edit',
+                                               'statustext' => lang('Add a 
workorder to this project'),
+                                               'text' => lang('Add a workorder 
to this project'),
                                                'action' => 
$GLOBALS['phpgw']->link('/index.php', array
                                                        (
                                                        'menuaction' => 
'property.uiworkorder.edit'
-                                                       )),
+                                               )),
                                                'parameters' => 
json_encode($parameters2)
-                                               );
+                                       );
                                }
 
                                if($this->acl_delete)
                                {
                                        $data['datatable']['actions'][] = array
                                                (
-                                                       'my_name'               
        => 'delete',
-                                                       'text'                  
=> lang('delete'),
-                                                       'confirm_msg'   => 
lang('do you really want to delete this entry'),
+                                               'my_name' => 'delete',
+                                               'text' => lang('delete'),
+                                               'confirm_msg' => lang('do you 
really want to delete this entry'),
                                                'action' => 
$GLOBALS['phpgw']->link('/index.php', array
                                                        (
-                                                               'menuaction'    
=> 'property.uiproject.delete'
-                                                       )),
+                                                       'menuaction' => 
'property.uiproject.delete'
+                                               )),
                                                'parameters' => 
json_encode($parameters2)
-                                               );
+                                       );
                                }
                        }
 
@@ -587,9 +587,9 @@
                                $lookup_target = array
                                        (
                                        'menuaction' => 'property.ui' . $from . 
'.edit',
-                                               'origin'                        
=> phpgw::get_var('origin'),
-                                               'origin_id'                     
=> phpgw::get_var('origin_id')
-                                       );
+                                       'origin' => phpgw::get_var('origin'),
+                                       'origin_id' => 
phpgw::get_var('origin_id')
+                               );
 
                                for($i = 0; $i < $count_uicols_name; $i++)
                                {
@@ -664,7 +664,7 @@
                        $result_data['total_records'] = 
$this->bo->total_records;
                        $result_data['draw'] = $draw;
                        $link_data = array
-                       (
+                               (
                                'menuaction' => 'property.uiproject.edit'
                        );
                        array_walk($result_data['results'], array($this, 
'_add_links'), $link_data);
@@ -679,11 +679,11 @@
                        //      $GLOBALS['phpgw_info']['flags']['nonavbar'] = 
true;
                        //      $GLOBALS['phpgw_info']['flags']['noheader'] = 
true;
                        $GLOBALS['phpgw_info']['flags']['nofooter'] = true;
-                       $values['start_date']   = phpgw::get_var('start_date', 
'string', 'POST');
-                       $values['end_date']     = phpgw::get_var('end_date', 
'string', 'POST');
+                       $values['start_date'] = phpgw::get_var('start_date', 
'string', 'POST');
+                       $values['end_date'] = phpgw::get_var('end_date', 
'string', 'POST');
 
-                       $function_msg   = lang('Date search');
-                       $appname        = lang('project');
+                       $function_msg = lang('Date search');
+                       $appname = lang('project');
 
                        if(!$values['end_date'])
                        {
@@ -695,15 +695,15 @@
 
                        $data = array
                                (
-                                       'lang_start_date_statustext'    => 
lang('Select the estimated end date for the Project'),
-                                       'lang_start_date'               => 
lang('Start date'),
-                                       'value_start_date'              => 
$values['start_date'],
-                                       'lang_end_date_statustext'      => 
lang('Select the estimated end date for the Project'),
-                                       'lang_end_date'                 => 
lang('End date'),
-                                       'value_end_date'                => 
$values['end_date'],
-                                       'lang_submit_statustext'        => 
lang('Select this dates'),
-                                       'lang_submit'                   => 
lang('Submit')
-                               );
+                               'lang_start_date_statustext' => lang('Select 
the estimated end date for the Project'),
+                               'lang_start_date' => lang('Start date'),
+                               'value_start_date' => $values['start_date'],
+                               'lang_end_date_statustext' => lang('Select the 
estimated end date for the Project'),
+                               'lang_end_date' => lang('End date'),
+                               'value_end_date' => $values['end_date'],
+                               'lang_submit_statustext' => lang('Select this 
dates'),
+                               'lang_submit' => lang('Submit')
+                       );
 
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        $GLOBALS['phpgw']->xslttpl->set_var('phpgw', 
array('date_search' => $data));
@@ -716,13 +716,13 @@
                {
                        $id = (int)phpgw::get_var('id', 'int');
 
-                               $values                                         
= phpgw::get_var('values');
-                               $values_attribute                       = 
phpgw::get_var('values_attribute');
-                               $values['project_group']        = 
phpgw::get_var('project_group');
-                               $values['ecodimb']                      = 
phpgw::get_var('ecodimb');
-                               $values['b_account_id']         = 
phpgw::get_var('b_account_id', 'int', 'POST');
-                               $values['b_account_name']       = 
phpgw::get_var('b_account_name', 'string', 'POST');
-                               $values['contact_id']           = 
phpgw::get_var('contact', 'int', 'POST');
+                       $values = phpgw::get_var('values');
+                       $values_attribute = phpgw::get_var('values_attribute');
+                       $values['project_group'] = 
phpgw::get_var('project_group');
+                       $values['ecodimb'] = phpgw::get_var('ecodimb');
+                       $values['b_account_id'] = 
phpgw::get_var('b_account_id', 'int', 'POST');
+                       $values['b_account_name'] = 
phpgw::get_var('b_account_name', 'string', 'POST');
+                       $values['contact_id'] = phpgw::get_var('contact', 
'int', 'POST');
 
                        $config = CreateObject('phpgwapi.config', 'property');
                        $config->read();
@@ -731,212 +731,212 @@
 
                        $insert_record_entity = 
$GLOBALS['phpgw']->session->appsession("insert_record_values{$this->acl_location}",
 'property');
 
-                               if(isset($insert_record_entity) && 
is_array($insert_record_entity))
+                       if(isset($insert_record_entity) && 
is_array($insert_record_entity))
+                       {
+                               for($j = 0; $j < count($insert_record_entity); 
$j++)
                                {
-                               for($j = 0; $j < count($insert_record_entity); 
$j++)
-                                       {
-                                               
$insert_record['extra'][$insert_record_entity[$j]]      = 
$insert_record_entity[$j];
-                                       }
+                                       
$insert_record['extra'][$insert_record_entity[$j]] = $insert_record_entity[$j];
                                }
-                               $bypass = phpgw::get_var('bypass', 'bool');
+                       }
+                       $bypass = phpgw::get_var('bypass', 'bool');
 
 
-                               if($_POST && !$bypass && isset($insert_record) 
&& is_array($insert_record))
-                               {
+                       if($_POST && !$bypass && isset($insert_record) && 
is_array($insert_record))
+                       {
                                $values = 
$this->bocommon->collect_locationdata($values, $insert_record);
-                                       }
+                       }
 
-                                       
if(isset($config->config_data['invoice_acl']) && 
$config->config_data['invoice_acl'] == 'dimb')
+                       if(isset($config->config_data['invoice_acl']) && 
$config->config_data['invoice_acl'] == 'dimb')
+                       {
+                               if(!$this->acl_manage)
+                               {
+                                       if(!isset($values['ecodimb']) || 
!$values['ecodimb'])
                                        {
-                                               if(!$this->acl_manage)
-                                               {
-                                                       
if(!isset($values['ecodimb']) || !$values['ecodimb'])
-                                                       {
                                                $this->receipt['error'][] = 
array('msg' => lang('Please select dimb!'));
                                                $error_id = true;
-                                                       }
+                                       }
 
-                                                       $approve_role = 
execMethod('property.boinvoice.check_role', $values['ecodimb']);
+                                       $approve_role = 
execMethod('property.boinvoice.check_role', $values['ecodimb']);
                                        if(!$approve_role['is_supervisor'] && 
!$approve_role['is_budget_responsible'])
-                                                       {
+                                       {
                                                $this->receipt['error'][] = 
array('msg' => lang('you are not approved for this dimb: %1', 
$values['ecodimb']));
                                                $error_id = true;
-                                                       }
-                                               }
                                        }
+                               }
+                       }
 
-                                       if(!isset($values['location']))
-                                       {
+                       if(!isset($values['location']))
+                       {
                                $this->receipt['error'][] = array('msg' => 
lang('Please select a location !'));
                                $error_id = true;
-                                       }
+                       }
 
-                                       if(isset($values['b_account_id']) && 
$values['b_account_id'])
-                                       {
-                                               $sogeneric              = 
CreateObject('property.sogeneric');
+                       if(isset($values['b_account_id']) && 
$values['b_account_id'])
+                       {
+                               $sogeneric = CreateObject('property.sogeneric');
                                
$sogeneric->get_location_info('b_account_category', false);
                                $status_data = 
$sogeneric->read_single(array('id' => (int)$values['b_account_id']), array());
 
-                                               
if(isset($status_data['project_group']) && 
$status_data['project_group'])//mandatory for this account group
-                                               {
-                                                       
if(!isset($values['project_group']) || !$values['project_group'])
-                                                       {
+                               if(isset($status_data['project_group']) && 
$status_data['project_group'])//mandatory for this account group
+                               {
+                                       if(!isset($values['project_group']) || 
!$values['project_group'])
+                                       {
                                                $this->receipt['error'][] = 
array('msg' => lang('Please select a project group!'));
                                                $error_id = true;
-                                                       }
-                                               }
                                        }
+                               }
+                       }
 
-                                       if(isset($values['new_project_id']) && 
$values['new_project_id'] && 
!$this->bo->read_single_mini($values['new_project_id']))
-                                       {
+                       if(isset($values['new_project_id']) && 
$values['new_project_id'] && 
!$this->bo->read_single_mini($values['new_project_id']))
+                       {
                                $this->receipt['error'][] = array('msg' => 
lang('the project %1 does not exist', $values['new_project_id']));
-                                       }
+                       }
 
-                                       if(isset($values['new_project_id']) && 
$values['new_project_id'] && $values['new_project_id'] == $id)
-                                       {
-                                               
unset($values['new_project_id']);
-                                       }
+                       if(isset($values['new_project_id']) && 
$values['new_project_id'] && $values['new_project_id'] == $id)
+                       {
+                               unset($values['new_project_id']);
+                       }
 
-                                       if(!isset($values['end_date']) || 
!$values['end_date'])
-                                       {
+                       if(!isset($values['end_date']) || !$values['end_date'])
+                       {
                                $this->receipt['error'][] = array('msg' => 
lang('Please select an end date!'));
                                $error_id = true;
-                                       }
+                       }
 
-                                       if(!isset($values['project_type_id']) 
|| !$values['project_type_id'])
-                                       {
+                       if(!isset($values['project_type_id']) || 
!$values['project_type_id'])
+                       {
                                $this->receipt['error'][] = array('msg' => 
lang('Please select a project type!'));
                                $error_id = true;
-                                       }
+                       }
 
-                                       if(!$values['name'])
-                                       {
+                       if(!$values['name'])
+                       {
                                $this->receipt['error'][] = array('msg' => 
lang('Please enter a project NAME !'));
                                $error_id = true;
-                                       }
+                       }
 
-                                       
if(!isset($config->config_data['project_optional_category']) || 
!$config->config_data['project_optional_category'])
-                                       {
-                                               if(!$values['cat_id'])
-                                               {
+                       
if(!isset($config->config_data['project_optional_category']) || 
!$config->config_data['project_optional_category'])
+                       {
+                               if(!$values['cat_id'])
+                               {
                                        $this->receipt['error'][] = array('msg' 
=> lang('Please select a category !'));
                                        $error_id = true;
-                                               }
-                                       }
+                               }
+                       }
 
-                                       if(isset($values['cat_id']) && 
$values['cat_id'])
-                                       {
-                                               $_category = 
$this->cats->return_single($values['cat_id']);
-                                               if(!$_category[0]['active'])
-                                               {
+                       if(isset($values['cat_id']) && $values['cat_id'])
+                       {
+                               $_category = 
$this->cats->return_single($values['cat_id']);
+                               if(!$_category[0]['active'])
+                               {
                                        $this->receipt['error'][] = array('msg' 
=> lang('invalid category'));
-                                               }
-                                       }
+                               }
+                       }
 
-                                       if(!$values['coordinator'])
-                                       {
+                       if(!$values['coordinator'])
+                       {
                                $this->receipt['error'][] = array('msg' => 
lang('Please select a coordinator !'));
                                $error_id = true;
-                                       }
+                       }
 
-                                       if(!$values['status'])
-                                       {
+                       if(!$values['status'])
+                       {
                                $this->receipt['error'][] = array('msg' => 
lang('Please select a status !'));
                                $error_id = true;
-                                       }
+                       }
 
                        if(isset($values['budget']) && $values['budget'] && 
!ctype_digit(ltrim($values['budget'], '-')))
-                                       {
+                       {
                                $this->receipt['error'][] = array('msg' => 
lang('budget') . ': ' . lang('Please enter an integer !'));
                                $error_id = true;
-                                       }
+                       }
 
                        if(isset($values['reserve']) && $values['reserve'] && 
!ctype_digit(ltrim($values['reserve'], '-')))
-                                       {
+                       {
                                $this->receipt['error'][] = array('msg' => 
lang('reserve') . ': ' . lang('Please enter an integer !'));
                                $error_id = true;
-                                       }
+                       }
 
-                                       if(isset($values_attribute) && 
is_array($values_attribute))
+                       if(isset($values_attribute) && 
is_array($values_attribute))
+                       {
+                               foreach($values_attribute as $attribute)
+                               {
+                                       if($attribute['nullable'] != 1 && 
(!$attribute['value'] && !$values['extra'][$attribute['name']]))
                                        {
-                               foreach($values_attribute as $attribute)
-                                               {
-                                                       
if($attribute['nullable'] != 1 && (!$attribute['value'] && 
!$values['extra'][$attribute['name']]))
-                                                       {
                                                $this->receipt['error'][] = 
array('msg' => lang('Please enter value for attribute %1', 
$attribute['input_text']));
-                                                       }
-                                               }
                                        }
+                               }
+                       }
 
                        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(isset($config->config_data['project_approval_status']) && 
$config->config_data['project_approval_status'])
+                               {
+                                       $values['status'] = 
$config->config_data['project_approval_status'];
+                               }
+                       }
 
                        if(!$id && $bypass)
-                                       {
-                               $p_entity_id            = 
phpgw::get_var('p_entity_id', 'int');
-                               $p_cat_id                       = 
phpgw::get_var('p_cat_id', 'int');
-                               $values['p'][$p_entity_id]['p_entity_id']       
= $p_entity_id;
-                               $values['p'][$p_entity_id]['p_cat_id']          
= $p_cat_id;
-                               $values['p'][$p_entity_id]['p_num']             
= phpgw::get_var('p_num');
-                                       }
+                       {
+                               $p_entity_id = phpgw::get_var('p_entity_id', 
'int');
+                               $p_cat_id = phpgw::get_var('p_cat_id', 'int');
+                               $values['p'][$p_entity_id]['p_entity_id'] = 
$p_entity_id;
+                               $values['p'][$p_entity_id]['p_cat_id'] = 
$p_cat_id;
+                               $values['p'][$p_entity_id]['p_num'] = 
phpgw::get_var('p_num');
+                       }
 
                        return $values;
-                                               }
+               }
 
                private function _handle_files($values)
-                                               {
+               {
                        $id = (int)$values['id'];
                        if(empty($id))
                        {
                                throw new Exception('uiproject::_handle_files() 
- missing id');
-                                               }
+                       }
 
-                                               $bofiles        = 
CreateObject('property.bofiles');
-                                               
if(isset($values['file_action']) && is_array($values['file_action']))
-                                               {
-                                                       
$bofiles->delete_file("/project/{$id}/", $values);
-                                               }
+                       $bofiles = CreateObject('property.bofiles');
+                       if(isset($values['file_action']) && 
is_array($values['file_action']))
+                       {
+                               $bofiles->delete_file("/project/{$id}/", 
$values);
+                       }
 
                        $file_name = @str_replace(' ', '_', 
$_FILES['file']['name']);
 
-                                               if($file_name)
-                                               {
-                                                       $to_file = 
"{$bofiles->fakebase}/project/{$id}/{$file_name}";
+                       if($file_name)
+                       {
+                               $to_file = 
"{$bofiles->fakebase}/project/{$id}/{$file_name}";
 
-                                                       
if($bofiles->vfs->file_exists(array(
-                                                               'string' => 
$to_file,
-                                                               'relatives' => 
Array(RELATIVE_NONE)
-                                                       )))
-                                                       {
+                               if($bofiles->vfs->file_exists(array(
+                                       'string' => $to_file,
+                                       'relatives' => Array(RELATIVE_NONE)
+                               )))
+                               {
                                        $this->receipt['error'][] = array('msg' 
=> lang('This file already exists !'));
-                                                       }
-                                                       else
-                                                       {
-                                                               
$bofiles->create_document_dir("project/$id");
-                                                               
$bofiles->vfs->override_acl = 1;
+                               }
+                               else
+                               {
+                                       
$bofiles->create_document_dir("project/$id");
+                                       $bofiles->vfs->override_acl = 1;
 
                                        if(!$bofiles->vfs->cp(array(
-                                                                       'from'  
=> $_FILES['file']['tmp_name'],
-                                                                       'to'    
=> $to_file,
+                                               'from' => 
$_FILES['file']['tmp_name'],
+                                               'to' => $to_file,
                                                'relatives' => 
array(RELATIVE_NONE | VFS_REAL, RELATIVE_ALL))))
-                                                               {
+                                       {
                                                $this->receipt['error'][] = 
array('msg' => lang('Failed to upload file !'));
-                                                               }
-                                                               
$bofiles->vfs->override_acl = 0;
-                                                       }
-                                               }
+                                       }
+                                       $bofiles->vfs->override_acl = 0;
+                               }
+                       }
                }
 
                public function save()
                {
                        if(!$_POST)
                        {
-                               return  $this->edit();
+                               return $this->edit();
                        }
 
                        $id = phpgw::get_var('id', 'int');
@@ -979,14 +979,14 @@
                                        $this->_handle_files($values);
 
                                        
if(isset($GLOBALS['phpgw_info']['server']['smtp_server']) && 
$GLOBALS['phpgw_info']['server']['smtp_server'])
-                                               {
+                                       {
                                                $historylog = 
CreateObject('property.historylog', 'project');
                                                
if(!is_object($GLOBALS['phpgw']->send))
-                                                       {
-                                                               
$GLOBALS['phpgw']->send = CreateObject('phpgwapi.send');
-                                                       }
+                                               {
+                                                       $GLOBALS['phpgw']->send 
= CreateObject('phpgwapi.send');
+                                               }
 
-                                                       
$action_params['responsible'] = $_account_id;
+                                               $action_params['responsible'] = 
$_account_id;
                                                $from_name = 
$GLOBALS['phpgw_info']['user']['fullname'];
                                                $from_email = 
$GLOBALS['phpgw_info']['user']['preferences']['property']['email'];
 
@@ -994,103 +994,103 @@
                                                $message = '<a href ="' . 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uiproject.edit',
                                                        'id' => $id), false, 
true) . '">' . lang('project %1 needs approval', $id) . '</a>';
 
-                                                       $bcc = '';//$from_email;
+                                               $bcc = '';//$from_email;
 
-                                                       $action_params = array
+                                               $action_params = array
                                                        (
-                                                               'appname'       
                => 'property',
-                                                               'location'      
                => '.project',
-                                                               'id'            
                => $id,
-                                                               'responsible'   
        => '',
-                                                               
'responsible_type'  => 'user',
-                                                               'action'        
                => 'approval',
-                                                               'remark'        
                => '',
-                                                               'deadline'      
                => ''
-                                                       );
+                                                       'appname' => 'property',
+                                                       'location' => 
'.project',
+                                                       'id' => $id,
+                                                       'responsible' => '',
+                                                       'responsible_type' => 
'user',
+                                                       'action' => 'approval',
+                                                       'remark' => '',
+                                                       'deadline' => ''
+                                               );
 
                                                
if(isset($values['mail_address']) && is_array($values['mail_address']))
+                                               {
+                                                       
foreach($values['mail_address'] as $_account_id => $_address)
                                                        {
-                                                       
foreach($values['mail_address'] as $_account_id => $_address)
+                                                               
if(isset($values['approval'][$_account_id]) && 
$values['approval'][$_account_id])
                                                                {
-                                                                       
if(isset($values['approval'][$_account_id]) && 
$values['approval'][$_account_id])
+                                                                       $rcpt = 
$GLOBALS['phpgw']->send->msg('email', $_address, $subject, 
stripslashes($message), '', $cc, $bcc, $from_email, $from_name, 'html');
+                                                                       
$action_params['responsible'] = $_account_id;
+                                                                       
execMethod('property.sopending_action.set_pending_action', $action_params);
+                                                                       
if(!$rcpt)
                                                                        {
-                                                                       $rcpt = 
$GLOBALS['phpgw']->send->msg('email', $_address, $subject, 
stripslashes($message), '', $cc, $bcc, $from_email, $from_name, 'html');
-                                                                               
$action_params['responsible'] = $_account_id;
-                                                                               
execMethod('property.sopending_action.set_pending_action', $action_params);
-                                                                               
if(!$rcpt)
-                                                                               
{
                                                                                
$this->receipt['error'][] = array('msg' => "uiproject::edit: sending message to 
'" . $_address . "', subject='$subject' failed !!!");
                                                                                
$this->receipt['error'][] = array('msg' => 
$GLOBALS['phpgw']->send->err['desc']);
                                                                                
$this->bypass_error = true;
-                                                                               
}
-                                                                               
else
-                                                                               
{
+                                                                       }
+                                                                       else
+                                                                       {
                                                                                
$historylog->add('AP', $id, lang('%1 is notified', $_address));
-                                                                               
$receipt['message'][] = array('msg' => lang('%1 is notified', $_address));
-                                                                               
}
+                                                                               
$this->receipt['message'][] = array('msg' => lang('%1 is notified', $_address));
                                                                        }
                                                                }
                                                        }
+                                               }
 
-                                                       $toarray = array();
-                                                       $toarray_sms = array();
-                                               
if(isset($receipt['notice_owner']) && is_array($receipt['notice_owner']))
+                                               $toarray = array();
+                                               $toarray_sms = array();
+                                               
if(isset($this->receipt['notice_owner']) && 
is_array($this->receipt['notice_owner']))
+                                               {
+                                                       if($this->account != 
$values['coordinator'] && 
isset($GLOBALS['phpgw_info']['user']['preferences']['property']['notify_project_owner'])
 && 
$GLOBALS['phpgw_info']['user']['preferences']['property']['notify_project_owner']
+                                                       //                      
                                 && $config->config_data['mailnotification']
+                                                       )
                                                        {
-                                                       if($this->account != 
$values['coordinator'] && 
isset($GLOBALS['phpgw_info']['user']['preferences']['property']['notify_project_owner'])
 && 
$GLOBALS['phpgw_info']['user']['preferences']['property']['notify_project_owner']
-               //                                                       && 
$config->config_data['mailnotification']
-                                                               )
+                                                               
$prefs_coordinator = $this->bocommon->create_preferences('property', 
$values['coordinator']);
+                                                               
if(isset($prefs_coordinator['email']) && $prefs_coordinator['email'])
                                                                {
-                                                               
$prefs_coordinator = $this->bocommon->create_preferences('property', 
$values['coordinator']);
-                                                                       
if(isset($prefs_coordinator['email']) && $prefs_coordinator['email'])
-                                                                       {
-                                                                               
$toarray[] = $prefs_coordinator['email'];
-                                                                       }
+                                                                       
$toarray[] = $prefs_coordinator['email'];
                                                                }
                                                        }
+                                               }
 
-                                                       $notify_list = 
execMethod('property.notify.read', array
-                                                               (
-                                                                       
'location_id'           => $location_id,
-                                                                       
'location_item_id'      => $id
-                                                               )
-                                                       );
+                                               $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']))
+                                               
if(isset($GLOBALS['phpgw_info']['user']['apps']['sms']))
+                                               {
+                                                       $sms_text = 
"{$subject}. \r\n{$GLOBALS['phpgw_info']['user']['fullname']} 
\r\n{$GLOBALS['phpgw_info']['user']['preferences']['property']['email']}";
+                                                       $sms = 
CreateObject('sms.sms');
+
+                                                       foreach($notify_list as 
$entry)
                                                        {
-                                                               $sms_text = 
"{$subject}. \r\n{$GLOBALS['phpgw_info']['user']['fullname']} 
\r\n{$GLOBALS['phpgw_info']['user']['preferences']['property']['email']}";
-                                                               $sms    = 
CreateObject('sms.sms');
-
-                                                               
foreach($notify_list as $entry)
+                                                               
if($entry['is_active'] && $entry['notification_method'] == 'sms' && 
$entry['sms'])
                                                                {
-                                                                       
if($entry['is_active'] && $entry['notification_method'] == 'sms' && 
$entry['sms'])
-                                                                       {
                                                                        
$sms->websend2pv($this->account, $entry['sms'], $sms_text);
-                                                                               
$toarray_sms[] = "{$entry['first_name']} 
{$entry['last_name']}({$entry['sms']})";
-                                                                       
$receipt['message'][] = array('msg' => lang('%1 is notified', 
"{$entry['first_name']} {$entry['last_name']}"));
-                                                                       }
+                                                                       
$toarray_sms[] = "{$entry['first_name']} 
{$entry['last_name']}({$entry['sms']})";
+                                                                       
$this->receipt['message'][] = array('msg' => lang('%1 is notified', 
"{$entry['first_name']} {$entry['last_name']}"));
                                                                }
-                                                               unset($entry);
+                                                       }
+                                                       unset($entry);
 
-                                                               if($toarray_sms)
-                                                               {
+                                                       if($toarray_sms)
+                                                       {
                                                                
$historylog->add('MS', $id, implode(',', $toarray_sms));
-                                                               }
                                                        }
+                                               }
 
-                                                       reset($notify_list);
-                                                       foreach($notify_list as 
$entry)
+                                               reset($notify_list);
+                                               foreach($notify_list as $entry)
+                                               {
+                                                       if($entry['is_active'] 
&& $entry['notification_method'] == 'email' && $entry['email'])
                                                        {
-                                                               
if($entry['is_active'] && $entry['notification_method'] == 'email' && 
$entry['email'])
-                                                               {
-                                                                       
$toarray[] = "{$entry['first_name']} {$entry['last_name']}<{$entry['email']}>";
-                                                               }
+                                                               $toarray[] = 
"{$entry['first_name']} {$entry['last_name']}<{$entry['email']}>";
                                                        }
-                                                       unset($entry);
+                                               }
+                                               unset($entry);
 
                                                if($toarray)
-                                                       {
+                                               {
                                                        $to = implode(';', 
$toarray);
                                                        $from_name = 
$GLOBALS['phpgw_info']['user']['fullname'];
                                                        $from_email = 
$GLOBALS['phpgw_info']['user']['preferences']['property']['email'];
@@ -1098,15 +1098,15 @@
                                                        $body = '<a href ="' . 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uiproject.edit',
                                                                'id' => $id), 
false, true) . '">' . lang('project %1 has been edited', $id) . '</a>' . "\n";
 
-                                                               
foreach($receipt['notice_owner'] as $notice)
-                                                               {
-                                                                       $body 
.= $notice . "\n";
-                                                               }
+                                                       
foreach($this->receipt['notice_owner'] as $notice)
+                                                       {
+                                                               $body .= 
$notice . "\n";
+                                                       }
 
-                                                               $body .= 
lang('Altered by') . ': ' . $from_name . "\n";
-                                                               $body .= 
lang('remark') . ': ' . $values['remark'] . "\n";
+                                                       $body .= lang('Altered 
by') . ': ' . $from_name . "\n";
+                                                       $body .= lang('remark') 
. ': ' . $values['remark'] . "\n";
 
-                                                               $body = 
nl2br($body);
+                                                       $body = nl2br($body);
 
                                                        $returncode = 
$GLOBALS['phpgw']->send->msg('email', $to, $subject, $body, false, false, 
false, $from_email, $from_name, 'html');
 
@@ -1119,14 +1119,33 @@
                                                        else
                                                        {
                                                                
$historylog->add('ON', $id, lang('%1 is notified', $to));
-                                                               
$receipt['message'][] = array('msg' => lang('%1 is notified', $to));
+                                                               
$this->receipt['message'][] = array('msg' => lang('%1 is notified', $to));
                                                        }
                                                }
                                        }
                                }
                        }
 
-                       //phpgwapi_cache::message_set($receipt, 'message');
+                       if($id)
+                       {
+                               if(isset($this->receipt['error']) && 
is_array($this->receipt['error']))
+                               {
+                                       foreach($this->receipt['error'] as $key 
=> $entry)
+                                       {
+                                               
phpgwapi_cache::message_set($entry['msg'], 'message');
+                                       }
+                                       unset($entry);
+                               }
+                               if(isset($this->receipt['message']) && 
is_array($this->receipt['message']))
+                               {
+                                       foreach($this->receipt['message'] as 
$key => $entry)
+                                       {
+                                               
phpgwapi_cache::message_set($entry['msg'], 'message');
+                                       }
+                                       unset($entry);
+                               }
+                               self::redirect(array('menuaction' => 
'property.uiproject.edit', 'id' => $id));
+                       }
 
                        $this->edit($values, 'edit');
 
@@ -1159,13 +1178,13 @@
                                }
 
                                if(!$id)
-                                                               {
+                               {
                                        phpgwapi_cache::message_set('ID is 
required for the function uiproject::view()', 'error');
                                        
$GLOBALS['phpgw']->redirect_link('/index.php', array('menuaction' => 
'property.uiproject.index'));
                                }
-                                                               }
-                                                               else
-                                                               {
+                       }
+                       else
+                       {
                                if(!$this->acl_add && !$this->acl_edit)
                                {
                                        $this->bocommon->no_access();
@@ -1182,7 +1201,7 @@
                                $add_request = array('request_id' => 
array(phpgw::get_var('origin_id', 'int')));
                        }
 
-                       if( $mode == 'edit' && $add_request && $id)
+                       if($mode == 'edit' && $add_request && $id)
                        {
                                $receipt = $this->bo->add_request($add_request, 
$id);
                        }
@@ -1193,68 +1212,69 @@
 
                        if(!$id && $bypass)
                        {
-                               $location_code          = 
phpgw::get_var('location_code');
-                               $tenant_id                      = 
phpgw::get_var('tenant_id', 'int');
-                               $values['descr']        = 
phpgw::get_var('descr');
-                               $p_entity_id            = 
phpgw::get_var('p_entity_id', 'int');
-                               $p_cat_id                       = 
phpgw::get_var('p_cat_id', 'int');
-                               $values['p'][$p_entity_id]['p_entity_id']       
= $p_entity_id;
-                               $values['p'][$p_entity_id]['p_cat_id']          
= $p_cat_id;
-                               $values['p'][$p_entity_id]['p_num']             
= phpgw::get_var('p_num');
+                               $location_code = 
phpgw::get_var('location_code');
+                               $tenant_id = phpgw::get_var('tenant_id', 'int');
+                               $values['descr'] = phpgw::get_var('descr');
+                               $p_entity_id = phpgw::get_var('p_entity_id', 
'int');
+                               $p_cat_id = phpgw::get_var('p_cat_id', 'int');
+                               $values['p'][$p_entity_id]['p_entity_id'] = 
$p_entity_id;
+                               $values['p'][$p_entity_id]['p_cat_id'] = 
$p_cat_id;
+                               $values['p'][$p_entity_id]['p_num'] = 
phpgw::get_var('p_num');
 
-                               $origin                         = 
phpgw::get_var('origin');
-                               $origin_id                      = 
phpgw::get_var('origin_id', 'int');
+                               $origin = phpgw::get_var('origin');
+                               $origin_id = phpgw::get_var('origin_id', 'int');
 
                                if($origin == '.ticket' && $origin_id && 
!$values['descr'])
                                {
-                                       $boticket= 
CreateObject('property.botts');
+                                       $boticket = 
CreateObject('property.botts');
                                        $ticket = 
$boticket->read_single($origin_id);
                                        $values['descr'] = $ticket['details'];
                                        $values['name'] = $ticket['subject'] ? 
$ticket['subject'] : $ticket['category_name'];
                                        $ticket_notes = 
$boticket->read_additional_notes($origin_id);
-                                       $i = count($ticket_notes)-1;
+                                       $i = count($ticket_notes) - 1;
                                        
if(isset($ticket_notes[$i]['value_note']) && $ticket_notes[$i]['value_note'])
                                        {
                                                $values['descr'] .= ": " . 
$ticket_notes[$i]['value_note'];
-                                                               }
+                                       }
                                        $values['contact_id'] = 
$ticket['contact_id'];
-                                       $tts_status_create_project      = 
isset($GLOBALS['phpgw_info']['user']['preferences']['property']['tts_status_create_project'])
 ? 
$GLOBALS['phpgw_info']['user']['preferences']['property']['tts_status_create_project']
 : '';
+                                       $tts_status_create_project = 
isset($GLOBALS['phpgw_info']['user']['preferences']['property']['tts_status_create_project'])
 ? 
$GLOBALS['phpgw_info']['user']['preferences']['property']['tts_status_create_project']
 : '';
                                        if($tts_status_create_project)
                                        {
                                                
$boticket->update_status(array('status' => $tts_status_create_project), 
$origin_id);
-                                                       }
+                                       }
 
-                                       if ( 
isset($GLOBALS['phpgw_info']['user']['preferences']['property']['auto_create_project_from_ticket'])
-                                               && 
$GLOBALS['phpgw_info']['user']['preferences']['property']['auto_create_project_from_ticket']
 == 'yes')
+                                       
if(isset($GLOBALS['phpgw_info']['user']['preferences']['property']['auto_create_project_from_ticket'])
+                                       && 
$GLOBALS['phpgw_info']['user']['preferences']['property']['auto_create_project_from_ticket']
 == 'yes')
                                        {
                                                $auto_create = true;
-                                               }
                                        }
+                               }
 
                                if($p_entity_id && $p_cat_id)
-                                       {
+                               {
                                        if(!is_object($boadmin_entity))
                                        {
-                                               $boadmin_entity = 
CreateObject('property.boadmin_entity');
+                                               $boadmin_entity = 
CreateObject('property.boadmin_entity');
                                        }
 
-                                       $entity_category = 
$boadmin_entity->read_single_category($p_entity_id,$p_cat_id);
+                                       $entity_category = 
$boadmin_entity->read_single_category($p_entity_id, $p_cat_id);
                                        
$values['p'][$p_entity_id]['p_cat_name'] = $entity_category['name'];
                                }
 
                                if($location_code)
-                                               {
-                                       $values['location_data'] = 
$bolocation->read_single($location_code,array('tenant_id'=>$tenant_id,'p_num'=>$p_num,
 'view' => true));
-                                               }
+                               {
+                                       $values['location_data'] = 
$bolocation->read_single($location_code, array('tenant_id' => $tenant_id,
+                                               'p_num' => $p_num, 'view' => 
true));
+                               }
 
                                if(isset($origin) && $origin)
-                                               {
-                                       $interlink      = 
CreateObject('property.interlink');
-                                       $values['origin_data'][0]['location']= 
$origin;
-                                       $values['origin_data'][0]['descr']= 
$interlink->get_location_name($origin);
-                                       $values['origin_data'][0]['data'][]= 
array(
-                                               'id'    => $origin_id,
-                                               'link'  => 
$interlink->get_relation_link(array('location' => $origin), $origin_id),
+                               {
+                                       $interlink = 
CreateObject('property.interlink');
+                                       $values['origin_data'][0]['location'] = 
$origin;
+                                       $values['origin_data'][0]['descr'] = 
$interlink->get_location_name($origin);
+                                       $values['origin_data'][0]['data'][] = 
array(
+                                               'id' => $origin_id,
+                                               'link' => 
$interlink->get_relation_link(array('location' => $origin), $origin_id),
                                        );
                                }
                        }
@@ -1270,7 +1290,7 @@
                        {
                                $_transfer_new_project = 
isset($values['new_project_id']) && $values['new_project_id'] ? true : false;
 
-                               $values = $this->bo->read_single($id);
+                               $values = $this->bo->read_single($id);
                                if(!isset($values['origin']))
                                {
                                        $values['origin'] = '';
@@ -1308,7 +1328,7 @@
                        else
                        {
                                $function_msg = lang('Add Project');
-                               $values = $this->bo->read_single(0, $values);
+                               $values = $this->bo->read_single(0, $values);
                        }
 
                        $tabs = array();
@@ -1320,11 +1340,11 @@
                                        {
                                                $link_history_data = array
                                                        (
-                                                               'menuaction'    
=> 'property.uiproject.attrib_history',
-                                                               'attrib_id'     
=> $attribute['id'],
-                                                               'id'            
=> $id,
-                                                               'edit'          
=> true
-                                                       );
+                                                       'menuaction' => 
'property.uiproject.attrib_history',
+                                                       'attrib_id' => 
$attribute['id'],
+                                                       'id' => $id,
+                                                       'edit' => true
+                                               );
 
                                                $attribute['link_history'] = 
$GLOBALS['phpgw']->link('/index.php', $link_history_data);
                                        }
@@ -1343,14 +1363,14 @@
                        $location_data = $bolocation->initiate_ui_location(array
                                (
                                'values' => (isset($values['location_data']) ? 
$values['location_data'] : ''),
-                                       'type_id'       => -1, // calculated 
from location_types
-                                       'no_link'       => false, // disable 
lookup links for location type less than type_id
-                                       'tenant'        => true,
-                                       'lookup_type'   => $lookup_type,
-                                       'lookup_entity' => 
$this->bocommon->get_lookup_entity('project'),
+                               'type_id' => -1, // calculated from 
location_types
+                               'no_link' => false, // disable lookup links for 
location type less than type_id
+                               'tenant' => true,
+                               'lookup_type' => $lookup_type,
+                               'lookup_entity' => 
$this->bocommon->get_lookup_entity('project'),
                                'entity_data' => (isset($values['p']) ? 
$values['p'] : ''),
                                'required_level' => 1
-                               )
+                       )
                        );
 
                        $b_account_data = array();
@@ -1360,29 +1380,29 @@
                        {
                                $b_account_data = 
$this->bocommon->initiate_ui_budget_account_lookup(array
                                        (
-                                               'b_account_id'          => 
$values['b_account_id'],
-                                               'b_account_name'        => 
$values['b_account_name'],
-                                               'role'                          
=> 'group',
-                                               'type'                          
=> $lookup_type
-                                       )
+                                       'b_account_id' => 
$values['b_account_id'],
+                                       'b_account_name' => 
$values['b_account_name'],
+                                       'role' => 'group',
+                                       'type' => $lookup_type
+                               )
                                );
 
                                $ecodimb_data = 
$this->bocommon->initiate_ecodimb_lookup(array
                                        (
-                                               'ecodimb'                       
=> $values['ecodimb'],
-                                               'ecodimb_descr'         => 
$values['ecodimb_descr'],
-                                               'disabled'                      
=> $mode == 'view'
-                                       ));
+                                       'ecodimb' => $values['ecodimb'],
+                                       'ecodimb_descr' => 
$values['ecodimb_descr'],
+                                       'disabled' => $mode == 'view'
+                               ));
                        }
 
                        $contact_data = 
$this->bocommon->initiate_ui_contact_lookup(array
                                (
-                                       'contact_id'            => 
$values['contact_id'],
-                                       'contact_name'          => 
$values['contact_name'],
-                                       'field'                         => 
'contact',
-                                       'type'                          => 
$lookup_type
-                                       )
-                               );
+                               'contact_id' => $values['contact_id'],
+                               'contact_name' => $values['contact_name'],
+                               'field' => 'contact',
+                               'type' => $lookup_type
+                       )
+                       );
 
 
                        if(isset($values['contact_phone']))
@@ -1397,33 +1417,33 @@
                        }
 
                        $link_data = array
-                       (
+                               (
                                'menuaction' => 'property.uiproject.save',
-                               'id'            => $id
+                               'id' => $id
                        );
 
                        $link_request_data = array
                                (
-                                       'menuaction'    => 
'property.uirequest.index',
+                               'menuaction' => 'property.uirequest.index',
                                'query' => 
(isset($values['location_data']['loc1']) ? $values['location_data']['loc1'] : 
''),
                                'project_id' => (isset($id) ? $id : '')
-                               );
+                       );
 
                        $supervisor_email = array();
                        if($need_approval = 
isset($config->config_data['project_approval']) ? 
$config->config_data['project_approval'] : '')
                        {
-                               $invoice        = 
CreateObject('property.soinvoice');
+                               $invoice = CreateObject('property.soinvoice');
                                if(isset($config->config_data['invoice_acl']) 
&& $config->config_data['invoice_acl'] == 'dimb')
                                {
                                        $supervisor_id = 
$invoice->get_default_dimb_role_user(2, $values['ecodimb']);
 
                                        $sodimb_role_users = 
execMethod('property.sodimb_role_user.read', array
-                                                       (
-                                                               'dimb_id'       
                => $values['ecodimb'],
-                                                               'role_id'       
                => 2,
-                                                               'query_start'   
        => 
date($GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']),
-                                                               
'get_netto_list'        => true
-                                                       )
+                                               (
+                                               'dimb_id' => $values['ecodimb'],
+                                               'role_id' => 2,
+                                               'query_start' => 
date($GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']),
+                                               'get_netto_list' => true
+                                       )
                                        );
                                        
if(isset($sodimb_role_users[$values['ecodimb']][2]) && 
is_array($sodimb_role_users[$values['ecodimb']][2]))
                                        {
@@ -1431,10 +1451,10 @@
                                                {
                                                        $prefs = 
$this->bocommon->create_preferences('property', $supervisor_id);
                                                        $supervisor_email[] = 
array
-                                                       (
-                                                               'id'      => 
$supervisor_id,
+                                                               (
+                                                               'id' => 
$supervisor_id,
                                                                'address' => 
$prefs['email'],
-                                                               'default'       
=> $entry['default_user'],
+                                                               'default' => 
$entry['default_user'],
                                                        );
                                                }
                                        }
@@ -1442,8 +1462,8 @@
                                        $supervisor2_id = 
$invoice->get_default_dimb_role_user(3, $values['ecodimb']);
                                        $prefs2 = 
$this->bocommon->create_preferences('property', $supervisor2_id);
                                        $supervisor_email[] = array
-                                       (
-                                               'id'      => $supervisor2_id,
+                                               (
+                                               'id' => $supervisor2_id,
                                                'address' => $prefs2['email'],
                                        );
 //                                     $supervisor_email = 
array_reverse($supervisor_email);
@@ -1465,8 +1485,8 @@
                                        {
                                                $prefs = 
$this->bocommon->create_preferences('property', $supervisor_id);
                                                $supervisor_email[] = array
-                                               (
-                                                       'id'      => 
$supervisor_id,
+                                                       (
+                                                       'id' => $supervisor_id,
                                                        'address' => 
$prefs['email'],
                                                );
 
@@ -1479,8 +1499,8 @@
                                                        
if(isset($prefs2['email']))
                                                        {
                                                                
$supervisor_email[] = array
-                                                               (
-                                                                       'id'    
  => $prefs['approval_from'],
+                                                                       (
+                                                                       'id' => 
$prefs['approval_from'],
                                                                        
'address' => $prefs2['email'],
                                                                );
                                                                
$supervisor_email = array_reverse($supervisor_email);
@@ -1530,8 +1550,8 @@
                        
$GLOBALS['phpgw']->jqcal->add_listener('values_end_date');
 
                        $project_group_data = 
$this->bocommon->initiate_project_group_lookup(array(
-                               'project_group'                 => 
$values['project_group'],
-                               'project_group_descr'   => 
$values['project_group_descr']));
+                               'project_group' => $values['project_group'],
+                               'project_group_descr' => 
$values['project_group_descr']));
 
 
                        //---datatable 
settings---------------------------------------------------
@@ -1560,19 +1580,19 @@
                                        $_year_count = array();
                                        foreach($content_budget as $key => $row)
                                        {
-                                               $_year_count[$row['year']]  +=1;
+                                               $_year_count[$row['year']] +=1;
                                                $rows_per_page = 
$_year_count[$row['year']];
                                        }
                                        $initial_page = 
floor(count($content_budget) / $rows_per_page);
-                                       }
+                               }
 
                                foreach($content_budget as & $b_entry)
                                {
                                        if($b_entry['active'])
                                        {
-                                               $sum_actual_cost        += 
$b_entry['actual_cost'];
-                                               $sum_oblications        += 
$b_entry['sum_oblications'];
-                                               $values['sum']          += 
$b_entry['budget'];
+                                               $sum_actual_cost += 
$b_entry['actual_cost'];
+                                               $sum_oblications += 
$b_entry['sum_oblications'];
+                                               $values['sum'] += 
$b_entry['budget'];
                                        }
                                        if($b_entry['active'])
                                        {
@@ -1591,8 +1611,6 @@
                                        $b_entry['closed_orig'] = "<input 
type='checkbox' name='values[closed_orig_b_period][]' 
value='{$b_entry['year']}_{$b_entry['month']}' $checked style='display:none'>";
                                        $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 style='display:none'>";
-
-
                                }
                                unset($b_entry);
                        }
@@ -1658,8 +1676,10 @@
                                                'sortable' => false, 
'className' => 'right', 'formatter' => 'JqueryPortico.FormatterAmount2'),
                                        array('key' => 'deviation_percent_acc', 
'label' => lang('percent') . '::' . lang('accumulated'),
                                                'sortable' => false, 
'className' => 'right', 'formatter' => 'JqueryPortico.FormatterAmount2'),
-                                       array('key' => 'closed', 'label' => 
lang('closed'), 'sortable' => false, 'className' => 'center', 'formatter' => 
'JqueryPortico.FormatterClosed'),
-                                       array('key' => 'active', 'label' => 
lang('active'), 'sortable' => false, 'className' => 'center', 'formatter' => 
'JqueryPortico.FormatterActive'),
+                                       array('key' => 'closed', 'label' => 
lang('closed'), 'sortable' => false, 'className' => 'center',
+                                               'formatter' => 
'JqueryPortico.FormatterClosed'),
+                                       array('key' => 'active', 'label' => 
lang('active'), 'sortable' => false, 'className' => 'center',
+                                               'formatter' => 
'JqueryPortico.FormatterActive'),
                                        array('key' => 'delete_year', 'label' 
=> lang('Delete'), 'sortable' => false,
                                                'className' => 'center')
                                );
@@ -1674,9 +1694,9 @@
                                'config' => array(
                                        array('disableFilter' => true),
                                        array('disablePagination' => true),
-                                       array('initial_page'    => 
$initial_page)
+                                       array('initial_page' => $initial_page)
                                )
-                               );
+                       );
 
                        $orders_def = array
                                (
@@ -1713,7 +1733,7 @@
                                        array('disableFilter' => true),
                                        array('disablePagination' => true)
                                )
-                               );
+                       );
 
                        $_formatter_voucher_link = 
isset($config->config_data['invoicehandler']) && 
$config->config_data['invoicehandler'] == 2 ? 'formatLink_invoicehandler_2' : 
'formatLink_voucher';
 
@@ -1752,7 +1772,7 @@
                                        array('disableFilter' => true),
                                        array('disablePagination' => true)
                                )
-                               );
+                       );
 
                        /*
                         * start new notify-table
@@ -1760,15 +1780,15 @@
                         */
 
                        $notify_info = 
execMethod('property.notify.get_jquery_table_def', array
-                                                               (
-                                                                       
'location_id'           => $location_id,
-                                                                       
'location_item_id'      => $id,
+                               (
+                               'location_id' => $location_id,
+                               'location_item_id' => $id,
                                'count' => count($datatable_def), //3
                                'requestUrl' => 
json_encode(self::link(array('menuaction' => 'property.notify.update_data',
                                        'location_id' => $location_id, 
'location_item_id' => $id, 'action' => 'refresh_notify_contact',
                                        'phpgw_return_as' => 'json'))),
-                                                               )
-                                                       );
+                       )
+                       );
 
                        $datatable_def[] = array
                                (
@@ -1783,7 +1803,7 @@
                                        array('disableFilter' => true),
                                        array('disablePagination' => true)
                                )
-                               );
+                       );
 
                        /* end new notify-table */
 
@@ -1806,13 +1826,13 @@
                                        array('disableFilter' => true),
                                        array('disablePagination' => true)
                                )
-                               );
+                       );
 
 //--------------files
                        $link_file_data = array
-                       (
-                               'menuaction'    => 
'property.uiproject.view_file',
-                               'id'            => $id
+                               (
+                               'menuaction' => 'property.uiproject.view_file',
+                               'id' => $id
                        );
 
                        $link_to_files = 
(isset($config->config_data['files_url']) ? $config->config_data['files_url'] : 
'');
@@ -1840,7 +1860,7 @@
                        }
 
                        $files_def = array
-                       (
+                               (
                                array('key' => 'file_name', 'label' => 
lang('Filename'), 'sortable' => false,
                                        'resizeable' => true),
                                array('key' => 'delete_file', 'label' => 
lang('Delete file'), 'sortable' => false,
@@ -1857,11 +1877,11 @@
                                        array('disableFilter' => true),
                                        array('disablePagination' => true)
                                )
-                               );
+                       );
 
 //--------------files
 
-                       $lang_delete_request_statustext = lang('Check to delete 
this request from this project');
+                       $lang_delete_request_statustext = lang('Check to delete 
this request from this project');
                        $_origin = array();
                        if(isset($values['origin_data']) && 
$values['origin_data'])
                        {
@@ -1876,26 +1896,27 @@
                                                }
 
                                                $_origin[] = array
-                                               (
-                                                       'url'                   
=> "<a href='{$_origin_data['link']}'>{$_origin_data['id']} </a>",
-                                                       'type'                  
=> $__origin['descr'],
-                                                       'title'                 
=> $_origin_data['title'],
-                                                       'status'                
=> $_origin_data['statustext'],
-                               //                      'user'                  
=> $GLOBALS['phpgw']->accounts->get($_origin_data['account_id'])->__toString(),
-                               //                      'entry_date'    => 
$GLOBALS['phpgw']->common->show_date($_origin_data['entry_date'],$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']),
-                                                       'select'                
=> $_select
+                                                       (
+                                                       'url' => "<a 
href='{$_origin_data['link']}'>{$_origin_data['id']} </a>",
+                                                       'type' => 
$__origin['descr'],
+                                                       'title' => 
$_origin_data['title'],
+                                                       'status' => 
$_origin_data['statustext'],
+                                                       //                      
'user'                  => 
$GLOBALS['phpgw']->accounts->get($_origin_data['account_id'])->__toString(),
+                                                       //                      
'entry_date'    => 
$GLOBALS['phpgw']->common->show_date($_origin_data['entry_date'],$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']),
+                                                       'select' => $_select
                                                );
                                        }
-                               } 
+                               }
                        }
 
                        $origin_def = array
-                       (
+                               (
                                array('key' => 'url', 'label' => lang('id'), 
'sortable' => true),
                                array('key' => 'type', 'label' => lang('type'), 
'sortable' => true),
                                array('key' => 'title', 'label' => 
lang('title'), 'sortable' => false),
                                array('key' => 'status', 'label' => 
lang('status'), 'sortable' => false),
-                               array('key' => 'select', 'label' => 
lang('select'), 'className' => 'center','sortable' => false)
+                               array('key' => 'select', 'label' => 
lang('select'), 'className' => 'center',
+                                       'sortable' => false)
                        );
 
                        $datatable_def[] = array
@@ -1912,17 +1933,17 @@
 
                        
//----------------------------------------------datatable settings--------
 
-                       $suppresscoordination                   = 
isset($config->config_data['project_suppresscoordination']) && 
$config->config_data['project_suppresscoordination'] ? 1 : '';
+                       $suppresscoordination = 
isset($config->config_data['project_suppresscoordination']) && 
$config->config_data['project_suppresscoordination'] ? 1 : '';
 
                        $year = date('Y') - 1;
-                       $limit  = $year + 8;
+                       $limit = $year + 8;
 
                        while($year < $limit)
                        {
                                $year_list[] = array
-                               (
-                                       'id'    =>  $year,
-                                       'name'  =>  $year
+                                       (
+                                       'id' => $year,
+                                       'name' => $year
                                );
                                $year++;
                        }
@@ -1930,29 +1951,29 @@
                        $periodization_list = 
$this->bo->get_periodizations_with_outline();
 
                        $sub_entry_action_data = array();
-                               $sub_entry_action_data = array
+                       $sub_entry_action_data = array
                                (
-                                       'menuaction'    => 
'property.uiworkorder.edit',
-                                       'project_id'    => $id
-                               );
+                               'menuaction' => 'property.uiworkorder.edit',
+                               'project_id' => $id
+                       );
 
                        if($id && !$values['project_type_id'] == 3)
                        {
                                $sub_entry_action_data = array
-                               (
-                                       'menuaction'    => 
'property.uiworkorder.edit',
-                                       'project_id'    => $id
+                                       (
+                                       '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
+                                       (
+                                       'menuaction' => 
'property.uiproject.edit',
+                                       'bypass' => 1,
+                                       'parent_id' => $id,
+                                       'origin' => '.project',
+                                       'origin_id' => $id
                                );
                        }
                        $msgbox_data = 
$this->bocommon->msgbox_data($this->receipt);
@@ -1961,140 +1982,140 @@
                        $active_tab = phpgw::get_var('tab', 'string', 
'REQUEST', 'general');
 
                        $data = array
-                       (
+                               (
                                'datatable_def' => $datatable_def,
-                                       'project_types'                         
                => array('options' => 
$this->bo->get_project_types($project_type_id)),
-                                       'project_type_id'                       
                => $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 : '',
-                                       'suppresscoordination'                  
        => $suppresscoordination,
-                                       'custom_attributes'                     
                => array('attributes' => $values['attributes']),
+                               'project_types' => array('options' => 
$this->bo->get_project_types($project_type_id)),
+                               'project_type_id' => $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 : '',
+                               'suppresscoordination' => $suppresscoordination,
+                               'custom_attributes' => array('attributes' => 
$values['attributes']),
                                'lookup_functions' => 
isset($values['lookup_functions']) ? $values['lookup_functions'] : '',
-                                       'b_account_data'                        
                => $b_account_data,
-                                       'ecodimb_data'                          
                => $ecodimb_data,
-                                       'contact_data'                          
                => $contact_data,
+                               'b_account_data' => $b_account_data,
+                               'ecodimb_data' => $ecodimb_data,
+                               'contact_data' => $contact_data,
                                'tabs' => self::_generate_tabs($tabs, 
$active_tab, array('documents' => $id ? false : true,
                                        'history' => $id ? false : true)),
-                                       'msgbox_data'                           
                => $GLOBALS['phpgw']->common->msgbox($msgbox_data),
+                               'msgbox_data' => 
$GLOBALS['phpgw']->common->msgbox($msgbox_data),
                                'value_origin' => isset($values['origin_data']) 
? $values['origin_data'] : '',
                                'value_origin_type' => isset($origin) ? $origin 
: '',
                                'value_origin_id' => isset($origin_id) ? 
$origin_id : '',
-                                       'year_list'                             
                        => array('options' => $year_list),
-                                       'order_time_span'                       
                => array('options' => $this->bo->get_order_time_span($id)),
-                                       'periodization_list'                    
        => array('options' => $periodization_list),
-                                       'lang_select_request_statustext'        
=> lang('Add request for this project'),
-                                       'lang_request_statustext'               
        => lang('Link to the request for this project'),
+                               'year_list' => array('options' => $year_list),
+                               'order_time_span' => array('options' => 
$this->bo->get_order_time_span($id)),
+                               'periodization_list' => array('options' => 
$periodization_list),
+                               'lang_select_request_statustext' => lang('Add 
request for this project'),
+                               'lang_request_statustext' => lang('Link to the 
request for this project'),
                                'link_select_request' => 
$GLOBALS['phpgw']->link('/index.php', $link_request_data),
                                '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'),
+                               'lang_no_workorders' => lang('No workorder 
budget'),
                                'workorder_link' => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uiworkorder.edit')),
-                                       'record_history'                        
                => $record_history,
-                                       'table_header_history'                  
        => $table_header_history,
-                                       'lang_history'                          
                => lang('History'),
-                                       'lang_no_history'                       
                => lang('No history'),
-                                       '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'],
-                                       'lang_end_date_statustext'              
        => lang('Select the estimated end date for the Project'),
-                                       'lang_end_date'                         
                => lang('Project end date'),
+                               'record_history' => $record_history,
+                               'table_header_history' => $table_header_history,
+                               'lang_history' => lang('History'),
+                               'lang_no_history' => lang('No history'),
+                               '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'],
+                               'lang_end_date_statustext' => lang('Select the 
estimated end date for the Project'),
+                               'lang_end_date' => lang('Project end date'),
                                'value_end_date' => isset($values['end_date']) 
? $values['end_date'] : '',
-                                       'lang_copy_project'                     
                => lang('Copy project ?'),
-                                       'lang_copy_project_statustext'          
=> lang('Choose Copy Project to copy this project to a new project'),
-                                       'lang_charge_tenant'                    
        => lang('Charge tenant'),
-                                       'lang_charge_tenant_statustext'         
=> lang('Choose charge tenant if the tenant i to pay for this project'),
+                               'lang_copy_project' => lang('Copy project ?'),
+                               'lang_copy_project_statustext' => lang('Choose 
Copy Project to copy this project to a new project'),
+                               'lang_charge_tenant' => lang('Charge tenant'),
+                               'lang_charge_tenant_statustext' => lang('Choose 
charge tenant if the tenant i to pay for this project'),
                                'charge_tenant' => 
isset($values['charge_tenant']) ? $values['charge_tenant'] : '',
-                                       'lang_power_meter'                      
                => lang('Power meter'),
-                                       'lang_power_meter_statustext'           
=> lang('Enter the power meter'),
+                               'lang_power_meter' => lang('Power meter'),
+                               'lang_power_meter_statustext' => lang('Enter 
the power meter'),
                                'value_power_meter' => 
isset($values['power_meter']) ? $values['power_meter'] : '',
                                'value_budget' => isset($values['budget']) && 
$this->receipt['error'] ? $values['budget'] : '',
-                                       'lang_reserve'                          
                => lang('reserve'),
+                               'lang_reserve' => lang('reserve'),
                                'value_reserve' => isset($values['reserve']) ? 
$values['reserve'] : '',
-                                       'lang_reserve_statustext'               
        => lang('Enter the reserve'),
+                               'lang_reserve_statustext' => lang('Enter the 
reserve'),
                                'value_sum' => isset($values['sum']) ? 
$values['sum'] : '',
-                                       'lang_reserve_remainder'                
        => lang('reserve remainder'),
+                               'lang_reserve_remainder' => lang('reserve 
remainder'),
                                'value_reserve_remainder' => 
isset($reserve_remainder) ? $reserve_remainder : '',
                                'value_reserve_remainder_percent' => 
isset($remainder_percent) ? $remainder_percent : '',
 //                                     'lang_planned_cost'                     
                => lang('planned cost'),
 //                                     'value_planned_cost'                    
        => $values['planned_cost'],
-                                       'location_data'                         
                => $location_data,
-                                       'location_type'                         
                => 'form',
+                               'location_data' => $location_data,
+                               'location_type' => 'form',
                                'form_action' => 
$GLOBALS['phpgw']->link('/index.php', $link_data),
                                'done_action' => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uiproject.index')),
-                                       'lang_year'                             
                        => lang('Year'),
-                                       'lang_category'                         
                => lang('category'),
-                                       'lang_save'                             
                        => lang('save'),
-                                       'lang_done'                             
                        => lang('done'),
-                                       'lang_name'                             
                        => lang('Name'),
-                                       'lang_project_id'                       
                => lang('Project ID'),
+                               'lang_year' => lang('Year'),
+                               'lang_category' => lang('category'),
+                               'lang_save' => lang('save'),
+                               'lang_done' => lang('done'),
+                               'lang_name' => lang('Name'),
+                               'lang_project_id' => lang('Project ID'),
                                'value_project_id' => isset($id) ? $id : '',
-                                       'project_group_data'                    
        => $project_group_data,
+                               'project_group_data' => $project_group_data,
                                'value_name' => isset($values['name']) ? 
$values['name'] : '',
-                                       'lang_name_statustext'                  
        => lang('Enter Project Name'),
-                                       'lang_other_branch'                     
                => lang('Other branch'),
-                                       'lang_other_branch_statustext'          
=> lang('Enter other branch if not found in the list'),
+                               'lang_name_statustext' => lang('Enter Project 
Name'),
+                               'lang_other_branch' => lang('Other branch'),
+                               'lang_other_branch_statustext' => lang('Enter 
other branch if not found in the list'),
                                'value_other_branch' => 
isset($values['other_branch']) ? $values['other_branch'] : '',
-                                       'lang_descr_statustext'                 
        => lang('Enter a description of the project'),
-                                       'lang_descr'                            
                => lang('Description'),
+                               'lang_descr_statustext' => lang('Enter a 
description of the project'),
+                               'lang_descr' => lang('Description'),
                                'value_descr' => isset($values['descr']) ? 
$values['descr'] : '',
-                                       'lang_remark_statustext'                
        => lang('Enter a remark to add to the history of the project'),
-                                       'lang_remark'                           
                => lang('remark'),
+                               'lang_remark_statustext' => lang('Enter a 
remark to add to the history of the project'),
+                               'lang_remark' => lang('remark'),
                                'value_remark' => isset($values['remark']) ? 
$values['remark'] : '',
-                                       'lang_done_statustext'                  
        => lang('Back to the list'),
-                                       'lang_save_statustext'                  
        => lang('Save the project'),
-                                       'lang_no_cat'                           
                => lang('Select category'),
+                               'lang_done_statustext' => lang('Back to the 
list'),
+                               'lang_save_statustext' => lang('Save the 
project'),
+                               'lang_no_cat' => lang('Select category'),
                                'value_cat_id' => isset($values['cat_id']) ? 
$values['cat_id'] : '',
                                'cat_select' => 
$this->cats->formatted_xslt_list(array('select_name' => 'values[cat_id]',
                                        'selected' => $values['cat_id'], 
'required' => isset($config->config_data['project_optional_category']) && 
$config->config_data['project_optional_category'] ? false : true)),
-                                       'lang_workorder_id'                     
                => lang('Workorder ID'),
-                                       'lang_sum'                              
                        => lang('Sum'),
-                                       'value_remainder'                       
                => $value_remainder,
-                                       'lang_remainder'                        
                => lang('remainder'),
-                                       'lang_coordinator'                      
                => lang('Coordinator'),
-                                       'lang_user_statustext'                  
        => lang('Select the coordinator the project belongs to. To do not use a 
category select NO USER'),
-                                       'select_user_name'                      
                => 'values[coordinator]',
-                                       'lang_no_user'                          
                => lang('Select coordinator'),
+                               'lang_workorder_id' => lang('Workorder ID'),
+                               'lang_sum' => lang('Sum'),
+                               'value_remainder' => $value_remainder,
+                               'lang_remainder' => lang('remainder'),
+                               'lang_coordinator' => lang('Coordinator'),
+                               'lang_user_statustext' => lang('Select the 
coordinator the project belongs to. To do not use a category select NO USER'),
+                               'select_user_name' => 'values[coordinator]',
+                               'lang_no_user' => lang('Select coordinator'),
                                'user_list' => 
$this->bocommon->get_user_list_right2('select', 4, $values['coordinator'], 
$this->acl_location),
                                'status_list' => 
$this->bo->select_status_list('select', $values['status']),
-                                       'status_name'                           
                => 'values[status]',
+                               'status_name' => 'values[status]',
                                'status_required' => true,
-                                       'lang_no_status'                        
                => lang('Select status'),
-                                       'lang_status'                           
                => lang('Status'),
-                                       'lang_status_statustext'                
        => lang('What is the current status of this project ?'),
-                                       'lang_confirm_status'                   
        => lang('Confirm status'),
-                                       'lang_confirm_statustext'               
        => lang('Confirm status to the history'),
+                               'lang_no_status' => lang('Select status'),
+                               'lang_status' => lang('Status'),
+                               'lang_status_statustext' => lang('What is the 
current status of this project ?'),
+                               'lang_confirm_status' => lang('Confirm status'),
+                               'lang_confirm_statustext' => lang('Confirm 
status to the history'),
                                'branch_list' => 
$this->bo->select_branch_p_list((isset($id) ? $id : '')),
-                                       'lang_branch'                           
                => lang('branch'),
-                                       'lang_branch_statustext'                
        => lang('Select the branches for this project'),
+                               'lang_branch' => lang('branch'),
+                               'lang_branch_statustext' => lang('Select the 
branches for this project'),
                                'key_responsible_list' => 
$this->bo->select_branch_list((isset($values['key_responsible']) ? 
$values['key_responsible'] : '')),
-                                       'lang_no_key_responsible'               
        => lang('Select key responsible'),
-                                       'lang_key_responsible'                  
        => lang('key responsible'),
-                                       'lang_key_responsible_statustext'       
=> lang('Select the key responsible for this project'),
+                               'lang_no_key_responsible' => lang('Select key 
responsible'),
+                               'lang_key_responsible' => lang('key 
responsible'),
+                               'lang_key_responsible_statustext' => 
lang('Select the key responsible for this project'),
                                'key_fetch_list' => 
$this->bo->select_key_location_list((isset($values['key_fetch']) ? 
$values['key_fetch'] : '')),
-                                       'lang_no_key_fetch'                     
                => lang('Where to fetch the key'),
-                                       'lang_key_fetch'                        
                => lang('key fetch location'),
-                                       'lang_key_fetch_statustext'             
        => lang('Select where to fetch the key'),
+                               'lang_no_key_fetch' => lang('Where to fetch the 
key'),
+                               'lang_key_fetch' => lang('key fetch location'),
+                               'lang_key_fetch_statustext' => lang('Select 
where to fetch the key'),
                                'key_deliver_list' => 
$this->bo->select_key_location_list((isset($values['key_deliver']) ? 
$values['key_deliver'] : '')),
-                                       'lang_no_key_deliver'                   
        => lang('Where to deliver the key'),
-                                       'lang_key_deliver'                      
                => lang('key deliver location'),
-                                       'lang_key_deliver_statustext'           
=> lang('Select where to deliver the key'),
-                                       'need_approval'                         
                => $need_approval,
-                                       'lang_ask_approval'                     
                => lang('Ask for approval'),
-                                       'lang_ask_approval_statustext'          
=> lang('Check this to send a mail to your supervisor for approval'),
-                                       'value_approval_mail_address'           
=> $supervisor_email,
-                                       'currency'                              
                        => 
$GLOBALS['phpgw_info']['user']['preferences']['common']['currency'],
+                               'lang_no_key_deliver' => lang('Where to deliver 
the key'),
+                               'lang_key_deliver' => lang('key deliver 
location'),
+                               'lang_key_deliver_statustext' => lang('Select 
where to deliver the key'),
+                               'need_approval' => $need_approval,
+                               'lang_ask_approval' => lang('Ask for approval'),
+                               'lang_ask_approval_statustext' => lang('Check 
this to send a mail to your supervisor for approval'),
+                               'value_approval_mail_address' => 
$supervisor_email,
+                               'currency' => 
$GLOBALS['phpgw_info']['user']['preferences']['common']['currency'],
                                'base_java_url' => 
"{menuaction:'property.bocommon.get_vendor_email',phpgw_return_as:'json'}",
-                                       'base_java_notify_url'                  
        => 
"{menuaction:'property.notify.update_data',location_id:{$location_id},location_item_id:{$id}}",
+                               'base_java_notify_url' => 
"{menuaction:'property.notify.update_data',location_id:{$location_id},location_item_id:{$id}}",
                                'edit_action' => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uiproject.edit',
                                        'id' => $id)),
-                                       'lang_edit_statustext'                  
        => lang('Edit this entry '),
-                                       'lang_edit'                             
                        => lang('Edit'),
+                               'lang_edit_statustext' => lang('Edit this entry 
'),
+                               'lang_edit' => lang('Edit'),
                                'decimal_separator' => $this->decimal_separator,
                                'validator' => 
phpgwapi_jquery::formvalidator_generate(array('location',
                                        'date', 'security', 'file'))
-                               );
+                       );
 
                        if($auto_create)
                        {
@@ -2126,7 +2147,7 @@
                                }
                        }
 
-                       $appname                = lang('project');
+                       $appname = lang('project');
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
 
                        phpgwapi_jquery::load_widget('core');
@@ -2138,8 +2159,8 @@
                }
 
                public function get_orders()
-                       {
-                               $project_id = phpgw::get_var('project_id', 
'int');
+               {
+                       $project_id = phpgw::get_var('project_id', 'int');
                        if(empty($project_id))
                        {
                                $result_data = array('results' => array());
@@ -2149,7 +2170,7 @@
                                return $this->jquery_results($result_data);
                        }
 
-                               $year = phpgw::get_var('year', 'int');
+                       $year = phpgw::get_var('year', 'int');
                        $draw = phpgw::get_var('draw', 'int');
 
                        $values = $this->bo->get_orders(array('project_id' => 
$project_id, 'year' => $year));
@@ -2160,8 +2181,8 @@
                                {
                                        $_title = implode(';', 
$_order_entry['mail_recipients']);
                                        $_order_entry['send_order'] = "<input 
type='checkbox' name='values[send_order][]' 
value='{$_order_entry['workorder_id']}' title='{$_title}'>";
+                               }
                        }
-                       }
 
                        $total_records = count($values);
 
@@ -2173,23 +2194,23 @@
                        return $this->jquery_results($result_data);
 
                        /* if( phpgw::get_var('phpgw_return_as') == 'json' )
-                       {
+                         {
 
-                               if(count($content))
-                               {
-                                       return json_encode($content);
-                               }
-                               else
-                               {
-                                       return "";
-                               }
-                       }
+                         if(count($content))
+                         {
+                         return json_encode($content);
+                         }
+                         else
+                         {
+                         return "";
+                         }
+                         }
                          return $content; */
                }
 
                public function get_vouchers()
-                       {
-                               $project_id = phpgw::get_var('project_id', 
'int');
+               {
+                       $project_id = phpgw::get_var('project_id', 'int');
                        if(empty($project_id))
                        {
                                $result_data = array('results' => array());
@@ -2211,26 +2232,26 @@
                        foreach($invoices as $entry)
                        {
                                $values[] = array
-                               (
+                                       (
                                        'voucher_id' => $entry['transfer_time'] 
? -1 * $entry['voucher_id'] : $entry['voucher_id'],
-                                       'voucher_out_id'                => 
$entry['voucher_out_id'],
-                                       'workorder_id'                  => 
$entry['workorder_id'],
-                                       'status'                                
=> $entry['status'],
-                                       'period'                                
=> $entry['period'],
-                                       'periodization'                 => 
$entry['periodization'],
-                                       'periodization_start'   => 
$entry['periodization_start'],
-                                       'invoice_id'                    => 
$entry['invoice_id'],
-                                       'budget_account'                => 
$entry['budget_account'],
-                                       'dima'                                  
=> $entry['dima'],
-                                       'dimb'                                  
=> $entry['dimb'],
-                                       'dimd'                                  
=> $entry['dimd'],
-                                       'type'                                  
=> $entry['type'],
-                                       'amount'                                
=> $entry['amount'],
-                                       'approved_amount'               => 
$entry['approved_amount'],
-                                       'vendor'                                
=> $entry['vendor'],
-                                       'project_group'                 => 
$entry['project_id'],
-                                       'currency'                              
=> $entry['currency'],
-                                       'budget_responsible'    => 
$entry['budget_responsible'],
+                                       'voucher_out_id' => 
$entry['voucher_out_id'],
+                                       'workorder_id' => 
$entry['workorder_id'],
+                                       'status' => $entry['status'],
+                                       'period' => $entry['period'],
+                                       'periodization' => 
$entry['periodization'],
+                                       'periodization_start' => 
$entry['periodization_start'],
+                                       'invoice_id' => $entry['invoice_id'],
+                                       'budget_account' => 
$entry['budget_account'],
+                                       'dima' => $entry['dima'],
+                                       'dimb' => $entry['dimb'],
+                                       'dimd' => $entry['dimd'],
+                                       'type' => $entry['type'],
+                                       'amount' => $entry['amount'],
+                                       'approved_amount' => 
$entry['approved_amount'],
+                                       'vendor' => $entry['vendor'],
+                                       'project_group' => $entry['project_id'],
+                                       'currency' => $entry['currency'],
+                                       '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']) : '',
                                );
@@ -2246,17 +2267,17 @@
                        return $this->jquery_results($result_data);
 
                        /* if( phpgw::get_var('phpgw_return_as') == 'json' )
-                       {
+                         {
 
-                               if(count($content))
-                               {
-                                       return json_encode($content);
-                               }
-                               else
-                               {
-                                       return "";
-                               }
-                       }
+                         if(count($content))
+                         {
+                         return json_encode($content);
+                         }
+                         else
+                         {
+                         return "";
+                         }
+                         }
                          return $content; */
                }
 
@@ -2286,19 +2307,19 @@
 
                        $GLOBALS['phpgw_info']['flags']['menu_selection'] .= 
'::project_bulk_update_status';
 
-                       $start_date     = phpgw::get_var('start_date');
-                       $end_date               = phpgw::get_var('end_date');
-                       $get_list               = phpgw::get_var('get_list', 
'bool', 'POST');
-                       $execute                = phpgw::get_var('execute', 
'bool', 'POST');
-                       $status_filter  = phpgw::get_var('status_filter');
-                       $status_new     = phpgw::get_var('status_new');
+                       $start_date = phpgw::get_var('start_date');
+                       $end_date = phpgw::get_var('end_date');
+                       $get_list = phpgw::get_var('get_list', 'bool', 'POST');
+                       $execute = phpgw::get_var('execute', 'bool', 'POST');
+                       $status_filter = phpgw::get_var('status_filter');
+                       $status_new = phpgw::get_var('status_new');
                        $type = phpgw::get_var('type', 'string', 'REQUEST', 
'project');
-                       $ecodimb                = phpgw::get_var('ecodimb');
+                       $ecodimb = phpgw::get_var('ecodimb');
                        $ids = phpgw::get_var('ids');
-                       $paid                   = phpgw::get_var('paid', 
'bool', 'POST');
-                       $closed_orders  = phpgw::get_var('closed_orders', 
'bool', 'POST');
+                       $paid = phpgw::get_var('paid', 'bool', 'POST');
+                       $closed_orders = phpgw::get_var('closed_orders', 
'bool', 'POST');
                        $transfer_budget = phpgw::get_var('transfer_budget', 
'integer');
-                       $b_account_id   = phpgw::get_var('b_account_id', 
'integer');
+                       $b_account_id = phpgw::get_var('b_account_id', 
'integer');
                        $b_account_name = phpgw::get_var('b_account_name');
 
                        if(isset($_POST['coordinator']))
@@ -2325,7 +2346,7 @@
                        }
 
                        $link_data = array
-                       (
+                               (
                                'menuaction' => 'property.uiproject.index'
                        );
 
@@ -2392,7 +2413,7 @@
                                        'id' => $entry['id']));
                        }
 
-                       $total_records  = count($list);
+                       $total_records = count($list);
 
                        switch($type)
                        {
@@ -2419,7 +2440,7 @@
                                        $b_account_data = array();
                                        $td_count = 9;
                                        break;
-                                       
+
                                case 'workorder':
                                        $lang_coordinator = lang('janitor');
                                        $lang_new_coordinator = lang('new 
janitor');
@@ -2447,11 +2468,11 @@
                                        );
 
                                        $b_account_data = 
$this->bocommon->initiate_ui_budget_account_lookup(array(
-                                               'b_account_id'          => 
$b_account_id,
-                                               'disabled'                      
=> '',
-                                               'parent'                        
=> $project['b_account_id'],
-                                               'type'                          
=> 'form'
-                                               )
+                                               'b_account_id' => $b_account_id,
+                                               'disabled' => '',
+                                               'parent' => 
$project['b_account_id'],
+                                               'type' => 'form'
+                                       )
                                        );
                                        $td_count = 12;
                                        break;
@@ -2502,21 +2523,21 @@
                        $status_list_filter = 
$this->bocommon->select_list($status_filter, $status_list_filter);
 
                        $type_array = array
-                       (
+                               (
                                array
-                               (
+                                       (
                                        'id' => '0',
-                                       'name'  => lang('select')
+                                       'name' => lang('select')
                                ),
                                array
-                               (
+                                       (
                                        'id' => 'workorder',
-                                       'name'  => lang('workorder')
+                                       'name' => lang('workorder')
                                ),
                                array
-                               (
+                                       (
                                        'id' => 'project',
-                                       'name'  => lang('project')
+                                       'name' => lang('project')
                                )
                        );
 
@@ -2525,15 +2546,15 @@
                                $entry['selected'] = $entry['id'] == $type ? 1 
: 0;
                        }
 
-                       $year   = date('Y') - 2;
-                       $limit  = $year + 4;
+                       $year = date('Y') - 2;
+                       $limit = $year + 4;
 
                        while($year < $limit)
                        {
                                $year_list[] = array
-                               (
-                                       'id'    =>  $year,
-                                       'name'  =>  $year
+                                       (
+                                       'id' => $year,
+                                       'name' => $year
                                );
                                $year++;
                        }
@@ -2543,33 +2564,33 @@
                        $active_tab = 'generic';
 
                        $data = array
-                       (
+                               (
                                'datatable_def' => $datatable_def,
-                               'year_list'                             => 
array('options' => $year_list),
+                               'year_list' => array('options' => $year_list),
                                'done_action' => 
$GLOBALS['phpgw']->link('/index.php', $link_data),
                                'update_action' => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'property.uiproject.bulk_update_status')),
-                               'status_list_filter'    => array('options' => 
$status_list_filter),
-                               'status_list_new'               => 
array('options' => $status_list_new),
-                               'type_list'                             => 
array('options' => $type_array),
-                               'user_list'                             => 
array('options' => $user_list),
+                               'status_list_filter' => array('options' => 
$status_list_filter),
+                               'status_list_new' => array('options' => 
$status_list_new),
+                               'type_list' => array('options' => $type_array),
+                               'user_list' => array('options' => $user_list),
                                'ecodimb_list' => array('options' => 
$this->bocommon->select_category_list(array(
                                                'type' => 'dimb', 'selected' => 
$ecodimb))),
-                               'start_date'                    => $start_date,
-                               'end_date'                              => 
$end_date,
-                               'total_records'                 => 
$total_records,
-                               'paid'                                  => 
$paid,
-                               'closed_orders'                 => 
$closed_orders,
-                               'check_paid'                    => $type == 
'workorder' ? 1 : 0,
-                               'check_closed_orders'   => $type == 'project' ? 
1 : 0,
-                               'type'                                  => 
$type,
-                               'b_account_data'                => 
$b_account_data,
+                               'start_date' => $start_date,
+                               'end_date' => $end_date,
+                               'total_records' => $total_records,
+                               'paid' => $paid,
+                               'closed_orders' => $closed_orders,
+                               'check_paid' => $type == 'workorder' ? 1 : 0,
+                               'check_closed_orders' => $type == 'project' ? 1 
: 0,
+                               'type' => $type,
+                               'b_account_data' => $b_account_data,
                                'tabs' => 
phpgwapi_jquery::tabview_generate($tabs, $active_tab),
                                'lang_coordinator' => $lang_coordinator,
                                'lang_new_coordinator' => $lang_new_coordinator,
                        );
 
-                       $appname                        = lang('project');
-                       $function_msg           = lang('bulk update status');
+                       $appname = lang('project');
+                       $function_msg = lang('bulk update status');
 
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
 
@@ -2593,13 +2614,14 @@
                {
                        $tabs = array
                                (
-                                       'general'               => 
array('label' => lang('general'), 'link' => '#general', 'function' => 
"set_tab('general')"),
-                                       'location'              => 
array('label' => lang('location'), 'link' => '#location', 'function' => 
"set_tab('location')"),
-                                       'budget'                => 
array('label' => lang('Time and budget'), 'link' => '#budget', 'function' => 
"set_tab('budget')"),
-                                       'coordination'  => array('label' => 
lang('coordination'), 'link' => '#coordination', 'function' => 
"set_tab('coordination')"),
-                                       'documents'             => 
array('label' => lang('documents'), 'link' => '#documents', 'function' => 
"set_tab('documents')"),
+                               'general' => array('label' => lang('general'), 
'link' => '#general', 'function' => "set_tab('general')"),
+                               'location' => array('label' => 
lang('location'), 'link' => '#location', 'function' => "set_tab('location')"),
+                               'budget' => array('label' => lang('Time and 
budget'), 'link' => '#budget', 'function' => "set_tab('budget')"),
+                               'coordination' => array('label' => 
lang('coordination'), 'link' => '#coordination',
+                                       'function' => 
"set_tab('coordination')"),
+                               'documents' => array('label' => 
lang('documents'), 'link' => '#documents', 'function' => 
"set_tab('documents')"),
                                'history' => array('label' => lang('history'), 
'link' => '#history', 'function' => "set_tab('history')"),
-                               );
+                       );
 
                        $tabs = array_merge($tabs, $tabs_);
                        foreach($suppress as $tab => $remove)
@@ -2612,4 +2634,4 @@
 
                        return phpgwapi_jquery::tabview_generate($tabs, 
$active_tab);
                }
-       }
+       }
\ No newline at end of file




reply via email to

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