*/
class ScheduleStatus extends BaculumAPIServer {
+ /**
+ * Default days limit.
+ */
+ const DEF_DAYS = 30;
+
+ /**
+ * Default list items limit.
+ */
+ const DEF_LIMIT = 30;
+
public function get() {
$misc = $this->getModule('misc');
$cmd = array('status', 'schedule');
}
if ($this->Request->contains('days') && $misc->isValidInteger($this->Request['days'])) {
$cmd[] = 'days="' . $this->Request['days'] . '"';
+ } else {
+ /**
+ * For Director < 9.6.0 there was a bug in displaying the full schedule status
+ * that caused showing an incomplete schedule list. Providing days limit
+ * is a workaround to have always complete schedule list for all Director versions
+ * which support 'status schedule' command.
+ */
+ $cmd[] = 'days="' . self::DEF_DAYS . '"';
}
if ($this->Request->contains('limit') && $misc->isValidInteger($this->Request['limit'])) {
$cmd[] = 'limit="' . $this->Request['limit'] . '"';
+ } elseif (!$this->Request->contains('days')) {
+ $cmd[] = 'limit="' . self::DEF_LIMIT . '"';
}
if ($this->Request->contains('time') && $misc->isValidBDateAndTime($this->Request['time'])) {
$cmd[] = 'time="' . $this->Request['time'] . '"';
"description": "Days number to show schedule",
"schema": {
"type": "integer",
+ "default": 30,
"minimum": 1
}
},
"name": "limit",
"in": "query",
"required": false,
- "description": "Schedule results limit",
+ "description": "Schedule results limit. Setting zero disables the limit. Default value is taken into account only if the days parameter is not set.",
"schema": {
"type": "integer",
- "minimum": 1
+ "default": 30,
+ "minimum": 0
}
},
{
*/
class StatusSchedule extends Portlets {
+ /**
+ * Default days limit.
+ */
+ const DEF_DAYS = 90;
+
const JOB = 'Job';
const CLIENT = 'Client';
const SCHEDULE = 'Schedule';
return;
}
$this->loadSchedules();
+ $this->Days->Text = self::DEF_DAYS;
$this->DatePicker->setDate(date('Y-m-d'));
if ($this->getShowClientFilter()) {
$days = $this->getDays();
if (!empty($days)) {
$query[] = 'days=' . $days;
+ } else {
+ $query[] = 'days=' . self::DEF_DAYS;
}
$limit = $this->getLimit();
if (!empty($limit)) {
$query[] = 'limit=' . $limit;
+ } else {
+ $query[] = 'limit=0';
}
$time = $this->getTime();
if (!empty($time)) {