Adding generated files

This commit is contained in:
Marc Ducobu 2015-07-01 13:34:14 +02:00
parent cfc7b725d8
commit 5738de5033
33 changed files with 1865 additions and 0 deletions

View File

@ -0,0 +1,224 @@
<?php
namespace Chill\ActivityBundle\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Chill\ActivityBundle\Entity\Activity;
use Chill\ActivityBundle\Form\ActivityType;
/**
* Activity controller.
*
*/
class ActivityController extends Controller
{
/**
* Lists all Activity entities.
*
*/
public function indexAction()
{
$em = $this->getDoctrine()->getManager();
$entities = $em->getRepository('ChillActivityBundle:Activity')->findAll();
return $this->render('ChillActivityBundle:Activity:index.html.twig', array(
'entities' => $entities,
));
}
/**
* Creates a new Activity entity.
*
*/
public function createAction(Request $request)
{
$entity = new Activity();
$form = $this->createCreateForm($entity);
$form->handleRequest($request);
if ($form->isValid()) {
$em = $this->getDoctrine()->getManager();
$em->persist($entity);
$em->flush();
return $this->redirect($this->generateUrl('activity_show', array('id' => $entity->getId())));
}
return $this->render('ChillActivityBundle:Activity:new.html.twig', array(
'entity' => $entity,
'form' => $form->createView(),
));
}
/**
* Creates a form to create a Activity entity.
*
* @param Activity $entity The entity
*
* @return \Symfony\Component\Form\Form The form
*/
private function createCreateForm(Activity $entity)
{
$form = $this->createForm(new ActivityType(), $entity, array(
'action' => $this->generateUrl('activity_create'),
'method' => 'POST',
));
$form->add('submit', 'submit', array('label' => 'Create'));
return $form;
}
/**
* Displays a form to create a new Activity entity.
*
*/
public function newAction()
{
$entity = new Activity();
$form = $this->createCreateForm($entity);
return $this->render('ChillActivityBundle:Activity:new.html.twig', array(
'entity' => $entity,
'form' => $form->createView(),
));
}
/**
* Finds and displays a Activity entity.
*
*/
public function showAction($id)
{
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository('ChillActivityBundle:Activity')->find($id);
if (!$entity) {
throw $this->createNotFoundException('Unable to find Activity entity.');
}
$deleteForm = $this->createDeleteForm($id);
return $this->render('ChillActivityBundle:Activity:show.html.twig', array(
'entity' => $entity,
'delete_form' => $deleteForm->createView(),
));
}
/**
* Displays a form to edit an existing Activity entity.
*
*/
public function editAction($id)
{
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository('ChillActivityBundle:Activity')->find($id);
if (!$entity) {
throw $this->createNotFoundException('Unable to find Activity entity.');
}
$editForm = $this->createEditForm($entity);
$deleteForm = $this->createDeleteForm($id);
return $this->render('ChillActivityBundle:Activity:edit.html.twig', array(
'entity' => $entity,
'edit_form' => $editForm->createView(),
'delete_form' => $deleteForm->createView(),
));
}
/**
* Creates a form to edit a Activity entity.
*
* @param Activity $entity The entity
*
* @return \Symfony\Component\Form\Form The form
*/
private function createEditForm(Activity $entity)
{
$form = $this->createForm(new ActivityType(), $entity, array(
'action' => $this->generateUrl('activity_update', array('id' => $entity->getId())),
'method' => 'PUT',
));
$form->add('submit', 'submit', array('label' => 'Update'));
return $form;
}
/**
* Edits an existing Activity entity.
*
*/
public function updateAction(Request $request, $id)
{
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository('ChillActivityBundle:Activity')->find($id);
if (!$entity) {
throw $this->createNotFoundException('Unable to find Activity entity.');
}
$deleteForm = $this->createDeleteForm($id);
$editForm = $this->createEditForm($entity);
$editForm->handleRequest($request);
if ($editForm->isValid()) {
$em->flush();
return $this->redirect($this->generateUrl('activity_edit', array('id' => $id)));
}
return $this->render('ChillActivityBundle:Activity:edit.html.twig', array(
'entity' => $entity,
'edit_form' => $editForm->createView(),
'delete_form' => $deleteForm->createView(),
));
}
/**
* Deletes a Activity entity.
*
*/
public function deleteAction(Request $request, $id)
{
$form = $this->createDeleteForm($id);
$form->handleRequest($request);
if ($form->isValid()) {
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository('ChillActivityBundle:Activity')->find($id);
if (!$entity) {
throw $this->createNotFoundException('Unable to find Activity entity.');
}
$em->remove($entity);
$em->flush();
}
return $this->redirect($this->generateUrl('activity'));
}
/**
* Creates a form to delete a Activity entity by id.
*
* @param mixed $id The entity id
*
* @return \Symfony\Component\Form\Form The form
*/
private function createDeleteForm($id)
{
return $this->createFormBuilder()
->setAction($this->generateUrl('activity_delete', array('id' => $id)))
->setMethod('DELETE')
->add('submit', 'submit', array('label' => 'Delete'))
->getForm()
;
}
}

View File

