Gestion de l'affichage des repos 'machine_cluster' et 'user_cluster' sur les pages 'machines/view' et 'users/view'
This commit is contained in:
parent
24450bd87a
commit
79e3bf6a75
|
@ -230,7 +230,7 @@
|
||||||
$_SESSION['WAREHOUSE']['id'],
|
$_SESSION['WAREHOUSE']['id'],
|
||||||
$id_machine
|
$id_machine
|
||||||
]);
|
]);
|
||||||
$answer = $request->answer();
|
$answer = $request->answer();
|
||||||
|
|
||||||
// Si aucun resultat, on retourne une erreur
|
// Si aucun resultat, on retourne une erreur
|
||||||
if( $answer === false )
|
if( $answer === false )
|
||||||
|
|
|
@ -52,7 +52,7 @@
|
||||||
|
|
||||||
/* [3] Creation du groupe de meme nom que l'username
|
/* [3] Creation du groupe de meme nom que l'username
|
||||||
=========================================================*/
|
=========================================================*/
|
||||||
$create_cluster = new Repo('cluster/create', [
|
$create_cluster = new Repo('user_cluster/create', [
|
||||||
$_SESSION['WAREHOUSE']['id'],
|
$_SESSION['WAREHOUSE']['id'],
|
||||||
$username,
|
$username,
|
||||||
clusterRepo::USER_CLASS,
|
clusterRepo::USER_CLASS,
|
||||||
|
@ -92,7 +92,7 @@
|
||||||
|
|
||||||
/* [1] Creation de l'association
|
/* [1] Creation de l'association
|
||||||
=========================================================*/
|
=========================================================*/
|
||||||
$link_user = new Repo('cluster/link', [
|
$link_user = new Repo('user_cluster/link', [
|
||||||
$_SESSION['WAREHOUSE']['id'],
|
$_SESSION['WAREHOUSE']['id'],
|
||||||
$id_cluster,
|
$id_cluster,
|
||||||
$id_user,
|
$id_user,
|
||||||
|
@ -121,7 +121,7 @@
|
||||||
|
|
||||||
/* [1] Suppression de l'association
|
/* [1] Suppression de l'association
|
||||||
=========================================================*/
|
=========================================================*/
|
||||||
$link_user = new Repo('cluster/unlink', [
|
$link_user = new Repo('user_cluster/unlink', [
|
||||||
$_SESSION['WAREHOUSE']['id'],
|
$_SESSION['WAREHOUSE']['id'],
|
||||||
$id_cluster,
|
$id_cluster,
|
||||||
$id_user,
|
$id_user,
|
||||||
|
@ -399,7 +399,7 @@
|
||||||
|
|
||||||
/* [2] On récupère le groupe personnel
|
/* [2] On récupère le groupe personnel
|
||||||
=========================================================*/
|
=========================================================*/
|
||||||
$get_personal_cluster = new Repo('cluster/getPersonal', [
|
$get_personal_cluster = new Repo('user_cluster/getPersonal', [
|
||||||
$id_warehouse,
|
$id_warehouse,
|
||||||
$id_user,
|
$id_user,
|
||||||
clusterRepo::USER_CLASS
|
clusterRepo::USER_CLASS
|
||||||
|
@ -414,7 +414,7 @@
|
||||||
|
|
||||||
/* [3] On supprime le groupe personnel
|
/* [3] On supprime le groupe personnel
|
||||||
=========================================================*/
|
=========================================================*/
|
||||||
$del_cluster = new Repo('cluster/delete', [
|
$del_cluster = new Repo('user_cluster/delete', [
|
||||||
$id_warehouse,
|
$id_warehouse,
|
||||||
$personal_cluster['id_cluster']
|
$personal_cluster['id_cluster']
|
||||||
]);
|
]);
|
||||||
|
|
|
@ -94,18 +94,17 @@
|
||||||
public static function getClusters($id_warehouse, $id_machine){
|
public static function getClusters($id_warehouse, $id_machine){
|
||||||
/* [1] On redige/execute la requete
|
/* [1] On redige/execute la requete
|
||||||
=========================================================*/
|
=========================================================*/
|
||||||
$get_clusters = Database::getPDO()->prepare("SELECT c.id_cluster, c.name
|
$get_clusters = Database::getPDO()->prepare("SELECT c.*
|
||||||
FROM cluster as c, cluster_merge as cm, machine as m
|
FROM machine_cluster as c, machine_cluster_merge as cm, machine as m
|
||||||
WHERE cm.id_cluster = c.id_cluster
|
WHERE cm.id_machine_cluster = c.id_machine_cluster
|
||||||
AND cm.id_entity = m.id_machine
|
AND cm.id_machine = m.id_machine
|
||||||
AND m.id_warehouse = :id_warehouse
|
AND cm.id_machine = :id_machine
|
||||||
AND cm.id_entity = :id_machine
|
AND c.id_warehouse = m.id_warehouse
|
||||||
AND c.class = :class
|
AND m.id_warehouse = :id_warehouse
|
||||||
ORDER BY c.id_cluster");
|
ORDER BY c.name");
|
||||||
$get_clusters->execute([
|
$get_clusters->execute([
|
||||||
':id_warehouse' => $id_warehouse,
|
':id_warehouse' => $id_warehouse,
|
||||||
':id_machine' => $id_machine,
|
':id_machine' => $id_machine
|
||||||
':class' => clusterRepo::MACHINE_CLASS
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
/* [2] On retourne la liste des groupes
|
/* [2] On retourne la liste des groupes
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
namespace manager\repo;
|
namespace manager\repo;
|
||||||
use \manager\Database;
|
use \manager\Database;
|
||||||
use \manager\repo\cluster as clusterRepo;
|
use \manager\repo\uesr_cluster;
|
||||||
|
|
||||||
class user extends parentRepo{
|
class user extends parentRepo{
|
||||||
|
|
||||||
|
@ -110,18 +110,17 @@
|
||||||
public static function getClusters($id_warehouse, $id_user){
|
public static function getClusters($id_warehouse, $id_user){
|
||||||
/* [1] On redige/execute la requete
|
/* [1] On redige/execute la requete
|
||||||
=========================================================*/
|
=========================================================*/
|
||||||
$get_clusters = Database::getPDO()->prepare("SELECT c.id_cluster, c.name
|
$get_clusters = Database::getPDO()->prepare("SELECT c.*
|
||||||
FROM cluster as c, cluster_merge as cm, user as u
|
FROM user_cluster as c, user_cluster_merge as cm, user as u
|
||||||
WHERE cm.id_cluster = c.id_cluster
|
WHERE cm.id_user_cluster = c.id_user_cluster
|
||||||
AND cm.id_entity = u.id_user
|
AND cm.id_user = u.id_user
|
||||||
AND cm.id_entity = :id_user
|
AND cm.id_user = :id_user
|
||||||
AND c.class = :class
|
AND c.id_warehouse = u.id_warehouse
|
||||||
AND u.id_warehouse = :id_warehouse
|
AND u.id_warehouse = :id_warehouse
|
||||||
ORDER BY c.id_cluster");
|
ORDER BY c.name");
|
||||||
$get_clusters->execute([
|
$get_clusters->execute([
|
||||||
':id_warehouse' => $id_warehouse,
|
':id_warehouse' => $id_warehouse,
|
||||||
':id_user' => $id_user,
|
':id_user' => $id_user
|
||||||
':class' => clusterRepo::USER_CLASS
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
/* [2] On retourne la liste des groupes
|
/* [2] On retourne la liste des groupes
|
||||||
|
|
|
@ -337,9 +337,10 @@
|
||||||
|
|
||||||
|
|
||||||
debug();
|
debug();
|
||||||
$req = new Repo('user_cluster/delete', [
|
$req = new Repo('machine_cluster/link', [
|
||||||
7,
|
7,
|
||||||
1
|
2,
|
||||||
|
3
|
||||||
]);
|
]);
|
||||||
|
|
||||||
var_dump( $req->error );
|
var_dump( $req->error );
|
||||||
|
|
|
@ -39,6 +39,7 @@
|
||||||
|
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
debug();
|
||||||
|
|
||||||
$post = [];
|
$post = [];
|
||||||
foreach($_POST as $k=>$v)
|
foreach($_POST as $k=>$v)
|
||||||
|
|
|
@ -40,7 +40,6 @@
|
||||||
|
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
$post = [];
|
$post = [];
|
||||||
foreach($_POST as $k=>$v)
|
foreach($_POST as $k=>$v)
|
||||||
array_push($post, $k);
|
array_push($post, $k);
|
||||||
|
@ -53,7 +52,7 @@
|
||||||
=========================================================*/
|
=========================================================*/
|
||||||
echo "<section data-sublink='view' class='list'>";
|
echo "<section data-sublink='view' class='list'>";
|
||||||
|
|
||||||
$userlist = new View('user.view');
|
$userlist = new View('user.view', []);
|
||||||
$userlist->view();
|
$userlist->view();
|
||||||
|
|
||||||
echo '</section>';
|
echo '</section>';
|
||||||
|
|
Loading…
Reference in New Issue