improvements
This commit is contained in:
@@ -9,10 +9,6 @@
|
|||||||
<source>browser.title</source>
|
<source>browser.title</source>
|
||||||
<target>Kimai - Time Tracking</target>
|
<target>Kimai - Time Tracking</target>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
<trans-unit id="app.title">
|
|
||||||
<source>app.title</source>
|
|
||||||
<target>Kimai</target>
|
|
||||||
</trans-unit>
|
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
Login / Security
|
Login / Security
|
||||||
@@ -53,6 +49,18 @@
|
|||||||
<source>menu.timesheet</source>
|
<source>menu.timesheet</source>
|
||||||
<target>Zeiterfassung</target>
|
<target>Zeiterfassung</target>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
|
<trans-unit id="menu.admin_timesheet">
|
||||||
|
<source>menu.admin_timesheet</source>
|
||||||
|
<target>Mitarbeiter Zeiten</target>
|
||||||
|
</trans-unit>
|
||||||
|
<trans-unit id="menu.admin_project">
|
||||||
|
<source>menu.admin_project</source>
|
||||||
|
<target>Projekte</target>
|
||||||
|
</trans-unit>
|
||||||
|
<trans-unit id="menu.admin_activity">
|
||||||
|
<source>menu.admin_activity</source>
|
||||||
|
<target>Aktivitäten</target>
|
||||||
|
</trans-unit>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
Footer
|
Footer
|
||||||
@@ -101,6 +109,10 @@
|
|||||||
<source>http_error_405.suggestion</source>
|
<source>http_error_405.suggestion</source>
|
||||||
<target>Error</target>
|
<target>Error</target>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
|
<trans-unit id="error.no_entries_found">
|
||||||
|
<source>error.no_entries_found</source>
|
||||||
|
<target>Keine Einträge vorhanden</target>
|
||||||
|
</trans-unit>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
General labels
|
General labels
|
||||||
@@ -129,7 +141,86 @@
|
|||||||
<source>label.description</source>
|
<source>label.description</source>
|
||||||
<target>Beschreibung</target>
|
<target>Beschreibung</target>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
|
<trans-unit id="label.name">
|
||||||
|
<source>label.name</source>
|
||||||
|
<target>Name</target>
|
||||||
|
</trans-unit>
|
||||||
|
<trans-unit id="label.comment">
|
||||||
|
<source>label.comment</source>
|
||||||
|
<target>Kommentar</target>
|
||||||
|
</trans-unit>
|
||||||
|
<trans-unit id="label.id">
|
||||||
|
<source>label.id</source>
|
||||||
|
<target>ID</target>
|
||||||
|
</trans-unit>
|
||||||
|
<trans-unit id="label.visible">
|
||||||
|
<source>label.visible</source>
|
||||||
|
<target>Sichtbar</target>
|
||||||
|
</trans-unit>
|
||||||
|
<trans-unit id="label.budget">
|
||||||
|
<source>label.budget</source>
|
||||||
|
<target>Budget</target>
|
||||||
|
</trans-unit>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Dashboard
|
||||||
|
-->
|
||||||
|
<trans-unit id="dashboard.title">
|
||||||
|
<source>dashboard.title</source>
|
||||||
|
<target>Dashboard</target>
|
||||||
|
</trans-unit>
|
||||||
|
<trans-unit id="dashboard.subtitle">
|
||||||
|
<source>dashboard.subtitle</source>
|
||||||
|
<target>Willkommen!</target>
|
||||||
|
</trans-unit>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Timesheet
|
||||||
|
-->
|
||||||
|
<trans-unit id="timesheet.title">
|
||||||
|
<source>timesheet.title</source>
|
||||||
|
<target>Zeiterfassung</target>
|
||||||
|
</trans-unit>
|
||||||
|
<trans-unit id="timesheet.subtitle">
|
||||||
|
<source>timesheet.subtitle</source>
|
||||||
|
<target>Verwalten Sie Ihre Zeiteinträge</target>
|
||||||
|
</trans-unit>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Admin: Timesheet
|
||||||
|
-->
|
||||||
|
<trans-unit id="admin_timesheet.title">
|
||||||
|
<source>admin_timesheet.title</source>
|
||||||
|
<target>Mitarbeiter Zeiterfassung</target>
|
||||||
|
</trans-unit>
|
||||||
|
<trans-unit id="admin_timesheet.subtitle">
|
||||||
|
<source>admin_timesheet.subtitle</source>
|
||||||
|
<target>Zeiten aller Benutzer</target>
|
||||||
|
</trans-unit>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Admin: Projects
|
||||||
|
-->
|
||||||
|
<trans-unit id="admin_project.title">
|
||||||
|
<source>admin_project.title</source>
|
||||||
|
<target>Projekte</target>
|
||||||
|
</trans-unit>
|
||||||
|
<trans-unit id="admin_project.subtitle">
|
||||||
|
<source>admin_project.subtitle</source>
|
||||||
|
<target>Alle vorhandenen Projekte</target>
|
||||||
|
</trans-unit>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Admin: Activity
|
||||||
|
-->
|
||||||
|
<trans-unit id="admin_activity.title">
|
||||||
|
<source>admin_activity.title</source>
|
||||||
|
<target>Aktivitäten</target>
|
||||||
|
</trans-unit>
|
||||||
|
<trans-unit id="admin_activity.subtitle">
|
||||||
|
<source>admin_activity.subtitle</source>
|
||||||
|
<target>Aufgaben zur Zeiterfassung</target>
|
||||||
|
</trans-unit>
|
||||||
</body>
|
</body>
|
||||||
</file>
|
</file>
|
||||||
</xliff>
|
</xliff>
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="navbar-header">
|
<div class="navbar-header">
|
||||||
<a class="navbar-brand" href="{{ path('homepage') }}">
|
<a class="navbar-brand" href="{{ path('homepage') }}">
|
||||||
{{ 'app.title'|trans }}
|
{{ 'browser.title'|trans }}
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<button type="button" class="navbar-toggle"
|
<button type="button" class="navbar-toggle"
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
{% extends 'base.html.twig' %}
|
{% extends 'base.html.twig' %}
|
||||||
{% import "macros/widgets.html.twig" as widgets %}
|
{% import "macros/widgets.html.twig" as widgets %}
|
||||||
|
|
||||||
{% block page_title %}Dashboard{% endblock %}
|
{% block page_title %}{{ 'dashboard.title'|trans }}{% endblock %}
|
||||||
{% block page_subtitle %}Welcome!{% endblock %}
|
{% block page_subtitle %}{{ 'dashboard.subtitle'|trans }}{% endblock %}
|
||||||
|
|
||||||
{% block main %}
|
{% block main %}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,19 @@
|
|||||||
|
|
||||||
|
{% macro alert(type, description, title, icon) %}
|
||||||
|
<div class="alert alert-{{ type|default('danger') }} alert-dismissible">
|
||||||
|
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||||||
|
{% if title %}<h4><i class="icon fa fa-{{ icon|default('ban') }}"></i> {{ title|trans }}</h4>{% endif %}
|
||||||
|
{{ description|trans }}
|
||||||
|
</div>
|
||||||
|
{% endmacro %}
|
||||||
|
|
||||||
|
{% macro callout(type, description, title) %}
|
||||||
|
<div class="callout callout-{{ type|default('danger') }} lead">
|
||||||
|
{% if title %}<h4>{{ title|trans }}</h4>{% endif %}
|
||||||
|
<p>{{ description|trans }}</p>
|
||||||
|
</div>
|
||||||
|
{% endmacro %}
|
||||||
|
|
||||||
{% macro profile_list(user, items, color) %}
|
{% macro profile_list(user, items, color) %}
|
||||||
{% import "AvanzuAdminThemeBundle:layout:macros.html.twig" as macro %}
|
{% import "AvanzuAdminThemeBundle:layout:macros.html.twig" as macro %}
|
||||||
<div class="box box-widget widget-user-2">
|
<div class="box box-widget widget-user-2">
|
||||||
|
|||||||
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.
|
* Controller used for manage timesheet entries in the admin part of the site.
|
||||||
*
|
*
|
||||||
* @Route("/admin/timesheet")
|
* @Route("/admin/timesheet")
|
||||||
* @Security("has_role('ROLE_CUSTOMER')")
|
* @Security("has_role('ROLE_ADMIN')")
|
||||||
*
|
*
|
||||||
* @author Kevin Papst <kevin@kevinpapst.de>
|
* @author Kevin Papst <kevin@kevinpapst.de>
|
||||||
*/
|
*/
|
||||||
class TimesheetController extends Controller
|
class TimesheetController extends Controller
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @Route("/", defaults={"page": 1}, name="admin_timesheet_index")
|
* @Route("/", defaults={"page": 1}, name="admin_timesheet")
|
||||||
* @Route("/timesheet/{page}", requirements={"page": "[1-9]\d*"}, name="admin_timesheet_index_paginated")
|
* @Route("/page/{page}", requirements={"page": "[1-9]\d*"}, name="admin_timesheet_paginated")
|
||||||
* @Method("GET")
|
* @Method("GET")
|
||||||
* @Cache(smaxage="10")
|
* @Cache(smaxage="10")
|
||||||
*/
|
*/
|
||||||
public function indexAction($page)
|
public function indexAction($page)
|
||||||
{
|
{
|
||||||
|
/* @var $entries Pagerfanta */
|
||||||
$entries = $this->getDoctrine()->getRepository(Timesheet::class)->findAll($page);
|
$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.
|
* Controller used to manage timesheet contents in the public part of the site.
|
||||||
*
|
*
|
||||||
* @Route("/timesheet")
|
* @Route("/timesheet")
|
||||||
* @Security("has_role('ROLE_CUSTOMER')")
|
* @Security("has_role('ROLE_USER')")
|
||||||
*
|
*
|
||||||
* @author Kevin Papst <kevin@kevinpapst.de>
|
* @author Kevin Papst <kevin@kevinpapst.de>
|
||||||
*/
|
*/
|
||||||
@@ -37,6 +37,7 @@ class TimesheetController extends Controller
|
|||||||
public function indexAction($page)
|
public function indexAction($page)
|
||||||
{
|
{
|
||||||
$user = $this->getUser();
|
$user = $this->getUser();
|
||||||
|
/* @var $entries Pagerfanta */
|
||||||
$entries = $this->getDoctrine()->getRepository(Timesheet::class)->findLatest($user, $page);
|
$entries = $this->getDoctrine()->getRepository(Timesheet::class)->findLatest($user, $page);
|
||||||
|
|
||||||
return $this->render('TimesheetBundle:timesheet:index.html.twig', ['entries' => $entries]);
|
return $this->render('TimesheetBundle:timesheet:index.html.twig', ['entries' => $entries]);
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ use Doctrine\ORM\Mapping as ORM;
|
|||||||
* Activity
|
* Activity
|
||||||
*
|
*
|
||||||
* @ORM\Table(name="activities")
|
* @ORM\Table(name="activities")
|
||||||
* @ORM\Entity
|
* @ORM\Entity(repositoryClass="TimesheetBundle\Repository\ActivityRepository")
|
||||||
*
|
*
|
||||||
* @author Kevin Papst <kevin@kevinpapst.de>
|
* @author Kevin Papst <kevin@kevinpapst.de>
|
||||||
*/
|
*/
|
||||||
@@ -54,20 +54,6 @@ class Activity
|
|||||||
*/
|
*/
|
||||||
private $visible = '1';
|
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
|
* Set name
|
||||||
*
|
*
|
||||||
@@ -140,60 +126,12 @@ class Activity
|
|||||||
return $this->visible;
|
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
|
* Get activityid
|
||||||
*
|
*
|
||||||
* @return integer
|
* @return integer
|
||||||
*/
|
*/
|
||||||
public function getActivityid()
|
public function getActivityId()
|
||||||
{
|
{
|
||||||
return $this->activityid;
|
return $this->activityid;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ use Doctrine\ORM\Mapping as ORM;
|
|||||||
* Project
|
* Project
|
||||||
*
|
*
|
||||||
* @ORM\Table(name="projects", indexes={@ORM\Index(name="customerID", columns={"customerID"})})
|
* @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>
|
* @author Kevin Papst <kevin@kevinpapst.de>
|
||||||
*/
|
*/
|
||||||
@@ -61,20 +61,6 @@ class Project
|
|||||||
*/
|
*/
|
||||||
private $visible = '1';
|
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
|
* @var string
|
||||||
*
|
*
|
||||||
@@ -82,35 +68,14 @@ class Project
|
|||||||
*/
|
*/
|
||||||
private $budget = '0.00';
|
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
|
* Set customerid
|
||||||
*
|
*
|
||||||
* @param integer $customerid
|
* @param integer $customerid
|
||||||
*
|
*
|
||||||
* @return KimaiProjects
|
* @return Project
|
||||||
*/
|
*/
|
||||||
public function setCustomerid($customerid)
|
public function setCustomerId($customerid)
|
||||||
{
|
{
|
||||||
$this->customerid = $customerid;
|
$this->customerid = $customerid;
|
||||||
|
|
||||||
@@ -122,7 +87,7 @@ class Project
|
|||||||
*
|
*
|
||||||
* @return integer
|
* @return integer
|
||||||
*/
|
*/
|
||||||
public function getCustomerid()
|
public function getCustomerId()
|
||||||
{
|
{
|
||||||
return $this->customerid;
|
return $this->customerid;
|
||||||
}
|
}
|
||||||
@@ -132,7 +97,7 @@ class Project
|
|||||||
*
|
*
|
||||||
* @param string $name
|
* @param string $name
|
||||||
*
|
*
|
||||||
* @return KimaiProjects
|
* @return Project
|
||||||
*/
|
*/
|
||||||
public function setName($name)
|
public function setName($name)
|
||||||
{
|
{
|
||||||
@@ -156,7 +121,7 @@ class Project
|
|||||||
*
|
*
|
||||||
* @param string $comment
|
* @param string $comment
|
||||||
*
|
*
|
||||||
* @return KimaiProjects
|
* @return Project
|
||||||
*/
|
*/
|
||||||
public function setComment($comment)
|
public function setComment($comment)
|
||||||
{
|
{
|
||||||
@@ -180,7 +145,7 @@ class Project
|
|||||||
*
|
*
|
||||||
* @param boolean $visible
|
* @param boolean $visible
|
||||||
*
|
*
|
||||||
* @return KimaiProjects
|
* @return Project
|
||||||
*/
|
*/
|
||||||
public function setVisible($visible)
|
public function setVisible($visible)
|
||||||
{
|
{
|
||||||
@@ -199,60 +164,12 @@ class Project
|
|||||||
return $this->visible;
|
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
|
* Set budget
|
||||||
*
|
*
|
||||||
* @param string $budget
|
* @param string $budget
|
||||||
*
|
*
|
||||||
* @return KimaiProjects
|
* @return Project
|
||||||
*/
|
*/
|
||||||
public function setBudget($budget)
|
public function setBudget($budget)
|
||||||
{
|
{
|
||||||
@@ -271,84 +188,12 @@ class Project
|
|||||||
return $this->budget;
|
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
|
* Get projectid
|
||||||
*
|
*
|
||||||
* @return integer
|
* @return integer
|
||||||
*/
|
*/
|
||||||
public function getProjectid()
|
public function getProjectId()
|
||||||
{
|
{
|
||||||
return $this->projectid;
|
return $this->projectid;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,16 +29,16 @@ class Menu
|
|||||||
*/
|
*/
|
||||||
public function onMainMenuConfigure(ConfigureMainMenuEvent $event)
|
public function onMainMenuConfigure(ConfigureMainMenuEvent $event)
|
||||||
{
|
{
|
||||||
$menu = $event->getMenu();
|
|
||||||
$auth = $event->getAuth();
|
$auth = $event->getAuth();
|
||||||
|
|
||||||
$isLoggedIn = $auth->isGranted('IS_AUTHENTICATED_FULLY');
|
$isLoggedIn = $auth->isGranted('IS_AUTHENTICATED_FULLY');
|
||||||
$isAdmin = $isLoggedIn && $auth->isGranted('ROLE_ADMIN');
|
$isUser = $isLoggedIn && $auth->isGranted('ROLE_USER');
|
||||||
|
|
||||||
if (!$isLoggedIn) {
|
if (!$isLoggedIn || !$isUser) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$menu = $event->getMenu();
|
||||||
$menu->addItem(
|
$menu->addItem(
|
||||||
new MenuItemModel('timesheet', 'menu.timesheet', 'timesheet', [], 'fa fa-clock-o')
|
new MenuItemModel('timesheet', 'menu.timesheet', 'timesheet', [], 'fa fa-clock-o')
|
||||||
);
|
);
|
||||||
@@ -60,7 +60,12 @@ class Menu
|
|||||||
}
|
}
|
||||||
|
|
||||||
$menu->addChild(
|
$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 = $this->getEntityManager()->createQueryBuilder();
|
||||||
|
|
||||||
$qb->select('p')
|
$qb->select('t')
|
||||||
->from('TimesheetBundle:Timesheet', 'p')
|
->from('TimesheetBundle:Timesheet', 't')
|
||||||
->orderBy('p.start', 'DESC');
|
->orderBy('t.start', 'DESC');
|
||||||
|
|
||||||
if (null !== $user) {
|
if (null !== $user) {
|
||||||
$qb->where('p.user = :user')
|
$qb->where('t.user = :user')
|
||||||
->setParameter('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' %}
|
{% extends 'base.html.twig' %}
|
||||||
|
{% import "macros/widgets.html.twig" as widgets %}
|
||||||
|
|
||||||
{% block page_title %}Timesheet{% endblock %}
|
{% block page_title %}{{ 'timesheet.title'|trans }}{% endblock %}
|
||||||
{% block page_subtitle %}manage your times{% endblock %}
|
{% block page_subtitle %}{{ 'timesheet.subtitle'|trans }}{% endblock %}
|
||||||
|
|
||||||
{% block main %}
|
{% block main %}
|
||||||
{% if entries %}
|
{% if entries.count > 0 %}
|
||||||
<table class="table table-striped">
|
<table class="table table-striped">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -29,11 +30,11 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
{% else %}
|
|
||||||
<div class="well">{{ 'post.no_posts_found'|trans }}</div>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
<div class="navigation text-center">
|
<div class="navigation text-center">
|
||||||
{{ pagerfanta(entries, 'twitter_bootstrap3_translated', { routeName: 'timesheet_paginated' }) }}
|
{{ pagerfanta(entries, 'twitter_bootstrap3_translated', { routeName: 'timesheet_paginated' }) }}
|
||||||
</div>
|
</div>
|
||||||
|
{% else %}
|
||||||
|
{{ widgets.callout('warning', 'error.no_entries_found') }}
|
||||||
|
{% endif %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
Reference in New Issue
Block a user