Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sencha-core
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
project-open
sencha-core
Commits
b4467846
Commit
b4467846
authored
Aug 24, 2021
by
Project Open
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Added baselines
parent
0fed72e7
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
160 additions
and
23 deletions
+160
-23
Baseline.js
www/model/project/Baseline.js
+55
-0
TimesheetTask.adp
www/model/timesheet/TimesheetTask.adp
+1
-0
BaselineStore.js
www/store/project/BaselineStore.js
+42
-0
GanttTreePanel.adp
www/view/gantt/GanttTreePanel.adp
+20
-1
ConfigMenu.js
www/view/menu/ConfigMenu.js
+42
-22
No files found.
www/model/project/Baseline.js
0 → 100644
View file @
b4467846
/*
* /sencha-core/www/model/project/Baseline.js
*
* Copyright (C) 2021 ]project-open[
* All rights reserved. Please see
* https://www.project-open.com/license/sencha/ for details.
*
* This is the default Sencha model for baselines and sub-
* types including "im_profile" and "im_ticket_queue" with
* all important fields available from the ]po[ data-model.
*/
Ext
.
define
(
'PO.model.project.Baseline'
,
{
extend
:
'Ext.data.Model'
,
fields
:
[
'id'
,
'object_type'
,
// Type of baseline: 'baseline', 'im_profile', ...
// Basic Information
'baseline_id'
,
// The primary key or object_id of the baseline
'baseline_name'
,
// System name, frequently the Windows login of the baseline
'baseline_project_id'
,
// baselines always belong to a project
'baseline_type_id'
,
// Type
'baseline_status_id'
,
// Status
// Object metainformation
'creation_date'
,
//
'creation_ip'
,
//
'creation_baseline'
,
//
'last_modified'
,
//
'modifying_ip'
,
//
'modifying_user'
//
],
proxy
:
{
type
:
'rest'
,
// Use the standard ]po[ REST interface for loading/saving
url
:
'/intranet-rest/im_baseline'
,
// Standard URL for baselines
appendId
:
true
,
// Append the object_id: ../im_ticket/<object_id>
timeout
:
300000
,
extraParams
:
{
format
:
'json'
,
// Tell the ]po[ REST to return JSON data.
deref_p
:
'0'
// By default also load denormalized fields
},
reader
:
{
type
:
'json'
,
// Tell the Proxy Reader to parse JSON
root
:
'data'
,
// Where do the data start in the JSON file?
totalProperty
:
'total'
// Total number of tickets for pagination
},
writer
:
{
type
:
'json'
// Allow Sencha to write ticket changes
}
}
});
www/model/timesheet/TimesheetTask.adp
View file @
b4467846
...
...
@@ -124,6 +124,7 @@ Ext.define('PO.model.timesheet.TimesheetTask', {
'successors', // List of tasks that depend on the current tasks
'predecessors', // List of tasks on which this task depends
'assignees', // List of users assigned to the task with {id,user_id,percent}
'baselines', // Baseline information
'invoices', // List of financial documents related to task with {id,cost_id,cost_type_id, ...}
'logged_hours', // Sum of hours logged on task, sub-project or project (from cache)
...
...
www/store/project/BaselineStore.js
0 → 100644
View file @
b4467846
/*
* /sencha-core/www/store/project/BaselineStore.js
*
* Copyright (C) 2021 ]project-open[
* All rights reserved. Please see
* https://www.project-open.com/license/sencha/ for details.
*
* <ul>
* <li>A store with the list of all active main projects in the system.
* <li>The store needs explicit sync() in order to store changes.
* <li>The store does not explicitely exclude tasks and tickets
* with parent_id=NULL, which may occur accidentally in ]po[.
* </ul>
*/
Ext
.
define
(
'PO.store.project.BaselineStore'
,
{
storeId
:
'baselineStore'
,
extend
:
'Ext.data.Store'
,
requires
:
[
'PO.model.project.Baseline'
],
model
:
'PO.model.project.Baseline'
,
// Uses standard Baseline as model
autoLoad
:
false
,
remoteFilter
:
true
,
// Do not filter on the Sencha side
pageSize
:
100000
,
// Load all projects, no matter what size(?)
proxy
:
{
type
:
'rest'
,
// Standard ]po[ REST interface for loading
url
:
'/intranet-rest/im_baseline'
,
appendId
:
true
,
timeout
:
300000
,
extraParams
:
{
format
:
'json'
// deref_p: '0' // We don't need additional fields
},
reader
:
{
type
:
'json'
,
// Tell the Proxy Reader to parse JSON
root
:
'data'
,
// Where do the data start in the JSON file?
totalProperty
:
'total'
// Total number of tickets for pagination
},
writer
:
{
type
:
'json'
// Allow Sencha to write ticket changes
}
}
});
www/view/gantt/GanttTreePanel.adp
View file @
b4467846
...
...
@@ -387,7 +387,26 @@ Ext.define('PO.view.gantt.GanttTreePanel', {
hidden: true, sortable: false
// ,editor: { xtype: 'checkbox', uncheckedValue: 'f', inputValue: 't'}
},
{text: 'Scheduling Type', stateId: 'treegrid-effort-driven-type', flex: 1, hidden: true, dataIndex: 'effort_driven_type_id', sortable: false,
{text: 'Baseline Start', stateId: 'treegrid-baseline-start', width: 80, hidden: true,
renderer: function(value, context, model) {
var baseline = model.get('baseline');
if (!baseline) return "";
var startDate = baseline.start_date;
return startDate.substring(0,10);
}},
{text: 'Baseline End', stateId: 'treegrid-baseline-end', width: 80, hidden: true,
renderer: function(value, context, model) {
var baseline = model.get('baseline');
if (!baseline) return "";
var endDate = baseline.end_date;
return endDate.substring(0,10);
}},
{text: 'Scheduling Type', stateId: 'treegrid-effort-driven-type', flex: 1, hidden: true, dataIndex: 'effort_driven_type_id', sortable: false,
editor: {
xtype: 'combobox',
forceSelection: true,
...
...
www/view/menu/ConfigMenu.js
View file @
b4467846
...
...
@@ -31,7 +31,7 @@ Ext.define('PO.view.menu.ConfigMenu', {
if
(
me
.
debug
)
console
.
log
(
'PO.view.menu.ConfigMenu.initComponent: Starting'
)
this
.
callParent
(
arguments
);
this
.
initPreferenceStore
();
this
.
initPreferenceStore
();
// Create a "Reset Configuration" entry
var
item
=
Ext
.
create
(
'Ext.menu.Item'
,
{
...
...
@@ -39,13 +39,13 @@ Ext.define('PO.view.menu.ConfigMenu', {
text
:
'Reset Configuration'
,
handler
:
function
()
{
if
(
me
.
debug
)
console
.
log
(
'configMenu.OnResetConfiguration'
);
me
.
items
.
each
(
function
(
item
)
{
if
(
'checkedDefault'
in
item
)
{
me
.
senchaPreferenceStore
.
setPreference
(
item
.
key
,
item
.
checkedDefault
);
item
.
setChecked
(
item
.
checkedDefault
);
item
.
fireEvent
(
'click'
,
this
);
}
});
me
.
items
.
each
(
function
(
item
)
{
if
(
'checkedDefault'
in
item
)
{
me
.
senchaPreferenceStore
.
setPreference
(
item
.
key
,
item
.
checkedDefault
);
item
.
setChecked
(
item
.
checkedDefault
);
item
.
fireEvent
(
'click'
,
this
);
}
});
}
});
me
.
insert
(
0
,
item
);
...
...
@@ -56,7 +56,7 @@ Ext.define('PO.view.menu.ConfigMenu', {
initPreferenceStore
:
function
()
{
var
me
=
this
;
var
me
=
this
;
if
(
me
.
debug
)
console
.
log
(
'PO.view.menu.ConfigMenu.initPreferenceStore: Starting'
)
// Check if SenchaPreference entries exist for the menu items and create if needed
...
...
@@ -69,25 +69,45 @@ Ext.define('PO.view.menu.ConfigMenu', {
return
;
};
// Save the original (default) checked property
item
.
checkedDefault
=
item
.
checked
;
// Save the original (default) checked property
item
.
checkedDefault
=
item
.
checked
;
// Initialize the DB state if not already set from using the page the last time
var
exists
=
me
.
senchaPreferenceStore
.
existsPreference
(
item
.
key
);
if
(
exists
)
{
// Pull the value from preference store and write into default state
item
.
checked
=
me
.
senchaPreferenceStore
.
getPreferenceBoolean
(
item
.
key
,
item
.
checked
);
}
else
{
me
.
senchaPreferenceStore
.
setPreference
(
item
.
key
,
item
.
checked
);
}
// Pull the value from preference store and write into default state
item
.
checked
=
me
.
senchaPreferenceStore
.
getPreferenceBoolean
(
item
.
key
,
item
.
checked
);
}
else
{
me
.
senchaPreferenceStore
.
setPreference
(
item
.
key
,
item
.
checked
);
}
// Handle a click: Update the DB status via REST interface
item
.
setHandler
(
function
(
item
){
if
(
me
.
debug
)
console
.
log
(
'configMenuOnItemCheck: item.key='
+
item
.
key
+
', checked='
+
item
.
checked
);
me
.
senchaPreferenceStore
.
setPreference
(
item
.
key
,
item
.
checked
);
}
);
// Only works for Ext.menu.CheckItem, ignore for others (handle it yourself!)
var
senchaClassName
=
item
[
'$className'
];
switch
(
senchaClassName
)
{
case
"Ext.menu.CheckItem"
:
item
.
setHandler
(
function
(
item
){
if
(
me
.
debug
)
console
.
log
(
'configMenuOnItemCheck (CheckItem): item.key='
+
item
.
key
+
', checked='
+
item
.
checked
);
me
.
senchaPreferenceStore
.
setPreference
(
item
.
key
,
item
.
checked
);
}
);
break
;
/*
case "Ext.form.field.ComboBox":
item.on('select', function(combo, records) {
console.log('configMenuOnItemCheck (ComboBox): item.key='+item.key+', value='+records);
if (!records) return;
var record = records[0];
if (!record) return;
var id = record.get('id');
me.senchaPreferenceStore.setPreference(item.key, id);
});
break;
*/
default
:
console
.
log
(
'PO.view.menu.ConfigMenu.initPreferenceStore: Unknown config item with class='
+
senchaClassName
);
}
});
if
(
me
.
debug
)
console
.
log
(
'PO.view.menu.ConfigMenu.initPreferenceStore: Finished'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment