Merge branch 'master' into dist/envole/6/master

This commit is contained in:
Arnaud Fornerot 2020-06-22 13:32:50 +02:00
commit e03af01666
12 changed files with 158 additions and 96 deletions

View File

@ -179,7 +179,9 @@ class GroupController extends Controller
} }
else { else {
$fgproprio=($user==$data->getOwner()); $fgproprio=($user==$data->getOwner());
$fgmanager=$this->getDoctrine()->getRepository("CadolesCoreBundle:UserGroup")->findOneBy(["user"=>$this->getUser(),"group"=>$data])->getFgmanager(); $fgmanager=false;
$usergroup=$this->getDoctrine()->getRepository("CadolesCoreBundle:UserGroup")->findOneBy(["user"=>$this->getUser(),"group"=>$data]);
if($usergroup) $fgmanager=$usergroup->getFgmanager();
// Modification possible uniquement si l'utilisateur est propriétaire du groupe // Modification possible uniquement si l'utilisateur est propriétaire du groupe
if($fgproprio) { if($fgproprio) {
@ -570,7 +572,7 @@ class GroupController extends Controller
"body_text"=>$text "body_text"=>$text
); );
$to = $user->getEmail(); $to = $user->getEmail();
$from = $this->getParameter('noreply');; $from = $this->getParameter('noreply');
$fromName = $this->get('session')->get('appname'); $fromName = $this->get('session')->get('appname');
$message = $this->container->get('cadoles.core.service.mail'); $message = $this->container->get('cadoles.core.service.mail');
$message->sendEmail($template, $mail_params, $to, $from, $fromName); $message->sendEmail($template, $mail_params, $to, $from, $fromName);
@ -750,7 +752,7 @@ class GroupController extends Controller
$form->handleRequest($request); $form->handleRequest($request);
// Sur erreur // Sur erreur
$this->getErrorForm(null,$form,$request,$data,"submit"); $this->getErrorForm(null,$form,$request,$data,"submit",$access);
// Sur validation // Sur validation
if ($form->get('submit')->isClicked() && $form->isValid()) { if ($form->get('submit')->isClicked() && $form->isValid()) {
@ -804,6 +806,8 @@ class GroupController extends Controller
// Récupération de l'enregistrement courant // Récupération de l'enregistrement courant
$em = $this->getDoctrine()->getManager(); $em = $this->getDoctrine()->getManager();
$data=$this->getData($id); $data=$this->getData($id);
$oldowner=$data->getOwner();
$this->canOwner($data,$access); $this->canOwner($data,$access);
// Création du formulaire // Création du formulaire
@ -822,7 +826,7 @@ class GroupController extends Controller
$form->handleRequest($request); $form->handleRequest($request);
// Sur erreur // Sur erreur
$this->getErrorForm($id,$form,$request,$data,"update"); $this->getErrorForm($id,$form,$request,$data,"update",$access);
// Sur validation // Sur validation
if ($form->get('submit')->isClicked() && $form->isValid()) { if ($form->get('submit')->isClicked() && $form->isValid()) {
@ -850,6 +854,23 @@ class GroupController extends Controller
// Sinon on les génère // Sinon on les génère
$this->ctrlFgcanshare($data,$access); $this->ctrlFgcanshare($data,$access);
// Si le propriétaire change de main on prévient le nouveau propriétaire
if($data->getOwner()&&$data->getOwner()!=$oldowner) {
// Email à destination de l'inscript pour le prévenir qu'un administrateur doit valider
$text="On vient de vous tranférer la propriété du groupe ".$data->getLabel();
$template="template";
$mail_params=array(
"subject" => $this->get('session')->get('appname')." : Transfert de groupe",
"body_html"=>nl2br($text),
"body_text"=>$text
);
$to = $data->getOwner()->getEmail();
$from = $this->getParameter('noreply');
$fromName = $this->get('session')->get('appname');
$message = $this->container->get('cadoles.core.service.mail');
$message->sendEmail($template, $mail_params, $to, $from, $fromName);
}
// Retour à la liste // Retour à la liste
return $this->redirectToRoute("cadoles_core_".$access."_group"); return $this->redirectToRoute("cadoles_core_".$access."_group");
} }
@ -901,7 +922,7 @@ class GroupController extends Controller
$form->handleRequest($request); $form->handleRequest($request);
// Sur erreur // Sur erreur
$this->getErrorForm($id,$form,$request,$data,"delete"); $this->getErrorForm($id,$form,$request,$data,"delete",$access);
// Sur validation // Sur validation
if ($form->get('submit')->isClicked() && $form->isValid()) { if ($form->get('submit')->isClicked() && $form->isValid()) {
@ -1163,6 +1184,11 @@ class GroupController extends Controller
} }
$pages=$group->getPages(); $pages=$group->getPages();
$this->idpage=$pages[0]->getId(); $this->idpage=$pages[0]->getId();
if($pages[0]->getName()!=$group->getLabel()) {
$pages[0]->setName($group->getLabel());
$em->persist($pages[0]);
$em->flush();
}
// On regarde s'il a au moins un calendrier // On regarde s'il a au moins un calendrier
if($group->getCalendars()->isEmpty()) { if($group->getCalendars()->isEmpty()) {
@ -1179,6 +1205,14 @@ class GroupController extends Controller
$em->persist($calendar); $em->persist($calendar);
$em->flush(); $em->flush();
} }
else {
$calendars=$group->getCalendars();
if($calendars[0]->getName()!=$group->getLabel()) {
$calendars[0]->setName($group->getLabel());
$em->persist($calendars[0]);
$em->flush();
}
}
// On regarde s'il a au moins un blog // On regarde s'il a au moins un blog
if($group->getBlogs()->isEmpty()) { if($group->getBlogs()->isEmpty()) {
@ -1190,7 +1224,15 @@ class GroupController extends Controller
$em->persist($blog); $em->persist($blog);
$em->flush(); $em->flush();
} }
else {
$blogs=$group->getBlogs();
if($blogs[0]->getName()!=$group->getLabel()) {
$blogs[0]->setName($group->getLabel());
$em->persist($blogs[0]);
$em->flush();
}
}
// On regarde s'il a au moins un project // On regarde s'il a au moins un project
if($group->getProjects()->isEmpty()) { if($group->getProjects()->isEmpty()) {
@ -1202,7 +1244,15 @@ class GroupController extends Controller
$em->persist($project); $em->persist($project);
$em->flush(); $em->flush();
} }
else {
$projects=$group->getProjects();
if($projects[0]->getName()!=$group->getLabel()) {
$projects[0]->setName($group->getLabel());
$em->persist($projects[0]);
$em->flush();
}
}
} }
} }
@ -1239,7 +1289,7 @@ class GroupController extends Controller
else return true; else return true;
} }
protected function getErrorForm($id,$form,$request,$data,$mode) { protected function getErrorForm($id,$form,$request,$data,$mode,$access) {
if ($form->get('submit')->isClicked()&&$mode=="delete") { if ($form->get('submit')->isClicked()&&$mode=="delete") {
} }
@ -1262,6 +1312,10 @@ class GroupController extends Controller
$form->addError(new FormError("Un groupe de travail doit avoir un modèle de page d'accueil")); $form->addError(new FormError("Un groupe de travail doit avoir un modèle de page d'accueil"));
} }
if ($form->get('submit')->isClicked() && $mode=="update" && $access=="user") {
if(!$data->getOwner()) $form->addError(new FormError('Le propriétaire du groupe est obligatoire'));
}
if ($form->get('submit')->isClicked() && !$form->isValid()) { if ($form->get('submit')->isClicked() && !$form->isValid()) {
$this->get('session')->getFlashBag()->clear(); $this->get('session')->getFlashBag()->clear();
$validator = $this->get('validator'); $validator = $this->get('validator');

View File

@ -58,26 +58,28 @@ class GroupType extends AbstractType
"attr" => array("class" => "form-control", "style" => "margin-bottom:15px","readonly" => ($options["mode"]=="delete"?true:false)) "attr" => array("class" => "form-control", "style" => "margin-bottom:15px","readonly" => ($options["mode"]=="delete"?true:false))
]); ]);
$builder->add('owner', if($options["access"]=="config" || $options["mode"] == "update") {
Select2EntityType::class, array( $builder->add('owner',
'label' => "Propriétaire", Select2EntityType::class, array(
'disabled' => ($options["mode"]=="delete"?true:false), 'label' => "Propriétaire",
"required" => false, 'disabled' => ($options["mode"]=="delete"?true:false),
'multiple' => false, "required" => false,
'remote_route' => 'cadoles_core_config_user_ajax_selectlist', 'multiple' => false,
'class' => 'Cadoles\coreBundle\Entity\User', 'remote_route' => 'cadoles_core_'.$options["access"].'_user_ajax_selectlist',
'primary_key' => 'id', 'class' => 'Cadoles\coreBundle\Entity\User',
'text_property' => 'username', 'primary_key' => 'id',
'minimum_input_length' => 2, 'text_property' => 'username',
'page_limit' => 10, 'minimum_input_length' => 2,
'allow_clear' => true, 'page_limit' => 10,
'delay' => 250, 'allow_clear' => true,
'cache' => false, 'delay' => 250,
'cache_timeout' => 60000, // if 'cache' is true 'cache' => false,
'language' => 'fr', 'cache_timeout' => 60000, // if 'cache' is true
'placeholder' => 'Selectionner un propriétaire', 'language' => 'fr',
'attr' => array("class" => "form-control", "style" => "margin-bottom:15px") 'placeholder' => 'Selectionner un propriétaire',
)); 'attr' => array("class" => "form-control", "style" => "margin-bottom:15px")
));
}
} }
if($options["access"]=="config") { if($options["access"]=="config") {

View File

@ -286,6 +286,10 @@ cadoles_core_user_user_ajax_list:
path: /user/user/ajax/list path: /user/user/ajax/list
defaults: { _controller: CadolesCoreBundle:User:ajaxlist, access: user } defaults: { _controller: CadolesCoreBundle:User:ajaxlist, access: user }
cadoles_core_user_user_ajax_selectlist:
path: /user/user/ajax/selectlist
defaults: { _controller: CadolesCoreBundle:User:selectlist, access: user }
cadoles_core_user_users: cadoles_core_user_users:
path: /user/users path: /user/users
defaults: { _controller: CadolesCoreBundle:User:list, access: user } defaults: { _controller: CadolesCoreBundle:User:list, access: user }

View File

@ -1894,148 +1894,148 @@ function AdminIcon() {
$(document).on('ready', function(){ $(document).on('ready', function(){
var url = document.location.href; var url = document.location.href;
if (new RegExp("ninegate/user/group/submit$").test(url)) { if (new RegExp("ninegate/user/group/submit$").test(url)) {
$("<li><a title='Aide' style='cursor:pointer'><i onClick='MyTourGroupe()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire")); $("<li><a title='Aide embarquée' style='cursor:pointer'><i onClick='MyTourGroupe()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire"));
} }
else if (new RegExp("ninegate/user/users$").test(url)) { else if (new RegExp("ninegate/user/users$").test(url)) {
$("<li><a title='Aide' style='cursor:pointer'><i onClick='MyTourUsers()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire")); $("<li><a title='Aide embarquée' style='cursor:pointer'><i onClick='MyTourUsers()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire"));
} }
else if (new RegExp("ninegate/user$").test(url)) { else if (new RegExp("ninegate/user$").test(url)) {
$("<li><a title='Aide' style='cursor:pointer'><i onClick='MyTourUser()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire")); $("<li><a title='Aide embarquée' style='cursor:pointer'><i onClick='MyTourUser()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire"));
} }
else if (new RegExp("ninegate/user/group$").test(url)) { else if (new RegExp("ninegate/user/group$").test(url)) {
$("<li><a title='Aide' style='cursor:pointer'><i onClick='Groups()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire")); $("<li><a title='Aide embarquée' style='cursor:pointer'><i onClick='Groups()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire"));
} }
else if (new RegExp(/ninegate\/user\/group\/update\/\d+$/).test(url)) { else if (new RegExp(/ninegate\/user\/group\/update\/\d+$/).test(url)) {
$("<li><a title='Aide' style='cursor:pointer'><i onClick='MyTourGroupe()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire")); $("<li><a title='Aide embarquée' style='cursor:pointer'><i onClick='MyTourGroupe()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire"));
} }
else if (new RegExp(/ninegate\/user\/group\/users\/\d+$/).test(url)) { else if (new RegExp(/ninegate\/user\/group\/users\/\d+$/).test(url)) {
$("<li><a title='Aide' style='cursor:pointer'><i onClick='MyTourGroupUsers()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire")); $("<li><a title='Aide embarquée' style='cursor:pointer'><i onClick='MyTourGroupUsers()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire"));
} }
else if (new RegExp(/ninegate\/config\/group\/users\/\d+$/).test(url)) { else if (new RegExp(/ninegate\/config\/group\/users\/\d+$/).test(url)) {
$("<li><a title='Aide' style='cursor:pointer'><i onClick='MyTourGroupUsers()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire")); $("<li><a title='Aide embarquée' style='cursor:pointer'><i onClick='MyTourGroupUsers()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire"));
} }
else if (new RegExp("ninegate/user/page/submit").test(url)) { else if (new RegExp("ninegate/user/page/submit").test(url)) {
$("<li><a title='Aide' style='cursor:pointer'><i onClick='MyTourPage()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire")); $("<li><a title='Aide embarquée' style='cursor:pointer'><i onClick='MyTourPage()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire"));
} }
else if (new RegExp("ninegate/config/commun$").test(url)) { else if (new RegExp("ninegate/config/commun$").test(url)) {
$("<li><a title='Aide' style='cursor:pointer'><i onClick='AdminCommun()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire")); $("<li><a title='Aide embarquée' style='cursor:pointer'><i onClick='AdminCommun()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire"));
} }
else if (new RegExp("ninegate/config/home$").test(url)) { else if (new RegExp("ninegate/config/home$").test(url)) {
$("<li><a title='Aide' style='cursor:pointer'><i onClick='AdminHome()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire")); $("<li><a title='Aide embarquée' style='cursor:pointer'><i onClick='AdminHome()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire"));
} }
else if (new RegExp("ninegate/config/theme$").test(url)) { else if (new RegExp("ninegate/config/theme$").test(url)) {
$("<li><a title='Aide' style='cursor:pointer'><i onClick='AdminTheme()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire")); $("<li><a title='Aide embarquée' style='cursor:pointer'><i onClick='AdminTheme()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire"));
} }
else if (new RegExp("ninegate/config/commun/permmodo$").test(url)) { else if (new RegExp("ninegate/config/commun/permmodo$").test(url)) {
$("<li><a title='Aide' style='cursor:pointer'><i onClick='AdminPermmodo()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire")); $("<li><a title='Aide embarquée' style='cursor:pointer'><i onClick='AdminPermmodo()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire"));
} }
else if (new RegExp("ninegate/config/commun/datauser$").test(url)) { else if (new RegExp("ninegate/config/commun/datauser$").test(url)) {
$("<li><a title='Aide' style='cursor:pointer'><i onClick='AdminDatauser()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire")); $("<li><a title='Aide embarquée' style='cursor:pointer'><i onClick='AdminDatauser()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire"));
} }
else if (new RegExp("ninegate/config/commun/datausers$").test(url)) { else if (new RegExp("ninegate/config/commun/datausers$").test(url)) {
$("<li><a title='Aide' style='cursor:pointer'><i onClick='AdminDatausers()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire")); $("<li><a title='Aide embarquée' style='cursor:pointer'><i onClick='AdminDatausers()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire"));
} }
else if (new RegExp("ninegate/config/whitelist$").test(url)) { else if (new RegExp("ninegate/config/whitelist$").test(url)) {
$("<li><a title='Aide' style='cursor:pointer'><i onClick='AdminWhitelist()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire")); $("<li><a title='Aide embarquée' style='cursor:pointer'><i onClick='AdminWhitelist()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire"));
} }
else if (new RegExp("ninegate/config/niveau01$").test(url)) { else if (new RegExp("ninegate/config/niveau01$").test(url)) {
$("<li><a title='Aide' style='cursor:pointer'><i onClick='AdminServices()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire")); $("<li><a title='Aide embarquée' style='cursor:pointer'><i onClick='AdminServices()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire"));
} }
else if (new RegExp("ninegate/config/niveau02$").test(url)) { else if (new RegExp("ninegate/config/niveau02$").test(url)) {
$("<li><a title='Aide' style='cursor:pointer'><i onClick='AdminEtablissements()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire")); $("<li><a title='Aide embarquée' style='cursor:pointer'><i onClick='AdminEtablissements()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire"));
} }
else if (new RegExp("ninegate/config/group$").test(url)) { else if (new RegExp("ninegate/config/group$").test(url)) {
$("<li><a title='Aide' style='cursor:pointer'><i onClick='AdminGroup()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire")); $("<li><a title='Aide embarquée' style='cursor:pointer'><i onClick='AdminGroup()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire"));
} }
else if (new RegExp("ninegate/config/group/submit$").test(url)) { else if (new RegExp("ninegate/config/group/submit$").test(url)) {
$("<li><a title='Aide' style='cursor:pointer'><i onClick='AdminGroupSubmit()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire")); $("<li><a title='Aide embarquée' style='cursor:pointer'><i onClick='AdminGroupSubmit()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire"));
} }
else if (new RegExp("ninegate/config/registration$").test(url)) { else if (new RegExp("ninegate/config/registration$").test(url)) {
$("<li><a title='Aide' style='cursor:pointer'><i onClick='AdminRegistration()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire")); $("<li><a title='Aide embarquée' style='cursor:pointer'><i onClick='AdminRegistration()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire"));
} }
else if (new RegExp("ninegate/config/user$").test(url)) { else if (new RegExp("ninegate/config/user$").test(url)) {
$("<li><a title='Aide' style='cursor:pointer'><i onClick='AdminUser()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire")); $("<li><a title='Aide embarquée' style='cursor:pointer'><i onClick='AdminUser()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire"));
} }
else if (new RegExp("ninegate/config/importuser$").test(url)) { else if (new RegExp("ninegate/config/importuser$").test(url)) {
$("<li><a title='Aide' style='cursor:pointer'><i onClick='AdminImportuser()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire")); $("<li><a title='Aide embarquée' style='cursor:pointer'><i onClick='AdminImportuser()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire"));
} }
else if (new RegExp("ninegate/config/template$").test(url)) { else if (new RegExp("ninegate/config/template$").test(url)) {
$("<li><a title='Aide' style='cursor:pointer'><i onClick='AdminTemplate()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire")); $("<li><a title='Aide embarquée' style='cursor:pointer'><i onClick='AdminTemplate()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire"));
} }
else if (new RegExp("ninegate/config/template/submit$").test(url)) { else if (new RegExp("ninegate/config/template/submit$").test(url)) {
$("<li><a title='Aide' style='cursor:pointer'><i onClick='AdminTemplateSubmit()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire")); $("<li><a title='Aide embarquée' style='cursor:pointer'><i onClick='AdminTemplateSubmit()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire"));
} }
else if (new RegExp (/ninegate\/config\/template\/view\/\d+$/).test(url)) { else if (new RegExp (/ninegate\/config\/template\/view\/\d+$/).test(url)) {
$("<li><a title='Aide' style='cursor:pointer'><i onClick='AdminTemplateView()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire")); $("<li><a title='Aide embarquée' style='cursor:pointer'><i onClick='AdminTemplateView()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire"));
} }
else if (new RegExp (/ninegate\/config\/template\/update\/\d+$/).test(url)) { else if (new RegExp (/ninegate\/config\/template\/update\/\d+$/).test(url)) {
$("<li><a title='Aide' style='cursor:pointer'><i onClick='AdminTemplateUpdate()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire")); $("<li><a title='Aide embarquée' style='cursor:pointer'><i onClick='AdminTemplateUpdate()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire"));
} }
else if (new RegExp("ninegate/config/page$").test(url)) { else if (new RegExp("ninegate/config/page$").test(url)) {
$("<li><a title='Aide' style='cursor:pointer'><i onClick='AdminPage()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire")); $("<li><a title='Aide embarquée' style='cursor:pointer'><i onClick='AdminPage()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire"));
} }
else if (new RegExp("ninegate/config/page/submit$").test(url)) { else if (new RegExp("ninegate/config/page/submit$").test(url)) {
$("<li><a title='Aide' style='cursor:pointer'><i onClick='AdminPageSubmit()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire")); $("<li><a title='Aide embarquée' style='cursor:pointer'><i onClick='AdminPageSubmit()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire"));
} }
else if (new RegExp (/ninegate\/config\/page\/view\/\d+$/).test(url)) { else if (new RegExp (/ninegate\/config\/page\/view\/\d+$/).test(url)) {
$("<li><a title='Aide' style='cursor:pointer'><i onClick='AdminPageView()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire")); $("<li><a title='Aide embarquée' style='cursor:pointer'><i onClick='AdminPageView()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire"));
} }
else if (new RegExp (/ninegate\/config\/page\/update\/\d+$/).test(url)) { else if (new RegExp (/ninegate\/config\/page\/update\/\d+$/).test(url)) {
$("<li><a title='Aide' style='cursor:pointer'><i onClick='AdminPageUpdate()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire")); $("<li><a title='Aide embarquée' style='cursor:pointer'><i onClick='AdminPageUpdate()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire"));
} }
else if (new RegExp("ninegate/config/item$").test(url)) { else if (new RegExp("ninegate/config/item$").test(url)) {
$("<li><a title='Aide' style='cursor:pointer'><i onClick='AdminItem()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire")); $("<li><a title='Aide embarquée' style='cursor:pointer'><i onClick='AdminItem()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire"));
} }
else if (new RegExp("ninegate/config/item/submit$").test(url)) { else if (new RegExp("ninegate/config/item/submit$").test(url)) {
$("<li><a title='Aide' style='cursor:pointer'><i onClick='AdminItemSubmit()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire")); $("<li><a title='Aide embarquée' style='cursor:pointer'><i onClick='AdminItemSubmit()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire"));
} }
else if (new RegExp(/ninegate\/config\/item\/update\/\d+$/).test(url)) { else if (new RegExp(/ninegate\/config\/item\/update\/\d+$/).test(url)) {
$("<li><a title='Aide' style='cursor:pointer'><i onClick='AdminItemSubmit()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire")); $("<li><a title='Aide embarquée' style='cursor:pointer'><i onClick='AdminItemSubmit()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire"));
} }
else if (new RegExp("ninegate/config/alert$").test(url)) { else if (new RegExp("ninegate/config/alert$").test(url)) {
$("<li><a title='Aide' style='cursor:pointer'><i onClick='AdminAlert()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire")); $("<li><a title='Aide embarquée' style='cursor:pointer'><i onClick='AdminAlert()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire"));
} }
else if (new RegExp("ninegate/config/alert/submit$").test(url)) { else if (new RegExp("ninegate/config/alert/submit$").test(url)) {
$("<li><a title='Aide' style='cursor:pointer'><i onClick='AdminAlertSubmit()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire")); $("<li><a title='Aide embarquée' style='cursor:pointer'><i onClick='AdminAlertSubmit()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire"));
} }
else if (new RegExp(/ninegate\/config\/alert\/update\/\d+$/).test(url)) { else if (new RegExp(/ninegate\/config\/alert\/update\/\d+$/).test(url)) {
$("<li><a title='Aide' style='cursor:pointer'><i onClick='AdminAlertSubmit()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire")); $("<li><a title='Aide embarquée' style='cursor:pointer'><i onClick='AdminAlertSubmit()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire"));
} }
else if (new RegExp("ninegate/config/calendar$").test(url)) { else if (new RegExp("ninegate/config/calendar$").test(url)) {
$("<li><a title='Aide' style='cursor:pointer'><i onClick='AdminCalendar()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire")); $("<li><a title='Aide embarquée' style='cursor:pointer'><i onClick='AdminCalendar()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire"));
} }
else if (new RegExp("ninegate/config/calendar/submit$").test(url)) { else if (new RegExp("ninegate/config/calendar/submit$").test(url)) {
$("<li><a title='Aide' style='cursor:pointer'><i onClick='AdminCalendarSubmit()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire")); $("<li><a title='Aide embarquée' style='cursor:pointer'><i onClick='AdminCalendarSubmit()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire"));
} }
else if (new RegExp("ninegate/config/blog$").test(url)) { else if (new RegExp("ninegate/config/blog$").test(url)) {
$("<li><a title='Aide' style='cursor:pointer'><i onClick='AdminBlog()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire")); $("<li><a title='Aide embarquée' style='cursor:pointer'><i onClick='AdminBlog()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire"));
} }
else if (new RegExp("ninegate/config/blog/submit$").test(url)) { else if (new RegExp("ninegate/config/blog/submit$").test(url)) {
$("<li><a title='Aide' style='cursor:pointer'><i onClick='AdminBlogSubmit()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire")); $("<li><a title='Aide embarquée' style='cursor:pointer'><i onClick='AdminBlogSubmit()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire"));
} }
else if (new RegExp("ninegate/config/flux$").test(url)) { else if (new RegExp("ninegate/config/flux$").test(url)) {
$("<li><a title='Aide' style='cursor:pointer'><i onClick='AdminFlux()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire")); $("<li><a title='Aide embarquée' style='cursor:pointer'><i onClick='AdminFlux()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire"));
} }
else if (new RegExp("ninegate/config/flux/submit$").test(url)) { else if (new RegExp("ninegate/config/flux/submit$").test(url)) {
$("<li><a title='Aide' style='cursor:pointer'><i onClick='AdminFluxSubmit()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire")); $("<li><a title='Aide embarquée' style='cursor:pointer'><i onClick='AdminFluxSubmit()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire"));
} }
else if (new RegExp(/ninegate\/config\/flux\/update\/\d+$/).test(url)) { else if (new RegExp(/ninegate\/config\/flux\/update\/\d+$/).test(url)) {
$("<li><a title='Aide' style='cursor:pointer'><i onClick='AdminFluxSubmit()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire")); $("<li><a title='Aide embarquée' style='cursor:pointer'><i onClick='AdminFluxSubmit()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire"));
} }
else if (new RegExp("ninegate/config/notice$").test(url)) { else if (new RegExp("ninegate/config/notice$").test(url)) {
$("<li><a title='Aide' style='cursor:pointer'><i onClick='AdminNotice()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire")); $("<li><a title='Aide embarquée' style='cursor:pointer'><i onClick='AdminNotice()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire"));
} }
else if (new RegExp("ninegate/config/notice/submit$").test(url)) { else if (new RegExp("ninegate/config/notice/submit$").test(url)) {
$("<li><a title='Aide' style='cursor:pointer'><i onClick='AdminNoticeSubmit()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire")); $("<li><a title='Aide embarquée' style='cursor:pointer'><i onClick='AdminNoticeSubmit()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire"));
} }
else if (new RegExp(/ninegate\/config\/notice\/update\/\d+$/).test(url)) { else if (new RegExp(/ninegate\/config\/notice\/update\/\d+$/).test(url)) {
$("<li><a title='Aide' style='cursor:pointer'><i onClick='AdminNoticeSubmit()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire")); $("<li><a title='Aide embarquée' style='cursor:pointer'><i onClick='AdminNoticeSubmit()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire"));
} }
else if (new RegExp("ninegate/config/icon$").test(url)) { else if (new RegExp("ninegate/config/icon$").test(url)) {
$("<li><a title='Aide' style='cursor:pointer'><i onClick='AdminIcon()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire")); $("<li><a title='Aide embarquée' style='cursor:pointer'><i onClick='AdminIcon()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire"));
} }
// Instance the Tour // Instance the Tour
else if($("#menu-annuaire".length)) { else if($("#menu-annuaire".length)) {
$("<li><a title='Aide' style='cursor:pointer'><i onClick='MyTour()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire")); $("<li><a title='Aide embarquée' style='cursor:pointer'><i onClick='MyTour()' class='fa fa-question fa-fw'></i></a></li>").insertBefore($("#menu-annuaire"));
} }
}); });

