fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [12826]


From: Nelson Guerra
Subject: [Fmsystem-commits] [12826]
Date: Thu, 05 Mar 2015 23:32:01 +0000

Revision: 12826
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=12826
Author:   nelson224
Date:     2015-03-05 23:32:00 +0000 (Thu, 05 Mar 2015)
Log Message:
-----------


Modified Paths:
--------------
    branches/dev-syncromind/property/inc/class.uirequest.inc.php

Modified: branches/dev-syncromind/property/inc/class.uirequest.inc.php
===================================================================
--- branches/dev-syncromind/property/inc/class.uirequest.inc.php        
2015-03-05 23:31:18 UTC (rev 12825)
+++ branches/dev-syncromind/property/inc/class.uirequest.inc.php        
2015-03-05 23:32:00 UTC (rev 12826)
@@ -673,7 +673,8 @@
                                        'label' => lang('Select'),
                                        'sortable' => false,
                                        'hidden' => false,
-                                       'formatter' => 'formatRadio'
+                                       'formatter' => 'formatRadio',
+                                       'className' => 'dt-center all'
                                );
                                array_push ($data['datatable']['field'], 
$params);
                        }
@@ -802,9 +803,9 @@
 
                                        $code = <<<JS
                                                function 
initCompleteDatatable(oSettings, json, oTable) 
-                                               {
+                                               { 
                                                        var api = oTable.api();
-                                                       api.search( '$query' ); 
                                                
+                                                       api.search( '$query' 
).draw();
                                                }
 JS;
 
@@ -814,828 +815,8 @@
                        self::add_javascript('property', 'portico', 
'request.index.js');
                        self::render_template_xsl('datatable_jquery', $data);
                }
-               
-               function index2()
-               {
-                       if(!$this->acl_read)
-                       {
-                               
//$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=> 
'property.uilocation.stop', 'perm'=>1, 'acl_location'=> $this->acl_location));
-                       }
 
-                       $datatable = array();
-                       $values_combo_box = array();
 
