Newer
Older

Henning Leutz
committed
* @module package/quiqqer/cron/bin/History
*
* @require qui/QUI
* @require qui/controls/desktop/Panel
* @require qui/controls/windows/Confirm
* @require qui/controls/buttons/Button
* @require qui/controls/buttons/Seperator
* @require controls/grid/Grid
* @require Ajax
* @require Locale

Henning Leutz
committed
define('package/quiqqer/cron/bin/History', [
'qui/QUI',
'qui/controls/desktop/Panel',
'qui/controls/windows/Confirm',
'qui/controls/buttons/Button',
'qui/controls/buttons/Seperator',
'controls/grid/Grid',
'Ajax',
'Locale'
],function(QUI, QUIPanel, QUIConfirm, QUIButton, QUIButtonSeperator, Grid, Ajax, QUILocale)

Henning Leutz
committed
Type : 'package/quiqqer/cron/bin/History',
Binds : [
'$onCreate',
'$onResize'
],
options : {
title : 'Cron-History',
},
initialize : function(options)
{
this.parent( options );
this.addEvents({
onCreate : this.$onCreate,
onResize : this.$onResize
});
},
/**
* Load the History list
*/
loadData : function()
{

Henning Leutz
committed
var self = this,
options = this.$Grid.options;
this.Loader.show();
Ajax.get('package_quiqqer_cron_ajax_history_get', function(result)
{

Henning Leutz
committed
self.$Grid.setData( result );
self.Loader.hide();

Henning Leutz
committed
'package' : 'quiqqer/cron',
params : JSON.encode({
perPage : options.perPage,
page : options.page
})
});
},
/**
* event : on Create
*/
$onCreate : function()
{

Henning Leutz
committed
var self = this,
Content = this.getContent(),
Container = new Element('div', {
'class' : 'box',
styles : {
height : '100%'
}
}).inject( Content );
this.$Grid = new Grid(Container, {
columnModel : [{
header : QUILocale.get('quiqqer/system', 'createdate'),
dataIndex : 'lastexec',
dataType : 'date',
width : 150
}, {

Henning Leutz
committed
width : 50
}, {

Henning Leutz
committed
dataIndex : 'cronTitle',
dataType : 'string',
width : 200
header : QUILocale.get('quiqqer/system', 'user_id'),

Henning Leutz
committed
width : 100
}, {
header : QUILocale.get('quiqqer/system', 'username'),

Henning Leutz
committed
dataIndex : 'username',
dataType : 'string',
this.$Grid.addEvents({
onRefresh : function() {
self.loadData();
}
});
this.$Grid.refresh();
},
/**
* event : on resize
*/
$onResize : function()
{
if ( !this.$Grid ) {
return;
}
var Content = this.getContent(),
size = Content.getSize();
this.$Grid.setHeight( size.y - 40 );
this.$Grid.setWidth( size.x - 40 );
}
});