This commit is contained in:
afornerot 2019-05-07 13:49:42 +02:00
parent 3560bd1769
commit 5d133c16f1
41 changed files with 595 additions and 176 deletions

View File

@ -51,5 +51,9 @@ security:
- { path: ^/config/item, roles: [ROLE_ADMIN, ROLE_MODO] }
- { path: ^/config/alert, roles: [ROLE_ADMIN, ROLE_MODO] }
- { path: ^/config/page, roles: [ROLE_ADMIN, ROLE_MODO] }
- { path: ^/config/calendar, roles: [ROLE_ADMIN, ROLE_MODO] }
- { path: ^/config/notice, roles: [ROLE_ADMIN, ROLE_MODO] }
- { path: ^/config/blog, roles: [ROLE_ADMIN, ROLE_MODO] }
- { path: ^/config/flux, roles: [ROLE_ADMIN, ROLE_MODO] }
- { path: ^/config, roles: [ROLE_ADMIN] }

View File

@ -6,6 +6,9 @@ twig:
masteridentity: %masteridentity%
mode_auth: %mode_auth%
cron_activate: %cron_activate%
portal_activate: %portal_activate%
eportail_sync: %eportail_sync%
moderegistration: %moderegistration%
labelniveau01: %labelniveau01%

View File

@ -93,6 +93,9 @@ class InitDataCommand extends ContainerAwareCommand
$group->setFgall(true);
$group->setFgtemplate(false);
$group->setFgcanshare(false);
$group->setFgcancreatepage(true);
$group->setFgcancreateblog(true);
$group->setFgcancreatecalendar(true);
$em->persist($group);
$em->flush();
}

View File

@ -637,6 +637,9 @@ class SynchroCommand extends Command
if(!$group) {
$group=new Group();
$group->setFgcanshare($fgcanshare);
$group->setFgcancreatepage(true);
$group->setFgcancreateblog(true);
$group->setFgcancreatecalendar(true);
}
$group->setLabel($label);

View File