View File

@ -10,13 +10,13 @@
<li> <li>
{% if mode_auth == "SAML" %} {% if mode_auth == "SAML" %}
<a href="{{ url('cadoles_core_kill') }}"><i class="fa fa-sign-out fa-fw"></i></a> <a href="{{ url('cadoles_core_kill') }}" title="Déconnexion"><i class="fa fa-sign-out fa-fw"></i></a>
{% elseif mode_auth == "CAS" %} {% elseif mode_auth == "CAS" %}
<a href="{{ path('cas_sp.logout') }}"><i class="fa fa-sign-out fa-fw"></i></a> <a href="{{ path('cas_sp.logout') }}" title="Déconnexion"><i class="fa fa-sign-out fa-fw"></i></a>
{% elseif mode_auth == "SQL" %} {% elseif mode_auth == "SQL" %}
<a href="{{ path('cadoles_core_kill') }}"><i class="fa fa-sign-out fa-fw"></i></a> <a href="{{ path('cadoles_core_kill') }}" title="Déconnexion"><i class="fa fa-sign-out fa-fw"></i></a>
{% elseif mode_auth == "LDAP" %} {% elseif mode_auth == "LDAP" %}
<a href="{{ path('cadoles_core_kill') }}"><i class="fa fa-sign-out fa-fw"></i></a> <a href="{{ path('cadoles_core_kill') }}" title="Déconnexion"><i class="fa fa-sign-out fa-fw"></i></a>
{% endif %} {% endif %}
</li> </li>
@ -30,13 +30,13 @@
<li> <li>
{% if mode_auth == "SAML" %} {% if mode_auth == "SAML" %}
<a href="{{ path('lightsaml_sp.login') }}"><i class="fa fa-sign-in fa-fw"></i></a> <a href="{{ path('lightsaml_sp.login') }}" title="Connexion"><i class="fa fa-sign-in fa-fw"></i></a>
{% elseif mode_auth == "CAS" %} {% elseif mode_auth == "CAS" %}
<a href="{{ path('cas_sp.login') }}"><i class="fa fa-sign-in fa-fw"></i></a> <a href="{{ path('cas_sp.login') }}" title="Connexion"><i class="fa fa-sign-in fa-fw"></i></a>
{% elseif mode_auth == "SQL" %} {% elseif mode_auth == "SQL" %}
<a href="{{ path('cadoles_core_login') }}"><i class="fa fa-sign-in fa-fw"></i></a> <a href="{{ path('cadoles_core_login') }}" title="Connexion"><i class="fa fa-sign-in fa-fw"></i></a>
{% elseif mode_auth == "LDAP" %} {% elseif mode_auth == "LDAP" %}
<a href="{{ path('cadoles_core_ldap_login') }}"><i class="fa fa-sign-in fa-fw"></i></a> <a href="{{ path('cadoles_core_ldap_login') }}" title="Connexion"><i class="fa fa-sign-in fa-fw"></i></a>
{% endif %} {% endif %}
</li> </li>

