form improvement
using theme clone
This commit is contained in:
@@ -100,7 +100,7 @@ class ActivityRepository extends EntityRepository
|
||||
*/
|
||||
public function findAll($page = 1)
|
||||
{
|
||||
return $this->getPager($this->queryLatest(), $page);
|
||||
return $this->getPager($this->queryAll(), $page);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
namespace TimesheetBundle\Repository;
|
||||
|
||||
use AppBundle\Entity\User;
|
||||
use TimesheetBundle\Entity\Timesheet;
|
||||
use TimesheetBundle\Entity\Project;
|
||||
use Doctrine\ORM\EntityRepository;
|
||||
use Doctrine\ORM\Query;
|
||||
use Pagerfanta\Adapter\DoctrineORMAdapter;
|
||||
@@ -27,6 +27,15 @@ use TimesheetBundle\Model\ProjectStatistic;
|
||||
class ProjectRepository extends EntityRepository
|
||||
{
|
||||
|
||||
/**
|
||||
* @param $id
|
||||
* @return null|Project
|
||||
*/
|
||||
public function getById($id)
|
||||
{
|
||||
return $this->find($id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return statistic data for all user.
|
||||
*
|
||||
|
||||
@@ -39,8 +39,10 @@ class TimesheetRepository extends EntityRepository
|
||||
*/
|
||||
protected function queryThisMonth($select, User $user = null)
|
||||
{
|
||||
$end = new DateTime();
|
||||
$begin = $end->sub(new \DateInterval("P30D")); // FIXME last month is not last 30 days
|
||||
$end = new DateTime('last day of this month');
|
||||
$end->setTime(23, 59, 59);
|
||||
$begin = new DateTime('first day of this month');
|
||||
$begin->setTime(0,0,0);
|
||||
|
||||
return $this->queryTimeRange($select, $begin, $end, $user);
|
||||
}
|
||||
@@ -59,7 +61,7 @@ class TimesheetRepository extends EntityRepository
|
||||
$qb->select($select)
|
||||
->from('TimesheetBundle:Timesheet', 't')
|
||||
->where($qb->expr()->gt('t.begin', ':from'))
|
||||
->andWhere($qb->expr()->gt('t.end', ':to'))
|
||||
->andWhere($qb->expr()->lt('t.end', ':to'))
|
||||
->setParameter('from', $begin, Type::DATETIME)
|
||||
->setParameter('to', $end, Type::DATETIME);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user