fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [6704] Property: formatting: intend


From: Sigurd Nes
Subject: [Fmsystem-commits] [6704] Property: formatting: intend
Date: Sat, 25 Dec 2010 23:13:56 +0000

Revision: 6704
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=6704
Author:   sigurdne
Date:     2010-12-25 23:13:55 +0000 (Sat, 25 Dec 2010)
Log Message:
-----------
Property: formatting: intend

Modified Paths:
--------------
    trunk/property/inc/class.uicustom.inc.php
    trunk/property/inc/class.uidebug_json.inc.php
    trunk/property/inc/class.uidocument.inc.php
    trunk/property/inc/class.uientity.inc.php
    trunk/property/inc/class.uievent.inc.php
    trunk/property/inc/class.uigab.inc.php
    trunk/property/inc/class.uigallery.inc.php
    trunk/property/inc/class.uigeneric.inc.php
    trunk/property/inc/class.uiinvestment.inc.php
    trunk/property/inc/class.uiinvoice.inc.php
    trunk/property/inc/class.uijasper.inc.php
    trunk/property/inc/class.uilocation.inc.php
    trunk/property/inc/class.uilookup.inc.php
    trunk/property/inc/class.uipricebook.inc.php
    trunk/property/inc/class.uiproject.inc.php
    trunk/property/inc/class.uirequest.inc.php

Modified: trunk/property/inc/class.uicustom.inc.php
===================================================================
--- trunk/property/inc/class.uicustom.inc.php   2010-12-25 11:31:42 UTC (rev 
6703)
+++ trunk/property/inc/class.uicustom.inc.php   2010-12-25 23:13:55 UTC (rev 
6704)
@@ -44,13 +44,13 @@
                var $filter;
 
                var $public_functions = array
-               (
-                       'index'  => true,
-                       'view'   => true,
-                       'edit'   => true,
-                       'download' => true,
-                       'delete' => true
-               );
+                       (
+                               'index'         => true,
+                               'view'          => true,
+                               'edit'          => true,
+                               'download'      => true,
+                               'delete'        => true
+                       );
 
                function property_uicustom()
                {
@@ -59,11 +59,11 @@
 
                        $this->account          = 
$GLOBALS['phpgw_info']['user']['account_id'];
 
-                       $this->bo               = 
CreateObject('property.bocustom',true);
+                       $this->bo                       = 
CreateObject('property.bocustom',true);
                        $this->bocommon         = 
CreateObject('property.bocommon');
                        $this->start            = $this->bo->start;
                        $this->query            = $this->bo->query;
-                       $this->sort             = $this->bo->sort;
+                       $this->sort                     = $this->bo->sort;
                        $this->order            = $this->bo->order;
                        $this->filter           = $this->bo->filter;
                        $this->cat_id           = $this->bo->cat_id;
@@ -81,15 +81,15 @@
                function save_sessiondata()
                {
                        $data = array
-                       (
-                               'start'                 => $this->start,
-                               'query'                 => $this->query,
-                               'sort'                  => $this->sort,
-                               'order'                 => $this->order,
-                               'filter'                => $this->filter,
-                               'cat_id'                => $this->cat_id,
-                               'this->allrows'         => $this->allrows
-                       );
+                               (
+                                       'start'                         => 
$this->start,
+                                       'query'                         => 
$this->query,
+                                       'sort'                          => 
$this->sort,
+                                       'order'                         => 
$this->order,
+                                       'filter'                        => 
$this->filter,
+                                       'cat_id'                        => 
$this->cat_id,
+                                       'this->allrows'         => 
$this->allrows
+                               );
                        $this->bo->save_sessiondata($data);
                }
 
@@ -105,38 +105,41 @@
                                $datatable['menu']      = 
$this->bocommon->get_menu();
 
                                $datatable['config']['base_url'] = 
$GLOBALS['phpgw']->link('/index.php', array
-                       (
-                               'menuaction'                    => 
'property.uicustom.index',
-                               'sort'                          => $this->sort,
-                       'order'                         => $this->order,
-                       'cat_id'                        => $this->cat_id,
-                       'filter'                        => $this->filter,
-                       'query'                         => $this->query
-                               ));
+                                       (
+                                               'menuaction'                    
=> 'property.uicustom.index',
+                                               'sort'                          
=> $this->sort,
+                                               'order'                         
=> $this->order,
+                                               'cat_id'                        
=> $this->cat_id,
+                                               'filter'                        
=> $this->filter,
+                                               'query'                         
=> $this->query
+                                       ));
 
-                               $datatable['config']['base_java_url'] = 
"menuaction:'property.uicustom.index',"
-                                                                               
                        ."sort:'{$this->sort}',"
-                                                                               
                        ."order:'{$this->order}',"
-                                                                               
                        ."cat_id:'{$this->cat_id}',"
-                                                                               
                        ."filter:'{$this->filter}',"
-                                                                               
                        ."query:'{$this->query}'";
+                               $datatable['config']['base_java_url'] = 
"menuaction:'property.uicustom.index',"
+                                       ."sort:'{$this->sort}',"
+                                       ."order:'{$this->order}',"
+                                       ."cat_id:'{$this->cat_id}',"
+                                       ."filter:'{$this->filter}',"
+                                       ."query:'{$this->query}'";
 
                                $link_data = array
-                               (
-                                       'menuaction'    => 
'property.uicustom.index',
-                                       'sort'          => $this->sort,
-                                       'order'         => $this->order,
-                                       'cat_id'        => $this->cat_id,
-                                       'filter'        => $this->filter,
-                                       'query'         => $this->query
-                               );
+                                       (
+                                               'menuaction'    => 
'property.uicustom.index',
+                                               'sort'          => $this->sort,
+                                               'order'         => $this->order,
+                                               'cat_id'        => 
$this->cat_id,
+                                               'filter'        => 
$this->filter,
+                                               'query'         => $this->query
+                                       );
 
                                $datatable['config']['allow_allrows'] = true;
 
-                               $datatable['actions']['form'] = array(
-                               array(
-                                       'action'        => 
$GLOBALS['phpgw']->link('/index.php',
-                                                       array(
+                               $datatable['actions']['form'] = array
+                                       (
+                                               array
+                                               (
+                                                       'action'        => 
$GLOBALS['phpgw']->link('/index.php',
+                                                       array
+                                                       (
                                                                'menuaction'    
=> 'property.uicustom.index',
                                                                'sort'          
=> $this->sort,
                                                                'order'         
=> $this->order,
@@ -145,34 +148,38 @@
                                                                'query'         
=> $this->query
                                                        )
                                                ),
-                                       'fields'        => array(
-                                           'field' => array
-                                                               (
-                                                                               
                                array(
-                                                                               
        'type'  => 'button',
-                                                                               
        'id'    => 'btn_new',
-                                                                               
        'value' => lang('add'),
-                                                                               
        'tab_index' => 8
-                                                                               
    ),
-                                                                       array( 
//boton     SEARCH
-                                                                           
'id' => 'btn_search',
-                                                                           
'name' => 'search',
-                                                                           
'value'    => lang('search'),
-                                                                           
'type' => 'button',
-                                                                           
'tab_index' => 7
-                                                                       ),
-                                                                               
                                array( // TEXT INPUT
-                                                                           
'name'     => 'query',
-                                                                           
'id'     => 'txt_query',
-                                                                           
'value'    => '',//$query,
-                                                                           
'type' => 'text',
-                                                                           
'onkeypress' => 'return pulsar(event)',
-                                                                           
'size'    => 28,
-                                                                           
'tab_index' => 6
-                                                                       )
-                                                                               
)
-                                                                               
)
-                                        )
+                                               'fields'        => array
+                                               (
+                                                       'field' => array
+                                                       (
+                                                               array
+                                                               (
+                                                                       'type'  
=> 'button',
+                                                                       'id'    
=> 'btn_new',
+                                                                       'value' 
=> lang('add'),
+                                                                       
'tab_index' => 8
+                                                               ),
+                                                               array
+                                                               ( //boton     
SEARCH
+                                                                       'id' => 
'btn_search',
+                                                                       'name' 
=> 'search',
+                                                                       'value' 
   => lang('search'),
+                                                                       'type' 
=> 'button',
+                                                                       
'tab_index' => 7
+                                                               ),
+                                                               array
+                                                               ( // TEXT INPUT
+                                                                       'name'  
   => 'query',
+                                                                       'id'    
 => 'txt_query',
+                                                                       'value' 
   => '',//$query,
+                                                                       'type' 
=> 'text',
+                                                                       
'onkeypress' => 'return pulsar(event)',
+                                                                       'size'  
  => 28,
+                                                                       
'tab_index' => 6
+                                                               )
+                                                       )
+                                               )
+                                       )
                                );
 
                        }
@@ -209,61 +216,65 @@
                        $datatable['rowactions']['action'] = array();
 
                        $parameters = array
-                       (
-                               'parameter' => array
                                (
-                                       array
+                                       'parameter' => array
                                        (
-                                               'name'          => 'custom_id',
-                                               'source'        => 'custom_id'
-                                       ),
-                               )
-                       );
+                                               array
+                                               (
+                                                       'name'          => 
'custom_id',
+                                                       'source'        => 
'custom_id'
+                                               ),
+                                       )
+                               );
 
                        if($this->acl_read)
                        {
-                               $datatable['rowactions']['action'][] = array(
-                                                       'my_name'               
        => 'view',
-                                                       'statustext'    => 
lang('view the entity'),
-                                                       'text'                  
=> lang('view'),
-                                                       'action'                
=> $GLOBALS['phpgw']->link('/index.php',array
-                                                                       (
-                                                                               
'menuaction'    => 'property.uicustom.view'
-                                                                       )),
+                               $datatable['rowactions']['action'][] = array
+                                       (
+                                               'my_name'               => 
'view',
+                                               'statustext'    => lang('view 
the entity'),
+                                               'text'                  => 
lang('view'),
+                                               'action'                => 
$GLOBALS['phpgw']->link('/index.php',array
+                                               (
+                                                       'menuaction'    => 
'property.uicustom.view'
+                                               )),
                                                'parameters'    => $parameters
-                                               );
+                                       );
                        }
 
                        if($this->acl_edit)
                        {
-                               $datatable['rowactions']['action'][] = array(
-                                                       'my_name'               
        => 'edit',
-                                                       'statustext'    => 
lang('edit the actor'),
-                                                       'text'                  
=> lang('edit'),
-                                                       'action'                
=> $GLOBALS['phpgw']->link('/index.php',array
-                                                                       (
-                                                                               
'menuaction'    => 'property.uicustom.edit'
-                                                                       )),
+                               $datatable['rowactions']['action'][] = array
+                                       (
+                                               'my_name'               => 
'edit',
+                                               'statustext'    => lang('edit 
the actor'),
+                                               'text'                  => 
lang('edit'),
+                                               'action'                => 
$GLOBALS['phpgw']->link('/index.php',array
+                                               (
+                                                       'menuaction'    => 
'property.uicustom.edit'
+                                               )),
                                                'parameters'    => $parameters
-                                               );
+                                       );
                        }
 
                        if($this->acl_delete)
                        {
-                               $datatable['rowactions']['action'][] = array(
-                                                       'my_name'               
        => 'delete',
-                                                       'statustext'    => 
lang('delete the actor'),
-                                                       'text'                  
=> lang('delete'),
-                                                       'confirm_msg'   => 
lang('do you really want to delete this entry'),
-                                                       'action'                
=> $GLOBALS['phpgw']->link('/index.php',array
-                                                                       (
-                                                                               
'menuaction'    => 'property.uicustom.delete'
-                                                                       )),
+                               $datatable['rowactions']['action'][] = array
+                                       (
+                                               'my_name'               => 
'delete',
+                                               'statustext'    => lang('delete 
the actor'),
+                                               'text'                  => 
lang('delete'),
+                                               'confirm_msg'   => lang('do you 
really want to delete this entry'),
+                                               'action'                => 
$GLOBALS['phpgw']->link('/index.php',array
+                                               (
+                                                       'menuaction'    => 
'property.uicustom.delete'
+                                               )),
                                                'parameters'    => $parameters
-                                               );
+                                       );
                        }
 
-                       $datatable['rowactions']['action'][] = array(
+                       $datatable['rowactions']['action'][] = array
+                               (
                                        'my_name'               => 'add',
                                        'text'                  => lang('add'),
                                        'action'                => 
$GLOBALS['phpgw']->link('/index.php',array
@@ -326,77 +337,77 @@
                        }
 
                        phpgwapi_yui::load_widget('dragdrop');
-                       phpgwapi_yui::load_widget('datatable');
-                       phpgwapi_yui::load_widget('menu');
-                       phpgwapi_yui::load_widget('connection');
-                       phpgwapi_yui::load_widget('loader');
+                       phpgwapi_yui::load_widget('datatable');
+                       phpgwapi_yui::load_widget('menu');
+                       phpgwapi_yui::load_widget('connection');
+                       phpgwapi_yui::load_widget('loader');
                        phpgwapi_yui::load_widget('tabview');
                        phpgwapi_yui::load_widget('paginator');
                        phpgwapi_yui::load_widget('animation');
 
                        //-- BEGIN----------------------------- JSON CODE 
------------------------------
-               //values for Pagination
-                       $json = array
-                       (
-                               'recordsReturned'       => 
$datatable['pagination']['records_returned'],
-                               'totalRecords'          => 
(int)$datatable['pagination']['records_total'],
-                               'startIndex'            => 
$datatable['pagination']['records_start'],
+                       //values for Pagination
+                       $json = array
+                               (
+                                       'recordsReturned'       => 
$datatable['pagination']['records_returned'],
+                                       'totalRecords'          => 
(int)$datatable['pagination']['records_total'],
+                                       'startIndex'            => 
$datatable['pagination']['records_start'],
                                        'sort'                          => 
$datatable['sorting']['order'],
-                               'dir'                           => 
$datatable['sorting']['sort'],
+                                       'dir'                           => 
$datatable['sorting']['sort'],
                                        'records'                       => 
array()
-                       );
+                               );
 
-                               // values for datatable
-                       if(isset($datatable['rows']['row']) && 
is_array($datatable['rows']['row'])){
-                               foreach( $datatable['rows']['row'] as $row )
-                               {
-                                       $json_row = array();
-                                       foreach( $row['column'] as $column)
-                                       {
-                                               if(isset($column['format']) && 
$column['format']== "link" && $column['java_link']==true)
-                                               {
-                                                       
$json_row[$column['name']] = "<a href='#' id='".$column['link']."' 
onclick='javascript:filter_data(this.id);'>" .$column['value']."</a>";
-                                               }
-                                               elseif(isset($column['format']) 
&& $column['format']== "link")
-                                               {
-                                                 $json_row[$column['name']] = 
"<a href='".$column['link']."'>" .$column['value']."</a>";
-                                               }else
-                                               {
-                                                 $json_row[$column['name']] = 
$column['value'];
-                                               }
-                                       }
-                                       $json['records'][] = $json_row;
-                               }
-                       }
-
-                               // right in datatable
-                               if(isset($datatable['rowactions']['action']) && 
is_array($datatable['rowactions']['action']))
+                       // values for datatable
+                       if(isset($datatable['rows']['row']) && 
is_array($datatable['rows']['row'])){
+                               foreach( $datatable['rows']['row'] as $row )
                                {
-                                       $json ['rights'] = 
$datatable['rowactions']['action'];
+                                       $json_row = array();
+                                       foreach( $row['column'] as $column)
+                                       {
+                                               if(isset($column['format']) && 
$column['format']== "link" && $column['java_link']==true)
+                                               {
+                                                       
$json_row[$column['name']] = "<a href='#' id='".$column['link']."' 
onclick='javascript:filter_data(this.id);'>" .$column['value']."</a>";
+                                               }
+                                               elseif(isset($column['format']) 
&& $column['format']== "link")
+                                               {
+                                                       
$json_row[$column['name']] = "<a href='".$column['link']."'>" 
.$column['value']."</a>";
+                                               }else
+                                               {
+                                                       
$json_row[$column['name']] = $column['value'];
+                                               }
+                                       }
+                                       $json['records'][] = $json_row;
                                }
+                       }
 
-                               if( phpgw::get_var('phpgw_return_as') == 'json' 
)
-                               {
-                               return $json;
-                               }
+                       // right in datatable
+                       if(isset($datatable['rowactions']['action']) && 
is_array($datatable['rowactions']['action']))
+                       {
+                               $json ['rights'] = 
$datatable['rowactions']['action'];
+                       }
 
+                       if( phpgw::get_var('phpgw_return_as') == 'json' )
+                       {
+                               return $json;
+                       }
 
+
                        $datatable['json_data'] = json_encode($json);
                        //-------------------- JSON CODE ----------------------
 
                        $template_vars = array();
                        $template_vars['datatable'] = $datatable;
                        
$GLOBALS['phpgw']->xslttpl->add_file(array('datatable'));
-               $GLOBALS['phpgw']->xslttpl->set_var('phpgw', $template_vars);
+                       $GLOBALS['phpgw']->xslttpl->set_var('phpgw', 
$template_vars);
 
-               if ( !isset($GLOBALS['phpgw']->css) || 
!is_object($GLOBALS['phpgw']->css) )
-               {
-                       $GLOBALS['phpgw']->css = createObject('phpgwapi.css');
-               }
+                       if ( !isset($GLOBALS['phpgw']->css) || 
!is_object($GLOBALS['phpgw']->css) )
+                       {
+                               $GLOBALS['phpgw']->css = 
createObject('phpgwapi.css');
+                       }
 
-               $GLOBALS['phpgw']->css->validate_file('datatable');
-                       $GLOBALS['phpgw']->css->validate_file('property');
-                       
$GLOBALS['phpgw']->css->add_external_file('property/templates/base/css/property.css');
+                       $GLOBALS['phpgw']->css->validate_file('datatable');
+                       $GLOBALS['phpgw']->css->validate_file('property');
+                       
$GLOBALS['phpgw']->css->add_external_file('property/templates/base/css/property.css');
                        
$GLOBALS['phpgw']->css->add_external_file('phpgwapi/js/yahoo/datatable/assets/skins/sam/datatable.css');
                        
$GLOBALS['phpgw']->css->add_external_file('phpgwapi/js/yahoo/paginator/assets/skins/sam/paginator.css');
                        
$GLOBALS['phpgw']->css->add_external_file('phpgwapi/js/yahoo/container/assets/skins/sam/container.css');
@@ -466,10 +477,10 @@
 
 
                        $link_data = array
-                       (
-                               'menuaction'    => 'property.uicustom.edit',
-                               'custom_id'     => $custom_id
-                       );
+                               (
+                                       'menuaction'    => 
'property.uicustom.edit',
+                                       'custom_id'     => $custom_id
+                               );
 
                        $msgbox_data = $this->bocommon->msgbox_data($receipt);
 
@@ -484,47 +495,46 @@
                                        'text_down'     => lang('Down'),
                                        'link_up'       => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'property.uicustom.edit', 'resort'=> 'up', 'cols_id'=> $entry['id'], 
'custom_id'=> $custom_id)),
                                        'link_down'     => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'property.uicustom.edit', 'resort'=> 'down', 'cols_id'=> $entry['id'], 
'custom_id'=> $custom_id)),
-                                       );
+                               );
                        }
 
 
                        $data = array
-                       (
-                               'msgbox_data'                                   
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
-                               'edit_url'                                      
=> $GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'lang_custom_id'                                
=> lang('ID'),
-                               'value_custom_id'                               
=> $custom_id,
-                               'lang_sql_text'                                 
=> lang('sql'),
-                               'lang_name'                                     
=> lang('name'),
-                               'lang_save'                                     
=> lang('save'),
-                               'lang_cancel'                                   
=> lang('cancel'),
-                               'lang_apply'                                    
=> lang('apply'),
-                               'value_sql_text'                                
=> $custom['sql_text'],
-                               'value_name'                                    
=> $custom['name'],
-                               'lang_name_statustext'                          
=> lang('Enter a name for the query'),
-                               'lang_sql_statustext'                           
=> lang('Enter a sql query'),
-                               'lang_apply_statustext'                         
=> lang('Apply the values'),
-                               'lang_cancel_statustext'                        
=> lang('Leave the custom untouched and return back to the list'),
-                               'lang_save_statustext'                          
=> lang('Save the custom and return back to the list'),
-                               'lang_no_cat'                                   
=> lang('no category'),
-                               'lang_cat_statustext'                           
=> lang('Select the category the custom belongs to. To do not use a category 
select NO CATEGORY'),
-                               'lang_descr'                                    
=> lang('descr'),
-                               'lang_new_name_statustext'                      
=> lang('name'),
-                               'lang_new_descr_statustext'                     
=> lang('descr'),
-                               'cols'                                          
=> $cols,
-                               'lang_col_name'                                 
=> lang('Column name'),
-                               'lang_col_descr'                                
=> lang('Column description'),
-                               'lang_delete_column'                            
=> lang('Delete column'),
-                               'lang_delete_cols_statustext'                   
=> lang('Delete this column from the output'),
-                               'lang_up_text'                                  
=> lang('Up'),
-                               'lang_down_text'                                
=> lang('Down'),
-                               'lang_sorting'                                  
=> lang('Sorting'),
+                               (
+                                       'msgbox_data'                           
        => $GLOBALS['phpgw']->common->msgbox($msgbox_data),
+                                       'edit_url'                              
                => $GLOBALS['phpgw']->link('/index.php',$link_data),
+                                       'lang_custom_id'                        
        => lang('ID'),
+                                       'value_custom_id'                       
        => $custom_id,
+                                       'lang_sql_text'                         
        => lang('sql'),
+                                       'lang_name'                             
                => lang('name'),
+                                       'lang_save'                             
                => lang('save'),
+                                       'lang_cancel'                           
        => lang('cancel'),
+                                       'lang_apply'                            
        => lang('apply'),
+                                       'value_sql_text'                        
        => $custom['sql_text'],
+                                       'value_name'                            
        => $custom['name'],
+                                       'lang_name_statustext'                  
=> lang('Enter a name for the query'),
+                                       'lang_sql_statustext'                   
=> lang('Enter a sql query'),
+                                       'lang_apply_statustext'                 
=> lang('Apply the values'),
+                                       'lang_cancel_statustext'                
=> lang('Leave the custom untouched and return back to the list'),
+                                       'lang_save_statustext'                  
=> lang('Save the custom and return back to the list'),
+                                       'lang_no_cat'                           
        => lang('no category'),
+                                       'lang_cat_statustext'                   
=> lang('Select the category the custom belongs to. To do not use a category 
select NO CATEGORY'),
+                                       'lang_descr'                            
        => lang('descr'),
+                                       'lang_new_name_statustext'              
=> lang('name'),
+                                       'lang_new_descr_statustext'             
=> lang('descr'),
+                                       'cols'                                  
                => $cols,
+                                       'lang_col_name'                         
        => lang('Column name'),
+                                       'lang_col_descr'                        
        => lang('Column description'),
+                                       'lang_delete_column'                    
=> lang('Delete column'),
+                                       'lang_delete_cols_statustext'   => 
lang('Delete this column from the output'),
+                                       'lang_up_text'                          
        => lang('Up'),
+                                       'lang_down_text'                        
        => lang('Down'),
+                                       'lang_sorting'                          
        => lang('Sorting'),
 
-                       );
+                               );
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('custom') . ': ' . ($custom_id?lang('edit custom'):lang('add custom'));
 
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
                }
 
 
@@ -534,9 +544,9 @@
                        $confirm        = phpgw::get_var('confirm', 'bool', 
'POST');
 
                        $link_data = array
-                       (
-                               'menuaction' => 'property.uicustom.index'
-                       );
+                               (
+                                       'menuaction' => 
'property.uicustom.index'
+                               );
 
                        if( phpgw::get_var('phpgw_return_as') == 'json' )
                        {
@@ -547,22 +557,21 @@
                        
$GLOBALS['phpgw']->xslttpl->add_file(array('app_delete'));
 
                        $data = array
-                       (
-                               'done_action'           => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'delete_action'         => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'property.uicustom.delete', 'custom_id'=> $custom_id)),
-                               'lang_confirm_msg'      => lang('do you really 
want to delete this entry'),
-                               'lang_yes'              => lang('yes'),
-                               'lang_yes_statustext'   => lang('Delete the 
entry'),
-                               'lang_no_statustext'    => lang('Back to the 
list'),
-                               'lang_no'               => lang('no')
-                       );
+                               (
+                                       'done_action'                           
=> $GLOBALS['phpgw']->link('/index.php',$link_data),
+                                       'delete_action'                         
=> $GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'property.uicustom.delete', 'custom_id'=> $custom_id)),
+                                       'lang_confirm_msg'                      
=> lang('do you really want to delete this entry'),
+                                       'lang_yes'                              
        => lang('yes'),
+                                       'lang_yes_statustext'           => 
lang('Delete the entry'),
+                                       'lang_no_statustext'            => 
lang('Back to the list'),
+                                       'lang_no'                               
        => lang('no')
+                               );
 
                        $appname        = lang('custom');
                        $function_msg   = lang('delete custom');
 
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
                }
 
 