View File

@ -67,9 +67,9 @@
{{ form_widget(form.username) }} {{ form_widget(form.username) }}
<div class='alert alert-info' style='font-size: 80%;padding: 5px;margin-top: -10px;'> <div class='alert alert-info' style='font-size: 80%;padding: 5px;margin-top: -10px;'>
Caractères interdits = accent, espace, caractères spéciaux sauf @ . - _<br> Formatez votre login sous la forme prenom.nom dans la mesure du possible<br>
Taille minimum = 5 caractères<br> Taille minimum = 5 caractères<br>
Formatez votre login sous la forme prenom.nom dans la mesure du possible Caractères interdits = accent, espace, caractères spéciaux sauf @ . - _<br>
</div> </div>
{% if form.password is defined %} {% if form.password is defined %}

View File

@ -74,9 +74,9 @@
{{ form_widget(form.username) }} {{ form_widget(form.username) }}
<div class='alert alert-info' style='font-size: 80%;padding: 5px;margin-top: -10px;'> <div class='alert alert-info' style='font-size: 80%;padding: 5px;margin-top: -10px;'>
Caractères interdits = accent, espace, caractères spéciaux sauf @ . - _<br> Formatez votre login sous la forme prenom.nom dans la mesure du possible<br>
Taille minimum = 5 caractères<br> Taille minimum = 5 caractères<br>
Formatez votre login sous la forme prenom.nom dans la mesure du possible Caractères interdits = accent, espace, caractères spéciaux sauf @ . - _<br>
</div> </div>
{% if form.password is defined %} {% if form.password is defined %}