@ -0,0 +1,224 @@
<?php
namespace Chill\ActivityBundle\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Chill\ActivityBundle\Entity\ActivityReasonCategory;
use Chill\ActivityBundle\Form\ActivityReasonCategoryType;
/**
* ActivityReasonCategory controller.
*
*/
class ActivityReasonCategoryController extends Controller
{
/**
* Lists all ActivityReasonCategory entities.
*
*/
public function indexAction()
{
$em = $this->getDoctrine()->getManager();
$entities = $em->getRepository('ChillActivityBundle:ActivityReasonCategory')->findAll();
return $this->render('ChillActivityBundle:ActivityReasonCategory:index.html.twig', array(
'entities' => $entities,
));
}
/**
* Creates a new ActivityReasonCategory entity.
*
*/
public function createAction(Request $request)
{
$entity = new ActivityReasonCategory();
$form = $this->createCreateForm($entity);
$form->handleRequest($request);
if ($form->isValid()) {
$em = $this->getDoctrine()->getManager();
$em->persist($entity);
$em->flush();
return $this->redirect($this->generateUrl('activityreasoncategory_show', array('id' => $entity->getId())));
}
return $this->render('ChillActivityBundle:ActivityReasonCategory:new.html.twig', array(
'entity' => $entity,
'form' => $form->createView(),
));
}
/**
* Creates a form to create a ActivityReasonCategory entity.
*
* @param ActivityReasonCategory $entity The entity
*
* @return \Symfony\Component\Form\Form The form
*/
private function createCreateForm(ActivityReasonCategory $entity)
{
$form = $this->createForm(new ActivityReasonCategoryType(), $entity, array(
'action' => $this->generateUrl('activityreasoncategory_create'),
'method' => 'POST',
));
$form->add('submit', 'submit', array('label' => 'Create'));
return $form;
}
/**
* Displays a form to create a new ActivityReasonCategory entity.
*
*/
public function newAction()
{
$entity = new ActivityReasonCategory();
$form = $this->createCreateForm($entity);
return $this->render('ChillActivityBundle:ActivityReasonCategory:new.html.twig', array(
'entity' => $entity,
'form' => $form->createView(),
));
}
/**
* Finds and displays a ActivityReasonCategory entity.
*
*/
public function showAction($id)
{
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository('ChillActivityBundle:ActivityReasonCategory')->find($id);
if (!$entity) {
throw $this->createNotFoundException('Unable to find ActivityReasonCategory entity.');
}
$deleteForm = $this->createDeleteForm($id);
return $this->render('ChillActivityBundle:ActivityReasonCategory:show.html.twig', array(
'entity' => $entity,
'delete_form' => $deleteForm->createView(),
));
}
/**
* Displays a form to edit an existing ActivityReasonCategory entity.
*
*/
public function editAction($id)
{
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository('ChillActivityBundle:ActivityReasonCategory')->find($id);
if (!$entity) {
throw $this->createNotFoundException('Unable to find ActivityReasonCategory entity.');
}
$editForm = $this->createEditForm($entity);
$deleteForm = $this->createDeleteForm($id);
return $this->render('ChillActivityBundle:ActivityReasonCategory:edit.html.twig', array(
'entity' => $entity,
'edit_form' => $editForm->createView(),
'delete_form' => $deleteForm->createView(),
));
}
/**
* Creates a form to edit a ActivityReasonCategory entity.
*
* @param ActivityReasonCategory $entity The entity
*
* @return \Symfony\Component\Form\Form The form
*/
private function createEditForm(ActivityReasonCategory $entity)
{
$form = $this->createForm(new ActivityReasonCategoryType(), $entity, array(
'action' => $this->generateUrl('activityreasoncategory_update', array('id' => $entity->getId())),
'method' => 'PUT',
));
$form->add('submit', 'submit', array('label' => 'Update'));
return $form;
}
/**
* Edits an existing ActivityReasonCategory entity.
*
*/
public function updateAction(Request $request, $id)
{
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository('ChillActivityBundle:ActivityReasonCategory')->find($id);
if (!$entity) {
throw $this->createNotFoundException('Unable to find ActivityReasonCategory entity.');
}
$deleteForm = $this->createDeleteForm($id);
$editForm = $this->createEditForm($entity);
$editForm->handleRequest($request);
if ($editForm->isValid()) {
$em->flush();
return $this->redirect($this->generateUrl('activityreasoncategory_edit', array('id' => $id)));
}
return $this->render('ChillActivityBundle:ActivityReasonCategory:edit.html.twig', array(
'entity' => $entity,
'edit_form' => $editForm->createView(),
'delete_form' => $deleteForm->createView(),
));
}
/**
* Deletes a ActivityReasonCategory entity.
*
*/
public function deleteAction(Request $request, $id)
{
$form = $this->createDeleteForm($id);
$form->handleRequest($request);
if ($form->isValid()) {
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository('ChillActivityBundle:ActivityReasonCategory')->find($id);
if (!$entity) {
throw $this->createNotFoundException('Unable to find ActivityReasonCategory entity.');
}
$em->remove($entity);
$em->flush();
}
return $this->redirect($this->generateUrl('activityreasoncategory'));
}
/**
* Creates a form to delete a ActivityReasonCategory entity by id.
*
* @param mixed $id The entity id
*
* @return \Symfony\Component\Form\Form The form
*/
private function createDeleteForm($id)
{
return $this->createFormBuilder()
->setAction($this->generateUrl('activityreasoncategory_delete', array('id' => $id)))
->setMethod('DELETE')
->add('submit', 'submit', array('label' => 'Delete'))
->getForm()
;
}
}

View File

@ -0,0 +1,224 @@
<?php
namespace Chill\ActivityBundle\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Chill\ActivityBundle\Entity\ActivityReason;
use Chill\ActivityBundle\Form\ActivityReasonType;
/**
* ActivityReason controller.
*
*/
class ActivityReasonController extends Controller
{
/**
* Lists all ActivityReason entities.
*
*/
public function indexAction()
{
$em = $this->getDoctrine()->getManager();
$entities = $em->getRepository('ChillActivityBundle:ActivityReason')->findAll();
return $this->render('ChillActivityBundle:ActivityReason:index.html.twig', array(
'entities' => $entities,
));
}
/**
* Creates a new ActivityReason entity.
*
*/
public function createAction(Request $request)
{
$entity = new ActivityReason();
$form = $this->createCreateForm($entity);
$form->handleRequest($request);
if ($form->isValid()) {
$em = $this->getDoctrine()->getManager();
$em->persist($entity);
$em->flush();
return $this->redirect($this->generateUrl('activityreason_show', array('id' => $entity->getId())));
}
return $this->render('ChillActivityBundle:ActivityReason:new.html.twig', array(
'entity' => $entity,
'form' => $form->createView(),
));
}
/**
* Creates a form to create a ActivityReason entity.
*
* @param ActivityReason $entity The entity
*
* @return \Symfony\Component\Form\Form The form
*/
private function createCreateForm(ActivityReason $entity)
{
$form = $this->createForm(new ActivityReasonType(), $entity, array(
'action' => $this->generateUrl('activityreason_create'),
'method' => 'POST',
));
$form->add('submit', 'submit', array('label' => 'Create'));
return $form;
}
/**
* Displays a form to create a new ActivityReason entity.
*
*/
public function newAction()
{
$entity = new ActivityReason();
$form = $this->createCreateForm($entity);
return $this->render('ChillActivityBundle:ActivityReason:new.html.twig', array(
'entity' => $entity,
'form' => $form->createView(),
));
}
/**
* Finds and displays a ActivityReason entity.
*
*/
public function showAction($id)
{
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository('ChillActivityBundle:ActivityReason')->find($id);
if (!$entity) {
throw $this->createNotFoundException('Unable to find ActivityReason entity.');
}
$deleteForm = $this->createDeleteForm($id);
return $this->render('ChillActivityBundle:ActivityReason:show.html.twig', array(
'entity' => $entity,
'delete_form' => $deleteForm->createView(),
));
}
/**
* Displays a form to edit an existing ActivityReason entity.
*
*/
public function editAction($id)
{
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository('ChillActivityBundle:ActivityReason')->find($id);
if (!$entity) {
throw $this->createNotFoundException('Unable to find ActivityReason entity.');
}
$editForm = $this->createEditForm($entity);
$deleteForm = $this->createDeleteForm($id);
return $this->render('ChillActivityBundle:ActivityReason:edit.html.twig', array(
'entity' => $entity,
'edit_form' => $editForm->createView(),
'delete_form' => $deleteForm->createView(),
));
}
/**
* Creates a form to edit a ActivityReason entity.
*
* @param ActivityReason $entity The entity
*
* @return \Symfony\Component\Form\Form The form
*/
private function createEditForm(ActivityReason $entity)
{
$form = $this->createForm(new ActivityReasonType(), $entity, array(
'action' => $this->generateUrl('activityreason_update', array('id' => $entity->getId())),
'method' => 'PUT',
));
$form->add('submit', 'submit', array('label' => 'Update'));
return $form;
}
/**
* Edits an existing ActivityReason entity.
*
*/
public function updateAction(Request $request, $id)
{
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository('ChillActivityBundle:ActivityReason')->find($id);
if (!$entity) {
throw $this->createNotFoundException('Unable to find ActivityReason entity.');
}
$deleteForm = $this->createDeleteForm($id);
$editForm = $this->createEditForm($entity);
$editForm->handleRequest($request);
if ($editForm->isValid()) {
$em->flush();
return $this->redirect($this->generateUrl('activityreason_edit', array('id' => $id)));
}
return $this->render('ChillActivityBundle:ActivityReason:edit.html.twig', array(
'entity' => $entity,
'edit_form' => $editForm->createView(),
'delete_form' => $deleteForm->createView(),
));
}
/**
* Deletes a ActivityReason entity.
*
*/
public function deleteAction(Request $request, $id)
{
$form = $this->createDeleteForm($id);
$form->handleRequest($request);
if ($form->isValid()) {
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository('ChillActivityBundle:ActivityReason')->find($id);
if (!$entity) {
throw $this->createNotFoundException('Unable to find ActivityReason entity.');
}
$em->remove($entity);
$em->flush();
}
return $this->redirect($this->generateUrl('activityreason'));
}
/**
* Creates a form to delete a ActivityReason entity by id.
*
* @param mixed $id The entity id
*
* @return \Symfony\Component\Form\Form The form
*/
private function createDeleteForm($id)
{
return $this->createFormBuilder()
->setAction($this->generateUrl('activityreason_delete', array('id' => $id)))
->setMethod('DELETE')
->add('submit', 'submit', array('label' => 'Delete'))
->getForm()
;
}
}

View File