@@ -576,39 +585,42 @@
                        {
                                $datatable['menu']      = 
$this->bocommon->get_menu();
 
-                       $datatable['config']['base_url'] = 
$GLOBALS['phpgw']->link('/index.php', array
-                       (
-                               'menuaction'    => 'property.uicustom.view',
-                                       'sort'          => $this->sort,
-                                       'order'         => $this->order,
-                                       'custom_id'     => $custom_id,
-                                       'filter'        => $this->filter,
-                                       'query'         => $this->query
-                               ));
+                               $datatable['config']['base_url'] = 
$GLOBALS['phpgw']->link('/index.php', array
+                                       (
+                                               'menuaction'    => 
'property.uicustom.view',
+                                               'sort'          => $this->sort,
+                                               'order'         => $this->order,
+                                               'custom_id'     => $custom_id,
+                                               'filter'        => 
$this->filter,
+                                               'query'         => $this->query
+                                       ));
 
-                               $datatable['config']['base_java_url'] = 
"menuaction:'property.uicustom.view',"
-                                                                               
                        ."sort:'{$this->sort}',"
-                                                                               
                        ."order:'{$this->order}',"
-                                                                               
                        ."custom_id:'{$custom_id}',"
-                                                                               
                        ."filter:'{$this->filter}',"
-                                                                               
                        ."query:'{$this->query}'";
+                               $datatable['config']['base_java_url'] = 
"menuaction:'property.uicustom.view',"
+                                       ."sort:'{$this->sort}',"
+                                       ."order:'{$this->order}',"
+                                       ."custom_id:'{$custom_id}',"
+                                       ."filter:'{$this->filter}',"
+                                       ."query:'{$this->query}'";
 
-                           $link_data = array
-                               (
-                                       'menuaction'    => 
'property.uicustom.view',
-                                       'sort'          => $this->sort,
-                                       'order'         => $this->order,
-                                       'custom_id'     => $custom_id,
-                                       'filter'        => $this->filter,
-                                       'query'         => $this->query
-                               );
+                               $link_data = array
+                                       (
+                                               'menuaction'    => 
'property.uicustom.view',
+                                               'sort'          => $this->sort,
+                                               'order'         => $this->order,
+                                               'custom_id'     => $custom_id,
+                                               'filter'        => 
$this->filter,
+                                               'query'         => $this->query
+                                       );
 
-                           $datatable['config']['allow_allrows'] = true;
+                               $datatable['config']['allow_allrows'] = true;
 
-                               $datatable['actions']['form'] = array(
-                               array(
-                                       'action'        => 
$GLOBALS['phpgw']->link('/index.php',
-                                                       array(
+                               $datatable['actions']['form'] = array
+                                       (
+                                               array
+                                               (
+                                                       'action'        => 
$GLOBALS['phpgw']->link('/index.php',
+                                                       array
+                                                       (
                                                                'menuaction'    
=> 'property.uicustom.view',
                                                                'sort'          
=> $this->sort,
                                                                'order'         
=> $this->order,
@@ -617,16 +629,17 @@
                                                                'query'         
=> $this->query
                                                        )
                                                ),
-                                       'fields'        => array(
-                                                        'field' => array
-                                                        (
-                                                                       'type'  
=> 'button',
-                                                                   'id'        
=> 'btn_export',
-                                                                   'value'     
=> lang('download'),
-                                                                   'tab_index' 
=> 1
-                                                        )
+                                               'fields'        => array
+                                               (
+                                                       'field' => array
+                                                       (
+                                                               'type'  => 
'button',
+                                                               'id'    => 
'btn_export',
+                                                               'value' => 
lang('download'),
+                                                               'tab_index' => 1
+                                                       )
                                                )
-                                        )
+                                       )
                                );
                        }
                        //_debug_array($custom_id);die;
@@ -665,15 +678,15 @@
                        }
 
                        $link_download = array
-                       (
-                               'menuaction'    => 'property.uicustom.download',
-                               'sort'          => $this->sort,
-                               'order'         => $this->order,
-                               'filter'        => $this->filter,
-                               'query'         => $this->query,
-                               'custom_id'     => $custom_id,
-                               'allrows'       => $this->allrows
-                       );
+                               (
+                                       'menuaction'    => 
'property.uicustom.download',
+                                       'sort'          => $this->sort,
+                                       'order'         => $this->order,
+                                       'filter'        => $this->filter,
+                                       'query'         => $this->query,
+                                       'custom_id'     => $custom_id,
+                                       'allrows'       => $this->allrows
+                               );
 
                        //path for property.js
                        $datatable['property_js'] = 
$GLOBALS['phpgw_info']['server']['webserver_url']."/property/js/yahoo/property.js";
@@ -701,78 +714,79 @@
                        }
 
                        phpgwapi_yui::load_widget('dragdrop');
-                       phpgwapi_yui::load_widget('datatable');
-                       phpgwapi_yui::load_widget('menu');
-                       phpgwapi_yui::load_widget('connection');
-                       phpgwapi_yui::load_widget('loader');
+                       phpgwapi_yui::load_widget('datatable');
+                       phpgwapi_yui::load_widget('menu');
+                       phpgwapi_yui::load_widget('connection');
+                       phpgwapi_yui::load_widget('loader');
                        phpgwapi_yui::load_widget('tabview');
                        phpgwapi_yui::load_widget('paginator');
                        phpgwapi_yui::load_widget('animation');
 
 
                        //-- BEGIN----------------------------- JSON CODE 
------------------------------
-               //values for Pagination
-                       $json = array
-                       (
-                               'recordsReturned'       => 
$datatable['pagination']['records_returned'],
-                               'totalRecords'          => 
(int)$datatable['pagination']['records_total'],
-                               'startIndex'            => 
$datatable['pagination']['records_start'],
+                       //values for Pagination
+                       $json = array
+                               (
+                                       'recordsReturned'       => 
$datatable['pagination']['records_returned'],
+                                       'totalRecords'          => 
(int)$datatable['pagination']['records_total'],
+                                       'startIndex'            => 
$datatable['pagination']['records_start'],
                                        'sort'                          => 
$datatable['sorting']['order'],
-                               'dir'                           => 
$datatable['sorting']['sort'],
+                                       'dir'                           => 
$datatable['sorting']['sort'],
                                        'records'                       => 
array()
-                       );
+                               );
 
-                               // values for datatable
-                       if(isset($datatable['rows']['row']) && 
is_array($datatable['rows']['row'])){
-                               foreach( $datatable['rows']['row'] as $row )
-                               {
-                                       $json_row = array();
-                                       foreach( $row['column'] as $column)
-                                       {
-                                               if(isset($column['format']) && 
$column['format']== "link" && $column['java_link']==true)
-                                               {
-                                                       
$json_row[$column['name']] = "<a href='#' id='".$column['link']."' 
onclick='javascript:filter_data(this.id);'>" .$column['value']."</a>";
-                                               }
-                                               elseif(isset($column['format']) 
&& $column['format']== "link")
-                                               {
-                                                 $json_row[$column['name']] = 
"<a href='".$column['link']."'>" .$column['value']."</a>";
-                                               }else
-                                               {
-                                                 $json_row[$column['name']] = 
$column['value'];
-                                               }
-                                       }
-                                       $json['records'][] = $json_row;
-                               }
-                       }
-
-                               // right in datatable
-                               if(isset($datatable['rowactions']['action']) && 
is_array($datatable['rowactions']['action']))
+                       // values for datatable
+                       if(isset($datatable['rows']['row']) && 
is_array($datatable['rows']['row'])){
+                               foreach( $datatable['rows']['row'] as $row )
                                {
-                                       $json ['rights'] = 
$datatable['rowactions']['action'];
+                                       $json_row = array();
+                                       foreach( $row['column'] as $column)
+                                       {
+                                               if(isset($column['format']) && 
$column['format']== "link" && $column['java_link']==true)
+                                               {
+                                                       
$json_row[$column['name']] = "<a href='#' id='".$column['link']."' 
onclick='javascript:filter_data(this.id);'>" .$column['value']."</a>";
+                                               }
+                                               else 
if(isset($column['format']) && $column['format']== "link")
+                                               {
+                                                       
$json_row[$column['name']] = "<a href='".$column['link']."'>" 
.$column['value']."</a>";
+                                               }
+                                               else
+                                               {
+                                                       
$json_row[$column['name']] = $column['value'];
+                                               }
+                                       }
+                                       $json['records'][] = $json_row;
                                }
+                       }
 
-                               if( phpgw::get_var('phpgw_return_as') == 'json' 
)
-                               {
-                               return $json;
-                               }
+                       // right in datatable
+                       if(isset($datatable['rowactions']['action']) && 
is_array($datatable['rowactions']['action']))
+                       {
+                               $json ['rights'] = 
$datatable['rowactions']['action'];
+                       }
 
+                       if( phpgw::get_var('phpgw_return_as') == 'json' )
+                       {
+                               return $json;
+                       }
 
+
                        $datatable['json_data'] = json_encode($json);
                        //-------------------- JSON CODE ----------------------
 
                        $template_vars = array();
                        $template_vars['datatable'] = $datatable;
                        
$GLOBALS['phpgw']->xslttpl->add_file(array('datatable'));
-               $GLOBALS['phpgw']->xslttpl->set_var('phpgw', $template_vars);
+                       $GLOBALS['phpgw']->xslttpl->set_var('phpgw', 
$template_vars);
 
-               if ( !isset($GLOBALS['phpgw']->css) || 
!is_object($GLOBALS['phpgw']->css) )
-               {
-                       $GLOBALS['phpgw']->css = createObject('phpgwapi.css');
-               }
+                       if ( !isset($GLOBALS['phpgw']->css) || 
!is_object($GLOBALS['phpgw']->css) )
+                       {
+                               $GLOBALS['phpgw']->css = 
createObject('phpgwapi.css');
+                       }
 
-               $GLOBALS['phpgw']->css->validate_file('datatable');
-                       $GLOBALS['phpgw']->css->validate_file('property');
-                       
$GLOBALS['phpgw']->css->add_external_file('property/templates/base/css/property.css');
+                       $GLOBALS['phpgw']->css->validate_file('datatable');
+                       $GLOBALS['phpgw']->css->validate_file('property');
+                       
$GLOBALS['phpgw']->css->add_external_file('property/templates/base/css/property.css');
                        
$GLOBALS['phpgw']->css->add_external_file('phpgwapi/js/yahoo/datatable/assets/skins/sam/datatable.css');
                        
$GLOBALS['phpgw']->css->add_external_file('phpgwapi/js/yahoo/paginator/assets/skins/sam/paginator.css');
                        
$GLOBALS['phpgw']->css->add_external_file('phpgwapi/js/yahoo/container/assets/skins/sam/container.css');
@@ -782,103 +796,6 @@
                        $GLOBALS['phpgw']->js->validate_file( 'yahoo', 
'custom.view', 'property' );
                        //$this->save_sessiondata();
 
-
-                       /*$custom_id    = phpgw::get_var('custom_id', 'int', 
'GET');
-
-                       
$GLOBALS['phpgw']->xslttpl->add_file(array('custom','nextmatchs'));
-
-                       $list= $this->bo->read_custom($custom_id);
-                       $uicols = $this->bo->uicols;
-
-//_debug_array($uicols);
-
-                       $j=0;
-                       if (isSet($list) AND is_array($list))
-                       {
-                               foreach($list as $entry)
-                               {
-                                       for ($i=0;$i<count($uicols);$i++)
-                                       {
-                                               
$content[$j]['row'][$i]['value'] = $entry[$uicols[$i]['name']];
-                                       }
-                                       $j++;
-                               }
-                       }
-
-                       for ($i=0;$i<count($uicols);$i++)
-                       {
-                               $table_header[$i]['header']     = 
$uicols[$i]['descr'];
-                               $table_header[$i]['width']      = '15%';
-                               $table_header[$i]['align']      = 'left';
-                       }
-
-//_debug_array($content);
-
-                       $custom_name = $this->bo->read_custom_name($custom_id);
-
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('custom') . ': ' . $custom_name;
-
-                       $link_data = array
-                       (
-                               'menuaction'    => 'property.uicustom.view',
-                               'sort'          => $this->sort,
-                               'order'         => $this->order,
-                               'custom_id'     => $custom_id,
-                               'filter'        => $this->filter,
-                               'query'         => $this->query
-                       );
-
-
-                       if(!$this->allrows)
-                       {
-                               $record_limit   = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'];
-                       }
-                       else
-                       {
-                               $record_limit   = $this->bo->total_records;
-                       }
-
-                       $link_download = array
-                       (
-                               'menuaction'    => 'property.uicustom.download',
-                               'sort'          => $this->sort,
-                               'order'         => $this->order,
-                               'filter'        => $this->filter,
-                               'query'         => $this->query,
-                               'custom_id'     => $custom_id,
-                               'allrows'       => $this->allrows
-                       );
-
-                       
$GLOBALS['phpgw']->js->validate_file('overlib','overlib','property');
-
-                       $data = array
-                       (
-                               'lang_download'                         => 
'download',
-                               'link_download'                         => 
$GLOBALS['phpgw']->link('/index.php',$link_download),
-                               'lang_download_help'                    => 
lang('Download table to your browser'),
-
-                               'allow_allrows'                         => true,
-                               'allrows'                               => 
$this->allrows,
-                               'start_record'                          => 
$this->start,
-                               'record_limit'                          => 
$record_limit,
-                               'num_records'                           => 
count($list),
-                               'all_records'                           => 
$this->bo->total_records,
-                               'link_url'                              => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'img_path'                              => 
$GLOBALS['phpgw']->common->get_image_path('phpgwapi','default'),
-                               'select_action'                         => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'lang_searchfield_statustext'           => 
lang('Enter the search string. To show all entries, empty this field and press 
the SUBMIT button again'),
-                               'lang_searchbutton_statustext'          => 
lang('Submit the search string'),
-                               'query'                                 => 
$this->query,
-                               'lang_search'                           => 
lang('search'),
-                               'table_header'                          => 
$table_header,
-                               'values'                                => 
$content,
-
-                               'done_action'                           => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'property.uicustom.index')),
-                               'lang_done'                             => 
lang('done'),
-                       );
-
-                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('view' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();*/
                }
 
                function download()
@@ -894,4 +811,3 @@
                        $this->bocommon->download($list,$names,$descr);
                }
        }
-

Modified: trunk/property/inc/class.uidebug_json.inc.php
===================================================================
--- trunk/property/inc/class.uidebug_json.inc.php       2010-12-25 11:31:42 UTC 
(rev 6703)
+++ trunk/property/inc/class.uidebug_json.inc.php       2010-12-25 23:13:55 UTC 
(rev 6704)
@@ -37,28 +37,28 @@
        class property_uidebug_json
        {
                var $public_functions = array
-               (
-                       'index'                 => true
-               );
+                       (
+                               'index'                 => true
+                       );
 
                public function __construct()
                {
                        $GLOBALS['phpgw_info']['flags']['xslt_app'] = false;
                        $this->acl                              = & 
$GLOBALS['phpgw']->acl;
-                       $this->acl_location             = '.admin';
+                       $this->acl_location             = '.admin';
                        $this->acl_read                 = 
$this->acl->check($this->acl_location, PHPGW_ACL_READ, 'property');
                }
 
                public function index()
                {
-                       if(!$this->acl_read)
-                       {
-                               echo lang('no access');
-                               $GLOBALS['phpgw']->common->phpgw_exit();
-                       }
-                       
-                       $app = phpgw::get_var('app', 'string', 'GET');
-
+                       if(!$this->acl_read)
+                       {
+                               echo lang('no access');
+                               $GLOBALS['phpgw']->common->phpgw_exit();
+                       }
+
+                       $app = phpgw::get_var('app', 'string', 'GET');
+
                        //get session's values
                        $data = phpgwapi_cache::session_get($app,'id_debug');
                        if(isset($data))
@@ -66,15 +66,15 @@
                                //clear session
                                phpgwapi_cache::session_clear($app, 'id_debug');
                                //replace '<' and '>'
-                               if (is_array($data))
-                               {
-                                       self::_my_print_rec($data,0);
-                               }
-                               else
-                               {
-                                       $data = htmlspecialchars($data);
+                               if (is_array($data))
+                               {
+                                       self::_my_print_rec($data,0);
                                }
-                               _debug_array($data);                            
+                               else
+                               {
+                                       $data = htmlspecialchars($data);
+                               }
+                               _debug_array($data);
                        }
                        else
                        {
@@ -82,7 +82,7 @@
                        }
                        $GLOBALS['phpgw']->common->phpgw_exit();
                }
-               
+
                static protected function _my_print_rec(&$val,$nivel=0)
                {
                        foreach($val as $key => &$value)
@@ -93,13 +93,10 @@
                                }
                                else
                                {
-                               //      $value = 
str_replace(array('<','>'),array('&lt;','&gt;'),$value);
+                                       //      $value = 
str_replace(array('<','>'),array('&lt;','&gt;'),$value);
                                        $value = htmlspecialchars($value);
                                }
                        }
-               }               
-
-
-
+               }
        }
 

Modified: trunk/property/inc/class.uidocument.inc.php
===================================================================
--- trunk/property/inc/class.uidocument.inc.php 2010-12-25 11:31:42 UTC (rev 
6703)
+++ trunk/property/inc/class.uidocument.inc.php 2010-12-25 23:13:55 UTC (rev 
6704)
@@ -48,14 +48,14 @@
                var $allrows;
 
                var $public_functions = array
