Ajout de la notion de domaine (fixes #72)
This commit is contained in:
@@ -19,6 +19,10 @@ app_home_selectservice:
|
|||||||
path: /user/selectservice
|
path: /user/selectservice
|
||||||
defaults: { _controller: App\Controller\HomeController:selectservice }
|
defaults: { _controller: App\Controller\HomeController:selectservice }
|
||||||
|
|
||||||
|
app_home_selectdomaine:
|
||||||
|
path: /user/selectdomaine
|
||||||
|
defaults: { _controller: App\Controller\HomeController:selectdomaine }
|
||||||
|
|
||||||
#== Security ====================================================================================================
|
#== Security ====================================================================================================
|
||||||
app_login:
|
app_login:
|
||||||
path: /login
|
path: /login
|
||||||
@@ -114,6 +118,23 @@ app_service_delete:
|
|||||||
path: /admin/service/delete/{id}
|
path: /admin/service/delete/{id}
|
||||||
defaults: { _controller: App\Controller\ServiceController:delete }
|
defaults: { _controller: App\Controller\ServiceController:delete }
|
||||||
|
|
||||||
|
#== Domaine =====================================================================================================
|
||||||
|
app_domaine:
|
||||||
|
path: /admin/domaine
|
||||||
|
defaults: { _controller: App\Controller\DomaineController:list }
|
||||||
|
|
||||||
|
app_domaine_submit:
|
||||||
|
path: /admin/domaine/submit
|
||||||
|
defaults: { _controller: App\Controller\DomaineController:submit }
|
||||||
|
|
||||||
|
app_domaine_update:
|
||||||
|
path: /admin/domaine/update/{id}
|
||||||
|
defaults: { _controller: App\Controller\DomaineController:update }
|
||||||
|
|
||||||
|
app_domaine_delete:
|
||||||
|
path: /admin/domaine/delete/{id}
|
||||||
|
defaults: { _controller: App\Controller\DomaineController:delete }
|
||||||
|
|
||||||
#== Nature =====================================================================================================
|
#== Nature =====================================================================================================
|
||||||
app_nature:
|
app_nature:
|
||||||
path: /admin/nature
|
path: /admin/nature
|
||||||
@@ -191,11 +212,14 @@ app_project_activeproject:
|
|||||||
path: /master/project/activeproject
|
path: /master/project/activeproject
|
||||||
defaults: { _controller: App\Controller\ProjectController:activeproject }
|
defaults: { _controller: App\Controller\ProjectController:activeproject }
|
||||||
|
|
||||||
|
app_project_viewservice:
|
||||||
|
path: /master/project/viewservice
|
||||||
|
defaults: { _controller: App\Controller\ProjectController:viewservice }
|
||||||
|
|
||||||
app_project_select:
|
app_project_select:
|
||||||
path: /master/project/select
|
path: /master/project/select
|
||||||
defaults: { _controller: App\Controller\ProjectController:select }
|
defaults: { _controller: App\Controller\ProjectController:select }
|
||||||
|
|
||||||
|
|
||||||
app_project_users_add:
|
app_project_users_add:
|
||||||
path: /master/project/users/add
|
path: /master/project/users/add
|
||||||
defaults: { _controller: App\Controller\ProjectController:usersadd }
|
defaults: { _controller: App\Controller\ProjectController:usersadd }
|
||||||
@@ -233,6 +257,10 @@ app_offer_activeoffer:
|
|||||||
path: /master/offer/activeoffer
|
path: /master/offer/activeoffer
|
||||||
defaults: { _controller: App\Controller\OfferController:activeoffer }
|
defaults: { _controller: App\Controller\OfferController:activeoffer }
|
||||||
|
|
||||||
|
app_offer_viewservice:
|
||||||
|
path: /master/offer/viewservice
|
||||||
|
defaults: { _controller: App\Controller\OfferController:viewservice }
|
||||||
|
|
||||||
app_offer_getorders:
|
app_offer_getorders:
|
||||||
path: /master/offer/getorders
|
path: /master/offer/getorders
|
||||||
defaults: { _controller: App\Controller\OfferController:getorders }
|
defaults: { _controller: App\Controller\OfferController:getorders }
|
||||||
@@ -266,6 +294,10 @@ app_task_activetask:
|
|||||||
path: /master/task/activetask
|
path: /master/task/activetask
|
||||||
defaults: { _controller: App\Controller\TaskController:activetask }
|
defaults: { _controller: App\Controller\TaskController:activetask }
|
||||||
|
|
||||||
|
app_task_viewservice:
|
||||||
|
path: /master/task/viewservice
|
||||||
|
defaults: { _controller: App\Controller\TaskController:viewservice }
|
||||||
|
|
||||||
#== Event ====================================================================================================
|
#== Event ====================================================================================================
|
||||||
app_event:
|
app_event:
|
||||||
path: /user/event
|
path: /user/event
|
||||||
|
180
src/schedule-2.0/src/Controller/DomaineController.php
Executable file
180
src/schedule-2.0/src/Controller/DomaineController.php
Executable file
@@ -0,0 +1,180 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Controller;
|
||||||
|
|
||||||
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
|
use Symfony\Component\Form\FormError;
|
||||||
|
use Knp\Bundle\SnappyBundle\Snappy\Response\PdfResponse;
|
||||||
|
|
||||||
|
use App\Entity\Domaine as Entity;
|
||||||
|
use App\Form\DomaineType as Form;
|
||||||
|
|
||||||
|
class DomaineController extends AbstractController
|
||||||
|
{
|
||||||
|
private $data = "domaine";
|
||||||
|
private $route = "app_domaine";
|
||||||
|
private $render = "Domaine/";
|
||||||
|
private $entity = "App:Domaine";
|
||||||
|
|
||||||
|
private $knpSnappy;
|
||||||
|
public function __construct(\Knp\Snappy\Pdf $knpSnappy) { $this->knpSnappy = $knpSnappy; }
|
||||||
|
|
||||||
|
public function list(Request $request)
|
||||||
|
{
|
||||||
|
$em = $this->getDoctrine()->getManager();
|
||||||
|
$datas = $em->getRepository($this->entity)->findAll();
|
||||||
|
|
||||||
|
if($request->query->get('fgprint')) {
|
||||||
|
$render = $this->renderView($this->render.'list.html.twig',[
|
||||||
|
$this->data."s" => $datas,
|
||||||
|
"useheader" => true,
|
||||||
|
"usesidebar" => true,
|
||||||
|
"fgprint" => true,
|
||||||
|
]);
|
||||||
|
|
||||||
|
return new PdfResponse(
|
||||||
|
$this->knpSnappy->getOutputFromHtml($render),
|
||||||
|
'domaines.pdf'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return $this->render($this->render.'list.html.twig',[
|
||||||
|
$this->data."s" => $datas,
|
||||||
|
"useheader" => true,
|
||||||
|
"usesidebar" => true,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function submit(Request $request)
|
||||||
|
{
|
||||||
|
// Initialisation de l'enregistrement
|
||||||
|
$em = $this->getDoctrine()->getManager();
|
||||||
|
$data = new Entity();
|
||||||
|
|
||||||
|
// Création du formulaire
|
||||||
|
$form = $this->createForm(Form::class,$data,array("mode"=>"submit"));
|
||||||
|
|
||||||
|
// Récupération des data du formulaire
|
||||||
|
$form->handleRequest($request);
|
||||||
|
|
||||||
|
// Sur erreur
|
||||||
|
$this->getErrorForm(null,$form,$request,$data,"submit");
|
||||||
|
|
||||||
|
// Sur validation
|
||||||
|
if ($form->get('submit')->isClicked() && $form->isValid()) {
|
||||||
|
$data = $form->getData();
|
||||||
|
$em->persist($data);
|
||||||
|
$em->flush();
|
||||||
|
|
||||||
|
// Retour à la liste
|
||||||
|
return $this->redirectToRoute($this->route);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Affichage du formulaire
|
||||||
|
return $this->render($this->render.'edit.html.twig', [
|
||||||
|
'useheader' => true,
|
||||||
|
'usesidebar' => true,
|
||||||
|
$this->data => $data,
|
||||||
|
'mode' => 'submit',
|
||||||
|
'form' => $form->createView()
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function update($id,Request $request)
|
||||||
|
{
|
||||||
|
// Initialisation de l'enregistrement
|
||||||
|
$em = $this->getDoctrine()->getManager();
|
||||||
|
$data=$em->getRepository($this->entity)->find($id);
|
||||||
|
|
||||||
|
// Création du formulaire
|
||||||
|
$form = $this->createForm(Form::class,$data,array("mode"=>"update"));
|
||||||
|
|
||||||
|
// Récupération des data du formulaire
|
||||||
|
$form->handleRequest($request);
|
||||||
|
|
||||||
|
// Sur erreur
|
||||||
|
$this->getErrorForm(null,$form,$request,$data,"update");
|
||||||
|
|
||||||
|
// Sur validation
|
||||||
|
if ($form->get('submit')->isClicked() && $form->isValid()) {
|
||||||
|
$data = $form->getData();
|
||||||
|
$em->persist($data);
|
||||||
|
$em->flush();
|
||||||
|
|
||||||
|
// Retour à la liste
|
||||||
|
return $this->redirectToRoute($this->route);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Affichage du formulaire
|
||||||
|
if($request->query->get('fgprint')) {
|
||||||
|
$render = $this->renderView($this->render.'edit.html.twig', [
|
||||||
|
'useheader' => true,
|
||||||
|
'usesidebar' => true,
|
||||||
|
$this->data => $data,
|
||||||
|
'mode' => 'update',
|
||||||
|
'form' => $form->createView(),
|
||||||
|
"fgprint" => true,
|
||||||
|
]);
|
||||||
|
|
||||||
|
return new PdfResponse(
|
||||||
|
$this->knpSnappy->getOutputFromHtml($render),
|
||||||
|
'domaine.pdf'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return $this->render($this->render.'edit.html.twig', [
|
||||||
|
'useheader' => true,
|
||||||
|
'usesidebar' => true,
|
||||||
|
$this->data => $data,
|
||||||
|
'mode' => 'update',
|
||||||
|
'form' => $form->createView()
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function delete($id,Request $request)
|
||||||
|
{
|
||||||
|
// Initialisation de l'enregistrement
|
||||||
|
$em = $this->getDoctrine()->getManager();
|
||||||
|
$data=$em->getRepository($this->entity)->find($id);
|
||||||
|
|
||||||
|
// Controle avant suppression
|
||||||
|
$error=false;
|
||||||
|
if($error)
|
||||||
|
return $this->redirectToRoute($this->route."_update",["id"=>$id]);
|
||||||
|
else {
|
||||||
|
try {
|
||||||
|
$em->remove($data);
|
||||||
|
$em->flush();
|
||||||
|
}
|
||||||
|
catch(\Doctrine\DBAL\DBALException $e) {
|
||||||
|
// Création du formulaire
|
||||||
|
$this->get('session')->getFlashBag()->add('error', 'Impossible de supprimer cet enregistrement');
|
||||||
|
return $this->redirectToRoute($this->route."_update",["id"=>$id]);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Retour à la liste
|
||||||
|
return $this->redirectToRoute($this->route);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function getErrorForm($id,$form,$request,$data,$mode) {
|
||||||
|
if ($form->get('submit')->isClicked()&&$mode=="delete") {
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($form->get('submit')->isClicked() && $mode=="submit") {
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($form->get('submit')->isClicked() && !$form->isValid()) {
|
||||||
|
$this->get('session')->getFlashBag()->clear();
|
||||||
|
|
||||||
|
$errors = $form->getErrors();
|
||||||
|
foreach( $errors as $error ) {
|
||||||
|
$request->getSession()->getFlashBag()->add("error", $error->getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -61,7 +61,9 @@ class HomeController extends AbstractController
|
|||||||
{
|
{
|
||||||
$em = $this->getDoctrine()->getManager();
|
$em = $this->getDoctrine()->getManager();
|
||||||
|
|
||||||
|
$iddomaine = $this->get('session')->get('iddomaine');
|
||||||
$idservice = $request->request->get('idservice');
|
$idservice = $request->request->get('idservice');
|
||||||
|
|
||||||
$this->get('session')->set('idservice',$idservice);
|
$this->get('session')->set('idservice',$idservice);
|
||||||
$output=["return"=>"OK"];
|
$output=["return"=>"OK"];
|
||||||
|
|
||||||
@@ -86,12 +88,40 @@ class HomeController extends AbstractController
|
|||||||
}
|
}
|
||||||
$this->get('session')->set('users',$tbusers);
|
$this->get('session')->set('users',$tbusers);
|
||||||
if(!$haveuser) $this->get('session')->set("iduser","all");
|
if(!$haveuser) $this->get('session')->set("iduser","all");
|
||||||
|
|
||||||
|
// On recalcul les projets
|
||||||
|
$this->regenProjects($idservice,$iddomaine);
|
||||||
|
|
||||||
|
return new Response(json_encode($output));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function selectdomaine(Request $request)
|
||||||
|
{
|
||||||
|
$iddomaine = $request->request->get('iddomaine');
|
||||||
|
$idservice = $this->get('session')->get('idservice');
|
||||||
|
|
||||||
|
$this->get('session')->set('iddomaine',$iddomaine);
|
||||||
|
$output=["return"=>"OK"];
|
||||||
|
|
||||||
// On recalcul les projets
|
// On recalcul les projets
|
||||||
if($idservice=="all")
|
$this->regenProjects($idservice,$iddomaine);
|
||||||
|
|
||||||
|
|
||||||
|
return new Response(json_encode($output));
|
||||||
|
}
|
||||||
|
|
||||||
|
private function regenProjects($idservice,$iddomaine) {
|
||||||
|
$em = $this->getDoctrine()->getManager();
|
||||||
|
|
||||||
|
if($idservice=="all"&&$iddomaine=="all")
|
||||||
$projects=$em->getRepository('App:Project')->findBy(["active"=>$this->get('session')->get('activeproject')]);
|
$projects=$em->getRepository('App:Project')->findBy(["active"=>$this->get('session')->get('activeproject')]);
|
||||||
else
|
elseif($idservice!="all"&&$iddomaine!="all")
|
||||||
|
$projects=$em->getRepository('App:Project')->findBy(["active"=>$this->get('session')->get('activeproject'),"service"=>$idservice,"domaine"=>$iddomaine]);
|
||||||
|
elseif($idservice!="all")
|
||||||
$projects=$em->getRepository('App:Project')->findBy(["active"=>$this->get('session')->get('activeproject'),"service"=>$idservice]);
|
$projects=$em->getRepository('App:Project')->findBy(["active"=>$this->get('session')->get('activeproject'),"service"=>$idservice]);
|
||||||
|
else
|
||||||
|
$projects=$em->getRepository('App:Project')->findBy(["active"=>$this->get('session')->get('activeproject'),"domaine"=>$iddomaine]);
|
||||||
|
|
||||||
$tbprojects=[];
|
$tbprojects=[];
|
||||||
$haveproject=false;
|
$haveproject=false;
|
||||||
foreach($projects as $project) {
|
foreach($projects as $project) {
|
||||||
@@ -106,7 +136,5 @@ class HomeController extends AbstractController
|
|||||||
}
|
}
|
||||||
$this->get('session')->set('projects',$tbprojects);
|
$this->get('session')->set('projects',$tbprojects);
|
||||||
if(!$haveproject) $this->get('session')->set("idproject","all");
|
if(!$haveproject) $this->get('session')->set("idproject","all");
|
||||||
|
|
||||||
return new Response(json_encode($output));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -29,10 +29,12 @@ class OfferController extends AbstractController
|
|||||||
{
|
{
|
||||||
$em = $this->getDoctrine()->getManager();
|
$em = $this->getDoctrine()->getManager();
|
||||||
$services=$em->getRepository("App:Service")->findAllOfferActive($this->get('session')->get('activeproject'),$this->get('session')->get('activeoffer'),$this->get('session')->get('idservice'));
|
$services=$em->getRepository("App:Service")->findAllOfferActive($this->get('session')->get('activeproject'),$this->get('session')->get('activeoffer'),$this->get('session')->get('idservice'));
|
||||||
|
$domaines=$em->getRepository("App:Domaine")->findAllOfferActive($this->get('session')->get('activeproject'),$this->get('session')->get('activeoffer'),$this->get('session')->get('iddomaine'));
|
||||||
|
|
||||||
if($request->query->get('fgprint')) {
|
if($request->query->get('fgprint')) {
|
||||||
$render = $this->renderView($this->render.'list.html.twig',[
|
$render = $this->renderView($this->render.'list.html.twig',[
|
||||||
"services" => $services,
|
"services" => $services,
|
||||||
|
"domaines" => $domaines,
|
||||||
"useheader" => true,
|
"useheader" => true,
|
||||||
"usesidebar" => true,
|
"usesidebar" => true,
|
||||||
"fgprint" => true,
|
"fgprint" => true,
|
||||||
@@ -46,6 +48,7 @@ class OfferController extends AbstractController
|
|||||||
else {
|
else {
|
||||||
return $this->render($this->render.'list.html.twig',[
|
return $this->render($this->render.'list.html.twig',[
|
||||||
"services" => $services,
|
"services" => $services,
|
||||||
|
"domaines" => $domaines,
|
||||||
"useheader" => true,
|
"useheader" => true,
|
||||||
"usesidebar" => true,
|
"usesidebar" => true,
|
||||||
"doliactive" => $this->getParameter('doliActive'),
|
"doliactive" => $this->getParameter('doliActive'),
|
||||||
@@ -219,6 +222,12 @@ class OfferController extends AbstractController
|
|||||||
$this->get('session')->set('activeoffer',!$this->get('session')->get('activeoffer'));
|
$this->get('session')->set('activeoffer',!$this->get('session')->get('activeoffer'));
|
||||||
return $this->redirectToRoute($this->route);
|
return $this->redirectToRoute($this->route);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function viewservice() {
|
||||||
|
$this->get('session')->set('viewservice',!$this->get('session')->get('viewservice'));
|
||||||
|
return $this->redirectToRoute($this->route);
|
||||||
|
}
|
||||||
|
|
||||||
public function getorders(){
|
public function getorders(){
|
||||||
$em = $this->getDoctrine()->getManager();
|
$em = $this->getDoctrine()->getManager();
|
||||||
$orders = $this->dolibarrapi->getOrders();
|
$orders = $this->dolibarrapi->getOrders();
|
||||||
|
@@ -27,10 +27,12 @@ class ProjectController extends AbstractController
|
|||||||
{
|
{
|
||||||
$em = $this->getDoctrine()->getManager();
|
$em = $this->getDoctrine()->getManager();
|
||||||
$services=$em->getRepository("App:Service")->findAllProjectActive($this->get('session')->get('activeproject'),$this->get('session')->get('idservice'));
|
$services=$em->getRepository("App:Service")->findAllProjectActive($this->get('session')->get('activeproject'),$this->get('session')->get('idservice'));
|
||||||
|
$domaines=$em->getRepository("App:Domaine")->findAllProjectActive($this->get('session')->get('activeproject'),$this->get('session')->get('iddomaine'));
|
||||||
|
|
||||||
if($request->query->get('fgprint')) {
|
if($request->query->get('fgprint')) {
|
||||||
$render = $this->renderView($this->render.'list.html.twig',[
|
$render = $this->renderView($this->render.'list.html.twig',[
|
||||||
"services" => $services,
|
"services" => $services,
|
||||||
|
"domaines" => $domaines,
|
||||||
"useheader" => true,
|
"useheader" => true,
|
||||||
"usesidebar" => true,
|
"usesidebar" => true,
|
||||||
"fgprint" => true,
|
"fgprint" => true,
|
||||||
@@ -44,6 +46,7 @@ class ProjectController extends AbstractController
|
|||||||
else {
|
else {
|
||||||
return $this->render($this->render.'list.html.twig',[
|
return $this->render($this->render.'list.html.twig',[
|
||||||
"services" => $services,
|
"services" => $services,
|
||||||
|
"domaines" => $domaines,
|
||||||
"useheader" => true,
|
"useheader" => true,
|
||||||
"usesidebar" => true,
|
"usesidebar" => true,
|
||||||
]);
|
]);
|
||||||
@@ -287,6 +290,13 @@ class ProjectController extends AbstractController
|
|||||||
return $this->redirectToRoute($this->route);
|
return $this->redirectToRoute($this->route);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function viewservice() {
|
||||||
|
$this->get('session')->set('viewservice',!$this->get('session')->get('viewservice'));
|
||||||
|
$this->refreshsession();
|
||||||
|
|
||||||
|
return $this->redirectToRoute($this->route);
|
||||||
|
}
|
||||||
|
|
||||||
protected function refreshsession() {
|
protected function refreshsession() {
|
||||||
$em = $this->getDoctrine()->getManager();
|
$em = $this->getDoctrine()->getManager();
|
||||||
$tbprojects=[];
|
$tbprojects=[];
|
||||||
|
@@ -246,12 +246,19 @@ class ReportController extends AbstractController
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Filtre par Domaine
|
||||||
|
if($this->get('session')->get('iddomaine')!="all") {
|
||||||
|
if($project->getDomaine()->getId()!=$this->get('session')->get('iddomaine'))
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// Filtre par project
|
// Filtre par project
|
||||||
if($this->get('session')->get('idproject')!="all") {
|
if($this->get('session')->get('idproject')!="all") {
|
||||||
if($project->getId()!=$this->get('session')->get('idproject'))
|
if($project->getId()!=$this->get('session')->get('idproject'))
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Ne prendre que les projets actif/inactif
|
// Ne prendre que les projets actif/inactif
|
||||||
if($this->get('session')->get('activeproject')!=$project->getActive())
|
if($this->get('session')->get('activeproject')!=$project->getActive())
|
||||||
continue;
|
continue;
|
||||||
@@ -501,6 +508,12 @@ class ReportController extends AbstractController
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Filtre par Domaine
|
||||||
|
if($this->get('session')->get('iddomaine')!="all") {
|
||||||
|
if($project->getDomaine()->getId()!=$this->get('session')->get('iddomaine'))
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// Filtre par project
|
// Filtre par project
|
||||||
if($this->get('session')->get('idproject')!="all") {
|
if($this->get('session')->get('idproject')!="all") {
|
||||||
if($project->getId()!=$this->get('session')->get('idproject'))
|
if($project->getId()!=$this->get('session')->get('idproject'))
|
||||||
@@ -713,8 +726,6 @@ class ReportController extends AbstractController
|
|||||||
$end->add(new \DateInterval('P'.$nbmonth.'M'));
|
$end->add(new \DateInterval('P'.$nbmonth.'M'));
|
||||||
$end->sub(new \DateInterval('P1D'));
|
$end->sub(new \DateInterval('P1D'));
|
||||||
$end->setTime(23,59,0);
|
$end->setTime(23,59,0);
|
||||||
dump($start);
|
|
||||||
dump($end);
|
|
||||||
while($start<$end) {
|
while($start<$end) {
|
||||||
$tbproject["months"][$start->format("Ym")]=[
|
$tbproject["months"][$start->format("Ym")]=[
|
||||||
"monthid"=> $start->format("Ym"),
|
"monthid"=> $start->format("Ym"),
|
||||||
@@ -906,6 +917,7 @@ class ReportController extends AbstractController
|
|||||||
$project=$event->getTask()->getProject();
|
$project=$event->getTask()->getProject();
|
||||||
$idproject=$project->getId();
|
$idproject=$project->getId();
|
||||||
$idservice=$project->getService()->getId();
|
$idservice=$project->getService()->getId();
|
||||||
|
$iddomaine=$project->getDomaine()->getId();
|
||||||
$activeproject=$project->getActive();
|
$activeproject=$project->getActive();
|
||||||
|
|
||||||
// Filtre par Service
|
// Filtre par Service
|
||||||
@@ -914,6 +926,12 @@ class ReportController extends AbstractController
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Filtre par Domaine
|
||||||
|
if($this->get('session')->get('iddomaine')!="all") {
|
||||||
|
if($iddomaine!=$this->get('session')->get('iddomaine'))
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// Filtre par project
|
// Filtre par project
|
||||||
if($this->get('session')->get('idproject')!="all") {
|
if($this->get('session')->get('idproject')!="all") {
|
||||||
if($idproject!=$this->get('session')->get('idproject'))
|
if($idproject!=$this->get('session')->get('idproject'))
|
||||||
@@ -968,6 +986,7 @@ class ReportController extends AbstractController
|
|||||||
$project=$penalty->getTask()->getProject();
|
$project=$penalty->getTask()->getProject();
|
||||||
$idproject=$project->getId();
|
$idproject=$project->getId();
|
||||||
$idservice=$project->getService()->getId();
|
$idservice=$project->getService()->getId();
|
||||||
|
$iddomaine=$project->getDomaine()->getId();
|
||||||
$activeproject=$project->getActive();
|
$activeproject=$project->getActive();
|
||||||
|
|
||||||
// Filtre par Service
|
// Filtre par Service
|
||||||
@@ -976,6 +995,12 @@ class ReportController extends AbstractController
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Filtre par Domaine
|
||||||
|
if($this->get('session')->get('iddomaine')!="all") {
|
||||||
|
if($iddomaine!=$this->get('session')->get('iddomaine'))
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// Filtre par project
|
// Filtre par project
|
||||||
if($this->get('session')->get('idproject')!="all") {
|
if($this->get('session')->get('idproject')!="all") {
|
||||||
if($idproject!=$this->get('session')->get('idproject'))
|
if($idproject!=$this->get('session')->get('idproject'))
|
||||||
|
@@ -25,10 +25,12 @@ class TaskController extends AbstractController
|
|||||||
{
|
{
|
||||||
$em = $this->getDoctrine()->getManager();
|
$em = $this->getDoctrine()->getManager();
|
||||||
$services=$em->getRepository("App:Service")->findAllTaskActive($this->get('session')->get('activeproject'),$this->get('session')->get('idservice'));
|
$services=$em->getRepository("App:Service")->findAllTaskActive($this->get('session')->get('activeproject'),$this->get('session')->get('idservice'));
|
||||||
|
$domaines=$em->getRepository("App:Domaine")->findAllTaskActive($this->get('session')->get('activeproject'),$this->get('session')->get('iddomaine'));
|
||||||
|
|
||||||
if($request->query->get('fgprint')) {
|
if($request->query->get('fgprint')) {
|
||||||
$render = $this->renderView($this->render.'list.html.twig',[
|
$render = $this->renderView($this->render.'list.html.twig',[
|
||||||
"services" => $services,
|
"services" => $services,
|
||||||
|
"domaines" => $domaines,
|
||||||
"useheader" => true,
|
"useheader" => true,
|
||||||
"usesidebar" => true,
|
"usesidebar" => true,
|
||||||
"fgprint" => true,
|
"fgprint" => true,
|
||||||
@@ -42,6 +44,7 @@ class TaskController extends AbstractController
|
|||||||
else {
|
else {
|
||||||
return $this->render($this->render.'list.html.twig',[
|
return $this->render($this->render.'list.html.twig',[
|
||||||
"services" => $services,
|
"services" => $services,
|
||||||
|
"domaines" => $domaines,
|
||||||
"useheader" => true,
|
"useheader" => true,
|
||||||
"usesidebar" => true,
|
"usesidebar" => true,
|
||||||
]);
|
]);
|
||||||
@@ -173,12 +176,11 @@ class TaskController extends AbstractController
|
|||||||
return $this->redirectToRoute($this->route);
|
return $this->redirectToRoute($this->route);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function activeoffer() {
|
public function viewservice() {
|
||||||
$this->get('session')->set('activeoffer',!$this->get('session')->get('activeoffer'));
|
$this->get('session')->set('viewservice',!$this->get('session')->get('viewservice'));
|
||||||
return $this->redirectToRoute($this->route);
|
return $this->redirectToRoute($this->route);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected function getErrorForm($id,$form,$request,$data,$mode) {
|
protected function getErrorForm($id,$form,$request,$data,$mode) {
|
||||||
if ($form->get('submit')->isClicked()&&$mode=="delete") {
|
if ($form->get('submit')->isClicked()&&$mode=="delete") {
|
||||||
}
|
}
|
||||||
|
144
src/schedule-2.0/src/Entity/Domaine.php
Normal file
144
src/schedule-2.0/src/Entity/Domaine.php
Normal file
@@ -0,0 +1,144 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Entity;
|
||||||
|
|
||||||
|
use Doctrine\Common\Collections\ArrayCollection;
|
||||||
|
use Doctrine\Common\Collections\Collection;
|
||||||
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
|
use Symfony\Component\Validator\Constraints as Assert;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Domaine
|
||||||
|
*
|
||||||
|
* @ORM\Table(name="domaine")
|
||||||
|
* @ORM\Entity(repositoryClass="App\Repository\DomaineRepository")
|
||||||
|
*/
|
||||||
|
class Domaine
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @ORM\Column(name="id", type="integer")
|
||||||
|
* @ORM\Id
|
||||||
|
* @ORM\GeneratedValue(strategy="AUTO")
|
||||||
|
*/
|
||||||
|
private $id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ORM\Column(name="name", type="string")
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private $name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ORM\Column(type="text", nullable=true)
|
||||||
|
*/
|
||||||
|
private $description;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ORM\OneToMany(targetEntity="User", mappedBy="domaine", cascade={"persist"}, orphanRemoval=false)
|
||||||
|
*/
|
||||||
|
private $users;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ORM\OneToMany(targetEntity="Project", mappedBy="domaine", cascade={"persist"}, orphanRemoval=false)
|
||||||
|
*/
|
||||||
|
private $projects;
|
||||||
|
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->users = new ArrayCollection();
|
||||||
|
$this->projects = new ArrayCollection();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function getId(): ?int
|
||||||
|
{
|
||||||
|
return $this->id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getName(): ?string
|
||||||
|
{
|
||||||
|
return $this->name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setName(string $name): self
|
||||||
|
{
|
||||||
|
$this->name = $name;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getDescription(): ?string
|
||||||
|
{
|
||||||
|
return $this->description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setDescription(?string $description): self
|
||||||
|
{
|
||||||
|
$this->description = $description;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return Collection|User[]
|
||||||
|
*/
|
||||||
|
public function getUsers(): Collection
|
||||||
|
{
|
||||||
|
return $this->users;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function addUser(User $user): self
|
||||||
|
{
|
||||||
|
if (!$this->users->contains($user)) {
|
||||||
|
$this->users[] = $user;
|
||||||
|
$user->setDomaine($this);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function removeUser(User $user): self
|
||||||
|
{
|
||||||
|
if ($this->users->contains($user)) {
|
||||||
|
$this->users->removeElement($user);
|
||||||
|
// set the owning side to null (unless already changed)
|
||||||
|
if ($user->getDomaine() === $this) {
|
||||||
|
$user->setDomaine(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return Collection|Project[]
|
||||||
|
*/
|
||||||
|
public function getProjects(): Collection
|
||||||
|
{
|
||||||
|
return $this->projects;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function addProject(Project $project): self
|
||||||
|
{
|
||||||
|
if (!$this->projects->contains($project)) {
|
||||||
|
$this->projects[] = $project;
|
||||||
|
$project->setDomaine($this);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function removeProject(Project $project): self
|
||||||
|
{
|
||||||
|
if ($this->projects->contains($project)) {
|
||||||
|
$this->projects->removeElement($project);
|
||||||
|
// set the owning side to null (unless already changed)
|
||||||
|
if ($project->getDomaine() === $this) {
|
||||||
|
$project->setDomaine(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@@ -51,6 +51,11 @@ class Project
|
|||||||
*/
|
*/
|
||||||
private $service;
|
private $service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ORM\ManyToOne(targetEntity="Domaine", inversedBy="projects")
|
||||||
|
*/
|
||||||
|
private $domaine;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ORM\OneToMany(targetEntity="Offer", mappedBy="project", cascade={"persist"}, orphanRemoval=false)
|
* @ORM\OneToMany(targetEntity="Offer", mappedBy="project", cascade={"persist"}, orphanRemoval=false)
|
||||||
*/
|
*/
|
||||||
@@ -242,5 +247,17 @@ class Project
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getDomaine(): ?Domaine
|
||||||
|
{
|
||||||
|
return $this->domaine;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setDomaine(?Domaine $domaine): self
|
||||||
|
{
|
||||||
|
$this->domaine = $domaine;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
58
src/schedule-2.0/src/Form/DomaineType.php
Normal file
58
src/schedule-2.0/src/Form/DomaineType.php
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
<?php
|
||||||
|
namespace App\Form;
|
||||||
|
|
||||||
|
use Symfony\Component\Form\AbstractType;
|
||||||
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
|
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||||
|
use Symfony\Component\Form\Extension\Core\Type\EmailType;
|
||||||
|
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||||
|
use Symfony\Component\Form\Extension\Core\Type\IntegerType;
|
||||||
|
use Symfony\Component\Form\Extension\Core\Type\RepeatedType;
|
||||||
|
use Symfony\Component\Form\Extension\Core\Type\PasswordType;
|
||||||
|
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
|
||||||
|
use Symfony\Component\Form\Extension\Core\Type\ButtonType;
|
||||||
|
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
||||||
|
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||||
|
use FOS\CKEditorBundle\Form\Type\CKEditorType;
|
||||||
|
|
||||||
|
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||||
|
|
||||||
|
|
||||||
|
use Doctrine\ORM\EntityRepository;
|
||||||
|
use Doctrine\ORM\EntityManager;
|
||||||
|
|
||||||
|
class DomaineType extends AbstractType
|
||||||
|
{
|
||||||
|
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||||
|
{
|
||||||
|
$builder->add('submit',
|
||||||
|
SubmitType::class, [
|
||||||
|
"label" => "Valider",
|
||||||
|
"attr" => ["class" => "btn btn-success no-print"],
|
||||||
|
]
|
||||||
|
);
|
||||||
|
|
||||||
|
$builder->add('name',
|
||||||
|
TextType::class, [
|
||||||
|
"label" =>"Nom"
|
||||||
|
]
|
||||||
|
);
|
||||||
|
|
||||||
|
$builder->add('description',
|
||||||
|
CKEditorType::class, [
|
||||||
|
"required" => false,
|
||||||
|
"config" => [
|
||||||
|
'uiColor' => '#ffffff',
|
||||||
|
],
|
||||||
|
]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function configureOptions(OptionsResolver $resolver)
|
||||||
|
{
|
||||||
|
$resolver->setDefaults(array(
|
||||||
|
'data_class' => 'App\Entity\Domaine',
|
||||||
|
'mode' => 'string',
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
@@ -69,11 +69,18 @@ class ProjectType extends AbstractType
|
|||||||
$builder->add('service',
|
$builder->add('service',
|
||||||
EntityType::class, [
|
EntityType::class, [
|
||||||
"class" => "App:Service",
|
"class" => "App:Service",
|
||||||
"label" => "Service",
|
"label" => "Activité",
|
||||||
"choice_label" => "name",
|
"choice_label" => "name",
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$builder->add('domaine',
|
||||||
|
EntityType::class, [
|
||||||
|
"class" => "App:Domaine",
|
||||||
|
"label" => "Domaine",
|
||||||
|
"choice_label" => "name",
|
||||||
|
]
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function configureOptions(OptionsResolver $resolver)
|
public function configureOptions(OptionsResolver $resolver)
|
||||||
|
57
src/schedule-2.0/src/Repository/DomaineRepository.php
Normal file
57
src/schedule-2.0/src/Repository/DomaineRepository.php
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Repository;
|
||||||
|
|
||||||
|
use App\Entity\Domaine;
|
||||||
|
use App\Entity\Project;
|
||||||
|
|
||||||
|
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||||
|
use Doctrine\Common\Persistence\ManagerRegistry;
|
||||||
|
|
||||||
|
class DomaineRepository extends ServiceEntityRepository
|
||||||
|
{
|
||||||
|
public function __construct(ManagerRegistry $registry)
|
||||||
|
{
|
||||||
|
parent::__construct($registry, Domaine::class);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function findAllProjectActive($activeproject,$iddomaine) {
|
||||||
|
$qb = $this->createQueryBuilder('domaine')
|
||||||
|
->from('App:Project','project')
|
||||||
|
->Where('project.active=:activeproject')
|
||||||
|
->andWhere('project.domaine=domaine');
|
||||||
|
|
||||||
|
if($iddomaine!="all")
|
||||||
|
$qb->andWhere("domaine.id=:id")->setParameter('id',$iddomaine);
|
||||||
|
|
||||||
|
return $qb->getQuery()->setParameter('activeproject',$activeproject)->getResult();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function findAllOfferActive($activeproject,$activeoffer,$iddomaine) {
|
||||||
|
$qb = $this->createQueryBuilder('domaine')
|
||||||
|
->from('App:Project','project')
|
||||||
|
->from('App:Offer','offer')
|
||||||
|
->Where('offer.active=:activeoffer')
|
||||||
|
->andWhere('project.active=:activeproject')
|
||||||
|
->andWhere('project.domaine=domaine')
|
||||||
|
->andWhere('offer.project=project');
|
||||||
|
|
||||||
|
if($iddomaine!="all")
|
||||||
|
$qb->andWhere("domaine.id=:id")->setParameter('id',$iddomaine);
|
||||||
|
|
||||||
|
return $qb->getQuery()->setParameter('activeproject',$activeproject)->setParameter('activeoffer',$activeoffer)->getResult();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function findAllTaskActive($activeproject,$iddomaine) {
|
||||||
|
$qb = $this->createQueryBuilder('domaine')
|
||||||
|
->from('App:Project','project')
|
||||||
|
->Where('project.active=:activeproject')
|
||||||
|
->andWhere('project.domaine=domaine');
|
||||||
|
|
||||||
|
if($iddomaine!="all")
|
||||||
|
$qb->andWhere("domaine.id=:id")->setParameter('id',$iddomaine);
|
||||||
|
|
||||||
|
return $qb->getQuery()->setParameter('activeproject',$activeproject)->getResult();
|
||||||
|
}
|
||||||
|
}
|
@@ -71,6 +71,7 @@ class sessionListener {
|
|||||||
$session->set('activeoffer',true);
|
$session->set('activeoffer',true);
|
||||||
$session->set('activeholiday',true);
|
$session->set('activeholiday',true);
|
||||||
$session->set('activetimer',true);
|
$session->set('activetimer',true);
|
||||||
|
$session->set('viewservice',true);
|
||||||
$session->set('nbmonth',3);
|
$session->set('nbmonth',3);
|
||||||
|
|
||||||
if($curentuser!="anon.") {
|
if($curentuser!="anon.") {
|
||||||
@@ -81,11 +82,13 @@ class sessionListener {
|
|||||||
|
|
||||||
$session->set('idproject',"all");
|
$session->set('idproject',"all");
|
||||||
$session->set('idservice',"all");
|
$session->set('idservice',"all");
|
||||||
|
$session->set('iddomaine',"all");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$session->set('iduser',"all");
|
$session->set('iduser',"all");
|
||||||
$session->set('idproject',"all");
|
$session->set('idproject',"all");
|
||||||
$session->set('idservice',"all");
|
$session->set('idservice',"all");
|
||||||
|
$session->set('iddomaine',"all");
|
||||||
}
|
}
|
||||||
|
|
||||||
$tbusers=[];
|
$tbusers=[];
|
||||||
@@ -123,6 +126,17 @@ class sessionListener {
|
|||||||
}
|
}
|
||||||
$session->set('services',$tbservices);
|
$session->set('services',$tbservices);
|
||||||
|
|
||||||
|
$tbdomaines=[];
|
||||||
|
$domaines=$this->em->getRepository('App:Domaine')->findAll();
|
||||||
|
foreach($domaines as $domaine) {
|
||||||
|
$tmp=[
|
||||||
|
"id"=>$domaine->getId(),
|
||||||
|
"name"=>$domaine->getName()
|
||||||
|
];
|
||||||
|
array_push($tbdomaines,$tmp);
|
||||||
|
}
|
||||||
|
$session->set('domaines',$tbdomaines);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
70
src/schedule-2.0/templates/Domaine/edit.html.twig
Executable file
70
src/schedule-2.0/templates/Domaine/edit.html.twig
Executable file
@@ -0,0 +1,70 @@
|
|||||||
|
{% extends 'base.html.twig' %}
|
||||||
|
|
||||||
|
{% block body %}
|
||||||
|
{{ form_start(form) }}
|
||||||
|
<h1 class="page-header">
|
||||||
|
{% if fgprint is defined and fgprint %}
|
||||||
|
DOMAINE
|
||||||
|
{% elseif mode=="update" %}
|
||||||
|
Modification DOMAINE
|
||||||
|
{% elseif mode=="submit" %}
|
||||||
|
Création DOMAINE
|
||||||
|
{% endif %}
|
||||||
|
</h1>
|
||||||
|
|
||||||
|
{{ form_widget(form.submit) }}
|
||||||
|
|
||||||
|
<a class="btn btn-secondary" href={{ path('app_domaine') }}>Annuler</a>
|
||||||
|
|
||||||
|
{% if mode=="update" %}
|
||||||
|
|
||||||
|
<a href="{{ path('app_domaine_delete',{'id':domaine.id}) }}"
|
||||||
|
class="btn btn-danger float-right"
|
||||||
|
data-method="delete"
|
||||||
|
data-confirm="Êtes-vous sûr de vouloir supprimer cet entregistrement ?">
|
||||||
|
Supprimer
|
||||||
|
</a>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
<br><br>
|
||||||
|
|
||||||
|
{% if app.session.flashbag.has('error') %}
|
||||||
|
<div class='alert alert-danger' style='margin: 5px 0px'>
|
||||||
|
<strong>Erreur</strong><br>
|
||||||
|
{% for flashMessage in app.session.flashbag.get('error') %}
|
||||||
|
{{ flashMessage }}<br>
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if app.session.flashbag.has('notice') %}
|
||||||
|
<div class='alert alert-info' style='margin: 5px 0px'>
|
||||||
|
<strong>Information</strong><br>
|
||||||
|
{% for flashMessage in app.session.flashbag.get('notice') %}
|
||||||
|
{{ flashMessage }}<br>
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-header">
|
||||||
|
<i class="fa fa-pencil-alt fa-fw"></i> Informations
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="card-body">
|
||||||
|
{{ form_row(form.name) }}
|
||||||
|
{{ form_row(form.description) }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{{ form_end(form) }}
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block localjavascript %}
|
||||||
|
$(document).ready(function() {
|
||||||
|
$("#domaine_name").focus();
|
||||||
|
});
|
||||||
|
|
||||||
|
function myprint() {
|
||||||
|
href=document.location.href;
|
||||||
|
document.location.href=href+"?fgprint=true";
|
||||||
|
}
|
||||||
|
{% endblock %}
|
70
src/schedule-2.0/templates/Domaine/list.html.twig
Normal file
70
src/schedule-2.0/templates/Domaine/list.html.twig
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
{% extends "base.html.twig" %}
|
||||||
|
{% block localstyle %}
|
||||||
|
{% if fgprint is defined and fgprint %}
|
||||||
|
table { font-size:10px;}
|
||||||
|
th,td {
|
||||||
|
border: 1px solid #37474F;
|
||||||
|
}
|
||||||
|
thead {
|
||||||
|
display: table-header-group;
|
||||||
|
}
|
||||||
|
tr { page-break-inside: avoid; }
|
||||||
|
{%endif%}
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block body %}
|
||||||
|
<h1 class="page-header">
|
||||||
|
DOMAINES
|
||||||
|
</h1>
|
||||||
|
|
||||||
|
<p><a class="btn btn-success" href={{ path('app_domaine_submit') }}>Ajouter</a></p>
|
||||||
|
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-header">
|
||||||
|
<i class="fa fa-table fa-fw"></i> Liste des Domaines
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="card-body">
|
||||||
|
<div class="dataTable_wrapper">
|
||||||
|
<table class="table table-striped table-bordered table-hover" id="dataTables" style="width:100%">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th width="70px" class="no-sort no-print">Action</th>
|
||||||
|
<th>Nom</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{% for domaine in domaines %}
|
||||||
|
<tr>
|
||||||
|
<td class="no-print">
|
||||||
|
<a href="{{path("app_domaine_update",{id:domaine.id})}}"><i class="fa fa-file"></i></a>
|
||||||
|
</td>
|
||||||
|
<td>{{domaine.name}}</td>
|
||||||
|
</tr>
|
||||||
|
{% endfor %}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block localjavascript %}
|
||||||
|
$(document).ready(function() {
|
||||||
|
{% if not fgprint is defined or not fgprint %}
|
||||||
|
$('#dataTables').DataTable({
|
||||||
|
columnDefs: [ { "targets": "no-sort", "orderable": false }, { "targets": "no-string", "type" : "num" } ],
|
||||||
|
responsive: true,
|
||||||
|
iDisplayLength: 100,
|
||||||
|
order: [[ 1, "asc" ]]
|
||||||
|
});
|
||||||
|
{%else%}
|
||||||
|
$('#dataTables').removeClass("table table-striped table-bordered table-hover small dataTable no-footer");
|
||||||
|
{% endif %}
|
||||||
|
});
|
||||||
|
|
||||||
|
function myprint() {
|
||||||
|
href=document.location.href;
|
||||||
|
document.location.href=href+"?fgprint=true";
|
||||||
|
}
|
||||||
|
{% endblock %}
|
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
{% block body %}
|
{% block body %}
|
||||||
<h1 class="page-header">
|
<h1 class="page-header">
|
||||||
COMMANDES
|
COMMANDES {% if app.session.get('viewservice') %}PAR ACTVITE{%else%}PAR DOMAINE{%endif%}
|
||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
<a class="btn btn-success" href={{ path('app_offer_submit') }}>Ajouter</a>
|
<a class="btn btn-success" href={{ path('app_offer_submit') }}>Ajouter</a>
|
||||||
@@ -36,13 +36,28 @@
|
|||||||
<label class="custom-control-label" for="switchactiveoffer">Proposition Active</label>
|
<label class="custom-control-label" for="switchactiveoffer">Proposition Active</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="custom-control custom-switch float-right mr-3">
|
||||||
|
<input type="checkbox" class="custom-control-input" id="switchservice" {% if app.session.get('viewservice') %} checked {% endif %}>
|
||||||
|
{% if app.session.get('viewservice') %}
|
||||||
|
<label class="custom-control-label" for="switchservice">Vue par Activité</label>
|
||||||
|
{% else %}
|
||||||
|
<label class="custom-control-label" for="switchservice">Vue par Domaine</label>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
|
||||||
<p></p>
|
<p></p>
|
||||||
|
|
||||||
{%for service in services %}
|
{% if app.session.get('viewservice') %}
|
||||||
{% if not service.projects is empty %}
|
{% set loop01s=services %}
|
||||||
|
{% else %}
|
||||||
|
{% set loop01s=domaines %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{%for loop01 in loop01s %}
|
||||||
|
{% if not loop01.projects is empty %}
|
||||||
{% set haveoffer=false %}
|
{% set haveoffer=false %}
|
||||||
{% set haveproject=false %}
|
{% set haveproject=false %}
|
||||||
{% for project in service.projects %}
|
{% for project in loop01.projects %}
|
||||||
{% if app.session.get('activeproject')==project.active and (app.session.get('idproject')=="all" or app.session.get('idproject')==project.id) %}
|
{% if app.session.get('activeproject')==project.active and (app.session.get('idproject')=="all" or app.session.get('idproject')==project.id) %}
|
||||||
{% for offer in project.offers %}
|
{% for offer in project.offers %}
|
||||||
{% if app.session.get('activeoffer')==offer.active %}
|
{% if app.session.get('activeoffer')==offer.active %}
|
||||||
@@ -57,7 +72,7 @@
|
|||||||
{% if haveoffer and haveproject %}
|
{% if haveoffer and haveproject %}
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<i class="fa fa-table fa-fw"></i> {{ service.name }}
|
<i class="fa fa-table fa-fw"></i> {{ loop01.name }}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
@@ -76,7 +91,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{% for project in service.projects %}
|
{% for project in loop01.projects %}
|
||||||
{% if app.session.get('activeproject')==project.active and (app.session.get('idproject')=="all" or app.session.get('idproject')==project.id) %}
|
{% if app.session.get('activeproject')==project.active and (app.session.get('idproject')=="all" or app.session.get('idproject')==project.id) %}
|
||||||
{% for offer in project.offers %}
|
{% for offer in project.offers %}
|
||||||
{% if app.session.get('activeoffer')==offer.active %}
|
{% if app.session.get('activeoffer')==offer.active %}
|
||||||
@@ -139,4 +154,7 @@
|
|||||||
window.location="{{ path('app_offer_activeoffer' )}}";
|
window.location="{{ path('app_offer_activeoffer' )}}";
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('#switchservice').change(function() {
|
||||||
|
window.location="{{ path('app_offer_viewservice' )}}";
|
||||||
|
});
|
||||||
{% endblock %}
|
{% endblock %}
|
@@ -56,6 +56,7 @@
|
|||||||
{{ form_row(form.customer) }}
|
{{ form_row(form.customer) }}
|
||||||
{{ form_row(form.visible) }}
|
{{ form_row(form.visible) }}
|
||||||
{{ form_row(form.service) }}
|
{{ form_row(form.service) }}
|
||||||
|
{{ form_row(form.domaine) }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{ form_end(form) }}
|
{{ form_end(form) }}
|
||||||
|
@@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
{% block body %}
|
{% block body %}
|
||||||
<h1 class="page-header">
|
<h1 class="page-header">
|
||||||
PROJETS
|
PROJETS {% if app.session.get('viewservice') %} PAR ACTVITE{%else%} PAR DOMAINE{%endif%}
|
||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
<a class="btn btn-success" href={{ path('app_project_submit') }}>Ajouter</a>
|
<a class="btn btn-success" href={{ path('app_project_submit') }}>Ajouter</a>
|
||||||
@@ -29,13 +29,28 @@
|
|||||||
<label class="custom-control-label" for="switchactive">Projet Actif</label>
|
<label class="custom-control-label" for="switchactive">Projet Actif</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="custom-control custom-switch float-right mr-3">
|
||||||
|
<input type="checkbox" class="custom-control-input" id="switchservice" {% if app.session.get('viewservice') %} checked {% endif %}>
|
||||||
|
{% if app.session.get('viewservice') %}
|
||||||
|
<label class="custom-control-label" for="switchservice">Vue par Activité</label>
|
||||||
|
{% else %}
|
||||||
|
<label class="custom-control-label" for="switchservice">Vue par Domaine</label>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
|
||||||
<p></p>
|
<p></p>
|
||||||
|
|
||||||
{%for service in services %}
|
{% if app.session.get('viewservice') %}
|
||||||
{% if not service.projects is empty %}
|
{% set loop01s=services %}
|
||||||
|
{% else %}
|
||||||
|
{% set loop01s=domaines %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{%for loop01 in loop01s %}
|
||||||
|
{% if not loop01.projects is empty %}
|
||||||
{% set haveproject=false %}
|
{% set haveproject=false %}
|
||||||
|
|
||||||
{% for project in service.projects %}
|
{% for project in loop01.projects %}
|
||||||
{% if app.session.get('activeproject')==project.active and (app.session.get('idproject')=="all" or app.session.get('idproject')==project.id) %}
|
{% if app.session.get('activeproject')==project.active and (app.session.get('idproject')=="all" or app.session.get('idproject')==project.id) %}
|
||||||
{% set haveproject=true %}
|
{% set haveproject=true %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@@ -44,7 +59,7 @@
|
|||||||
{% if haveproject %}
|
{% if haveproject %}
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<i class="fa fa-table fa-fw"></i> {{ service.name }}
|
<i class="fa fa-table fa-fw"></i> {{ loop01.name }}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
@@ -53,8 +68,9 @@
|
|||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th width="70px" class="no-sort no-print">Action</th>
|
<th width="70px" class="no-sort no-print">Action</th>
|
||||||
<th width="300px">Client</th>
|
<th width="200px">Client</th>
|
||||||
<th>Nom</th>
|
<th>Nom</th>
|
||||||
|
<th width="200px">{% if app.session.get('viewservice') %}Domaine{%else%}Activité{%endif%}</th>
|
||||||
<th width="100px" class="text-center no-string">Estimé</th>
|
<th width="100px" class="text-center no-string">Estimé</th>
|
||||||
<th width="100px" class="text-center no-string">Commandé</th>
|
<th width="100px" class="text-center no-string">Commandé</th>
|
||||||
<th width="100px" class="text-center no-string">Validé</th>
|
<th width="100px" class="text-center no-string">Validé</th>
|
||||||
@@ -64,7 +80,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{% for project in service.projects %}
|
{% for project in loop01.projects %}
|
||||||
{% if app.session.get('activeproject')==project.active and (app.session.get('idproject')=="all" or app.session.get('idproject')==project.id) %}
|
{% if app.session.get('activeproject')==project.active and (app.session.get('idproject')=="all" or app.session.get('idproject')==project.id) %}
|
||||||
<tr>
|
<tr>
|
||||||
<td class="no-print">
|
<td class="no-print">
|
||||||
@@ -79,6 +95,7 @@
|
|||||||
</td>
|
</td>
|
||||||
<td>{{project.customer.name}}</td>
|
<td>{{project.customer.name}}</td>
|
||||||
<td>{{project.name}}</td>
|
<td>{{project.name}}</td>
|
||||||
|
<td>{% if app.session.get('viewservice') %}{%if not project.domaine is empty %}{{project.domaine.name}}{%endif%}{%else%}{{project.service.name}}{%endif%}</td>
|
||||||
<td class="text-right">
|
<td class="text-right">
|
||||||
{% set tottask=0 %}
|
{% set tottask=0 %}
|
||||||
{% set totvalidate=0 %}
|
{% set totvalidate=0 %}
|
||||||
@@ -155,6 +172,10 @@
|
|||||||
window.location="{{ path('app_project_activeproject' )}}";
|
window.location="{{ path('app_project_activeproject' )}}";
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('#switchservice').change(function() {
|
||||||
|
window.location="{{ path('app_project_viewservice' )}}";
|
||||||
|
});
|
||||||
|
|
||||||
function myprint() {
|
function myprint() {
|
||||||
href=document.location.href;
|
href=document.location.href;
|
||||||
document.location.href=href+"?fgprint=true";
|
document.location.href=href+"?fgprint=true";
|
||||||
|
@@ -7,7 +7,7 @@ STATISTIQUES
|
|||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-12">
|
<div class="col-md-12 mb-4">
|
||||||
<div class="card homecard" style="width: 100%; height: 520px;">
|
<div class="card homecard" style="width: 100%; height: 520px;">
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
CADOLES
|
CADOLES
|
||||||
|
@@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
{% block body %}
|
{% block body %}
|
||||||
<h1 class="page-header">
|
<h1 class="page-header">
|
||||||
TACHES
|
TACHES {% if app.session.get('viewservice') %}PAR ACTVITE{%else%}PAR DOMAINE{%endif%}
|
||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
<a class="btn btn-success" href={{ path('app_task_submit') }}>Ajouter</a>
|
<a class="btn btn-success" href={{ path('app_task_submit') }}>Ajouter</a>
|
||||||
@@ -35,14 +35,29 @@
|
|||||||
<label class="custom-control-label" for="switchactivetask">Tâche Active</label>
|
<label class="custom-control-label" for="switchactivetask">Tâche Active</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="custom-control custom-switch float-right mr-3">
|
||||||
|
<input type="checkbox" class="custom-control-input" id="switchservice" {% if app.session.get('viewservice') %} checked {% endif %}>
|
||||||
|
{% if app.session.get('viewservice') %}
|
||||||
|
<label class="custom-control-label" for="switchservice">Vue par Activité</label>
|
||||||
|
{% else %}
|
||||||
|
<label class="custom-control-label" for="switchservice">Vue par Domaine</label>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
|
||||||
<p></p>
|
<p></p>
|
||||||
|
|
||||||
{%for service in services %}
|
{% if app.session.get('viewservice') %}
|
||||||
{% if not service.projects is empty %}
|
{% set loop01s=services %}
|
||||||
|
{% else %}
|
||||||
|
{% set loop01s=domaines %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{%for loop01 in loop01s %}
|
||||||
|
{% if not loop01.projects is empty %}
|
||||||
{% set havetask=false %}
|
{% set havetask=false %}
|
||||||
{% set haveproject=false %}
|
{% set haveproject=false %}
|
||||||
|
|
||||||
{% for project in service.projects %}
|
{% for project in loop01.projects %}
|
||||||
{% if app.session.get('activeproject')==project.active and (app.session.get('idproject')=="all" or app.session.get('idproject')==project.id) %}
|
{% if app.session.get('activeproject')==project.active and (app.session.get('idproject')=="all" or app.session.get('idproject')==project.id) %}
|
||||||
{% if not project.tasks is empty %}
|
{% if not project.tasks is empty %}
|
||||||
{% set havetask=true %}
|
{% set havetask=true %}
|
||||||
@@ -55,7 +70,7 @@
|
|||||||
{% if haveproject and havetask %}
|
{% if haveproject and havetask %}
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<i class="fa fa-table fa-fw"></i> {{ service.name }}
|
<i class="fa fa-table fa-fw"></i> {{ loop01.name }}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
@@ -77,7 +92,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{% for project in service.projects %}
|
{% for project in loop01.projects %}
|
||||||
{% if app.session.get('activeproject')==project.active and (app.session.get('idproject')=="all" or app.session.get('idproject')==project.id) %}
|
{% if app.session.get('activeproject')==project.active and (app.session.get('idproject')=="all" or app.session.get('idproject')==project.id) %}
|
||||||
{% for task in project.tasks %}
|
{% for task in project.tasks %}
|
||||||
{% if app.session.get('activetask')==task.active %}
|
{% if app.session.get('activetask')==task.active %}
|
||||||
@@ -145,10 +160,14 @@
|
|||||||
$('#switchactive').change(function() {
|
$('#switchactive').change(function() {
|
||||||
window.location="{{ path('app_task_activeproject' )}}";
|
window.location="{{ path('app_task_activeproject' )}}";
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#switchactivetask').change(function() {
|
$('#switchactivetask').change(function() {
|
||||||
window.location="{{ path('app_task_activetask' )}}";
|
window.location="{{ path('app_task_activetask' )}}";
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('#switchservice').change(function() {
|
||||||
|
window.location="{{ path('app_task_viewservice' )}}";
|
||||||
|
});
|
||||||
|
|
||||||
function myprint() {
|
function myprint() {
|
||||||
href=document.location.href;
|
href=document.location.href;
|
||||||
|
@@ -292,7 +292,21 @@
|
|||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<label class="control-label" style="padding:0px 10px 5px 10px; color:#fff;">
|
||||||
|
Domaine
|
||||||
|
</label>
|
||||||
|
<div class="select-control">
|
||||||
|
<select class="form-control select2entity" id="sidedomaine" name="sidedomaine">
|
||||||
|
<option value="all" selected>Toutes les domaines</option>
|
||||||
|
{% for domaine in app.session.get('domaines') %}
|
||||||
|
{% set selected="" %}
|
||||||
|
{%if domaine.id==app.session.get('iddomaine') %}
|
||||||
|
{% set selected="selected" %}
|
||||||
|
{% endif %}
|
||||||
|
<option value="{{domaine.id}}" {{selected}}>{{domaine.name}}</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
<label class="control-label" style="padding:0px 10px 5px 10px; color:#fff;">
|
<label class="control-label" style="padding:0px 10px 5px 10px; color:#fff;">
|
||||||
Intervenant
|
Intervenant
|
||||||
@@ -442,6 +456,12 @@
|
|||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="{{path("app_domaine")}}">
|
||||||
|
<i class="fas fa-money-bill-alt"></i> Domaines
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
<li>
|
<li>
|
||||||
<a href="{{path("app_user")}}">
|
<a href="{{path("app_user")}}">
|
||||||
<i class="fa fa-users"></i>Utilisateurs
|
<i class="fa fa-users"></i>Utilisateurs
|
||||||
@@ -554,6 +574,20 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('#sidedomaine').on('select2:select', function (e) {
|
||||||
|
var data = e.params.data;
|
||||||
|
$.ajax({
|
||||||
|
type: "POST",
|
||||||
|
data: {
|
||||||
|
iddomaine: data.id,
|
||||||
|
},
|
||||||
|
url: "{{ path('app_home_selectdomaine') }}",
|
||||||
|
success: function (response) {
|
||||||
|
location.reload();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
Reference in New Issue
Block a user