Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
intranet-timesheet2-weekly
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
intranet-timesheet2-weekly
Commits
25329849
Commit
25329849
authored
Mar 30, 2021
by
Project Open
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- WIP
parent
ef1937b7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
12 deletions
+38
-12
index.adp
www/index.adp
+38
-12
No files found.
www/index.adp
View file @
25329849
...
...
@@ -17,6 +17,9 @@ Ext.Loader.setPath('Ext.ux', '/sencha-core/ux');
Ext.Loader.setPath('PO.view', '/sencha-core/view');
Ext.Loader.setPath('PO.controller', '/sencha-core/controller');
// Disable the ?_dc=123456789 parameter from loader
Ext.Loader.setConfig({disableCaching: false});
Ext.require([
'Ext.data.*',
'Ext.grid.*',
...
...
@@ -72,6 +75,24 @@ function launchTimesheetWeeklyLogging(){
}
});
var summaryType = function(hourArray, dataIndex) {
var sum = 0;
for (var i = 0; i < hourArray.length; i++) {
var vString = hourArray[i].get(dataIndex);
var vFloat = parseFloat(vString);
if (!!vFloat) sum = sum + vFloat;
}
return sum;
};
var summaryRenderer = function(value, summaryData, dataIndex) {
var type = typeof(value);
if ("number" == type) {
return Math.round(value * 100) / 100;
}
return value;
};
var hourGrid = Ext.create('Ext.grid.Panel', {
store: hourStore,
layout: 'fit',
...
...
@@ -85,6 +106,10 @@ function launchTimesheetWeeklyLogging(){
iconCls: 'icon-grid',
margin: '0 0 20 0',
plugins: [rowEditing],
features: [{
ftype: 'summary',
dock: 'bottom'
}],
// reference to controller
hourController: null, // Reference to main controller
...
...
@@ -101,12 +126,12 @@ function launchTimesheetWeeklyLogging(){
},
editor: {
xtype: 'combo',
queryMode:
'local',
queryMode: 'local',
store: projectStore,
displayField: 'project_name',
valueField: 'project_id',
matchFieldWidth: false,
displayTpl: Ext.create('Ext.XTemplate', '<tpl for=".">', '{project_name}', '</tpl>'),
listeners: {
change: function(combo, value, oldValue, event) {
// ToDo: Replace this hard-wired reference with something more intelligent
...
...
@@ -127,13 +152,13 @@ function launchTimesheetWeeklyLogging(){
editor: { xtype: 'pocombotree', store: taskTreeStore, queryMode: 'local', displayField: 'project_name', valueField: 'id'}
},
// { text: "Date", xtype: 'datecolumn', dataIndex: 'day', renderer: Ext.util.Format.dateRenderer('Y-m-d'), editor: {xtype: 'datefield',allowBlank: true}},
{
text: "Mon", width: 60, dataIndex: 'hours', editor: { xtype: 'numberfield', minValue: 0 }
},
{
text: "Tue", width: 60, dataIndex: 'hours', editor: { xtype: 'numberfield', minValue: 0 }
},
{
text: "Wed", width: 60, dataIndex: 'hours', editor: { xtype: 'numberfield', minValue: 0 }
},
{
text: "Thu", width: 60, dataIndex: 'hours', editor: { xtype: 'numberfield', minValue: 0 }
},
{
text: "Fri", width: 60, dataIndex: 'hours', editor: { xtype: 'numberfield', minValue: 0 }
},
{
text: "Sat", width: 60, dataIndex: 'hours', editor: { xtype: 'numberfield', minValue: 0 }
},
{
text: "Sun", width: 60, dataIndex: 'hours', editor: { xtype: 'numberfield', minValue: 0 }
},
{
text: "<div align=center>Mon<br>3/29/2021</div>", width: 65, dataIndex: 'hours', editor: { xtype: 'numberfield', minValue: 0}, summaryType: summaryType, summaryRenderer: summaryRenderer
},
{
text: "<div align=center>Tue<br>3/30/2021</div>", width: 65, dataIndex: 'hours', editor: { xtype: 'numberfield', minValue: 0}, summaryType: summaryType, summaryRenderer: summaryRenderer
},
{
text: "<div align=center>Wed<br>2/31/2021</div>", width: 65, dataIndex: 'hours', editor: { xtype: 'numberfield', minValue: 0}, summaryType: summaryType, summaryRenderer: summaryRenderer
},
{
text: "<div align=center>Thu<br>2/31/2021</div>", width: 65, dataIndex: 'hours', editor: { xtype: 'numberfield', minValue: 0}, summaryType: summaryType, summaryRenderer: summaryRenderer
},
{
text: "<div align=center>Fri<br>2/31/2021</div>", width: 65, dataIndex: 'hours', editor: { xtype: 'numberfield', minValue: 0}, summaryType: summaryType, summaryRenderer: summaryRenderer
},
{
text: "<div align=center>Sat<br>2/31/2021</div>", width: 65, dataIndex: 'hours', editor: { xtype: 'numberfield', minValue: 0}, summaryType: summaryType, summaryRenderer: summaryRenderer
},
{
text: "<div align=center>Sun<br>2/31/2021</div>", width: 65, dataIndex: 'hours', editor: { xtype: 'numberfield', minValue: 0}, summaryType: summaryType, summaryRenderer: summaryRenderer
},
// { text: "Note", flex: 1, dataIndex: 'note', editor: { allowBlank: true }}
]
});
...
...
@@ -522,7 +547,7 @@ Ext.onReady(function() {
var coordinator = Ext.create('PO.controller.StoreLoadCoordinator', {
stores: [
'hourStore',
'taskTreeStore',
//
'taskTreeStore',
'projectMainStore'
],
listeners: {
...
...
@@ -535,7 +560,7 @@ Ext.onReady(function() {
});
// Load stores that need parameters
taskTreeStore.getProxy().extraParams = { project_id:
@project_id@
};
taskTreeStore.getProxy().extraParams = { project_id:
18228
};
taskTreeStore.load({
callback: function(records, operation, success) {
var me = this;
...
...
@@ -560,7 +585,8 @@ Ext.onReady(function() {
// Load stores that need parameters
// projectStore.getProxy().extraParams = { query: 'parent_id is NULL and project_status_id = 76', format: 'json' };
projectStore.getProxy().extraParams = { query: 'parent_id is NULL and project_status_id in (select * from im_sub_categories(76))', format: 'json' };
projectStore.getProxy().extraParams = { query: 'parent_id is NULL and (project_status_id in (select * from im_sub_categories(76)) OR \
parent_id is null)', format: 'json' };
projectStore.load({
callback: function() {
console.log('PO.store.project.ProjectMainStore: loaded');
...
...
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