1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-17 12:48:24 +01:00

Schedule task was failing when multiple tab items were selected/saved.

This commit is contained in:
Cameron 2020-08-12 13:24:50 -07:00
parent 09c3a189c6
commit d0823f1b50

View File

@ -325,7 +325,16 @@ class cron_admin_ui extends e_admin_ui
// Process _POST before saving.
public function beforeUpdate($new_data, $old_data, $id)
{
$new_data['cron_tab'] = implode(" ", $new_data['tab']);
$tab = [];
foreach($new_data['tab'] as $t)
{
$tab[] = implode(",", $t);
}
$new_data['cron_tab'] = implode(" ", $tab);
e107::getMessage()->addDebug("Cron Tab: ".$new_data['cron_tab']);
return $new_data;
}
@ -627,7 +636,7 @@ class cron_admin_form_ui extends e_admin_form_ui
$text = "
<select style='height:120px' multiple='multiple' name='tab[minute]'>
<select style='height:140px' multiple='multiple' name='tab[minute][]'>
\n";
foreach ($this->min_options as $key => $val)
@ -655,7 +664,7 @@ class cron_admin_form_ui extends e_admin_form_ui
$text .= "
</select>
<select style='height:120px' multiple='multiple' name='tab[hour]'>
<select style='height:140px' multiple='multiple' name='tab[hour][]'>
\n";
foreach ($this->hour_options as $key => $val)
@ -680,7 +689,7 @@ class cron_admin_form_ui extends e_admin_form_ui
}
$text .= "</select>
<select style='height:120px' multiple='multiple' name='tab[day]'>\n";
<select style='height:140px' multiple='multiple' name='tab[day][]'>\n";
$sel_day = ($day[0] == "*") ? "selected='selected'" : "";
@ -692,7 +701,7 @@ class cron_admin_form_ui extends e_admin_form_ui
}
$text .= "</select>
<select style='height:120px' multiple='multiple' name='tab[month]'>\n";
<select style='height:140px' multiple='multiple' name='tab[month][]'>\n";
$sel_month = ($month[0] == "*") ? "selected='selected'" : "";
$text .= "<option value='*' $sel_month>".LAN_CRON_41."</option>\n"; // Every Month
@ -705,7 +714,7 @@ class cron_admin_form_ui extends e_admin_form_ui
}
$text .= "</select>
<select style='height:120px' multiple='multiple' name='tab[weekday]'>\n";
<select style='height:140px' multiple='multiple' name='tab[weekday][]'>\n";
$sel_weekday = ($weekday[0] == "*") ? "selected='selected'" : "";
$text .= "<option value='*' $sel_weekday>".LAN_CRON_42."</option>\n"; // Every Week Day.