-               (
-                       'index'         => true,
-                       'list_doc'      => true,
-                       'view'          => true,
-                       'view_file' => true,
-                       'edit'          => true,
-                       'delete'        => true
-               );
+                       (
+                               'index'         => true,
+                               'list_doc'      => true,
+                               'view'          => true,
+                               'view_file' => true,
+                               'edit'          => true,
+                               'delete'        => true
+                       );
 
                function property_uidocument()
                {
@@ -106,18 +106,18 @@
                function save_sessiondata()
                {
                        $data = array
-                       (
-                               'start'         => $this->start,
-                               'query'         => $this->query,
-                               'sort'          => $this->sort,
-                               'order'         => $this->order,
-                               'filter'        => $this->filter,
-                               'cat_id'        => $this->cat_id,
-                               'status_id'     => $this->status_id,
-                               'entity_id'     => $this->entity_id,
-                               'doc_type'      => $this->doc_type,
-                               'query_location'=> $this->query_location
-                       );
+                               (
+                                       '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,
+                                       'entity_id'     => $this->entity_id,
+                                       'doc_type'      => $this->doc_type,
+                                       'query_location'=> $this->query_location
+                               );
                        $this->bo->save_sessiondata($data);
                }
 
@@ -150,45 +150,45 @@
                        if( phpgw::get_var('phpgw_return_as') != 'json' )
                        {
                                $datatable['menu']                              
        = $this->bocommon->get_menu();
-                       $datatable['config']['base_url'] = 
$GLOBALS['phpgw']->link('/index.php', array
-                       (
-                               'menuaction'                    => 
'property.uidocument.index',
-                               'sort'                          => $this->sort,
-                       'order'                         => $this->order,
-                       'cat_id'                        => $this->cat_id,
-                       'filter'                        => $this->filter,
-                       'status_id'                     => $this->status_id,
-                       'query'                         => $this->query,
-                       'doc_type'                      => $this->doc_type,
-                       'entity_id'                     => $this->entity_id
-                               ));
+                               $datatable['config']['base_url'] = 
$GLOBALS['phpgw']->link('/index.php', array
+                                       (
+                                               'menuaction'                    
=> 'property.uidocument.index',
+                                               'sort'                          
=> $this->sort,
+                                               'order'                         
=> $this->order,
+                                               'cat_id'                        
=> $this->cat_id,
+                                               'filter'                        
=> $this->filter,
+                                               'status_id'                     
=> $this->status_id,
+                                               'query'                         
=> $this->query,
+                                               'doc_type'                      
=> $this->doc_type,
+                                               'entity_id'                     
=> $this->entity_id
+                                       ));
 
-                               $datatable['config']['base_java_url'] = 
"menuaction:'property.uidocument.index',"
-                                                                               
                        ."sort:'{$this->sort}',"
-                                                                               
                        ."order:'{$this->order}',"
-                                                                               
                        ."cat_id:'{$this->cat_id}',"
-                                                                               
                        ."filter:'{$this->filter}',"
-                                                                               
                        ."status_id:'{$this->status_id}',"
-                                                                               
                        ."query:'{$this->query}',"
-                                                                               
                        ."doc_type:'{$this->doc_type}',"
-                                                                               
                        ."entity_id:'{$this->entity_id}'";
+                               $datatable['config']['base_java_url'] = 
"menuaction:'property.uidocument.index',"
+                                       ."sort:'{$this->sort}',"
+                                       ."order:'{$this->order}',"
+                                       ."cat_id:'{$this->cat_id}',"
+                                       ."filter:'{$this->filter}',"
+                                       ."status_id:'{$this->status_id}',"
+                                       ."query:'{$this->query}',"
+                                       ."doc_type:'{$this->doc_type}',"
+                                       ."entity_id:'{$this->entity_id}'";
 
                                
//_debug_array($datatable['config']['base_java_url']);die;
 
-                           $link_data = array
-                               (
-                                       'menuaction'    => 
'property.uidocument.index',
-                                       'sort'          => $this->sort,
-                                       'order'         => $this->order,
-                                       'cat_id'        => $this->cat_id,
-                                       'filter'        => $this->filter,
-                                       'status_id'     => $this->status_id,
-                                       'query'         => $this->query,
-                                       'doc_type'      => $this->doc_type,
-                                       'entity_id'     => $this->entity_id
-                               );
+                               $link_data = array
+                                       (
+                                               'menuaction'    => 
'property.uidocument.index',
+                                               'sort'          => $this->sort,
+                                               'order'         => $this->order,
+                                               'cat_id'        => 
$this->cat_id,
+                                               'filter'        => 
$this->filter,
+                                               'status_id'     => 
$this->status_id,
+                                               'query'         => $this->query,
+                                               'doc_type'      => 
$this->doc_type,
+                                               'entity_id'     => 
$this->entity_id
+                                       );
 
-                           $datatable['config']['allow_allrows'] = false;
+                               $datatable['config']['allow_allrows'] = false;
 
                                $values_combo_box[0] = 
$this->cats->formatted_xslt_list(array('format'=>'filter','selected' => 
$this->doc_type,'globals' => True));
                                $default_value = array ('cat_id'=>'','name'=> 
lang('no document type'));
@@ -198,10 +198,13 @@
                                $default_value = array 
('id'=>'','name'=>lang('no status'));
                                array_unshift 
($values_combo_box[1],$default_value);
 
-                               $datatable['actions']['form'] = array(
-                               array(
-                                       'action'        => 
$GLOBALS['phpgw']->link('/index.php',
-                                                       array(
+                               $datatable['actions']['form'] = array
+                                       (
+                                               array
+                                               (
+                                                       'action'        => 
$GLOBALS['phpgw']->link('/index.php',
+                                                       array
+                                                       (
                                                                'menuaction'    
        => 'property.uidocument.index',
                                                                'sort'       => 
$this->sort,
                                                                'order'       
=> $this->order,
@@ -213,59 +216,69 @@
                                                                'entity_id'     
  => $this->entity_id
                                                        )
                                                ),
-                                       'fields'        => array(
-                                           'field' => array(
-                                                                       array( 
//boton  CATEGORY
-                                                                           
'id' => 'btn_type_id',
-                                                                           
'name' => 'type_id',
-                                                                           
'value'     => lang('Type'),
-                                                                           
'type' => 'button',
-                                                                           
'style' => 'filter',
-                                                                           
'tab_index' => 1
-                                                                       ),
-                                                                       array( 
//boton  STATUS
-                                                                           
'id' => 'btn_user_id',
-                                                                           
'name' => 'user_id',
-                                                                           
'value'     => lang('User'),
-                                                                           
'type' => 'button',
-                                                                           
'style' => 'filter',
-                                                                           
'tab_index' => 2
-                                                                       ),
-                                                                               
                                array(
-                                                                               
        'type'  => 'button',
-                                                                               
        'id'    => 'btn_new',
-                                                                               
        'value' => lang('add'),
-                                                                               
        'tab_index' => 8
-                                                                               
    ),
-                                                                       array( 
//boton     SEARCH
-                                                                           
'id' => 'btn_search',
-                                                                           
'name' => 'search',
-                                                                           
'value'    => lang('search'),
-                                                                           
'type' => 'button',
-                                                                           
'tab_index' => 7
-                                                                       ),
-                                                                               
                                array( // TEXT INPUT
-                                                                           
'name'     => 'query',
-                                                                           
'id'     => 'txt_query',
-                                                                           
'value'    => '',//$query,
-                                                                           
'type' => 'text',
-                                                                           
'onkeypress' => 'return pulsar(event)',
-                                                                           
'size'    => 28,
-                                                                           
'tab_index' => 6
-                                                                       )
-                                                                               
),
-                                                       'hidden_value' => array(
-                                                                               
        array( //div values  combo_box_0
-                                                                               
                            'id' => 'values_combo_box_0',
-                                                                               
                            'value'     => 
$this->bocommon->select2String($values_combo_box[0]['cat_list'], 'cat_id') 
//i.e.  id,value/id,vale/
-                                                                               
                      ),
-                                                                               
                array( //div values  combo_box_1
-                                                                               
                            'id' => 'values_combo_box_1',
-                                                                               
                            'value'     => 
$this->bocommon->select2String($values_combo_box[1])
-                                                                               
                      )
-                                                                               
                        )
-                                                                               
)
-                                        )
+                                               'fields'        => array
+                                               (
+                                                       'field' => array
+                                                       (
+                                                               array
+                                                               ( //boton       
CATEGORY
+                                                                       'id' => 
'btn_type_id',
+                                                                       'name' 
=> 'type_id',
+                                                                       'value' 
=> lang('Type'),
+                                                                       'type' 
=> 'button',
+                                                                       'style' 
=> 'filter',
+                                                                       
'tab_index' => 1
+                                                               ),
+                                                               array
+                                                               ( //boton       
STATUS
+                                                                       'id' => 
'btn_user_id',
+                                                                       'name' 
=> 'user_id',
+                                                                       'value' 
=> lang('User'),
+                                                                       'type' 
=> 'button',
+                                                                       'style' 
=> 'filter',
+                                                                       
'tab_index' => 2
+                                                               ),
+                                                               array
+                                                               (
+                                                                       'type'  
=> 'button',
+                                                                       'id'    
=> 'btn_new',
+                                                                       'value' 
=> lang('add'),
+                                                                       
'tab_index' => 8
+                                                               ),
+                                                               array
+                                                               ( //boton     
SEARCH
+                                                                       'id' => 
'btn_search',
+                                                                       'name' 
=> 'search',
+                                                                       'value' 
   => lang('search'),
+                                                                       'type' 
=> 'button',
+                                                                       
'tab_index' => 7
+                                                               ),
+                                                               array
+                                                               ( // TEXT INPUT
+                                                                       'name'  
   => 'query',
+                                                                       'id'    
 => 'txt_query',
+                                                                       'value' 
   => '',//$query,
+                                                                       'type' 
=> 'text',
+                                                                       
'onkeypress' => 'return pulsar(event)',
+                                                                       'size'  
  => 28,
+                                                                       
'tab_index' => 6
+                                                               )
+                                                       ),
+                                                       'hidden_value' => array
+                                                       (
+                                                               array
+                                                               ( //div values  
combo_box_0
+                                                                       'id' => 
'values_combo_box_0',
+                                                                       'value' 
=> $this->bocommon->select2String($values_combo_box[0]['cat_list'], 'cat_id') 
//i.e.  id,value/id,vale/
+                                                               ),
+                                                               array
+                                                               ( //div values  
combo_box_1
+                                                                       'id' => 
'values_combo_box_1',
+                                                                       'value' 
=> $this->bocommon->select2String($values_combo_box[1])
+                                                               )
+                                                       )
+                                               )
+                                       )
                                );
 
                        }
@@ -299,19 +312,19 @@
 
                                        if($this->acl_read)
                                        {
-                                                               
$datatable['rows']['row'][$j]['column'][$k]['name']                     = 
lang('view');
-                                                               
$datatable['rows']['row'][$j]['column'][$k]['format']                   = 
'link';
-                                                                               
$datatable['rows']['row'][$j]['column'][$k]['link']             =       
$GLOBALS['phpgw']->link('/index.php', array
-                                                                               
        (
-                                                                               
                'menuaction'=> 'property.uidocument.list_doc',
-                                                                               
                'location_code'=>  $document_entry['location_code'],
-                                                                               
                'p_num'=> isset($document_entry['p_num']) ? 
$document_entry['p_num'] :'',
-                                                                               
                'entity_id'=> isset($document_entry['p_entity_id']) ? 
$document_entry['p_entity_id'] : '',
-                                                                               
                'cat_id'=> isset($document_entry['p_cat_id']) ? 
$document_entry['p_cat_id'] : '',
-                                                                               
                'doc_type'=> $this->doc_type
-                                                                               
        ));
-                                                                               
$datatable['rows']['row'][$j]['column'][$k]['value']            = 
lang('documents');
-                                                                               
$datatable['rows']['row'][$j]['column'][$k]['target']   = '_blank';
+                                               
$datatable['rows']['row'][$j]['column'][$k]['name']                     = 
lang('view');
+                                               
$datatable['rows']['row'][$j]['column'][$k]['format']                   = 
'link';
+                                               
$datatable['rows']['row'][$j]['column'][$k]['link']             =       
$GLOBALS['phpgw']->link('/index.php', array
+                                                       (
+                                                               'menuaction'=> 
'property.uidocument.list_doc',
+                                                               
'location_code'=>  $document_entry['location_code'],
+                                                               'p_num'=> 
isset($document_entry['p_num']) ? $document_entry['p_num'] :'',
+                                                               'entity_id'=> 
isset($document_entry['p_entity_id']) ? $document_entry['p_entity_id'] : '',
+                                                               'cat_id'=> 
isset($document_entry['p_cat_id']) ? $document_entry['p_cat_id'] : '',
+                                                               'doc_type'=> 
$this->doc_type
+                                                       ));
+                                               
$datatable['rows']['row'][$j]['column'][$k]['value']            = 
lang('documents');
+                                               
$datatable['rows']['row'][$j]['column'][$k]['target']   = '_blank';
                                        }
 
                                        $j++;
@@ -322,16 +335,17 @@
 
                                if ($this->acl_add)
                                {
-                                       $datatable['rowactions']['action'][] = 
array(
-                                                                               
'my_name'                       => 'add',
-                                                                               
'text'                  => lang('add'),
-                                                                               
'action'                => $GLOBALS['phpgw']->link('/index.php',array
-                                                                               
                                (
-                                                                               
                                        'menuaction'=> 
'property.uidocument.edit',
-                                                                               
                                        'entity_id'=> $this->entity_id,
-                                                                               
                                        'cat_id'=> $this->cat_id
-                                                                               
                                ))
-                                                               );
+                                       $datatable['rowactions']['action'][] = 
array
+                                               (
+                                                       'my_name'               
        => 'add',
+                                                       'text'                  
=> lang('add'),
+                                                       'action'                
=> $GLOBALS['phpgw']->link('/index.php',array
+                                                       (
+                                                               'menuaction'=> 
'property.uidocument.edit',
+                                                               'entity_id'=> 
$this->entity_id,
+                                                               'cat_id'=> 
$this->cat_id
+                                                       ))
+                                               );
                                }
                        }
 
@@ -396,79 +410,79 @@
                        }
 
                        //-- BEGIN----------------------------- JSON CODE 
------------------------------
-               //values for Pagination
-                       $json = array
-                       (
-                               'recordsReturned'       => 
$datatable['pagination']['records_returned'],
-                               'totalRecords'          => 
(int)$datatable['pagination']['records_total'],
-                               'startIndex'            => 
$datatable['pagination']['records_start'],
+                       //values for Pagination
+                       $json = array
+                               (
+                                       'recordsReturned'       => 
$datatable['pagination']['records_returned'],
+                                       'totalRecords'          => 
(int)$datatable['pagination']['records_total'],
+                                       'startIndex'            => 
$datatable['pagination']['records_start'],
                                        'sort'                          => 
$datatable['sorting']['order'],
-                               'dir'                           => 
$datatable['sorting']['sort'],
+                                       'dir'                           => 
$datatable['sorting']['sort'],
                                        'records'                       => 
array()
-                       );
+                               );
 
-                               // values for datatable
-                       if(isset($datatable['rows']['row']) && 
is_array($datatable['rows']['row']))
-                       {
-                               foreach( $datatable['rows']['row'] as $row )
-                               {
-                                       $json_row = array();
-                                       foreach( $row['column'] as $column)
-                                       {
-                                               if(isset($column['format']) && 
$column['format']== "link" && $column['java_link']==true)
-                                               {
-                                                       
$json_row[$column['name']] = "<a href='#' id='{$column['link']}' 
onclick='javascript:filter_data(this.id);'>{$column['value']}</a>";
-                                               }
-                                               else 
if(isset($column['format']) && $column['format']== "link")
-                                               {
-                                                 $json_row[$column['name']] = 
"<a href='{$column['link']}'>{$column['value']}</a>";
-                                               }
-                                               else
-                                               {
-                                                 $json_row[$column['name']] = 
$column['value'];
-                                               }
-                                       }
-                                       $json['records'][] = $json_row;
-                               }
-                       }
-
-                               // right in datatable
-                               if(isset($datatable['rowactions']['action']) && 
is_array($datatable['rowactions']['action']))
+                       // values for datatable
+                       if(isset($datatable['rows']['row']) && 
is_array($datatable['rows']['row']))
+                       {
+                               foreach( $datatable['rows']['row'] as $row )
                                {
-                                       $json ['rights'] = 
$datatable['rowactions']['action'];
+                                       $json_row = array();
+                                       foreach( $row['column'] as $column)
+                                       {
+                                               if(isset($column['format']) && 
$column['format']== "link" && $column['java_link']==true)
+                                               {
+                                                       
$json_row[$column['name']] = "<a href='#' id='{$column['link']}' 
onclick='javascript:filter_data(this.id);'>{$column['value']}</a>";
+                                               }
+                                               else 
if(isset($column['format']) && $column['format']== "link")
+                                               {
+                                                       
$json_row[$column['name']] = "<a 
href='{$column['link']}'>{$column['value']}</a>";
+                                               }
+                                               else
+                                               {
+                                                       
$json_row[$column['name']] = $column['value'];
+                                               }
+                                       }
+                                       $json['records'][] = $json_row;
                                }
+                       }
 
-                               if( phpgw::get_var('phpgw_return_as') == 'json' 
)
-                               {
-                               return $json;
-                               }
+                       // right in datatable
+                       if(isset($datatable['rowactions']['action']) && 
is_array($datatable['rowactions']['action']))
+                       {
+                               $json ['rights'] = 
$datatable['rowactions']['action'];
+                       }
 
+                       if( phpgw::get_var('phpgw_return_as') == 'json' )
+                       {
+                               return $json;
+                       }
 
+
                        $datatable['json_data'] = json_encode($json);
                        //-------------------- JSON CODE ----------------------
 
                        $template_vars = array();
                        $template_vars['datatable'] = $datatable;
                        
$GLOBALS['phpgw']->xslttpl->add_file(array('datatable'));
-               $GLOBALS['phpgw']->xslttpl->set_var('phpgw', $template_vars);
+                       $GLOBALS['phpgw']->xslttpl->set_var('phpgw', 
$template_vars);
 
                        phpgwapi_yui::load_widget('dragdrop');
-                       phpgwapi_yui::load_widget('datatable');
-                       phpgwapi_yui::load_widget('menu');
-                       phpgwapi_yui::load_widget('connection');
-                       phpgwapi_yui::load_widget('loader');
+                       phpgwapi_yui::load_widget('datatable');
+                       phpgwapi_yui::load_widget('menu');
+                       phpgwapi_yui::load_widget('connection');
+                       phpgwapi_yui::load_widget('loader');
                        phpgwapi_yui::load_widget('tabview');
                        phpgwapi_yui::load_widget('paginator');
                        phpgwapi_yui::load_widget('animation');
 
-               if ( !isset($GLOBALS['phpgw']->css) || 
!is_object($GLOBALS['phpgw']->css) )
-               {
-                       $GLOBALS['phpgw']->css = createObject('phpgwapi.css');
-               }
+                       if ( !isset($GLOBALS['phpgw']->css) || 
!is_object($GLOBALS['phpgw']->css) )
+                       {
+                               $GLOBALS['phpgw']->css = 
createObject('phpgwapi.css');
+                       }
 
-               $GLOBALS['phpgw']->css->validate_file('datatable');
-                       $GLOBALS['phpgw']->css->validate_file('property');
-                       
$GLOBALS['phpgw']->css->add_external_file('property/templates/base/css/property.css');
+                       $GLOBALS['phpgw']->css->validate_file('datatable');
+                       $GLOBALS['phpgw']->css->validate_file('property');
+                       
$GLOBALS['phpgw']->css->add_external_file('property/templates/base/css/property.css');
                        
$GLOBALS['phpgw']->css->add_external_file('phpgwapi/js/yahoo/datatable/assets/skins/sam/datatable.css');
                        
$GLOBALS['phpgw']->css->add_external_file('phpgwapi/js/yahoo/paginator/assets/skins/sam/paginator.css');
                        
$GLOBALS['phpgw']->css->add_external_file('phpgwapi/js/yahoo/container/assets/skins/sam/container.css');
@@ -567,36 +581,36 @@
                        if( phpgw::get_var('phpgw_return_as') != 'json' )
                        {
                                $datatable['menu']                              
        = $this->bocommon->get_menu();
-                       $datatable['config']['base_url'] = 
$GLOBALS['phpgw']->link('/index.php', array
-                       (
-                               'menuaction'    => 
'property.uidocument.list_doc',
-                                       'sort'          => $this->sort,
-                                       'order'         => $this->order,
-                                       'entity_id'     => $this->entity_id,
-                                       'cat_id'        => $this->cat_id,
-                                       'p_num'         => $p_num,
-                                       'doc_type'      => $this->doc_type,
-                                       'location_code' => $location_code,
-                                       'filter'        => $this->filter,
-                                       'query'         => $this->query,
-                                       'query_location'=> 
$this->query_location,
-                                       'allrows'               => 
$this->allrows
-                               ));
+                               $datatable['config']['base_url'] = 
$GLOBALS['phpgw']->link('/index.php', array
+                                       (
+                                               'menuaction'    => 
'property.uidocument.list_doc',
+                                               'sort'          => $this->sort,
+                                               'order'         => $this->order,
+                                               'entity_id'     => 
$this->entity_id,
+                                               'cat_id'        => 
$this->cat_id,
+                                               'p_num'         => $p_num,
+                                               'doc_type'      => 
$this->doc_type,
+                                               'location_code' => 
$location_code,
+                                               'filter'        => 
$this->filter,
+                                               'query'         => $this->query,
+                                               'query_location'=> 
$this->query_location,
+                                               'allrows'               => 
$this->allrows
+                                       ));
 
-                               $datatable['config']['base_java_url'] = 
"menuaction:'property.uidocument.list_doc',"
-                                                                               
                        ."sort:'{$this->sort}',"
-                                                                               
                        ."order:'{$this->order}',"
-                                                                               
                        ."entity_id:'{$this->entity_id}',"
-                                                                               
                        ."cat_id:'{$this->cat_id}',"
-                                                                               
                        ."p_num:'{$p_num}',"
-                                                                               
                        ."doc_type:'{$this->doc_type}',"
-                                                                               
                        ."location_code:'{$location_code}',"
-                                                                               
                        ."filter:'{$this->filter}',"
-                                                                               
                        ."query:'{$this->query}',"
-                                                                               
                        ."query_location:'{$this->query_location}',"
-                                                                               
                        ."allrows:'{$this->allrows}'";
+                               $datatable['config']['base_java_url'] = 
"menuaction:'property.uidocument.list_doc',"
+                                       ."sort:'{$this->sort}',"
+                                       ."order:'{$this->order}',"
+                                       ."entity_id:'{$this->entity_id}',"
+                                       ."cat_id:'{$this->cat_id}',"
+                                       ."p_num:'{$p_num}',"
+                                       ."doc_type:'{$this->doc_type}',"
+                                       ."location_code:'{$location_code}',"
+                                       ."filter:'{$this->filter}',"
+                                       ."query:'{$this->query}',"
+                                       
."query_location:'{$this->query_location}',"
+                                       ."allrows:'{$this->allrows}'";
 
-                           $datatable['config']['allow_allrows'] = true;
+                               $datatable['config']['allow_allrows'] = true;
 
                                $values_combo_box[0] = 
$this->cats->formatted_xslt_list(array('format'=>'filter','selected' => 
$this->doc_type,'globals' => True));
                                $default_value = array ('cat_id'=>'','name'=> 
lang('no category'));
@@ -606,10 +620,13 @@
                                $default_value = array 
('id'=>'','name'=>lang('no user'));
                                array_unshift 
($values_combo_box[1],$default_value);
 
-                               $datatable['actions']['form'] = array(
-                               array(
-                                       'action'        => 
$GLOBALS['phpgw']->link('/index.php',
-                                                       array(
+                               $datatable['actions']['form'] = array
+                                       (
+                                               array
+                                               (
+                                                       'action'        => 
$GLOBALS['phpgw']->link('/index.php',
+                                                       array
+                                                       (
                                                                'menuaction'    
=> 'property.uidocument.list_doc',
                                                                'sort'          
=> $this->sort,
                                                                'order'         
=> $this->order,
@@ -623,70 +640,82 @@
                                                                
'query_location'=> $this->query_location
                                                        )
                                                ),
-                                       'fields'        => array(
-                                           'field' => array(
-                                                                       array( 
// mensaje
-                                                                               
                                        'type'  => 'label',
-                                                                               
                                        'id'    => 'msg_header',
-                                                                               
                                        'value' => '',
-                                                                               
                                        'style' => 'filter'
-                                                                               
                                ),
-                                                                               
                                array( //boton  CATEGORY
-                                                                           
'id' => 'btn_type_id',
-                                                                           
'name' => 'type_id',
-                                                                           
'value'     => lang('Type'),
-                                                                           
'type' => 'button',
-                                                                           
'style' => 'filter',
-                                                                           
'tab_index' => 1
-                                                                       ),
-                                                                       array( 
//boton  STATUS
-                                                                           
'id' => 'btn_user_id',
-                                                                           
'name' => 'user_id',
-                                                                           
'value'     => lang('User'),
-                                                                           
'type' => 'button',
-                                                                           
'style' => 'filter',
-                                                                           
'tab_index' => 2
-                                                                       ),
-                                                                               
                                array(
-                                                                               
        'type'  => 'button',
-                                                                               
        'id'    => 'btn_new',
-                                                                               
        'value' => lang('add'),
-                                                                               
        'tab_index' => 8
-                                                                               
    ),
-                                                                       array( 
//boton     SEARCH
-                                                                           
'id' => 'btn_search',
-                                                                           
'name' => 'search',
-                                                                           
'value'    => lang('search'),
-                                                                           
'type' => 'button',
-                                                                           
'tab_index' => 7
-                                                                       ),
-                                                                               
                                array( // TEXT INPUT
-                                                                           
'name'     => 'query',
-                                                                           
'id'     => 'txt_query',
-                                                                           
'value'    => '',//$query,
-                                                                           
'type' => 'text',
-                                                                           
'onkeypress' => 'return pulsar(event)',
-                                                                           
'size'    => 28,
-                                                                           
'tab_index' => 6
-                                                                       ),
-                                                                               
                                array( //container of  control's Form
-                                                                               
                                        'type'  => 'label',
-                                                                               
                                        'id'    => 'controlsForm_container',
-                                                                               
                                        'value' => ''
-                                                                               
                                )
-                                                                               
),
-                                                       'hidden_value' => array(
-                                                                               
        array( //div values  combo_box_0
-                                                                               
                            'id' => 'values_combo_box_0',
-                                                                               
                            'value'     => 
$this->bocommon->select2String($values_combo_box[0]['cat_list'], 'cat_id') 
//i.e.  id,value/id,vale/
-                                                                               
                      ),
-                                                                               
                array( //div values  combo_box_1
-                                                                               
                            'id' => 'values_combo_box_1',
-                                                                               
                            'value'     => 
$this->bocommon->select2String($values_combo_box[1])
-                                                                               
                      )
-                                                                               
                        )
-                                                                               
)
-                                        )
+                                               'fields'        => array
+                                               (
+                                                       'field' => array
+                                                       (
+                                                               array
+                                                               ( // mensaje
+                                                                       'type'  
=> 'label',
+                                                                       'id'    
=> 'msg_header',
+                                                                       'value' 
=> '',
+                                                                       'style' 
=> 'filter'
+                                                               ),
+                                                               array
+                                                               ( //boton       
CATEGORY
+                                                                       'id' => 
'btn_type_id',
+                                                                       'name' 
=> 'type_id',
+                                                                       'value' 
=> lang('Type'),
+                                                                       'type' 
=> 'button',
+                                                                       'style' 
=> 'filter',
+                                                                       
'tab_index' => 1
+                                                               ),
+                                                               array
+                                                               ( //boton       
STATUS
+                                                                       'id' => 
'btn_user_id',
+                                                                       'name' 
=> 'user_id',
+                                                                       'value' 
=> lang('User'),
+                                                                       'type' 
=> 'button',
+                                                                       'style' 
=> 'filter',
+                                                                       
'tab_index' => 2
+                                                               ),
+                                                               array
+                                                               (
+                                                                       'type'  
=> 'button',
+                                                                       'id'    
=> 'btn_new',
+                                                                       'value' 
=> lang('add'),
+                                                                       
'tab_index' => 8
+                                                               ),
+                                                               array
+                                                               ( //boton     
SEARCH
+                                                                       'id' => 
'btn_search',
+                                                                       'name' 
=> 'search',
+                                                                       'value' 
   => lang('search'),
+                                                                       'type' 
=> 'button',
+                                                                       
'tab_index' => 7
+                                                               ),
+                                                               array
+                                                               ( // TEXT INPUT
+                                                                       'name'  
   => 'query',
+                                                                       'id'    
 => 'txt_query',
+                                                                       'value' 
   => '',//$query,
+                                                                       'type' 
=> 'text',
+                                                                       
'onkeypress' => 'return pulsar(event)',
+                                                                       'size'  
  => 28,
+                                                                       
'tab_index' => 6
+                                                               ),
+                                                               array
+                                                               ( //container 
of  control's Form
+                                                                       'type'  
=> 'label',
+                                                                       'id'    
=> 'controlsForm_container',
+                                                                       'value' 
=> ''
+                                                               )
+                                                       ),
+                                                       'hidden_value' => array
+                                                       (
+                                                               array
+                                                               ( //div values  
combo_box_0
+                                                                       'id' => 
'values_combo_box_0',
+                                                                       'value' 
=> $this->bocommon->select2String($values_combo_box[0]['cat_list'], 'cat_id') 
//i.e.  id,value/id,vale/
+                                                               ),
+                                                               array
+                                                               ( //div values  
combo_box_1
+                                                                       'id' => 
'values_combo_box_1',
+                                                                       'value' 
=> $this->bocommon->select2String($values_combo_box[1])
+                                                               )
+                                                       )
+                                               )
+                                       )
                                );
                        }
 
@@ -768,96 +797,100 @@
                        $location_data = array();
 
                        $location_data = 
$this->bolocation->initiate_ui_location(array(
-                                               'values'                => 
$location,
-                                               'type_id'               => 
count(explode('-',$location_code)),
-                                               'no_link'               => 
false, // disable lookup links for location type less than type_id
-                                               'tenant'                => 
false,
-                                               'lookup_type'           => 
'view',
-                                               'lookup_entity'         => 
$lookup_entity,
-                                               'entity_data'           => 
$entity_data,
-                                               'link_data'             => 
$link_data,
-                                               'query_link'            => true
-                                               ));
+                               'values'                => $location,
+                               'type_id'               => 
count(explode('-',$location_code)),
+                               'no_link'               => false, // disable 
lookup links for location type less than type_id
+                               'tenant'                => false,
+                               'lookup_type'           => 'view',
+                               'lookup_entity'         => $lookup_entity,
+                               'entity_data'           => $entity_data,
+                               'link_data'             => $link_data,
+                               'query_link'            => true
+                       ));
 
                        $datatable['locdata'] = $location_data['location'];
 
                        $datatable['rowactions']['action'] = array();
 
                        $parameters = array
-                       (
-                               'parameter' => array
                                (
-                                       array
+                                       'parameter' => array
                                        (
-                                               'name'          => 
'document_id',
-                                               'source'        => 'document_id'
-                                       ),
-                               )
-                       );
+                                               array
+                                               (
+                                                       'name'          => 
'document_id',
+                                                       'source'        => 
'document_id'
+                                               ),
+                                       )
+                               );
 
                        if($this->acl_read)
                        {
-                               $datatable['rowactions']['action'][] = array(
-                                                       'my_name'               
        => 'view',
-                                                       'statustext'    => 
lang('view this entity'),
-                                                       'text'                  
=> lang('view'),
-                                                       'action'                
=> $GLOBALS['phpgw']->link('/index.php',array
-                                                                       (
-                                                                               
'menuaction'    => 'property.uidocument.view',
-                                                                               
'from'                  => 'list_doc'
-                                                                       )),
+                               $datatable['rowactions']['action'][] = array
+                                       (
+                                               'my_name'                       
=> 'view',
+                                               'statustext'    => lang('view 
this entity'),
+                                               'text'                  => 
lang('view'),
+                                               'action'                => 
$GLOBALS['phpgw']->link('/index.php',array
+                                               (
+                                                       'menuaction'    => 
'property.uidocument.view',
+                                                       'from'                  
=> 'list_doc'
+                                               )),
                                                'parameters'    => $parameters
-                                               );
+                                       );
                        }
 
                        if($this->acl_edit)
                        {
-                               $datatable['rowactions']['action'][] = array(
-                                                       'my_name'               
        => 'edit',
-                                                       'statustext'    => 
lang('edit this entity'),
-                                                       'text'                  
=> lang('edit'),
-                                                       'action'                
=> $GLOBALS['phpgw']->link('/index.php',array
-                                                                       (
-                                                                               
'menuaction'    => 'property.uidocument.edit',
-                                                                               
'from'                  => 'list_doc'
-                                                                       )),
+                               $datatable['rowactions']['action'][] = array
+                                       (
+                                               'my_name'                       
=> 'edit',
+                                               'statustext'    => lang('edit 
this entity'),
+                                               'text'                  => 
lang('edit'),
+                                               'action'                => 
$GLOBALS['phpgw']->link('/index.php',array
+                                               (
+                                                       'menuaction'    => 
'property.uidocument.edit',
+                                                       'from'                  
=> 'list_doc'
+                                               )),
                                                'parameters'    => $parameters
-                                               );
+                                       );
                        }
 
                        if($this->acl_delete)
                        {
-                               $datatable['rowactions']['action'][] = array(
-                                                       'my_name'               
        => 'delete',
-                                                       'statustext'    => 
lang('delete this entity'),
-                                                       'text'                  
=> lang('delete'),
-                                                       'confirm_msg'   => 
lang('do you really want to delete this entry'),
-                                                       'action'                
=> $GLOBALS['phpgw']->link('/index.php',array
-                                                                       (
-                                                                               
'menuaction'    => 'property.uidocument.delete',
-                                                                               
'location_code' => $location_code,
-                                                                               
'p_num'         => $p_num
-                                                                       )),
+                               $datatable['rowactions']['action'][] = array
+                                       (
+                                               'my_name'                       
=> 'delete',
+                                               'statustext'    => lang('delete 
this entity'),
+                                               'text'                  => 
lang('delete'),
+                                               'confirm_msg'   => lang('do you 
really want to delete this entry'),
+                                               'action'                => 
$GLOBALS['phpgw']->link('/index.php',array
+                                               (
+                                                       'menuaction'    => 
'property.uidocument.delete',
+                                                       'location_code' => 
$location_code,
+                                                       'p_num'         => 
$p_num
+                                               )),
                                                'parameters'    => $parameters
-                                               );
+                                       );
                        }
 
                        if($this->acl_add)
                        {
-                               $datatable['rowactions']['action'][] = array(
-                                                       'my_name'               
        => 'add',
-                                                       'statustext'    => 
lang('add an entity'),
-                                                       'text'                  
=> lang('add'),
-                                                       'action'                
=> $GLOBALS['phpgw']->link('/index.php',array
-                                                                       (
-                                                                               
'menuaction'    => 'property.uidocument.edit',
-                                                                               
'from'                  => 'list_doc',
-                                                                               
'location_code' => $location_code,
-                                                                               
'p_entity_id'   => $this->entity_id,
-                                                                               
'p_cat_id'              => $this->cat_id,
-                                                                               
'p_num'                 => $p_num
-                                                                       ))
-                                               );
+                               $datatable['rowactions']['action'][] = array
+                                       (
+                                               'my_name'                       
=> 'add',
+                                               'statustext'    => lang('add an 
entity'),
+                                               'text'                  => 
lang('add'),
+                                               'action'                => 
$GLOBALS['phpgw']->link('/index.php',array
+                                               (
+                                                       'menuaction'    => 
'property.uidocument.edit',
+                                                       'from'                  
=> 'list_doc',
+                                                       'location_code' => 
$location_code,
+                                                       'p_entity_id'   => 
$this->entity_id,
+                                                       'p_cat_id'              
=> $this->cat_id,
+                                                       'p_num'                 
=> $p_num
+                                               ))
+                                       );
                        }
 
                        unset($parameters);
@@ -909,85 +942,85 @@
                        }
 
                        phpgwapi_yui::load_widget('dragdrop');
-                       phpgwapi_yui::load_widget('datatable');
-                       phpgwapi_yui::load_widget('menu');
-                       phpgwapi_yui::load_widget('connection');
-                       phpgwapi_yui::load_widget('loader');
+                       phpgwapi_yui::load_widget('datatable');
+                       phpgwapi_yui::load_widget('menu');
+                       phpgwapi_yui::load_widget('connection');
+                       phpgwapi_yui::load_widget('loader');
                        phpgwapi_yui::load_widget('tabview');
                        phpgwapi_yui::load_widget('paginator');
                        phpgwapi_yui::load_widget('animation');
 
                        //-- BEGIN----------------------------- JSON CODE 
------------------------------
-               //values for Pagination
-                       $json = array
-                       (
-                               'recordsReturned'       => 
$datatable['pagination']['records_returned'],
-                               'totalRecords'          => 
(int)$datatable['pagination']['records_total'],
-                               'startIndex'            => 
$datatable['pagination']['records_start'],
+                       //values for Pagination
+                       $json = array
+                               (
+                                       'recordsReturned'       => 
$datatable['pagination']['records_returned'],
+                                       'totalRecords'          => 
(int)$datatable['pagination']['records_total'],
+                                       'startIndex'            => 
$datatable['pagination']['records_start'],
                                        'sort'                          => 
$datatable['sorting']['order'],
-                               'dir'                           => 
$datatable['sorting']['sort'],
+                                       'dir'                           => 
$datatable['sorting']['sort'],
                                        'records'                       => 
array()
-                       );
+                               );
 
-                               // values for datatable
-                       if(isset($datatable['rows']['row']) && 
is_array($datatable['rows']['row']))
-                       {
-                               foreach( $datatable['rows']['row'] as $row )
-                               {
-                                       $json_row = array();
-                                       foreach( $row['column'] as $column)
-                                       {
-                                               if(isset($column['format']) && 
$column['format']== "link" && $column['java_link']==true)
-                                               {
-                                                       
$json_row[$column['name']] = "<a href='#' id='{$column['link']} 
onclick='javascript:filter_data(this.id);'>{$column['value']}</a>";
-                                               }
-                                               else 
if(isset($column['format']) && $column['format']== "link")
-                                               {
-                                                 $json_row[$column['name']] = 
"<a href='{$column['link']}' target = '_blank'>{$column['value']}</a>";
-                                               }
-                                               else
-                                               {
-                                                 $json_row[$column['name']] = 
$column['value'];
-                                               }
-                                       }
-                                       $json['records'][] = $json_row;
-                               }
-                       }
-
-                       // right in datatable
-                               if(isset($datatable['rowactions']['action']) && 
is_array($datatable['rowactions']['action']))
+                       // values for datatable
+                       if(isset($datatable['rows']['row']) && 
is_array($datatable['rows']['row']))
+                       {
+                               foreach( $datatable['rows']['row'] as $row )
                                {
-                                       $json ['rights'] = 
$datatable['rowactions']['action'];
+                                       $json_row = array();
+                                       foreach( $row['column'] as $column)
+                                       {
+                                               if(isset($column['format']) && 
$column['format']== "link" && $column['java_link']==true)
+                                               {
+                                                       
$json_row[$column['name']] = "<a href='#' id='{$column['link']} 
onclick='javascript:filter_data(this.id);'>{$column['value']}</a>";
+                                               }
+                                               else 
if(isset($column['format']) && $column['format']== "link")
+                                               {
+                                                       
$json_row[$column['name']] = "<a href='{$column['link']}' target = 
'_blank'>{$column['value']}</a>";
+                                               }
+                                               else
+                                               {
+                                                       
$json_row[$column['name']] = $column['value'];
+                                               }
+                                       }
+                                       $json['records'][] = $json_row;
                                }
+                       }
 
-                               $json ['toolbar_height'] = 40;
-                               if(isset($location_data) && 
is_array($location_data))
-                               {
-                                       $json ['toolbar_height'] = $json 
['toolbar_height'] + (count($datatable['locdata']) * 10);
-                                       $json ['current_consult'] = 
$datatable['locdata'];
-                               }
-                               if( phpgw::get_var('phpgw_return_as') == 'json' 
)
-                               {
-                               return $json;
-                               }
+                       // right in datatable
+                       if(isset($datatable['rowactions']['action']) && 
is_array($datatable['rowactions']['action']))
+                       {
+                               $json ['rights'] = 
$datatable['rowactions']['action'];
+                       }
 
+                       $json ['toolbar_height'] = 40;
+                       if(isset($location_data) && is_array($location_data))
+                       {
+                               $json ['toolbar_height'] = $json 
['toolbar_height'] + (count($datatable['locdata']) * 10);
+                               $json ['current_consult'] = 
$datatable['locdata'];
+                       }
+                       if( phpgw::get_var('phpgw_return_as') == 'json' )
+                       {
+                               return $json;
+                       }
 
+
                        $datatable['json_data'] = json_encode($json);
                        //-------------------- JSON CODE ----------------------
 
                        $template_vars = array();
                        $template_vars['datatable'] = $datatable;
                        
$GLOBALS['phpgw']->xslttpl->add_file(array('datatable'));
-               $GLOBALS['phpgw']->xslttpl->set_var('phpgw', $template_vars);
+                       $GLOBALS['phpgw']->xslttpl->set_var('phpgw', 
$template_vars);
 
-               if ( !isset($GLOBALS['phpgw']->css) || 
!is_object($GLOBALS['phpgw']->css) )
-               {
-                       $GLOBALS['phpgw']->css = createObject('phpgwapi.css');
-               }
+                       if ( !isset($GLOBALS['phpgw']->css) || 
!is_object($GLOBALS['phpgw']->css) )
+                       {
+                               $GLOBALS['phpgw']->css = 
createObject('phpgwapi.css');
+                       }
 
-               $GLOBALS['phpgw']->css->validate_file('datatable');
-                       $GLOBALS['phpgw']->css->validate_file('property');
-                       
$GLOBALS['phpgw']->css->add_external_file('property/templates/base/css/property.css');
+                       $GLOBALS['phpgw']->css->validate_file('datatable');
+                       $GLOBALS['phpgw']->css->validate_file('property');
+                       
$GLOBALS['phpgw']->css->add_external_file('property/templates/base/css/property.css');
                        
$GLOBALS['phpgw']->css->add_external_file('phpgwapi/js/yahoo/datatable/assets/skins/sam/datatable.css');
                        
$GLOBALS['phpgw']->css->add_external_file('phpgwapi/js/yahoo/paginator/assets/skins/sam/paginator.css');
                        
$GLOBALS['phpgw']->css->add_external_file('phpgwapi/js/yahoo/container/assets/skins/sam/container.css');
@@ -1021,7 +1054,7 @@
 
                        $from                   = phpgw::get_var('from');
                        $document_id            = phpgw::get_var('document_id', 
'int');
-//                     $location_code          = 
phpgw::get_var('location_code');
+                       //                      $location_code          = 
phpgw::get_var('location_code');
                        $values                 = phpgw::get_var('values');
 
                        if(!$from)
@@ -1084,7 +1117,7 @@
                                $values['entity_name']=$entity['name'];
                                $values['category_name']=$category['name'];
                        }
-*/
+ */
                        if ($values['save'])
                        {
                                $values['vendor_id']            = 
phpgw::get_var('vendor_id', 'int', 'POST');
@@ -1107,7 +1140,7 @@
 
                                if(!$values['status'])
                                {
-//                                     
$receipt['error'][]=array('msg'=>lang('Please select a status !'));
+                                       //                                      
$receipt['error'][]=array('msg'=>lang('Please select a status !'));
                                }
                                if(!$values['location'])
                                {
@@ -1122,12 +1155,13 @@
                                {
                                        $document_dir = 
"document/entity_{$this->entity_id}_{$this->cat_id}/{$values['extra']['p_num']}";
                                }
-                               
+
                                $document_dir .= "/{$values['doc_type']}";
 
                                $to_file        = 
"{$this->bofiles->fakebase}/{$document_dir}/{$values['document_name']}";
 
-                               if((!isset($values['document_name_orig']) || 
!$values['document_name_orig']) && $this->bofiles->vfs->file_exists(array(
+                               if((!isset($values['document_name_orig']) || 
!$values['document_name_orig']) && $this->bofiles->vfs->file_exists(array
+                                       (
                                                'string' => $to_file,
                                                'relatives' => 
Array(RELATIVE_NONE)
                                        )))
@@ -1139,61 +1173,61 @@
                                {
                                        
if(isset($_FILES['document_file']['tmp_name']) && 
$_FILES['document_file']['tmp_name'])
                                        {
-                                       $receipt = 
$this->bofiles->create_document_dir($document_dir);
-                                       if(isset($values['document_name_orig']) 
&& $values['document_name_orig'] && (!isset($values['document_name']) || 
!$values['document_name']))
+                                               $receipt = 
$this->bofiles->create_document_dir($document_dir);
+                                               
if(isset($values['document_name_orig']) && $values['document_name_orig'] && 
(!isset($values['document_name']) || !$values['document_name']))
+                                               {
+                                                       $old_file       = 
$this->bo->get_file($document_id);
+
+                                                       $to_file .= 
$values['document_name_orig'];
+
+                                                       if($old_file != 
$to_file)
+                                                       {
+                                                               
$this->bofiles->vfs->override_acl = 1;
+                                                               
if(!$this->bofiles->vfs->mv (array (
+                                                                       'from'  
        => $old_file,
+                                                                       'to'    
        => $to_file,
+                                                                       
'relatives'     => array (RELATIVE_ALL, RELATIVE_ALL))))
+                                                               {
+                                                                       
$receipt['error'][]=array('msg'=>lang('Failed to move file !'));
+                                                               }
+                                                               
$this->bofiles->vfs->override_acl = 0;
+                                                       }
+                                               }
+                                       }
+
+                                       $values['document_id'] = $document_id;
+
+                                       if(!$receipt['error'])
                                        {
-                                               $old_file       = 
$this->bo->get_file($document_id);
-                                               
-                                               $to_file .= 
$values['document_name_orig'];
-                                               
-                                               if($old_file != $to_file)
+                                               if($values['document_name'] && 
!$values['link'])
                                                {
                                                        
$this->bofiles->vfs->override_acl = 1;
-                                                       
if(!$this->bofiles->vfs->mv (array (
-                                                               'from'          
=> $old_file,
+
+                                                       
if(!$this->bofiles->vfs->cp (array (
+                                                               'from'          
=> $_FILES['document_file']['tmp_name'],
                                                                'to'            
=> $to_file,
-                                                               'relatives'     
=> array (RELATIVE_ALL, RELATIVE_ALL))))
+                                                               'relatives'     
=> array (RELATIVE_NONE|VFS_REAL, RELATIVE_ALL))))
                                                        {
-                                                               
$receipt['error'][]=array('msg'=>lang('Failed to move file !'));
+                                                               
$receipt['error'][]=array('msg'=>lang('Failed to upload file !'));
                                                        }
                                                        
$this->bofiles->vfs->override_acl = 0;
                                                }
                                        }
                                }
 
-                               $values['document_id'] = $document_id;
-
                                if(!$receipt['error'])
                                {
-                                       if($values['document_name'] && 
!$values['link'])
-                                       {
-                                               
$this->bofiles->vfs->override_acl = 1;
-
-                                               if(!$this->bofiles->vfs->cp 
(array (
-                                                       'from'          => 
$_FILES['document_file']['tmp_name'],
-                                                       'to'            => 
$to_file,
-                                                       'relatives'     => 
array (RELATIVE_NONE|VFS_REAL, RELATIVE_ALL))))
-                                               {
-                                                       
$receipt['error'][]=array('msg'=>lang('Failed to upload file !'));
-                                               }
-                                               
$this->bofiles->vfs->override_acl = 0;
-                                       }
-                                       }
+                                       $receipt = $this->bo->save($values);
+                                       //                                      
$document_id=$receipt['document_id'];
+                                       
$GLOBALS['phpgw']->session->appsession('session_data','document_receipt',$receipt);
+                                       
$GLOBALS['phpgw']->redirect_link('/index.php', array('menuaction'=> 
'property.uidocument.list_doc', 'location_code'=> implode("-", 
$values['location']), 'entity_id'=> $this->entity_id, 'cat_id'=> $this->cat_id, 
'p_num'=> $values['extra']['p_num']));
                                }
-
-                                       if(!$receipt['error'])
-                                       {
-                                               $receipt = 
$this->bo->save($values);
-       //                                      
$document_id=$receipt['document_id'];
-                                               
$GLOBALS['phpgw']->session->appsession('session_data','document_receipt',$receipt);
-                                               
$GLOBALS['phpgw']->redirect_link('/index.php', array('menuaction'=> 
'property.uidocument.list_doc', 'location_code'=> implode("-", 
$values['location']), 'entity_id'=> $this->entity_id, 'cat_id'=> $this->cat_id, 
'p_num'=> $values['extra']['p_num']));
-                                       }
                                else
                                {
                                        $values['document_name']='';
                                        if($values['location'])
                                        {
-               //                              $location_code=implode("-", 
$values['location']);
+                                               //                              
$location_code=implode("-", $values['location']);
                                                $values['extra']['view'] = true;
                                                $values['location_data'] = 
$this->bolocation->read_single($values['location_code'],$values['extra']);
                                        }
@@ -1219,12 +1253,12 @@
                        }
 
                        $table_header_history[] = array
-                       (
-                               'lang_date'             => lang('Date'),
-                               'lang_user'             => lang('User'),
-                               'lang_action'           => lang('Action'),
-                               'lang_new_value'        => lang('New value')
-                       );
+                               (
+                                       'lang_date'             => lang('Date'),
+                                       'lang_user'             => lang('User'),
+                                       'lang_action'           => 
lang('Action'),
+                                       'lang_new_value'        => lang('New 
value')
+                               );
 
                        if ($values['doc_type'])
                        {
@@ -1238,159 +1272,161 @@
                        {
                                $p_num = $values['p_num'];
                        }
-*/
-                       
$location_data=$this->bolocation->initiate_ui_location(array(
-                                               'values'                => 
$values['location_data'],
-                                               'type_id'               => -1, 
// calculated from location_types
-                                               'no_link'               => 
false, // disable lookup links for location type less than type_id
-                                               'tenant'                => 
false,
-                                               'lookup_type'           => 
'form',
-                                               'lookup_entity'         => 
$this->bocommon->get_lookup_entity('document'),
-                                               'entity_data'           => 
$values['p']
-                                               ));
+ */
+                       
$location_data=$this->bolocation->initiate_ui_location(array
+                               (
+                                       'values'                => 
$values['location_data'],
+                                       'type_id'               => -1, // 
calculated from location_types
+                                       'no_link'               => false, // 
disable lookup links for location type less than type_id
+                                       'tenant'                => false,
+                                       'lookup_type'           => 'form',
+                                       'lookup_entity'         => 
$this->bocommon->get_lookup_entity('document'),
+                                       'entity_data'           => $values['p']
+                               ));
 
 
-                       
$vendor_data=$this->bocommon->initiate_ui_vendorlookup(array(
-                                               'vendor_id'     => 
$values['vendor_id'],
-                                               'vendor_name'   => 
$values['vendor_name']));
+                       
$vendor_data=$this->bocommon->initiate_ui_vendorlookup(array
+                               (
+                                       'vendor_id'     => $values['vendor_id'],
+                                       'vendor_name'   => 
$values['vendor_name']));
 
 
                        $link_data = array
-                       (
-                               'menuaction'    => 'property.uidocument.edit',
-                               'document_id'   => $document_id,
-                               'from'          => $from,
-                               'location_code' => $values['location_code'],
-                               'entity_id'     => $this->entity_id,
-                               'cat_id'        => $this->cat_id,
-                       );
+                               (
+                                       'menuaction'    => 
'property.uidocument.edit',
+                                       'document_id'   => $document_id,
+                                       'from'          => $from,
+                                       'location_code' => 
$values['location_code'],
+                                       'entity_id'     => $this->entity_id,
+                                       'cat_id'        => $this->cat_id,
+                               );
 
                        $msgbox_data = $this->bocommon->msgbox_data($receipt);
 
                        $jscal = CreateObject('phpgwapi.jscalendar');
                        $jscal->add_listener('values_document_date');
-       
+
                        //data test     $record_history = 
array(array(value_date=>"1111",value_user=>"22222",value_action=>"33333",value_new_value=>"44444444"));
-                       
-//----datatable settings------------------------------------
 
+                       //----datatable 
settings------------------------------------
+
                        $datavalues[0] = array
-                       (
+                               (
                                        'name'                                  
=> "0",
                                        'values'                                
=> json_encode($record_history),
                                        'total_records'                 => 
count($record_history),
                                        'is_paginator'                  => 0,
                                        'footer'                                
=> 0
-                       );      
+                               );      
 
-                       $myColumnDefs[0] = array
-                       (
-                               'name'          => "0",
-                               'values'        =>      json_encode(array(      
array(key => value_date,        label=>lang('Date'),    
sortable=>true,resizeable=>true),
-                                                                               
                array(key => value_user,        label=>lang('User'),    
sortable=>true,resizeable=>true),
-                                                                               
                array(key => value_action,      label=>lang('Action'),  
sortable=>true,resizeable=>true),
-                                                                               
        array(key => value_new_value,label=>lang('New 
value'),sortable=>true,resizeable=>true)))
-                       );      
-                       
-//-----------------------------------------datatable settings-----
+                       $myColumnDefs[0] = array
+                               (
+                                       'name'          => "0",
+                                       'values'        =>      
json_encode(array(      array('key' => 'value_date',    'label'=>lang('Date'),  
'sortable'=>true,'resizeable'=>true),
+                                       array('key' => 'value_user',    
'label'=>lang('User'),  'sortable'=>true,'resizeable'=>true),
+                                       array('key' => 'value_action',  
'label'=>lang('Action'),        'sortable'=>true,'resizeable'=>true),
+                                       array('key' => 
'value_new_value','label'=>lang('New 
value'),'sortable'=>true,'resizeable'=>true)))
+                               );      
 
+                       //-----------------------------------------datatable 
settings-----
+
                        $data = array
-                       (
-                               'property_js'                                   
=> 
json_encode($GLOBALS['phpgw_info']['server']['webserver_url']."/property/js/yahoo/property2.js"),
-                               'datatable'                                     
        => $datavalues,
-                               'myColumnDefs'                                  
=> $myColumnDefs,       
-                                                                       
-                               'msgbox_data'                                   
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
-                               'vendor_data'                                   
=> $vendor_data,
-                               'record_history'                                
=> $record_history,
-                               'table_header_history'                          
=> $table_header_history,
-                               'lang_history'                                  
=> lang('History'),
-                               'lang_no_history'                               
=> lang('No history'),
+                               (
+                                       'property_js'                           
        => 
json_encode($GLOBALS['phpgw_info']['server']['webserver_url']."/property/js/yahoo/property2.js"),
+                                       'datatable'                             
                => $datavalues,
+                                       'myColumnDefs'                          
        => $myColumnDefs,       
 
-                               'img_cal'                                       
=> $GLOBALS['phpgw']->common->image('phpgwapi','cal'),
-                               'lang_datetitle'                                
=> lang('Select date'),
+                                       'msgbox_data'                           
        => $GLOBALS['phpgw']->common->msgbox($msgbox_data),
+                                       'vendor_data'                           
        => $vendor_data,
+                                       'record_history'                        
        => $record_history,
+                                       'table_header_history'                  
=> $table_header_history,
+                                       'lang_history'                          
        => lang('History'),
+                                       'lang_no_history'                       
        => lang('No history'),
 
-                               'lang_document_date_statustext'                 
=> lang('Select date the document was created'),
-                               'lang_document_date'                            
=> lang('document date'),
-                               'value_document_date'                           
=> $values['document_date'],
+                                       'img_cal'                               
                => $GLOBALS['phpgw']->common->image('phpgwapi','cal'),
+                                       'lang_datetitle'                        
        => lang('Select date'),
 
-                               'vendor_data'                                   
=> $vendor_data,
-                               'location_data'                                 
=> $location_data,
-                               'location_type'                                 
=> 'form',
-                               'form_action'                                   
=> $GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'lang_year'                                     
=> lang('Year'),
-                               'lang_category'                                 
=> lang('category'),
-                               'lang_save'                                     
=> lang('save'),
-                               'lang_save_statustext'                          
=> lang('Save the document'),
+                                       'lang_document_date_statustext' => 
lang('Select date the document was created'),
+                                       'lang_document_date'                    
=> lang('document date'),
+                                       'value_document_date'                   
=> $values['document_date'],
 
-                               'done_action'                                   
=> $GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'property.uidocument.' .$from, 'location_code'=> $location_code, 'entity_id'=> 
$this->entity_id, 'cat_id'=> $this->cat_id, 'p_num'=> $p_num, 'preserve'=> 1)),
-                               'lang_done'                                     
=> lang('done'),
-                               'lang_done_statustext'                          
=> lang('Back to the list'),
+                                       'vendor_data'                           
        => $vendor_data,
+                                       'location_data'                         
        => $location_data,
+                                       'location_type'                         
        => 'form',
+                                       'form_action'                           
        => $GLOBALS['phpgw']->link('/index.php',$link_data),
+                                       'lang_year'                             
                => lang('Year'),
+                                       'lang_category'                         
        => lang('category'),
+                                       'lang_save'                             
                => lang('save'),
+                                       'lang_save_statustext'                  
=> lang('Save the document'),
 
-                               'lang_update_file'                              
=> lang('Update file'),
+                                       'done_action'                           
        => $GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'property.uidocument.' .$from, 'location_code'=> $location_code, 'entity_id'=> 
$this->entity_id, 'cat_id'=> $this->cat_id, 'p_num'=> $p_num, 'preserve'=> 1)),
+                                       'lang_done'                             
                => lang('done'),
+                                       'lang_done_statustext'                  
=> lang('Back to the list'),
 
-                               'lang_document_id'                              
=> lang('document ID'),
-                               'value_document_id'                             
=> $document_id,
+                                       'lang_update_file'                      
        => lang('Update file'),
 
-                               'lang_document_name'                            
=> lang('document name'),
-                               'value_document_name'                           
=> $values['document_name'],
-                               'lang_document_name_statustext'                 
=> lang('Enter document Name'),
+                                       'lang_document_id'                      
        => lang('document ID'),
+                                       'value_document_id'                     
        => $document_id,
 
-                               'lang_floor_id'                                 
=> lang('Floor ID'),
-                               'value_floor_id'                                
=> $values['floor_id'],
-                               'lang_floor_statustext'                         
=> lang('Enter the floor ID'),
+                                       'lang_document_name'                    
=> lang('document name'),
+                                       'value_document_name'                   
=> $values['document_name'],
+                                       'lang_document_name_statustext' => 
lang('Enter document Name'),
 
-                               'lang_title'                                    
=> lang('title'),
-                               'value_title'                                   
=> $values['title'],
-                               'lang_title_statustext'                         
=> lang('Enter document title'),
+                                       'lang_floor_id'                         
        => lang('Floor ID'),
+                                       'value_floor_id'                        
        => $values['floor_id'],
+                                       'lang_floor_statustext'                 
=> lang('Enter the floor ID'),
 
-                               'lang_version'                                  
=> lang('Version'),
-                               'value_version'                                 
=> $values['version'],
-                               'lang_version_statustext'                       
=> lang('Enter document version'),
+                                       'lang_title'                            
        => lang('title'),
+                                       'value_title'                           
        => $values['title'],
+                                       'lang_title_statustext'                 
=> lang('Enter document title'),
 
-                               'lang_link'                                     
=> lang('Link'),
-                               'value_link'                                    
=> $values['link'],
-                               'lang_link_statustext'                          
=> lang('Alternative - link instead of uploading a file'),
+                                       'lang_version'                          
        => lang('Version'),
+                                       'value_version'                         
        => $values['version'],
+                                       'lang_version_statustext'               
=> lang('Enter document version'),
 
-                               'lang_descr_statustext'                         
=> lang('Enter a description of the document'),
-                               'lang_descr'                                    
=> lang('Description'),
-                               'value_descr'                                   
=> $values['descr'],
-                               'lang_no_cat'                                   
=> lang('Select category'),
-                               'lang_cat_statustext'                           
=> lang('Select the category the document belongs to. To do not use a category 
select NO CATEGORY'),
-                               'value_cat_id'                                  
=> $values['doc_type'],
-                               'cat_select'                                    
        => $this->cats->formatted_xslt_list(array('select_name' => 
'values[doc_type]','selected' => $values['doc_type'])),
-                               'lang_coordinator'                              
=> lang('Coordinator'),
-                               'lang_user_statustext'                          
=> lang('Select the coordinator the document 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),
+                                       'lang_link'                             
                => lang('Link'),
+                                       'value_link'                            
        => $values['link'],
+                                       'lang_link_statustext'                  
=> lang('Alternative - link instead of uploading a file'),
 
-                               'status_list'                                   
=> $this->bo->select_status_list('select',$values['status']),
-                               'status_name'                                   
=> 'values[status]',
-                               'lang_no_status'                                
=> lang('Select status'),
-                               'lang_status'                                   
=> lang('Status'),
-                               'lang_status_statustext'                        
=> lang('What is the current status of this document ?'),
+                                       'lang_descr_statustext'                 
=> lang('Enter a description of the document'),
+                                       'lang_descr'                            
        => lang('Description'),
+                                       'value_descr'                           
        => $values['descr'],
+                                       'lang_no_cat'                           
        => lang('Select category'),
+                                       'lang_cat_statustext'                   
=> lang('Select the category the document belongs to. To do not use a category 
select NO CATEGORY'),
+                                       'value_cat_id'                          
        => $values['doc_type'],
+                                       'cat_select'                            
        => $this->cats->formatted_xslt_list(array('select_name' => 
'values[doc_type]','selected' => $values['doc_type'])),
+                                       'lang_coordinator'                      
        => lang('Coordinator'),
+                                       'lang_user_statustext'                  
=> lang('Select the coordinator the document 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),
 
-                               'value_location_code'                           
=> $values['location_code'],
+                                       'status_list'                           
        => $this->bo->select_status_list('select',$values['status']),
+                                       'status_name'                           
        => 'values[status]',
+                                       'lang_no_status'                        
        => lang('Select status'),
+                                       'lang_status'                           
        => lang('Status'),
+                                       'lang_status_statustext'                
=> lang('What is the current status of this document ?'),
 
-                               'branch_list'                                   
=> $this->bo->select_branch_list($values['branch_id']),
-                               'lang_no_branch'                                
=> lang('No branch'),
-                               'lang_branch'                                   
=> lang('branch'),
-                               'lang_branch_statustext'                        
=> lang('Select the branch for this document')
-                       );
+                                       'value_location_code'                   
=> $values['location_code'],
+
+                                       'branch_list'                           
        => $this->bo->select_branch_list($values['branch_id']),
+                                       'lang_no_branch'                        
        => lang('No branch'),
+                                       'lang_branch'                           
        => lang('branch'),
+                                       'lang_branch_statustext'                
=> lang('Select the branch for this document')
+                               );
                        //----datatable 
settings------------------------------------
                        phpgwapi_yui::load_widget('dragdrop');
-                       phpgwapi_yui::load_widget('datatable');
-                       phpgwapi_yui::load_widget('menu');
-                       phpgwapi_yui::load_widget('connection');
-                       phpgwapi_yui::load_widget('loader');
+                       phpgwapi_yui::load_widget('datatable');
+                       phpgwapi_yui::load_widget('menu');
+                       phpgwapi_yui::load_widget('connection');
+                       phpgwapi_yui::load_widget('loader');
                        phpgwapi_yui::load_widget('tabview');
                        phpgwapi_yui::load_widget('paginator');
                        phpgwapi_yui::load_widget('animation');
 
                        $GLOBALS['phpgw']->css->validate_file('datatable');
-                       $GLOBALS['phpgw']->css->validate_file('property');
-                       
$GLOBALS['phpgw']->css->add_external_file('property/templates/base/css/property.css');
+                       $GLOBALS['phpgw']->css->validate_file('property');
+                       
$GLOBALS['phpgw']->css->add_external_file('property/templates/base/css/property.css');
                        
$GLOBALS['phpgw']->css->add_external_file('phpgwapi/js/yahoo/datatable/assets/skins/sam/datatable.css');
                        
$GLOBALS['phpgw']->css->add_external_file('phpgwapi/js/yahoo/paginator/assets/skins/sam/paginator.css');
                        
$GLOBALS['phpgw']->css->add_external_file('phpgwapi/js/yahoo/container/assets/skins/sam/container.css');
                        
@@ -1401,7 +1437,7 @@
 
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       //      $GLOBALS['phpgw']->xslttpl->pp();
                }
 
                function delete()
@@ -1417,11 +1453,11 @@
                        $confirm        = phpgw::get_var('confirm', 'bool', 
'POST');
 
                        $link_data = array
-                       (
-                               'menuaction'    => 
'property.uidocument.list_doc',
-                               'location_code' => $location_code,
-                               'p_num'         => $p_num
-                       );
+                               (
+                                       'menuaction'    => 
'property.uidocument.list_doc',
+                                       'location_code' => $location_code,
+                                       'p_num'         => $p_num
+                               );
 
                        if( phpgw::get_var('phpgw_return_as') == 'json' )
                        {
@@ -1432,22 +1468,22 @@
                        
$GLOBALS['phpgw']->xslttpl->add_file(array('app_delete'));
 
                        $data = array
-                       (
-                               'done_action'           => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
-                               'delete_action'         => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'property.uidocument.delete', 'document_id'=> $document_id, 'location_code'=> 
$location_code, 'p_num'=> $p_num)),
-                               'lang_confirm_msg'      => lang('do you really 
want to delete this entry'),
-                               'lang_yes'              => lang('yes'),
-                               'lang_yes_statustext'   => lang('Delete the 
entry'),
-                               'lang_no_statustext'    => lang('Back to the 
list'),
-                               'lang_no'               => lang('no')
-                       );
+                               (
+                                       'done_action'           => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
+                                       'delete_action'         => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'property.uidocument.delete', 'document_id'=> $document_id, 'location_code'=> 
$location_code, 'p_num'=> $p_num)),
+                                       'lang_confirm_msg'      => lang('do you 
really want to delete this entry'),
+                                       'lang_yes'              => lang('yes'),
+                                       'lang_yes_statustext'   => lang('Delete 
the entry'),
+                                       'lang_no_statustext'    => lang('Back 
to the list'),
+                                       'lang_no'               => lang('no')
+                               );
 
                        $appname        = lang('document');
                        $function_msg   = lang('delete document');
 
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('delete' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
+                       //      $GLOBALS['phpgw']->xslttpl->pp();
                }
 
                function view()
@@ -1473,120 +1509,120 @@
                        $record_history = 
$this->bo->read_record_history($document_id);
 
                        $table_header_history[] = array
-                       (
-                               'lang_date'             => lang('Date'),
-                               'lang_user'             => lang('User'),
-                               'lang_action'           => lang('Action'),
-                               'lang_new_value'        => lang('New value')
-                       );
+                               (
+                                       'lang_date'             => lang('Date'),
+                                       'lang_user'             => lang('User'),
+                                       'lang_action'           => 
lang('Action'),
+                                       'lang_new_value'        => lang('New 
value')
+                               );
 
                        if ($values['doc_type'])
                        {
                                $this->cat_id = $values['doc_type'];
                        }
 
-                       
$location_data=$this->bolocation->initiate_ui_location(array(
-                                               'values'        => 
$values['location_data'],
-                                               'type_id'       => 
count(explode('-',$values['location_data']['location_code'])),
-                                               'no_link'       => false, // 
disable lookup links for location type less than type_id
-                                               'tenant'        => false,
-                                               'lookup_type'   => 'view',
-                                               'lookup_entity' => 
$this->bocommon->get_lookup_entity('document'),
-                                               'entity_data'   => $values['p']
-                                               ));
+                       
$location_data=$this->bolocation->initiate_ui_location(array
+                               (
+                                       'values'        => 
$values['location_data'],
+                                       'type_id'       => 
count(explode('-',$values['location_data']['location_code'])),
+                                       'no_link'       => false, // disable 
lookup links for location type less than type_id
+                                       'tenant'        => false,
+                                       'lookup_type'   => 'view',
+                                       'lookup_entity' => 
$this->bocommon->get_lookup_entity('document'),
+                                       'entity_data'   => $values['p']
+                               ));
 
 
                        
$vendor_data=$this->bocommon->initiate_ui_vendorlookup(array(
-                                               'type'          => 'view',
-                                               'vendor_id'     => 
$values['vendor_id'],
-                                               'vendor_name'   => 
$values['vendor_name']));
+                               'type'          => 'view',
+                               'vendor_id'     => $values['vendor_id'],
+                               'vendor_name'   => $values['vendor_name']));
 
 
                        $link_data = array
-                       (
-                               'menuaction'    => 'property.uidocument.edit',
-                               'document_id'   => $document_id
-                       );
+                               (
+                                       'menuaction'    => 
'property.uidocument.edit',
+                                       'document_id'   => $document_id
+                               );
 
                        $categories = 
$this->cats->formatted_xslt_list(array('selected' => $values['doc_type']));
 
                        $data = array
-                       (
-                               'vendor_data'                                   
        => $vendor_data,
-                               'record_history'                                
        => $record_history,
-                               'table_header_history'                          
=> $table_header_history,
-                               'lang_history'                                  
=> lang('History'),
-                               'lang_no_history'                               
=> lang('No history'),
+                               (
+                                       'vendor_data'                           
                => $vendor_data,
+                                       'record_history'                        
                => $record_history,
+                                       'table_header_history'                  
        => $table_header_history,
+                                       'lang_history'                          
        => lang('History'),
+                                       'lang_no_history'                       
        => lang('No history'),
 
-                               'lang_document_date'                            
=> lang('document date'),
-                               'value_document_date'                           
=> $values['document_date'],
+                                       'lang_document_date'                    
        => lang('document date'),
+                                       'value_document_date'                   
        => $values['document_date'],
 
-                               'vendor_data'                                   
=> $vendor_data,
-                               '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.uidocument.' .$from, 'location_code'=> $values['location_code'], 
'entity_id'=> $values['p_entity_id'], 'cat_id'=> $values['p_cat_id'], 
'preserve'=> 1)),
-                               'lang_year'                                     
=> lang('Year'),
-                               'lang_category'                                 
=> lang('category'),
-                               'lang_save'                                     
=> lang('save'),
-                               'lang_done'                                     
=> lang('done'),
+                                       'vendor_data'                           
        => $vendor_data,
+                                       '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.uidocument.' .$from, 'location_code'=> $values['location_code'], 
'entity_id'=> $values['p_entity_id'], 'cat_id'=> $values['p_cat_id'], 
'preserve'=> 1)),
+                                       'lang_year'                             
        => lang('Year'),
+                                       'lang_category'                         
        => lang('category'),
+                                       'lang_save'                             
        => lang('save'),
+                                       'lang_done'                             
        => lang('done'),
 
-                               'lang_update_file'                              
=> lang('Update file'),
+                                       'lang_update_file'                      
        => lang('Update file'),
 
-                               'lang_document_id'                              
=> lang('document ID'),
-                               'value_document_id'                             
=> $document_id,
+                                       'lang_document_id'                      
        => lang('document ID'),
+                                       'value_document_id'                     
        => $document_id,
 
-                               'lang_document_name'                            
=> lang('document name'),
-                               'value_document_name'                           
=> $values['document_name'],
-                               'lang_document_name_statustext'                 
=> lang('Enter document Name'),
+                                       'lang_document_name'                    
        => lang('document name'),
+                                       'value_document_name'                   
        => $values['document_name'],
+                                       'lang_document_name_statustext'         
        => lang('Enter document Name'),
 
-                               'lang_floor_id'                                 
=> lang('Floor ID'),
-                               'value_floor_id'                                
=> $values['floor_id'],
-                               'lang_floor_statustext'                         
=> lang('Enter the floor ID'),
+                                       'lang_floor_id'                         
        => lang('Floor ID'),
+                                       'value_floor_id'                        
        => $values['floor_id'],
+                                       'lang_floor_statustext'                 
        => lang('Enter the floor ID'),
 
-                               'lang_title'                                    
=> lang('title'),
-                               'value_title'                                   
=> $values['title'],
-                               'lang_title_statustext'                         
=> lang('Enter document title'),
+                                       'lang_title'                            
        => lang('title'),
+                                       'value_title'                           
        => $values['title'],
+                                       'lang_title_statustext'                 
        => lang('Enter document title'),
 
-                               'lang_version'                                  
=> lang('Version'),
-                               'value_version'                                 
=> $values['version'],
-                               'lang_version_statustext'                       
=> lang('Enter document version'),
+                                       'lang_version'                          
        => lang('Version'),
+                                       'value_version'                         
        => $values['version'],
+                                       'lang_version_statustext'               
        => lang('Enter document version'),
 
-                               'lang_descr_statustext'                         
=> lang('Enter a description of the document'),
-                               'lang_descr'                                    
=> lang('Description'),
-                               'value_descr'                                   
=> $values['descr'],
-                               'lang_done_statustext'                          
=> lang('Back to the list'),
+                                       'lang_descr_statustext'                 
        => lang('Enter a description of the document'),
+                                       'lang_descr'                            
        => lang('Description'),
+                                       'value_descr'                           
        => $values['descr'],
+                                       'lang_done_statustext'                  
        => lang('Back to the list'),
 
-                               'cat_list'                                      
        => $categories['cat_list'],
+                                       'cat_list'                              
                => $categories['cat_list'],
 
-                               'lang_coordinator'                              
=> lang('Coordinator'),
-                               'lang_user_statustext'                          
=> lang('Select the coordinator the document 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('select',$values['coordinator'],$extra=false,$default=false,$start=-1,$sort='ASC',$order='account_lastname',$query='',$offset=-1),
+                                       'lang_coordinator'                      
        => lang('Coordinator'),
+                                       'lang_user_statustext'                  
        => lang('Select the coordinator the document 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('select',$values['coordinator'],$extra=false,$default=false,$start=-1,$sort='ASC',$order='account_lastname',$query='',$offset=-1),
 
-                               'status_list'                                   
=> $this->bo->select_status_list('select',$values['status']),
-                               'status_name'                                   
=> 'values[status]',
-                               'lang_no_status'                                
=> lang('Select status'),
-                               'lang_status'                                   
=> lang('Status'),
-                               'lang_status_statustext'                        
=> lang('What is the current status of this document ?'),
+                                       'status_list'                           
        => $this->bo->select_status_list('select',$values['status']),
+                                       'status_name'                           
        => 'values[status]',
+                                       'lang_no_status'                        
        => lang('Select status'),
+                                       'lang_status'                           
        => lang('Status'),
+                                       'lang_status_statustext'                
        => lang('What is the current status of this document ?'),
 
 
-                               'branch_list'                                   
=> $this->bo->select_branch_list($values['branch_id']),
-                               'lang_no_branch'                                
=> lang('No branch'),
-                               'lang_branch'                                   
=> lang('branch'),
-                               'lang_branch_statustext'                        
=> lang('Select the branch for this document'),
+                                       'branch_list'                           
        => $this->bo->select_branch_list($values['branch_id']),
+                                       'lang_no_branch'                        
        => lang('No branch'),
+                                       'lang_branch'                           
        => lang('branch'),
+                                       'lang_branch_statustext'                
        => lang('Select the branch for this document'),
 
-                               'edit_action'                                   
=> $GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'property.uidocument.edit', 'document_id'=> $document_id, 'from'=> $from)),
-                               'lang_edit_statustext'                          
=> lang('Edit this entry'),
-                               'lang_edit'                                     
=> lang('Edit')
-                       );
+                                       'edit_action'                           
        => $GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'property.uidocument.edit', 'document_id'=> $document_id, 'from'=> $from)),
+                                       'lang_edit_statustext'                  
        => lang('Edit this entry'),
+                                       'lang_edit'                             
        => lang('Edit')
+                               );
 
                        $appname = lang('document');
 
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('view' => $data));
-               //      $GLOBALS['phpgw']->xslttpl->pp();
                }
        }
 

Modified: trunk/property/inc/class.uientity.inc.php
===================================================================
--- trunk/property/inc/class.uientity.inc.php   2010-12-25 11:31:42 UTC (rev 
6703)
+++ trunk/property/inc/class.uientity.inc.php   2010-12-25 23:13:55 UTC (rev 
6704)
@@ -47,20 +47,20 @@
                var $currentapp;
 
                var $public_functions = array
-               (
-                       'columns'               => true,
-                       'download'              => true,
-                       'view'                  => true,
-                       'edit'                  => true,
-                       'delete'                => true,
-                       'view_file'             => true,
-                       'attrib_history'=> true,
-                       'attrib_help'   => true,
-                       'print_pdf'             => true,
-                       'index'         => true,
-                       'addfiles'              => true,
-                       'get_files'             => true
-               );
+                       (
+                               'columns'               => true,
+                               'download'              => true,
+                               'view'                  => true,
+                               'edit'                  => true,
+                               'delete'                => true,
+                               'view_file'             => true,
+                               'attrib_history'=> true,
+                               'attrib_help'   => true,
+                               'print_pdf'             => true,
+                               'index'         => true,
+                               'addfiles'              => true,
+                               'get_files'             => true
+                       );
 
                function property_uientity()
                {
@@ -93,7 +93,7 @@
                        $this->type                                     = 
$this->bo->type;
                        $this->type_app                         = 
$this->bo->type_app;
                        $this->acl                                      = & 
$GLOBALS['phpgw']->acl;
-                       
+
                        $this->acl_location                     = 
".{$this->type}.$this->entity_id";
                        if( $this->cat_id )
                        {
@@ -107,7 +107,7 @@
                        $GLOBALS['phpgw_info']['flags']['menu_selection'] = 
"{$this->type_app[$this->type]}::entity_{$this->entity_id}";
                        if($this->cat_id > 0)
                        {
-                                
$GLOBALS['phpgw_info']['flags']['menu_selection'] .= "::{$this->cat_id}";
+                               
$GLOBALS['phpgw_info']['flags']['menu_selection'] .= "::{$this->cat_id}";
                        }
                }
 
@@ -116,21 +116,21 @@
                function save_sessiondata()
                {
                        $data = array
-                       (
-                               'start'                         => $this->start,
-                               'query'                         => $this->query,
-                               'sort'                          => $this->sort,
-                               'order'                         => $this->order,
-                               'filter'                        => 
$this->filter,
-                               'cat_id'                        => 
$this->cat_id,
-                               'part_of_town_id'       => 
$this->part_of_town_id,
-                               'district_id'           => $this->district_id,
-                               'entity_id'                     => 
$this->entity_id,
-                               'status'                        => 
$this->status,
-                               'start_date'            => $this->start_date,
-                               'end_date'                      => 
$this->end_date,
-                               'criteria_id'           => $this->criteria_id
-                       );
+                               (
+                                       'start'                         => 
$this->start,
+                                       'query'                         => 
$this->query,
+                                       'sort'                          => 
$this->sort,
+                                       'order'                         => 
$this->order,
+                                       'filter'                        => 
$this->filter,
+                                       'cat_id'                        => 
$this->cat_id,
+                                       'part_of_town_id'       => 
$this->part_of_town_id,
+                                       'district_id'           => 
$this->district_id,
+                                       'entity_id'                     => 
$this->entity_id,
+                                       'status'                        => 
$this->status,
+                                       'start_date'            => 
$this->start_date,
+                                       'end_date'                      => 
$this->end_date,
+                                       'criteria_id'           => 
$this->criteria_id
+                               );
                        $this->bo->save_sessiondata($data);
                }
 
@@ -177,7 +177,7 @@
                        {
                                foreach ($_FILES as $fieldName => $file)
                                {
-                                   move_uploaded_file($file['tmp_name'], 
"{$GLOBALS['phpgw_info']['server']['temp_dir']}/" . 
strip_tags(basename($file['name'])));
+                                       move_uploaded_file($file['tmp_name'], 
"{$GLOBALS['phpgw_info']['server']['temp_dir']}/" . 
strip_tags(basename($file['name'])));
                                }
                                $GLOBALS['phpgw']->common->phpgw_exit();
                        }
@@ -196,28 +196,28 @@
                }
 
                function get_files()
-                       {
+               {
                        $id     = phpgw::get_var('id', 'int');
 
                        if( !$this->acl_read)
-                               {
+                       {
                                return;
-                               }
+                       }
 
                        $values = 
$this->bo->read_single(array('entity_id'=>$this->entity_id,'cat_id'=>$this->cat_id,'id'=>$id));
 
                        $link_file_data = array
-                       (
-                               'menuaction'    => 
'property.uientity.view_file',
-                               'loc1'                  => 
$values['location_data']['loc1'],
-                               'id'                    => $id,
-                               'cat_id'                => $this->cat_id,
-                               'entity_id'             => $this->entity_id,
-                               'type'                  => $this->type
-                       );
+                               (
+                                       'menuaction'    => 
'property.uientity.view_file',
+                                       'loc1'                  => 
$values['location_data']['loc1'],
+                                       'id'                    => $id,
+                                       'cat_id'                => 
$this->cat_id,
+                                       'entity_id'             => 
$this->entity_id,
+                                       'type'                  => $this->type
+                               );
 
                        if(isset($values['files']) && 
is_array($values['files']))
-                               {
+                       {
                                $j      = count($values['files']);
                                for ($i=0;$i<$j;$i++)
                                {
@@ -228,13 +228,13 @@
 
                        $content_files = array();
                        foreach($values['files'] as $_entry )
-                               {
+                       {
                                $content_files[] = array
                                        (
-                                       'file_name' => '<a 
href="'.$GLOBALS['phpgw']->link('/index.php',$link_file_data).'&amp;file_name='.$_entry['name'].'"
 target="_blank" title="'.lang('click to view 
file').'">'.$_entry['name'].'</a>',
-                                       'delete_file' => '<input 
type="checkbox" name="values[file_action][]" value="'.$_entry['name'].'" 
title="'.lang('Check to delete file').'">'
+                                               'file_name' => '<a 
href="'.$GLOBALS['phpgw']->link('/index.php',$link_file_data).'&amp;file_name='.$_entry['name'].'"
 target="_blank" title="'.lang('click to view 
file').'">'.$_entry['name'].'</a>',
+                                               'delete_file' => '<input 
type="checkbox" name="values[file_action][]" value="'.$_entry['name'].'" 
title="'.lang('Check to delete file').'">'
                                        );
-                               }
+                       }
 
                        if( phpgw::get_var('phpgw_return_as') == 'json' )
                        {
@@ -246,17 +246,17 @@
                                else
                                {
                                        return "";
+                               }
                        }
-                       }
                        return $content_files;
                }
 
 
                function columns()
                {
-               //cramirez: necesary for windows.open . Avoid error JS
-               phpgwapi_yui::load_widget('tabview');
-               $GLOBALS['phpgw']->xslttpl->add_file(array('columns'));
+                       //cramirez: necesary for windows.open . Avoid error JS
+                       phpgwapi_yui::load_widget('tabview');
+                       $GLOBALS['phpgw']->xslttpl->add_file(array('columns'));
 
                        $GLOBALS['phpgw_info']['flags']['noframework'] = true;
                        $GLOBALS['phpgw_info']['flags']['nofooter'] = true;
@@ -281,26 +281,26 @@
                        $function_msg   = lang('Select Column');
 
                        $link_data = array
-                       (
-                               'menuaction'    => 'property.uientity.columns',
-                               'entity_id'             => $this->entity_id,
-                               'cat_id'                => $this->cat_id,
-                               'type'                  => $this->type
-                       );
+                               (
+                                       'menuaction'    => 
'property.uientity.columns',
+                                       'entity_id'             => 
$this->entity_id,
+                                       'cat_id'                => 
$this->cat_id,
+                                       'type'                  => $this->type
+                               );
 
 
                        $msgbox_data = $this->bocommon->msgbox_data($receipt);
 
                        $data = array
-                       (
-                               'msgbox_data'           => 
$GLOBALS['phpgw']->common->msgbox($msgbox_data),
-                               'column_list'           => 
$this->bo->column_list($values['columns'],$entity_id=$this->entity_id,$cat_id=$this->cat_id,$allrows=true),
-                               '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'),
-                       );
+                               (
+                                       'msgbox_data'           => 
$GLOBALS['phpgw']->common->msgbox($msgbox_data),
+                                       'column_list'           => 
$this->bo->column_list($values['columns'],$entity_id=$this->entity_id,$cat_id=$this->cat_id,$allrows=true),
+                                       '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'),
+                               );
 
                        $GLOBALS['phpgw_info']['flags']['app_header'] = 
$function_msg;
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('columns' => $data));
@@ -331,17 +331,17 @@
                        //redirect. If selected the title of module.
                        if($this->entity_id == 1 && !$this->cat_id)
                        {
-                                 
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uientity.index', 'entity_id'=>1, 'cat_id'=> 1, 'type' => 
$this->type));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uientity.index', 'entity_id'=>1, 'cat_id'=> 1, 'type' => 
$this->type));
                        }
                        elseif($this->entity_id == 2 && !$this->cat_id)
                        {
-                                 
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uientity.index', 'entity_id'=>2, 'cat_id'=> 1, 'type' => 
$this->type));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uientity.index', 'entity_id'=>2, 'cat_id'=> 1, 'type' => 
$this->type));
                        }
 
                        //redirect if no rights
                        if(!$this->acl_read && $this->cat_id)
                        {
-                                 
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>1, 'acl_location'=> $this->acl_location));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>1, 'acl_location'=> $this->acl_location));
                        }
 
                        $start_date     = urldecode($this->start_date);
