added project start and end date (#1303)
* added sortable js library * activity in invoice is optional * added javascript widget for paginated boxes * fix activity dropdown for globals only * added timesheet service to reduce code duplication * use repository to query for teams in dropdowns * added project validator * validate project start and end against timesheet * include begin and end in dynamic form requests for projects * added timezone and language option to import flag, improve timesheet import speed * deactivate cross-timezone filter * add virtual fields to field order list * composer update * added param to ignore dates * position loader icon fixed - fixes #1330 * permission problem when creating a new project - fixes #1340 * remove dev dependencies webserver and thanks bundle * stop information leak (begin and end date) in duration mode - fixes #1307 * unify timesheet edit dialog for user and admins * fix security issue, own rates exposed to unauthorized users in multi-update dialog
This commit is contained in:
@@ -26,15 +26,15 @@ class BaseQuery
|
||||
public const DEFAULT_PAGE = 1;
|
||||
|
||||
/**
|
||||
* @deprecated since 1.4, will be removed with 1.6
|
||||
* @deprecated since 1.4, will be removed with 2.0
|
||||
*/
|
||||
public const RESULT_TYPE_OBJECTS = 'Objects';
|
||||
/**
|
||||
* @deprecated since 1.4, will be removed with 1.6
|
||||
* @deprecated since 1.4, will be removed with 2.0
|
||||
*/
|
||||
public const RESULT_TYPE_PAGER = 'PagerFanta';
|
||||
/**
|
||||
* @deprecated since 1.4, will be removed with 1.6
|
||||
* @deprecated since 1.4, will be removed with 2.0
|
||||
*/
|
||||
public const RESULT_TYPE_QUERYBUILDER = 'QueryBuilder';
|
||||
|
||||
@@ -63,7 +63,7 @@ class BaseQuery
|
||||
private $order = self::ORDER_ASC;
|
||||
/**
|
||||
* @var string
|
||||
* @deprecated since 1.4, will be removed with 1.6
|
||||
* @deprecated since 1.4, will be removed with 2.0
|
||||
*/
|
||||
private $resultType = self::RESULT_TYPE_PAGER;
|
||||
/**
|
||||
@@ -79,6 +79,23 @@ class BaseQuery
|
||||
*/
|
||||
private $searchTerm;
|
||||
|
||||
/**
|
||||
* @param Team[] $teams
|
||||
* @return $this
|
||||
*/
|
||||
public function setTeams(?array $teams): self
|
||||
{
|
||||
$this->teams = [];
|
||||
|
||||
if (null !== $teams) {
|
||||
foreach ($teams as $team) {
|
||||
$this->addTeam($team);
|
||||
}
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function addTeam(Team $team): self
|
||||
{
|
||||
$this->teams[$team->getId()] = $team;
|
||||
@@ -189,7 +206,7 @@ class BaseQuery
|
||||
*/
|
||||
public function getResultType()
|
||||
{
|
||||
@trigger_error('BaseQuery::getResultType() is deprecated and will be removed with 1.6', E_USER_DEPRECATED);
|
||||
@trigger_error('BaseQuery::getResultType() is deprecated and will be removed with 2.0', E_USER_DEPRECATED);
|
||||
|
||||
return $this->resultType;
|
||||
}
|
||||
@@ -254,4 +271,27 @@ class BaseQuery
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function copyTo(BaseQuery $query): BaseQuery
|
||||
{
|
||||
$query->setDefaults($this->defaults);
|
||||
if (null !== $this->getCurrentUser()) {
|
||||
$query->setCurrentUser($this->getCurrentUser());
|
||||
}
|
||||
$query->setOrder($this->getOrder());
|
||||
$query->setOrderBy($this->getOrderBy());
|
||||
$query->setSearchTerm($this->getSearchTerm());
|
||||
$query->setPage($this->getPage());
|
||||
$query->setPageSize($this->getPageSize());
|
||||
|
||||
foreach ($this->getTeams() as $team) {
|
||||
$query->addTeam($team);
|
||||
}
|
||||
|
||||
if ($this instanceof VisibilityInterface && $query instanceof VisibilityInterface) {
|
||||
$query->setVisibility($this->getVisibility());
|
||||
}
|
||||
|
||||
return $query;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user