diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/ItemController.php b/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/ItemController.php index 759b2c3b..7527ba8d 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/ItemController.php +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/ItemController.php @@ -71,7 +71,8 @@ class ItemController extends Controller "mode" => "submit", "labelniveau01" => $this->GetParameter("labelsniveau01"), "ssosynchroitem" => $this->GetParameter("ssosynchroitem"), - "user_attr_cas_item" => $this->GetParameter("user_attr_cas_item") + "user_attr_cas_item" => $this->GetParameter("user_attr_cas_item"), + "activate_widsonde" => $this->GetParameter("activate_widsonde"), )); // Récupération des data du formulaire @@ -122,7 +123,8 @@ class ItemController extends Controller "idicon" => ($data->getIcon()?$data->getIcon()->getId():null), "labelniveau01" => $this->GetParameter("labelsniveau01"), "ssosynchroitem" => $this->GetParameter("ssosynchroitem"), - "user_attr_cas_item" => $this->GetParameter("user_attr_cas_item") + "user_attr_cas_item" => $this->GetParameter("user_attr_cas_item"), + "activate_widsonde" => $this->GetParameter("activate_widsonde"), )); // Récupération des data du formulaire @@ -230,6 +232,13 @@ class ItemController extends Controller if ($form->get('submit')->isClicked() && $mode=="submit") { } + if ($form->get('submit')->isClicked() && ($mode=="submit" || $mode=="update")) { + // si clicksonde alors clicksondeservice obligatoire + if ($data->getClicksonde() && !$data->getClicksondeservice()) { + $form->addError(new FormError('Type de service sur le click sonde est obligatoire')); + } + } + if ($form->get('submit')->isClicked() && !$form->isValid()) { $this->get('session')->getFlashBag()->clear(); $validator = $this->get('validator'); diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Entity/Item.php b/src/ninegate-1.0/src/Cadoles/PortalBundle/Entity/Item.php index a73b7a52..13e97afc 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Entity/Item.php +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Entity/Item.php @@ -122,6 +122,20 @@ class Item */ private $icon; + /** + * @var boolean + * + * @ORM\Column(name="clicksonde", type="boolean", nullable=true, options={"default":false}) + */ + private $clicksonde = false; + + /** + * @var boolean + * + * @ORM\Column(name="clicksondeservice", type="string", nullable=true) + */ + private $clicksondeservice; + /** * @var ArrayCollection $bookmark * @var Bookmark @@ -681,4 +695,52 @@ class Item { return $this->badgeurl; } + + /** + * Set clicksonde + * + * @param boolean $clicksonde + * + * @return Item + */ + public function setClicksonde($clicksonde) + { + $this->clicksonde = $clicksonde; + + return $this; + } + + /** + * Get clicksonde + * + * @return boolean + */ + public function getClicksonde() + { + return $this->clicksonde; + } + + /** + * Set clicksondeservice + * + * @param string $clicksondeservice + * + * @return Item + */ + public function setClicksondeservice($clicksondeservice) + { + $this->clicksondeservice = $clicksondeservice; + + return $this; + } + + /** + * Get clicksondeservice + * + * @return string + */ + public function getClicksondeservice() + { + return $this->clicksondeservice; + } } diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Form/ItemType.php b/src/ninegate-1.0/src/Cadoles/PortalBundle/Form/ItemType.php index 5ed44e62..45a675dd 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Form/ItemType.php +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Form/ItemType.php @@ -146,6 +146,51 @@ class ItemType extends AbstractType "disabled" => ($options["mode"]=="delete"?true:false), ]); } + + + if($options["activate_widsonde"]) { + $builder + ->add('clicksonde', CheckboxType::class, [ + "label" => "Exécuter une sonde statistique sur le click", + "required" => false + ]) + + ->add('clicksondeservice', ChoiceType::class, [ + "label" => 'Type de Service associé à la sonde', + "placeholder" => 'Selectionner un service', + "required" => false, + "choices" => [ + "ACCUEIL" => "ACCUEIL", + "ACTUALITES" => "ACTUALITES", + "CAHIER TEXTES" => "CAHIER_TEXTES", + "CAHIER LIAISON" => "CAHIER_LIAISON", + "COURRIER ELECTRONIQUE" => "COURRIER_ELECTRONIQUE", + "MESSAGERIE INSTANTANEE" => "MESSAGERIE_INSTANTANEE", + "VISIOCONFERENCE" => "VISIOCONFERENCE", + "STOCKAGE PARTAGE" => "STOCKAGE_PARTAGE", + "PRODUCTION COLLABORATIVE" => "PRODUCTION_COLLABORATIVE", + "DOCUMENTATION CDI" => "DOCUMENTATION_CDI", + "PARCOURS PEDAGOGIQUE" => "PARCOURS_PEDAGOGIQUE", + "RESERVATION SALLES MATERIELS" => "RESERVATION_SALLES_MATERIELS", + "SERVICE COLLECTIVITE" => "SERVICE_COLLECTIVITE", + "SERVICES VIE SCOLAIRE" => "SERVICES_VIE_SCOLAIRE", + "GESTION TEMPS" => "GESTION_TEMPS", + "ABSENCES" => "ABSENCES", + "GESTION COMPETENCES" => "GESTION_COMPETENCES", + "NOTES" => "NOTES", + "MANUEL NUMERIQUE" => "MANUEL_NUMERIQUE", + "RESSOURCE MULTIMEDIA" => "RESSOURCE_MULTIMEDIA", + "RESSOURCE ORIENTATION" => "RESSOURCE_ORIENTATION", + "RESSOURCE PRODUCTION" => "RESSOURCE_PRODUCTION", + "RESSOURCE ACCOMPAGNEMENT ENTRAINEMENT" => "RESSOURCE_ACCOMPAGNEMENT_ENTRAINEMENT", + "RESSOURCE REFERENCE DICTIONNAIRE" => "RESSOURCE_REFERENCE_DICTIONNAIRE", + "RESSOURCE DOCUMENTAIRE" => "RESSOURCE_DOCUMENTAIRE", + "PAGE ENT" => "PAGE_ENT", + ], + "disabled" => ($options["mode"]=="delete"?true:false), + ]); + + } } public function configureOptions(OptionsResolver $resolver) @@ -157,6 +202,7 @@ class ItemType extends AbstractType 'labelniveau01' => "string", 'ssosynchroitem' => "string", 'user_attr_cas_item' => "string", + "activate_widsonde" => "string", ]); } } diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Item/edit.html.twig b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Item/edit.html.twig index fef787b4..5e012200 100755 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Item/edit.html.twig +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Item/edit.html.twig @@ -67,6 +67,13 @@ {{ form_row(form.ssoitem) }} {% endif %} + {% if form.clicksonde is defined %} + {{ form_row(form.clicksonde) }} +
+ {{ form_row(form.clicksondeservice) }} +
+ {% endif %} + {{ form_row(form.color) }}
@@ -94,6 +101,10 @@ showhide(); }); + $('#item_clicksonde').change(function() { + showhide(); + }); + function selIcon(idicon,label) { $("#item_idicon").val(idicon); $("#diviconsel img").remove(); @@ -122,5 +133,13 @@ if($("#item_target").val()=="frame") { $("#divhelp").show(); } + + + if($("#item_clicksonde").is(':checked')) { + $("#divclicksondeservice").show(); + } + else { + $("#divclicksondeservice").hide(); + } } {% endblock %} diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Page/application.html.twig b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Page/application.html.twig index c8657b67..b2e6d1c3 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Page/application.html.twig +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Page/application.html.twig @@ -25,12 +25,17 @@
+ {% set datasonde = "" %} + {% if bookmark.item and bookmark.item.clicksonde %} + {% set datasonde = "class='linktosonde' data-sondetitle='"~bookmark.item.title~"' data-sondeservice='"~bookmark.item.clicksondeservice~"'" %} + {% endif %} + {% if bookmark.target == 'frame' %} - + {% elseif bookmark.target == "_self" %} - + {% else %} - + {% endif %}