@ -0,0 +1,224 @@
<?php
namespace Chill\ActivityBundle\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Chill\ActivityBundle\Entity\ActivityType;
use Chill\ActivityBundle\Form\ActivityTypeType;
/**
* ActivityType controller.
*
*/
class ActivityTypeController extends Controller
{
/**
* Lists all ActivityType entities.
*
*/
public function indexAction()
{
$em = $this->getDoctrine()->getManager();
$entities = $em->getRepository('ChillActivityBundle:ActivityType')->findAll();
return $this->render('ChillActivityBundle:ActivityType:index.html.twig', array(
'entities' => $entities,
));
}
/**
* Creates a new ActivityType entity.
*
*/
public function createAction(Request $request)
{
$entity = new ActivityType();
$form = $this->createCreateForm($entity);
$form->handleRequest($request);
if ($form->isValid()) {
$em = $this->getDoctrine()->getManager();
$em->persist($entity);
$em->flush();
return $this->redirect($this->generateUrl('activitytype_show', array('id' => $entity->getId())));
}
return $this->render('ChillActivityBundle:ActivityType:new.html.twig', array(
'entity' => $entity,
'form' => $form->createView(),
));
}
/**
* Creates a form to create a ActivityType entity.
*
* @param ActivityType $entity The entity
*
* @return \Symfony\Component\Form\Form The form
*/
private function createCreateForm(ActivityType $entity)
{
$form = $this->createForm(new ActivityTypeType(), $entity, array(
'action' => $this->generateUrl('activitytype_create'),
'method' => 'POST',
));
$form->add('submit', 'submit', array('label' => 'Create'));
return $form;
}
/**
* Displays a form to create a new ActivityType entity.
*
*/
public function newAction()
{
$entity = new ActivityType();
$form = $this->createCreateForm($entity);
return $this->render('ChillActivityBundle:ActivityType:new.html.twig', array(
'entity' => $entity,
'form' => $form->createView(),
));
}
/**
* Finds and displays a ActivityType entity.
*
*/
public function showAction($id)
{
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository('ChillActivityBundle:ActivityType')->find($id);
if (!$entity) {
throw $this->createNotFoundException('Unable to find ActivityType entity.');
}
$deleteForm = $this->createDeleteForm($id);
return $this->render('ChillActivityBundle:ActivityType:show.html.twig', array(
'entity' => $entity,
'delete_form' => $deleteForm->createView(),
));
}
/**
* Displays a form to edit an existing ActivityType entity.
*
*/
public function editAction($id)
{
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository('ChillActivityBundle:ActivityType')->find($id);
if (!$entity) {
throw $this->createNotFoundException('Unable to find ActivityType entity.');
}
$editForm = $this->createEditForm($entity);
$deleteForm = $this->createDeleteForm($id);
return $this->render('ChillActivityBundle:ActivityType:edit.html.twig', array(
'entity' => $entity,
'edit_form' => $editForm->createView(),
'delete_form' => $deleteForm->createView(),
));
}
/**
* Creates a form to edit a ActivityType entity.
*
* @param ActivityType $entity The entity
*
* @return \Symfony\Component\Form\Form The form
*/
private function createEditForm(ActivityType $entity)
{
$form = $this->createForm(new ActivityTypeType(), $entity, array(
'action' => $this->generateUrl('activitytype_update', array('id' => $entity->getId())),
'method' => 'PUT',
));
$form->add('submit', 'submit', array('label' => 'Update'));
return $form;
}
/**
* Edits an existing ActivityType entity.
*
*/
public function updateAction(Request $request, $id)
{
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository('ChillActivityBundle:ActivityType')->find($id);
if (!$entity) {
throw $this->createNotFoundException('Unable to find ActivityType entity.');
}
$deleteForm = $this->createDeleteForm($id);
$editForm = $this->createEditForm($entity);
$editForm->handleRequest($request);
if ($editForm->isValid()) {
$em->flush();
return $this->redirect($this->generateUrl('activitytype_edit', array('id' => $id)));
}
return $this->render('ChillActivityBundle:ActivityType:edit.html.twig', array(
'entity' => $entity,
'edit_form' => $editForm->createView(),
'delete_form' => $deleteForm->createView(),
));
}
/**
* Deletes a ActivityType entity.
*
*/
public function deleteAction(Request $request, $id)
{
$form = $this->createDeleteForm($id);
$form->handleRequest($request);
if ($form->isValid()) {
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository('ChillActivityBundle:ActivityType')->find($id);
if (!$entity) {
throw $this->createNotFoundException('Unable to find ActivityType entity.');
}
$em->remove($entity);
$em->flush();
}
return $this->redirect($this->generateUrl('activitytype'));
}
/**
* Creates a form to delete a ActivityType entity by id.
*
* @param mixed $id The entity id
*
* @return \Symfony\Component\Form\Form The form
*/
private function createDeleteForm($id)
{
return $this->createFormBuilder()
->setAction($this->generateUrl('activitytype_delete', array('id' => $id)))
->setMethod('DELETE')
->add('submit', 'submit', array('label' => 'Delete'))
->getForm()
;
}
}

View File

@ -0,0 +1,40 @@
<?php
namespace Chill\ActivityBundle\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
class ActivityReasonCategoryType extends AbstractType
{
/**
* @param FormBuilderInterface $builder
* @param array $options
*/
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('label')
->add('active')
;
}
/**
* @param OptionsResolverInterface $resolver
*/
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
$resolver->setDefaults(array(
'data_class' => 'Chill\ActivityBundle\Entity\ActivityReasonCategory'
));
}
/**
* @return string
*/
public function getName()
{
return 'chill_activitybundle_activityreasoncategory';
}
}

View File

@ -0,0 +1,41 @@
<?php
namespace Chill\ActivityBundle\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
class ActivityReasonType extends AbstractType
{
/**
* @param FormBuilderInterface $builder
* @param array $options
*/
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('label')
->add('active')
->add('category')
;
}
/**
* @param OptionsResolverInterface $resolver
*/
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
$resolver->setDefaults(array(
'data_class' => 'Chill\ActivityBundle\Entity\ActivityReason'
));
}
/**
* @return string
*/
public function getName()
{
return 'chill_activitybundle_activityreason';
}
}

47
Form/ActivityType.php Normal file
View File