@@ -371,28 +371,28 @@
                                $datatable['menu']                              
                =       $this->bocommon->get_menu($this->type_app[$this->type]);
 
                                $datatable['config']['base_url']        = 
$GLOBALS['phpgw']->link('/index.php', array
-                                                                               
                                (
-                                                                               
                                                'menuaction'                    
=> 'property.uientity.index',
-                                                                               
                                                'entity_id'                     
=> $this->entity_id,
-                                                                               
                                                'cat_id'                => 
$this->cat_id,
-                                                                               
                                                'type'                          
        => $this->type,
-                                                                               
                //                              'district_id'           => 
$this->district_id,
-                                                                               
                //                              'status'                        
=> $this->status,
-                                                                               
                //                              'filter'                        
=> $this->filter,
-//                                                                             
                                                'location_code'                 
=> $this->location_code,
-                                                                               
                //                              'criteria_id'                   
=> $this->criteria_id
-                                                                               
                    ));
+                                       (
+                                               'menuaction'                    
=> 'property.uientity.index',
+                                               'entity_id'                     
=> $this->entity_id,
+                                               'cat_id'                => 
$this->cat_id,
+                                               'type'                          
        => $this->type,
+                                               //                              
'district_id'           => $this->district_id,
+                                               //                              
'status'                        => $this->status,
+                                               //                              
'filter'                        => $this->filter,
+                                               //                              
                                                                                
                'location_code'                 => $this->location_code,
+                                               //                              
'criteria_id'                   => $this->criteria_id
+                                       ));
                                $datatable['config']['allow_allrows'] = true;
 
                                $datatable['config']['base_java_url']   =       
