minmod CSS + divers

This commit is contained in:
xdrm-brackets 2016-07-20 19:01:11 +02:00
parent 6b8209a977
commit a9b0f5b02e
5 changed files with 34 additions and 20 deletions

View File

@ -375,7 +375,8 @@
"description": "Recherche d'un groupe par mots-clés.",
"permissions": ["warehouse", "admin"],
"parameters": {
"keywords": { "description": "Mots-clés de la recherche.", "type": "text" }
"keywords": { "description": "Mots-clés de la recherche.", "type": "text" },
"class": { "description": "Type de groupe.", "type": "int", "optional": true }
},
"output": {
"clusters": { "description": "Liste des groupes correspondants aux mots-clés.", "type": "array<mixed>" }

View File

@ -221,7 +221,7 @@
left: 100%;
width: 1em;
height: calc( 100% - .1em - 2px );
padding: .1em .5em;
padding: .12em .5em;
border-radius: 0 3px 3px 0;
border: 1px solid #bdbdbd;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -52,6 +52,7 @@
/* RENVOIE UN GROUPE EN FONCTION D'UN MOT CLE
*
* @keywords<String> Element de recherche
* @class<int> Type de groupe (0:user;1:machine) [OPTIONNEL]
*
* @return clusters<Array> Retourne la liste des groupes trouves
*
@ -59,22 +60,34 @@
public static function search($params){
extract($params);
// On recupere les donnees des groupes utilisateurs
$userClusters = new Repo('user_cluster/search', [
$_SESSION['WAREHOUSE']['id'],
$keywords
]);
$result = [];
if( is_null($class) || $class == 0 ){
// On recupere les donnees des groupes utilisateurs
$userClusters = new Repo('user_cluster/search', [
$_SESSION['WAREHOUSE']['id'],
$keywords
]);
$result = array_merge($result, $userClusters->answer());
}
if( is_null($class) || $class == 1 ){
// On recupere les donnees des groupes utilisateurs
$machineClusters = new Repo('machine_cluster/search', [
$_SESSION['WAREHOUSE']['id'],
$keywords
]);
$result = array_merge($result, $machineClusters->answer());
}
// On recupere les donnees des groupes machines
$machineClusters = new Repo('machine_cluster/search', [
$_SESSION['WAREHOUSE']['id'],
$keywords
]);
$merged = array_merge($userClusters->answer(), $machineClusters->answer());
return [ 'clusters' => $merged ];
return [ 'clusters' => $result ];
}