@ -0,0 +1,47 @@
<?php
namespace Chill\ActivityBundle\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
class ActivityType extends AbstractType
{
/**
* @param FormBuilderInterface $builder
* @param array $options
*/
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('date')
->add('durationTime')
->add('remark')
->add('attendee')
->add('user')
->add('scope')
->add('reason')
->add('type')
->add('person')
;
}
/**
* @param OptionsResolverInterface $resolver
*/
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
$resolver->setDefaults(array(
'data_class' => 'Chill\ActivityBundle\Entity\Activity'
));
}
/**
* @return string
*/
public function getName()
{
return 'chill_activitybundle_activity';
}
}

39
Form/ActivityTypeType.php Normal file
View File

@ -0,0 +1,39 @@
<?php
namespace Chill\ActivityBundle\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
class ActivityTypeType extends AbstractType
{
/**
* @param FormBuilderInterface $builder
* @param array $options
*/
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('name')
;
}
/**
* @param OptionsResolverInterface $resolver
*/
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
$resolver->setDefaults(array(
'data_class' => 'Chill\ActivityBundle\Entity\ActivityType'
));
}
/**
* @return string
*/
public function getName()
{
return 'chill_activitybundle_activitytype';
}
}

View File

@ -1,3 +1,19 @@
chill_activity_activity:
resource: "@ChillActivityBundle/Resources/config/routing/activity.yml"
prefix: /activity
chill_activity_activityreason:
resource: "@ChillActivityBundle/Resources/config/routing/activityreason.yml"
prefix: /activityreason
chill_activity_activityreasoncategory:
resource: "@ChillActivityBundle/Resources/config/routing/activityreasoncategory.yml"
prefix: /activityreasoncategory
chill_activity_activitytype:
resource: "@ChillActivityBundle/Resources/config/routing/activitytype.yml"
prefix: /activitytype
chill_activity_homepage:
path: /hello/{name}
defaults: { _controller: ChillActivityBundle:Default:index }

View File

@ -0,0 +1,30 @@
activity:
path: /
defaults: { _controller: "ChillActivityBundle:Activity:index" }
activity_show:
path: /{id}/show
defaults: { _controller: "ChillActivityBundle:Activity:show" }
activity_new:
path: /new
defaults: { _controller: "ChillActivityBundle:Activity:new" }
activity_create:
path: /create
defaults: { _controller: "ChillActivityBundle:Activity:create" }
methods: POST
activity_edit:
path: /{id}/edit
defaults: { _controller: "ChillActivityBundle:Activity:edit" }
activity_update:
path: /{id}/update
defaults: { _controller: "ChillActivityBundle:Activity:update" }
methods: [POST, PUT]
activity_delete:
path: /{id}/delete
defaults: { _controller: "ChillActivityBundle:Activity:delete" }
methods: [POST, DELETE]

View File

@ -0,0 +1,30 @@
activityreason:
path: /
defaults: { _controller: "ChillActivityBundle:ActivityReason:index" }
activityreason_show:
path: /{id}/show
defaults: { _controller: "ChillActivityBundle:ActivityReason:show" }
activityreason_new:
path: /new
defaults: { _controller: "ChillActivityBundle:ActivityReason:new" }
activityreason_create:
path: /create
defaults: { _controller: "ChillActivityBundle:ActivityReason:create" }
methods: POST
activityreason_edit:
path: /{id}/edit
defaults: { _controller: "ChillActivityBundle:ActivityReason:edit" }
activityreason_update:
path: /{id}/update
defaults: { _controller: "ChillActivityBundle:ActivityReason:update" }
methods: [POST, PUT]
activityreason_delete:
path: /{id}/delete
defaults: { _controller: "ChillActivityBundle:ActivityReason:delete" }
methods: [POST, DELETE]

View File

@ -0,0 +1,30 @@
activityreasoncategory:
path: /
defaults: { _controller: "ChillActivityBundle:ActivityReasonCategory:index" }
activityreasoncategory_show:
path: /{id}/show
defaults: { _controller: "ChillActivityBundle:ActivityReasonCategory:show" }
activityreasoncategory_new:
path: /new
defaults: { _controller: "ChillActivityBundle:ActivityReasonCategory:new" }
activityreasoncategory_create:
path: /create
defaults: { _controller: "ChillActivityBundle:ActivityReasonCategory:create" }
methods: POST
activityreasoncategory_edit:
path: /{id}/edit
defaults: { _controller: "ChillActivityBundle:ActivityReasonCategory:edit" }
activityreasoncategory_update:
path: /{id}/update
defaults: { _controller: "ChillActivityBundle:ActivityReasonCategory:update" }
methods: [POST, PUT]
activityreasoncategory_delete:
path: /{id}/delete
defaults: { _controller: "ChillActivityBundle:ActivityReasonCategory:delete" }
methods: [POST, DELETE]

View File

@ -0,0 +1,30 @@
activitytype:
path: /
defaults: { _controller: "ChillActivityBundle:ActivityType:index" }
activitytype_show:
path: /{id}/show
defaults: { _controller: "ChillActivityBundle:ActivityType:show" }
activitytype_new:
path: /new
defaults: { _controller: "ChillActivityBundle:ActivityType:new" }
activitytype_create:
path: /create
defaults: { _controller: "ChillActivityBundle:ActivityType:create" }
methods: POST
activitytype_edit:
path: /{id}/edit
defaults: { _controller: "ChillActivityBundle:ActivityType:edit" }
activitytype_update:
path: /{id}/update
defaults: { _controller: "ChillActivityBundle:ActivityType:update" }
methods: [POST, PUT]
activitytype_delete:
path: /{id}/delete
defaults: { _controller: "ChillActivityBundle:ActivityType:delete" }
methods: [POST, DELETE]

View File