@ -49,6 +49,7 @@ INSERT IGNORE INTO `config` (`order`, `visible`, `changeable`, `required`, `type
('004', 1, 1, 1, 'logo', 'logo', 'uploads/logo/logo.png', '', 'Le logo de votre site'),
('005', 0, 1, 0, 'theme', 'theme', '', '', 'Le theme de votre site'),
('010', 1, 1, 1, 'boolean', 'fgforceconnect', '0', '', 'Forcer la connection afin de rendre votre site privé'),
('040', 1, 1, 1, 'boolean', 'fgheader', '1', '', 'Utiliser une image en bannière du site'),
('041', 1, 1, 1, 'header', 'header', 'uploads/header/header.png', 'fgheader', 'Image en bannière du site'),

View File

@ -123,6 +123,35 @@ class AjaxController extends Controller
}
public function grouplistAction(Request $request)
{
// S'assurer que c'est un appel ajax
if (!$request->isXmlHttpRequest()) {
return new JsonResponse(array('message' => 'Interdit'), 400);
}
$output=array();
$em = $this->getDoctrine()->getManager();
$page_limit=$request->query->get('page_limit');
$q=$request->query->get('q');
$qb = $em->createQueryBuilder();
$qb->select('table')->from("CadolesCoreBundle:Group",'table')
->where('table.label LIKE :value')
->setParameter("value", "%".$q."%")
->orderBy('table.label');
$datas=$qb->setFirstResult(0)->setMaxResults($page_limit)->getQuery()->getResult();
foreach($datas as $data) {
array_push($output,array("id"=>$data->getId(),"text"=>$data->getLabel()));
}
$response = new Response(json_encode($output));
$response->headers->set('Content-Type', 'application/json');
return $response;
}
public function groupreadAction(Request $request)
{
// S'assurer que c'est un appel ajax

View File

@ -67,7 +67,7 @@ class CoreController extends Controller
'pagesadmin' => $pagesadmin,
'pagesuser' => $pagesuser,
'pagesshared' => $pagesshared,
'canadd' => ($user),
'canadd' => $this->get('session')->get('cancreatepage'),
'widgets' => $this->getDoctrine()->getRepository("CadolesPortalBundle:Widget")->findAll()
]);
}

View File

@ -37,6 +37,8 @@ class GroupController extends Controller
return new JsonResponse(array('message' => 'Interdit'), 400);
}
$portal_activate=$this->getParameter("portal_activate");
$em = $this->getDoctrine()->getManager();
$start=$request->query->get('start');
@ -83,17 +85,37 @@ class GroupController extends Controller
case 2 :
$qb->orderBy('table.fgopen',$order[0]["dir"]);
break;
case 3 :
case 4 :
$qb->orderBy('table.fgcanshare',$order[0]["dir"]);
break;
break;
case 5 :
$qb->orderBy('table.fgcancreatepage',$order[0]["dir"]);
break;
case 6 :
$qb->orderBy('table.fgcancreatecalendar',$order[0]["dir"]);
break;
case 7 :
$qb->orderBy('table.fgcancreateblog',$order[0]["dir"]);
break;
}
$datas=$qb->setFirstResult($start)->setMaxResults($length)->getQuery()->getResult();
foreach($datas as $data) {
$action = "";
$action .="<a href='".$this->generateUrl('cadoles_core_config_group_update', array('id'=>$data->getId()))."'><i class='fa fa-file fa-2x fa-fw'></i></a>";
// Modification possible si groupe non template et non tout le monde
if(!$data->getFgTemplate() && !$data->getFgall())
$action .="<a href='".$this->generateUrl('cadoles_core_config_group_update', array('id'=>$data->getId()))."'><i class='fa fa-file fa-2x fa-fw'></i></a>";
// Modification possible si groupe template mais avec module portail activé
elseif($data->getFgTemplate()&&$portal_activate)
$action .="<a href='".$this->generateUrl('cadoles_core_config_group_update', array('id'=>$data->getId()))."'><i class='fa fa-file fa-2x fa-fw'></i></a>";
// Modification possible si groupe tout le monde mais avec module portail activé
elseif($data->getFgall()&&$portal_activate)
$action .="<a href='".$this->generateUrl('cadoles_core_config_group_update', array('id'=>$data->getId()))."'><i class='fa fa-file fa-2x fa-fw'></i></a>";
if($data->getId()>0&&!$data->getFgall()&&!$data->getFgTemplate()&&$this->isGranted('ROLE_ADMIN')) $action.="<a href='".$this->generateUrl('cadoles_core_config_group_delete', array('id'=>$data->getId()))."'><i class='fa fa-trash fa-fw fa-2x'></i></a>";
if(!$data->getFgall()) $action .="<a href='".$this->generateUrl('cadoles_core_config_group_users', array('id'=>$data->getId()))."'><i class='fa fa-users fa-2x fa-fw'></i></a>";
@ -101,7 +123,17 @@ class GroupController extends Controller
if($this->GetParameter("masteridentity")=="LDAP") $filtre=$data->getLdapfilter();
if($this->GetParameter("masteridentity")=="SSO") $filtre=$data->getAttributes();
array_push($output["data"],array($action,$data->getLabel(),($data->getFgopen()?"oui":"non"),($data->getFgcanshare()?"oui":"non"),$filtre));
array_push($output["data"],array(
$action,
$data->getLabel(),
($data->getFgopen()?"oui":"non"),
$filtre,
($data->getFgcanshare()?"oui":"non"),
($data->getFgcancreatepage()?"oui":"non"),
($data->getFgcancreatecalendar()?"oui":"non"),
($data->getFgcancreateblog()?"oui":"non"),
)
);
}
// Retour
@ -422,9 +454,19 @@ class GroupController extends Controller
// Initialisation de l'enregistrement
$data = new Group();
$data->setFgopen(false);
$data->setFgcanshare(true);
$data->setFgcancreatepage(true);
$data->setFgcancreatecalendar(true);
$data->setFgcancreateblog(true);
// Création du formulaire
$form = $this->createForm(GroupType::class,$data,array("mode"=>"submit","updatelimite"=>false,"masteridentity"=> $this->GetParameter("masteridentity")));
$form = $this->createForm(GroupType::class,$data,array(
"mode"=>"submit",
"updatelimite"=>false,
"masteridentity"=> $this->GetParameter("masteridentity"),
"portal_activate"=>$this->getParameter("portal_activate")
)
);
// Récupération des data du formulaire
$form->handleRequest($request);
@ -468,7 +510,13 @@ class GroupController extends Controller
// Création du formulaire
$form = $this->createForm(GroupType::class,$data,array("mode"=>"update","updatelimite"=>($data->getFgAll()||$data->getFgTemplate()),"masteridentity"=> $this->GetParameter("masteridentity")));
$form = $this->createForm(GroupType::class,$data,array(
"mode"=>"update",
"updatelimite"=>($data->getFgAll()||$data->getFgTemplate()),
"masteridentity"=> $this->GetParameter("masteridentity"),
"portal_activate"=>$this->getParameter("portal_activate")
)
);
// Récupération des data du formulaire
$form->handleRequest($request);
@ -521,7 +569,13 @@ class GroupController extends Controller
throw $this->createNotFoundException('Permission denied');
// Création du formulaire
$form = $this->createForm(GroupType::class,$data,array("mode"=>"delete","masteridentity"=> $this->GetParameter("masteridentity")));
$form = $this->createForm(GroupType::class,$data,array(
"mode"=>"delete",
"updatelimite"=>($data->getFgAll()||$data->getFgTemplate()),
"masteridentity"=> $this->GetParameter("masteridentity"),
"portal_activate"=>$this->getParameter("portal_activate")
)
);
// Récupération des data du formulaire
$form->handleRequest($request);

View File

@ -72,14 +72,14 @@ class SecurityController extends Controller
$fglogin = false;
if($ldapConn){
// Connexion au serveur LDAP superuser
$ldapbind = ldap_bind($ldapConn, $ldap_user, $ldap_password);
@$ldapbind = ldap_bind($ldapConn, $ldap_user, $ldap_password);
if($ldapbind) {
$result = ldap_search($ldapConn, $ldap_basedn, "uid=".$data["_username"]);
if($result) {
$first = ldap_first_entry($ldapConn, $result);
$dn = ldap_get_dn($ldapConn, $first);
$ldapbind = ldap_bind($ldapConn, $dn, $data["_password"]);
@$ldapbind = ldap_bind($ldapConn, $dn, $data["_password"]);
if($ldapbind) {
$fglogin = true;
}
@ -140,29 +140,54 @@ class SecurityController extends Controller
public function checkuserAction(Request $request)
{
// Mode d'authentification
$userapp = $this->getUser();
$fgforceconnect = $this->get('session')->get('fgforceconnect');
$modeauth=$this->getParameter('mode_auth');
switch($modeauth) {
case "CAS":
// Init Client CAS
\phpCAS::setDebug(false);
\phpCAS::client(CAS_VERSION_2_0, $this->container->getParameter('cas_host'), $this->container->getParameter('cas_port'), is_null($this->container->getParameter('cas_path')) ? '' : $this->container->getParameter('cas_path'), false);
\phpCAS::setNoCasServerValidation();
if(is_null($userapp) && $fgforceconnect) {
switch($modeauth) {
case "SAML":
return new Response("<script>window.location.href='".$this->generateUrl("lightsaml_sp.login")."';</script>");
break;
case "CAS":
return new Response("<script>window.location.href='".$this->generateUrl("cas_sp.login")."';</script>");
break;
if(\phpCAS::checkAuthentication()) {
$usercas = \phpCAS::getUser();
$userapp = $this->getUser();
case "SQL":
return new Response("<script>window.location.href='".$this->generateUrl("cadoles_core_login")."';</script>");
break;
case "LDAP":
return new Response("<script>window.location.href='".$this->generateUrl("cadoles_core_ldap_login")."';</script>");
break;
}
}
else
{
// Mode d'authentification
switch($modeauth) {
case "CAS":
// Init Client CAS
\phpCAS::setDebug(false);
\phpCAS::client(CAS_VERSION_2_0, $this->container->getParameter('cas_host'), $this->container->getParameter('cas_port'), is_null($this->container->getParameter('cas_path')) ? '' : $this->container->getParameter('cas_path'), false);
\phpCAS::setNoCasServerValidation();
if(\phpCAS::checkAuthentication()) {
$usercas = \phpCAS::getUser();
// si on a un usercas mais pas de userapp c'est qu'il faut s'autoconnect
if(!$userapp) {
$url=$this->generateUrl('cas_sp.login');
return new Response(
'<script>document.location.replace("'.$url.'");</script>'
);
// si on a un usercas mais pas de userapp c'est qu'il faut s'autoconnect
if(!$userapp) {
$url=$this->generateUrl('cas_sp.login');
return new Response(
'<script>document.location.replace("'.$url.'");</script>'
);
}
}
break;
}
}
break;
}
}
return new Response();

View File

@ -30,22 +30,37 @@ class Group
private $label;
/**
* @ORM\Column(type="boolean")
* @ORM\Column(type="boolean", options={"default" : false})
*/
private $fgopen;
/**
* @ORM\Column(type="boolean")
* @ORM\Column(type="boolean", options={"default" : true})
*/
private $fgcanshare;
/**
* @ORM\Column(type="boolean")
* @ORM\Column(type="boolean", options={"default" : true})
*/
private $fgcancreatepage;
/**
* @ORM\Column(type="boolean", options={"default" : true})
*/
private $fgcancreateblog;
/**
* @ORM\Column(type="boolean", options={"default" : true})
*/
private $fgcancreatecalendar;
/**
* @ORM\Column(type="boolean", options={"default" : false})
*/
private $fgall;
/**
* @ORM\Column(type="boolean")
* @ORM\Column(type="boolean", options={"default" : false})
*/
private $fgtemplate;
@ -202,6 +217,78 @@ class Group
return $this->fgcanshare;
}
/**
* Set fgcancreatepage
*
* @param boolean $fgcancreatepage
*
* @return Group
*/
public function setFgcancreatepage($fgcancreatepage)
{
$this->fgcancreatepage = $fgcancreatepage;
return $this;
}
/**
* Get fgcancreatepage
*
* @return boolean
*/
public function getFgcancreatepage()
{
return $this->fgcancreatepage;
}
/**
* Set fgcancreateblog
*
* @param boolean $fgcancreateblog
*
* @return Group
*/
public function setFgcancreateblog($fgcancreateblog)
{
$this->fgcancreateblog = $fgcancreateblog;
return $this;
}
/**
* Get fgcancreateblog
*
* @return boolean
*/
public function getFgcancreateblog()
{
return $this->fgcancreateblog;
}
/**
* Set fgcancreatecalendar
*
* @param boolean $fgcancreatecalendar
*
* @return Group
*/
public function setFgcancreatecalendar($fgcancreatecalendar)
{
$this->fgcancreatecalendar = $fgcancreatecalendar;
return $this;
}
/**
* Get fgcancreatecalendar
*
* @return boolean
*/
public function getFgcancreatecalendar()
{
return $this->fgcancreatecalendar;
}
/**
* Set fgall
*

View File

@ -189,5 +189,21 @@
}
}
$session->set('sidebar', $sidebar);
if($portal_activate) {
$session->set('cancreatepage',false);
$session->set('cancreatecalendar',false);
$session->set('cancreateblog',false);
if($curentuser!="anon.") {
$groups=$curentuser->getGroups();
foreach($groups as $usergroup) {
$group=$usergroup->getGroup();
if($group->getFgcancreatepage()) $session->set('cancreatepage',true);
if($group->getFgcancreatecalendar()) $session->set('cancreatecalendar',true);
if($group->getFgcancreateblog()) $session->set('cancreateblog',true);
}
}
}
}
}

View File

@ -30,16 +30,45 @@ class GroupType extends AbstractType
)
);
$choices=array("oui" => "1","non" => "0");
$builder->add("fgcanshare",
ChoiceType::class,array(
"label" =>"Partage dans le groupe activé",
'disabled' => ($options["mode"]=="delete"?true:false),
"attr" => array("class" => "form-control", "style" => "margin-bottom:15px"),
"choices" => $choices
)
);
if($options["portal_activate"]) {
$choices=array("oui" => "1","non" => "0");
$builder->add("fgcanshare",
ChoiceType::class,array(
"label" =>"Partage dans le groupe activé",
'disabled' => ($options["mode"]=="delete"?true:false),
"attr" => array("class" => "form-control", "style" => "margin-bottom:15px"),
"choices" => $choices
)
);
$builder->add("fgcancreatepage",
ChoiceType::class,array(
"label" =>"Permission de créer des Pages",
'disabled' => ($options["mode"]=="delete"?true:false),
"attr" => array("class" => "form-control", "style" => "margin-bottom:15px"),
"choices" => $choices
)
);
$builder->add("fgcancreatecalendar",
ChoiceType::class,array(
"label" =>"Permission de créer des Calendriers",
'disabled' => ($options["mode"]=="delete"?true:false),
"attr" => array("class" => "form-control", "style" => "margin-bottom:15px"),
"choices" => $choices
)
);
$builder->add("fgcancreateblog",
ChoiceType::class,array(
"label" =>"Permission de créer des Blogs",
'disabled' => ($options["mode"]=="delete"?true:false),
"attr" => array("class" => "form-control", "style" => "margin-bottom:15px"),
"choices" => $choices
)
);
}
if(!$options["updatelimite"]) {
$builder->add('label',
TextType::class, array(
@ -116,6 +145,7 @@ class GroupType extends AbstractType
'data_class' => 'Cadoles\CoreBundle\Entity\Group',
'mode' => "string",
'masteridentity' => "string",
'portal_activate' => "boolean",
'updatelimite' => "boolean"
));
}

View File

@ -107,6 +107,10 @@ cadoles_core_ajax_niveau02_read:
path: /ajax/niveau02/read
defaults: { _controller: CadolesCoreBundle:Ajax:niveau02read }
cadoles_core_ajax_group_list:
path: /ajax/group/list
defaults: { _controller: CadolesCoreBundle:Ajax:grouplist }
cadoles_core_ajax_group_read:
path: /ajax/group/read
defaults: { _controller: CadolesCoreBundle:Ajax:groupread }

View File

@ -33,37 +33,62 @@
{% endfor %}
</div>
{% endif %}
<div class="panel panel-primary">
<div class="panel-heading">
<i class="fa fa-pencil fa-fw"></i> Informations
</div>
<div class="panel-body">
{% if form.label is defined %}
{{ form_label(form.label) }}
{{ form_widget(form.label) }}
{% endif %}
<div class="row">
{% if form.label is defined %}
<div class="col-sm-6">
<div class="panel panel-primary">
<div class="panel-heading">
<i class="fa fa-pencil fa-fw"></i> Informations
</div>
{{ form_label(form.fgcanshare) }}
{{ form_widget(form.fgcanshare) }}
<div class="panel-body">
{{ form_label(form.label) }}
{{ form_widget(form.label) }}
{% if form.label is defined %}
{{ form_label(form.fgopen) }}
{{ form_widget(form.fgopen) }}
{% endif %}
{{ form_label(form.fgopen) }}
{{ form_widget(form.fgopen) }}
{% if form.fgassoc is defined %}
{% if masteridentity=="LDAP" %}
{{ form_row(form.fgassoc) }}
{{ form_row(form.ldapfilter) }}
{% endif %}
{% if form.fgassoc is defined %}
{% if masteridentity=="LDAP" %}
{{ form_row(form.fgassoc) }}
{{ form_row(form.ldapfilter) }}
{% endif %}
{% if masteridentity=="SSO" %}
{{ form_row(form.fgassoc) }}
{{ form_row(form.attributes) }}
{% endif %}
{% endif %}
</div>
</div>
</div>
{% endif %}
{% if form.fgcanshare is defined %}
<div class="col-sm-6">
<div class="panel panel-primary">
<div class="panel-heading">
<i class="fa fa-pencil fa-fw"></i> Permissions Portail
</div>
<div class="panel-body">
{{ form_label(form.fgcanshare) }}
{{ form_widget(form.fgcanshare) }}
{{ form_label(form.fgcancreatepage) }}
{{ form_widget(form.fgcancreatepage) }}
{{ form_label(form.fgcancreatecalendar) }}
{{ form_widget(form.fgcancreatecalendar) }}
{{ form_label(form.fgcancreateblog) }}
{{ form_widget(form.fgcancreateblog) }}
</div>
</div>
</div>
{% endif %}
{% if masteridentity=="SSO" %}
{{ form_row(form.fgassoc) }}
{{ form_row(form.attributes) }}
{% endif %}
{% endif %}
</div>
</div>
{{ form_end(form) }}
{% endblock %}

View File

@ -18,8 +18,13 @@
<th width="130px" class="no-sort">Action</th>
<th>Label</th>
<th>Ouvert</th>
<th>Partage</th>
<th class="no-sort">Filtre</th>
{% if portal_activate %}
<th>Partage</th>
<th>Création Pages</th>
<th>Création Calendriers</th>
<th>Création Blogs</th>
{% endif %}
</tr>
</thead>
</table>

View File

@ -31,7 +31,7 @@
</div>
{% if error %}
<div>{{ error.messageKey|trans(error.messageData, 'security') }}</div>
<div>{{ error }}</div>
{% endif %}
</div>
</form>

View File

@ -145,6 +145,9 @@ class BlogController extends Controller
public function submitAction(Request $request,$access="config")
{
if($access=="user"&&!$this->get('session')->get('cancreateblog'))
throw $this->createNotFoundException('Permission denied');
$entity = new Blog();
$form = $this->entityForm($entity,$access);
@ -345,8 +348,7 @@ class BlogController extends Controller
if(!$cansee) throw $this->createNotFoundException('Permission denied');
$canupdate=false;
if($user) $canupdate=true;
$canupdate=$this->get('session')->get('cancreateblog');
}
$pagination=15;
@ -355,6 +357,7 @@ class BlogController extends Controller
else
$em->getRepository("CadolesPortalBundle:Blogarticle")->getBlogsArticles($blogs,($page-1)*$pagination,$pagination,$count,$blogarticles);
return $this->render($this->labelentity.':view.html.twig', [
'useheader' => ($access=="config"),
'usemenu' => false,

View File

@ -142,6 +142,9 @@ class CalendarController extends Controller
public function submitAction(Request $request,$access="config")
{
if($access=="user"&&!$this->get('session')->get('cancreatecalendar'))
throw $this->createNotFoundException('Permission denied');
$entity = new Calendar();
$form = $this->entityForm($entity,$access);
@ -326,8 +329,7 @@ class CalendarController extends Controller
}
$calendars=array_merge($calendarsuser,$calendarsadmin->toArray(),$calendarsshared);
$canupdate=false;
if($user) $canupdate=true;
$canupdate=$this->get('session')->get('cancreatecalendar');
}
return $this->render($this->labelentity.':view.html.twig', [

View File

@ -182,6 +182,9 @@ class PageController extends Controller
public function submitAction(Request $request,$access="config")
{
if($access=="user"&&!$this->get('session')->get('cancreatepage'))
throw $this->createNotFoundException('Permission denied');
$entity = new Page();
$entity->setMaxwidth(0);
$entity->setRoworder(0);

View File

@ -12,6 +12,7 @@ use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Ivory\CKEditorBundle\Form\Type\CKEditorType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Tetranz\Select2EntityBundle\Form\Type\Select2EntityType;
class AlertType extends AbstractType
{
@ -55,13 +56,22 @@ class AlertType extends AbstractType
"disabled" => ($options["mode"]=="delete"?true:false),
])
->add('groups', EntityType::class, [
"label" => 'Visible pour les Groupes',
"class" => 'CadolesCoreBundle:Group',
"choice_label" => 'label',
"multiple" => true,
"expanded" => true,
"disabled" => ($options["mode"]=="delete"?true:false),
->add('groups', Select2EntityType::class, [
'label' => 'Visible pour les Groupes',
'class' => 'CadolesCoreBundle:Group',
'text_property' => 'label',
'multiple' => true,
'remote_route' => 'cadoles_core_ajax_group_list',
'primary_key' => 'id',
'text_property' => 'label',
'minimum_input_length' => 0,
'page_limit' => 100,
'allow_clear' => true,
'delay' => 250,
'cache' => false,
'cache_timeout' => 60000,
'language' => 'fr',
'placeholder' => 'Selectionner un groupe',
])
->add('publishedat', DateType::class, [

View File

@ -43,12 +43,11 @@ class AlertcategoryType extends AbstractType
)
);
$builder->add('color',
ColorType::class, array(
'label' => 'Couleur',
'attr' => ['placeholder' => '#FF0066']
)
);
$builder->add('color', TextType::class, [
'label' => "Couleur",
'required' => false,
'attr' => array("class" => "pick-a-color")
]);
}
public function configureOptions(OptionsResolver $resolver)

View File

@ -9,6 +9,7 @@ use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\Extension\Core\Type\IntegerType;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Tetranz\Select2EntityBundle\Form\Type\Select2EntityType;
use Symfony\Component\OptionsResolver\OptionsResolver;
@ -41,13 +42,22 @@ class BlogType extends AbstractType
"disabled" => ($options["mode"]=="delete"?true:false),
])
->add('groups', EntityType::class, [
"label" => 'Visible pour les Groupes',
"class" => 'CadolesCoreBundle:Group',
"choice_label" => 'label',
"multiple" => true,
"expanded" => true,
"disabled" => ($options["mode"]=="delete"?true:false),
->add('groups', Select2EntityType::class, [
'label' => 'Visible pour les Groupes',
'class' => 'CadolesCoreBundle:Group',
'text_property' => 'label',
'multiple' => true,
'remote_route' => 'cadoles_core_ajax_group_list',
'primary_key' => 'id',
'text_property' => 'label',
'minimum_input_length' => 0,
'page_limit' => 100,
'allow_clear' => true,
'delay' => 250,
'cache' => false,
'cache_timeout' => 60000,
'language' => 'fr',
'placeholder' => 'Selectionner un groupe',
]);
}
}

View File

@ -39,10 +39,10 @@ class BookmarkType extends AbstractType
])
->add('color', ColorType::class, [
"label" => 'Couleur de la tuile',
"required" => false,
"attr" => ['placeholder' => '#FF0066'],
->add('color', TextType::class, [
'label' => "Couleur",
'required' => false,
'attr' => array("class" => "pick-a-color")
])
->add('url')

View File

@ -10,6 +10,7 @@ use Symfony\Component\Form\Extension\Core\Type\IntegerType;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\PasswordType;
use Tetranz\Select2EntityBundle\Form\Type\Select2EntityType;
use Symfony\Component\OptionsResolver\OptionsResolver;
@ -79,13 +80,22 @@ class CalendarType extends AbstractType
"disabled" => ($options["mode"]=="delete"?true:false),
])
->add('groups', EntityType::class, [
"label" => 'Visible pour les Groupes',
"class" => 'CadolesCoreBundle:Group',
"choice_label" => 'label',
"multiple" => true,
"expanded" => true,
"disabled" => ($options["mode"]=="delete"?true:false),
->add('groups', Select2EntityType::class, [
'label' => 'Visible pour les Groupes',
'class' => 'CadolesCoreBundle:Group',
'text_property' => 'label',
'multiple' => true,
'remote_route' => 'cadoles_core_ajax_group_list',
'primary_key' => 'id',
'text_property' => 'label',
'minimum_input_length' => 0,
'page_limit' => 100,
'allow_clear' => true,
'delay' => 250,
'cache' => false,
'cache_timeout' => 60000,
'language' => 'fr',
'placeholder' => 'Selectionner un groupe',
]);
}
}

View File

@ -13,6 +13,7 @@ use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Ivory\CKEditorBundle\Form\Type\CKEditorType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Tetranz\Select2EntityBundle\Form\Type\Select2EntityType;
class FluxType extends AbstractType
{
@ -54,13 +55,22 @@ class FluxType extends AbstractType
"disabled" => ($options["mode"]=="delete"?true:false),
])
->add('groups', EntityType::class, [
"label" => 'Visible pour les Groupes',
"class" => 'CadolesCoreBundle:Group',
"choice_label" => 'label',
"multiple" => true,
"expanded" => true,
"disabled" => ($options["mode"]=="delete"?true:false),
->add('groups', Select2EntityType::class, [
'label' => 'Visible pour les Groupes',
'class' => 'CadolesCoreBundle:Group',
'text_property' => 'label',
'multiple' => true,
'remote_route' => 'cadoles_core_ajax_group_list',
'primary_key' => 'id',
'text_property' => 'label',
'minimum_input_length' => 0,
'page_limit' => 100,
'allow_clear' => true,
'delay' => 250,
'cache' => false,
'cache_timeout' => 60000,
'language' => 'fr',
'placeholder' => 'Selectionner un groupe',
]);
}

View File

@ -14,6 +14,7 @@ use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Symfony\Component\Form\Extension\Core\Type\ColorType;
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
use Tetranz\Select2EntityBundle\Form\Type\Select2EntityType;
use Ivory\CKEditorBundle\Form\Type\CKEditorType;
class ItemType extends AbstractType
@ -67,20 +68,29 @@ class ItemType extends AbstractType
"disabled" => ($options["mode"]=="delete"?true:false),
])
->add('groups', EntityType::class, [
"label" => 'Visible pour les Groupes',
"class" => 'CadolesCoreBundle:Group',
"choice_label" => 'label',
"multiple" => true,
"expanded" => true,
"disabled" => ($options["mode"]=="delete"?true:false),
->add('groups', Select2EntityType::class, [
'label' => 'Visible pour les Groupes',
'class' => 'CadolesCoreBundle:Group',
'text_property' => 'label',
'multiple' => true,
'remote_route' => 'cadoles_core_ajax_group_list',
'primary_key' => 'id',
'text_property' => 'label',
'minimum_input_length' => 0,
'page_limit' => 100,
'allow_clear' => true,
'delay' => 250,
'cache' => false,
'cache_timeout' => 60000,
'language' => 'fr',
'placeholder' => 'Selectionner un groupe',
])
->add('color', ColorType::class, [
"label" => 'Couleur de la tuile',
"required" => false,
"attr" => ['placeholder' => '#FF0066'],
])
->add('color', TextType::class, [
'label' => "Couleur",
'required' => false,
'attr' => array("class" => "pick-a-color")
])
->add('url')

View File

@ -13,6 +13,7 @@ use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Ivory\CKEditorBundle\Form\Type\CKEditorType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Tetranz\Select2EntityBundle\Form\Type\Select2EntityType;
class NoticeType extends AbstractType
{
@ -62,13 +63,22 @@ class NoticeType extends AbstractType
"disabled" => ($options["mode"]=="delete"?true:false),
])
->add('groups', EntityType::class, [
"label" => 'Visible pour les Groupes',
"class" => 'CadolesCoreBundle:Group',
"choice_label" => 'label',
"multiple" => true,
"expanded" => true,
"disabled" => ($options["mode"]=="delete"?true:false),
->add('groups', Select2EntityType::class, [
'label' => 'Visible pour les Groupes',
'class' => 'CadolesCoreBundle:Group',
'text_property' => 'label',
'multiple' => true,
'remote_route' => 'cadoles_core_ajax_group_list',
'primary_key' => 'id',
'text_property' => 'label',
'minimum_input_length' => 0,
'page_limit' => 100,
'allow_clear' => true,
'delay' => 250,
'cache' => false,
'cache_timeout' => 60000,
'language' => 'fr',
'placeholder' => 'Selectionner un groupe',
]);
}

View File

@ -10,6 +10,7 @@ use Symfony\Component\Form\Extension\Core\Type\IntegerType;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Ivory\CKEditorBundle\Form\Type\CKEditorType;
use Tetranz\Select2EntityBundle\Form\Type\Select2EntityType;
use Symfony\Component\OptionsResolver\OptionsResolver;
class PageUpdateEditorType extends AbstractType
@ -57,12 +58,22 @@ class PageUpdateEditorType extends AbstractType
"disabled" => ($options["mode"]=="delete"?true:false),
])
->add('groups', EntityType::class, [
'label' => 'Visible pour les Groupes',
'class' => 'CadolesCoreBundle:Group',
'choice_label' => 'label',
'multiple' => true,
'expanded' => true
->add('groups', Select2EntityType::class, [
'label' => 'Visible pour les Groupes',
'class' => 'CadolesCoreBundle:Group',
'text_property' => 'label',
'multiple' => true,
'remote_route' => 'cadoles_core_ajax_group_list',
'primary_key' => 'id',
'text_property' => 'label',
'minimum_input_length' => 0,
'page_limit' => 100,
'allow_clear' => true,
'delay' => 250,
'cache' => false,
'cache_timeout' => 60000,
'language' => 'fr',
'placeholder' => 'Selectionner un groupe',
]);
}
}

View File

@ -9,6 +9,7 @@ use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\Extension\Core\Type\IntegerType;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Tetranz\Select2EntityBundle\Form\Type\Select2EntityType;
use Symfony\Component\OptionsResolver\OptionsResolver;
class PageUpdateToolType extends AbstractType
@ -44,12 +45,22 @@ class PageUpdateToolType extends AbstractType
"disabled" => ($options["mode"]=="delete"?true:false),
])
->add('groups', EntityType::class, [
'label' => 'Visible pour les Groupes',
'class' => 'CadolesCoreBundle:Group',
'choice_label' => 'label',
'multiple' => true,
'expanded' => true
->add('groups', Select2EntityType::class, [
'label' => 'Visible pour les Groupes',
'class' => 'CadolesCoreBundle:Group',
'text_property' => 'label',
'multiple' => true,
'remote_route' => 'cadoles_core_ajax_group_list',
'primary_key' => 'id',
'text_property' => 'label',
'minimum_input_length' => 0,
'page_limit' => 100,
'allow_clear' => true,
'delay' => 250,
'cache' => false,
'cache_timeout' => 60000,
'language' => 'fr',
'placeholder' => 'Selectionner un groupe',
]);
}
}

View File

@ -9,6 +9,7 @@ use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\Extension\Core\Type\IntegerType;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Tetranz\Select2EntityBundle\Form\Type\Select2EntityType;
use Symfony\Component\OptionsResolver\OptionsResolver;
class PageUpdateURLType extends AbstractType
@ -53,12 +54,22 @@ class PageUpdateURLType extends AbstractType
"disabled" => ($options["mode"]=="delete"?true:false),
])
->add('groups', EntityType::class, [
'label' => 'Visible pour les Groupes',
'class' => 'CadolesCoreBundle:Group',
'choice_label' => 'label',
'multiple' => true,
'expanded' => true
->add('groups', Select2EntityType::class, [
'label' => 'Visible pour les Groupes',
'class' => 'CadolesCoreBundle:Group',
'text_property' => 'label',
'multiple' => true,
'remote_route' => 'cadoles_core_ajax_group_list',
'primary_key' => 'id',
'text_property' => 'label',
'minimum_input_length' => 0,
'page_limit' => 100,
'allow_clear' => true,
'delay' => 250,
'cache' => false,
'cache_timeout' => 60000,
'language' => 'fr',
'placeholder' => 'Selectionner un groupe',
]);
}
}

View File

@ -10,6 +10,7 @@ use Symfony\Component\Form\Extension\Core\Type\IntegerType;
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Tetranz\Select2EntityBundle\Form\Type\Select2EntityType;
use Symfony\Component\OptionsResolver\OptionsResolver;
class PageUpdateWidgetType extends AbstractType
@ -54,12 +55,22 @@ class PageUpdateWidgetType extends AbstractType
"disabled" => ($options["mode"]=="delete"?true:false),
])
->add('groups', EntityType::class, [
'label' => 'Visible pour les Groupes',
'class' => 'CadolesCoreBundle:Group',
'choice_label' => 'label',
'multiple' => true,
'expanded' => true
->add('groups', Select2EntityType::class, [
'label' => 'Visible pour les Groupes',
'class' => 'CadolesCoreBundle:Group',
'text_property' => 'label',
'multiple' => true,
'remote_route' => 'cadoles_core_ajax_group_list',
'primary_key' => 'id',
'text_property' => 'label',
'minimum_input_length' => 0,
'page_limit' => 100,
'allow_clear' => true,
'delay' => 250,
'cache' => false,
'cache_timeout' => 60000,
'language' => 'fr',
'placeholder' => 'Selectionner un groupe',
]);
}
}

View File

@ -27,7 +27,7 @@
"
data-alert-category-id="{{ alert.alertcategory.id }}"
data-alert-id="{{ alert.id }}"
style="background: {{ alert.alertcategory.color }};"
style="background: {{ "#"~alert.alertcategory.color }};"
>
<div class="panel-heading" role="tab">
<a href="{{ path('cadoles_portal_config_alert_update', { id: alert.id }) }}" class="panel-heading-icon pull-left">
@ -69,7 +69,7 @@
<i class="fa fa-edit"></i>
</a>
<a href="#" class="list-group-item active category-alert-item" data-category="{{ alertcategory.id }}" style="border-left: 15px solid {{ alertcategory.color }}; position: inherit;">
<a href="#" class="list-group-item active category-alert-item" data-category="{{ alertcategory.id }}" style="border-left: 15px solid {{ "#"~alertcategory.color }}; position: inherit;">
<i class="fa fa-fw {{ alertcategory.icon }}"></i>
{{ alertcategory.label }}
</a>

View File

@ -11,7 +11,12 @@
</h1>
{{ form_widget(form.submit) }}
<a class="btn btn-default" href={{ path('cadoles_portal_'~access~'_blog_view',{'id':entity.id}) }}>Annuler</a>
{% if access=="config" and mode=="submit" %}
<a class="btn btn-default" href={{ path('cadoles_portal_config_blog') }}>Annuler</a>
{% else %}
<a class="btn btn-default" href={{ path('cadoles_portal_'~access~'_blog_view',{'id':entity.id}) }}>Annuler</a>
{% endif %}
{% if mode=="update" %}
<a href={{ path('cadoles_portal_config_blog_delete',{'id':entity.id}) }}

View File

@ -11,7 +11,11 @@
</h1>
{{ form_widget(form.submit) }}
<a class="btn btn-default" href={{ path('cadoles_portal_'~access~'_calendar_view',{'id':entity.id}) }}>Annuler</a>
{% if access=="config" and mode=="submit" %}
<a class="btn btn-default" href={{ path('cadoles_portal_config_calendar') }}>Annuler</a>
{% else %}
<a class="btn btn-default" href={{ path('cadoles_portal_'~access~'_calendar_view',{'id':entity.id}) }}>Annuler</a>
{% endif %}
{% if mode=="update" %}
<a href={{ path('cadoles_portal_config_calendar_delete',{'id':entity.id}) }}

View File

@ -205,7 +205,14 @@
{% endif %}
{% endfor %}
{% else %}
showCalendar(0, {{ canupdate }});
{% set onecalendarcanupdate = false %}
{% for calendar in calendars %}
{% if calendar.canupdate %}
{% set onecalendarcanupdate = true %}
{% endif %}
{% endfor %}
showCalendar(0, {{ onecalendarcanupdate }});
{% endif %}
});

View File

@ -59,7 +59,7 @@
{{ form_row(form.groups) }}
{{ form_row(form.color) }}
<div id="diviconsel" class="col-md-12 text-left" style="height:140px; padding:20px; text-align:center; background-color: {{ item.color ? item.color : '#000000' }};">
<div id="diviconsel" class="col-md-12 text-left" style="height:140px; padding:20px; text-align:center; background-color: {{ item.color ? "#"~item.color : '#000000' }};">
{% if item.icon %}
<img src="/{{ alias }}/{{ item.icon.label }}" height="100" />
{% endif %}

View File

@ -28,7 +28,7 @@
<div class="grid clearfix">
{% for item in itemcategory.items %}
<div class="grid-item {% for group in item.groups %}{{ ' group-' ~ group.id }}{% endfor %}{% for role in item.roles %}{{ ' role-' ~ role }}{% endfor %}" data-item-id="{{ item.id }}">
<div class="grid-item-content" style="background-color: {{ item.color ? item.color : '#FFF' }};">
<div class="grid-item-content" style="background-color: {{ item.color ? '#'~item.color : '#000' }};">
<span class="item-drag"><i class="fa fa-arrows"></i></span>
<a class="item-link" href="{{ path('cadoles_portal_config_item_update', {"id": item.id}) }}">
<div class="grid-item-logo">

View File

@ -51,7 +51,7 @@
<div class="grid-gutter-sizer"></div>
{% for bookmark in bookmarks %}
<div class="grid-item {{ stylegrid }}">
<div class="grid-item-content" style="background-color: {{ bookmark.color ? bookmark.color : '#FFF' }};">
<div class="grid-item-content" style="background-color: {{ bookmark.color ? "#"~bookmark.color : '#000' }};">
<a style="cursor:pointer" onClick="modBookmark({{ bookmark.id }})" class="item-update"><i style="color: #FFF" class="fa fa-file" title="Modifier le favori"></i></a>
{% if bookmark.target == 'frame' %}

View File

@ -56,7 +56,7 @@
<div class="grid-gutter-sizer"></div>
{% for bookmark in bookmarks %}
<div class="grid-item {{ stylegrid }}">
<div class="grid-item-content" style="background-color: {{ bookmark.color ? bookmark.color : '#FFF' }};">
<div class="grid-item-content" style="background-color: {{ bookmark.color ? "#"~bookmark.color : '#000' }};">
<a style="cursor:pointer" onClick="modBookmark({{ bookmark.id }})" class="item-update"><i style="color: #FFF" class="fa fa-file" title="Modifier le favori"></i></a>
{% if bookmark.target == 'frame' %}
@ -129,7 +129,7 @@
{% endif %}
<div class="grid-item {{ stylegrid }}" data-idcategory="{{ item.itemcategory.id }}" data-iditem="{{ item.id }}">
<div class="grid-item-content" style="background-color: {{ item.color ? item.color : '#FFF' }};">
<div class="grid-item-content" style="background-color: {{ item.color ? "#"~item.color : '#000' }};">
{% if item.content %}
<a style="cursor:pointer" class="item-preview"><i style="color: #FFF" class="fa fa-info" title="Informations sur ce service"></i></a>
{% endif %}

View File

@ -1,7 +1,5 @@
dico
> voir pour ne pas rendre writer ldap obligatoire
> famille cadoles user visible alors que activer cadoles user non visible (car pas de writer ldap)
> refaire un point sur le dico
> ninegate_keyterm pas necessaire si registration désactivé
> Rendre l'alias paramétrage par genconfig
@ -10,10 +8,13 @@ dico
> Annonces pouvant $etre masquées par les utilisateurs
> Cron à horaire fixe
> Pages admin : gérer la notion de propriétaire de la page
> Calendrier admin : gérer la notion de propriétaire de la page
> Calendrier admin : gérer la notion de propriétaire du calendrier
> Blog admin : gérer la notion de propriétaire du blog
> Gestion des signataires de charte
> Calendrier export ICS
> Pages duplicable
> Icone utilisateur
> Calendrier output / input
> Déplacement de widget vers une autre page du meme user
> Annonces dans pages spécifique
@ -21,8 +22,9 @@ dico
> widget rss
> widget opened/closed
> Parametre canshare
> Parametre opentovisitor
> Theme - Reste à mettre un look associé au theme - Voir pour que les themes de base ne force pas le header
> Améliorer la selection des groupes partagé dans pages / items / feed / alert / blog / calendar
> Améliorer la selection des users avec droits d'écriture sur blog / calendar
> Ajouter notion de user avec droits d'écriture sur page
> sur menu pills (dans blog et calendrier ) revoir le style du active

View File

@ -62,6 +62,7 @@ INSERT IGNORE INTO `config` (`order`, `visible`, `changeable`, `required`, `type
('004', 1, 1, 1, 'logo', 'logo', 'uploads/logo/logo.png', '', 'Le logo de votre site'),
('005', 0, 1, 0, 'theme', 'theme', '', '', 'Le theme de votre site'),
('010', 1, 1, 1, 'boolean', 'fgforceconnect', '0', '', 'Forcer la connection afin de rendre votre site privé'),
('040', 1, 1, 1, 'boolean', 'fgheader', '1', '', 'Utiliser une image en bannière du site'),
('041', 1, 1, 1, 'header', 'header', 'uploads/header/header.png', 'fgheader', 'Image en bannière du site'),