Fixed user_groups.twig because it was `id_cluster` instead of

`id_user_cluster`
This commit is contained in:
xdrm-brackets 2017-01-09 14:49:00 +01:00
parent 5b1dc1cb5f
commit 4a8d81b221
4 changed files with 50 additions and 40 deletions

View File

@ -1,31 +1,31 @@
<input type='text' class='searchbar' placeholder='Recherche'> <input type='text' class='searchbar' placeholder='Recherche'>
{% for cluster in f_clusters() %} {% for cluster in f_clusters() %}
<article class='inline-box' id='{{ cluster.id_cluster }}'> <article class='inline-box' id='{{ cluster.id_user_cluster }}'>
<span class='title' style='color: {{ p_theme }}'>{{ cluster.name }}</span> <span class='title' style='color: {{ p_theme }}'>{{ cluster.name }}</span>
<span class='link_remove' data-cluster='{{ cluster.id_cluster }}'>{{ p_icon.remove | raw }}</span> <span class='link_remove' data-cluster='{{ cluster.id_user_cluster }}'>{{ p_icon.remove | raw }}</span>
<span class='link_edit' data-cluster='{{ cluster.id_cluster }}'>{{ p_icon.edit | raw }}</span> <span class='link_edit' data-cluster='{{ cluster.id_user_cluster }}'>{{ p_icon.edit | raw }}</span>
<span class='code'> <span class='code'>
{{ p_icon.type | raw }} {{ p_icon.type | raw }}
<span>{{ f_users(cluster.id_cluster) | length }} utilisateurs</span> <span>{{ f_users(cluster.id_user_cluster) | length }} utilisateurs</span>
</span> </span>
<span class='groups'> <span class='groups'>
{{ p_icon.group | raw }} {{ p_icon.group | raw }}
{% for user in f_users(cluster.id_cluster) %} {% for user in f_users(cluster.id_user_cluster) %}
<span> <span>
{{ user.username }} {{ user.username }}
<span class='rem-member' data-member='{{ user.id_user }}' data-cluster='{{ cluster.id_cluster }}'></span> <span class='rem-member' data-member='{{ user.id_user }}' data-cluster='{{ cluster.id_user_cluster }}'></span>
</span> </span>
{% endfor %} {% endfor %}
<span class='add-member' data-cluster='{{ cluster.id_cluster }}'>+</span> <span class='add-member' data-cluster='{{ cluster.id_user_cluster }}'>+</span>
</span> </span>
</article> </article>

3
lib/composer.lock generated
View File

@ -4,6 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"hash": "53cb678421f8ca86acfaa787070836fa",
"content-hash": "36bf97cd29216ef33bf0022d7680ab49", "content-hash": "36bf97cd29216ef33bf0022d7680ab49",
"packages": [ "packages": [
{ {
@ -63,7 +64,7 @@
"portable", "portable",
"shim" "shim"
], ],
"time": "2016-11-14T01:06:16+00:00" "time": "2016-11-14 01:06:16"
}, },
{ {
"name": "twig/twig", "name": "twig/twig",

View File

@ -1,26 +1,35 @@
var section={view:{text:'#CONTAINER > section[data-sublink="view"] ',element:document.querySelector('#CONTAINER > section[data-sublink="view"]'),searchbar:document.querySelector('#CONTAINER > section[data-sublink="view"] > .searchbar')},create:{text:'#CONTAINER > section[data-sublink="create"] ',element:document.querySelector('#CONTAINER > section[data-sublink="create"]')},remove:{text:'#CONTAINER > section[data-sublink="remove"] ',element:document.querySelector('#CONTAINER > section[data-sublink="remove"]')}, // On referencie toutes les sections
edit:{text:'#CONTAINER > section[data-sublink="edit"] ',element:document.querySelector('#CONTAINER > section[data-sublink="edit"]')},groups:{text:'#CONTAINER > section[data-sublink="groups"] ',element:document.querySelector('#CONTAINER > section[data-sublink="groups"]'),searchbar:document.querySelector('#CONTAINER > section[data-sublink="groups"] > .searchbar')}}; // gestion automatique au chargement de la page si id_user dans url "/users/.+/:id_user:"
if(null!=section.view.element){1<pageManager.vars.length&&!isNaN(pageManager.vars[1])&&(document.location="#"+pageManager.vars[1],null!=document.getElementById(pageManager.vars[1])&&document.getElementById(pageManager.vars[1]).addClass("selected"));section.view.link={edit:document.querySelectorAll(section.view.text+".link_edit[data-user]"),remove:document.querySelectorAll(section.view.text+".link_remove[data-user]")};section.view.group={rem:document.querySelectorAll(section.view.text+".rem-group[data-user][data-group]"), function autofill_remove(){var e={id_user:"",username:"",code:"",disable_input:!0}
add:document.querySelectorAll(section.view.text+".add-group[data-user]")};section.view.searchbar.addEventListener("keyup",function(a){api.send({path:"userDefault/search",keywords:section.view.searchbar.value},function(a){if(0==a.ModuleError&&(console.log(a.users.length),0==a.ModuleError)){for(var d=[],b=0;b<a.users.length;b++)d.push(a.users[b].id_user);a=document.querySelectorAll(section.view.text+"> article.inline-box[id]");for(b=0;b<a.length;b++)-1<d.indexOf(a[b].id)?a[b].remClass("hidden"):a[b].addClass("hidden")}})}, null==found_remove[searchindex_remove]?(section.remove.input.search.num.innerHTML=0,searchindex_remove=0):(e={id_user:found_remove[searchindex_remove].id_user,username:found_remove[searchindex_remove].username,code:found_remove[searchindex_remove].code,disable_input:!1},section.remove.input.search.num.innerHTML=searchindex_remove+1),section.remove.input.search.id.value=e.id_user,section.remove.input.username.value=e.username,section.remove.input.code.value=e.code,section.remove.input.submit.disabled=e.disable_input}function autofill_edit(){var e={id_user:"",code:"",username:"",firstname:"",lastname:"",mail:"",disable_input:!0}
!1);for(var i=0;i<section.view.link.edit.length;i++)section.view.link.edit[i].addEventListener("click",function(a){pageManager.vars[1]=a.target.getData("user");navSubMenu("edit");document.location=""},!1);for(i=0;i<section.view.link.remove.length;i++)section.view.link.remove[i].addEventListener("click",function(a){pageManager.vars[1]=a.target.getData("user");navSubMenu("remove");document.location=""},!1);for(i=0;i<section.view.group.rem.length;i++)section.view.group.rem[i].addEventListener("click", null==found_edit[searchindex_edit]?(section.edit.input.search.num.innerHTML=0,searchindex_edit=0):(e={id_user:found_edit[searchindex_edit].id_user,code:found_edit[searchindex_edit].code,username:found_edit[searchindex_edit].username,firstname:found_edit[searchindex_edit].firstname,lastname:found_edit[searchindex_edit].lastname,mail:found_edit[searchindex_edit].mail,disable_input:!1},section.edit.input.search.num.innerHTML=searchindex_edit+1),section.edit.input.search.id.value=e.id_user,section.edit.input.code.value=e.code,section.edit.input.username.value=e.username,section.edit.input.firstname.value=e.firstname,section.edit.input.lastname.value=e.lastname,section.edit.input.mail.value=e.mail,section.edit.input.submit.disabled=e.disable_input}var section={view:{text:'#CONTAINER > section[data-sublink="view"] ',element:document.querySelector('#CONTAINER > section[data-sublink="view"]'),searchbar:document.querySelector('#CONTAINER > section[data-sublink="view"] > .searchbar')},create:{text:'#CONTAINER > section[data-sublink="create"] ',element:document.querySelector('#CONTAINER > section[data-sublink="create"]')},remove:{text:'#CONTAINER > section[data-sublink="remove"] ',element:document.querySelector('#CONTAINER > section[data-sublink="remove"]')},edit:{text:'#CONTAINER > section[data-sublink="edit"] ',element:document.querySelector('#CONTAINER > section[data-sublink="edit"]')},groups:{text:'#CONTAINER > section[data-sublink="groups"] ',element:document.querySelector('#CONTAINER > section[data-sublink="groups"]'),searchbar:document.querySelector('#CONTAINER > section[data-sublink="groups"] > .searchbar')}}
function(a){var c={path:"userDefault/unlink",id_user:a.target.getData("user"),id_cluster:a.target.getData("group")};api.send(c,function(c){if(0!=c.ModuleError)return!1;a.target.parentNode.parentNode.removeChild(a.target.parentNode)})},!1)} if(null!=section.view.element){pageManager.vars.length>1&&!isNaN(pageManager.vars[1])&&(document.location="#"+pageManager.vars[1],null!=document.getElementById(pageManager.vars[1])&&document.getElementById(pageManager.vars[1]).addClass("selected")),section.view.link={edit:document.querySelectorAll(section.view.text+".link_edit[data-user]"),remove:document.querySelectorAll(section.view.text+".link_remove[data-user]")},section.view.group={rem:document.querySelectorAll(section.view.text+".rem-group[data-user][data-group]"),add:document.querySelectorAll(section.view.text+".add-group[data-user]")},section.view.searchbar.addEventListener("keyup",function(e){var t={path:"userDefault/search",keywords:section.view.searchbar.value}
if(null!=section.create.element){section.create.input={code:document.querySelector(section.create.text+"#create_code"),username:document.querySelector(section.create.text+"#create_username"),firstname:document.querySelector(section.create.text+"#create_firstname"),lastname:document.querySelector(section.create.text+"#create_lastname"),mail:document.querySelector(section.create.text+"#create_mail"),submit:document.querySelector(section.create.text+"#create_submit")};var createChecker=new inputChecker; api.send(t,function(e){if(0==e.ModuleError&&(console.log(e.users.length),0==e.ModuleError)){for(var t=[],r=0;r<e.users.length;r++)t.push(e.users[r].id_user)
createChecker.append(section.create.input.code,format_code,"01-AB-CD-23");section.create.input.code.addEventListener("keyup",function(a){a.target.value=a.target.value.toUpperCase();createChecker.check(a.target)||createChecker.correct(a.target,!1)},!1);section.create.input.submit.addEventListener("click",function(a){a.preventDefault();api.send({path:"userDefault/create",code:section.create.input.code.value,username:section.create.input.username.value,firstname:section.create.input.firstname.value, for(var i=document.querySelectorAll(section.view.text+"> article.inline-box[id]"),r=0;r<i.length;r++)t.indexOf(i[r].id)>-1?i[r].remClass("hidden"):i[r].addClass("hidden")}})},!1)
lastname:section.create.input.lastname.value,mail:section.create.input.mail.value},function(a){0==a.ModuleError?(console.log("Utilisateur cree!"),section.create.input.submit.anim("active",1500),section.create.input.code.value="",section.create.input.username.value="",section.create.input.firstname.value="",section.create.input.lastname.value="",section.create.input.mail.value=""):console.error("ModuleError::"+a.ModuleError)})},!1)} for(var i=0;i<section.view.link.edit.length;i++)section.view.link.edit[i].addEventListener("click",function(e){pageManager.vars=["edit",e.target.getData("user")],pageManager.refresh()},!1)
if(null!=section.remove.element){var autofill_remove=function(){var a="",c="",d="",b=!0;null==found_remove[searchindex_remove]?searchindex_remove=section.remove.input.search.num.innerHTML=0:(a=found_remove[searchindex_remove].id_user,c=found_remove[searchindex_remove].username,d=found_remove[searchindex_remove].code,b=!1,section.remove.input.search.num.innerHTML=searchindex_remove+1);section.remove.input.search.id.value=a;section.remove.input.username.value=c;section.remove.input.code.value=d;section.remove.input.submit.disabled= for(var i=0;i<section.view.link.remove.length;i++)section.view.link.remove[i].addEventListener("click",function(e){pageManager.vars=["remove",e.target.getData("user")],pageManager.refresh()},!1)
b};section.remove.input={search:{view:document.querySelector(section.remove.text+".remove_search_view"),num:document.querySelector(section.remove.text+".remove_search_num"),sum:document.querySelector(section.remove.text+".remove_search_sum"),keyword:document.querySelector(section.remove.text+"#remove_search_keyword"),id:document.querySelector(section.remove.text+"#remove_search_id"),submit:document.querySelector(section.remove.text+"#remove_search_submit")},code:document.querySelector(section.remove.text+ for(var i=0;i<section.view.group.rem.length;i++)section.view.group.rem[i].addEventListener("click",function(e){var t={path:"userDefault/unlink",id_user:e.target.getData("user"),id_cluster:e.target.getData("group")}
"#remove_code"),username:document.querySelector(section.remove.text+"#remove_username"),submit:document.querySelector(section.remove.text+"#remove_submit")};var lastkeywords_remove="",found_remove=[],searchindex_remove=0;2<=pageManager.vars.length&&!isNaN(pageManager.vars[1])&&api.send({path:"userDefault/getById",id_user:pageManager.vars[1]},function(a){0==a.ModuleError&&(found_remove=[a.user],searchindex_remove=0,autofill_remove())});section.remove.input.search.submit.addEventListener("click",function(a){a.preventDefault(); api.send(t,function(t){return 0==t.ModuleError&&void e.target.parentNode.parentNode.removeChild(e.target.parentNode)})},!1)}if(null!=section.create.element){section.create.input={code:document.querySelector(section.create.text+"#create_code"),username:document.querySelector(section.create.text+"#create_username"),firstname:document.querySelector(section.create.text+"#create_firstname"),lastname:document.querySelector(section.create.text+"#create_lastname"),mail:document.querySelector(section.create.text+"#create_mail"),submit:document.querySelector(section.create.text+"#create_submit")}
if(""!=section.remove.input.search.keyword.value)if(section.remove.input.search.keyword.value==lastkeywords_remove)searchindex_remove=(searchindex_remove+1)%found_remove.length,autofill_remove();else{var c={path:"userDefault/search",keywords:section.remove.input.search.keyword.value};api.send(c,function(a){0==a.ModuleError&&(section.remove.input.search.submit.anim("active",1E3),searchindex_remove=0,found_remove=a.users,section.remove.input.search.sum.innerHTML=found_remove.length,autofill_remove()); var createChecker=new inputChecker
lastkeywords_remove=c.keywords})}},!1);section.remove.input.submit.addEventListener("click",function(a){a.preventDefault();""!=section.remove.input.search.id.value&&api.send({path:"userDefault/delete",id_user:section.remove.input.search.id.value},function(a){0==a.ModuleError&&1==a.status?(console.log("Utilisateur supprime!"),section.remove.input.submit.anim("active",1500),0==section.remove.input.search.keyword.value.length?(found_remove=[],searchindex_remove=0):api.send({path:"userDefault/search", createChecker.append(section.create.input.code,format_code,"01-AB-CD-23"),section.create.input.code.addEventListener("keyup",function(e){e.target.value=e.target.value.toUpperCase(),createChecker.check(e.target)||createChecker.correct(e.target,!1)},!1),section.create.input.submit.addEventListener("click",function(e){e.preventDefault()
keywords:section.remove.input.search.keyword.value},function(a){0==a.ModuleError&&(searchindex_remove=0,found_remove=a.users,section.remove.input.search.sum.innerHTML=found_remove.length)}),autofill_remove()):console.error("ModuleError::"+a.ModuleError)})},!1)} var t={path:"userDefault/create",code:section.create.input.code.value,username:section.create.input.username.value,firstname:section.create.input.firstname.value,lastname:section.create.input.lastname.value,mail:section.create.input.mail.value}
if(null!=section.edit.element){var autofill_edit=function(){var a="",c="",d="",b="",e="",f="",g=!0;null==found_edit[searchindex_edit]?searchindex_edit=section.edit.input.search.num.innerHTML=0:(a=found_edit[searchindex_edit].id_user,c=found_edit[searchindex_edit].code,d=found_edit[searchindex_edit].username,b=found_edit[searchindex_edit].firstname,e=found_edit[searchindex_edit].lastname,f=found_edit[searchindex_edit].mail,g=!1,section.edit.input.search.num.innerHTML=searchindex_edit+1);section.edit.input.search.id.value= api.send(t,function(e){0==e.ModuleError?(console.log("Utilisateur cree!"),section.create.input.submit.anim("active",1500),section.create.input.code.value="",section.create.input.username.value="",section.create.input.firstname.value="",section.create.input.lastname.value="",section.create.input.mail.value=""):console.error("ModuleError::"+e.ModuleError)})},!1)}var lastkeywords_remove="",found_remove=[],searchindex_remove=0
a;section.edit.input.code.value=c;section.edit.input.username.value=d;section.edit.input.firstname.value=b;section.edit.input.lastname.value=e;section.edit.input.mail.value=f;section.edit.input.submit.disabled=g};section.edit.input={search:{view:document.querySelector(section.edit.text+".edit_search_view"),num:document.querySelector(section.edit.text+".edit_search_num"),sum:document.querySelector(section.edit.text+".edit_search_sum"),keyword:document.querySelector(section.edit.text+"#edit_search_keyword"), null!=section.remove.element&&(section.remove.input={search:{view:document.querySelector(section.remove.text+".remove_search_view"),num:document.querySelector(section.remove.text+".remove_search_num"),sum:document.querySelector(section.remove.text+".remove_search_sum"),keyword:document.querySelector(section.remove.text+"#remove_search_keyword"),id:document.querySelector(section.remove.text+"#remove_search_id"),submit:document.querySelector(section.remove.text+"#remove_search_submit")},code:document.querySelector(section.remove.text+"#remove_code"),username:document.querySelector(section.remove.text+"#remove_username"),submit:document.querySelector(section.remove.text+"#remove_submit")},section.remove.input.search.submit.addEventListener("click",function(e){if(e.preventDefault(),""!=section.remove.input.search.keyword.value)if(section.remove.input.search.keyword.value==lastkeywords_remove)searchindex_remove=(searchindex_remove+1)%found_remove.length,autofill_remove()
id:document.querySelector(section.edit.text+"#edit_search_id"),submit:document.querySelector(section.edit.text+"#edit_search_submit")},code:document.querySelector(section.edit.text+"#edit_code"),username:document.querySelector(section.edit.text+"#edit_username"),firstname:document.querySelector(section.edit.text+"#edit_firstname"),lastname:document.querySelector(section.edit.text+"#edit_lastname"),mail:document.querySelector(section.edit.text+"#edit_mail"),submit:document.querySelector(section.edit.text+ else{var t={path:"userDefault/search",keywords:section.remove.input.search.keyword.value}
"#edit_submit")};var lastkeywords_edit="",found_edit=[],searchindex_edit=0;2<=pageManager.vars.length&&!isNaN(pageManager.vars[1])&&api.send({path:"userDefault/getById",id_user:pageManager.vars[1]},function(a){0==a.ModuleError&&(found_edit=[a.user],searchindex_edit=0,autofill_edit())});section.edit.input.search.submit.addEventListener("click",function(a){a.preventDefault();if(""!=section.edit.input.search.keyword.value)if(section.edit.input.search.keyword.value==lastkeywords_edit)searchindex_edit= api.send(t,function(e){0==e.ModuleError&&(section.remove.input.search.submit.anim("active",1e3),searchindex_remove=0,found_remove=e.users,section.remove.input.search.sum.innerHTML=found_remove.length,autofill_remove()),lastkeywords_remove=t.keywords})}},!1),section.remove.input.submit.addEventListener("click",function(e){if(e.preventDefault(),""!=section.remove.input.search.id.value){var t={path:"userDefault/delete",id_user:section.remove.input.search.id.value}
(searchindex_edit+1)%found_edit.length,autofill_edit();else{var c={path:"userDefault/search",keywords:section.edit.input.search.keyword.value};api.send(c,function(a){0==a.ModuleError&&(section.edit.input.search.submit.anim("active",1E3),searchindex_edit=0,found_edit=a.users,section.edit.input.search.sum.innerHTML=found_edit.length,autofill_edit());lastkeywords_edit=c.keywords})}},!1);section.edit.input.submit.addEventListener("click",function(a){a.preventDefault();if(""!=section.edit.input.search.id.value){var c= api.send(t,function(e){if(0==e.ModuleError&&1==e.status){if(console.log("Utilisateur supprime!"),section.remove.input.submit.anim("active",1500),0==section.remove.input.search.keyword.value.length)found_remove=[],searchindex_remove=0
{path:"userDefault/edit",id_user:parseInt(section.edit.input.search.id.value),code:section.edit.input.code.value,username:section.edit.input.username.value,firstname:section.edit.input.firstname.value,lastname:section.edit.input.lastname.value,mail:section.edit.input.mail.value};api.send(c,function(a){console.log(a);0==a.ModuleError&&1==a.status?(console.log("Utilisateur modifie!"),section.edit.input.submit.anim("active",1500),api.send({path:"userDefault/getById",id_user:c.id_user},function(a){0== else{var t={path:"userDefault/search",keywords:section.remove.input.search.keyword.value}
a.ModuleError&&(found_edit[searchindex_edit]=a.user,autofill_edit())})):console.error("ModuleError::"+a.ModuleError)})}},!1)} api.send(t,function(e){0==e.ModuleError&&(searchindex_remove=0,found_remove=e.users,section.remove.input.search.sum.innerHTML=found_remove.length)})}autofill_remove()}else console.error("ModuleError::"+e.ModuleError)})}},!1))
if(null!=section.groups.element){section.groups.link={remove:document.querySelectorAll(section.groups.text+".link_remove[data-cluster]"),edit:document.querySelectorAll(section.groups.text+".link_edit[data-cluster]")};section.groups.group={rem:document.querySelectorAll(section.groups.text+".rem-member[data-cluster][data-member]"),add:document.querySelectorAll(section.groups.text+".add-member[data-cluster]")};section.groups.searchbar.addEventListener("keyup",function(a){api.send({path:"clusterDefault/search", var lastkeywords_edit="",found_edit=[],searchindex_edit=0
keywords:section.groups.searchbar.value,"class":0},function(a){if(0==a.ModuleError){for(var d=[],b=0;b<a.clusters.length;b++)d.push(a.clusters[b].id_user_cluster);a=document.querySelectorAll(section.groups.text+"> article.inline-box[id]");for(b=0;b<a.length;b++)-1<d.indexOf(parseInt(a[b].id))?a[b].remClass("hidden"):a[b].addClass("hidden")}})},!1);for(i=0;i<section.groups.link.edit.length;i++)section.groups.link.edit[i].addEventListener("click",function(a){pageManager.vars[0]="edit";pageManager.vars[1]= if(null!=section.edit.element&&(section.edit.input={search:{view:document.querySelector(section.edit.text+".edit_search_view"),num:document.querySelector(section.edit.text+".edit_search_num"),sum:document.querySelector(section.edit.text+".edit_search_sum"),keyword:document.querySelector(section.edit.text+"#edit_search_keyword"),id:document.querySelector(section.edit.text+"#edit_search_id"),submit:document.querySelector(section.edit.text+"#edit_search_submit")},code:document.querySelector(section.edit.text+"#edit_code"),username:document.querySelector(section.edit.text+"#edit_username"),firstname:document.querySelector(section.edit.text+"#edit_firstname"),lastname:document.querySelector(section.edit.text+"#edit_lastname"),mail:document.querySelector(section.edit.text+"#edit_mail"),submit:document.querySelector(section.edit.text+"#edit_submit")},section.edit.input.search.submit.addEventListener("click",function(e){if(e.preventDefault(),""!=section.edit.input.search.keyword.value)if(section.edit.input.search.keyword.value==lastkeywords_edit)searchindex_edit=(searchindex_edit+1)%found_edit.length,autofill_edit()
"u"+a.target.getData("cluster");navMenu("groups",!0)},!1);for(i=0;i<section.groups.link.remove.length;i++)section.groups.link.remove[i].addEventListener("click",function(a){pageManager.vars[0]="remove";pageManager.vars[1]="u"+a.target.getData("cluster");navMenu("groups",!0)},!1);for(i=0;i<section.groups.group.rem.length;i++)section.groups.group.rem[i].addEventListener("click",function(a){var c={path:"userDefault/unlink",id_cluster:a.target.getData("cluster"),id_user:a.target.getData("member")};api.send(c, else{var t={path:"userDefault/search",keywords:section.edit.input.search.keyword.value}
function(c){if(0!=c.ModuleError)return!1;a.target.parentNode.parentNode.removeChild(a.target.parentNode)})},!1);for(i=0;i<section.groups.group.add.length;i++)section.groups.group.add[i].addEventListener("click",function(a){pageManager.vars[0]="members";pageManager.vars[1]="u"+a.target.getData("cluster");navMenu("groups",!0)},!1)}; api.send(t,function(e){0==e.ModuleError&&(section.edit.input.search.submit.anim("active",1e3),searchindex_edit=0,found_edit=e.users,section.edit.input.search.sum.innerHTML=found_edit.length,autofill_edit()),lastkeywords_edit=t.keywords})}},!1),section.edit.input.submit.addEventListener("click",function(e){if(e.preventDefault(),""!=section.edit.input.search.id.value){var t={path:"userDefault/edit",id_user:parseInt(section.edit.input.search.id.value),code:section.edit.input.code.value,username:section.edit.input.username.value,firstname:section.edit.input.firstname.value,lastname:section.edit.input.lastname.value,mail:section.edit.input.mail.value}
api.send(t,function(e){console.log(e),0==e.ModuleError&&1==e.status?(console.log("Utilisateur modifie!"),section.edit.input.submit.anim("active",1500),api.send({path:"userDefault/getById",id_user:t.id_user},function(e){0==e.ModuleError&&(found_edit[searchindex_edit]=e.user,autofill_edit())})):console.error("ModuleError::"+e.ModuleError)})}},!1)),pageManager.vars.length>=2&&!isNaN(pageManager.vars[1])&&api.send({path:"userDefault/getById",id_user:pageManager.vars[1]},function(e){0==e.ModuleError&&(found_edit=[e.user],searchindex_edit=0,autofill_edit(),found_remove=[e.user],searchindex_remove=0,autofill_remove())}),null!=section.groups.element){section.groups.link={remove:document.querySelectorAll(section.groups.text+".link_remove[data-cluster]"),edit:document.querySelectorAll(section.groups.text+".link_edit[data-cluster]")},section.groups.group={rem:document.querySelectorAll(section.groups.text+".rem-member[data-cluster][data-member]"),add:document.querySelectorAll(section.groups.text+".add-member[data-cluster]")},section.groups.searchbar.addEventListener("keyup",function(e){var t={path:"clusterDefault/search",keywords:section.groups.searchbar.value,class:0}
api.send(t,function(e){if(0==e.ModuleError){for(var t=[],r=0;r<e.clusters.length;r++)t.push(e.clusters[r].id_user_cluster)
for(var i=document.querySelectorAll(section.groups.text+"> article.inline-box[id]"),r=0;r<i.length;r++)t.indexOf(parseInt(i[r].id))>-1?i[r].remClass("hidden"):i[r].addClass("hidden")}})},!1)
var i
for(i=0;i<section.groups.link.edit.length;i++)section.groups.link.edit[i].addEventListener("click",function(e){pageManager.vars=["edit","u"+e.target.getData("cluster")],console.warn("edit",pageManager.vars),navMenu("groups",!0)},!1)
for(i=0;i<section.groups.link.remove.length;i++)section.groups.link.remove[i].addEventListener("click",function(e){pageManager.vars=["remove","u"+e.target.getData("cluster")],console.warn("remove",pageManager.vars),navMenu("groups",!0)},!1)
for(i=0;i<section.groups.group.rem.length;i++)section.groups.group.rem[i].addEventListener("click",function(e){var t={path:"userDefault/unlink",id_cluster:e.target.getData("cluster"),id_user:e.target.getData("member")}
api.send(t,function(t){return 0==t.ModuleError&&void e.target.parentNode.parentNode.removeChild(e.target.parentNode)})},!1)
for(i=0;i<section.groups.group.add.length;i++)section.groups.group.add[i].addEventListener("click",function(e){pageManager.vars=["members","u"+e.target.getData("cluster")],console.warn("members",pageManager.vars),navMenu("groups",!0)},!1)}

View File

@ -732,8 +732,8 @@ if( section.groups.element != null ){
for( i = 0 ; i < section.groups.link.edit.length ; i++ ){ for( i = 0 ; i < section.groups.link.edit.length ; i++ ){
section.groups.link.edit[i].addEventListener('click', function(e){ section.groups.link.edit[i].addEventListener('click', function(e){
pageManager.vars[0] = 'edit'; pageManager.vars = [ 'edit', 'u'+e.target.getData('cluster') ];
pageManager.vars[1] = 'u'+e.target.getData('cluster'); console.warn('edit', pageManager.vars);
navMenu('groups', true); navMenu('groups', true);
}, false); }, false);
@ -743,8 +743,8 @@ if( section.groups.element != null ){
for( i = 0 ; i < section.groups.link.remove.length ; i++ ){ for( i = 0 ; i < section.groups.link.remove.length ; i++ ){
section.groups.link.remove[i].addEventListener('click', function(e){ section.groups.link.remove[i].addEventListener('click', function(e){
pageManager.vars[0] = 'remove'; pageManager.vars = [ 'remove', 'u'+e.target.getData('cluster') ];
pageManager.vars[1] = 'u'+e.target.getData('cluster'); console.warn('remove', pageManager.vars, e.target);
navMenu('groups', true); navMenu('groups', true);
}, false); }, false);
@ -782,8 +782,8 @@ if( section.groups.element != null ){
for( i = 0 ; i < section.groups.group.add.length ; i++ ){ for( i = 0 ; i < section.groups.group.add.length ; i++ ){
section.groups.group.add[i].addEventListener('click', function(e){ section.groups.group.add[i].addEventListener('click', function(e){
pageManager.vars[0] = 'members'; pageManager.vars = [ 'members', 'u'+e.target.getData('cluster') ];
pageManager.vars[1] = 'u'+e.target.getData('cluster'); console.warn('members', pageManager.vars);
navMenu('groups', true); navMenu('groups', true);
}, false); }, false);