@ -0,0 +1,16 @@
{% extends '::base.html.twig' %}
{% block body -%}
<h1>Activity edit</h1>
{{ form(edit_form) }}
<ul class="record_actions">
<li>
<a href="{{ path('activity') }}">
Back to the list
</a>
</li>
<li>{{ form(delete_form) }}</li>
</ul>
{% endblock %}

View File

@ -0,0 +1,47 @@
{% extends '::base.html.twig' %}
{% block body -%}
<h1>Activity list</h1>
<table class="records_list">
<thead>
<tr>
<th>Id</th>
<th>Date</th>
<th>Durationtime</th>
<th>Remark</th>
<th>Attendee</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
{% for entity in entities %}
<tr>
<td><a href="{{ path('activity_show', { 'id': entity.id }) }}">{{ entity.id }}</a></td>
<td>{% if entity.date %}{{ entity.date|date('Y-m-d H:i:s') }}{% endif %}</td>
<td>{{ entity.durationTime }}</td>
<td>{{ entity.remark }}</td>
<td>{{ entity.attendee }}</td>
<td>
<ul>
<li>
<a href="{{ path('activity_show', { 'id': entity.id }) }}">show</a>
</li>
<li>
<a href="{{ path('activity_edit', { 'id': entity.id }) }}">edit</a>
</li>
</ul>
</td>
</tr>
{% endfor %}
</tbody>
</table>
<ul>
<li>
<a href="{{ path('activity_new') }}">
Create a new entry
</a>
</li>
</ul>
{% endblock %}

View File

@ -0,0 +1,15 @@
{% extends '::base.html.twig' %}
{% block body -%}
<h1>Activity creation</h1>
{{ form(form) }}
<ul class="record_actions">
<li>
<a href="{{ path('activity') }}">
Back to the list
</a>
</li>
</ul>
{% endblock %}

View File

@ -0,0 +1,44 @@
{% extends '::base.html.twig' %}
{% block body -%}
<h1>Activity</h1>
<table class="record_properties">
<tbody>
<tr>
<th>Id</th>
<td>{{ entity.id }}</td>
</tr>
<tr>
<th>Date</th>
<td>{{ entity.date|date('Y-m-d H:i:s') }}</td>
</tr>
<tr>
<th>Durationtime</th>
<td>{{ entity.durationTime }}</td>
</tr>
<tr>
<th>Remark</th>
<td>{{ entity.remark }}</td>
</tr>
<tr>
<th>Attendee</th>
<td>{{ entity.attendee }}</td>
</tr>
</tbody>
</table>
<ul class="record_actions">
<li>
<a href="{{ path('activity') }}">
Back to the list
</a>
</li>
<li>
<a href="{{ path('activity_edit', { 'id': entity.id }) }}">
Edit
</a>
</li>
<li>{{ form(delete_form) }}</li>
</ul>
{% endblock %}

View File

@ -0,0 +1,16 @@
{% extends '::base.html.twig' %}
{% block body -%}
<h1>ActivityReason edit</h1>
{{ form(edit_form) }}
<ul class="record_actions">
<li>
<a href="{{ path('activityreason') }}">
Back to the list
</a>
</li>
<li>{{ form(delete_form) }}</li>
</ul>
{% endblock %}

View File

@ -0,0 +1,43 @@
{% extends '::base.html.twig' %}
{% block body -%}
<h1>ActivityReason list</h1>
<table class="records_list">
<thead>
<tr>
<th>Id</th>
<th>Label</th>
<th>Active</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
{% for entity in entities %}
<tr>
<td><a href="{{ path('activityreason_show', { 'id': entity.id }) }}">{{ entity.id }}</a></td>
<td>{{ entity.label }}</td>
<td>{{ entity.active }}</td>
<td>
<ul>
<li>
<a href="{{ path('activityreason_show', { 'id': entity.id }) }}">show</a>
</li>
<li>
<a href="{{ path('activityreason_edit', { 'id': entity.id }) }}">edit</a>
</li>
</ul>
</td>
</tr>
{% endfor %}
</tbody>
</table>
<ul>
<li>
<a href="{{ path('activityreason_new') }}">
Create a new entry
</a>
</li>
</ul>
{% endblock %}

View File

@ -0,0 +1,15 @@
{% extends '::base.html.twig' %}
{% block body -%}
<h1>ActivityReason creation</h1>
{{ form(form) }}
<ul class="record_actions">
<li>
<a href="{{ path('activityreason') }}">
Back to the list
</a>
</li>
</ul>
{% endblock %}

View File

@ -0,0 +1,36 @@
{% extends '::base.html.twig' %}
{% block body -%}
<h1>ActivityReason</h1>
<table class="record_properties">
<tbody>
<tr>
<th>Id</th>
<td>{{ entity.id }}</td>
</tr>
<tr>
<th>Label</th>
<td>{{ entity.label }}</td>
</tr>
<tr>
<th>Active</th>
<td>{{ entity.active }}</td>
</tr>
</tbody>
</table>
<ul class="record_actions">
<li>
<a href="{{ path('activityreason') }}">
Back to the list
</a>
</li>
<li>
<a href="{{ path('activityreason_edit', { 'id': entity.id }) }}">
Edit
</a>
</li>
<li>{{ form(delete_form) }}</li>
</ul>
{% endblock %}

View File

@ -0,0 +1,16 @@
{% extends '::base.html.twig' %}
{% block body -%}
<h1>ActivityReasonCategory edit</h1>
{{ form(edit_form) }}
<ul class="record_actions">
<li>
<a href="{{ path('activityreasoncategory') }}">
Back to the list
</a>
</li>
<li>{{ form(delete_form) }}</li>
</ul>
{% endblock %}

