BUG 0000 adding dashboard initial module
This commit is contained in:
23
workflow/engine/controllers/dashboard.php
Normal file
23
workflow/engine/controllers/dashboard.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
/**
|
||||
* Dashborad controller
|
||||
* @inherits Controller
|
||||
* @access public
|
||||
*/
|
||||
|
||||
class Dashboard extends Controller
|
||||
{
|
||||
/**
|
||||
* getting default list
|
||||
* @param string $httpData->PRO_UID (opional)
|
||||
*/
|
||||
public function index($httpData)
|
||||
{
|
||||
$this->includeExtJS('dashboard/index');
|
||||
$this->includeExtJSLib('ux/portal');
|
||||
//$this->setView('dashboard/index');
|
||||
|
||||
//render content
|
||||
G::RenderPage('publish', 'extJs');
|
||||
}
|
||||
}
|
||||
@@ -45,6 +45,10 @@ if ($RBAC->userCanAccess('PM_FACTORY') == 1 ) {
|
||||
$G_TMP_MENU->AddIdRawOption('PROCESSES', 'processes/main', G::LoadTranslation('ID_DESIGNER'));
|
||||
}
|
||||
|
||||
// DASHBOARD MODULE
|
||||
if ($RBAC->userCanAccess('PM_DASHBOARD') == 1) {
|
||||
$G_TMP_MENU->AddIdRawOption('DASHBOARD', 'dashboard/main', G::LoadTranslation('ID_DASHBOARD'));
|
||||
}
|
||||
|
||||
/*if ($RBAC->userCanAccess('PM_REPORTS') == 1 ) {
|
||||
$G_TMP_MENU->AddIdRawOption('REPORTS', 'reports/reportsList');
|
||||
|
||||
33
workflow/engine/methods/dashboard/main.php
Normal file
33
workflow/engine/methods/dashboard/main.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
/**
|
||||
* dashboard.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
|
||||
$RBAC->requirePermissions('PM_DASHBOARD');
|
||||
|
||||
$G_MAIN_MENU = 'processmaker';
|
||||
$G_ID_MENU_SELECTED = 'DASHBOARD';
|
||||
|
||||
$G_PUBLISH = new Publisher;
|
||||
$G_PUBLISH->AddContent('view', 'dashboard/load');
|
||||
G::RenderPage('publish');
|
||||
183
workflow/engine/templates/dashboard/index.js
Normal file
183
workflow/engine/templates/dashboard/index.js
Normal file
@@ -0,0 +1,183 @@
|
||||
Ext.onReady(function(){
|
||||
|
||||
Ext.state.Manager.setProvider(new Ext.state.CookieProvider());
|
||||
|
||||
// create some portlet tools using built in Ext tool ids
|
||||
var tools = [{
|
||||
id:'gear',
|
||||
handler: function(){
|
||||
Ext.Msg.alert('Message', 'The Settings tool was clicked.');
|
||||
}
|
||||
},{
|
||||
id:'close',
|
||||
handler: function(e, target, panel){
|
||||
panel.ownerCt.remove(panel, true);
|
||||
}
|
||||
}];
|
||||
|
||||
var tbDashboard = new Ext.Toolbar({
|
||||
height: 30,
|
||||
items: [
|
||||
{
|
||||
xtype: 'tbbutton',
|
||||
text : 'three columns',
|
||||
handler : function(a) {
|
||||
var vp = Ext.getCmp('viewportDashboard');
|
||||
var pd = Ext.getCmp('portalDashboard');
|
||||
pd.items.items[0].columnWidth = 0.33;
|
||||
pd.items.items[1].columnWidth = 0.33;
|
||||
pd.items.items[2].columnWidth = 0.33;
|
||||
pd.doLayout();
|
||||
}
|
||||
},
|
||||
{
|
||||
xtype: 'tbbutton',
|
||||
text : 'two columns',
|
||||
handler : function(a) {
|
||||
var vp = Ext.getCmp('viewportDashboard');
|
||||
var pd = Ext.getCmp('portalDashboard');
|
||||
pd.items.items[0].columnWidth = 0.49;
|
||||
pd.items.items[1].columnWidth = 0.49;
|
||||
while ( pd.items.items[2].items.items[0] ) {
|
||||
pd.items.items[0].add( pd.items.items[2].items.items[0] );
|
||||
}
|
||||
pd.items.items[2].columnWidth = 0.01;
|
||||
pd.doLayout();
|
||||
}
|
||||
},
|
||||
{
|
||||
xtype: 'tbbutton',
|
||||
text : 'blog',
|
||||
handler : function(a) {
|
||||
var vp = Ext.getCmp('viewportDashboard');
|
||||
var pd = Ext.getCmp('portalDashboard');
|
||||
pd.items.items[0].columnWidth = 0.40;
|
||||
pd.items.items[1].columnWidth = 0.40;
|
||||
pd.items.items[2].columnWidth = 0.20;
|
||||
pd.doLayout();
|
||||
//vp.doLayout();
|
||||
}
|
||||
},
|
||||
{
|
||||
xtype: 'tbbutton',
|
||||
text : 'new gauge',
|
||||
handler : function(a) {
|
||||
var np = new Ext.ux.Portlet ( {
|
||||
//title: 'Panel nuevo',
|
||||
//tools: tools,
|
||||
html: 'hello world',
|
||||
listeners: {
|
||||
'render': function(p){
|
||||
p.html = 'hello ' + p.getWidth();
|
||||
},
|
||||
'move' : function(p){
|
||||
Ext.Msg.alert('Portlet ', 'move ' + p.getWidth() );
|
||||
p.html = 'show ' + p.getWidth();
|
||||
},
|
||||
'resize' : function(p,w,h){
|
||||
var randomnumber=Math.floor(Math.random()*1000000)
|
||||
var img = new Ext.XTemplate("<img src='{page}?w={width}&r={random}'>").apply({
|
||||
page: 'http://javaserver.colosa.net/ext/examples/portal/gauge.php', width:w, random: randomnumber })
|
||||
|
||||
p.update(img );
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var vp = Ext.getCmp('viewportDashboard');
|
||||
var pd = Ext.getCmp('portalDashboard');
|
||||
pd.items.items[0].add( np );
|
||||
pd.doLayout();
|
||||
//vp.doLayout();
|
||||
}
|
||||
},
|
||||
{
|
||||
xtype: 'tbbutton',
|
||||
text : 'new trend graph',
|
||||
handler : function(a) {
|
||||
var np = new Ext.ux.Portlet ( {
|
||||
//title: 'Panel nuevo',
|
||||
tools: tools,
|
||||
html: 'hello world',
|
||||
listeners: {
|
||||
'render': function(p){
|
||||
p.html = 'hello ' + p.getWidth();
|
||||
},
|
||||
'move' : function(p){
|
||||
Ext.Msg.alert('Portlet ', 'move ' + p.getWidth() );
|
||||
p.html = 'show ' + p.getWidth();
|
||||
},
|
||||
'resize' : function(p,w,h){
|
||||
var randomnumber=Math.floor(Math.random()*1000000)
|
||||
var img = new Ext.XTemplate("<img src='{page}?w={width}&r={random}'>").apply({
|
||||
page: 'http://javaserver.colosa.net/ext/examples/portal/history.php', width:w, random: randomnumber })
|
||||
|
||||
p.update(img );
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var vp = Ext.getCmp('viewportDashboard');
|
||||
var pd = Ext.getCmp('portalDashboard');
|
||||
pd.items.items[0].add( np );
|
||||
pd.doLayout();
|
||||
//vp.doLayout();
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
var viewport = new Ext.Viewport({
|
||||
layout:'fit',
|
||||
name : 'viewportDashboard',
|
||||
id : 'viewportDashboard',
|
||||
items:[{
|
||||
xtype:'portal',
|
||||
region:'center',
|
||||
margins:'35 5 5 0',
|
||||
tbar: tbDashboard,
|
||||
name : 'portalDashboard',
|
||||
id : 'portalDashboard',
|
||||
items:[{
|
||||
columnWidth:.33,
|
||||
style:'padding:10px 0 10px 10px',
|
||||
items:[{
|
||||
title: 'Grid in a Portlet',
|
||||
layout:'fit',
|
||||
tools: tools,
|
||||
html: 'Learn Use the included files to view samples and our API documentation. For advanced, hands-on support, please see our premium support subscriptions. Larger organizations can use our enterprise training and services.'
|
||||
//items: new SampleGrid([0, 2, 3])
|
||||
}]
|
||||
},{
|
||||
columnWidth:.33,
|
||||
style:'padding:10px 0 10px 10px',
|
||||
items:[{
|
||||
title: 'Panel 2',
|
||||
tools: tools,
|
||||
html: 'Learn Use the included files to view samples and our API documentation. For advanced, hands-on support, please see our premium support subscriptions. Larger organizations can use our enterprise training and services.'
|
||||
}]
|
||||
},{
|
||||
columnWidth:.33,
|
||||
style:'padding:10px',
|
||||
items:[{
|
||||
title: 'Panel 3',
|
||||
tools: tools,
|
||||
html: 'Learn Use the included files to view samples and our API documentation. For advanced, hands-on support, please see our premium support subscriptions. Larger organizations can use our enterprise training and services.'
|
||||
}]
|
||||
}]
|
||||
|
||||
/*
|
||||
* Uncomment this block to test handling of the drop event. You could use this
|
||||
* to save portlet position state for example. The event arg e is the custom
|
||||
* event defined in Ext.ux.Portal.DropZone.
|
||||
*/
|
||||
// ,listeners: {
|
||||
// 'drop': function(e){
|
||||
// Ext.Msg.alert('Portlet Dropped', e.panel.title + '<br />Column: ' +
|
||||
// e.columnIndex + '<br />Position: ' + e.position);
|
||||
// }
|
||||
// }
|
||||
}]
|
||||
});
|
||||
});
|
||||
|
||||
39
workflow/engine/templates/dashboard/load.php
Normal file
39
workflow/engine/templates/dashboard/load.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<html>
|
||||
<style type="text/css">
|
||||
.Footer .content {
|
||||
padding :0px !important;
|
||||
}
|
||||
*html body {
|
||||
overflow-y: hidden;
|
||||
}
|
||||
</style>
|
||||
<body onresize="autoResizeScreen()" onload="autoResizeScreen()">
|
||||
<iframe name="casesFrame" id="casesFrame" src ="../dashboard" width="99%" height="768" frameborder="0">
|
||||
<p>Your browser does not support iframes.</p>
|
||||
</iframe>
|
||||
</body>
|
||||
<script>
|
||||
if ( document.getElementById('pm_submenu') )
|
||||
document.getElementById('pm_submenu').style.display = 'none';
|
||||
document.documentElement.style.overflowY = 'hidden';
|
||||
|
||||
var oClientWinSize = getClientWindowSize();
|
||||
|
||||
|
||||
|
||||
function autoResizeScreen() {
|
||||
oCasesFrame = document.getElementById('casesFrame');
|
||||
height = getClientWindowSize().height-90;
|
||||
oCasesFrame.style.height = height;
|
||||
oCasesSubFrame = oCasesFrame.contentWindow.document.getElementById('casesSubFrame');
|
||||
if(oCasesSubFrame){
|
||||
oCasesSubFrame.style.height = height-5;
|
||||
}
|
||||
else {
|
||||
setTimeout('autoResizeScreen()', 2000);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
</script>
|
||||
</html>
|
||||
Reference in New Issue
Block a user