-                       $project_id = phpgw::get_var('project_id', 'int'); // 
lookup for maintenance planning
-
-                       if($project_id)
-                       {
-                               $lookup = true;
-                       }
-
-                       $start_date     = urldecode($this->start_date);
-                       $end_date               = urldecode($this->end_date);
-
-                       $this->save_sessiondata();
-
-                       $dry_run = false;
-
-                       if( phpgw::get_var('phpgw_return_as') != 'json' )
-                       {
-
-                               if(!$lookup)
-                               {
-                                       $datatable['menu']      = 
$this->bocommon->get_menu();
-                               }
-
-                               $datatable['config']['base_url'] = 
$GLOBALS['phpgw']->link('/index.php', array
-                                       (
-                                               'menuaction'                    
=> 'property.uirequest.index',
-                                               'lookup'    => $lookup,
-               //                              'cat_id'        => 
$this->cat_id,
-               //                              'filter'        => 
$this->filter,
-               //                              'status_id'     => 
$this->status_id,
-                                               'project_id'    => $project_id,
-               //                              'query'         => $this->query,
-                                               'condition_survey_id'=> 
$this->condition_survey_id,
-                                               'nonavbar' => $this->nonavbar,
-                                               'p_num'         => $this->p_num,
-                                               'start_date'=> 
$this->start_date,
-                                               'end_date'      => 
$this->end_date
-
-                                       ));
-                               $datatable['config']['allow_allrows'] = false;
-
-                               $datatable['config']['base_java_url'] = 
"menuaction:'property.uirequest.index',"
-                                       ."p_num: '{$this->p_num}',"
-                                       ."query:'{$this->query}',"
-                                       ."lookup:'{$lookup}',"
-                                       ."project_id:'{$project_id}',"
-                                       ."filter:'{$this->filter}',"
-                                       ."status_id:'{$this->status_id}',"
-                                       ."degree_id:'{$this->degree_id}',"
-                                       
."property_cat_id:'{$this->property_cat_id}',"
-                                       
."condition_survey_id:'{$this->condition_survey_id}',"
-                                       ."nonavbar:'{$this->nonavbar}',"
-                                       ."district_id: '{$this->district_id}',"
-                                       ."start_date:'{$this->start_date}',"
-                                       ."end_date: '{$this->end_date}',"
-                                       ."cat_id:'{$this->cat_id}',"
-                                       
."responsible_unit:'{$this->responsible_unit}',"
-                                       
."building_part:'{$this->building_part}'";
-
-                               $values_combo_box[0]  = 
$this->bocommon->select_category_list(array
-                                       (
-                                               'format'=>'filter',
-                               //              'selected' => $this->cat_id,
-                                               'type' =>'location',
-                                               'type_id' =>1,
-                                               'order'=>'descr'
-                                       )
-                               );
-                               $default_value = array 
('id'=>'','name'=>lang('no type'));
-                               array_unshift 
($values_combo_box[0],$default_value);
-
-                               $values_combo_box[1]  = 
$this->bocommon->select_district_list('filter',$this->district_id);
-                               $default_value = array 
('id'=>'','name'=>lang('no district'));
-                               array_unshift 
($values_combo_box[1],$default_value);
-
-                               $values_combo_box[2] = 
$this->cats->formatted_xslt_list(array('select_name' => 'cat_id','selected' => 
$this->cat_id,'globals' => True));
-                               $default_value = array ('cat_id'=>'','name'=> 
lang('no category'));
-                               array_unshift 
($values_combo_box[2]['cat_list'],$default_value);
-
-                               $values_combo_box[3]  = 
$this->bo->select_status_list('filter',$this->status_id);
-                               array_unshift ($values_combo_box[3],array 
('id'=>'all','name'=> lang('all')));
-                               array_unshift ($values_combo_box[3],array 
('id'=>'open','name'=> lang('open')));
-
-                               $values_combo_box[4]  = 
$this->bo->select_degree_list();
-                               foreach($values_combo_box[4] as &$_degree)
-                               {
-                                       $_degree['id']++;
-                               }
-                               array_unshift ($values_combo_box[4],array 
('id'=>'','name'=> lang('condition degree')));
-
-                               $values_combo_box[5]  = 
$this->bo->get_user_list();
-                               array_unshift 
($values_combo_box[5],array('user_id'=>$GLOBALS['phpgw_info']['user']['account_id'],'name'=>$GLOBALS['phpgw_info']['user']['fullname']));
-                               $default_value = array 
('user_id'=>'','name'=>lang('no user'));
-                               array_unshift 
($values_combo_box[5],$default_value);
-
-
-                               $responsible_unit_list  = 
$this->bocommon->select_category_list(array('type'=> 
'request_responsible_unit','selected' =>$this->responsible_unit, 'order' => 
'id', 'fields' => array('descr')));
-                               array_unshift ($responsible_unit_list,array 
('id'=>'0','name'=> lang('responsible unit')));
-
-                               $recommended_year_list  = 
$this->bo->get_recommended_year_list($this->recommended_year);
-                               array_unshift ($recommended_year_list,array 
('id'=>'0','name'=> lang('recommended year')));
-
-                               $_filter_buildingpart = array();
-                               $filter_buildingpart = 
isset($this->bo->config->config_data['filter_buildingpart']) ? 
$this->bo->config->config_data['filter_buildingpart'] : array();
-
-                               if($filter_key = 
array_search('.project.request', $filter_buildingpart))
-                               {
-                                       $_filter_buildingpart = 
array("filter_{$filter_key}" => 1);
-                               }
-
-                               $building_part_list = 
$this->bocommon->select_category_list(array('type'=> 'building_part','selected' 
=>$this->building_part, 'order' => 'id', 'id_in_name' => 'num', 'filter' => 
$_filter_buildingpart));
-                               array_unshift ($building_part_list, array 
('id'=>'','name'=> lang('building part')));
-
-                               $datatable['actions']['form'] = array
-                               (
-                                       array
-                                       (
-                                               'action'        => 
$GLOBALS['phpgw']->link('/index.php',
-                                                       array
-                                                       (
-                                                               'menuaction'    
        => 'property.uirequest.index',
-                                                               'lookup'        
        => $lookup,
-                                                               
'condition_survey_id'=> $this->condition_survey_id,
-                                                               'nonavbar'      
                => $this->nonavbar,
-                                                               
'property_cat_id'       => $this->property_cat_id,
-                                                               'cat_id'        
                => $this->cat_id,
-                                                               'filter'        
                => $this->filter,
-                                                               'status_id'     
                => $this->status_id,
-                                                               'degree_id'     
                => $this->degree_id,
-                                                               'project_id'    
        => $project_id,
-                                                               'district_id'   
    => $this->district_id,
-                                                               'query'         
                => $this->query,
-                                                               'start_date'    
        => $this->start_date,
-                                                               'end_date'      
                => $this->end_date,
-                                                               'building_part' 
        => $this->building_part,
-                                                               
'responsible_unit'      => $this->responsible_unit,
-                                                               
'recommended_year'      => $this->recommended_year,
-                                                       )
-                                               ),
-                                               'fields'        => array
-                                               (
-                                                       'field' => array
-                                                       (
-                                                               array
-                                                               ( //boton       
DISTRICT
-                                                                       'id' => 
'btn_property_cat',
-                                                                       'name' 
=> 'property_cat_id',
-                                                                       'value' 
=> lang('property type'),
-                                                                       'type' 
=> 'button',
-                                                                       'style' 
=> 'filter',
-                                                                       
'tab_index' => 1
-                                                               ),
-                                                               array
-                                                               ( //boton       
DISTRICT
-                                                                       'id' => 
'btn_district_id',
-                                                                       'name' 
=> 'district_id',
-                                                                       'value' 
=> lang('district'),
-                                                                       'type' 
=> 'button',
-                                                                       'style' 
=> 'filter',
-                                                                       
'tab_index' => 2
-                                                               ),
-                                                               array
-                                                               ( //boton       
CATEGORY
-                                                                       'id' => 
'btn_cat_id',
-                                                                       'name' 
=> 'cat_id',
-                                                                       'value' 
=> lang('Category'),
-                                                                       'type' 
=> 'button',
-                                                                       'style' 
=> 'filter',
-                                                                       
'tab_index' => 3
-                                                               ),
-                                                               array
-                                                               ( //boton       
STATUS
-                                                                       'id' => 
'btn_status_id',
-                                                                       'name' 
=> 'status_id',
-                                                                       'value' 
=> lang('Status'),
-                                                                       'type' 
=> 'button',
-                                                                       'style' 
=> 'filter',
-                                                                       
'tab_index' => 4
-                                                               ),
-                                                               array
-                                                               ( //boton       
STATUS
-                                                                       'id' => 
'btn_degree_id',
-                                                                       'name' 
=> 'degree_id',
-                                                                       'value' 
=> lang('condition degree'),
-                                                                       'type' 
=> 'button',
-                                                                       'style' 
=> 'filter',
-                                                                       
'tab_index' => 5
-                                                               ),
-                                                               array
-                                                               (
-                                                                       'id' => 
'sel_building_part', // traditional listbox for long list
-                                                                       'name' 
=> 'building_part',
-                                                                       'value' 
=> lang('building part'),
-                                                                       'type' 
=> 'select',
-                                                                       'style' 
=> 'filter',
-                                                                       
'values'        => $building_part_list,
-                                                                       
'onchange'=> 'onChangeSelect("building_part");',
-                                                                       
'tab_index' => 6
-                                                               ),
-                                                               array
-                                                               (
-                                                                       'id' => 
'sel_responsible_unit',
-                                                                       'name' 
=> 'responsible_unit',
-                                                                       'value' 
=> lang('responsible unit'),
-                                                                       'type' 
=> 'select',
-                                                                       'style' 
=> 'filter',
-                                                                       
'values'        => $responsible_unit_list,
-                                                                       
'onchange'=> 'onChangeSelect("responsible_unit");',
-                                                                       
'tab_index' => 7
-                                                               ),
-                                                               array
-                                                               (
-                                                                       'id' => 
'sel_recommended_year',
-                                                                       'name' 
=> 'recommended_year',
-                                                                       'value' 
=> lang('responsible unit'),
-                                                                       'type' 
=> 'select',
-                                                                       'style' 
=> 'filter',
-                                                                       
'values'        => $recommended_year_list,
-                                                                       
'onchange'=> 'onChangeSelect("recommended_year");',
-                                                                       
'tab_index' => 8
-                                                               ),
-                                                               array
-                                                               ( //boton       
FILTER
-                                                                       'id' => 
'btn_user_id',
-                                                                       'name' 
=> 'filter',
-                                                                       'value' 
=> lang('User'),
-                                                                       'type' 
=> 'button',
-                                                                       'style' 
=> 'filter',
-                                                                       
'tab_index' => 9
-                                                               ),
-                                                               array
-                                                               (
-                                                                       'type'  
=> 'button',
-                                                                       'id'    
=> 'btn_update',
-                                                                       'value' 
=> lang('Update project'),
-                                                                       
'tab_index' => 17
-                                                               ),
-                                                               array
-                                                               (
-                                                                       'type'  
=> 'button',
-                                                                       'id'    
=> 'btn_export',
-                                                                       'value' 
=> lang('download'),
-                                                                       
'tab_index' => 16
-                                                               ),
-
-                                                               array
-                                                               (
-                                                                       'type'  
=> 'button',
-                                                                       'id'    
=> 'btn_new',
-                                                                       'value' 
=> lang('add'),
-                                                                       
'tab_index' => 15
-                                                               ),
-                                                               array
-                                                               (
-                                                                       'type'  
=> 'hidden',
-                                                                       'id'    
=> 'start_date',
-                                                                       'value' 
=> $start_date
-                                                               ),
-                                                               array
-                                                               (
-                                                                       'type'  
=> 'hidden',
-                                                                       'id'    
=> 'end_date',
-                                                                       'value' 
=> $end_date
-                                                               ),
-                                                               array
-                                                               (
-                                                                       
'type'=> 'label_date'
-                                                               ),
-                                                               array
-                                                               (
-                                                                       
'type'=> 'link',
-                                                                       'id'  
=> 'btn_date_search',
-                                                                       'url' 
=> "Javascript:window.open('".$GLOBALS['phpgw']->link('/index.php',
-                                                                       array
-                                                                       (
-                                                                               
'menuaction' => 'property.uiproject.date_search')
-                                                                       
)."','','width=350,height=250')",
-                                                                       'value' 
=> lang('Date search'),
-                                                                       
'tab_index' => 14
-                                                               ),
-
-                                                               array
-                                                               ( //boton     
SEARCH
-                                                                       'id' => 
'btn_search',
-                                                                       'name' 
=> 'search',
-                                                                       'value' 
   => lang('search'),
-                                                                       
'onkeypress' => 'return pulsar(event)',
-                                                                       'type' 
=> 'button',
-                                                                       
'tab_index' => 13
-                                                               ),
-                                                               array
-                                                               ( //hidden 
request
-                                                                       'type'  
=> 'hidden',
-                                                                       'id'    
=> 'myValuesForUpdatePHP',
-                                                                       'name'  
=> 'myValuesForUpdatePHP',
-                                                                       'value' 
=> ''
-                                                               ),
-                                                               array
-                                                               ( // TEXT IMPUT
-                                                                       'name'  
   => 'query',
-                                                                       'id'    
 => 'txt_query',
-                                                                       'value' 
   => $this->query,
-                                                                       'type' 
=> 'text',
-                                                                       'size'  
  => 28,
-                                                                       
'onkeypress' => 'return pulsar(event)',
-                                                                       
'tab_index' => 12
-                                                               ),
-                                                               array
-                                                               (
-                                                                       
'type'=> 'link',
-                                                                       'id'  
=> 'btn_priority_key',
-                                                                       'url' 
=> "Javascript:window.open('".$GLOBALS['phpgw']->link('/index.php',
-                                                                       array
-                                                                       (
-                                                                               
'menuaction' => 
'property.uirequest.priority_key'))."','','left=50,top=100,width=350,height=350,scrollbars=1')",
-                                                                               
'value' => lang('Priority key'),
-                                                                               
'tab_index' => 10
-                                                               ),
-                                                               array
-                                                               (
-                                                                       'type' 
=> 'link',
-                                                                       'id' => 
'btn_columns',
-                                                                       'url' 
=> "Javascript:window.open('".$GLOBALS['phpgw']->link('/index.php',
-                                                                       array
-                                                                       (
-                                                                               
'menuaction' => 
'property.uirequest.columns'))."','','width=300,height=600,scrollbars=1')",
-                                                                               
'value' => lang('columns'),
-                                                                               
'tab_index' => 9
-                                                               ),
-                                                       ),
-                                                       'hidden_value' => array
-                                                       (
-                                                               array
-                                                               ( //div values  
combo_box_0
-                                                                       'id' => 
'values_combo_box_0',
-                                                                       'value' 
=> $this->bocommon->select2String($values_combo_box[0])
-                                                               ),
-                                                               array
-                                                               ( //div values  
combo_box_1
-                                                                       'id' => 
'values_combo_box_1',
-                                                                       'value' 
=> $this->bocommon->select2String($values_combo_box[1])
-                                                               ),
-                                                               array
-                                                               ( //div values  
combo_box_2
-                                                                       'id' => 
'values_combo_box_2',
-                                                                       'value' 
=> $this->bocommon->select2String($values_combo_box[2]['cat_list'], 'cat_id') 
//i.e.  id,value/id,vale/
-                                                               ),
-                                                               array
-                                                               ( //div values  
combo_box_3
-                                                                       'id' => 
'values_combo_box_3',
-                                                                       'value' 
=> $this->bocommon->select2String($values_combo_box[3])
-                                                               ),
-                                                               array
-                                                               ( //div values  
combo_box_4
-                                                                       'id' => 
'values_combo_box_4',
-                                                                       'value' 
=> $this->bocommon->select2String($values_combo_box[4])
-                                                               ),
-                                                               array
-                                                               ( //div values  
combo_box_5
-                                                                       'id' => 
'values_combo_box_5',
-                                                                       'value' 
=> $this->bocommon->select2String($values_combo_box[5], 'user_id')
-                                                               )
-                                                       )
-                                               )
-                                       )
-                               );
-
-                               if(!$this->acl_manage)//priority_key
-                               {
-                                       
unset($datatable['actions']['form'][0]['fields']['field'][19]);
-                               }
-
-                               if(!$this->acl_add) //add
-                               {
-                                       
unset($datatable['actions']['form'][0]['fields']['field'][11]);
-                               }
-
-                               if(!$project_id) // update project
-                               {
-                                       
unset($datatable['actions']['form'][0]['fields']['field'][9]);
-                               }
-
-
-                               $custom = 
createObject('phpgwapi.custom_fields');
-                               $attrib_data = $custom->find('property', 
$this->acl_location, 0, '','','',true, true);
-
-                               if($attrib_data)
-                               {
-                                       $i = 16;
-                                       foreach ( $attrib_data as $attrib )
-                                       {
-
-
-                                               if($attrib['datatype'] == 'LB' 
|| $attrib['datatype'] == 'CH' || $attrib['datatype'] == 'R')
-                                               {
-
-                                                       $_values = array();
-                                                       $_values[] = array('id' 
=> '', 'name' => lang('select') . ' ' . $attrib['input_text']);
-                                                       
foreach($attrib['choice'] as $choice)
-                                                       {
-                                                               $_values[]  = 
array
-                                                               (
-                                                                       'id'    
=> $choice['id'],
-                                                                       'name'  
=> htmlspecialchars($choice['value'], ENT_QUOTES, 'UTF-8'),
-                                                               );
-                                                       }
-
-
-                                                       
$datatable['actions']['form'][0]['fields']['field'][] = array
-                                                       (
-                                                               'id' => 
"sel_{$attrib['column_name']}",
-                                                               'name' => 
$attrib['column_name'],
-                                                               'value' => 
$attrib['input_text'],
-                                                               'type' => 
'select',
-                                                               'style' => 
'filter',
-                                                               'values' => 
$_values,
-                                                               'onchange'=> 
"onChangeSelect(\"{$attrib['column_name']}\");",
-                                                               'tab_index' => 
$i
-                                                       );
-
-                                                       $i++;
-/*
-                                                       
$datatable['actions']['form'][0]['fields']['field'][] = array
-                                                       (
-                                                               'id' => 
'sel_order_dim1', // testing traditional listbox for long list
-                                                               'name' => 
'order_dim1',
-                                                               'value' => 
lang('order_dim1'),
-                                                               'type' => 
'select',
-                                                               'style' => 
'filter',
-                                                               'values' => 
$this->bo->get_order_dim1($this->order_dim1),
-                                                               'onchange'=> 
'onChangeSelect("order_dim1");',
-                                                               'tab_index' => 
17
-                                                       );
-*/
-                                               }
-                                       }
-                               }
-                               $dry_run = true;
-                       }
-
-                       $request_list = array();
-                       $request_list = $this->bo->read(array('project_id' => 
$project_id,'allrows'=>$this->allrows, 'dry_run' => $dry_run));
-                       $uicols = $this->bo->uicols;
-
-                       $j=0;
-                       if (isset($request_list) && is_array($request_list))
-                       {
-                               foreach($request_list as $request)
-                               {
-                                       for 
($i=0;$i<count($uicols['name']);$i++)
-                                       {
-                                               
if($uicols['input_type'][$i]!='hidden')
-                                               {
-                                                       
if(isset($request['query_location'][$uicols['name'][$i]]))
-                                                       {
-                                                               
$datatable['rows']['row'][$j]['column'][$i]['name']                     = 
$uicols['name'][$i];
-                                                               
$datatable['rows']['row'][$j]['column'][$i]['statustext']               = 
lang('search');
-                                                               
$datatable['rows']['row'][$j]['column'][$i]['value']                    = 
$request[$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']                             
= $request['query_location'][$uicols['name'][$i]];
-                                                       }
-                                                       else
-                                                       {
-                                                               
$datatable['rows']['row'][$j]['column'][$i]['value']                    = 
$request[$uicols['name'][$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');
-
-                                                               
if(isset($uicols['datatype']) && isset($uicols['datatype'][$i]) && 
$uicols['datatype'][$i]=='link' && $request[$uicols['name'][$i]])
-                                                               {
-                                                                       
$datatable['rows']['row'][$j]['column'][$i]['value']            = lang('link');
-                                                                       
$datatable['rows']['row'][$j]['column'][$i]['link']             = 
$request[$uicols['name'][$i]];
-                                                                       
$datatable['rows']['row'][$j]['column'][$i]['target']   = '_blank';
-                                                               }
-                                                       }
-                                               }
-                                               else
-                                               {
-                                                       
$datatable['rows']['row'][$j]['column'][$i]['name']                     = 
$uicols['name'][$i];
-                                                       
$datatable['rows']['row'][$j]['column'][$i]['value']                    = 
$request[$uicols['name'][$i]];
-                                               }
-
-                                               
$datatable['rows']['row'][$j]['hidden'][$i]['value']                    = 
$request[$uicols['name'][$i]];
-                                               
$datatable['rows']['row'][$j]['hidden'][$i]['name']                     = 
$uicols['name'][$i];
-                                       }
-
-                                       if($lookup)
-                                       {
-                                               
$datatable['rows']['row'][$j]['column'][$i + 1]['name']                         
= 'select';
-                                               
$datatable['rows']['row'][$j]['column'][$i + 1]['statustext']           = 
lang('select');
-                                               
$datatable['rows']['row'][$j]['column'][$i + 1]['align']                        
= 'center';
-                                               
$datatable['rows']['row'][$j]['column'][$i + 1]['value']                        
= '<input name="add_request[request_id][]" id="add_request[request_id][]"  
class="myValuesForPHP close_order" type="hidden" value=""/> <input 
type="checkbox" name="add_request[request_id_tmp][]" 
id="add_request[request_id_tmp][]" value="'.$request['request_id'].'" 
class="close_order_tmp">';                                     }
-                                               $j++;
-                               }
-                       }
-
-                       // NO pop-up
-                       $datatable['rowactions']['action'] = array();
-                       if(!$lookup)
-                       {
-                               $parameters = array
-                                       (
-                                               'parameter' => array
-                                               (
-                                                       array
-                                                       (
-                                                               'name'          
=> 'id',
-                                                               'source'        
=> 'request_id'
-                                                       ),
-                                               )
-                                       );
-
-                               if($this->acl_read)
-                               {
-                                       die;
-                               
-                                       $datatable['rowactions']['action'][] = 
array
-                                               (
-                                                       'my_name'               
=> 'view',
-                                                       'text'                  
=> lang('view'),
-                                                       'action'                
=> $GLOBALS['phpgw']->link('/index.php',array
-                                                       (
-                                                               'menuaction'    
=> 'property.uirequest.view'
-                                                       )),
-                                                       'parameters'    => 
$parameters
-                                               );
-                                       $jasper = 
execMethod('property.sojasper.read', array('location_id' => 
$GLOBALS['phpgw']->locations->get_id('property', $this->acl_location)));
-
-                                       foreach ($jasper as $report)
-                                       {
-                                               
$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'
-                                                               )),
-                                                               'parameters'    
                => $parameters
-                                                       );
-                                       }
-
-                               }
-                               if($this->acl_edit)
-                               {
-                                       $datatable['rowactions']['action'][] = 
array
-                                               (
-                                                       'my_name'               
        => 'edit',
-                                                       'text'                  
=> lang('edit'),
-                                                       'action'                
=> $GLOBALS['phpgw']->link('/index.php',array
-                                                       (
-                                                               'menuaction'    
=> 'property.uirequest.edit'
-                                                       )),
-                                                       'parameters'    => 
$parameters
-                                               );
-                               }
-                               if($this->acl_delete)
-                               {
-                                       $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.uirequest.delete'
-                                                       )),
-                                                       'parameters'    => 
$parameters
-                                               );
-                               }
-
-                               if($this->acl_add)
-                               {
-                                       $datatable['rowactions']['action'][] = 
array
-                                               (
-                                                       'my_name'               
        => 'add',
-                                                       'text'                  
=> lang('add'),
-                                                       'action'                
=> $GLOBALS['phpgw']->link('/index.php',array
-                                                       (
-                                                               'menuaction'    
=> 'property.uirequest.edit'
-                                                       ))
-                                               );
-                               }
-                               unset($parameters);
-                       }
-                       else
-                       {
-
-                               $parameters = array
-                                       (
-                                               'parameter' => array
-                                               (
-                                                       array
-                                                       (
-                                                               'name'          
=> 'id',
-                                                               'source'        
=> 'request_id'
-                                                       ),
-                                               )
-                                       );
-
-                               if($this->acl_read)
-                               {
-                                       $datatable['rowactions']['action'][] = 
array
-                                               (
-                                                       'my_name'               
        => 'view',
-                                                       'text'                  
        => lang('view'),
-                                                       'target'                
        => '_blank',
-                                                       'action'                
        => $GLOBALS['phpgw']->link('/index.php',array
-                                                       (
-                                                               'menuaction'    
=> 'property.uirequest.view'
-                                                       )),
-                                                       'parameters'    => 
$parameters
-                                               );
-                               }
-                       }
-
-                       $uicols_count   = count($uicols['descr']);
-
-                       $show_dates     = 
isset($this->config->config_data['request_show_dates']) && 
$this->config->config_data['request_show_dates'] ? 1 : '';
-
-                       for ($i=0;$i<$uicols_count;$i++)
-                       {
-                               if(!$show_dates && $uicols['name'][$i] == 
'start_date')
-                               {
-                                       $uicols['input_type'][$i] = 'hidden';
-                               }
-
-                               //all colums should be have formatter
-                               
$datatable['headers']['header'][$i]['formatter'] = 
($uicols['formatter'][$i]==''?  '""' : $uicols['formatter'][$i]);
-                               
$datatable['headers']['header'][$i]['className'] = $uicols['classname'][$i] ? 
$uicols['classname'][$i] : '';
-                               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']                 = 
$uicols['sortable'][$i];
-                                       
$datatable['headers']['header'][$i]['sort_field']               = 
$uicols['name'][$i];
-
-                                       if($uicols['name'][$i]=='loc1')
-                                       {
-                                               
$datatable['headers']['header'][$i]['sortable']         = true;
-                                               
$datatable['headers']['header'][$i]['sort_field']       = "location_code";
-                                       }
-
-                               }
-                               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';
-                               }
-                       }
-
-                       if($lookup)
-                       {
-                               $i++;
-                               $datatable['headers']['header'][$i]['name']     
                = 'select';
-                               $datatable['headers']['header'][$i]['text']     
                = lang('select');
-                               $datatable['headers']['header'][$i]['visible']  
                = true;
-                               $datatable['headers']['header'][$i]['sortable'] 
                = false;
-                               $datatable['headers']['header'][$i]['format']   
                = '';
-                               $datatable['headers']['header'][$i]['sortable'] 
                = false;
-                               $datatable['headers']['header'][$i]['visible']  
                = true;
-                               
$datatable['headers']['header'][$i]['formatter']                = '""';
-                       }
-
-                       // path for property.js
-                       $property_js = "/property/js/yahoo/property.js";
-
-                       if 
(!isset($GLOBALS['phpgw_info']['server']['no_jscombine']) || 
!$GLOBALS['phpgw_info']['server']['no_jscombine'])
-                       {
-                               $cachedir = 
urlencode($GLOBALS['phpgw_info']['server']['temp_dir']);
-                               $property_js = 
"/phpgwapi/inc/combine.php?cachedir={$cachedir}&type=javascript&files=" . 
str_replace('/', '--', ltrim($property_js,'/'));
-                       }
-
-                       $datatable['property_js'] = 
$GLOBALS['phpgw_info']['server']['webserver_url'] . $property_js;
-
-                       // Pagination and sort values
-                       $datatable['pagination']['records_start']       = 
(int)$this->bo->start;
-                       $datatable['pagination']['records_limit']       = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'];
-                       $datatable['pagination']['records_total']       = 
$this->bo->total_records;
-
-                       if($dry_run)
-                       {
-                               $datatable['pagination']['records_returned'] = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'];
-                       }
-                       else
-                       {
-                               $datatable['pagination']['records_returned']= 
count($request_list);
-                       }
-
-                       $appname                                        = 
lang('request');
-                       $function_msg                           = lang('list 
request');
-
-                       if ( !$this->start && !$this->order)
-                       {
-                               $datatable['sorting']['currentPage']    = 1;
-                               $datatable['sorting']['order']  = 'request_id'; 
// name key Column in myColumnDef
-                               $datatable['sorting']['sort']   = 'asc'; // ASC 
/ DESC
-                       }
-                       else
-                       {
-                               $datatable['sorting']['currentPage']    = 
phpgw::get_var('currentPage');
-                               $datatable['sorting']['order']  = $this->order; 
// name of column of Database
-                               $datatable['sorting']['sort']   = $this->sort; 
// ASC / DESC
-                       }
-
-                       //-- 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'],
-                                       'currentPage'                   => 
$datatable['sorting']['currentPage'],
-                                       'records'                               
=> array(),
-                                       'sum_investment'                => 
$this->bo->sum_investment,
-                                       'sum_operation'                 => 
$this->bo->sum_operation,
-                                       'sum_potential_grants'  => 
$this->bo->sum_potential_grants,
-                                       'sum_consume'                   => 
$this->bo->sum_consume
-
-                               );
-
-                       // values for datatable
-                       if(isset($datatable['rows']['row']) && 
is_array($datatable['rows']['row']))
-                       {
-//_debug_array($datatable['rows']);
-                               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']))
-                       {
-                               $json ['rights'] = 
$datatable['rowactions']['action'];
-                       }
-
-                       if( phpgw::get_var('phpgw_return_as') == 'json' )
-                       {
-                               return $json;
-                       }
-
-
-                       $datatable['json_data'] = json_encode($json);
-                       //-------------------- JSON CODE ----------------------
-
-                       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('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 template variables and process XSLT
-                       $template_vars = array();
-                       $template_vars['datatable'] = $datatable;
-                       
$GLOBALS['phpgw']->xslttpl->add_file(array('datatable'));
-                       $GLOBALS['phpgw']->xslttpl->set_var('phpgw', 
$template_vars);
-
-                       if ( !isset($GLOBALS['phpgw']->css) || 
!is_object($GLOBALS['phpgw']->css) )
-                       {
-                               $GLOBALS['phpgw']->css = 
createObject('phpgwapi.css');
-                       }
-                       // 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->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');
-
-                       //Title of Page
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('property') . ' - ' . $appname . ': ' . $function_msg;
-
-                       // Prepare YUI Library
-                       $GLOBALS['phpgw']->js->validate_file( 'yahoo', 
'request.index', 'property' );
-               }
-
-
                function priority_key()
                {
                        if(!$this->acl_manage)




reply via email to

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