View File

@ -0,0 +1,43 @@
{% extends '::base.html.twig' %}
{% block body -%}
<h1>ActivityReasonCategory list</h1>
<table class="records_list">
<thead>
<tr>
<th>Id</th>
<th>Label</th>
<th>Active</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
{% for entity in entities %}
<tr>
<td><a href="{{ path('activityreasoncategory_show', { 'id': entity.id }) }}">{{ entity.id }}</a></td>
<td>{{ entity.label }}</td>
<td>{{ entity.active }}</td>
<td>
<ul>
<li>
<a href="{{ path('activityreasoncategory_show', { 'id': entity.id }) }}">show</a>
</li>
<li>
<a href="{{ path('activityreasoncategory_edit', { 'id': entity.id }) }}">edit</a>
</li>
</ul>
</td>
</tr>
{% endfor %}
</tbody>
</table>
<ul>
<li>
<a href="{{ path('activityreasoncategory_new') }}">
Create a new entry
</a>
</li>
</ul>
{% endblock %}

View File

@ -0,0 +1,15 @@
{% extends '::base.html.twig' %}
{% block body -%}
<h1>ActivityReasonCategory creation</h1>
{{ form(form) }}
<ul class="record_actions">
<li>
<a href="{{ path('activityreasoncategory') }}">
Back to the list
</a>
</li>
</ul>
{% endblock %}

View File

@ -0,0 +1,36 @@
{% extends '::base.html.twig' %}
{% block body -%}
<h1>ActivityReasonCategory</h1>
<table class="record_properties">
<tbody>
<tr>
<th>Id</th>
<td>{{ entity.id }}</td>
</tr>
<tr>
<th>Label</th>
<td>{{ entity.label }}</td>
</tr>
<tr>
<th>Active</th>
<td>{{ entity.active }}</td>
</tr>
</tbody>
</table>
<ul class="record_actions">
<li>
<a href="{{ path('activityreasoncategory') }}">
Back to the list
</a>
</li>
<li>
<a href="{{ path('activityreasoncategory_edit', { 'id': entity.id }) }}">
Edit
</a>
</li>
<li>{{ form(delete_form) }}</li>
</ul>
{% endblock %}

View File

@ -0,0 +1,16 @@
{% extends '::base.html.twig' %}
{% block body -%}
<h1>ActivityType edit</h1>
{{ form(edit_form) }}
<ul class="record_actions">
<li>
<a href="{{ path('activitytype') }}">
Back to the list
</a>
</li>
<li>{{ form(delete_form) }}</li>
</ul>
{% endblock %}

View File

@ -0,0 +1,41 @@
{% extends '::base.html.twig' %}
{% block body -%}
<h1>ActivityType list</h1>
<table class="records_list">
<thead>
<tr>
<th>Id</th>
<th>Name</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
{% for entity in entities %}
<tr>
<td><a href="{{ path('activitytype_show', { 'id': entity.id }) }}">{{ entity.id }}</a></td>
<td>{{ entity.name }}</td>
<td>
<ul>
<li>
<a href="{{ path('activitytype_show', { 'id': entity.id }) }}">show</a>
</li>
<li>
<a href="{{ path('activitytype_edit', { 'id': entity.id }) }}">edit</a>
</li>
</ul>
</td>
</tr>
{% endfor %}
</tbody>
</table>
<ul>
<li>
<a href="{{ path('activitytype_new') }}">
Create a new entry
</a>
</li>
</ul>
{% endblock %}

View File

@ -0,0 +1,15 @@
{% extends '::base.html.twig' %}
{% block body -%}
<h1>ActivityType creation</h1>
{{ form(form) }}
<ul class="record_actions">
<li>
<a href="{{ path('activitytype') }}">
Back to the list
</a>
</li>
</ul>
{% endblock %}

View File

@ -0,0 +1,32 @@
{% extends '::base.html.twig' %}
{% block body -%}
<h1>ActivityType</h1>
<table class="record_properties">
<tbody>
<tr>
<th>Id</th>
<td>{{ entity.id }}</td>
</tr>
<tr>
<th>Name</th>
<td>{{ entity.name }}</td>
</tr>
</tbody>
</table>
<ul class="record_actions">
<li>
<a href="{{ path('activitytype') }}">
Back to the list
</a>
</li>
<li>
<a href="{{ path('activitytype_edit', { 'id': entity.id }) }}">
Edit
</a>
</li>
<li>{{ form(delete_form) }}</li>
</ul>
{% endblock %}

View File

@ -0,0 +1,55 @@
<?php
namespace Chill\ActivityBundle\Tests\Controller;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
class ActivityControllerTest extends WebTestCase
{
/*
public function testCompleteScenario()
{
// Create a new client to browse the application
$client = static::createClient();
// Create a new entry in the database
$crawler = $client->request('GET', '/activity/');
$this->assertEquals(200, $client->getResponse()->getStatusCode(), "Unexpected HTTP status code for GET /activity/");
$crawler = $client->click($crawler->selectLink('Create a new entry')->link());
// Fill in the form and submit it
$form = $crawler->selectButton('Create')->form(array(
'chill_activitybundle_activity[field_name]' => 'Test',
// ... other fields to fill
));
$client->submit($form);
$crawler = $client->followRedirect();
// Check data in the show view
$this->assertGreaterThan(0, $crawler->filter('td:contains("Test")')->count(), 'Missing element td:contains("Test")');
// Edit the entity
$crawler = $client->click($crawler->selectLink('Edit')->link());
$form = $crawler->selectButton('Update')->form(array(
'chill_activitybundle_activity[field_name]' => 'Foo',
// ... other fields to fill
));
$client->submit($form);
$crawler = $client->followRedirect();
// Check the element contains an attribute with value equals "Foo"
$this->assertGreaterThan(0, $crawler->filter('[value="Foo"]')->count(), 'Missing element [value="Foo"]');
// Delete the entity
$client->submit($crawler->selectButton('Delete')->form());
$crawler = $client->followRedirect();
// Check the entity has been delete on the list
$this->assertNotRegExp('/Foo/', $client->getResponse()->getContent());
}
*/
}

