Compare commits

..

No commits in common. "996651ca0e6b63b58adac17b48362251cb3bc4e9" and "a78b2051f1f161590eed36408b8b4cad61feec47" have entirely different histories.

4 changed files with 12 additions and 41 deletions

View File

@ -494,13 +494,6 @@ class GroupController extends Controller
$datas=$qb->setFirstResult($start)->setMaxResults($length)->getQuery()->getResult(); $datas=$qb->setFirstResult($start)->setMaxResults($length)->getQuery()->getResult();
$user=$this->getUser(); $user=$this->getUser();
$config=$em->getRepository('CadolesCoreBundle:Config')->find("datausers");
$fields=$config->getValue();
$fields=json_decode($fields,true);
if(!is_array($fields)) $fields=[];
if(!array_key_exists("visite",$fields)) $fields["visite"]["perm"]=0;
$fgviewvisite=($fields["visite"]["perm"]==1);
foreach($datas as $data) { foreach($datas as $data) {
// Propriétaire // Propriétaire
$usergroup=$em->getRepository("CadolesCoreBundle:UserGroup")->findOneBy(["user"=>$data->getId(),"group"=>$id]); $usergroup=$em->getRepository("CadolesCoreBundle:UserGroup")->findOneBy(["user"=>$data->getId(),"group"=>$id]);
@ -529,18 +522,12 @@ class GroupController extends Controller
} }
// Visite // Visite
if($fgviewvisite) { $visite="";
$visite=""; if($usergroup->getVisitedate()) {
if($usergroup->getVisitedate()) { $visite=$usergroup->getVisitedate()->format("d/m/Y H:i")."<br>nb = ".$usergroup->getVisitecpt();
$visite=$usergroup->getVisitedate()->format("d/m/Y H:i")."<br>nb = ".$usergroup->getVisitecpt();
}
} }
if($fgviewvisite)
$tmp=array("DT_RowId"=>"user".$data->getId(),$action,$avatar,$data->getUsername(),$data->getEmail(),$visite,$rolegroup);
else
$tmp=array("DT_RowId"=>"user".$data->getId(),$action,$avatar,$data->getUsername(),$data->getEmail(),$rolegroup);
array_push($output["data"],$tmp); array_push($output["data"],array("DT_RowId"=>"user".$data->getId(),$action,$avatar,$data->getUsername(),$data->getEmail(),$visite,$rolegroup));
} }
// Retour // Retour
@ -1031,14 +1018,6 @@ class GroupController extends Controller
// idreturn ? // idreturn ?
$idreturn=$request->get("idreturn"); $idreturn=$request->get("idreturn");
$em = $this->getDoctrine()->getManager();
$config=$em->getRepository('CadolesCoreBundle:Config')->find("datausers");
$fields=$config->getValue();
$fields=json_decode($fields,true);
if(!is_array($fields)) $fields=[];
if(!array_key_exists("visite",$fields)) $fields["visite"]["perm"]=0;
$fgviewvisite=($fields["visite"]["perm"]==1);
// Affichage du formulaire // Affichage du formulaire
return $this->render($this->labelentity.':users.html.twig', [ return $this->render($this->labelentity.':users.html.twig', [
'useheader' => true, 'useheader' => true,
@ -1047,7 +1026,6 @@ class GroupController extends Controller
'access' => $access, 'access' => $access,
$this->labeldata => $data, $this->labeldata => $data,
'idreturn' => $idreturn, 'idreturn' => $idreturn,
'fgviewvisite' => $fgviewvisite,
]); ]);
} }

View File

@ -841,15 +841,12 @@ class UserController extends Controller
public function viewAction($id, Request $request) public function viewAction($id, Request $request)
{ {
$user=$this->getData($id); $user=$this->getData($id);
$fields=$this->getDefaultDatauser();
return $this->render('CadolesCoreBundle:User:view.html.twig', [ return $this->render('CadolesCoreBundle:User:view.html.twig', [
'useheader' => false, 'useheader' => false,
'usemenu' => false, 'usemenu' => false,
'usesidebar' => false, 'usesidebar' => false,
'user' => $user, "user" => $user
'fields' => $fields,
]); ]);
} }

View File