"menuaction:'property.uientity.index',".
-                                                                               
                                        "entity_id:'{$this->entity_id}',".
-                                                                               
                                        "cat_id:'{$this->cat_id}',".
-                                                                               
                                        "type:'{$this->type}'";
-                                                                               
                        //              "district_id:'{$this->district_id}',".
-                                                                               
                        //              "status:'{$this->status}',".
-                                                                               
                        //              "filter:'{$this->filter}',".
-                                                                              
//               "criteria_id:'{$this->criteria_id}',".
-                                                                               
                        //              
"location_code:'{$this->location_code}'";
+                                       "entity_id:'{$this->entity_id}',".
+                                       "cat_id:'{$this->cat_id}',".
+                                       "type:'{$this->type}'";
+                               //              
"district_id:'{$this->district_id}',".
+                               //              "status:'{$this->status}',".
+                               //              "filter:'{$this->filter}',".
+                               //              
"criteria_id:'{$this->criteria_id}',".
+                               //              
"location_code:'{$this->location_code}'";
 
                                // this array "$arr_filter_hide" indicate what 
filters are hidden or not
                                $arr_filter_hide = array();
@@ -409,7 +409,7 @@
                                {
                                        $arr_filter_hide[0] = 1;
                                }
-*/
+ */
                                //// ---- DISTRICT filter----------------------
                                if($this->cat_id)
                                {
@@ -468,164 +468,191 @@
                                $default_value = array 
('id'=>'','name'=>lang('no criteria'));
                                array_unshift 
($values_combo_box[4],$default_value);
 
-                               $datatable['actions']['form'] = array(
-                               array(
-                                               'action'  => 
$GLOBALS['phpgw']->link('/index.php',
-                                                                               
array(
-                                                                               
                'menuaction'    => 'property.uientity.index',
-                                                                               
                'entity_id'             => $this->entity_id,
-                                                                               
                'cat_id'                => $this->cat_id,
-//                                                                             
                'district_id'   => $this->district_id,
-//                                                                             
                'status'                => $this->status,
-//                                                                             
                'filter'                => $this->filter,
-//                                                                             
                'query'                 => $this->query,
-                                                                               
                'type'                  => $this->type
-                                                                               
          )),
-                                               'fields'  => array(
-                                                         'field' => array(
-                                                                               
/*              array( //boton  CATEGORY
+                               $datatable['actions']['form'] = array
+                                       (
+                                               array
+                                               (
+                                                       'action'  => 
$GLOBALS['phpgw']->link('/index.php',
+                                                       array
+                                                       (
+                                                               'menuaction'    
=> 'property.uientity.index',
+                                                               'entity_id'     
        => $this->entity_id,
+                                                               'cat_id'        
        => $this->cat_id,
+                                                               //              
                                                                                
'district_id'   => $this->district_id,
+                                                               //              
                                                                                
'status'                => $this->status,
+                                                               //              
                                                                                
'filter'                => $this->filter,
+                                                               //              
                                                                                
'query'                 => $this->query,
+                                                               'type'          
        => $this->type
+                                                       )),
+                                                       'fields'  => array
+                                                       (
+                                                               'field' => array
+                                                               (
+                                                       /*              array
+                                                                       ( 
//boton       CATEGORY
                                                                                
                        'id'   => 'btn_cat_id',
                                                                                
                        'name' => 'cat_id',
                                                                                
                        'value'=> lang('Category'),
                                                                                
                        'type' => 'button',
                                                                                
                        'style' => 'filter',
                                                                                
                        'tab_index' => 1
-                                                                               
                ),*/
-                                                                               
                array( //boton  DISTINT
-                                                                               
                        'id'   => 'btn_district_id',
-                                                                               
                        'name' => 'district_id',
-                                                                               
                        'value'=> lang('District'),
-                                                                               
                        'type' => 'button',
-                                                                               
                        'style' => 'filter',
-                                                                               
                        'tab_index' => 2
-                                                                               
                ),
-                                                                               
                array( //boton  STATUS
-                                                                               
                        'id'   => 'btn_status_id',
-                                                                               
                        'name' => 'status_id',
-                                                                               
                        'value'=> lang('Status'),
-                                                                               
                        'type' => 'button',
-                                                                               
                        'style' => 'filter',
-                                                                               
                        'tab_index' => 3
-                                                                               
                ),
-                                                                               
                array( //boton  USER
-                                                                               
                        'id'   => 'btn_user_id',
-                                                                               
                        'name' => 'user_id',
-                                                                               
                        'value'=> lang('User'),
-                                                                               
                        'type' => 'button',
-                                                                               
                        'style' => 'filter',
-                                                                               
                        'tab_index' => 4
-                                                                               
                ),
-                                                                               
                array( //boton  search criteria
-                                                                               
                        'id' => 'btn_criteria_id',
-                                                                               
                        'name' => 'criteria_id',
-                                                                               
                        'value' => lang('search criteria'),
-                                                                               
                        'type' => 'button',
-                                                                               
                        'style' => 'filter',
-                                                                               
                        'tab_index' => 5
-                                                                               
                ),
-                                                                               
                array(//for link "columns", next to Export button
-                                                                               
                        'type'=> 'link',
-                                                                               
                        'id'  => 'btn_columns',
-                                                                               
                        'url' => 
"Javascript:window.open('".$GLOBALS['phpgw']->link('/index.php',
-                                                                               
                                   array(
-                                                                               
                                                'menuaction'    => 
'property.uientity.columns',
-                                                                               
                                                'entity_id'             => 
$this->entity_id,
-                                                                               
                                                'cat_id'                => 
$this->cat_id,
-                                                                               
                                                'type'                  => 
$this->type
-                                                                               
                                          
))."','link','width=300,height=600,scrollbars=1')",
-                                                                               
                         'value' => lang('columns'),
-                                                                               
                         'tab_index' => 11
-                                                                               
                ),
-                                                                               
                array(
-                                                                               
                        'type' => 'button',
-                                                                               
                        'id'   => 'btn_export',
-                                                                               
                        'value'=> lang('download'),
-                                                                               
                        'tab_index' => 10
-                                                                               
                        ),
-                                                                               
                array(
-                                                                               
                        'type' => 'button',
-                                                                               
                        'id'   => 'btn_new',
-                                                                               
                        'value'=> lang('add'),
-                                                                               
                        'tab_index' => 9
-                                                                               
                        ),
-                                                                               
                array( //boton   SEARCH
-                                                                               
                        'id'   => 'btn_search',
-                                                                               
                        'name' => 'search',
-                                                                               
                        'value'=> lang('search'),
-                                                                               
                        'type' => 'button',
-                                                                               
                        'tab_index' => 8
-                                                                               
                ),
-                                                                               
                array( // TEXT IMPUT
-                                                                               
                        'name' => 'query',
-                                                                               
                        'id'   => 'txt_query',
-                                                                               
                        'value'=> $this->query,
-                                                                               
                        'type' => 'text',
-                                                                               
                        'size' => 28,
-                                                                               
                        'onkeypress' => 'return pulsar(event)',
-                                                                               
                        'tab_index' => 7
-                                                                               
                ),
-                                                                               
                 array(//for link "None",
-                                                                               
                  'type'=> 'label_date'
-                                                                               
                 ),
-                                                                               
                 array( //hidden end_date
-                                                                               
                        'type'  => 'hidden',
-                                                                               
                        'id'    => 'end_date',
-                                                                               
                        'name'  => 'end_date',
-                                                                               
                        'value' => $end_date
-                                                                               
                 ),
-                                                                               
                array( //hidden start_date
-                                                                               
                        'type'  => 'hidden',
-                                                                               
                        'id'    => 'start_date',
-                                                                               
                        'name'  => 'start_date',
-                                                                               
                        'value' => $start_date
-                                                                               
                 ),
-                                                                               
                array(//for link "Date search",
-                                                                               
                        'type'=> 'link',
-                                                                               
                        'id'  => 'btn_data_search',
-                                                                               
                        'url' => 
"Javascript:window.open('".$GLOBALS['phpgw']->link('/index.php',
-                                                                               
                                   array(
-                                                                               
                                                        'menuaction' => 
'property.uiproject.date_search'))."','link','width=350,height=250')",
-                                                                               
                         'value' => lang('Date search'),
-                                                                               
                         'tab_index' => 6
-                                                                               
                 )),
-                                                               'hidden_value' 
=> array(
-                                                                               
                        array(
-                                                                               
                                'id'   => 'values_combo_box_0',
-                                                                               
                                'value'=> 
$this->bocommon->select2String($values_combo_box[0])
-                                                                               
                                  ),
-                                                                               
                        array(
-                                                                               
                                'id'    => 'values_combo_box_1',
-                                                                               
                                'value' => 
$this->bocommon->select2String($values_combo_box[1])
-                                                                               
                                  ),
-                                                                               
                         array(
-                                                                               
                                'id' => 'values_combo_box_2',
-                                                                               
                                'value' => 
$this->bocommon->select2String($values_combo_box[2])
-                                                                               
                                  ),
-                                                                               
                         array(
-                                                                               
                                'id' => 'values_combo_box_3',
-                                                                               
                                'value' => 
$this->bocommon->select2String($values_combo_box[3])
-                                                                               
                                  ),
-                                                                               
                        array(
-                                                                               
                                'id' => 'values_combo_box_4',
-                                                                               
                                'value' => 
$this->bocommon->select2String($values_combo_box[4])
-                                                                               
                                )
-                                                                               
                          )
-                                                )));
+                                                                               
),*/
+                                                                       array
+                                                                       ( 
//boton       DISTINT
+                                                                               
'id'   => 'btn_district_id',
+                                                                               
'name' => 'district_id',
+                                                                               
'value'=> lang('District'),
+                                                                               
'type' => 'button',
+                                                                               
'style' => 'filter',
+                                                                               
'tab_index' => 2
+                                                                       ),
+                                                                       array
+                                                                       ( 
//boton       STATUS
+                                                                               
'id'   => 'btn_status_id',
+                                                                               
'name' => 'status_id',
+                                                                               
'value'=> lang('Status'),
+                                                                               
'type' => 'button',
+                                                                               
'style' => 'filter',
+                                                                               
'tab_index' => 3
+                                                                       ),
+                                                                       array
+                                                                       ( 
//boton       USER
+                                                                               
'id'   => 'btn_user_id',
+                                                                               
'name' => 'user_id',
+                                                                               
'value'=> lang('User'),
+                                                                               
'type' => 'button',
+                                                                               
'style' => 'filter',
+                                                                               
'tab_index' => 4
+                                                                       ),
+                                                                       array
+                                                                       ( 
//boton       search criteria
+                                                                               
'id' => 'btn_criteria_id',
+                                                                               
'name' => 'criteria_id',
+                                                                               
'value' => lang('search criteria'),
+                                                                               
'type' => 'button',
+                                                                               
'style' => 'filter',
+                                                                               
'tab_index' => 5
+                                                                       ),
+                                                                       array
+                                                                       (//for 
link "columns", next to Export button
+                                                                               
'type'=> 'link',
+                                                                               
'id'  => 'btn_columns',
+                                                                               
'url' => "Javascript:window.open('".$GLOBALS['phpgw']->link('/index.php',
+                                                                               
array
+                                                                               
(
+                                                                               
        'menuaction'    => 'property.uientity.columns',
+                                                                               
        'entity_id'             => $this->entity_id,
+                                                                               
        'cat_id'                => $this->cat_id,
+                                                                               
        'type'                  => $this->type
+                                                                               
))."','link','width=300,height=600,scrollbars=1')",
+                                                                               
'value' => lang('columns'),
+                                                                               
'tab_index' => 11
+                                                                       ),
+                                                                       array
+                                                                       (
+                                                                               
'type' => 'button',
+                                                                               
'id'   => 'btn_export',
+                                                                               
'value'=> lang('download'),
+                                                                               
'tab_index' => 10
+                                                                       ),
+                                                                       array
+                                                                       (
+                                                                               
'type' => 'button',
+                                                                               
'id'   => 'btn_new',
+                                                                               
'value'=> lang('add'),
+                                                                               
'tab_index' => 9
+                                                                       ),
+                                                                       array
+                                                                       ( 
//boton        SEARCH
+                                                                               
'id'   => 'btn_search',
+                                                                               
'name' => 'search',
+                                                                               
'value'=> lang('search'),
+                                                                               
'type' => 'button',
+                                                                               
'tab_index' => 8
+                                                                       ),
+                                                                       array
+                                                                       ( // 
TEXT IMPUT
+                                                                               
'name' => 'query',
+                                                                               
'id'   => 'txt_query',
+                                                                               
'value'=> $this->query,
+                                                                               
'type' => 'text',
+                                                                               
'size' => 28,
+                                                                               
'onkeypress' => 'return pulsar(event)',
+                                                                               
'tab_index' => 7
+                                                                       ),
+                                                                       array
+                                                                       (//for 
link "None",
+                                                                               
'type'=> 'label_date'
+                                                                       ),
+                                                                       array
+                                                                       ( 
//hidden end_date
+                                                                               
'type'  => 'hidden',
+                                                                               
'id'    => 'end_date',
+                                                                               
'name'  => 'end_date',
+                                                                               
'value' => $end_date
+                                                                       ),
+                                                                       array
+                                                                       ( 
//hidden start_date
+                                                                               
'type'  => 'hidden',
+                                                                               
'id'    => 'start_date',
+                                                                               
'name'  => 'start_date',
+                                                                               
'value' => $start_date
+                                                                       ),
+                                                                       array
+                                                                       (//for 
link "Date search",
+                                                                               
'type'=> 'link',
+                                                                               
'id'  => 'btn_data_search',
+                                                                               
'url' => "Javascript:window.open('".$GLOBALS['phpgw']->link('/index.php',
+                                                                               
array
+                                                                               
(
+                                                                               
        'menuaction' => 
'property.uiproject.date_search'))."','link','width=350,height=250')",
+                                                                               
        'value' => lang('Date search'),
+                                                                               
        'tab_index' => 6
+                                                                               
)),
+                                                               'hidden_value' 
=> array
+                                                               (
+                                                                       array
+                                                                       (
+                                                                               
'id'   => 'values_combo_box_0',
+                                                                               
'value'=> $this->bocommon->select2String($values_combo_box[0])
+                                                                       ),
+                                                                       array
+                                                                       (
+                                                                               
'id'    => 'values_combo_box_1',
+                                                                               
'value' => $this->bocommon->select2String($values_combo_box[1])
+                                                                       ),
+                                                                       array
+                                                                       (
+                                                                               
'id' => 'values_combo_box_2',
+                                                                               
'value' => $this->bocommon->select2String($values_combo_box[2])
+                                                                       ),
+                                                                       array
+                                                                       (
+                                                                               
'id' => 'values_combo_box_3',
+                                                                               
'value' => $this->bocommon->select2String($values_combo_box[3])
+                                                                       ),
+                                                                       array
+                                                                       (
+                                                                               
'id' => 'values_combo_box_4',
+                                                                               
'value' => $this->bocommon->select2String($values_combo_box[4])
+                                                                       )
+                                                               )
+                                                       )));
 
