improvements
This commit is contained in:
45
src/TimesheetBundle/Controller/Admin/ActivityController.php
Normal file
45
src/TimesheetBundle/Controller/Admin/ActivityController.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Kimai package.
|
||||
*
|
||||
* (c) Kevin Papst <kevin@kevinpapst.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace TimesheetBundle\Controller\Admin;
|
||||
|
||||
use TimesheetBundle\Entity\Activity;
|
||||
use TimesheetBundle\Entity\Timesheet;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Cache;
|
||||
|
||||
/**
|
||||
* Controller used to manage activities in the admin part of the site.
|
||||
*
|
||||
* @Route("/admin/activity")
|
||||
* @Security("has_role('ROLE_ADMIN')")
|
||||
*
|
||||
* @author Kevin Papst <kevin@kevinpapst.de>
|
||||
*/
|
||||
class ActivityController extends Controller
|
||||
{
|
||||
/**
|
||||
* @Route("/", defaults={"page": 1}, name="admin_activity")
|
||||
* @Route("/page/{page}", requirements={"page": "[1-9]\d*"}, name="admin_activity_paginated")
|
||||
* @Method("GET")
|
||||
* @Cache(smaxage="10")
|
||||
*/
|
||||
public function indexAction($page)
|
||||
{
|
||||
/* @var $entries Pagerfanta */
|
||||
$entries = $this->getDoctrine()->getRepository(Activity::class)->findAll($page);
|
||||
|
||||
return $this->render('TimesheetBundle:admin:activity.html.twig', ['entries' => $entries]);
|
||||
}
|
||||
}
|
||||
46
src/TimesheetBundle/Controller/Admin/ProjectController.php
Normal file
46
src/TimesheetBundle/Controller/Admin/ProjectController.php
Normal file
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Kimai package.
|
||||
*
|
||||
* (c) Kevin Papst <kevin@kevinpapst.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace TimesheetBundle\Controller\Admin;
|
||||
|
||||
use Pagerfanta\Pagerfanta;
|
||||
use TimesheetBundle\Entity\Project;
|
||||
use TimesheetBundle\Entity\Timesheet;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Cache;
|
||||
|
||||
/**
|
||||
* Controller used to manage projects in the admin part of the site.
|
||||
*
|
||||
* @Route("/admin/project")
|
||||
* @Security("has_role('ROLE_ADMIN')")
|
||||
*
|
||||
* @author Kevin Papst <kevin@kevinpapst.de>
|
||||
*/
|
||||
class ProjectController extends Controller
|
||||
{
|
||||
/**
|
||||
* @Route("/", defaults={"page": 1}, name="admin_project")
|
||||
* @Route("/page/{page}", requirements={"page": "[1-9]\d*"}, name="admin_project_paginated")
|
||||
* @Method("GET")
|
||||
* @Cache(smaxage="10")
|
||||
*/
|
||||
public function indexAction($page)
|
||||
{
|
||||
/* @var $entries Pagerfanta */
|
||||
$entries = $this->getDoctrine()->getRepository(Project::class)->findAll($page);
|
||||
|
||||
return $this->render('TimesheetBundle:admin:project.html.twig', ['entries' => $entries]);
|
||||
}
|
||||
}
|
||||
@@ -22,22 +22,23 @@ use Sensio\Bundle\FrameworkExtraBundle\Configuration\Cache;
|
||||
* Controller used for manage timesheet entries in the admin part of the site.
|
||||
*
|
||||
* @Route("/admin/timesheet")
|
||||
* @Security("has_role('ROLE_CUSTOMER')")
|
||||
* @Security("has_role('ROLE_ADMIN')")
|
||||
*
|
||||
* @author Kevin Papst <kevin@kevinpapst.de>
|
||||
*/
|
||||
class TimesheetController extends Controller
|
||||
{
|
||||
/**
|
||||
* @Route("/", defaults={"page": 1}, name="admin_timesheet_index")
|
||||
* @Route("/timesheet/{page}", requirements={"page": "[1-9]\d*"}, name="admin_timesheet_index_paginated")
|
||||
* @Route("/", defaults={"page": 1}, name="admin_timesheet")
|
||||
* @Route("/page/{page}", requirements={"page": "[1-9]\d*"}, name="admin_timesheet_paginated")
|
||||
* @Method("GET")
|
||||
* @Cache(smaxage="10")
|
||||
*/
|
||||
public function indexAction($page)
|
||||
{
|
||||
/* @var $entries Pagerfanta */
|
||||
$entries = $this->getDoctrine()->getRepository(Timesheet::class)->findAll($page);
|
||||
|
||||
return $this->render('TimesheetBundle:timesheet:index.html.twig', ['entries' => $entries]);
|
||||
return $this->render('TimesheetBundle:admin:timesheet.html.twig', ['entries' => $entries]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ use Sensio\Bundle\FrameworkExtraBundle\Configuration\Cache;
|
||||
* Controller used to manage timesheet contents in the public part of the site.
|
||||
*
|
||||
* @Route("/timesheet")
|
||||
* @Security("has_role('ROLE_CUSTOMER')")
|
||||
* @Security("has_role('ROLE_USER')")
|
||||
*
|
||||
* @author Kevin Papst <kevin@kevinpapst.de>
|
||||
*/
|
||||
@@ -37,6 +37,7 @@ class TimesheetController extends Controller
|
||||
public function indexAction($page)
|
||||
{
|
||||
$user = $this->getUser();
|
||||
/* @var $entries Pagerfanta */
|
||||
$entries = $this->getDoctrine()->getRepository(Timesheet::class)->findLatest($user, $page);
|
||||
|
||||
return $this->render('TimesheetBundle:timesheet:index.html.twig', ['entries' => $entries]);
|
||||
|
||||
@@ -17,7 +17,7 @@ use Doctrine\ORM\Mapping as ORM;
|
||||
* Activity
|
||||
*
|
||||
* @ORM\Table(name="activities")
|
||||
* @ORM\Entity
|
||||
* @ORM\Entity(repositoryClass="TimesheetBundle\Repository\ActivityRepository")
|
||||
*
|
||||
* @author Kevin Papst <kevin@kevinpapst.de>
|
||||
*/
|
||||
@@ -54,20 +54,6 @@ class Activity
|
||||
*/
|
||||
private $visible = '1';
|
||||
|
||||
/**
|
||||
* @var boolean
|
||||
*
|
||||
* @ORM\Column(name="filter", type="boolean", nullable=false)
|
||||
*/
|
||||
private $filter = '0';
|
||||
|
||||
/**
|
||||
* @var boolean
|
||||
*
|
||||
* @ORM\Column(name="trash", type="boolean", nullable=false)
|
||||
*/
|
||||
private $trash = '0';
|
||||
|
||||
/**
|
||||
* Set name
|
||||
*
|
||||
@@ -140,60 +126,12 @@ class Activity
|
||||
return $this->visible;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set filter
|
||||
*
|
||||
* @param boolean $filter
|
||||
*
|
||||
* @return Activity
|
||||
*/
|
||||
public function setFilter($filter)
|
||||
{
|
||||
$this->filter = $filter;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get filter
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function getFilter()
|
||||
{
|
||||
return $this->filter;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set trash
|
||||
*
|
||||
* @param boolean $trash
|
||||
*
|
||||
* @return Activity
|
||||
*/
|
||||
public function setTrash($trash)
|
||||
{
|
||||
$this->trash = $trash;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get trash
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function getTrash()
|
||||
{
|
||||
return $this->trash;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get activityid
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getActivityid()
|
||||
public function getActivityId()
|
||||
{
|
||||
return $this->activityid;
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ use Doctrine\ORM\Mapping as ORM;
|
||||
* Project
|
||||
*
|
||||
* @ORM\Table(name="projects", indexes={@ORM\Index(name="customerID", columns={"customerID"})})
|
||||
* @ORM\Entity
|
||||
* @ORM\Entity(repositoryClass="TimesheetBundle\Repository\ProjectRepository")
|
||||
*
|
||||
* @author Kevin Papst <kevin@kevinpapst.de>
|
||||
*/
|
||||
@@ -61,20 +61,6 @@ class Project
|
||||
*/
|
||||
private $visible = '1';
|
||||
|
||||
/**
|
||||
* @var boolean
|
||||
*
|
||||
* @ORM\Column(name="filter", type="boolean", nullable=false)
|
||||
*/
|
||||
private $filter = '0';
|
||||
|
||||
/**
|
||||
* @var boolean
|
||||
*
|
||||
* @ORM\Column(name="trash", type="boolean", nullable=false)
|
||||
*/
|
||||
private $trash = '0';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
@@ -82,35 +68,14 @@ class Project
|
||||
*/
|
||||
private $budget = '0.00';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="effort", type="decimal", precision=10, scale=2, nullable=true)
|
||||
*/
|
||||
private $effort;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="approved", type="decimal", precision=10, scale=2, nullable=true)
|
||||
*/
|
||||
private $approved;
|
||||
|
||||
/**
|
||||
* @var boolean
|
||||
*
|
||||
* @ORM\Column(name="internal", type="boolean", nullable=false)
|
||||
*/
|
||||
private $internal = '0';
|
||||
|
||||
/**
|
||||
* Set customerid
|
||||
*
|
||||
* @param integer $customerid
|
||||
*
|
||||
* @return KimaiProjects
|
||||
* @return Project
|
||||
*/
|
||||
public function setCustomerid($customerid)
|
||||
public function setCustomerId($customerid)
|
||||
{
|
||||
$this->customerid = $customerid;
|
||||
|
||||
@@ -122,7 +87,7 @@ class Project
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getCustomerid()
|
||||
public function getCustomerId()
|
||||
{
|
||||
return $this->customerid;
|
||||
}
|
||||
@@ -132,7 +97,7 @@ class Project
|
||||
*
|
||||
* @param string $name
|
||||
*
|
||||
* @return KimaiProjects
|
||||
* @return Project
|
||||
*/
|
||||
public function setName($name)
|
||||
{
|
||||
@@ -156,7 +121,7 @@ class Project
|
||||
*
|
||||
* @param string $comment
|
||||
*
|
||||
* @return KimaiProjects
|
||||
* @return Project
|
||||
*/
|
||||
public function setComment($comment)
|
||||
{
|
||||
@@ -180,7 +145,7 @@ class Project
|
||||
*
|
||||
* @param boolean $visible
|
||||
*
|
||||
* @return KimaiProjects
|
||||
* @return Project
|
||||
*/
|
||||
public function setVisible($visible)
|
||||
{
|
||||
@@ -199,60 +164,12 @@ class Project
|
||||
return $this->visible;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set filter
|
||||
*
|
||||
* @param boolean $filter
|
||||
*
|
||||
* @return KimaiProjects
|
||||
*/
|
||||
public function setFilter($filter)
|
||||
{
|
||||
$this->filter = $filter;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get filter
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function getFilter()
|
||||
{
|
||||
return $this->filter;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set trash
|
||||
*
|
||||
* @param boolean $trash
|
||||
*
|
||||
* @return KimaiProjects
|
||||
*/
|
||||
public function setTrash($trash)
|
||||
{
|
||||
$this->trash = $trash;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get trash
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function getTrash()
|
||||
{
|
||||
return $this->trash;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set budget
|
||||
*
|
||||
* @param string $budget
|
||||
*
|
||||
* @return KimaiProjects
|
||||
* @return Project
|
||||
*/
|
||||
public function setBudget($budget)
|
||||
{
|
||||
@@ -271,84 +188,12 @@ class Project
|
||||
return $this->budget;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set effort
|
||||
*
|
||||
* @param string $effort
|
||||
*
|
||||
* @return KimaiProjects
|
||||
*/
|
||||
public function setEffort($effort)
|
||||
{
|
||||
$this->effort = $effort;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get effort
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getEffort()
|
||||
{
|
||||
return $this->effort;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set approved
|
||||
*
|
||||
* @param string $approved
|
||||
*
|
||||
* @return KimaiProjects
|
||||
*/
|
||||
public function setApproved($approved)
|
||||
{
|
||||
$this->approved = $approved;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get approved
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getApproved()
|
||||
{
|
||||
return $this->approved;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set internal
|
||||
*
|
||||
* @param boolean $internal
|
||||
*
|
||||
* @return KimaiProjects
|
||||
*/
|
||||
public function setInternal($internal)
|
||||
{
|
||||
$this->internal = $internal;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get internal
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function getInternal()
|
||||
{
|
||||
return $this->internal;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get projectid
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getProjectid()
|
||||
public function getProjectId()
|
||||
{
|
||||
return $this->projectid;
|
||||
}
|
||||
|
||||
@@ -29,16 +29,16 @@ class Menu
|
||||
*/
|
||||
public function onMainMenuConfigure(ConfigureMainMenuEvent $event)
|
||||
{
|
||||
$menu = $event->getMenu();
|
||||
$auth = $event->getAuth();
|
||||
|
||||
$isLoggedIn = $auth->isGranted('IS_AUTHENTICATED_FULLY');
|
||||
$isAdmin = $isLoggedIn && $auth->isGranted('ROLE_ADMIN');
|
||||
$isUser = $isLoggedIn && $auth->isGranted('ROLE_USER');
|
||||
|
||||
if (!$isLoggedIn) {
|
||||
if (!$isLoggedIn || !$isUser) {
|
||||
return;
|
||||
}
|
||||
|
||||
$menu = $event->getMenu();
|
||||
$menu->addItem(
|
||||
new MenuItemModel('timesheet', 'menu.timesheet', 'timesheet', [], 'fa fa-clock-o')
|
||||
);
|
||||
@@ -60,7 +60,12 @@ class Menu
|
||||
}
|
||||
|
||||
$menu->addChild(
|
||||
new MenuItemModel('timesheet_admin', 'menu.admin_timesheet', 'admin_timesheet_index', [], 'fa fa-clock-o')
|
||||
);
|
||||
new MenuItemModel('timesheet_admin', 'menu.admin_timesheet', 'admin_timesheet', [], 'fa fa-clock-o')
|
||||
)->addChild(
|
||||
new MenuItemModel('project_admin', 'menu.admin_project', 'admin_project', [], 'fa fa-object-group')
|
||||
)->addChild(
|
||||
new MenuItemModel('activity_admin', 'menu.admin_activity', 'admin_activity', [], 'fa fa-tasks')
|
||||
)
|
||||
;
|
||||
}
|
||||
}
|
||||
77
src/TimesheetBundle/Repository/ActivityRepository.php
Normal file
77
src/TimesheetBundle/Repository/ActivityRepository.php
Normal file
@@ -0,0 +1,77 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Kimai package.
|
||||
*
|
||||
* (c) Kevin Papst <kevin@kevinpapst.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace TimesheetBundle\Repository;
|
||||
|
||||
use AppBundle\Entity\User;
|
||||
use TimesheetBundle\Entity\Timesheet;
|
||||
use Doctrine\ORM\EntityRepository;
|
||||
use Doctrine\ORM\Query;
|
||||
use Pagerfanta\Adapter\DoctrineORMAdapter;
|
||||
use Pagerfanta\Pagerfanta;
|
||||
|
||||
/**
|
||||
* Class ActivityRepository
|
||||
*
|
||||
* @author Kevin Papst <kevin@kevinpapst.de>
|
||||
*/
|
||||
class ActivityRepository extends EntityRepository
|
||||
{
|
||||
|
||||
/**
|
||||
* @param User $user
|
||||
* @return Query
|
||||
*/
|
||||
public function queryLatest(User $user = null)
|
||||
{
|
||||
$qb = $this->getEntityManager()->createQueryBuilder();
|
||||
|
||||
$qb->select('a')
|
||||
->from('TimesheetBundle:Activity', 'a')
|
||||
->orderBy('a.name', 'DESC');
|
||||
|
||||
return $qb->getQuery();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param User $user
|
||||
* @param int $page
|
||||
* @return Pagerfanta
|
||||
*/
|
||||
public function findLatest(User $user, $page = 1)
|
||||
{
|
||||
return $this->getPager($this->queryLatest($user), $page);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $page
|
||||
*
|
||||
* @return Pagerfanta
|
||||
*/
|
||||
public function findAll($page = 1)
|
||||
{
|
||||
return $this->getPager($this->queryLatest(), $page);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Query $query
|
||||
* @param int $page
|
||||
* @return Pagerfanta
|
||||
*/
|
||||
protected function getPager(Query $query, $page = 1)
|
||||
{
|
||||
$paginator = new Pagerfanta(new DoctrineORMAdapter($query, false));
|
||||
$paginator->setMaxPerPage(25);
|
||||
$paginator->setCurrentPage($page);
|
||||
|
||||
return $paginator;
|
||||
}
|
||||
}
|
||||
77
src/TimesheetBundle/Repository/ProjectRepository.php
Normal file
77
src/TimesheetBundle/Repository/ProjectRepository.php
Normal file
@@ -0,0 +1,77 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Kimai package.
|
||||
*
|
||||
* (c) Kevin Papst <kevin@kevinpapst.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace TimesheetBundle\Repository;
|
||||
|
||||
use AppBundle\Entity\User;
|
||||
use TimesheetBundle\Entity\Timesheet;
|
||||
use Doctrine\ORM\EntityRepository;
|
||||
use Doctrine\ORM\Query;
|
||||
use Pagerfanta\Adapter\DoctrineORMAdapter;
|
||||
use Pagerfanta\Pagerfanta;
|
||||
|
||||
/**
|
||||
* Class ProjectRepository
|
||||
*
|
||||
* @author Kevin Papst <kevin@kevinpapst.de>
|
||||
*/
|
||||
class ProjectRepository extends EntityRepository
|
||||
{
|
||||
|
||||
/**
|
||||
* @param User $user
|
||||
* @return Query
|
||||
*/
|
||||
public function queryLatest(User $user = null)
|
||||
{
|
||||
$qb = $this->getEntityManager()->createQueryBuilder();
|
||||
|
||||
$qb->select('p')
|
||||
->from('TimesheetBundle:Project', 'p')
|
||||
->orderBy('p.name', 'DESC');
|
||||
|
||||
return $qb->getQuery();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param User $user
|
||||
* @param int $page
|
||||
* @return Pagerfanta
|
||||
*/
|
||||
public function findLatest(User $user, $page = 1)
|
||||
{
|
||||
return $this->getPager($this->queryLatest($user), $page);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $page
|
||||
*
|
||||
* @return Pagerfanta
|
||||
*/
|
||||
public function findAll($page = 1)
|
||||
{
|
||||
return $this->getPager($this->queryLatest(), $page);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Query $query
|
||||
* @param int $page
|
||||
* @return Pagerfanta
|
||||
*/
|
||||
protected function getPager(Query $query, $page = 1)
|
||||
{
|
||||
$paginator = new Pagerfanta(new DoctrineORMAdapter($query, false));
|
||||
$paginator->setMaxPerPage(25);
|
||||
$paginator->setCurrentPage($page);
|
||||
|
||||
return $paginator;
|
||||
}
|
||||
}
|
||||
@@ -34,12 +34,12 @@ class TimesheetRepository extends EntityRepository
|
||||
{
|
||||
$qb = $this->getEntityManager()->createQueryBuilder();
|
||||
|
||||
$qb->select('p')
|
||||
->from('TimesheetBundle:Timesheet', 'p')
|
||||
->orderBy('p.start', 'DESC');
|
||||
$qb->select('t')
|
||||
->from('TimesheetBundle:Timesheet', 't')
|
||||
->orderBy('t.start', 'DESC');
|
||||
|
||||
if (null !== $user) {
|
||||
$qb->where('p.user = :user')
|
||||
$qb->where('t.user = :user')
|
||||
->setParameter('user', $user);
|
||||
}
|
||||
|
||||
|
||||
36
src/TimesheetBundle/Resources/views/admin/activity.html.twig
Normal file
36
src/TimesheetBundle/Resources/views/admin/activity.html.twig
Normal file
@@ -0,0 +1,36 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
{% import "macros/widgets.html.twig" as widgets %}
|
||||
|
||||
{% block page_title %}{{ 'admin_activity.title'|trans }}{% endblock %}
|
||||
{% block page_subtitle %}{{ 'admin_activity.subtitle'|trans }}{% endblock %}
|
||||
|
||||
{% block main %}
|
||||
{% if entries.count > 0 %}
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><i class="fa fa-calendar"></i> {{ 'label.name'|trans }}</th>
|
||||
<th><i class="fa fa-hourglass-start"></i> {{ 'label.comment'|trans }}</th>
|
||||
<th><i class="fa fa-hourglass-end"></i> {{ 'label.visible'|trans }}</th>
|
||||
<th><i class="fa fa-clock-o"></i> {{ 'label.id'|trans }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for entry in entries %}
|
||||
<tr>
|
||||
<td>{{ entry.name }}</td>
|
||||
<td>{{ entry.comment }}</td>
|
||||
<td>{{ entry.visible }}</td>
|
||||
<td>{{ entry.activityId }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div class="navigation text-center">
|
||||
{{ pagerfanta(entries, 'twitter_bootstrap3_translated', { routeName: 'timesheet_paginated' }) }}
|
||||
</div>
|
||||
{% else %}
|
||||
{{ widgets.callout('warning', 'error.no_entries_found') }}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
38
src/TimesheetBundle/Resources/views/admin/project.html.twig
Normal file
38
src/TimesheetBundle/Resources/views/admin/project.html.twig
Normal file
@@ -0,0 +1,38 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
{% import "macros/widgets.html.twig" as widgets %}
|
||||
|
||||
{% block page_title %}{{ 'admin_project.title'|trans }}{% endblock %}
|
||||
{% block page_subtitle %}{{ 'admin_project.subtitle'|trans }}{% endblock %}
|
||||
|
||||
{% block main %}
|
||||
{% if entries.count > 0 %}
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><i class="fa fa-calendar"></i> {{ 'label.name'|trans }}</th>
|
||||
<th><i class="fa fa-hourglass-start"></i> {{ 'label.comment'|trans }}</th>
|
||||
<th><i class="fa fa-hourglass-end"></i> {{ 'label.visible'|trans }}</th>
|
||||
<th><i class="fa fa-clock-o"></i> {{ 'label.id'|trans }}</th>
|
||||
<th><i class="fa fa-credit-card"></i> {{ 'label.budget'|trans }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for entry in entries %}
|
||||
<tr>
|
||||
<td>{{ entry.name }}</td>
|
||||
<td>{{ entry.comment }}</td>
|
||||
<td>{{ entry.visible }}</td>
|
||||
<td>{{ entry.projectId }}</td>
|
||||
<td>{{ entry.budget}}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div class="navigation text-center">
|
||||
{{ pagerfanta(entries, 'twitter_bootstrap3_translated', { routeName: 'timesheet_paginated' }) }}
|
||||
</div>
|
||||
{% else %}
|
||||
{{ widgets.callout('warning', 'error.no_entries_found') }}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,40 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
{% import "macros/widgets.html.twig" as widgets %}
|
||||
|
||||
{% block page_title %}{{ 'admin_timesheet.title'|trans }}{% endblock %}
|
||||
{% block page_subtitle %}{{ 'admin_timesheet.subtitle'|trans }}{% endblock %}
|
||||
|
||||
{% block main %}
|
||||
{% if entries.count > 0 %}
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><i class="fa fa-calendar"></i> {{ 'label.date'|trans }}</th>
|
||||
<th><i class="fa fa-hourglass-start"></i> {{ 'label.starttime'|trans }}</th>
|
||||
<th><i class="fa fa-hourglass-end"></i> {{ 'label.endtime'|trans }}</th>
|
||||
<th><i class="fa fa-clock-o"></i> {{ 'label.duration'|trans }}</th>
|
||||
<th><i class="fa fa-user"></i> {{ 'label.username'|trans }}</th>
|
||||
<th><i class="fa fa-pencil-square-o"></i> {{ 'label.description'|trans }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for entry in entries %}
|
||||
<tr>
|
||||
<td>{{ entry.start|date(kimai_context.date_1) }}</td>
|
||||
<td>{{ entry.start|date("H:i") }}</td>
|
||||
<td>{{ entry.end|date("H:i") }}</td>
|
||||
<td>{{ entry.duration|gmdate }}</td>
|
||||
<td>{{ entry.user.username }}</td>
|
||||
<td>{{ entry.description }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div class="navigation text-center">
|
||||
{{ pagerfanta(entries, 'twitter_bootstrap3_translated', { routeName: 'timesheet_paginated' }) }}
|
||||
</div>
|
||||
{% else %}
|
||||
{{ widgets.callout('warning', 'error.no_entries_found') }}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
@@ -1,10 +1,11 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
{% import "macros/widgets.html.twig" as widgets %}
|
||||
|
||||
{% block page_title %}Timesheet{% endblock %}
|
||||
{% block page_subtitle %}manage your times{% endblock %}
|
||||
{% block page_title %}{{ 'timesheet.title'|trans }}{% endblock %}
|
||||
{% block page_subtitle %}{{ 'timesheet.subtitle'|trans }}{% endblock %}
|
||||
|
||||
{% block main %}
|
||||
{% if entries %}
|
||||
{% if entries.count > 0 %}
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -29,11 +30,11 @@
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% else %}
|
||||
<div class="well">{{ 'post.no_posts_found'|trans }}</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="navigation text-center">
|
||||
{{ pagerfanta(entries, 'twitter_bootstrap3_translated', { routeName: 'timesheet_paginated' }) }}
|
||||
</div>
|
||||
<div class="navigation text-center">
|
||||
{{ pagerfanta(entries, 'twitter_bootstrap3_translated', { routeName: 'timesheet_paginated' }) }}
|
||||
</div>
|
||||
{% else %}
|
||||
{{ widgets.callout('warning', 'error.no_entries_found') }}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user