improvements
This commit is contained in:
@@ -161,6 +161,14 @@
|
|||||||
<source>label.budget</source>
|
<source>label.budget</source>
|
||||||
<target>Budget</target>
|
<target>Budget</target>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
|
<trans-unit id="label.activity">
|
||||||
|
<source>label.activity</source>
|
||||||
|
<target>Aktivität</target>
|
||||||
|
</trans-unit>
|
||||||
|
<trans-unit id="label.project">
|
||||||
|
<source>label.project</source>
|
||||||
|
<target>Projekt</target>
|
||||||
|
</trans-unit>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
Dashboard
|
Dashboard
|
||||||
@@ -174,6 +182,22 @@
|
|||||||
<target>Willkommen!</target>
|
<target>Willkommen!</target>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Widgets
|
||||||
|
-->
|
||||||
|
<trans-unit id="more.info.link">
|
||||||
|
<source>more.info.link</source>
|
||||||
|
<target>Mehr Infos</target>
|
||||||
|
</trans-unit>
|
||||||
|
<trans-unit id="badge.visible">
|
||||||
|
<source>badge.visible</source>
|
||||||
|
<target>Ja</target>
|
||||||
|
</trans-unit>
|
||||||
|
<trans-unit id="badge.invisible">
|
||||||
|
<source>badge.invisible</source>
|
||||||
|
<target>Nein</target>
|
||||||
|
</trans-unit>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
Timesheet
|
Timesheet
|
||||||
-->
|
-->
|
||||||
|
|||||||
@@ -1,4 +1,25 @@
|
|||||||
|
|
||||||
|
{% macro badge_visible(visible) %}
|
||||||
|
{% import _self as macro %}
|
||||||
|
{% if visible %}
|
||||||
|
{{ macro.badge('badge.visible', 'green') }}
|
||||||
|
{% else %}
|
||||||
|
{{ macro.badge('badge.invisible', 'red') }}
|
||||||
|
{% endif %}
|
||||||
|
{% endmacro %}
|
||||||
|
|
||||||
|
{% macro badge_counter(count, url) %}
|
||||||
|
{% if url %}
|
||||||
|
<a href="{{ url }}"><span class="badge bg-blue">{{ count }}</span></a>
|
||||||
|
{% else %}
|
||||||
|
<span class="badge bg-blue">{{ count }}</span>
|
||||||
|
{% endif %}
|
||||||
|
{% endmacro %}
|
||||||
|
|
||||||
|
{% macro badge(title, color) %}
|
||||||
|
<span class="badge bg-{{ color|default('red') }}">{{ title|trans }}</span>
|
||||||
|
{% endmacro %}
|
||||||
|
|
||||||
{% macro alert(type, description, title, icon) %}
|
{% macro alert(type, description, title, icon) %}
|
||||||
<div class="alert alert-{{ type|default('danger') }} alert-dismissible">
|
<div class="alert alert-{{ type|default('danger') }} alert-dismissible">
|
||||||
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||||||
|
|||||||
@@ -68,23 +68,6 @@ class User implements UserInterface
|
|||||||
*/
|
*/
|
||||||
private $passwordresethash;
|
private $passwordresethash;
|
||||||
|
|
||||||
/**
|
|
||||||
* FIXME remove me
|
|
||||||
*
|
|
||||||
* @var integer
|
|
||||||
*
|
|
||||||
* @ORM\Column(name="ban", type="integer", nullable=false)
|
|
||||||
*/
|
|
||||||
private $ban = '0';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* FIXME remove me
|
|
||||||
* @var integer
|
|
||||||
*
|
|
||||||
* @ORM\Column(name="banTime", type="integer", nullable=false)
|
|
||||||
*/
|
|
||||||
private $bantime = '0';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string
|
* @var string
|
||||||
*
|
*
|
||||||
@@ -111,6 +94,8 @@ class User implements UserInterface
|
|||||||
private $lastactivity = '1';
|
private $lastactivity = '1';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* FIXME manytoone
|
||||||
|
*
|
||||||
* @var integer
|
* @var integer
|
||||||
*
|
*
|
||||||
* @ORM\Column(name="lastRecord", type="integer", nullable=false)
|
* @ORM\Column(name="lastRecord", type="integer", nullable=false)
|
||||||
|
|||||||
@@ -12,6 +12,8 @@
|
|||||||
namespace TimesheetBundle\DataFixtures\ORM;
|
namespace TimesheetBundle\DataFixtures\ORM;
|
||||||
|
|
||||||
use AppBundle\Entity\User;
|
use AppBundle\Entity\User;
|
||||||
|
use TimesheetBundle\Entity\Activity;
|
||||||
|
use TimesheetBundle\Entity\Project;
|
||||||
use TimesheetBundle\Entity\Timesheet;
|
use TimesheetBundle\Entity\Timesheet;
|
||||||
use Doctrine\Common\DataFixtures\FixtureInterface;
|
use Doctrine\Common\DataFixtures\FixtureInterface;
|
||||||
use Doctrine\Common\Persistence\ObjectManager;
|
use Doctrine\Common\Persistence\ObjectManager;
|
||||||
@@ -29,27 +31,72 @@ use AppBundle\DataFixtures\ORM\LoadFixtures as AppBundleLoadFixtures;
|
|||||||
*/
|
*/
|
||||||
class LoadFixtures extends AppBundleLoadFixtures
|
class LoadFixtures extends AppBundleLoadFixtures
|
||||||
{
|
{
|
||||||
const AMOUNT_ACTIVITIES = 20;
|
const AMOUNT_ACTIVITIES = 10; // maximum activites per project
|
||||||
const AMOUNT_TIMESHEET = 1000;
|
const AMOUNT_TIMESHEET = 1000; // timesheet entries total
|
||||||
const AMOUNT_PROJECTS = 10;
|
const AMOUNT_PROJECTS = 20; // projects entries total
|
||||||
const AMOUNT_CUSTOMER = 10;
|
const AMOUNT_CUSTOMER = 10; // customer entries total
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function load(ObjectManager $manager)
|
public function load(ObjectManager $manager)
|
||||||
{
|
{
|
||||||
|
$this->loadProjects($manager);
|
||||||
|
$this->loadActivities($manager);
|
||||||
$this->loadTimesheet($manager);
|
$this->loadTimesheet($manager);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param ObjectManager $manager
|
||||||
|
* @return User[]
|
||||||
|
*/
|
||||||
|
protected function getAllUsers(ObjectManager $manager)
|
||||||
|
{
|
||||||
|
$all = [];
|
||||||
|
/* @var User[] $entries */
|
||||||
|
$entries = $manager->getRepository(User::class)->findAll();
|
||||||
|
foreach ($entries as $temp) {
|
||||||
|
$all[$temp->getId()] = $temp;
|
||||||
|
}
|
||||||
|
return $all;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param ObjectManager $manager
|
||||||
|
* @return Project[]
|
||||||
|
*/
|
||||||
|
protected function getAllProjects(ObjectManager $manager)
|
||||||
|
{
|
||||||
|
$all = [];
|
||||||
|
/* @var Project[] $entries */
|
||||||
|
$entries = $manager->getRepository(Project::class)->findAll();
|
||||||
|
foreach ($entries as $temp) {
|
||||||
|
$all[$temp->getId()] = $temp;
|
||||||
|
}
|
||||||
|
return $all;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @param ObjectManager $manager
|
||||||
|
* @return Activity[]
|
||||||
|
*/
|
||||||
|
protected function getAllActivities(ObjectManager $manager)
|
||||||
|
{
|
||||||
|
$all = [];
|
||||||
|
/* @var Activity[] $entries */
|
||||||
|
$entries = $manager->getRepository(Activity::class)->findAll();
|
||||||
|
foreach ($entries as $temp) {
|
||||||
|
$all[$temp->getId()] = $temp;
|
||||||
|
}
|
||||||
|
return $all;
|
||||||
|
}
|
||||||
|
|
||||||
private function loadTimesheet(ObjectManager $manager)
|
private function loadTimesheet(ObjectManager $manager)
|
||||||
{
|
{
|
||||||
$allUsers = [];
|
$allUser = $this->getAllUsers($manager);
|
||||||
$users = $manager->getRepository(User::class)->findAll();
|
$amountUser = count($allUser);
|
||||||
foreach ($users as $user) {
|
|
||||||
$allUsers[$user->getId()] = $user;
|
$allActivity = $this->getAllActivities($manager);
|
||||||
}
|
$amountActivity = count($allActivity);
|
||||||
$amountUsers = count($allUsers);
|
|
||||||
|
|
||||||
for ($i = 0; $i <= self::AMOUNT_TIMESHEET; $i++) {
|
for ($i = 0; $i <= self::AMOUNT_TIMESHEET; $i++) {
|
||||||
|
|
||||||
@@ -60,19 +107,18 @@ class LoadFixtures extends AppBundleLoadFixtures
|
|||||||
$end = $end->modify('+ '.(rand(1, 43200)).' seconds');
|
$end = $end->modify('+ '.(rand(1, 43200)).' seconds');
|
||||||
|
|
||||||
$entry = new Timesheet();
|
$entry = new Timesheet();
|
||||||
$entry->setProjectid(rand(1, self::AMOUNT_PROJECTS));
|
$entry->setActivity($allActivity[array_rand($allActivity)]);
|
||||||
$entry->setActivityid(rand(1, self::AMOUNT_ACTIVITIES));
|
|
||||||
$entry->setStatusid(1); // TODO
|
$entry->setStatusid(1); // TODO
|
||||||
$entry->setBillable(true);
|
$entry->setBillable($i % 2 == 0);
|
||||||
$entry->setBudget(0);
|
$entry->setBudget(0);
|
||||||
$entry->setCleared(false);
|
$entry->setCleared($i % 7 == 0);
|
||||||
$entry->setComment($this->getRandomPhrase());
|
$entry->setComment($this->getRandomPhrase());
|
||||||
$entry->setDescription($this->getRandomPhrase());
|
$entry->setDescription($this->getRandomPhrase());
|
||||||
$entry->setLocation($this->getRandomLocation());
|
$entry->setLocation($this->getRandomLocation());
|
||||||
$entry->setStart($start->getTimestamp());
|
$entry->setStart($start->getTimestamp());
|
||||||
$entry->setEnd($end->getTimestamp());
|
$entry->setEnd($end->getTimestamp());
|
||||||
$entry->setDuration($end->modify('- ' . $start->getTimestamp() . ' seconds')->getTimestamp());
|
$entry->setDuration($end->modify('- ' . $start->getTimestamp() . ' seconds')->getTimestamp());
|
||||||
$entry->setUser($allUsers[rand(1, $amountUsers)]);
|
$entry->setUser($allUser[rand(1, $amountUser)]);
|
||||||
//$entry->setApproved(false); // TODO
|
//$entry->setApproved(false); // TODO
|
||||||
//$entry->setFixedrate(); // TODO
|
//$entry->setFixedrate(); // TODO
|
||||||
//$entry->setRate(); // TODO
|
//$entry->setRate(); // TODO
|
||||||
@@ -83,6 +129,79 @@ class LoadFixtures extends AppBundleLoadFixtures
|
|||||||
$manager->flush();
|
$manager->flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function loadProjects(ObjectManager $manager)
|
||||||
|
{
|
||||||
|
for ($i = 0; $i <= self::AMOUNT_PROJECTS; $i++) {
|
||||||
|
|
||||||
|
$entry = new Project();
|
||||||
|
$entry->setName($this->getRandomProject());
|
||||||
|
$entry->setBudget(rand(1000, 100000));
|
||||||
|
$entry->setComment($this->getRandomPhrase());
|
||||||
|
$entry->setCustomerId(rand(1, self::AMOUNT_CUSTOMER)); // TODO
|
||||||
|
$entry->setVisible($i % 3 != 0);
|
||||||
|
|
||||||
|
$manager->persist($entry);
|
||||||
|
}
|
||||||
|
$manager->flush();
|
||||||
|
}
|
||||||
|
|
||||||
|
private function loadActivities(ObjectManager $manager)
|
||||||
|
{
|
||||||
|
$allProject = $this->getAllProjects($manager);
|
||||||
|
|
||||||
|
foreach ($allProject as $projectId => $project) {
|
||||||
|
$activityCount = rand(1, self::AMOUNT_ACTIVITIES);
|
||||||
|
for ($i = 0; $i < $activityCount; $i++) {
|
||||||
|
$entry = new Activity();
|
||||||
|
$entry->setProject($project);
|
||||||
|
$entry->setName($this->getRandomActivity());
|
||||||
|
$entry->setComment($this->getRandomPhrase());
|
||||||
|
$entry->setVisible($i % 3 != 0);
|
||||||
|
|
||||||
|
$manager->persist($entry);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$manager->flush();
|
||||||
|
}
|
||||||
|
|
||||||
|
private function getActivities()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'Design',
|
||||||
|
'Programming',
|
||||||
|
'Testing',
|
||||||
|
'Documentation',
|
||||||
|
'Pause',
|
||||||
|
'Internal',
|
||||||
|
'Research',
|
||||||
|
'Meeting',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
private function getRandomActivity()
|
||||||
|
{
|
||||||
|
$all = $this->getActivities();
|
||||||
|
return $all[array_rand($all)];
|
||||||
|
}
|
||||||
|
|
||||||
|
private function getProjects()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'FooBar',
|
||||||
|
'Relaunch',
|
||||||
|
'Refactoring',
|
||||||
|
'Test Automatisation',
|
||||||
|
'Website redesign',
|
||||||
|
'Services',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
private function getRandomProject()
|
||||||
|
{
|
||||||
|
$all = $this->getProjects();
|
||||||
|
return $all[array_rand($all)];
|
||||||
|
}
|
||||||
|
|
||||||
private function getLocations()
|
private function getLocations()
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
@@ -103,8 +222,7 @@ class LoadFixtures extends AppBundleLoadFixtures
|
|||||||
|
|
||||||
private function getRandomLocation()
|
private function getRandomLocation()
|
||||||
{
|
{
|
||||||
$titles = $this->getLocations();
|
$all = $this->getLocations();
|
||||||
|
return $all[array_rand($all)];
|
||||||
return $titles[array_rand($titles)];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,11 +27,18 @@ class Activity
|
|||||||
/**
|
/**
|
||||||
* @var integer
|
* @var integer
|
||||||
*
|
*
|
||||||
* @ORM\Column(name="activityID", type="integer")
|
* @ORM\Column(name="id", type="integer")
|
||||||
* @ORM\Id
|
* @ORM\Id
|
||||||
* @ORM\GeneratedValue(strategy="IDENTITY")
|
* @ORM\GeneratedValue(strategy="IDENTITY")
|
||||||
*/
|
*/
|
||||||
private $activityid;
|
private $id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var Project
|
||||||
|
*
|
||||||
|
* @ORM\ManyToOne(targetEntity="TimesheetBundle\Entity\Project", inversedBy="activities")
|
||||||
|
*/
|
||||||
|
private $project;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string
|
* @var string
|
||||||
@@ -52,7 +59,23 @@ class Activity
|
|||||||
*
|
*
|
||||||
* @ORM\Column(name="visible", type="boolean", nullable=false)
|
* @ORM\Column(name="visible", type="boolean", nullable=false)
|
||||||
*/
|
*/
|
||||||
private $visible = '1';
|
private $visible = true;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return Project
|
||||||
|
*/
|
||||||
|
public function getProject()
|
||||||
|
{
|
||||||
|
return $this->project;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param int $project
|
||||||
|
*/
|
||||||
|
public function setProject($project)
|
||||||
|
{
|
||||||
|
$this->project = $project;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set name
|
* Set name
|
||||||
@@ -131,8 +154,16 @@ class Activity
|
|||||||
*
|
*
|
||||||
* @return integer
|
* @return integer
|
||||||
*/
|
*/
|
||||||
public function getActivityId()
|
public function getId()
|
||||||
{
|
{
|
||||||
return $this->activityid;
|
return $this->id;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function __toString()
|
||||||
|
{
|
||||||
|
return $this->getName();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,13 +27,14 @@ class Project
|
|||||||
/**
|
/**
|
||||||
* @var integer
|
* @var integer
|
||||||
*
|
*
|
||||||
* @ORM\Column(name="projectID", type="integer")
|
* @ORM\Column(name="id", type="integer")
|
||||||
* @ORM\Id
|
* @ORM\Id
|
||||||
* @ORM\GeneratedValue(strategy="IDENTITY")
|
* @ORM\GeneratedValue(strategy="IDENTITY")
|
||||||
*/
|
*/
|
||||||
private $projectid;
|
private $id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* FIXME
|
||||||
* @var integer
|
* @var integer
|
||||||
*
|
*
|
||||||
* @ORM\Column(name="customerID", type="integer", nullable=false)
|
* @ORM\Column(name="customerID", type="integer", nullable=false)
|
||||||
@@ -59,14 +60,21 @@ class Project
|
|||||||
*
|
*
|
||||||
* @ORM\Column(name="visible", type="boolean", nullable=false)
|
* @ORM\Column(name="visible", type="boolean", nullable=false)
|
||||||
*/
|
*/
|
||||||
private $visible = '1';
|
private $visible = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string
|
* @var string
|
||||||
*
|
*
|
||||||
* @ORM\Column(name="budget", type="decimal", precision=10, scale=2, nullable=true)
|
* @ORM\Column(name="budget", type="decimal", precision=10, scale=2, nullable=true)
|
||||||
*/
|
*/
|
||||||
private $budget = '0.00';
|
private $budget = 0.00;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var Activity[]
|
||||||
|
*
|
||||||
|
* @ORM\OneToMany(targetEntity="TimesheetBundle\Entity\Activity", mappedBy="project")
|
||||||
|
*/
|
||||||
|
private $activities;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set customerid
|
* Set customerid
|
||||||
@@ -193,8 +201,24 @@ class Project
|
|||||||
*
|
*
|
||||||
* @return integer
|
* @return integer
|
||||||
*/
|
*/
|
||||||
public function getProjectId()
|
public function getId()
|
||||||
{
|
{
|
||||||
return $this->projectid;
|
return $this->id;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return Activity[]
|
||||||
|
*/
|
||||||
|
public function getActivities()
|
||||||
|
{
|
||||||
|
return $this->activities;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function __toString()
|
||||||
|
{
|
||||||
|
return $this->getName();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ use Doctrine\ORM\Mapping as ORM;
|
|||||||
* Timesheet entity.
|
* Timesheet entity.
|
||||||
*
|
*
|
||||||
* @ORM\Entity(repositoryClass="TimesheetBundle\Repository\TimesheetRepository")
|
* @ORM\Entity(repositoryClass="TimesheetBundle\Repository\TimesheetRepository")
|
||||||
* @ORM\Table(name="timeSheet", indexes={@ORM\Index(columns={"userID"}), @ORM\Index(columns={"projectID"}), @ORM\Index(name="activityID", columns={"activityID"})})
|
* @ORM\Table(name="timeSheet", indexes={@ORM\Index(columns={"userID"}), @ORM\Index(name="activity", columns={"activity"})})
|
||||||
*
|
*
|
||||||
* @author Kevin Papst <kevin@kevinpapst.de>
|
* @author Kevin Papst <kevin@kevinpapst.de>
|
||||||
*/
|
*/
|
||||||
@@ -46,7 +46,7 @@ class Timesheet
|
|||||||
private $duration = '0';
|
private $duration = '0';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var integer
|
* @var User
|
||||||
*
|
*
|
||||||
* @ORM\ManyToOne(targetEntity="AppBundle\Entity\User")
|
* @ORM\ManyToOne(targetEntity="AppBundle\Entity\User")
|
||||||
* @ORM\JoinColumn(name="userID", referencedColumnName="userID")
|
* @ORM\JoinColumn(name="userID", referencedColumnName="userID")
|
||||||
@@ -56,16 +56,10 @@ class Timesheet
|
|||||||
/**
|
/**
|
||||||
* @var integer
|
* @var integer
|
||||||
*
|
*
|
||||||
* @ORM\Column(name="projectID", type="integer", nullable=false)
|
* @ORM\ManyToOne(targetEntity="TimesheetBundle\Entity\Activity")
|
||||||
|
* @ORM\JoinColumn(name="activity", referencedColumnName="id")
|
||||||
*/
|
*/
|
||||||
private $projectid;
|
private $activity;
|
||||||
|
|
||||||
/**
|
|
||||||
* @var integer
|
|
||||||
*
|
|
||||||
* @ORM\Column(name="activityID", type="integer", nullable=false)
|
|
||||||
*/
|
|
||||||
private $activityid;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string
|
* @var string
|
||||||
@@ -258,40 +252,16 @@ class Timesheet
|
|||||||
return $this->user;
|
return $this->user;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Set projectid
|
|
||||||
*
|
|
||||||
* @param integer $projectid
|
|
||||||
*
|
|
||||||
* @return Timesheet
|
|
||||||
*/
|
|
||||||
public function setProjectid($projectid)
|
|
||||||
{
|
|
||||||
$this->projectid = $projectid;
|
|
||||||
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get projectid
|
|
||||||
*
|
|
||||||
* @return integer
|
|
||||||
*/
|
|
||||||
public function getProjectid()
|
|
||||||
{
|
|
||||||
return $this->projectid;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set activityid
|
* Set activityid
|
||||||
*
|
*
|
||||||
* @param integer $activityid
|
* @param integer $activity
|
||||||
*
|
*
|
||||||
* @return Timesheet
|
* @return Timesheet
|
||||||
*/
|
*/
|
||||||
public function setActivityid($activityid)
|
public function setActivity($activity)
|
||||||
{
|
{
|
||||||
$this->activityid = $activityid;
|
$this->activity = $activity;
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
@@ -301,9 +271,9 @@ class Timesheet
|
|||||||
*
|
*
|
||||||
* @return integer
|
* @return integer
|
||||||
*/
|
*/
|
||||||
public function getActivityid()
|
public function getActivity()
|
||||||
{
|
{
|
||||||
return $this->activityid;
|
return $this->activity;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ class Menu
|
|||||||
$menu->addChild(
|
$menu->addChild(
|
||||||
new MenuItemModel('timesheet_admin', 'menu.admin_timesheet', 'admin_timesheet', [], 'fa fa-clock-o')
|
new MenuItemModel('timesheet_admin', 'menu.admin_timesheet', 'admin_timesheet', [], 'fa fa-clock-o')
|
||||||
)->addChild(
|
)->addChild(
|
||||||
new MenuItemModel('project_admin', 'menu.admin_project', 'admin_project', [], 'fa fa-object-group')
|
new MenuItemModel('project_admin', 'menu.admin_project', 'admin_project', [], 'fa fa-book')
|
||||||
)->addChild(
|
)->addChild(
|
||||||
new MenuItemModel('activity_admin', 'menu.admin_activity', 'admin_activity', [], 'fa fa-tasks')
|
new MenuItemModel('activity_admin', 'menu.admin_activity', 'admin_activity', [], 'fa fa-tasks')
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -36,7 +36,18 @@ class ProjectRepository extends EntityRepository
|
|||||||
|
|
||||||
$qb->select('p')
|
$qb->select('p')
|
||||||
->from('TimesheetBundle:Project', 'p')
|
->from('TimesheetBundle:Project', 'p')
|
||||||
->orderBy('p.name', 'DESC');
|
->orderBy('p.id', 'DESC');
|
||||||
|
|
||||||
|
return $qb->getQuery();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function queryAll($orderBy = 'id')
|
||||||
|
{
|
||||||
|
$qb = $this->getEntityManager()->createQueryBuilder();
|
||||||
|
|
||||||
|
$qb->select('p')
|
||||||
|
->from('TimesheetBundle:Project', 'p')
|
||||||
|
->orderBy('p.' . $orderBy, 'ASC');
|
||||||
|
|
||||||
return $qb->getQuery();
|
return $qb->getQuery();
|
||||||
}
|
}
|
||||||
@@ -58,7 +69,7 @@ class ProjectRepository extends EntityRepository
|
|||||||
*/
|
*/
|
||||||
public function findAll($page = 1)
|
public function findAll($page = 1)
|
||||||
{
|
{
|
||||||
return $this->getPager($this->queryLatest(), $page);
|
return $this->getPager($this->queryAll(), $page);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -9,26 +9,28 @@
|
|||||||
<table class="table table-striped">
|
<table class="table table-striped">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th><i class="fa fa-calendar"></i> {{ 'label.name'|trans }}</th>
|
<th>{{ 'label.id'|trans }}</th>
|
||||||
<th><i class="fa fa-hourglass-start"></i> {{ 'label.comment'|trans }}</th>
|
<th><i class="fa fa-bookmark-o"></i> {{ 'label.name'|trans }}</th>
|
||||||
<th><i class="fa fa-hourglass-end"></i> {{ 'label.visible'|trans }}</th>
|
<th><i class="fa fa-book"></i> {{ 'label.project'|trans }}</th>
|
||||||
<th><i class="fa fa-clock-o"></i> {{ 'label.id'|trans }}</th>
|
<th><i class="fa fa-comment-o"></i> {{ 'label.comment'|trans }}</th>
|
||||||
|
<th><i class="fa fa-eye"></i> {{ 'label.visible'|trans }}</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{% for entry in entries %}
|
{% for entry in entries %}
|
||||||
<tr>
|
<tr>
|
||||||
|
<td>{{ entry.id }}</td>
|
||||||
<td>{{ entry.name }}</td>
|
<td>{{ entry.name }}</td>
|
||||||
|
<td>{{ entry.project }}</td>
|
||||||
<td>{{ entry.comment }}</td>
|
<td>{{ entry.comment }}</td>
|
||||||
<td>{{ entry.visible }}</td>
|
<td>{{ widgets.badge_visible(entry.visible) }}</td>
|
||||||
<td>{{ entry.activityId }}</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<div class="navigation text-center">
|
<div class="navigation text-center">
|
||||||
{{ pagerfanta(entries, 'twitter_bootstrap3_translated', { routeName: 'timesheet_paginated' }) }}
|
{{ pagerfanta(entries, 'twitter_bootstrap3_translated', { routeName: 'admin_activity_paginated' }) }}
|
||||||
</div>
|
</div>
|
||||||
{% else %}
|
{% else %}
|
||||||
{{ widgets.callout('warning', 'error.no_entries_found') }}
|
{{ widgets.callout('warning', 'error.no_entries_found') }}
|
||||||
|
|||||||
@@ -9,20 +9,22 @@
|
|||||||
<table class="table table-striped">
|
<table class="table table-striped">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th><i class="fa fa-calendar"></i> {{ 'label.name'|trans }}</th>
|
<th>{{ 'label.id'|trans }}</th>
|
||||||
<th><i class="fa fa-hourglass-start"></i> {{ 'label.comment'|trans }}</th>
|
<th><i class="fa fa-bookmark-o"></i> {{ 'label.name'|trans }}</th>
|
||||||
<th><i class="fa fa-hourglass-end"></i> {{ 'label.visible'|trans }}</th>
|
<th><i class="fa fa-comment-o"></i> {{ 'label.comment'|trans }}</th>
|
||||||
<th><i class="fa fa-clock-o"></i> {{ 'label.id'|trans }}</th>
|
<th><i class="fa fa-eye"></i> {{ 'label.visible'|trans }}</th>
|
||||||
|
<th><i class="fa fa-tasks"></i> {{ 'label.activity'|trans }}</th>
|
||||||
<th><i class="fa fa-credit-card"></i> {{ 'label.budget'|trans }}</th>
|
<th><i class="fa fa-credit-card"></i> {{ 'label.budget'|trans }}</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{% for entry in entries %}
|
{% for entry in entries %}
|
||||||
<tr>
|
<tr>
|
||||||
|
<td>{{ entry.id }}</td>
|
||||||
<td>{{ entry.name }}</td>
|
<td>{{ entry.name }}</td>
|
||||||
<td>{{ entry.comment }}</td>
|
<td>{{ entry.comment }}</td>
|
||||||
<td>{{ entry.visible }}</td>
|
<td>{{ widgets.badge_visible(entry.visible) }}</td>
|
||||||
<td>{{ entry.projectId }}</td>
|
<td>{{ widgets.badge_counter(entry.activities.count) }}</td>
|
||||||
<td>{{ entry.budget}}</td>
|
<td>{{ entry.budget}}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
@@ -30,7 +32,7 @@
|
|||||||
</table>
|
</table>
|
||||||
|
|
||||||
<div class="navigation text-center">
|
<div class="navigation text-center">
|
||||||
{{ pagerfanta(entries, 'twitter_bootstrap3_translated', { routeName: 'timesheet_paginated' }) }}
|
{{ pagerfanta(entries, 'twitter_bootstrap3_translated', { routeName: 'admin_project_paginated' }) }}
|
||||||
</div>
|
</div>
|
||||||
{% else %}
|
{% else %}
|
||||||
{{ widgets.callout('warning', 'error.no_entries_found') }}
|
{{ widgets.callout('warning', 'error.no_entries_found') }}
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
</table>
|
</table>
|
||||||
|
|
||||||
<div class="navigation text-center">
|
<div class="navigation text-center">
|
||||||
{{ pagerfanta(entries, 'twitter_bootstrap3_translated', { routeName: 'timesheet_paginated' }) }}
|
{{ pagerfanta(entries, 'twitter_bootstrap3_translated', { routeName: 'admin_timesheet_paginated' }) }}
|
||||||
</div>
|
</div>
|
||||||
{% else %}
|
{% else %}
|
||||||
{{ widgets.callout('warning', 'error.no_entries_found') }}
|
{{ widgets.callout('warning', 'error.no_entries_found') }}
|
||||||
|
|||||||
Reference in New Issue
Block a user