-                                       //      eliminates those empty filters
-                                       $eliminate = 0;
-                                       foreach( $arr_filter_hide as $key => 
$value )
+                               //      eliminates those empty filters
+                               $eliminate = 0;
+                               foreach( $arr_filter_hide as $key => $value )
+                               {
+                                       if ($value)
                                        {
-                                               if ($value)
-                                               {
-                                                       //eliminates the 
respective entry in $datatable..['field']
-                                                       
array_splice($datatable['actions']['form'][0]['fields']['field'],$eliminate, 1);
-                                               }
-                                               else
-                                               {
-                                                       $eliminate++;
-                                               }
+                                               //eliminates the respective 
entry in $datatable..['field']
+                                               
array_splice($datatable['actions']['form'][0]['fields']['field'],$eliminate, 1);
                                        }
+                                       else
+                                       {
+                                               $eliminate++;
+                                       }
+                               }
 
                                // sets for initial ordering
                                $this->sort = "ASC";
@@ -656,15 +683,15 @@
                                                                
$datatable['rows']['row'][$j]['column'][$i]['value']                    = 
$entity_entry[$uicols['name'][$i]];
                                                                
$datatable['rows']['row'][$j]['column'][$i]['format']                   = 
'link';
                                                                
$datatable['rows']['row'][$j]['column'][$i]['java_link']                = true;
-                                                               
$datatable['rows']['row'][$j]['column'][$i]['link']                     = 
$entity_entry['query_location'][$uicols['name'][$i]];
+                                                               
$datatable['rows']['row'][$j]['column'][$i]['link']                             
= $entity_entry['query_location'][$uicols['name'][$i]];
                                                        }
                                                        else
                                                        {
                                                                
$datatable['rows']['row'][$j]['column'][$i]['value']                    = 
$entity_entry[$uicols['name'][$i]];
                                                                
//$datatable['rows']['row'][$j]['column'][$i]['value']                  = $i;
                                                                
$datatable['rows']['row'][$j]['column'][$i]['name']                     = 
$uicols['name'][$i];
-                                                               
//$datatable['rows']['row'][$j]['column'][$i]['lookup']                         
= $lookup;
-                                                               
$datatable['rows']['row'][$j]['column'][$i]['align']                    = 
(isset($uicols['align'][$i])?$uicols['align'][$i]:'center');
+                                                               
//$datatable['rows']['row'][$j]['column'][$i]['lookup']                 = 
$lookup;
+                                                               
$datatable['rows']['row'][$j]['column'][$i]['align']                    = 
isset($uicols['align'][$i])?$uicols['align'][$i]:'center';
 
                                                                
if(isset($uicols['datatype']) && isset($uicols['datatype'][$i]) && 
$uicols['datatype'][$i]=='link' && $entity_entry[$uicols['name'][$i]])
                                                                {
@@ -690,119 +717,126 @@
 
                        //indica que de la fila seleccionada escogera de la 
columna "id" el valor "id". Para agregarlo al URL
                        $parameters = array
-                       (
-                               'parameter' => array
                                (
+                                       'parameter' => array
+                                       (
                                                array
                                                (
-                                                               'name'          
=> 'id',
-                                                               'source'        
=> 'id'
+                                                       'name'          => 'id',
+                                                       'source'        => 'id'
                                                ),
-                               )
-                       );
+                                       )
+                               );
 
                        if($this->acl_read)
                        {
-                               $datatable['rowactions']['action'][] = array(
+                               $datatable['rowactions']['action'][] = array
+                                       (
                                                'my_name'               => 
'view',
                                                'text'                  => 
lang('view'),
                                                'action'                => 
$GLOBALS['phpgw']->link('/index.php',array
-                                                                               
                                (
-                                                                               
                                                'menuaction'    => 
'property.uientity.view',
-                                                                               
                                                'entity_id'             => 
$this->entity_id,
-                                                                               
                                                'cat_id'                => 
$this->cat_id,
-                                                                               
                                                'type'                  => 
$this->type
-                                                                               
                                )),
+                                               (
+                                                       'menuaction'    => 
'property.uientity.view',
+                                                       'entity_id'             
=> $this->entity_id,
+                                                       'cat_id'                
=> $this->cat_id,
+                                                       'type'                  
=> $this->type
+                                               )),
                                                'parameters'                    
=> $parameters
-                               );
-                               $datatable['rowactions']['action'][] = array(
+                                       );
+                               $datatable['rowactions']['action'][] = array
+                                       (
                                                'my_name'               => 
'view',
                                                'text'                  => 
lang('open view in new window'),
                                                'action'                => 
$GLOBALS['phpgw']->link('/index.php',array
-                                                                               
                                (
-                                                                               
                                                'menuaction'    => 
'property.uientity.view',
-                                                                               
                                                'entity_id'             => 
$this->entity_id,
-                                                                               
                                                'cat_id'                => 
$this->cat_id,
-                                                                               
                                                'type'                  => 
$this->type,
-                                                                               
                                                'target'                => 
'_blank'
-                                                                               
                                )),
+                                               (
+                                                       'menuaction'    => 
'property.uientity.view',
+                                                       'entity_id'             
=> $this->entity_id,
+                                                       'cat_id'                
=> $this->cat_id,
+                                                       'type'                  
=> $this->type,
+                                                       'target'                
=> '_blank'
+                                               )),
                                                'parameters'                    
=> $parameters
-                               );
+                                       );
                        }
                        if($this->acl_edit)
                        {
-                               $datatable['rowactions']['action'][] = array(
+                               $datatable['rowactions']['action'][] = array
+                                       (
                                                'my_name'               => 
'edit',
                                                'text'                  => 
lang('edit'),
                                                'action'                => 
$GLOBALS['phpgw']->link('/index.php',array
-                                                                               
                                (
-                                                                               
                                                'menuaction'    => 
'property.uientity.edit',
-                                                                               
                                                'entity_id'             => 
$this->entity_id,
-                                                                               
                                                'cat_id'                => 
$this->cat_id,
-                                                                               
                                                'type'                  => 
$this->type
-                                                                               
                                )),
+                                               (
+                                                       'menuaction'    => 
'property.uientity.edit',
+                                                       'entity_id'             
=> $this->entity_id,
+                                                       'cat_id'                
=> $this->cat_id,
+                                                       'type'                  
=> $this->type
+                                               )),
                                                'parameters'                    
=> $parameters
-                               );
-                               $datatable['rowactions']['action'][] = array(
+                                       );
+                               $datatable['rowactions']['action'][] = array
+                                       (
                                                'my_name'               => 
'edit',
                                                'text'                  => 
lang('open edit in new window'),
                                                'action'                => 
$GLOBALS['phpgw']->link('/index.php',array
-                                                                               
                                (
-                                                                               
                                                'menuaction'    => 
'property.uientity.edit',
-                                                                               
                                                'entity_id'             => 
$this->entity_id,
-                                                                               
                                                'cat_id'                => 
$this->cat_id,
-                                                                               
                                                'type'                  => 
$this->type,
-                                                                               
                                                'target'                => 
'_blank'
-                                                                               
                                )),
+                                               (
+                                                       'menuaction'    => 
'property.uientity.edit',
+                                                       'entity_id'             
=> $this->entity_id,
+                                                       'cat_id'                
=> $this->cat_id,
+                                                       'type'                  
=> $this->type,
+                                                       'target'                
=> '_blank'
+                                               )),
                                                'parameters'                    
=> $parameters
-                               );
+                                       );
                        }
                        $jasper = execMethod('property.sojasper.read', 
array('location_id' => 
$GLOBALS['phpgw']->locations->get_id($this->type_app[$this->type], 
$this->acl_location)));
 
                        foreach ($jasper as $report)
                        {
-                               $datatable['rowactions']['action'][] = array(
+                               $datatable['rowactions']['action'][] = array
+                                       (
                                                'my_name'               => 
'edit',
                                                'text'                  => 
lang('open JasperReport %1 in new window', $report['title']),
                                                'action'                => 
$GLOBALS['phpgw']->link('/index.php',array
-                                                                               
                                (
-                                                                               
                                                'menuaction'    => 
'property.uijasper.view',
-                                                                               
                                                'jasper_id'                     
=> $report['id'],
-                                                                               
                                                'target'                => 
'_blank'
-                                                                               
                                )),
+                                               (
+                                                       'menuaction'    => 
'property.uijasper.view',
+                                                       'jasper_id'             
        => $report['id'],
+                                                       'target'                
=> '_blank'
+                                               )),
                                                'parameters'                    
=> $parameters
-                               );
+                                       );
                        }
 
                        if($this->acl_delete)
                        {
-                               $datatable['rowactions']['action'][] = array(
+                               $datatable['rowactions']['action'][] = array
+                                       (
                                                '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.uientity.delete',
-                                                                               
                                                'entity_id'             => 
$this->entity_id,
-                                                                               
                                                'cat_id'                => 
$this->cat_id,
-                                                                               
                                                'type'                  => 
$this->type
-                                                                               
                                )),
+                                               (
+                                                       'menuaction'    => 
'property.uientity.delete',
+                                                       'entity_id'             
=> $this->entity_id,
+                                                       'cat_id'                
=> $this->cat_id,
+                                                       'type'                  
=> $this->type
+                                               )),
                                                'parameters'    => $parameters
