[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [12541] remove old code
From: |
Sigurd Nes |
Subject: |
[Fmsystem-commits] [12541] remove old code |
Date: |
Tue, 06 Jan 2015 15:31:28 +0000 |
Revision: 12541
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=12541
Author: sigurdne
Date: 2015-01-06 15:31:27 +0000 (Tue, 06 Jan 2015)
Log Message:
-----------
remove old code
Modified Paths:
--------------
branches/dev-syncromind/property/inc/class.uitts.inc.php
Modified: branches/dev-syncromind/property/inc/class.uitts.inc.php
===================================================================
--- branches/dev-syncromind/property/inc/class.uitts.inc.php 2015-01-06
15:22:27 UTC (rev 12540)
+++ branches/dev-syncromind/property/inc/class.uitts.inc.php 2015-01-06
15:31:27 UTC (rev 12541)
@@ -32,8 +32,6 @@
* @package property
*/
- //phpgw::import_class('phpgwapi.yui');
-
phpgw::import_class('phpgwapi.uicommon_jquery');
phpgw::import_class('phpgwapi.jquery');
@@ -772,9 +770,6 @@
return $this->query();
}
- //self::add_javascript('phpgwapi', 'yahoo',
'datatable.js');
- // phpgwapi_yui::load_widget('datatable');
- // phpgwapi_yui::load_widget('paginator');
self::add_javascript('phpgwapi', 'jquery',
'editable/jquery.jeditable.js');
self::add_javascript('phpgwapi', 'jquery',
'editable/jquery.dataTables.editable.js');
self::add_javascript('property', 'portico',
'tts.index.js');
@@ -957,1002 +952,7 @@
self::render_template_xsl('datatable_jquery', $data);
}
-
- function indexyahoo()
- {
- if($this->tenant_id)
- {
-
//$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=>
'property.uitts.index2'));
- }
-
- if(!$this->acl_read)
- {
-
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=>
'property.uilocation.stop', 'perm'=> 1, 'acl_location'=> $this->acl_location));
- }
-
- $this->save_sessiondata();
- $dry_run = false;
- $second_display = phpgw::get_var('second_display',
'bool');
-
- $default_district =
(isset($GLOBALS['phpgw_info']['user']['preferences']['property']['default_district'])?$GLOBALS['phpgw_info']['user']['preferences']['property']['default_district']:'');
- //FIXME: differentiate mainsreen and helpdesk if this
should be used.
- $default_status =
'';//isset($GLOBALS['phpgw_info']['user']['preferences']['property']['tts_status'])?$GLOBALS['phpgw_info']['user']['preferences']['property']['tts_status']:'';
- $start_date = urldecode($this->start_date);
- $end_date =
urldecode($this->end_date);
-
- if ($default_district && !$second_display &&
!$this->district_id)
- {
- $this->bo->district_id = $default_district;
- $this->district_id =
$default_district;
- }
-
- if ($default_status && !$second_display)
- {
- $this->bo->status_id = $default_status;
- $this->status_id =
$default_status;
- }
-
- $bgcolor_array[1] = '#da7a7a';
- $bgcolor_array[2] = '#dababa';
- $bgcolor_array[3] = '#dadada';
-
- $lookup = phpgw::get_var('lookup',
'bool');
- $from = phpgw::get_var('from');
- $start_date =
urldecode(phpgw::get_var('start_date'));
- $end_date =
urldecode(phpgw::get_var('end_date'));
- $allrows = phpgw::get_var('allrows',
'bool');
-
- $datatable = array();
- $order_read = $this->acl->check('.ticket.order',
PHPGW_ACL_READ, 'property');
-
- 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.uitts.index',
- 'query'
=> $this->query,
- 'district_id' =>
$this->district_id,
- 'part_of_town_id' =>
$this->part_of_town_id,
- 'cat_id'
=> $this->cat_id,
- 'status_id'
=> $this->status_id,
- 'p_num'
=> $this->p_num
- )
- );
-
- $datatable['config']['allow_allrows'] = true;
-
- $datatable['config']['base_java_url'] =
"menuaction:'property.uitts.index',"
- ."second_display:1,"
- ."sort: '{$this->sort}',"
- ."order: '{$this->order}',"
- ."cat_id:'{$this->cat_id}',"
- ."vendor_id:'{$this->vendor_id}',"
- ."status_id: '{$this->status_id}',"
- ."reported_by: '{$this->reported_by}',"
- ."user_id: '{$this->user_id}',"
- ."query: '{$this->query}',"
- ."p_num: '{$this->p_num}',"
- ."district_id: '{$this->district_id}',"
- ."part_of_town_id:
'{$this->part_of_town_id}',"
- ."start_date: '{$start_date}',"
- ."end_date: '{$end_date}',"
- ."location_code:
'{$this->location_code}',"
- ."allrows:'{$this->allrows}'";
-
- $link_data = array
- (
- 'menuaction' =>
'property.uitts.index',
- 'second_display' => true,
- 'sort'
=> $this->sort,
- 'order'
=> $this->order,
- 'cat_id'
=> $this->cat_id,
- 'vendor_id'
=> $this->vendor_id,
- 'status_id'
=> $this->status_id,
- 'user_id'
=> $this->user_id,
- 'reported_by' =>
$this->reported_by,
- 'query'
=> $this->query,
- 'district_id' =>
$this->district_id,
- 'part_of_town_id' =>
$this->part_of_town_id,
- 'start_date' =>
$start_date,
- 'end_date'
=> $end_date,
- 'location_code' =>
$this->location_code,
- 'allrows'
=> $this->allrows
- );
-
- $group_filters = 'select';
-
- $values_combo_box = array();
-
- $values_combo_box[3] =
$this->bo->filter(array('format' => $group_filters, 'filter'=>
$this->status_id,'default' => 'O'));
-
-
if(isset($this->bo->config->config_data['tts_lang_open']) &&
$this->bo->config->config_data['tts_lang_open'])
- {
- array_unshift
($values_combo_box[3],array
('id'=>'O2','name'=>$this->bo->config->config_data['tts_lang_open']));
- }
- $default_value = array
('id'=>'','name'=>lang('Open'));
- array_unshift
($values_combo_box[3],$default_value);
-
- if(!$this->simple)
- {
- $values_combo_box[0] =
$this->cats->formatted_xslt_list(array('format'=>'filter','selected' =>
$this->cat_id,'globals' => true,'use_acl' => $this->_category_acl));
- $default_value = array
('cat_id'=>'','name'=> lang('no category'));
- array_unshift
($values_combo_box[0]['cat_list'],$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->bocommon->select_part_of_town('filter',$this->part_of_town_id,$this->district_id);
- $default_value = array
('id'=>'','name'=>lang('no part of town'));
- array_unshift
($values_combo_box[2],$default_value);
-
- $values_combo_box[4] =
$this->bocommon->get_user_list_right2('filter',PHPGW_ACL_EDIT,$this->user_id,$this->acl_location);
- array_unshift
($values_combo_box[4],array('id'=>$GLOBALS['phpgw_info']['user']['account_id'],'name'=>lang('my
assigned tickets')));
- $_my_negative_self = (-1 *
$GLOBALS['phpgw_info']['user']['account_id']);
-/*
- $default_value = array
- (
- 'id' =>
$_my_negative_self,
- 'name' => lang('my
submitted tickets'),
- 'selected' =>
$_my_negative_self == $this->user_id
- );
- unset($_my_negative_self);
- array_unshift
($values_combo_box[4],$default_value);
-*/
- $default_value =
array('id'=>'','name'=>lang('assigned to'));
- array_unshift
($values_combo_box[4],$default_value);
-
- $values_combo_box[5] =
$this->bo->get_reported_by($this->reported_by);
- array_unshift
($values_combo_box[5],array('id'=>$GLOBALS['phpgw_info']['user']['account_id'],'name'=>lang('my
submitted tickets')));
- array_unshift
($values_combo_box[5],array('id'=>'','name'=>lang('reported by')));
-
-
- $datatable['actions']['form'] = array
- (
- array
- (
- 'action'
=> $GLOBALS['phpgw']->link('/index.php',
- array
- (
-
'menuaction' => 'property.uitts.index',
-
'second_display' => $second_display,
-
'district_id' => $this->district_id,
-
'part_of_town_id' => $this->part_of_town_id,
-
'cat_id' => $this->cat_id,
-
'vendor_id' => $this->vendor_id,
-
'status' => $this->status
- )
- ),
- '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 STATUS
-
'id' => 'btn_district_id',
-
'name' => 'district_id',
-
'value' => lang('District'),
-
'type' => 'button',
-
'style' => 'filter',
-
'tab_index' => 2
- ),
- array
- (
//boton PART OF TOWN
-
'id' => 'btn_part_of_town_id',
-
'name' => 'part_of_town_id',
-
'value' => lang('Part of Town'),
-
'type' => 'button',
-
'style' => 'filter',
-
'tab_index' => 3
- ),
- array
- (
//boton HOUR CATEGORY
-
'id' => 'btn_status_id',
-
'name' => 'status_id',
-
'value' => lang('Status'),
-
'type' => 'button',
-
'style' => 'filter',
-
'tab_index' => 4
- ),
- array
- (
//boton USER
-
// 'id' => 'btn_user_id',
-
'id' => 'sel_user_id', // testing traditional listbox for long list
-
'name' => 'user_id',
-
'value' => lang('User'),
-
'type' => 'select',
-
'style' => 'filter',
-
'values' => $values_combo_box[4],
-
'onchange'=> 'onChangeSelect("user_id");',
-
'tab_index' => 5
- ),
- array
- (
//boton USER
-
// 'id' => 'btn_user_id',
-
'id' => 'sel_reported_by', // testing traditional listbox for long list
-
'name' => 'reported_by',
-
'value' => lang('reported by'),
-
'type' => 'select',
-
'style' => 'filter',
-
'values' => $values_combo_box[5],
-
'onchange'=> 'onChangeSelect("reported_by");',
-
'tab_index' => 6
- ),
- 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.uitts.columns'
-
)
-
)."','','width=300,height=600,scrollbars=1')",
-
'value' => lang('columns'),
-
'tab_index' => 12
- ),
- array
- (
-
'type' => 'button',
-
'id' => 'btn_export',
-
'value' => lang('download'),
-
'tab_index' => 11
- ),
- array
- (
-
'type' => 'button',
-
'id' => 'btn_new',
-
'value' => lang('add'),
-
'tab_index' => 10
- ),
- array
- (
//hidden start_date
-
'type' => 'hidden',
-
'id' => 'start_date',
-
'value' => $start_date
- ),
- array
- (
//hidden end_date
-
'type' => 'hidden',
-
'id' => 'end_date',
-
'value' => $end_date
- ),
- array
- (//for
link "None",
-
'type'=> 'label_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'))."','','width=350,height=250')",
-
'value' => lang('Date search'),
-
'tab_index' => 9
- ),
- array
- (
//boton SEARCH
-
'id' => 'btn_search',
-
'name' => 'search',
-
'value' => lang('search'),
-
'type' => 'button',
-
'tab_index' => 8
- ),
- array
- ( //
TEXT INPUT
-
'name' => 'query',
-
'id' => 'txt_query',
-
'value' => $this->query,
-
'type' => 'text',
-
'onkeypress' => 'return pulsar(event)',
-
'size' => 28,
-
'tab_index' => 7
- )
- ),
- '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])
- ),
- array
- ( //div
values combo_box_2
-
'id' => 'values_combo_box_2',
-
'value' => $this->bocommon->select2String($values_combo_box[2])
- ),
- 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])
- )
- )
- )
- )
- );
-
- if($order_read)
- {
-
$datatable['actions']['form'][0]['fields']['field'][] = array
- (
- 'id' =>
'sel_vendor_id', // testing traditional listbox for long list
- 'name'
=> 'vendor_id',
- 'value'
=> lang('vendor'),
- 'type'
=> 'select',
- 'style'
=> 'filter',
-
'values' => $this->bo->get_vendors($this->vendor_id),
-
'onchange'=> 'onChangeSelect("vendor_id");',
-
'tab_index' => 12
- );
-
$datatable['actions']['form'][0]['fields']['field'][] = array
- (
- 'id' =>
'sel_ecodimb', // testing traditional listbox for long list
- 'name'
=> 'ecodimb',
- 'value'
=> lang('dimb'),
- 'type'
=> 'select',
- 'style'
=> 'filter',
-
'values' => $this->bo->get_ecodimb($this->ecodimb),
-
'onchange'=> 'onChangeSelect("ecodimb");',
-
'tab_index' => 13
- );
-
$datatable['actions']['form'][0]['fields']['field'][] = array
- (
- 'id' =>
'sel_b_account', // testing traditional listbox for long list
- 'name'
=> 'b_account',
- 'value'
=> lang('budget account'),
- 'type'
=> 'select',
- 'style'
=> 'filter',
-
'values' => $this->bo->get_b_account($this->b_account),
-
'onchange'=> 'onChangeSelect("b_account");',
-
'tab_index' => 14
- );
-
-
- $_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('.b_account', $filter_buildingpart))
- {
- $_filter_buildingpart =
array("filter_{$filter_key}" => 1);
- }
-
-
$datatable['actions']['form'][0]['fields']['field'][] = array
- (
- 'id' =>
'sel_building_part', // testing traditional listbox for long list
- 'name'
=> 'building_part',
- 'value'
=> lang('building part'),
- 'type'
=> 'select',
- 'style'
=> 'filter',
-
//'values' => $this->bo->get_building_part($this->building_part),
-
'values' => $this->bocommon->select_category_list(array('type'=>
'building_part','selected' =>$this->building_part, 'order' => 'id',
'id_in_name' => 'num', 'filter' => $_filter_buildingpart)),
-
'onchange'=> 'onChangeSelect("building_part");',
-
'tab_index' => 15
- );
-
- if (
isset($GLOBALS['phpgw_info']['user']['preferences']['property']['tts_branch_list'])
&&
$GLOBALS['phpgw_info']['user']['preferences']['property']['tts_branch_list']==1)
- {
-
$datatable['actions']['form'][0]['fields']['field'][] = array
- (
- 'id' =>
'sel_branch_id', // testing traditional listbox for long list
- 'name'
=> 'branch_id',
- 'value'
=> lang('branch'),
- 'type'
=> 'select',
- 'style'
=> 'filter',
-
'values' => $this->bo->get_branch($this->branch_id),
-
'onchange'=> 'onChangeSelect("branch_id");',
-
'tab_index' => 16
- );
- }
-
-
$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
- );
- }
- }
- else
- {
- $datatable['actions']['form'] = array
- (
- array
- (
- 'action'
=> $GLOBALS['phpgw']->link('/index.php',
- array
- (
-
'menuaction' => 'property.uitts.index',
-
'second_display' => $second_display,
-
'status' => $this->status
- )
- ),
- 'fields' => array
- (
- 'field' => array
- (
- array
- (
//boton HOUR CATEGORY
-
'id' => 'btn_status_id',
-
'name' => 'status_id',
-
'value' => lang('Status'),
-
'type' => 'button',
-
'style' => 'filter',
-
'tab_index' => 3
- ),
- 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' => 6
- ),
- array
- ( //
TEXT INPUT
-
'name' => 'query',
-
'id' => 'txt_query',
-
'value' => '',//$query,
-
'type' => 'text',
-
'onkeypress' => 'return pulsar(event)',
-
'size' => 28,
-
'tab_index' => 5
- )
- ),
- 'hidden_value'
=> array
- (
- array
- ( //div
values combo_box_0
-
'id' => 'values_combo_box_0',
-
'value' => $this->bocommon->select2String($values_combo_box[3])
- )
- )
- )
- )
- );
- }
- $dry_run = true;
- }
-
- $ticket_list = $this->bo->read($start_date,
$end_date,'',$dry_run);
-
- $this->bo->get_origin_entity_type();
- $uicols_related = $this->bo->uicols_related;
- //_debug_array($uicols_related);
- $uicols = array();
-
- $uicols['name'][] = 'priority';
- $uicols['descr'][] = lang('priority');
- $uicols['name'][] = 'hidden_id';
- $uicols['descr'][] = 'hidden_id';
- $uicols['name'][] = 'id';
- $uicols['descr'][] = lang('id');
- $uicols['name'][] = 'bgcolor';
- $uicols['descr'][] = lang('bgcolor');
- $uicols['name'][] = 'subject';
- $uicols['descr'][] = lang('subject');
-/*
- $uicols['name'][] = 'location_code';
- $uicols['descr'][] = lang('location code');
-*/
- $location_types =
execMethod('property.soadmin_location.select_location_type');
- $level_assigned =
isset($this->bo->config->config_data['list_location_level']) &&
$this->bo->config->config_data['list_location_level'] ?
$this->bo->config->config_data['list_location_level'] : array();
-
- static $location_cache = array();
-
- foreach ( $location_types as $dummy => $level)
- {
- if ( in_array($level['id'], $level_assigned))
- {
- $uicols['name'][] =
"loc{$level['id']}_name";
- $uicols['descr'][] =
$level['name'];
- if($level['id'] > 1)
- {
- foreach ($ticket_list as &
$_ticket)
- {
- $_location_code_arr =
explode('-', $_ticket['location_code']);
- $__location_code_arr =
array();
- for ($k=0;
$k<$level['id']; $k++)
- {
-
if(isset($_location_code_arr[$k]))
- {
-
$__location_code_arr[] = $_location_code_arr[$k];
- }
- }
- $_location_code =
implode('-', $__location_code_arr);
-
-
if(!$_ticket["loc{$level['id']}_name"] = $location_cache[$_location_code])
- {
- $location_data
= execMethod('property.solocation.read_single', $_location_code);
-
$_ticket["loc{$level['id']}_name"] = $location_data["loc{$level['id']}_name"];
-
$location_cache[$_location_code] = $location_data["loc{$level['id']}_name"];
- }
- }
- unset($_ticket);
- }
- }
- }
-
- $uicols['name'][] = 'entry_date';
- $uicols['descr'][] = lang('entry date');
-
- $custom_cols =
isset($GLOBALS['phpgw_info']['user']['preferences']['property']['ticket_columns'])
&& $GLOBALS['phpgw_info']['user']['preferences']['property']['ticket_columns']
? $GLOBALS['phpgw_info']['user']['preferences']['property']['ticket_columns'] :
array();
- $columns = $this->bo->get_columns();
-
-//_debug_array($custom_cols);die();
- foreach ($custom_cols as $col)
- {
- $uicols['name'][] = $col;
- $uicols['descr'][] =
$columns[$col]['name'];
- }
-
-
- $uicols['name'][] = 'child_date';
- $uicols['descr'][] = lang('child date');
- $uicols['name'][] = 'link_view';
- $uicols['descr'][] = lang('link view');
- $uicols['name'][] = 'lang_view_statustext';
- $uicols['descr'][] = lang('lang view statustext');
- $uicols['name'][] = 'text_view';
- $uicols['descr'][] = lang('text view');
-
- $count_uicols_name = count($uicols['name']);
-
-
- $j = 0;
- $k = 0;
- if(is_array($ticket_list))
- {
- $status['X'] = array
- (
- 'status'
=> lang('closed'),
- );
- $status['O'] = array
- (
- 'status'
=> isset($this->bo->config->config_data['tts_lang_open']) &&
$this->bo->config->config_data['tts_lang_open'] ?
$this->bo->config->config_data['tts_lang_open'] : lang('Open'),
- );
- $status['C'] = array
- (
- 'status'
=> lang('closed'),
- );
-
- $custom_status =
$this->bo->get_custom_status();
-
- foreach($custom_status as $custom)
- {
- $status["C{$custom['id']}"] = array
- (
- 'status'
=> $custom['name'],
- );
- }
-
- $view_action =
$GLOBALS['phpgw']->link('/index.php',array('menuaction' =>
'property.uitts.view','id'=> $ticket['id']));
- foreach($ticket_list as $ticket)
- {
- for ($k=0;$k<$count_uicols_name;$k++)
- {
- if($uicols['name'][$k] ==
'status' && array_key_exists($ticket[$uicols['name'][$k]],$status))
- {
-
$datatable['rows']['row'][$j]['column'][$k]['name'] =
$uicols['name'][$k];
-
$datatable['rows']['row'][$j]['column'][$k]['value'] =
$status[$ticket[$uicols['name'][$k]]]['status'];
- }
- else
- {
-
$datatable['rows']['row'][$j]['column'][$k]['name'] =
$uicols['name'][$k];
-
$datatable['rows']['row'][$j]['column'][$k]['value'] =
$ticket[$uicols['name'][$k]];
- }
- if($uicols['name'][$k] == 'id'
|| $uicols['name'][$k] == 'entry_date')
- {
-
$datatable['rows']['row'][$j]['column'][$k]['format'] = 'link';
-
$datatable['rows']['row'][$j]['column'][$k]['link'] =
"{$view_action}&id={$ticket['id']}";
-
$datatable['rows']['row'][$j]['column'][$k]['value'] =
$ticket[$uicols['name'][$k]] . $ticket['new_ticket'];
-
$datatable['rows']['row'][$j]['column'][$k]['target'] = '_blank';
- }
-
- if($uicols['name'][$k] ==
'hidden_id')//hidden
- {
-
$datatable['rows']['row'][$j]['column'][$k]['value'] = $ticket['id'];
- }
-
-
- $n = 0;
- foreach($uicols_related as
$related)
- {
- if($uicols['name'][$k]
== $related)
- {
-
$datatable['rows']['row'][$j]['column'][$k]['format'] = 'link';
-
$datatable['rows']['row'][$j]['column'][$k]['link'] =
$ticket['child_date'][$n]['date_info'][0]['link'];
-
$datatable['rows']['row'][$j]['column'][$k]['value'] =
$ticket['child_date'][$n]['date_info'][0]['entry_date'];
-
$datatable['rows']['row'][$j]['column'][$k]['statustext'] =
$ticket['child_date'][$n]['statustext'];
-
$datatable['rows']['row'][$j]['column'][$k]['target'] = '_blank';
-
- }
- $n++;
- }
- }
- $j++;
- }
- }
-
- $parameters = array
- (
- 'parameter' => array
- (
- array
- (
- 'name' => 'id',
- 'source' =>
'hidden_id'
- ),
- )
- );
-
- if($this->acl_read)
- {
- $datatable['rowactions']['action'][] = array
- (
- 'my_name'
=> 'view',
- 'statustext' => lang('view
the ticket'),
- 'text' =>
lang('view'),
- 'action' =>
$GLOBALS['phpgw']->link('/index.php',array
- (
- 'menuaction' =>
'property.uitts.view'
- )),
- 'parameters' => $parameters
- );
-
- $datatable['rowactions']['action'][] = array
- (
- 'my_name'
=> 'print',
- 'statustext' => lang('print
the ticket'),
- 'text' =>
lang('print view'),
- 'action' =>
$GLOBALS['phpgw']->link('/index.php',array
- (
- 'menuaction' =>
'property.uitts._print',
- 'target'
=> '_blank'
- )),
- '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_delete)
- {
- $datatable['rowactions']['action'][] = array
- (
- 'my_name'
=> 'delete',
- 'statustext' => lang('delete
the ticket'),
- 'text' =>
lang('delete'),
- 'confirm_msg' => lang('do you
really want to delete this ticket'),
- 'action' =>
$GLOBALS['phpgw']->link('/index.php',array
- (
- 'menuaction' =>
'property.uitts.delete'
- )),
- 'parameters' => $parameters
- );
- }
-
-
if(isset($GLOBALS['phpgw_info']['user']['preferences']['property']['tts_status_link'])
- &&
$GLOBALS['phpgw_info']['user']['preferences']['property']['tts_status_link'] ==
'yes'
- && $this->acl_edit)
- {
-
- unset($status['C']);
- foreach ($status as $status_code =>
$status_info)
- {
- $datatable['rowactions']['action'][] =
array
- (
- 'my_name'
=> 'status',
- 'statustext' =>
$status_info['status'],
- 'text'
=> lang('change to') . ' status: ' .$status_info['status'],
- 'confirm_msg' =>
lang('do you really want to change the status to %1',$status_info['status']),
- 'action'
=> $GLOBALS['phpgw']->link('/index.php',array
- (
- 'menuaction'
=> 'property.uitts.edit_status',
- 'edit_status'
=> true,
- 'new_status'
=> $status_code,
-
'second_display' => true,
- 'sort'
=> $this->sort,
- 'order'
=> $this->order,
- 'cat_id'
=> $this->cat_id,
- 'filter'
=> $this->filter,
- 'user_filter'
=> $this->user_filter,
- 'query'
=> $this->query,
- 'district_id'
=> $this->district_id,
- 'allrows'
=> $this->allrows,
- 'delete'
=> 'dummy'// FIXME to trigger the json in property.js.
- )),
- 'parameters' =>
$parameters
- );
- }
-
- $_priorities = $this->bo->get_priority_list();
- foreach ($_priorities as $_priority =>
$_priority_info)
- {
- $datatable['rowactions']['action'][] =
array
- (
- 'my_name' =>
'priority',
- 'statustext' =>
$_priority_info['name'],
- 'text' =>
lang('change to') . ' ' . lang('priority') .': ' .$_priority_info['name'],
- 'confirm_msg' => lang('do you
really want to change the priority to %1',$_priority_info['name']),
- 'action' =>
$GLOBALS['phpgw']->link('/index.php',array
- (
- 'menuaction'
=> 'property.uitts.edit_priority',
- 'edit_status'
=> true,
- 'new_priority'
=> $_priority,
- 'second_display'
=> true,
- 'sort'
=> $this->sort,
- 'order'
=> $this->order,
- 'cat_id'
=> $this->cat_id,
- 'filter'
=> $this->filter,
- 'user_filter'
=> $this->user_filter,
- 'query'
=> $this->query,
- 'district_id'
=> $this->district_id,
- 'allrows'
=> $this->allrows,
- 'delete'
=> 'dummy'// FIXME to trigger the json in property.js.
- )),
- 'parameters' => $parameters
- );
- }
- }
-
-
- if($this->acl_add)
- {
- $datatable['rowactions']['action'][] = array
- (
- 'my_name'
=> 'add',
- 'statustext' => lang('Add
new ticket'),
- 'text' =>
lang('add'),
- 'action' =>
$GLOBALS['phpgw']->link('/index.php',array
- (
- 'menuaction' =>
'property.uitts.add'
- ))
- );
- }
-
-
- $uicols_formatter = array
- (
- 'estimate' => 'FormatterRight',
- 'actual_cost' => 'FormatterRight',
- 'difference' => 'FormatterRight',
- );
-
- unset($parameters);
- for ($i=0;$i<$count_uicols_name;$i++)
- {
- // if($uicols['input_type'][$i]!='hidden')
- {
-
$datatable['headers']['header'][$i]['formatter'] =
isset($uicols_formatter[$uicols['name'][$i]]) &&
$uicols_formatter[$uicols['name'][$i]] ? $uicols_formatter[$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]['sortable'] = false;
-//
$datatable['headers']['header'][$i]['width'] =
(int)$uicols['width'][$i];
- if($uicols['name'][$i]=='priority' ||
$uicols['name'][$i]=='id' || $uicols['name'][$i]=='assignedto'
- ||
$uicols['name'][$i]=='finnish_date'|| $uicols['name'][$i]=='user'||
$uicols['name'][$i]=='entry_date'
- || $uicols['name'][$i]=='order_id'||
$uicols['name'][$i]=='modified_date')
- {
-
$datatable['headers']['header'][$i]['sortable'] = true;
-
$datatable['headers']['header'][$i]['sort_field'] = $uicols['name'][$i];
- }
- if($uicols['name'][$i]=='text_view' ||
$uicols['name'][$i]=='bgcolor' || $uicols['name'][$i]=='child_date' ||
$uicols['name'][$i]== 'link_view' ||
$uicols['name'][$i]=='lang_view_statustext' || $uicols['name'][$i]=='hidden_id')
- {
-
$datatable['headers']['header'][$i]['visible'] = false;
-
$datatable['headers']['header'][$i]['format'] = 'hidden';
- }
- }
- }
-
- //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'];
- if($dry_run)
- {
- $datatable['pagination']['records_returned'] =
$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'];
- }
- else
- {
- $datatable['pagination']['records_returned']=
count($ticket_list);
- }
- $datatable['pagination']['records_total'] =
$this->bo->total_records;
-
- $datatable['sorting']['order'] =
phpgw::get_var('order', 'string'); // Column
-
- $appname
= lang('helpdesk');
- $function_msg =
lang('list ticket');
-
- if ( (phpgw::get_var("start")== "") &&
(phpgw::get_var("order",'string')== ""))
- {
- $datatable['sorting']['order']
= 'entry_date'; // name key Column in myColumnDef
- $datatable['sorting']['sort']
= 'desc'; // ASC / DESC
- }
- else
- {
- $datatable['sorting']['order']
= phpgw::get_var('order', 'string'); // name of column of Database
- $datatable['sorting']['sort']
= phpgw::get_var('sort', 'string'); // 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'],
- 'records'
=> array(),
- 'show_sum_estimate' =>
in_array('estimate', $custom_cols),
- 'show_sum_actual_cost' =>
in_array('actual_cost', $custom_cols),
- 'show_sum_difference' =>
in_array('difference', $custom_cols),
- 'sum_budget' =>
$this->bo->sum_budget,
- 'sum_actual_cost' =>
$this->bo->sum_actual_cost,
- 'sum_difference' =>
$this->bo->sum_difference,
- );
-
- // 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" && isset($column['java_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']."' title =
'{$column['statustext']}'>" .$column['value']."</a>";
- }
- else
- {
-
$json_row[$column['name']] = $column['value'];
- }
-
- if($column['name'] ==
'priority')
- {
- $_value =
$column['value'];//str_repeat("||", abs(6 - 2*$column['value'])) .
$column['value'];
-
$json_row[$column['name']] = $_value;
- switch($column['value'])
- {
- case 1:
-
$json_row[$column['name']] = "<div
style='background-color:".$bgcolor_array[1].";'>".$_value."</div>";
- break;
- case 2:
-
$json_row[$column['name']] = "<div
style='background-color:".$bgcolor_array[2].";'>".$_value."</div>";
- break;
- case 3:
-
$json_row[$column['name']] = "<div
style='background-color:".$bgcolor_array[3].";'>".$_value."</div>";
- break;
- }
- unset($_value);
-
- }
- }
- $json['records'][] = $json_row;
- }
- }
-
- // values for control select
- $opt_cb_depend =
$this->bocommon->select_part_of_town('filter',$this->part_of_town_id,$this->district_id);
- $default_value = array ('id'=>'','name'=>'!no part of
town');
- array_unshift ($opt_cb_depend,$default_value);
- $json['hidden']['dependent'][] = array ( 'id' =>
$this->part_of_town_id,
- 'value' =>
$this->bocommon->select2String($opt_cb_depend)
- );
- // 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 ----------------------
-
- // 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');
- }
-
-// 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('paginator');
-
- // 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/paginator/assets/skins/sam/paginator.css');
-
$GLOBALS['phpgw']->css->add_external_file('phpgwapi/js/yahoo/container/assets/skins/sam/container.css');
-
- $GLOBALS['phpgw_info']['flags']['app_header'] =
lang('property') . ' - ' . $appname . ': ' . $function_msg;
-
- $GLOBALS['phpgw']->js->validate_file( 'yahoo',
$this->simple ? 'tts.index.simple' : 'tts.index' , 'property' );
-
- }
-
function add()
{
if(!$this->acl_add)
@@ -2409,7 +1409,6 @@
}
-
function view()
{
if(!$this->acl_read)
@@ -3426,7 +2425,7 @@
'td_count'
=> '""',
'base_java_url'
=> "{menuaction:'property.uitts.update_data',id:{$id}}",
'base_java_notify_url'
=>
"{menuaction:'property.notify.update_data',location_id:{$location_id},location_item_id:'{$id}'}",
- 'property_js'
=> json_encode($GLOBALS['phpgw_info']['server']['webserver_url'] .
$property_js),
+ // 'property_js'
=> json_encode($GLOBALS['phpgw_info']['server']['webserver_url'] .
$property_js),
'value_origin'
=> $ticket['origin'],
'value_target'
=> $ticket['target'],
'value_finnish_date'
=> $ticket['finnish_date'],
@@ -3446,7 +2445,6 @@
'user_list'
=>
$this->bocommon->get_user_list_right2('select',4,$ticket['assignedto'],$this->acl_location),
'lang_no_group'
=> lang('No group'),
-// 'group_list'
=>
$this->bocommon->get_group_list('select',$ticket['group_id'],$start=-1,$sort='ASC',$order='account_firstname',$query='',$offset=-1),
'group_list'
=> $this->bo->get_group_list($ticket['group_id']),
'select_group_name'
=> 'values[group_id]',
@@ -3513,23 +2511,14 @@
);
- //---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('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->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');
-// $GLOBALS['phpgw']->js->validate_file( 'yahoo',
'tts.view', 'property' );
+ */
self::add_javascript('property', 'portico',
'tts.view.js');
$this->_insert_custom_js();
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [12541] remove old code,
Sigurd Nes <=