toolbar dropdown and visibility improvements (#933)

This commit is contained in:
Kevin Papst
2019-07-09 16:34:11 +02:00
committed by GitHub
parent b833e1ce27
commit c33a87a07c
74 changed files with 1317 additions and 631 deletions

View File

@@ -25,16 +25,6 @@ class TimesheetQuery extends ActivityQuery
public const STATE_EXPORTED = 4;
public const STATE_NOT_EXPORTED = 5;
/**
* Overwritten for different default order
* @var string
*/
protected $order = self::ORDER_DESC;
/**
* Overwritten for different default order
* @var string
*/
protected $orderBy = 'begin';
/**
* @var User|null
*/
@@ -62,6 +52,9 @@ class TimesheetQuery extends ActivityQuery
public function __construct()
{
parent::__construct();
$this->setOrder(self::ORDER_DESC);
$this->setOrderBy('begin');
$this->dateRange = new DateRange();
}
@@ -245,4 +238,40 @@ class TimesheetQuery extends ActivityQuery
return $this;
}
/**
* {@inheritdoc}
*/
public function isDirty(): bool
{
if (parent::isDirty()) {
return true;
}
if ($this->activity !== null) {
return true;
}
if (!empty($this->tags)) {
return true;
}
if ($this->user !== null) {
return true;
}
if ($this->state !== self::STATE_ALL) {
return true;
}
if ($this->exported !== self::STATE_ALL) {
return true;
}
if ($this->dateRange->getBegin() !== null || $this->dateRange->getEnd() !== null) {
return true;
}
return false;
}
}