View File

@ -59,7 +59,7 @@ class PagewidgetController extends Controller
'param' => $params, 'param' => $params,
'mode' => "update", 'mode' => "update",
'access' => $access, 'access' => $access,
'idicon' => $entity->getIcon()->getId(), 'idicon' => ($entity->getIcon()?$entity->getIcon()->getId():$widgettype->getIcon()->getId()),
'method' => 'POST', 'method' => 'POST',
]); ]);
} else { } else {

View File

@ -45,6 +45,7 @@ class ProjecttaskType extends AbstractType
->add('priority', IntegerType::class, [ ->add('priority', IntegerType::class, [
"label" => 'Priorité', "label" => 'Priorité',
"required" => true, "required" => true,
"attr" => ["min"=>0],
]) ])
->add('end', DateType::class, [ ->add('end', DateType::class, [
@ -56,6 +57,7 @@ class ProjecttaskType extends AbstractType
->add('percentage', IntegerType::class, [ ->add('percentage', IntegerType::class, [
"label" => "Pourcentage d'avancement", "label" => "Pourcentage d'avancement",
"required" => true, "required" => true,
"attr" => ["min"=>0, "max"=>100],
]) ])
->add('projecttasktag', EntityType::class, [ ->add('projecttasktag', EntityType::class, [

View File

@ -15,7 +15,7 @@
<div style="margin:10px 0px 10px 0px; text-align:left; display:inline-block;width:49%"> <div style="margin:10px 0px 10px 0px; text-align:left; display:inline-block;width:49%">
{% if not idpage is empty %} {% if not idpage is empty %}
<a href="{{path('cadoles_portal_user_page_view',{id:idpage,usage:'group',group:idgroup})}}" class="btn btn-default">Revenir sur le Groupe</a> <a href="{{path('cadoles_portal_user_page_view',{id:idpage,usage:'group',group:idgroup})}}" class="btn btn-success">Revenir sur le Groupe</a>
{% endif %} {% endif %}
</div> </div>
@ -131,7 +131,7 @@
{{ projecttask.user.username }} {{ projecttask.user.username }}
{% endif %} {% endif %}
<br>Crée le {{ projecttask.submit|date("d/m/Y à H:i") }} <br>Crée le {{ projecttask.submit|date("d/m/Y à H:i") }}
<br>Dans le project {{projecttask.project.name }}</small> <br>Dans le projet {{projecttask.project.name }}</small>
</div> </div>
<div class="pull-right" style="width:80px; margin:5px 5px 0px 0px; text-align: center;"> <div class="pull-right" style="width:80px; margin:5px 5px 0px 0px; text-align: center;">

View File

@ -37,7 +37,7 @@
{% else %} {% else %}
<div style="margin:10px 0px 10px 0px; text-align:left; display:inline-block;width:49%"> <div style="margin:10px 0px 10px 0px; text-align:left; display:inline-block;width:49%">
{% if not idpage is empty %} {% if not idpage is empty %}
<a href="{{path('cadoles_portal_user_page_view',{id:idpage,usage:'group',group:idgroup})}}" class="btn btn-default">Revenir sur le Groupe</a> <a href="{{path('cadoles_portal_user_page_view',{id:idpage,usage:'group',group:idgroup})}}" class="btn btn-success">Revenir sur le Groupe</a>
{% endif %} {% endif %}
</div> </div>

View File

@ -94,11 +94,11 @@
<div id="topchat" class='row'> <div id="topchat" class='row'>
{{ form_widget(form.message) }} {{ form_widget(form.message) }}
<input id="sendbymail" type="checkbox" style="float:right" class='switch' ></input> <input id="sendbymail" type="checkbox" style="float:right" class='switch' ></input>
<label class="custom-control-label" for="sendbymail" style="color:#{{ colorbodyback }}">Envoyer par Mail ?</label> <label class="custom-control-label" for="sendbymail" style="color:#{{ colorbodyfont }}">Envoyer par Mail ?</label>
<a id="sendbtn" class="btn btn-success" style="margin-top:5px; width:100%; margin-bottom:15px">Envoyer</a> <a id="sendbtn" class="btn btn-success" style="margin-top:5px; width:100%; margin-bottom:15px">Envoyer</a>
<div id="useronline" style="margin-bottom:10px"></div> <div id="useronline" style="margin-bottom:10px"></div>
<input id="unsee" type="checkbox" style="float:right" class='switch' onChange="switchsee()"></input> <input id="unsee" type="checkbox" style="float:right" class='switch' onChange="switchsee()"></input>
<label class="custom-control-label" for="unsee" style="color:#{{ colorbodyback }}">Afficher les messages masqués ?</label> <label class="custom-control-label" for="unsee" style="color:#{{ colorbodyfont }}">Afficher les messages masqués ?</label>
</div> </div>
@ -734,9 +734,9 @@
function addOnline(userid, useravatar, userlastname, userfirstname) { function addOnline(userid, useravatar, userlastname, userfirstname) {
if(!$("#online"+userid).length) { if(!$("#online"+userid).length) {
html = "<span id='online"+userid+"' style='width:70px; height:105px; display:inline-block; text-align: center; font-size: 10px; color:#{{ colorbodyback }}; text-transform: uppercase; line-height:11px;overflow-wrap: break-word;vertical-align:top;'>"; html = "<span id='online"+userid+"' style='width:70px; display:inline-block; text-align: center; font-size: 10px; color:#{{ colorbodyback }}; text-transform: uppercase; line-height:11px;overflow-wrap: break-word;vertical-align:top;'>";
html+= "<img style='cursor:pointer; width:40px; height:40px; margin-bottom:5px;' onclick='seeUser("+userid+")' title='"+userlastname+" "+userfirstname+"' id='user_avatar_img' src='/{{ alias }}/uploads/avatar/"+useravatar+"' class='avatar'>"; html+= "<img style='cursor:pointer; width:40px; height:40px; margin-bottom:5px;' onclick='seeUser("+userid+")' title='"+userlastname+" "+userfirstname+"' id='user_avatar_img' src='/{{ alias }}/uploads/avatar/"+useravatar+"' class='avatar'>";
html+= userlastname+" "+userfirstname; html+= "<span style='color:#{{colorbodyfont}}'>"+userlastname+" "+userfirstname+"</span>";
html+= "</span>"; html+= "</span>";
$("#useronline").append(html); $("#useronline").append(html);
} }