Commit da505248 authored by Frank Bergmann's avatar Frank Bergmann

- Gantt Editor: Now adding DynFields to GanttEditor

parent f23ea063
......@@ -135,3 +135,77 @@ ad_proc -public im_sencha_sql_to_store {
}
# ----------------------------------------------------------------------
# List of add-on dynfields
# ---------------------------------------------------------------------
ad_proc -public im_sencha_dynfields {
-object_type:required
} {
Returns a cached list of DynFields for each object type
} {
set dynfield_sql "
select aa.attribute_name,
aa.pretty_name,
dw.widget_name
from acs_attributes aa,
im_dynfield_attributes da,
im_dynfield_widgets dw
where aa.attribute_id = da.acs_attribute_id and
da.widget_name = dw.widget_name and
aa.object_type = '$object_type' and
aa.attribute_name not in (
'billable_units',
'company_id',
'cost_center_id',
'creation_date',
'creation_ip',
'creation_user',
'deadline_date',
'description',
'effort_driven_p',
'effort_driven_type_id',
'end_date',
'expanded',
'gantt_project_id',
'icon',
'invoice_id',
'last_modified',
'level',
'lock_date',
'lock_ip',
'lock_user',
'material_id',
'milestone_p',
'modifying_ip',
'modifying_user',
'note',
'object_type',
'on_track_status_id',
'parent_id',
'percent_completed',
'planned_units',
'predecessors',
'priority',
'project_lead_id',
'project_name',
'project_nr',
'project_status_id',
'project_type_id',
'scheduling_constraint_date',
'scheduling_constraint_id',
'sort_order',
'start_date',
'successors',
'task_id',
'tree_sortkey',
'uom_id'
)
"
set tuples [util_memoize [list db_list_of_lists dynfield $dynfield_sql] 1]
return $tuples
}
......@@ -123,6 +123,11 @@ Ext.define('PO.model.timesheet.TimesheetTask', {
'expanded', // true or false (without quotes), default state for tree
// Add dynfields
<multiple name=dynfields>
'@dynfields.name@',</multiple>
{ name: 'icon', // A &nbsp; sequence representing the project indentation
convert: function(value, record) {
var typeId = parseInt(record.get('project_type_id'));
......
# Get DynFields for Timesheet Task
set names [im_sencha_dynfields -object_type "im_timesheet_task"]
multirow create dynfields name pretty_name widget
foreach tuple $names {
multirow append dynfields [lindex $tuple 0] [lindex $tuple 1] [lindex $tuple 2]
}
......@@ -251,6 +251,11 @@ Ext.define('PO.view.gantt.GanttTreePanel', {
var model = statusStore.getById(value);
return model.get('category');
}}
// DynFields
<multiple name=dynfields>
,{text: '@dynfields.pretty_name@', stateId: 'treegrid-@dynfields.name@', flex: 1, dataIndex: '@dynfields.name@', hidden: false @dynfields.editor;noquote@}
</multiple>
],
listeners: {
......
# Get DynFields for Timesheet Task
set tuples [im_sencha_dynfields -object_type "im_timesheet_task"]
multirow create dynfields name pretty_name widget editor
foreach tuple $tuples {
set widget [lindex $tuple 2]
switch $widget {
checkbox { set editor "" }
date - timestamp { set editor ", editor: 'podatefield'" }
integer { set editor ", editor: 'numberfield'" }
numeric { set editor ", editor: 'numberfield'" }
richtext { set editor ", editor: true" }
textarea_small - textarea_small_nospell - textbox_large - textbox_medium - textbox_small { set editor ", editor: true" }
default {
ad_return_complaint 1 $widget
set editor ""
}
}
multirow append dynfields [lindex $tuple 0] [lindex $tuple 1] [lindex $tuple 2] $editor
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment