widget only preference

This commit is contained in:
afornerot 2020-09-22 11:33:31 +02:00
parent 8f2e412b60
commit e029ad79a6
2 changed files with 60 additions and 8 deletions

View File

@ -76,13 +76,13 @@ class FrameController extends Controller
}
if((!array_key_exists($directory,$preference["widgetsortdirectory"]))) {
$toupdate=true;
$preference["widgetsortdirectory"][$directory]="name";
$preference["widgetsortdirectory"][$directory]="title";
}
if($sort&&$preference["widgetsortdirectory"][$directory]!=$sort) {
$toupdate=true;
$preference["widgetsortdirectory"][$directory]=$sort;
}
// Mise à jour des préferences
if($toupdate) {
$em = $this->getDoctrine()->getManager();
@ -96,6 +96,33 @@ class FrameController extends Controller
$firstfolder=($subdirectory?$subdirectory:null);
$files=$onlyservice->getDocument($grp->getId(), $firstfolder, $parents, $tasks);
// Trie Fichier
$tmpfiles=$files[$firstfolder]["files"];
foreach($tmpfiles as $key => $value) {
$tmpfiles[$key]->author=$value->updatedBy->displayName;
$tmpfiles[$key]->updatedformat= date('d/m/Y h:i', strtotime($value->updated));
}
$sort = array_column($tmpfiles, $preference["widgetsortdirectory"][$directory]);
array_multisort($sort, SORT_ASC, $tmpfiles);
$files[$firstfolder]["files"] = $tmpfiles;
// Trie Dossier
$tmpdirs=$files[$firstfolder]["folders"];
foreach($tmpdirs as $key => $value) {
$tmpdirs[$key]["title"]=$value["info"]->title;
$tmpdirs[$key]["updated"]= $value["info"]->updated;
$tmpdirs[$key]["updatedformat"]= date('d/m/Y h:i', strtotime($value["info"]->updated));
$tmpdirs[$key]["author"]=$value["info"]->updatedBy->displayName;
}
$sort = array_column($tmpdirs, $preference["widgetsortdirectory"][$directory]);
array_multisort($sort, SORT_ASC, $tmpdirs);
$files[$firstfolder]["folders"] = $tmpdirs;
//$sort = array_column($tmpfiles, $preference["widgetsortdirectory"][$directory]);
//array_multisort($sort, SORT_ASC, $tmpfiles);
//$files[$firstfolder]["files"] = $tmpfiles;
// Récupération du numéro de groupe oo
if($grp) $idonly= $grp->getIdOnlyoffice();
else $idonly=0;

View File

@ -11,10 +11,15 @@
.grid .grid-list .grid-item-title h2 {
font-size: 14px;
line-height: 22px;
height: 22px;
line-height: 18px;
height: 18px
}
.grid .grid-list .grid-item-title {
padding:0px 0px 0px 5px;
line-height: 10px;
}
.grid-item-title h2 {
text-transform: initial !important;
}
@ -39,19 +44,38 @@
{% else %}
{%set action="small" %}
{% endif %}
{% if not subdirectory is empty %}
<a href="{{ path('cadoles_portal_'~access~'_frame_only',{'directory':directory,'subdirectory':subdirectory,'view':action }) }}" type="button" class="btn btn-primary">
{% else %}
<a href="{{ path('cadoles_portal_'~access~'_frame_only',{'directory':directory,'clear':true,'view':action }) }}" type="button" class="btn btn-primary">
{% endif %}
{% if view=="small" %}
<i class="fas fa-list"></i>
{% else %}
<i class="fas fa-th"></i>
{% endif %}
</a>
{% if sort=="title" %}
{%set action="updated" %}
{% elseif sort=="updated" %}
{%set action="author" %}
{% else %}
{%set action="title" %}
{% endif %}
{% if not subdirectory is empty %}
<a href="{{ path('cadoles_portal_'~access~'_frame_only',{'directory':directory,'subdirectory':subdirectory,'sort':action }) }}" type="button" class="btn btn-primary">
{% else %}
<a href="{{ path('cadoles_portal_'~access~'_frame_only',{'directory':directory,'clear':true,'sort':action }) }}" type="button" class="btn btn-primary">
{% endif %}
{% if sort=="title" %}
<i class="fas fa-long-arrow-alt-down"></i> Nom
{% elseif sort=="updated" %}
<i class="fas fa-long-arrow-alt-down"></i> Date
{% else %}
<i class="fas fa-long-arrow-alt-down"></i> Utilisateur
{% endif %}
</a>
</div>
</div>
@ -83,7 +107,7 @@
</div>
<div class="grid-item-title">
<h2>{{ folder.info.title }}</h2>
<h2>{{ folder.info.title }}</h2>{% if view=="list" %}<small>le {{ folder.updatedformat }} par {{ folder.author }}</small>{%endif%}
</div>
</div>
</a>
@ -105,7 +129,7 @@
</div>
<div class="grid-item-title">
<h2>{{ file.title }}</h2>
<h2>{{ file.title }}</h2>{% if view=="list" %}<small>le {{ file.updatedformat }} par {{ file.author }}</small>{%endif%}
</div>
</div>
</a>
@ -158,6 +182,7 @@
}
$(".grid-item-title > h2").css("color",color);
$(".grid-item-title > small").css("color",color);
$("#onlytasks").css("color",color);
});