View File

@ -0,0 +1,55 @@
<?php
namespace Chill\ActivityBundle\Tests\Controller;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
class ActivityReasonCategoryControllerTest extends WebTestCase
{
/*
public function testCompleteScenario()
{
// Create a new client to browse the application
$client = static::createClient();
// Create a new entry in the database
$crawler = $client->request('GET', '/activityreasoncategory/');
$this->assertEquals(200, $client->getResponse()->getStatusCode(), "Unexpected HTTP status code for GET /activityreasoncategory/");
$crawler = $client->click($crawler->selectLink('Create a new entry')->link());
// Fill in the form and submit it
$form = $crawler->selectButton('Create')->form(array(
'chill_activitybundle_activityreasoncategory[field_name]' => 'Test',
// ... other fields to fill
));
$client->submit($form);
$crawler = $client->followRedirect();
// Check data in the show view
$this->assertGreaterThan(0, $crawler->filter('td:contains("Test")')->count(), 'Missing element td:contains("Test")');
// Edit the entity
$crawler = $client->click($crawler->selectLink('Edit')->link());
$form = $crawler->selectButton('Update')->form(array(
'chill_activitybundle_activityreasoncategory[field_name]' => 'Foo',
// ... other fields to fill
));
$client->submit($form);
$crawler = $client->followRedirect();
// Check the element contains an attribute with value equals "Foo"
$this->assertGreaterThan(0, $crawler->filter('[value="Foo"]')->count(), 'Missing element [value="Foo"]');
// Delete the entity
$client->submit($crawler->selectButton('Delete')->form());
$crawler = $client->followRedirect();
// Check the entity has been delete on the list
$this->assertNotRegExp('/Foo/', $client->getResponse()->getContent());
}
*/
}

View File

@ -0,0 +1,55 @@
<?php
namespace Chill\ActivityBundle\Tests\Controller;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
class ActivityReasonControllerTest extends WebTestCase
{
/*
public function testCompleteScenario()
{
// Create a new client to browse the application
$client = static::createClient();
// Create a new entry in the database
$crawler = $client->request('GET', '/activityreason/');
$this->assertEquals(200, $client->getResponse()->getStatusCode(), "Unexpected HTTP status code for GET /activityreason/");
$crawler = $client->click($crawler->selectLink('Create a new entry')->link());
// Fill in the form and submit it
$form = $crawler->selectButton('Create')->form(array(
'chill_activitybundle_activityreason[field_name]' => 'Test',
// ... other fields to fill
));
$client->submit($form);
$crawler = $client->followRedirect();
// Check data in the show view
$this->assertGreaterThan(0, $crawler->filter('td:contains("Test")')->count(), 'Missing element td:contains("Test")');
// Edit the entity
$crawler = $client->click($crawler->selectLink('Edit')->link());
$form = $crawler->selectButton('Update')->form(array(
'chill_activitybundle_activityreason[field_name]' => 'Foo',
// ... other fields to fill
));
$client->submit($form);
$crawler = $client->followRedirect();
// Check the element contains an attribute with value equals "Foo"
$this->assertGreaterThan(0, $crawler->filter('[value="Foo"]')->count(), 'Missing element [value="Foo"]');
// Delete the entity
$client->submit($crawler->selectButton('Delete')->form());
$crawler = $client->followRedirect();
// Check the entity has been delete on the list
$this->assertNotRegExp('/Foo/', $client->getResponse()->getContent());
}
*/
}

View File

@ -0,0 +1,55 @@
<?php
namespace Chill\ActivityBundle\Tests\Controller;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
class ActivityTypeControllerTest extends WebTestCase
{
/*
public function testCompleteScenario()
{
// Create a new client to browse the application
$client = static::createClient();
// Create a new entry in the database
$crawler = $client->request('GET', '/activitytype/');
$this->assertEquals(200, $client->getResponse()->getStatusCode(), "Unexpected HTTP status code for GET /activitytype/");
$crawler = $client->click($crawler->selectLink('Create a new entry')->link());
// Fill in the form and submit it
$form = $crawler->selectButton('Create')->form(array(
'chill_activitybundle_activitytype[field_name]' => 'Test',
// ... other fields to fill
));
$client->submit($form);
$crawler = $client->followRedirect();
// Check data in the show view
$this->assertGreaterThan(0, $crawler->filter('td:contains("Test")')->count(), 'Missing element td:contains("Test")');
// Edit the entity
$crawler = $client->click($crawler->selectLink('Edit')->link());
$form = $crawler->selectButton('Update')->form(array(
'chill_activitybundle_activitytype[field_name]' => 'Foo',
// ... other fields to fill
));
$client->submit($form);
$crawler = $client->followRedirect();
// Check the element contains an attribute with value equals "Foo"
$this->assertGreaterThan(0, $crawler->filter('[value="Foo"]')->count(), 'Missing element [value="Foo"]');
// Delete the entity
$client->submit($crawler->selectButton('Delete')->form());
$crawler = $client->followRedirect();
// Check the entity has been delete on the list
$this->assertNotRegExp('/Foo/', $client->getResponse()->getContent());
}
*/
}