Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
senchatouch-timesheet
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
senchatouch-timesheet
Commits
0b5e16a6
Commit
0b5e16a6
authored
May 12, 2013
by
Frank Bergmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Sencha Timesheet TS:
Added a Project timesheet view
parent
69016a56
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
296 additions
and
0 deletions
+296
-0
ProjectNavigationController.js
www/app/controller/ProjectNavigationController.js
+48
-0
ProjectDetail.js
www/app/view/ProjectDetail.js
+75
-0
ProjectEdit.js
www/app/view/ProjectEdit.js
+75
-0
ProjectNavigationView.js
www/app/view/ProjectNavigationView.js
+15
-0
ProjectTimesheet.js
www/app/view/ProjectTimesheet.js
+83
-0
No files found.
www/app/controller/ProjectNavigationController.js
0 → 100644
View file @
0b5e16a6
Ext
.
define
(
'PO.controller.ProjectNavigationController'
,
{
extend
:
'Ext.app.Controller'
,
xtype
:
'projectNavigationController'
,
config
:
{
refs
:
{
projectNavigationView
:
'projectNavigationView'
},
control
:
{
'projectNavigationView'
:
{
initialize
:
'onInitializeNavigationView'
},
'projectList'
:
{
disclose
:
'showDetail'
}
}
},
// Initialization of the Container - add a button
// The NavigationView itself doesn't seem to allow for this type of customization
onInitializeNavigationView
:
function
(
navView
)
{
var
navBar
=
Ext
.
ComponentQuery
.
query
(
'projectNavigationView'
)[
0
].
getNavigationBar
();
navBar
.
add
({
xtype
:
'button'
,
text
:
'New Project'
,
align
:
'right'
,
handler
:
function
()
{
console
.
log
(
'ProjectListController: New Project button pressed'
);
navView
.
push
({
xtype
:
'projectDetail'
,
title
:
'New Project'
});
}
});
},
// "Disclose" Event - somebody pressed on the -> button at the list
// Create a new instance of the projectDetail page and push on the top
// of the stack
showDetail
:
function
(
list
,
record
)
{
var
view
=
this
.
getProjectNavigationView
();
view
.
push
({
xtype
:
'projectTimesheet'
,
record
:
record
});
}
});
www/app/view/ProjectDetail.js
0 → 100644
View file @
0b5e16a6
Ext
.
define
(
'PO.view.ProjectDetail'
,
{
extend
:
'Ext.form.Panel'
,
xtype
:
'projectDetail'
,
config
:
{
title
:
'Project Detail'
,
layout
:
'vbox'
,
items
:
[{
xtype
:
'fieldset'
,
title
:
'Edit Project'
,
items
:
[{
xtype
:
'selectfield'
,
name
:
'project_type_id'
,
label
:
'Type'
,
options
:
[
{
text
:
'Address'
,
value
:
'11500'
},
{
text
:
'Email'
,
value
:
'11502'
},
{
text
:
'Http'
,
value
:
'11504'
},
{
text
:
'Ftp'
,
value
:
'11506'
},
{
text
:
'Phone'
,
value
:
'11508'
},
{
text
:
'Fax'
,
value
:
'11510'
},
{
text
:
'Mobile'
,
value
:
'11512'
},
{
text
:
'Other'
,
value
:
'11514'
}
]
},
{
xtype
:
'textareafield'
,
name
:
'project'
,
label
:
'Project'
},
{
xtype
:
'hiddenfield'
,
name
:
'id'
},
{
xtype
:
'hiddenfield'
,
name
:
'project_status_id'
,
value
:
11400
},
{
xtype
:
'hiddenfield'
,
name
:
'object_id'
,
label
:
'Object ID'
,
value
:
0
// Magic value: 0 is the ID of the "guest" object
}
]
},
{
xtype
:
'button'
,
text
:
'Save'
,
ui
:
'confirm'
,
handler
:
function
()
{
console
.
log
(
'ProjectDetail: Button "Save" pressed:'
);
// Save the form values to the record.
// The record was set by the ProjectNavigationController
var
form
=
this
.
up
(
'formpanel'
);
var
values
=
form
.
getValues
();
var
rec
=
form
.
getRecord
();
// Did we create a completely new project?
if
(
typeof
rec
===
"undefined"
||
rec
==
null
)
{
rec
=
Ext
.
ModelManager
.
create
(
values
,
'PO.model.Project'
);
}
// Save the model - generates PUT or POST to REST backend
rec
.
set
(
values
);
rec
.
save
();
// reload the store
var
projectStore
=
Ext
.
data
.
StoreManager
.
lookup
(
'ProjectStore'
);
projectStore
.
load
();
// Return to the list of projects page
var
navView
=
this
.
up
(
'projectNavigationView'
);
navView
.
pop
();
}
}
]
}
});
www/app/view/ProjectEdit.js
0 → 100644
View file @
0b5e16a6
Ext
.
define
(
'PO.view.ProjectEdit'
,
{
extend
:
'Ext.form.Panel'
,
xtype
:
'projectEdit'
,
config
:
{
title
:
'Project Edit'
,
layout
:
'vbox'
,
items
:
[{
xtype
:
'fieldset'
,
title
:
'Edit Project'
,
items
:
[{
xtype
:
'selectfield'
,
name
:
'project_type_id'
,
label
:
'Type'
,
options
:
[
{
text
:
'Address'
,
value
:
'11500'
},
{
text
:
'Email'
,
value
:
'11502'
},
{
text
:
'Http'
,
value
:
'11504'
},
{
text
:
'Ftp'
,
value
:
'11506'
},
{
text
:
'Phone'
,
value
:
'11508'
},
{
text
:
'Fax'
,
value
:
'11510'
},
{
text
:
'Mobile'
,
value
:
'11512'
},
{
text
:
'Other'
,
value
:
'11514'
}
]
},
{
xtype
:
'textareafield'
,
name
:
'project'
,
label
:
'Project'
},
{
xtype
:
'hiddenfield'
,
name
:
'id'
},
{
xtype
:
'hiddenfield'
,
name
:
'project_status_id'
,
value
:
11400
},
{
xtype
:
'hiddenfield'
,
name
:
'object_id'
,
label
:
'Object ID'
,
value
:
0
// Magic value: 0 is the ID of the "guest" object
}
]
},
{
xtype
:
'button'
,
text
:
'Save'
,
ui
:
'confirm'
,
handler
:
function
()
{
console
.
log
(
'ProjectEdit: Button "Save" pressed:'
);
// Save the form values to the record.
// The record was set by the ProjectNavigationController
var
form
=
this
.
up
(
'formpanel'
);
var
values
=
form
.
getValues
();
var
rec
=
form
.
getRecord
();
// Did we create a completely new project?
if
(
typeof
rec
===
"undefined"
||
rec
==
null
)
{
rec
=
Ext
.
ModelManager
.
create
(
values
,
'PO.model.Project'
);
}
// Save the model - generates PUT or POST to REST backend
rec
.
set
(
values
);
rec
.
save
();
// reload the store
var
projectStore
=
Ext
.
data
.
StoreManager
.
lookup
(
'ProjectStore'
);
projectStore
.
load
();
// Return to the list of projects page
var
navView
=
this
.
up
(
'projectNavigationView'
);
navView
.
pop
();
}
}
]
}
});
www/app/view/ProjectNavigationView.js
0 → 100644
View file @
0b5e16a6
Ext
.
define
(
'PO.view.ProjectNavigationView'
,
{
extend
:
'Ext.navigation.View'
,
xtype
:
'projectNavigationView'
,
requires
:
[
'PO.view.ProjectList'
,
'PO.view.ProjectDetail'
],
config
:
{
title
:
'Projects'
,
iconCls
:
'star'
,
items
:
[{
xtype
:
'projectList'
}]
}
});
www/app/view/ProjectTimesheet.js
0 → 100644
View file @
0b5e16a6
/*
* ProjectTimesheet.js
* (c) 2013 ]project-open[
* Please see www.project-open.org/en/project_open_license for details
*
* Timesheet entry page for a single task, sub-project or main project.
* Allows the user to log a single timesheet entry.
*/
Ext
.
define
(
'PO.view.ProjectTimesheet'
,
{
extend
:
'Ext.form.Panel'
,
xtype
:
'projectTimesheet'
,
config
:
{
title
:
'Project Timesheet'
,
layout
:
'vbox'
,
items
:
[{
xtype
:
'fieldset'
,
title
:
'Information'
,
items
:
[{
xtype
:
'selectfield'
,
name
:
'project_type_id'
,
label
:
'Type'
,
options
:
[
{
text
:
'Address'
,
value
:
'11500'
},
{
text
:
'Email'
,
value
:
'11502'
},
{
text
:
'Http'
,
value
:
'11504'
},
{
text
:
'Ftp'
,
value
:
'11506'
},
{
text
:
'Phone'
,
value
:
'11508'
},
{
text
:
'Fax'
,
value
:
'11510'
},
{
text
:
'Mobile'
,
value
:
'11512'
},
{
text
:
'Other'
,
value
:
'11514'
}
]
},
{
xtype
:
'textareafield'
,
name
:
'project'
,
label
:
'Project'
},
{
xtype
:
'hiddenfield'
,
name
:
'id'
},
{
xtype
:
'hiddenfield'
,
name
:
'project_status_id'
,
value
:
11400
},
{
xtype
:
'hiddenfield'
,
name
:
'object_id'
,
label
:
'Object ID'
,
value
:
0
// Magic value: 0 is the ID of the "guest" object
}
]
},
{
xtype
:
'button'
,
text
:
'Save'
,
ui
:
'confirm'
,
handler
:
function
()
{
console
.
log
(
'ProjectTimesheet: Button "Save" pressed:'
);
// Save the form values to the record.
// The record was set by the ProjectNavigationController
var
form
=
this
.
up
(
'formpanel'
);
var
values
=
form
.
getValues
();
var
rec
=
form
.
getRecord
();
// Did we create a completely new project?
if
(
typeof
rec
===
"undefined"
||
rec
==
null
)
{
rec
=
Ext
.
ModelManager
.
create
(
values
,
'PO.model.Project'
);
}
// Save the model - generates PUT or POST to REST backend
rec
.
set
(
values
);
rec
.
save
();
// reload the store
var
projectStore
=
Ext
.
data
.
StoreManager
.
lookup
(
'ProjectStore'
);
projectStore
.
load
();
// Return to the list of projects page
var
navView
=
this
.
up
(
'projectNavigationView'
);
navView
.
pop
();
}
}
]
}
});
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