-                               );
+                                       );
                        }
                        if($this->acl_add)
                        {
-                               $datatable['rowactions']['action'][] = array(
+                               $datatable['rowactions']['action'][] = array
+                                       (
                                                'my_name'               => 
'add',
                                                'text'                  => 
lang('add'),
                                                'action'                => 
$GLOBALS['phpgw']->link('/index.php',array
-                                                                               
                                (
-                                                                               
                                                'menuaction'    => 
'property.uientity.edit',
-                                                                               
                                                'entity_id'             => 
$this->entity_id,
-                                                                               
                                                'cat_id'                => 
$this->cat_id,
-                                                                               
                                                'type'                  => 
$this->type
-                                                                               
                                ))
-                               );
+                                               (
+                                                       'menuaction'    => 
'property.uientity.edit',
+                                                       'entity_id'             
=> $this->entity_id,
+                                                       'cat_id'                
=> $this->cat_id,
+                                                       'type'                  
=> $this->type
+                                               ))
+                                       );
                        }
 
                        unset($parameters);
@@ -818,34 +852,34 @@
 
                                if($uicols['input_type'][$i]!='hidden')
                                {
-                                               
$datatable['headers']['header'][$i]['name']                     = 
$uicols['name'][$i];
-                                               
$datatable['headers']['header'][$i]['text']                     = 
$uicols['descr'][$i];
-                                               
$datatable['headers']['header'][$i]['visible']                  = true;
-                                               
$datatable['headers']['header'][$i]['format']                   = 
$this->bocommon->translate_datatype_format($uicols['datatype'][$i]);
-                                               
$datatable['headers']['header'][$i]['sortable']                 = false;
-                                               
//$datatable['headers']['header'][$i]['formatter']              = 
$uicols['formatter'][$i];
-                                               //according to stable bruch 
this columns is not SORTABLE'
-                                               $denied = 
array('merknad');//$denied = array('merknad','account_lid');
-                                               //if not include
-                                               if(!in_array 
($uicols['name'][$i], $denied))
-                                               {
-                                                               
$datatable['headers']['header'][$i]['sortable']         = true;
-                                                               
$datatable['headers']['header'][$i]['sort_field']       = $uicols['name'][$i];
-                                               }
-                                               else 
if(isset($uicols['cols_return_extra'][$i]) && 
($uicols['cols_return_extra'][$i]!='T' || 
$uicols['cols_return_extra'][$i]!='CH'))
-                                               {
-                                                               
$datatable['headers']['header'][$i]['sortable']         = true;
-                                                               
$datatable['headers']['header'][$i]['sort_field']       = $uicols['name'][$i];
-                                               }
+                                       
$datatable['headers']['header'][$i]['name']                     = 
$uicols['name'][$i];
+                                       
$datatable['headers']['header'][$i]['text']                     = 
$uicols['descr'][$i];
+                                       
$datatable['headers']['header'][$i]['visible']                  = true;
+                                       
$datatable['headers']['header'][$i]['format']                   = 
$this->bocommon->translate_datatype_format($uicols['datatype'][$i]);
+                                       
$datatable['headers']['header'][$i]['sortable']                 = false;
+                                       
//$datatable['headers']['header'][$i]['formatter']              = 
$uicols['formatter'][$i];
+                                       //according to stable bruch this 
columns is not SORTABLE'
+                                       $denied = array('merknad');//$denied = 
array('merknad','account_lid');
+                                       //if not include
+                                       if(!in_array ($uicols['name'][$i], 
$denied))
+                                       {
+                                               
$datatable['headers']['header'][$i]['sortable']         = true;
+                                               
$datatable['headers']['header'][$i]['sort_field']       = $uicols['name'][$i];
+                                       }
+                                       else 
if(isset($uicols['cols_return_extra'][$i]) && 
($uicols['cols_return_extra'][$i]!='T' || 
$uicols['cols_return_extra'][$i]!='CH'))
+                                       {
+                                               
$datatable['headers']['header'][$i]['sortable']         = true;
+                                               
$datatable['headers']['header'][$i]['sort_field']       = $uicols['name'][$i];
+                                       }
 
                                }
                                else
                                {
-                                               
$datatable['headers']['header'][$i]['name']                     = 
$uicols['name'][$i];
-                                               
$datatable['headers']['header'][$i]['text']                     = 
$uicols['descr'][$i];
-                                               
$datatable['headers']['header'][$i]['visible']                  = false;
-                                               
$datatable['headers']['header'][$i]['sortable']          = false;
-                                               
$datatable['headers']['header'][$i]['format']                   = 'hidden';
+                                       
$datatable['headers']['header'][$i]['name']                     = 
$uicols['name'][$i];
+                                       
$datatable['headers']['header'][$i]['text']                     = 
$uicols['descr'][$i];
+                                       
$datatable['headers']['header'][$i]['visible']                  = false;
+                                       
$datatable['headers']['header'][$i]['sortable']          = false;
+                                       
$datatable['headers']['header'][$i]['format']                   = 'hidden';
                                }
                        }
 
@@ -858,7 +892,7 @@
 
                        if($dry_run)
                        {
-                                       
$datatable['pagination']['records_returned'] = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'];           
         
+                               $datatable['pagination']['records_returned'] = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'];           
         
                        }
                        else
                        {
@@ -882,18 +916,18 @@
                        }
 
 
-//-BEGIN----------------------------- JSON CODE ------------------------------
+                       //-BEGIN----------------------------- JSON CODE 
------------------------------
 
                        //values for Pagination
                        $json = array
-                       (
-                               'recordsReturned'       => 
$datatable['pagination']['records_returned'],
-                               'totalRecords'          => 
(int)$datatable['pagination']['records_total'],
-                               'startIndex'            => 
$datatable['pagination']['records_start'],
-                               'sort'                          => 
$datatable['sorting']['order'],
-                               'dir'                           => 
$datatable['sorting']['sort'],
-                               'records'                       => array()
-                       );
+                               (
+                                       'recordsReturned'       => 
$datatable['pagination']['records_returned'],
+                                       'totalRecords'          => 
(int)$datatable['pagination']['records_total'],
+                                       'startIndex'            => 
$datatable['pagination']['records_start'],
+                                       'sort'                          => 
$datatable['sorting']['order'],
+                                       'dir'                           => 
$datatable['sorting']['sort'],
+                                       'records'                       => 
array()
+                               );
 
                        // values for datatable
                        if(isset($datatable['rows']['row']) && 
is_array($datatable['rows']['row']))
@@ -905,9 +939,9 @@
                                        {
                                                if(isset($column['format']) && 
$column['format']== "link" && $column['java_link']==true)
                                                {
-                                                         
$json_row[$column['name']] = "<a href='#' id='".$column['link']."' 
onclick='javascript:filter_data(this.id);'>" .$column['value']."</a>";
+                                                       
$json_row[$column['name']] = "<a href='#' id='".$column['link']."' 
onclick='javascript:filter_data(this.id);'>" .$column['value']."</a>";
                                                }
-                                               elseif(isset($column['format']) 
&& $column['format']== "link")
+                                               else 
if(isset($column['format']) && $column['format']== "link")
                                                {
                                                        
$json_row[$column['name']] = "<a href='".$column['link']."' target='_blank'>" 
.$column['value']."</a>";
                                                }
@@ -929,14 +963,14 @@
                                $json ['rights'] = 
$datatable['rowactions']['action'];
                        }
 
-                               if( phpgw::get_var('phpgw_return_as') == 'json' 
)
-                               {
-                               return $json;
-                               }
+                       if( phpgw::get_var('phpgw_return_as') == 'json' )
+                       {
+                               return $json;
+                       }
 
 
                        $datatable['json_data'] = json_encode($json);
-//-END------------------- JSON CODE ----------------------
+                       //-END------------------- JSON CODE 
----------------------
 
                        // Prepare template variables and process XSLT
                        $template_vars = array();
@@ -946,28 +980,28 @@
 
                        if ( !isset($GLOBALS['phpgw']->css) || 
!is_object($GLOBALS['phpgw']->css) )
                        {
-                                       $GLOBALS['phpgw']->css = 
createObject('phpgwapi.css');
+                               $GLOBALS['phpgw']->css = 
createObject('phpgwapi.css');
                        }
 
 
                        $appname = lang('entity');
 
                        phpgwapi_yui::load_widget('dragdrop');
-                       phpgwapi_yui::load_widget('datatable');
-                       phpgwapi_yui::load_widget('menu');
-                       phpgwapi_yui::load_widget('connection');
-                       //// cramirez: necesary for include a partucular js
-                       phpgwapi_yui::load_widget('loader');
-                       //cramirez: necesary for use opener . Avoid error JS
+                       phpgwapi_yui::load_widget('datatable');
+                       phpgwapi_yui::load_widget('menu');
+                       phpgwapi_yui::load_widget('connection');
+                       //// cramirez: necesary for include a partucular js
+                       phpgwapi_yui::load_widget('loader');
+                       //cramirez: necesary for use opener . Avoid error JS
                        phpgwapi_yui::load_widget('tabview');
                        phpgwapi_yui::load_widget('paginator');
                        //FIXME this one is only needed when $lookup==true - so 
