diff --git a/src/Bundle/ChillActivityBundle/Controller/AdminActivityPresenceController.php b/src/Bundle/ChillActivityBundle/Controller/AdminActivityPresenceController.php
new file mode 100644
index 000000000..a100c3f5d
--- /dev/null
+++ b/src/Bundle/ChillActivityBundle/Controller/AdminActivityPresenceController.php
@@ -0,0 +1,23 @@
+orderBy('e.id', 'ASC');
+ }
+}
diff --git a/src/Bundle/ChillActivityBundle/DependencyInjection/ChillActivityExtension.php b/src/Bundle/ChillActivityBundle/DependencyInjection/ChillActivityExtension.php
index 3fdf4a726..d459da0e3 100644
--- a/src/Bundle/ChillActivityBundle/DependencyInjection/ChillActivityExtension.php
+++ b/src/Bundle/ChillActivityBundle/DependencyInjection/ChillActivityExtension.php
@@ -137,7 +137,28 @@ class ChillActivityExtension extends Extension implements PrependExtensionInterf
'template' => '@ChillActivity/ActivityTypeCategory/edit.html.twig',
]
]
- ]
+ ],
+ [
+ 'class' => \Chill\ActivityBundle\Entity\ActivityPresence::class,
+ 'name' => 'activity_presence',
+ 'base_path' => '/admin/activity/presence',
+ 'form_class' => \Chill\ActivityBundle\Form\ActivityPresenceType::class,
+ 'controller' => \Chill\ActivityBundle\Controller\AdminActivityPresenceController::class,
+ 'actions' => [
+ 'index' => [
+ 'template' => '@ChillActivity/ActivityPresence/index.html.twig',
+ 'role' => 'ROLE_ADMIN'
+ ],
+ 'new' => [
+ 'role' => 'ROLE_ADMIN',
+ 'template' => '@ChillActivity/ActivityPresence/new.html.twig',
+ ],
+ 'edit' => [
+ 'role' => 'ROLE_ADMIN',
+ 'template' => '@ChillActivity/ActivityPresence/edit.html.twig',
+ ]
+ ]
+ ],
]
]);
}
diff --git a/src/Bundle/ChillActivityBundle/Entity/Activity.php b/src/Bundle/ChillActivityBundle/Entity/Activity.php
index e96db03db..e1341787f 100644
--- a/src/Bundle/ChillActivityBundle/Entity/Activity.php
+++ b/src/Bundle/ChillActivityBundle/Entity/Activity.php
@@ -20,13 +20,13 @@
namespace Chill\ActivityBundle\Entity;
+use Chill\DocStoreBundle\Entity\Document;
use Chill\MainBundle\Entity\Embeddable\CommentEmbeddable;
+use Chill\ThirdPartyBundle\Entity\ThirdParty;
use Doctrine\ORM\Mapping as ORM;
use Chill\MainBundle\Entity\Scope;
use Chill\MainBundle\Entity\User;
use Chill\MainBundle\Entity\Center;
-use Chill\ActivityBundle\Entity\ActivityReason;
-use Chill\ActivityBundle\Entity\ActivityType;
use Chill\PersonBundle\Entity\Person;
use Chill\MainBundle\Entity\HasCenterInterface;
use Chill\MainBundle\Entity\HasScopeInterface;
@@ -49,93 +49,98 @@ use Chill\MainBundle\Validator\Constraints\Entity\UserCircleConsistency;
class Activity implements HasCenterInterface, HasScopeInterface
{
/**
- * @var integer
- *
* @ORM\Id
* @ORM\Column(name="id", type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
- private $id;
+ private ?int $id;
/**
- * @var User
* @ORM\ManyToOne(targetEntity="Chill\MainBundle\Entity\User")
*/
- private $user;
+ private User $user;
/**
- * @var \DateTime
* @ORM\Column(type="datetime")
*/
- private $date;
+ private \DateTime $date;
/**
- * @var \DateTime
* @ORM\Column(type="time")
*/
- private $durationTime;
+ private \DateTime $durationTime;
/**
- * @var boolean
* @ORM\Column(type="boolean")
*/
- private $attendee;
+ private bool $attendee;
/**
- * @var ActivityReason
* @ORM\ManyToMany(targetEntity="Chill\ActivityBundle\Entity\ActivityReason")
*/
- private $reasons;
+ private Collection $reasons;
/**
- * @var ActivityType
* @ORM\ManyToOne(targetEntity="Chill\ActivityBundle\Entity\ActivityType")
*/
- private $type;
+ private ActivityType $type;
/**
- * @var Scope
* @ORM\ManyToOne(targetEntity="Chill\MainBundle\Entity\Scope")
*/
- private $scope;
+ private Scope $scope;
/**
- * @var Person
* @ORM\ManyToOne(targetEntity="Chill\PersonBundle\Entity\Person")
*/
- private $person;
+ private Person $person;
/**
* @ORM\Embedded(class="Chill\MainBundle\Entity\Embeddable\CommentEmbeddable", columnPrefix="comment_")
*/
- private $comment;
+ private CommentEmbeddable $comment;
/**
- * Activity constructor.
+ * @ORM\OneToMany(targetEntity="Chill\PersonBundle\Entity\Person", mappedBy="person")
*/
+ private ArrayCollection $persons;
+
+ /**
+ * @ORM\OneToMany(targetEntity="Chill\ThirdPartyBundle\Entity\ThirdParty", mappedBy="thirdParty")
+ */
+ private ArrayCollection $thirdParties;
+
+ /**
+ * @ORM\OneToMany(targetEntity="Chill\DocStoreBundle\Entity\Document", mappedBy="document")
+ */
+ private ArrayCollection $documents;
+
+ /**
+ * @ORM\Column(type="boolean")
+ */
+ private bool $emergency = false;
+
public function __construct()
{
$this->reasons = new ArrayCollection();
$this->comment = new CommentEmbeddable();
+ $this->persons = new ArrayCollection();
+ $this->thirdParties = new ArrayCollection();
+ $this->documents = new ArrayCollection();
}
/**
* Get id
- *
- * @return integer
*/
- public function getId()
+ public function getId(): int
{
return $this->id;
}
/**
* Set user
- *
- * @param User $user
- * @return Activity
*/
- public function setUser(User $user)
+ public function setUser(User $user): self
{
$this->user = $user;
@@ -144,21 +149,16 @@ class Activity implements HasCenterInterface, HasScopeInterface
/**
* Get user
- *
- * @return User
*/
- public function getUser()
+ public function getUser(): User
{
return $this->user;
}
/**
* Set date
- *
- * @param \DateTime $date
- * @return Activity
*/
- public function setDate($date)
+ public function setDate(\DateTime $date): self
{
$this->date = $date;
@@ -167,21 +167,16 @@ class Activity implements HasCenterInterface, HasScopeInterface
/**
* Get date
- *
- * @return \DateTime
*/
- public function getDate()
+ public function getDate(): \DateTime
{
return $this->date;
}
/**
* Set durationTime
- *
- * @param \DateTime $durationTime
- * @return Activity
*/
- public function setDurationTime($durationTime)
+ public function setDurationTime(\DateTime $durationTime): self
{
$this->durationTime = $durationTime;
@@ -190,21 +185,16 @@ class Activity implements HasCenterInterface, HasScopeInterface
/**
* Get durationTime
- *
- * @return \DateTime
*/
- public function getDurationTime()
+ public function getDurationTime(): \DateTime
{
return $this->durationTime;
}
/**
* Set attendee
- *
- * @param boolean $attendee
- * @return Activity
*/
- public function setAttendee($attendee)
+ public function setAttendee(bool $attendee): self
{
$this->attendee = $attendee;
@@ -213,52 +203,39 @@ class Activity implements HasCenterInterface, HasScopeInterface
/**
* Get attendee
- *
- * @return boolean
*/
- public function getAttendee()
+ public function getAttendee(): bool
{
return $this->attendee;
}
/**
* Add a reason
- *
- * @param ActivityReason $reason
- * @return Activity
*/
- public function addReason(ActivityReason $reason)
+ public function addReason(ActivityReason $reason): self
{
$this->reasons[] = $reason;
return $this;
}
- /**
- * @param ActivityReason $reason
- */
- public function removeReason(ActivityReason $reason)
+ public function removeReason(ActivityReason $reason): void
{
$this->reasons->removeElement($reason);
}
/**
* Get reasons
- *
- * @return Collection
*/
- public function getReasons()
+ public function getReasons(): ArrayCollection
{
return $this->reasons;
}
/**
* Set type
- *
- * @param ActivityType $type
- * @return Activity
*/
- public function setType(ActivityType $type)
+ public function setType(ActivityType $type): self
{
$this->type = $type;
@@ -267,21 +244,16 @@ class Activity implements HasCenterInterface, HasScopeInterface
/**
* Get type
- *
- * @return ActivityType
*/
- public function getType()
+ public function getType(): ActivityType
{
return $this->type;
}
/**
* Set scope
- *
- * @param Scope $scope
- * @return Activity
*/
- public function setScope(Scope $scope)
+ public function setScope(Scope $scope): self
{
$this->scope = $scope;
@@ -290,21 +262,16 @@ class Activity implements HasCenterInterface, HasScopeInterface
/**
* Get scope
- *
- * @return Scope
*/
- public function getScope()
+ public function getScope(): Scope
{
return $this->scope;
}
/**
* Set person
- *
- * @param Person $person
- * @return Activity
*/
- public function setPerson(Person $person)
+ public function setPerson(Person $person): self
{
$this->person = $person;
@@ -313,10 +280,8 @@ class Activity implements HasCenterInterface, HasScopeInterface
/**
* Get person
- *
- * @return Person
*/
- public function getPerson()
+ public function getPerson(): Person
{
return $this->person;
}
@@ -324,28 +289,114 @@ class Activity implements HasCenterInterface, HasScopeInterface
/**
* get the center
* center is extracted from person
- *
- * @return Center
*/
- public function getCenter()
+ public function getCenter(): Center
{
return $this->person->getCenter();
}
- /**
- * @return \Chill\MainBundle\Entity\Embeddalbe\CommentEmbeddable
- */
- public function getComment()
+ public function getComment(): CommentEmbeddable
{
return $this->comment;
}
- /**
- * @param \Chill\MainBundle\Entity\Embeddalbe\CommentEmbeddable $comment
- */
- public function setComment($comment)
+ public function setComment(CommentEmbeddable $comment): self
{
$this->comment = $comment;
+
+ return $this;
+ }
+
+ /**
+ * Add a person to the person list
+ */
+ public function addPerson(Person $person): self
+ {
+ $this->persons[] = $person;
+
+ return $this;
+ }
+
+ public function removePerson(Person $person): void
+ {
+ $this->persons->removeElement($person);
+ }
+
+ public function getPersons(): ArrayCollection
+ {
+ return $this->persons;
+ }
+
+ public function setPersons(ArrayCollection $persons): self
+ {
+ $this->persons = $persons;
+
+ return $this;
+ }
+
+ public function addThirdParty(ThirdParty $thirdParty): self
+ {
+ $this->thirdParties[] = $thirdParty;
+
+ return $this;
+ }
+
+ public function removeThirdParty(ThirdParty $thirdParty): void
+ {
+ $this->thirdParties->removeElement($thirdParty);
+ }
+
+ public function getThirdParties(): ArrayCollection
+ {
+ return $this->thirdParties;
+ }
+
+ public function setThirdParties(ArrayCollection $thirdParties): self
+ {
+ $this->thirdParties = $thirdParties;
+
+ return $this;
+ }
+
+ public function addDocument(Document $document): self
+ {
+ $this->documents[] = $document;
+
+ return $this;
+ }
+
+ public function removeDocument(Document $document): void
+ {
+ $this->documents->removeElement($document);
+ }
+
+ public function getDocuments(): ArrayCollection
+ {
+ return $this->documents;
+ }
+
+ public function setDocuments(ArrayCollection $documents): self
+ {
+ $this->documents = $documents;
+
+ return $this;
+ }
+
+ public function isEmergency(): bool
+ {
+ return $this->getEmergency();
+ }
+
+ public function getEmergency(): bool
+ {
+ return $this->emergency;
+ }
+
+ public function setEmergency(bool $emergency): self
+ {
+ $this->emergency = $emergency;
+
+ return $this;
}
}
diff --git a/src/Bundle/ChillActivityBundle/Entity/ActivityPresence.php b/src/Bundle/ChillActivityBundle/Entity/ActivityPresence.php
new file mode 100644
index 000000000..bfae78878
--- /dev/null
+++ b/src/Bundle/ChillActivityBundle/Entity/ActivityPresence.php
@@ -0,0 +1,103 @@
+
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see
{{ 'Name'|trans }} | +{{ 'Active'|trans }} | +{{ 'Actions'|trans }} | +
---|---|---|
{{ entity.name|localize_translatable_string }} | ++ {%- if entity.active -%} + + {%- else -%} + + {%- endif -%} + | ++ + | +