Fixed display problem skins and dates in internet explorer

This commit is contained in:
Alvaro Campos
2011-03-03 13:46:37 +00:00
parent 683c2b27ef
commit 3f65d5552a
2 changed files with 300 additions and 292 deletions

View File

@@ -1,4 +1,4 @@
<?php <?php
/** /**
* pluginsList.php * pluginsList.php
* *
@@ -28,7 +28,7 @@ if($RBAC->userCanAccess('PM_SETUP') != 1 && $RBAC->userCanAccess('PM_SETUP_ADVAN
//G::header('location: ../login/login'); //G::header('location: ../login/login');
die; die;
} }
$G_MAIN_MENU = 'processmaker'; $G_MAIN_MENU = 'processmaker';
$G_SUB_MENU = 'setup'; $G_SUB_MENU = 'setup';
$G_ID_MENU_SELECTED = 'SETUP'; $G_ID_MENU_SELECTED = 'SETUP';
@@ -46,6 +46,8 @@ $oHeadPublisher->addExtJsScript('setup/skinList', false); //adding a javascri
$oHeadPublisher->addContent('setup/skinList'); //adding a html file .html. $oHeadPublisher->addContent('setup/skinList'); //adding a html file .html.
$oHeadPublisher->assign('CONFIG', $Config); $oHeadPublisher->assign('CONFIG', $Config);
$oHeadPublisher->assign('FORMATS',$c->getFormats());
G::RenderPage('publish', 'extJs'); G::RenderPage('publish', 'extJs');
die; die;
@@ -135,7 +137,7 @@ if( $access != 1 ){
G::LoadClass( 'ArrayPeer'); G::LoadClass( 'ArrayPeer');
$c = new Criteria ('dbarray'); $c = new Criteria ('dbarray');
$c->setDBArrayTable('plugins'); $c->setDBArrayTable('plugins');
//$c->addAscendingOrderByColumn ('id'); $c->addAscendingOrderByColumn ('id');
$G_MAIN_MENU = 'processmaker'; $G_MAIN_MENU = 'processmaker';
$G_ID_MENU_SELECTED = 'SETUP'; $G_ID_MENU_SELECTED = 'SETUP';
@@ -145,5 +147,6 @@ if( $access != 1 ){
$G_PUBLISH = new Publisher; $G_PUBLISH = new Publisher;
$G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'setup/skinsList', $c ); $G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'setup/skinsList', $c );
G::RenderPage('publishBlank', 'blank'); G::RenderPage('publishBlank', 'blank');

View File

@@ -5,44 +5,44 @@
//Keyboard Events //Keyboard Events
new Ext.KeyMap(document, [ new Ext.KeyMap(document, [
{ {
key: Ext.EventObject.F5, key: Ext.EventObject.F5,
fn: function(keycode, e) { fn: function(keycode, e) {
if (! e.ctrlKey) { if (! e.ctrlKey) {
if (Ext.isIE) { if (Ext.isIE) {
// IE6 doesn't allow cancellation of the F5 key, so trick it into // IE6 doesn't allow cancellation of the F5 key, so trick it into
// thinking some other key was pressed (backspace in this case) // thinking some other key was pressed (backspace in this case)
e.browserEvent.keyCode = 8; e.browserEvent.keyCode = 8;
} }
e.stopEvent(); e.stopEvent();
document.location = document.location; document.location = document.location;
}else{ }else{
Ext.Msg.alert('Refresh', 'You clicked: CTRL-F5'); Ext.Msg.alert('Refresh', 'You clicked: CTRL-F5');
} }
} }
} }
, ,
{ {
key: Ext.EventObject.DELETE, key: Ext.EventObject.DELETE,
fn: function(k,e){ fn: function(k,e){
iGrid = Ext.getCmp('infoGrid'); iGrid = Ext.getCmp('infoGrid');
rowSelected = iGrid.getSelectionModel().getSelected(); rowSelected = iGrid.getSelectionModel().getSelected();
if (rowSelected){ if (rowSelected){
DeleteButtonAction(); DeleteButtonAction();
} }
} }
}, },
{ {
key: Ext.EventObject.F2, key: Ext.EventObject.F2,
fn: function(k,e){ fn: function(k,e){
iGrid = Ext.getCmp('infoGrid'); iGrid = Ext.getCmp('infoGrid');
rowSelected = iGrid.getSelectionModel().getSelected(); rowSelected = iGrid.getSelectionModel().getSelected();
if (rowSelected){ if (rowSelected){
EditCalendarAction(); EditCalendarAction();
} }
} }
} }
]); ]);
var store; var store;
var cmodel; var cmodel;
@@ -63,230 +63,235 @@ var pageSize;
var classicSkin = '00000000000000000000000000000001'; var classicSkin = '00000000000000000000000000000001';
Ext.onReady(function(){ Ext.onReady(function(){
Ext.QuickTips.init(); Ext.QuickTips.init();
pageSize = parseInt(CONFIG.pageSize); pageSize = parseInt(CONFIG.pageSize);
newButton = new Ext.Action({ newButton = new Ext.Action({
text: _('ID_NEW'), text: _('ID_NEW'),
iconCls: 'button_menu_ext ss_sprite ss_add', iconCls: 'button_menu_ext ss_sprite ss_add',
disabled: true, disabled: true,
handler: NewCalendarAction handler: NewCalendarAction
}); });
editButton = new Ext.Action({ editButton = new Ext.Action({
text: _('ID_EDIT'), text: _('ID_EDIT'),
iconCls: 'button_menu_ext ss_sprite ss_pencil', iconCls: 'button_menu_ext ss_sprite ss_pencil',
handler: EditCalendarAction, handler: EditCalendarAction,
hidden: true, hidden: true,
disabled: true disabled: true
}); });
deleteButton = new Ext.Action({ deleteButton = new Ext.Action({
text: _('ID_DELETE'), text: _('ID_DELETE'),
iconCls: 'button_menu_ext ss_sprite ss_delete', iconCls: 'button_menu_ext ss_sprite ss_delete',
handler: DeleteButtonAction, handler: DeleteButtonAction,
hidden: true, hidden: true,
disabled: true disabled: true
}); });
copyButton = new Ext.Action({ copyButton = new Ext.Action({
text: _('ID_COPY'), text: _('ID_COPY'),
iconCls: 'button_menu_ext ss_sprite ss_calendar_add', iconCls: 'button_menu_ext ss_sprite ss_calendar_add',
handler: CopyButtonAction, handler: CopyButtonAction,
hidden: true, hidden: true,
disabled: true disabled: true
}); });
importButton = new Ext.Action({ importButton = new Ext.Action({
text: _('ID_IMPORT'), text: _('ID_IMPORT'),
iconCls: 'button_menu_ext ss_sprite ss_basket_put', iconCls: 'button_menu_ext ss_sprite ss_basket_put',
//handler: CopyButtonAction, //handler: CopyButtonAction,
disabled: true disabled: true
}); });
exportButton = new Ext.Action({ exportButton = new Ext.Action({
text: _('ID_EXPORT'), text: _('ID_EXPORT'),
iconCls: 'button_menu_ext ss_sprite ss_basket_go', iconCls: 'button_menu_ext ss_sprite ss_basket_go',
//handler: CopyButtonAction, //handler: CopyButtonAction,
disabled: true disabled: true
}); });
searchButton = new Ext.Action({ searchButton = new Ext.Action({
text: _('ID_SEARCH'), text: _('ID_SEARCH'),
handler: DoSearch handler: DoSearch
}); });
contextMenu = new Ext.menu.Menu({ contextMenu = new Ext.menu.Menu({
items: [exportButton] items: [exportButton]
}); });
searchText = new Ext.form.TextField ({ searchText = new Ext.form.TextField ({
id: 'searchTxt', id: 'searchTxt',
ctCls:'pm_search_text_field', ctCls:'pm_search_text_field',
allowBlank: true, allowBlank: true,
width: 150, width: 150,
emptyText: _('ID_ENTER_SEARCH_TERM'), emptyText: _('ID_ENTER_SEARCH_TERM'),
listeners: { listeners: {
specialkey: function(f,e){ specialkey: function(f,e){
if (e.getKey() == e.ENTER) { if (e.getKey() == e.ENTER) {
DoSearch(); DoSearch();
}
},
focus: function(f,e) {
var row = infoGrid.getSelectionModel().getSelected();
infoGrid.getSelectionModel().deselectRow(infoGrid.getStore().indexOf(row));
}
} }
}); },
focus: function(f,e) {
clearTextButton = new Ext.Action({ var row = infoGrid.getSelectionModel().getSelected();
text: 'X', infoGrid.getSelectionModel().deselectRow(infoGrid.getStore().indexOf(row));
ctCls:'pm_search_x_button', }
handler: GridByDefault }
}); });
clearTextButton = new Ext.Action({
smodel = new Ext.grid.RowSelectionModel({ text: 'X',
singleSelect: true, ctCls:'pm_search_x_button',
listeners:{ handler: GridByDefault
rowselect: function(sm){ });
//exportButton.enable();
exportButton.disable();
rowSelected = infoGrid.getSelectionModel().getSelected(); smodel = new Ext.grid.RowSelectionModel({
}, singleSelect: true,
rowdeselect: function(sm){ listeners:{
exportButton.disable(); rowselect: function(sm){
} //exportButton.enable();
} exportButton.disable();
}); rowSelected = infoGrid.getSelectionModel().getSelected();
},
store = new Ext.data.GroupingStore( { rowdeselect: function(sm){
proxy : new Ext.data.HttpProxy({ exportButton.disable();
url: 'skin_Ajax?action=skinList' }
}), }
reader : new Ext.data.JsonReader( { });
root: 'skins',
totalProperty: 'total_skins', store = new Ext.data.GroupingStore( {
fields : [ proxy : new Ext.data.HttpProxy({
{name : 'SKIN_ID'}, url: 'skin_Ajax?action=skinList'
{name : 'SKIN_NAME'}, }),
{name : 'SKIN_DESCRIPTION'}, reader : new Ext.data.JsonReader( {
{name : 'SKIN_AUTHOR'}, root: 'skins',
{name : 'SKIN_CREATEDATE', type: 'date'}, totalProperty: 'total_skins',
{name : 'SKIN_MODIFIEDDATE', type: 'date'}, fields : [
{name : 'SKIN_STATUS'} {name : 'SKIN_ID'},
] {name : 'SKIN_NAME'},
}) {name : 'SKIN_DESCRIPTION'},
}); {name : 'SKIN_AUTHOR'},
{name : 'SKIN_CREATEDATE'},
cmodel = new Ext.grid.ColumnModel({ {name : 'SKIN_MODIFIEDDATE'},
defaults: { {name : 'SKIN_STATUS'}
width: 50, ]
sortable: true })
}, });
columns: [
{id:'SKIN_UID', dataIndex: 'SKIN_UID', hidden:true, hideable:false}, cmodel = new Ext.grid.ColumnModel({
{header: _('ID_NAME'), dataIndex: 'SKIN_NAME', width: 100, align:'left'}, defaults: {
{header: _('ID_DESCRIPTION'), dataIndex: 'SKIN_DESCRIPTION', width: 200, align:'left'}, width: 50,
{header: _('ID_OWNER'), dataIndex: 'SKIN_AUTHOR', width: 69, align:'center'}, sortable: true
{header: _('ID_CREATE'), dataIndex: 'SKIN_CREATEDATE', width: 69, align:'center'}, },
{header: _('ID_UPDATE_DATE'), dataIndex: 'SKIN_MODIFIEDDATE', width: 69, align:'center'}, columns: [
//{header: _('ID_STATUS'), dataIndex: 'SKIN_STATUS', width: 130, align:'center', renderer: render_status}, {id:'SKIN_UID', dataIndex: 'SKIN_UID', hidden:true, hideable:false},
{header: _('ID_NAME'), dataIndex: 'SKIN_NAME', width: 100, align:'left'},
{header: _('ID_DESCRIPTION'), dataIndex: 'SKIN_DESCRIPTION', width: 200, align:'left'},
{header: _('ID_OWNER'), dataIndex: 'SKIN_AUTHOR', width: 69, align:'center'},
{header: _('ID_CREATE'), dataIndex: 'SKIN_CREATEDATE', width: 69, align:'center', renderer: showdate},
{header: _('ID_UPDATE_DATE'), dataIndex: 'SKIN_MODIFIEDDATE', width: 69, align:'center', renderer: showdate}
//{header: _('ID_STATUS'), dataIndex: 'SKIN_STATUS', width: 130, align:'center', renderer: render_status},
]
});
storePageSize = new Ext.data.SimpleStore({
fields: ['size'],
data: [['20'],['30'],['40'],['50'],['100']],
autoLoad: true
});
comboPageSize = new Ext.form.ComboBox({
typeAhead : false,
mode : 'local',
triggerAction : 'all',
store: storePageSize,
valueField: 'size',
displayField: 'size',
width: 50,
editable: false,
listeners:{
select: function(c,d,i){
UpdatePageConfig(d.data['size']);
bbarpaging.pageSize = parseInt(d.data['size']);
bbarpaging.moveFirst();
}
}
});
comboPageSize.setValue(pageSize);
bbarpaging = new Ext.PagingToolbar({
pageSize: pageSize,
store: store,
displayInfo: true,
displayMsg: _('ID_GRID_PAGE_DISPLAYING_CALENDAR_MESSAGE') + '&nbsp; &nbsp; ',
emptyMsg: _('ID_GRID_PAGE_NO_CALENDAR_MESSAGE')//,
//items: ['-',_('ID_PAGE_SIZE')+':',comboPageSize]
});
infoGrid = new Ext.grid.GridPanel({
region: 'center',
layout: 'fit',
id: 'infoGrid',
height:100,
autoWidth : true,
stateful : true,
stateId : 'grid',
enableColumnResize: true,
enableHdMenu: true,
frame:false,
//iconCls:'icon-grid',
columnLines: false,
viewConfig: {
forceFit:true
},
title : _('ID_SKINS'),
store: store,
cm: cmodel,
sm: smodel,
tbar: [newButton, '-', importButton,exportButton, {xtype: 'tbfill'}, searchText,clearTextButton,searchButton],
bbar: bbarpaging,
listeners: {
rowdblclick: DoNothing
},
view: new Ext.grid.GroupingView({
forceFit:true,
groupTextTpl: '{text}'
})
});
infoGrid.on('rowcontextmenu',
function (grid, rowIndex, evt) {
var sm = grid.getSelectionModel();
sm.selectRow(rowIndex, sm.isSelected(rowIndex));
},
this
);
infoGrid.on('contextmenu', function(evt){evt.preventDefault();}, this);
infoGrid.addListener('rowcontextmenu',onMessageContextMenu, this);
infoGrid.store.load();
viewport = new Ext.Viewport({
layout: 'fit',
autoScroll: false,
items: [
infoGrid
] ]
}); });
storePageSize = new Ext.data.SimpleStore({
fields: ['size'],
data: [['20'],['30'],['40'],['50'],['100']],
autoLoad: true
});
comboPageSize = new Ext.form.ComboBox({
typeAhead : false,
mode : 'local',
triggerAction : 'all',
store: storePageSize,
valueField: 'size',
displayField: 'size',
width: 50,
editable: false,
listeners:{
select: function(c,d,i){
UpdatePageConfig(d.data['size']);
bbarpaging.pageSize = parseInt(d.data['size']);
bbarpaging.moveFirst();
}
}
});
comboPageSize.setValue(pageSize);
bbarpaging = new Ext.PagingToolbar({
pageSize: pageSize,
store: store,
displayInfo: true,
displayMsg: _('ID_GRID_PAGE_DISPLAYING_CALENDAR_MESSAGE') + '&nbsp; &nbsp; ',
emptyMsg: _('ID_GRID_PAGE_NO_CALENDAR_MESSAGE')//,
//items: ['-',_('ID_PAGE_SIZE')+':',comboPageSize]
});
infoGrid = new Ext.grid.GridPanel({
region: 'center',
layout: 'fit',
id: 'infoGrid',
height:100,
autoWidth : true,
stateful : true,
stateId : 'grid',
enableColumnResize: true,
enableHdMenu: true,
frame:false,
//iconCls:'icon-grid',
columnLines: false,
viewConfig: {
forceFit:true
},
title : _('ID_SKINS'),
store: store,
cm: cmodel,
sm: smodel,
tbar: [newButton, '-', importButton,exportButton, {xtype: 'tbfill'}, searchText,clearTextButton,searchButton],
bbar: bbarpaging,
listeners: {
rowdblclick: EditCalendarAction
},
view: new Ext.grid.GroupingView({
forceFit:true,
groupTextTpl: '{text}'
})
});
infoGrid.on('rowcontextmenu',
function (grid, rowIndex, evt) {
var sm = grid.getSelectionModel();
sm.selectRow(rowIndex, sm.isSelected(rowIndex));
},
this
);
infoGrid.on('contextmenu', function(evt){evt.preventDefault();}, this);
infoGrid.addListener('rowcontextmenu',onMessageContextMenu, this);
infoGrid.store.load();
viewport = new Ext.Viewport({
layout: 'fit',
autoScroll: false,
items: [
infoGrid
]
});
}); });
//Function format dates
showdate = function (value){
return _DF(value);
};
//Funtion Handles Context Menu Opening //Funtion Handles Context Menu Opening
onMessageContextMenu = function (grid, rowIndex, e) { onMessageContextMenu = function (grid, rowIndex, e) {
e.stopEvent(); e.stopEvent();
var coords = e.getXY(); var coords = e.getXY();
contextMenu.showAt([coords[0], coords[1]]); contextMenu.showAt([coords[0], coords[1]]);
}; };
//Do Nothing Function //Do Nothing Function
@@ -294,25 +299,25 @@ DoNothing = function(){};
//Open New Calendar //Open New Calendar
NewCalendarAction = function(){ NewCalendarAction = function(){
location.href = 'calendarEdit'; location.href = 'calendarEdit';
}; };
//Load Grid By Default //Load Grid By Default
GridByDefault = function(){ GridByDefault = function(){
searchText.reset(); searchText.reset();
infoGrid.store.load(); infoGrid.store.load();
}; };
//Do Search Function //Do Search Function
DoSearch = function(){ DoSearch = function(){
infoGrid.store.load({params: {textFilter: searchText.getValue()}}); infoGrid.store.load({params: {textFilter: searchText.getValue()}});
}; };
//Edit Calendar Action //Edit Calendar Action
EditCalendarAction = function(){ EditCalendarAction = function(){
rowSelected = infoGrid.getSelectionModel().getSelected(); rowSelected = infoGrid.getSelectionModel().getSelected();
if (rowSelected){ if (rowSelected){
location.href = 'calendarEdit?id=' + rowSelected.data.CALENDAR_UID; location.href = 'calendarEdit?id=' + rowSelected.data.CALENDAR_UID;
} }
}; };
@@ -327,30 +332,30 @@ DeleteButtonAction = function(){
viewport.getEl().unmask(); viewport.getEl().unmask();
var resp = Ext.util.JSON.decode(r.responseText); var resp = Ext.util.JSON.decode(r.responseText);
if (resp.success){ if (resp.success){
Ext.Msg.confirm(_('ID_CONFIRM'),_('ID_CONFIRM_DELETE_CALENDAR'), Ext.Msg.confirm(_('ID_CONFIRM'),_('ID_CONFIRM_DELETE_CALENDAR'),
function(btn, text){ function(btn, text){
if (btn=='yes'){ if (btn=='yes'){
viewport.getEl().mask(_('ID_PROCESSING')); viewport.getEl().mask(_('ID_PROCESSING'));
Ext.Ajax.request({ Ext.Ajax.request({
url: 'calendar_Ajax', url: 'calendar_Ajax',
params: {action: 'deleteCalendar', CAL_UID: rowSelected.data.CALENDAR_UID}, params: {action: 'deleteCalendar', CAL_UID: rowSelected.data.CALENDAR_UID},
success: function(r,o){ success: function(r,o){
viewport.getEl().unmask(); viewport.getEl().unmask();
editButton.disable(); editButton.disable();
deleteButton.disable(); deleteButton.disable();
copyButton.disable(); copyButton.disable();
DoSearch(); DoSearch();
PMExt.notify(_('ID_CALENDARS'),_('ID_CALENDAR_SUCCESS_DELETE')); PMExt.notify(_('ID_CALENDARS'),_('ID_CALENDAR_SUCCESS_DELETE'));
}, },
failure: function(r,o){ failure: function(r,o){
viewport.getEl().unmask(); viewport.getEl().unmask();
} }
}); });
} }
} }
); );
}else{ }else{
PMExt.error(_('ID_CALENDARS'),_('ID_MSG_CANNOT_DELETE_CALENDAR')); PMExt.error(_('ID_CALENDARS'),_('ID_MSG_CANNOT_DELETE_CALENDAR'));
} }
}, },
failure: function(r,o){ failure: function(r,o){
@@ -362,9 +367,9 @@ DeleteButtonAction = function(){
//Render Status //Render Status
render_status = function(v){ render_status = function(v){
switch(v){ switch(v){
case 'ACTIVE': return '<font color="green">' + _('ID_ACTIVE') + '</font>'; break; case 'ACTIVE': return '<font color="green">' + _('ID_ACTIVE') + '</font>'; break;
case 'INACTIVE': return '<font color="red">' + _('ID_INACTIVE') + '</font>';; break; case 'INACTIVE': return '<font color="red">' + _('ID_INACTIVE') + '</font>';; break;
case 'VACATION': return '<font color="blue">' + _('ID_VACATION') + '</font>';; break; case 'VACATION': return '<font color="blue">' + _('ID_VACATION') + '</font>';; break;
} }
}; };
@@ -379,7 +384,7 @@ CopyButtonAction = function(){
//Update Page Size Configuration //Update Page Size Configuration
UpdatePageConfig = function(pageSize){ UpdatePageConfig = function(pageSize){
Ext.Ajax.request({ Ext.Ajax.request({
url: 'calendar_Ajax', url: 'calendar_Ajax',
params: {action:'updatePageSize', size: pageSize} params: {action:'updatePageSize', size: pageSize}
}); });
}; };