major refactoring and cleanup

This commit is contained in:
Kevin Papst
2016-10-23 00:12:32 +02:00
parent 5a85b1d37e
commit c492d30be3
70 changed files with 1304 additions and 4027 deletions

View File

@@ -0,0 +1,200 @@
<?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\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* Activity
*
* @ORM\Table(name="activities")
* @ORM\Entity
*
* @author Kevin Papst <kevin@kevinpapst.de>
*/
class Activity
{
/**
* @var integer
*
* @ORM\Column(name="activityID", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
private $activityid;
/**
* @var string
*
* @ORM\Column(name="name", type="string", length=255, nullable=false)
*/
private $name;
/**
* @var string
*
* @ORM\Column(name="comment", type="text", length=65535, nullable=true)
*/
private $comment;
/**
* @var boolean
*
* @ORM\Column(name="visible", type="boolean", nullable=false)
*/
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
*
* @param string $name
*
* @return Activity
*/
public function setName($name)
{
$this->name = $name;
return $this;
}
/**
* Get name
*
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* Set comment
*
* @param string $comment
*
* @return Activity
*/
public function setComment($comment)
{
$this->comment = $comment;
return $this;
}
/**
* Get comment
*
* @return string
*/
public function getComment()
{
return $this->comment;
}
/**
* Set visible
*
* @param boolean $visible
*
* @return Activity
*/
public function setVisible($visible)
{
$this->visible = $visible;
return $this;
}
/**
* Get visible
*
* @return boolean
*/
public function getVisible()
{
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()
{
return $this->activityid;
}
}

View File

@@ -0,0 +1,675 @@
<?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\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* Customer
*
* @ORM\Table(name="customers")
* @ORM\Entity
*
* @author Kevin Papst <kevin@kevinpapst.de>
*/
class Customer
{
/**
* @var integer
*
* @ORM\Column(name="customerID", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
private $customerid;
/**
* @var string
*
* @ORM\Column(name="name", type="string", length=255, nullable=false)
*/
private $name;
/**
* @var string
*
* @ORM\Column(name="comment", type="text", length=65535, nullable=true)
*/
private $comment;
/**
* @var boolean
*
* @ORM\Column(name="visible", type="boolean", nullable=false)
*/
private $visible = '1';
/**
* @var boolean
*
* @ORM\Column(name="filter", type="boolean", nullable=false)
*/
private $filter = '0';
/**
* @var string
*
* @ORM\Column(name="company", type="string", length=255, nullable=true)
*/
private $company;
/**
* @var string
*
* @ORM\Column(name="vat", type="string", length=255, nullable=true)
*/
private $vat;
/**
* @var string
*
* @ORM\Column(name="contact", type="string", length=255, nullable=true)
*/
private $contact;
/**
* @var string
*
* @ORM\Column(name="street", type="string", length=255, nullable=true)
*/
private $street;
/**
* @var string
*
* @ORM\Column(name="zipcode", type="string", length=255, nullable=true)
*/
private $zipcode;
/**
* @var string
*
* @ORM\Column(name="city", type="string", length=255, nullable=true)
*/
private $city;
/**
* @var string
*
* @ORM\Column(name="country", type="string", length=2, nullable=true)
*/
private $country;
/**
* @var string
*
* @ORM\Column(name="phone", type="string", length=255, nullable=true)
*/
private $phone;
/**
* @var string
*
* @ORM\Column(name="fax", type="string", length=255, nullable=true)
*/
private $fax;
/**
* @var string
*
* @ORM\Column(name="mobile", type="string", length=255, nullable=true)
*/
private $mobile;
/**
* @var string
*
* @ORM\Column(name="mail", type="string", length=255, nullable=true)
*/
private $mail;
/**
* @var string
*
* @ORM\Column(name="homepage", type="string", length=255, nullable=true)
*/
private $homepage;
/**
* @var string
*
* @ORM\Column(name="timezone", type="string", length=255, nullable=false)
*/
private $timezone;
/**
* @var boolean
*
* @ORM\Column(name="trash", type="boolean", nullable=false)
*/
private $trash = '0';
/**
* Set name
*
* @param string $name
*
* @return Customer
*/
public function setName($name)
{
$this->name = $name;
return $this;
}
/**
* Get name
*
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* Set password
*
* @param string $password
*
* @return Customer
*/
public function setPassword($password)
{
$this->password = $password;
return $this;
}
/**
* Get password
*
* @return string
*/
public function getPassword()
{
return $this->password;
}
/**
* Set passwordresethash
*
* @param string $passwordresethash
*
* @return Customer
*/
public function setPasswordresethash($passwordresethash)
{
$this->passwordresethash = $passwordresethash;
return $this;
}
/**
* Get passwordresethash
*
* @return string
*/
public function getPasswordresethash()
{
return $this->passwordresethash;
}
/**
* Set secure
*
* @param string $secure
*
* @return Customer
*/
public function setSecure($secure)
{
$this->secure = $secure;
return $this;
}
/**
* Get secure
*
* @return string
*/
public function getSecure()
{
return $this->secure;
}
/**
* Set comment
*
* @param string $comment
*
* @return Customer
*/
public function setComment($comment)
{
$this->comment = $comment;
return $this;
}
/**
* Get comment
*
* @return string
*/
public function getComment()
{
return $this->comment;
}
/**
* Set visible
*
* @param boolean $visible
*
* @return Customer
*/
public function setVisible($visible)
{
$this->visible = $visible;
return $this;
}
/**
* Get visible
*
* @return boolean
*/
public function getVisible()
{
return $this->visible;
}
/**
* Set filter
*
* @param boolean $filter
*
* @return Customer
*/
public function setFilter($filter)
{
$this->filter = $filter;
return $this;
}
/**
* Get filter
*
* @return boolean
*/
public function getFilter()
{
return $this->filter;
}
/**
* Set company
*
* @param string $company
*
* @return Customer
*/
public function setCompany($company)
{
$this->company = $company;
return $this;
}
/**
* Get company
*
* @return string
*/
public function getCompany()
{
return $this->company;
}
/**
* Set vat
*
* @param string $vat
*
* @return Customer
*/
public function setVat($vat)
{
$this->vat = $vat;
return $this;
}
/**
* Get vat
*
* @return string
*/
public function getVat()
{
return $this->vat;
}
/**
* Set contact
*
* @param string $contact
*
* @return Customer
*/
public function setContact($contact)
{
$this->contact = $contact;
return $this;
}
/**
* Get contact
*
* @return string
*/
public function getContact()
{
return $this->contact;
}
/**
* Set street
*
* @param string $street
*
* @return Customer
*/
public function setStreet($street)
{
$this->street = $street;
return $this;
}
/**
* Get street
*
* @return string
*/
public function getStreet()
{
return $this->street;
}
/**
* Set zipcode
*
* @param string $zipcode
*
* @return Customer
*/
public function setZipcode($zipcode)
{
$this->zipcode = $zipcode;
return $this;
}
/**
* Get zipcode
*
* @return string
*/
public function getZipcode()
{
return $this->zipcode;
}
/**
* Set city
*
* @param string $city
*
* @return Customer
*/
public function setCity($city)
{
$this->city = $city;
return $this;
}
/**
* Get city
*
* @return string
*/
public function getCity()
{
return $this->city;
}
/**
* Set country
*
* @param string $country
*
* @return Customer
*/
public function setCountry($country)
{
$this->country = $country;
return $this;
}
/**
* Get country
*
* @return string
*/
public function getCountry()
{
return $this->country;
}
/**
* Set phone
*
* @param string $phone
*
* @return Customer
*/
public function setPhone($phone)
{
$this->phone = $phone;
return $this;
}
/**
* Get phone
*
* @return string
*/
public function getPhone()
{
return $this->phone;
}
/**
* Set fax
*
* @param string $fax
*
* @return Customer
*/
public function setFax($fax)
{
$this->fax = $fax;
return $this;
}
/**
* Get fax
*
* @return string
*/
public function getFax()
{
return $this->fax;
}
/**
* Set mobile
*
* @param string $mobile
*
* @return Customer
*/
public function setMobile($mobile)
{
$this->mobile = $mobile;
return $this;
}
/**
* Get mobile
*
* @return string
*/
public function getMobile()
{
return $this->mobile;
}
/**
* Set mail
*
* @param string $mail
*
* @return Customer
*/
public function setMail($mail)
{
$this->mail = $mail;
return $this;
}
/**
* Get mail
*
* @return string
*/
public function getMail()
{
return $this->mail;
}
/**
* Set homepage
*
* @param string $homepage
*
* @return Customer
*/
public function setHomepage($homepage)
{
$this->homepage = $homepage;
return $this;
}
/**
* Get homepage
*
* @return string
*/
public function getHomepage()
{
return $this->homepage;
}
/**
* Set timezone
*
* @param string $timezone
*
* @return Customer
*/
public function setTimezone($timezone)
{
$this->timezone = $timezone;
return $this;
}
/**
* Get timezone
*
* @return string
*/
public function getTimezone()
{
return $this->timezone;
}
/**
* Set trash
*
* @param boolean $trash
*
* @return Customer
*/
public function setTrash($trash)
{
$this->trash = $trash;
return $this;
}
/**
* Get trash
*
* @return boolean
*/
public function getTrash()
{
return $this->trash;
}
/**
* Get customerid
*
* @return integer
*/
public function getCustomerid()
{
return $this->customerid;
}
}

View File

@@ -0,0 +1,355 @@
<?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\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* Project
*
* @ORM\Table(name="projects", indexes={@ORM\Index(name="customerID", columns={"customerID"})})
* @ORM\Entity
*
* @author Kevin Papst <kevin@kevinpapst.de>
*/
class Project
{
/**
* @var integer
*
* @ORM\Column(name="projectID", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
private $projectid;
/**
* @var integer
*
* @ORM\Column(name="customerID", type="integer", nullable=false)
*/
private $customerid;
/**
* @var string
*
* @ORM\Column(name="name", type="string", length=255, nullable=false)
*/
private $name;
/**
* @var string
*
* @ORM\Column(name="comment", type="text", length=65535, nullable=true)
*/
private $comment;
/**
* @var boolean
*
* @ORM\Column(name="visible", type="boolean", nullable=false)
*/
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
*
* @ORM\Column(name="budget", type="decimal", precision=10, scale=2, nullable=true)
*/
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
*/
public function setCustomerid($customerid)
{
$this->customerid = $customerid;
return $this;
}
/**
* Get customerid
*
* @return integer
*/
public function getCustomerid()
{
return $this->customerid;
}
/**
* Set name
*
* @param string $name
*
* @return KimaiProjects
*/
public function setName($name)
{
$this->name = $name;
return $this;
}
/**
* Get name
*
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* Set comment
*
* @param string $comment
*
* @return KimaiProjects
*/
public function setComment($comment)
{
$this->comment = $comment;
return $this;
}
/**
* Get comment
*
* @return string
*/
public function getComment()
{
return $this->comment;
}
/**
* Set visible
*
* @param boolean $visible
*
* @return KimaiProjects
*/
public function setVisible($visible)
{
$this->visible = $visible;
return $this;
}
/**
* Get visible
*
* @return boolean
*/
public function getVisible()
{
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
*/
public function setBudget($budget)
{
$this->budget = $budget;
return $this;
}
/**
* Get budget
*
* @return string
*/
public function getBudget()
{
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()
{
return $this->projectid;
}
}

View File

@@ -11,13 +11,14 @@
namespace TimesheetBundle\Entity;
use AppBundle\Entity\User;
use Doctrine\ORM\Mapping as ORM;
/**
* Timesheet entity.
*
* @ORM\Entity(repositoryClass="TimesheetBundle\Repository\TimesheetRepository")
* @ORM\Table(name="timeSheet", indexes={@ORM\Index(name="userID", columns={"userID"}), @ORM\Index(name="projectID", columns={"projectID"}), @ORM\Index(name="activityID", columns={"activityID"})})
* @ORM\Table(name="timeSheet", indexes={@ORM\Index(columns={"userID"}), @ORM\Index(columns={"projectID"}), @ORM\Index(name="activityID", columns={"activityID"})})
*
* @author Kevin Papst <kevin@kevinpapst.de>
*/
@@ -47,9 +48,10 @@ class Timesheet
/**
* @var integer
*
* @ORM\Column(name="userID", type="integer", nullable=false)
* @ORM\ManyToOne(targetEntity="AppBundle\Entity\User")
* @ORM\JoinColumn(name="userID", referencedColumnName="userID")
*/
private $userid;
private $user;
/**
* @var integer
@@ -165,7 +167,7 @@ class Timesheet
*
* @param integer $start
*
* @return KimaiTimesheet
* @return Timesheet
*/
public function setStart($start)
{
@@ -189,7 +191,7 @@ class Timesheet
*
* @param integer $end
*
* @return KimaiTimesheet
* @return Timesheet
*/
public function setEnd($end)
{
@@ -213,7 +215,7 @@ class Timesheet
*
* @param integer $duration
*
* @return KimaiTimesheet
* @return Timesheet
*/
public function setDuration($duration)
{
@@ -233,27 +235,27 @@ class Timesheet
}
/**
* Set userid
* Set user
*
* @param integer $userid
* @param User $user
*
* @return KimaiTimesheet
* @return Timesheet
*/
public function setUserid($userid)
public function setUser(User $user)
{
$this->userid = $userid;
$this->user = $user;
return $this;
}
/**
* Get userid
* Get user
*
* @return integer
* @return User
*/
public function getUserid()
public function getUser()
{
return $this->userid;
return $this->user;
}
/**
@@ -261,7 +263,7 @@ class Timesheet
*
* @param integer $projectid
*
* @return KimaiTimesheet
* @return Timesheet
*/
public function setProjectid($projectid)
{
@@ -285,7 +287,7 @@ class Timesheet
*
* @param integer $activityid
*
* @return KimaiTimesheet
* @return Timesheet
*/
public function setActivityid($activityid)
{
@@ -309,7 +311,7 @@ class Timesheet
*
* @param string $description
*
* @return KimaiTimesheet
* @return Timesheet
*/
public function setDescription($description)
{
@@ -333,7 +335,7 @@ class Timesheet
*
* @param string $comment
*
* @return KimaiTimesheet
* @return Timesheet
*/
public function setComment($comment)
{
@@ -357,7 +359,7 @@ class Timesheet
*
* @param boolean $commenttype
*
* @return KimaiTimesheet
* @return Timesheet
*/
public function setCommenttype($commenttype)
{
@@ -381,7 +383,7 @@ class Timesheet
*
* @param boolean $cleared
*
* @return KimaiTimesheet
* @return Timesheet
*/
public function setCleared($cleared)
{
@@ -405,7 +407,7 @@ class Timesheet
*
* @param string $location
*
* @return KimaiTimesheet
* @return Timesheet
*/
public function setLocation($location)
{
@@ -429,7 +431,7 @@ class Timesheet
*
* @param string $trackingnumber
*
* @return KimaiTimesheet
* @return Timesheet
*/
public function setTrackingnumber($trackingnumber)
{
@@ -453,7 +455,7 @@ class Timesheet
*
* @param string $rate
*
* @return KimaiTimesheet
* @return Timesheet
*/
public function setRate($rate)
{
@@ -477,7 +479,7 @@ class Timesheet
*
* @param string $fixedrate
*
* @return KimaiTimesheet
* @return Timesheet
*/
public function setFixedrate($fixedrate)
{
@@ -501,7 +503,7 @@ class Timesheet
*
* @param string $budget
*
* @return KimaiTimesheet
* @return Timesheet
*/
public function setBudget($budget)
{
@@ -525,7 +527,7 @@ class Timesheet
*
* @param string $approved
*
* @return KimaiTimesheet
* @return Timesheet
*/
public function setApproved($approved)
{
@@ -549,7 +551,7 @@ class Timesheet
*
* @param integer $statusid
*
* @return KimaiTimesheet
* @return Timesheet
*/
public function setStatusid($statusid)
{
@@ -573,7 +575,7 @@ class Timesheet
*
* @param boolean $billable
*
* @return KimaiTimesheet
* @return Timesheet
*/
public function setBillable($billable)
{