@ -36,9 +36,7 @@
<th width="70px" class="no-sort">Avatar</th> <th width="70px" class="no-sort">Avatar</th>
<th width="200px">Login</th> <th width="200px">Login</th>
<th>Email</th> <th>Email</th>
{% if fgviewvisite %}
<th class="no-sort no-visible">Visite</th> <th class="no-sort no-visible">Visite</th>
{% endif %}
{% if group.fgcanshare %} {% if group.fgcanshare %}
<th class="no-sort no-visible">Permissions</th> <th class="no-sort no-visible">Permissions</th>
{% endif %} {% endif %}
@ -65,9 +63,7 @@
<th width="70px" class="no-sort">Avatar</th> <th width="70px" class="no-sort">Avatar</th>
<th width="200px">Login</th> <th width="200px">Login</th>
<th>Email</th> <th>Email</th>
{% if fgviewvisite %}
<th class="no-sort">Visite</th> <th class="no-sort">Visite</th>
{% endif %}
{% if group.fgcanshare %} {% if group.fgcanshare %}
<th class="no-sort">Permissions</th> <th class="no-sort">Permissions</th>
{% endif %} {% endif %}

View File

@ -11,16 +11,16 @@
<br>L'utilisateur souhaite masquer ses informations personnelles. <br>L'utilisateur souhaite masquer ses informations personnelles.
{% else %} {% else %}
{%if user.lastname %}<b>Nom</b> = {{ user.lastname }}<br>{%endif%} {%if user.lastname %}<b>Nom</b> = {{ user.lastname }}<br>{%endif%}
{%if user.firstname and not fields["firstname"]["perm"]==0 %}<b>{{fields["firstname"]["label"]}}</b> = {{ user.firstname }}<br>{%endif%} {%if user.firstname %}<b>Prénom</b> = {{ user.firstname }}<br>{%endif%}
{%if user.email %}<b>Email</b> = <a href='mailto:{{ user.email }}'>{{ user.email }}</a><br>{%endif%} {%if user.email %}<b>Email</b> = <a href='mailto:{{ user.email }}'>{{ user.email }}</a><br>{%endif%}
{%if user.telephonenumber and not fields["telephonenumber"]["perm"]==0 %}<b>{{fields["telephonenumber"]["label"]}}</b> = {{ user.telephonenumber }}<br>{%endif%} {%if user.telephonenumber %}<b>Téléphone</b> = {{ user.telephonenumber }}<br>{%endif%}
{%if user.niveau01 %}<b>{{ labelniveau01 }}</b> = {{ user.niveau01.label }}<br>{%endif%} {%if user.niveau01 %}<b>{{ labelniveau01 }}</b> = {{ user.niveau01.label }}<br>{%endif%}
{%if viewniveau02 and user.niveau02%}<b>{{ labelniveau02 }}</b> = {{ user.niveau02.label }}<br>{% endif %} {%if viewniveau02 and user.niveau02%}<b>{{ labelniveau02 }}</b> = {{ user.niveau02.label }}<br>{% endif %}
{%if user.job and not fields["job"]["perm"]==0 %}<b>{{fields["position"]["job"]}}</b> = {{ user.job }}<br>{%endif%} {%if user.job %}<b>Métier</b> = {{ user.job }}<br>{%endif%}
{%if user.position and not fields["position"]["perm"]==0 %}<b>{{fields["position"]["label"]}}</b> = {{ user.position }}<br>{%endif%} {%if user.position %}<b>Fonction</b> = {{ user.position }}<br>{%endif%}
{%if user.postaladress and not fields["postaladress"]["perm"]==0 %}<b>{{fields["postaladress"]["label"]}}</b> = {{ user.postaladress }}<br>{%endif%} {%if user.postaladress %}<b>Adresse</b> = {{ user.postaladress }}<br>{%endif%}
{%if user.visitedate and not fields["visite"]["perm"]==0 %}<b>Date de dernière visite</b> = {{ user.visitedate|date('d/m/Y H:i') }}<br>{%endif%} {%if user.visitedate %}<b>Date de dernière visite</b> = {{ user.visitedate|date('d/m/Y H:i') }}<br>{%endif%}
{%if user.visitecpt and not fields["visite"]["perm"]==0 %}<b>Nombre de visites</b> = {{ user.visitecpt }}<br>{%endif%} {%if user.visitecpt %}<b>Nombre de visites</b> = {{ user.visitecpt }}<br>{%endif%}
<br> <br>
{% set fgtitle=false %} {% set fgtitle=false %}
{% for usergroup in user.groups %} {% for usergroup in user.groups %}