Skip to content
Code-Schnipsel Gruppen Projekte
Commit 91be2ecc erstellt von Henning Leutz's avatar Henning Leutz :martial_arts_uniform:
Dateien durchsuchen

add a cron and database title fix

Übergeordneter 918ef1dd
Keine zugehörigen Branchen gefunden
Keine zugehörigen Tags gefunden
Keine zugehörigen Merge Requests gefunden
......@@ -107,7 +107,8 @@ define('package/quiqqer/cron/bin/AddCronWindow', [
for ( i = 0, len = result.length; i < len; i++ )
{
new Element('option', {
html : result[ i ].title
value : result[ i ].title,
html : result[ i ].description
}).inject( self.$List );
}
......@@ -142,6 +143,7 @@ define('package/quiqqer/cron/bin/AddCronWindow', [
console.log( result );
}, {
'package' : 'quiqqer/cron',
cron : this.$List.value,
min : this.$Min.value,
hour : this.$Hour.value,
......
......@@ -51,7 +51,13 @@ define('package/quiqqer/cron/bin/Manager', [
Ajax.get('package_quiqqer_cron_ajax_getList', function(result)
{
console.log( result );
if ( !self.$Grid ) {
return;
}
self.$Grid.setData({
data : result
});
}, {
'package' : 'quiqqer/cron'
......@@ -106,7 +112,7 @@ define('package/quiqqer/cron/bin/Manager', [
width : 50
}, {
header : 'Cron-Name',
dataIndex : 'name',
dataIndex : 'title',
dataType : 'string',
width : 150
}, {
......@@ -159,9 +165,7 @@ define('package/quiqqer/cron/bin/Manager', [
this.$Grid.setHeight( size.y - 40 );
this.$Grid.setWidth( size.x - 40 );
}
});
});
\ No newline at end of file
......@@ -4,7 +4,7 @@
<global>
<table name="cron">
<field type="INT( 3 ) NOT NULL AUTO_INCREMENT PRIMARY KEY">id</field>
<field type="VARCHAR( 60 ) NOT NULL">name</field>
<field type="VARCHAR( 60 ) NOT NULL">title</field>
<field type="VARCHAR( 2 ) NOT NULL">min</field>
<field type="VARCHAR( 2 ) NOT NULL">hour</field>
<field type="VARCHAR( 2 ) NOT NULL">day</field>
......
......@@ -15,12 +15,13 @@ namespace QUI\Cron;
class Manager
{
/**
* Add a cron
*
* @param unknown $cron
* @param unknown $min
* @param unknown $hour
* @param unknown $day
* @param unknown $month
* @param unknown $cron - Name of the Cron
* @param unknown $min - On which minute should it start
* @param unknown $hour - On which hour should it start
* @param unknown $day - On which day should it start
* @param unknown $month - On which month should it start
*/
public function add($cron, $min, $hour, $day, $month)
{
......@@ -31,11 +32,15 @@ class Manager
$cronData = $this->getCronData( $cron );
\QUI::getDataBase()->insert($this->Table(), array(
'exec' => $cronData['exec'],
'exec' => $cronData['exec']
'exec' => $cronData['exec'],
'title' => $cronData['title'],
'min' => $min,
'hour' => $hour,
'day' => $day,
'month' => $month
));
QUI::getMessagesHandler()->addSuccess(
\QUI::getMessagesHandler()->addSuccess(
'Cron erfolgreich hinzugefügt'
);
}
......@@ -80,7 +85,7 @@ class Manager
// check if cron is available
foreach ( $availableCrons as $entry )
{
if ( $entry['name'] == $cron ) {
if ( $entry['title'] == $cron ) {
return $entry;
}
}
......
0% Lade oder .
You are about to add 0 people to the discussion. Proceed with caution.
Bearbeitung dieser Nachricht zuerst beenden!
Bitte registrieren oder zum Kommentieren