there is probably an error
                        phpgwapi_yui::load_widget('animation');
 
                        // Prepare CSS Style
-                       $GLOBALS['phpgw']->css->validate_file('datatable');
-                       $GLOBALS['phpgw']->css->validate_file('property');
-                       
$GLOBALS['phpgw']->css->add_external_file('property/templates/base/css/property.css');
+                       $GLOBALS['phpgw']->css->validate_file('datatable');
+                       $GLOBALS['phpgw']->css->validate_file('property');
+                       
$GLOBALS['phpgw']->css->add_external_file('property/templates/base/css/property.css');
                        
$GLOBALS['phpgw']->css->add_external_file('phpgwapi/js/yahoo/datatable/assets/skins/sam/datatable.css');
                        
$GLOBALS['phpgw']->css->add_external_file('phpgwapi/js/yahoo/container/assets/skins/sam/container.css');
                        
$GLOBALS['phpgw']->css->add_external_file('phpgwapi/js/yahoo/paginator/assets/skins/sam/paginator.css');
@@ -994,10 +1028,11 @@
 
                        if(!$this->acl_add && !$this->acl_edit)
                        {
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',array(
-                                       'menuaction'    => 
'property.uientity.view', 'id'=> $id, 'entity_id'    => $this->entity_id,
-                                       'cat_id'                => 
$this->cat_id,
-                                       'type'                  => 
$this->type));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array
+                                       (
+                                               'menuaction'    => 
'property.uientity.view', 'id'=> $id, 'entity_id'    => $this->entity_id,
+                                               'cat_id'                => 
$this->cat_id,
+                                               'type'                  => 
$this->type));
                        }
 
                        if($mode == 'view')
@@ -1017,7 +1052,7 @@
                                }
                        }
 
-               //      $config         = 
CreateObject('phpgwapi.config','property');
+                       //      $config         = 
CreateObject('phpgwapi.config','property');
                        $bolocation     = CreateObject('property.bolocation');
 
                        $values                         = 
phpgw::get_var('values');
@@ -1095,7 +1130,7 @@
                                $values['origin'][0]['data'][]= array(
                                        'id'    => $origin_id,
                                        'link'  => 
$interlink->get_relation_link(array('location' => $origin), $origin_id),
-                                       );
+                               );
                        }
 
                        if(isset($tenant_id) && $tenant_id)
@@ -1114,7 +1149,7 @@
 
                        if (isset($values['cancel']) && $values['cancel'])
                        {
-                                       
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uientity.index', 'entity_id'=> $this->entity_id, 'cat_id'=> 
$this->cat_id,'type' => $this->type));
+                               
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uientity.index', 'entity_id'=> $this->entity_id, 'cat_id'=> 
$this->cat_id,'type' => $this->type));
                        }
 
                        if ((isset($values['save']) && $values['save']) || 
(isset($values['apply']) && $values['apply']))
@@ -1163,7 +1198,7 @@
                                        $receipt = 
$this->bo->save($values,$values_attribute,$action,$this->entity_id,$this->cat_id);
                                        $id = $receipt['id'];
                                        $function_msg = lang('edit entity');
-//--------------files
+                                       //--------------files
                                        $loc1 = 
isset($values['location']['loc1']) && $values['location']['loc1'] ? 
$values['location']['loc1'] : 'dummy';
                                        if($this->type_app[$this->type] == 
'catch')
                                        {
@@ -1188,7 +1223,8 @@
                                                $file_name = str_replace (' 
','_',$_FILES['file']['name']);
                                                $to_file        = 
"{$bofiles->fakebase}/{$this->category_dir}/{$loc1}/{$id}/{$file_name}";
 
-                                               if 
($bofiles->vfs->file_exists(array(
+                                               if 
($bofiles->vfs->file_exists(array
+                                                       (
                                                                'string' => 
$to_file,
                                                                'relatives' => 
Array(RELATIVE_NONE)
                                                        )))
@@ -1198,10 +1234,10 @@
                                                else
                                                {
                                                        $files[] = array
-                                                       (
-                                                               'from_file'     
=> $_FILES['file']['tmp_name'],
-                                                               'to_file'       
=> $to_file
-                                                       );
+                                                               (
+                                                                       
'from_file'     => $_FILES['file']['tmp_name'],
+                                                                       
'to_file'       => $to_file
+                                                               );
                                                }
 
                                                unset($to_file);
@@ -1213,7 +1249,8 @@
                                                $file_name = 'jasper::' . 
str_replace (' ','_',$_FILES['jasperfile']['name']);
                                                $to_file        = 
"{$bofiles->fakebase}/{$this->category_dir}/{$loc1}/{$id}/{$file_name}";
 
-                                               
if($bofiles->vfs->file_exists(array(
+                                               
if($bofiles->vfs->file_exists(array
+                                                       (
                                                                'string' => 
$to_file,
                                                                'relatives' => 
Array(RELATIVE_NONE)
                                                        )))
@@ -1223,10 +1260,10 @@
                                                else
                                                {
                                                        $files[] = array
-                                                       (
-                                                               'from_file'     
=> $_FILES['jasperfile']['tmp_name'],
-                                                               'to_file'       
=> $to_file
-                                                       );
+                                                               (
+                                                                       
'from_file'     => $_FILES['jasperfile']['tmp_name'],
+                                                                       
'to_file'       => $to_file
+                                                               );
                                                }
 
                                                unset($to_file);
@@ -1250,7 +1287,7 @@
                                        unset($loc1);
                                        unset($files);
                                        unset($file);                           
        
-//-------------end files
+                                       //-------------end files
 
                                        if (isset($values['save']) && 
$values['save'])
                                        {
@@ -1320,10 +1357,10 @@
                                {
                                        $entity_lookup = 
$this->soadmin_entity->read_single($lookup_id);
                                        $lookup_entity[] = array
-                                       (
-                                               'id'            => $lookup_id,
-                                               'name'          => 
$entity_lookup['name']
-                                       );
+                                               (
+                                                       'id'            => 
$lookup_id,
+                                                       'name'          => 
$entity_lookup['name']
+                                               );
                                }
                        }
 
@@ -1344,7 +1381,8 @@
 
                        if($entity['location_form'] && 
$category['location_level'] > 0 )
                        {
-                               
$location_data=$bolocation->initiate_ui_location(array(
+                               
$location_data=$bolocation->initiate_ui_location(array
+                                       (
                                                'values'        => 
$values['location_data'],
                                                'type_id'       => 
$category['location_level'],
                                                'no_link'       => false, // 
disable lookup links for location type less than type_id
@@ -1352,7 +1390,7 @@
                                                'tenant'        => 
$lookup_tenant,
                                                'lookup_entity' => 
$lookup_entity,
                                                'entity_data'   => 
isset($values['p'])?$values['p']:''
-                                               ));
+                                       ));
                        }
 
                        if(isset($error_id) && $error_id)
@@ -1362,19 +1400,19 @@
                        }
 
                        $link_data = array
-                       (
-                               'menuaction'    => "property.uientity.{$mode}",
-                               'id'                    => $id,
-                               'entity_id'             => $this->entity_id,
-                               'cat_id'                => $this->cat_id,
-                               'type'                  => $this->type
-                       );
+                               (
+                                       'menuaction'    => 
"property.uientity.{$mode}",
+                                       'id'                    => $id,
+                                       'entity_id'             => 
$this->entity_id,
+                                       'cat_id'                => 
$this->cat_id,
+                                       'type'                  => $this->type
+                               );
 
                        $msgbox_data = $this->bocommon->msgbox_data($receipt);
 
 
-       //              $config->read();
-       //              $link_to_files = $config->config_data['files_url'];
+                       //              $config->read();
+                       //              $link_to_files = 
$config->config_data['files_url'];
 
                        if(isset($values['files']) && 
is_array($values['files']))
                        {
@@ -1386,51 +1424,51 @@
                        }
 
                        $project_link_data = array
-                       (
-                               'menuaction'            => 
'property.uiproject.edit',
-                               'bypass'                        => true,
-                               'location_code'         => 
$values['location_code'],
-                               'p_num'                         => $id,
-                               'p_entity_id'           => $this->entity_id,
-                               'p_cat_id'                      => 
$this->cat_id,
-                               'tenant_id'                     => 
$values['tenant_id'],
-                               'origin'                        => 
".{$this->type}.{$this->entity_id}.{$this->cat_id}",
-                               'origin_id'                     => $id
-                       );
+                               (
+                                       'menuaction'            => 
'property.uiproject.edit',
+                                       'bypass'                        => true,
+                                       'location_code'         => 
$values['location_code'],
+                                       'p_num'                         => $id,
+                                       'p_entity_id'           => 
$this->entity_id,
+                                       'p_cat_id'                      => 
$this->cat_id,
+                                       'tenant_id'                     => 
$values['tenant_id'],
+                                       'origin'                        => 
".{$this->type}.{$this->entity_id}.{$this->cat_id}",
+                                       'origin_id'                     => $id
+                               );
 
                        $ticket_link_data = array
-                       (
-                               'menuaction'            => 'property.uitts.add',
-                               'bypass'                        => true,
-                               'location_code'         => 
$values['location_code'],
-                               'p_num'                         => $id,
-                               'p_entity_id'           => $this->entity_id,
-                               'p_cat_id'                      => 
$this->cat_id,
-                               'tenant_id'                     => 
$values['tenant_id'],
-                               'origin'                        => 
".{$this->type}.{$this->entity_id}.{$this->cat_id}",
-                               'origin_id'                     => $id
-                       );
+                               (
+                                       'menuaction'            => 
'property.uitts.add',
+                                       'bypass'                        => true,
+                                       'location_code'         => 
$values['location_code'],
+                                       'p_num'                         => $id,
+                                       'p_entity_id'           => 
$this->entity_id,
+                                       'p_cat_id'                      => 
$this->cat_id,
+                                       'tenant_id'                     => 
$values['tenant_id'],
+                                       'origin'                        => 
".{$this->type}.{$this->entity_id}.{$this->cat_id}",
+                                       'origin_id'                     => $id
+                               );
 
 
-//_debug_array($values['origin']);
+                       //_debug_array($values['origin']);
 
-//                     
$GLOBALS['phpgw']->js->validate_file('overlib','overlib','property');
+                       //                      
$GLOBALS['phpgw']->js->validate_file('overlib','overlib','property');
 
                        $table_apply[] = array
-                       (
-                               'lang_save'                                     
        => lang('save'),
-                               'lang_cancel'                                   
=> lang('cancel'),
-                               'lang_apply'                                    
=> lang('apply'),
-                       );
+                               (
+                                       'lang_save'                             
                => lang('save'),
+                                       'lang_cancel'                           
        => lang('cancel'),
+                                       'lang_apply'                            
        => lang('apply'),
+                               );
 
                        $pdf_data = array
-                       (
-                               'menuaction'    => 
'property.uientity.print_pdf',
-                               'id'            => $id,
-                               'entity_id'     => $this->entity_id,
-                               'cat_id'        => $this->cat_id,
-                               'type'          => $this->type
-                       );
+                               (
+                                       'menuaction'    => 
'property.uientity.print_pdf',
+                                       'id'            => $id,
+                                       'entity_id'     => $this->entity_id,
+                                       'cat_id'        => $this->cat_id,
+                                       'type'          => $this->type
+                               );
 
                        $tabs = array();
 
@@ -1441,16 +1479,16 @@
                                        if($attribute['history'] == true)
                                        {
                                                $link_history_data = array
-                                               (
-                                                       'menuaction'    => 
'property.uientity.attrib_history',
-                                                       'acl_location'  => 
".{$this->type}.{$this->entity_id}.{$this->cat_id}",
-                                       //              'entity_id'     => 
$this->entity_id,
-                                       //              'cat_id'        => 
$this->cat_id,
-                                                       'attrib_id'     => 
$attribute['id'],
-                                                       'id'            => $id,
-                                                       'edit'          => true,
-                                                       'type'          => 
$this->type
-                                               );
+                                                       (
+                                                               'menuaction'    
=> 'property.uientity.attrib_history',
+                                                               'acl_location'  
=> ".{$this->type}.{$this->entity_id}.{$this->cat_id}",
+                                                               //              
'entity_id'     => $this->entity_id,
+                                                               //              
'cat_id'        => $this->cat_id,
+                                                               'attrib_id'     
=> $attribute['id'],
+                                                               'id'            
=> $id,
+                                                               'edit'          
=> true,
+                                                               'type'          
=> $this->type
+                                                       );
 
                                                $attribute['link_history'] = 
$GLOBALS['phpgw']->link('/index.php',$link_history_data);
                                        }
@@ -1490,13 +1528,13 @@
                                {
                                        $tabs['jasper'] = array('label' => 
lang('jasper reports'), 'link' => '#jasper');
                                }
-*/
+ */
                        }
 
                        $custom_config  = 
CreateObject('admin.soconfig',$GLOBALS['phpgw']->locations->get_id($this->type_app[$this->type],
 $this->acl_location));
                        $_integration_config = 
isset($custom_config->config_data['integration']) ? 
$custom_config->config_data['integration'] : array();
-                       
-               // required settings:
+
+                       // required settings:
 /*
                        integration_tab
                        integration_url
@@ -1509,7 +1547,7 @@
                        integration_auth_hash_name
                        integration_auth_hash_value
                        integration_location_data
-*/
+ */
 
 
                        $integration = '';
@@ -1517,19 +1555,19 @@
                        {
 
                                //get session key from remote system
-                               
+
                                $arguments = 
array($_integration_config['auth_hash_name'] => 
$_integration_config['auth_hash_value']);
                                $query = http_build_query($arguments);
                                $auth_url = $_integration_config['auth_url'];
                                $request = "{$auth_url}?{$query}";
 
                                $aContext = array
-                               (
-                                       'http' => array
                                        (
-                                               'request_fulluri' => true,
-                                       ),
-                               );
+                                               'http' => array
+                                               (
+                                                       'request_fulluri' => 
true,
+                                               ),
+                                       );
 
                                
if(isset($GLOBALS['phpgw_info']['server']['httpproxy_server']))
                                {
@@ -1545,7 +1583,7 @@
                                $_integration_config['parametres']      = 
htmlspecialchars_decode($_integration_config['parametres']);
 
                                parse_str($_integration_config['parametres'], 
$output);
-                               
+
                                foreach ($output as $_dummy => $_substitute)
                                {
                                        $_keys[] = $_substitute;
@@ -1562,15 +1600,15 @@
                                                        }
                                                }
                                        }
-                                       
+
                                        if($__value)
                                        {
                                                $_values[] = $__value;
                                        }
                                }
 
-//_debug_array($_integration_config['parametres']);
-//_debug_array($_values);
+                               
//_debug_array($_integration_config['parametres']);
+                               //_debug_array($_values);
                                unset($output);
                                unset($__value);
                                $_sep = '?';
@@ -1581,7 +1619,7 @@
                                $_param = str_replace($_keys, $_values, 
$_integration_config['parametres']);
                                unset($_keys);
                                unset($_values);
-//                             $integration_src = 
phpgw::safe_redirect("{$_integration_config['url']}{$_sep}{$_param}");
+                               //                              
$integration_src = 
phpgw::safe_redirect("{$_integration_config['url']}{$_sep}{$_param}");
                                $integration_src = 
"{$_integration_config['url']}{$_sep}{$_param}";
                                if($_integration_config['action'])
                                {
@@ -1594,7 +1632,7 @@
                                }
 
                                $arguments = 
array($_integration_config['auth_key_name'] => $response);
-                               
+
                                if(isset($_integration_config['location_data']) 
&& $_integration_config['location_data'])
                                {
                                        $_integration_config['location_data']   
= htmlspecialchars_decode($_integration_config['location_data']);
@@ -1608,21 +1646,21 @@
                                }
 
                                $integration_src .= 
"&{$_integration_config['auth_key_name']}={$response}";
-//_debug_array($values);
-//_debug_array($integration_src);die();
+                               //_debug_array($values);
+                               //_debug_array($integration_src);die();
                                $tabs['integration']    = array('label' => 
$_integration_config['tab'], 'link' => '#integration', 'function' => 
"document.getElementById('integration_content').src = '{$integration_src}';");
 
                        }
                        unset($values['attributes']);
                        $link_file_data = array
-                       (
-                               'menuaction'    => 
'property.uientity.view_file',
-                               'loc1'                  => 
$values['location_data']['loc1'],
-                               'id'                    => $id,
-                               'cat_id'                => $this->cat_id,
-                               'entity_id'             => $this->entity_id,
-                               'type'                  => $this->type
-                       );
+                               (
+                                       'menuaction'    => 
'property.uientity.view_file',
+                                       'loc1'                  => 
$values['location_data']['loc1'],
+                                       'id'                    => $id,
+                                       'cat_id'                => 
$this->cat_id,
+                                       'entity_id'             => 
$this->entity_id,
+                                       'type'                  => $this->type
+                               );
 
                        $content_files = array();
                        for($z=0; $z<count($values['files']); $z++)
@@ -1632,21 +1670,21 @@
                        }                                                       
                
 
                        $datavalues[0] = array
-                       (
+                               (
                                        'name'                                  
=> "0",
                                        'values'                                
=> json_encode($content_files),
                                        'total_records'                 => 
count($content_files),
                                        'edit_action'                   => "''",
                                        'is_paginator'                  => 0,
                                        'footer'                                
=> 0
-                       );
+                               );
 
                        $myColumnDefs[0] = array
-                       (
-                               'name'          => "0",
-                               'values'        =>      json_encode(array(      
array('key' => 
'file_name','label'=>lang('Filename'),'sortable'=>false,'resizeable'=>true),
-                                                                               
                array('key' => 'delete_file','label'=>lang('Delete 
file'),'sortable'=>false,'resizeable'=>true,'formatter'=>'FormatterCenter')))
-                       );
+                               (
+                                       'name'          => "0",
+                                       'values'        =>      
json_encode(array(      array('key' => 
'file_name','label'=>lang('Filename'),'sortable'=>false,'resizeable'=>true),
+                                       array('key' => 
'delete_file','label'=>lang('Delete 
file'),'sortable'=>false,'resizeable'=>true,'formatter'=>'FormatterCenter')))
+                               );
 
 /*
                        $link_file_data['jasper']               = true;
@@ -1669,12 +1707,12 @@
                        );
 
                        $myColumnDefs[1] = array
-                       (
-                               'name'          => "1",
-                               'values'        =>      json_encode(array(      
array('key' => 
'file_name','label'=>lang('Filename'),'sortable'=>false,'resizeable'=>true),
-                                                                               
                array('key' => 'delete_file','label'=>lang('Delete 
file'),'sortable'=>false,'resizeable'=>true,'formatter'=>'FormatterCenter')))
+                       (
+                               'name'          => "1",
+                               'values'        =>      json_encode(array(      
array('key' => 
'file_name','label'=>lang('Filename'),'sortable'=>false,'resizeable'=>true),
+                                                                               
                        array('key' => 'delete_file','label'=>lang('Delete 
file'),'sortable'=>false,'resizeable'=>true,'formatter'=>'FormatterCenter')))
                        );
-*/                     
+ */                    
                        if ($id)
                        {
                                $related = 
$this->bo->read_entity_to_link(array('entity_id'=>$this->entity_id,'cat_id'=>$this->cat_id,'id'=>$id));
@@ -1689,104 +1727,104 @@
                                                foreach($related_data as $entry)
                                                {
                                                        $related_link[] = array
-                                                       (
-                                                               'entity_link'   
                        => $entry['entity_link'],
-                                                               
'lang_entity_statustext'        => $entry['descr'],
-                                                               'text_entity'   
                        => $entry['name'],
-                                                       );
+                                                               (
+                                                                       
'entity_link'                           => $entry['entity_link'],
+                                                                       
'lang_entity_statustext'        => $entry['descr'],
+                                                                       
'text_entity'                           => $entry['name'],
+                                                               );
                                                }
                                        }
                                }
                        }
 
                        $data = array
-                       (
-                               'property_js'                                   
        => 
json_encode($GLOBALS['phpgw_info']['server']['webserver_url']."/property/js/yahoo/property2.js"),
-                               'datatable'                                     
                => $datavalues,
-                               'myColumnDefs'                                  
        => $myColumnDefs,       
-                               'related_link'                                  
=> $related_link,                       
-                               'link_pdf'                                      
        => $GLOBALS['phpgw']->link('/index.php',$pdf_data),
-                               'start_project'                                 
=> $category['start_project'],
-                               'lang_start_project'                    => 
lang('start project'),
-                               'project_link'                                  
=> $GLOBALS['phpgw']->link('/index.php',$project_link_data),
-                               'start_ticket'                                  
=> $category['start_ticket'],
-                               'lang_start_ticket'                     => 
lang('start ticket'),
-                               'ticket_link'                                   
=> $GLOBALS['phpgw']->link('/index.php',$ticket_link_data),
-                               'fileupload'                                    
=> $category['fileupload'],
-               //              'jasperupload'                                  
=> $category['jasperupload'],
-                               'link_view_file'                                
=> $GLOBALS['phpgw']->link('/index.php',$link_file_data),
-               //              'link_to_files'                                 
=> $link_to_files,
-                               'files'                                         
        => isset($values['files'])?$values['files']:'',
-               //              'jasperfiles'                                   
=> isset($values['jasperfiles'])?$values['jasperfiles']:'',
-                               'lang_files'                                    
=> lang('files'),
-                               'lang_filename'                                 
=> lang('Filename'),
-                               'lang_file_action'                              
=> lang('Delete file'),
-                               'lang_view_file_statustext'             => 
lang('click to view file'),
-                               'lang_file_action_statustext'   => lang('Check 
to delete file'),
-                               'lang_upload_file'                              
=> lang('Upload file'),
-                               'lang_file_statustext'                  => 
lang('Select file to upload'),
-                               'multiple_uploader'                             
=> $id ? true : '',
-                               'fileuploader_action'                   => 
"{menuaction:'property.fileuploader.add',"
-                                                                               
                 ."upload_target:'property.uientity.addfiles',"
-                                                                               
                 ."id:'{$id}',"
-                                                                               
                 ."_entity_id:'{$this->entity_id}',"
-                                                                               
                 ."_cat_id:'{$this->cat_id}',"
-                                                                               
                 ."_type:'{$this->type}'}",
-                               'value_origin'                                  
=> isset($values['origin'])?$values['origin']:'',
-                               'value_origin_type'                             
=> isset($origin)?$origin:'',
-                               'value_origin_id'                               
=> isset($origin_id)?$origin_id:'',
+                               (
+                                       'property_js'                           
        => 
json_encode($GLOBALS['phpgw_info']['server']['webserver_url']."/property/js/yahoo/property2.js"),
+                                       'datatable'                             
                => $datavalues,
+                                       'myColumnDefs'                          
        => $myColumnDefs,       
+                                       'related_link'                          
        => $related_link,                       
+                                       'link_pdf'                              
                => $GLOBALS['phpgw']->link('/index.php',$pdf_data),
+                                       'start_project'                         
        => $category['start_project'],
+                                       'lang_start_project'                    
=> lang('start project'),
+                                       'project_link'                          
        => $GLOBALS['phpgw']->link('/index.php',$project_link_data),
+                                       'start_ticket'                          
        => $category['start_ticket'],

@@ Diff output truncated at 153600 characters. @@



reply via email to

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