From de1fce5aac7c58dc830638178af8ce755295e9f3 Mon Sep 17 00:00:00 2001 From: "tristan.champomier" Date: Mon, 14 Dec 2020 15:18:55 +0100 Subject: [PATCH] Fixed issue #30 --- .../usertemp/actionmanageregister.mxt | 202 ++++++------------ lib/object_coordination/usertemp/usertemp.php | 53 +++-- 2 files changed, 95 insertions(+), 160 deletions(-) diff --git a/data/template/lcube6/object_coordination/usertemp/actionmanageregister.mxt b/data/template/lcube6/object_coordination/usertemp/actionmanageregister.mxt index 6aeefa0..a5a84ac 100755 --- a/data/template/lcube6/object_coordination/usertemp/actionmanageregister.mxt +++ b/data/template/lcube6/object_coordination/usertemp/actionmanageregister.mxt @@ -1,142 +1,64 @@ -
-
- () -
-
-
- " /> - " /> - " /> - - -
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
-
- -
-
-

- - - -

-
-
-
+
+
+
+

()

+
+
+
+
+ " /> + " /> + " /> + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+

+
+
+
+
+
+ +
+ +
+
+
+ +
+
- - - diff --git a/lib/object_coordination/usertemp/usertemp.php b/lib/object_coordination/usertemp/usertemp.php index d1179f4..50aef69 100755 --- a/lib/object_coordination/usertemp/usertemp.php +++ b/lib/object_coordination/usertemp/usertemp.php @@ -46,13 +46,33 @@ Class UserTemp extends CoordinationObj */ function actionManageRegister() { - /* On inclus la template (voir package.template.php) */ - withBlocPath("UserTemp", "actionManageRegister"); - global $SERVER_NAME, $SCRIPT_NAME, $CONF_PERSISTANT_SECURE,$CONF_DATA_PATH; - + /*Récupération des messages utilisateurs*/ addMessageFile("user.ini"); + + mxPageTitle("titlAdminSubscriptions"); + + /* gestion du lib en fonction de la langue courante */ + $currentCode=$GLOBALS["SYSTEM_USER_SESSION"]->langue->getCode(); + $defaultCode=$GLOBALS["SYSTEM_DEFAULT_LANGUAGE_CODE"]; + /* fin récupération des codes par defaut */ + + $arrayCallCss = array(); + $arrayCallCss[] = "data/css/dataTables.bootstrap4/1.10.22/dataTables.bootstrap4.min.css"; + mxCallCss($arrayCallCss); + + $arrayCallJs = array(); + $arrayCallJs[] = "data/javascript/jquery.dataTables/1.10.22/jquery.dataTables.min.js"; + $arrayCallJs[] = "data/javascript/dataTables.bootstrap4/1.10.22/dataTables.bootstrap4.min.js"; + mxCallJs($arrayCallJs); + + $arrayRawJs[] = "\$(document).ready(function(){\$(\"#tabInscriptions\").dataTable({\"bPaginate\": false,\"bFilter\": false,\"bInfo\": false,\"aaSorting\": [[ 0, \"desc\" ]],\"oLanguage\": {\"sUrl\": \"data/message/".$currentCode."/datatables.txt\"}});}); "; + $arrayRawJs[] = "function Valid_register(the_val,the_form,the_field){var objectform = document.forms[the_form];var nbr = objectform.length;var flag = 0;for (z=0 ; z < nbr; z++){if(objectform.elements[z].checked == true && objectform.elements[z].name == the_field){flag=1;}}if(flag == 0){alert(document.userTemp.selectcheckbox.value);return false;}else{if(the_val == 1){var reponse = confirm(document.userTemp.confirmactivate.value);}else{var reponse = confirm(document.userTemp.confirmdelete.value);}if(reponse == true){if(the_val==1){objectform.action=document.userTemp.urlAction1.value;}else{objectform.action=document.userTemp.urlAction2.value;}objectform.submit();}else{return false;}}}"; + mxRawJs($arrayRawJs); + + /* On inclus la template (voir package.template.php) */ + withBlocPath("UserTemp", "actionManageRegister"); /* Récuperation du noeud à administrer sinon noeud d'entrée de l'admin */ $groupId=($this->getData("groupId")!="")?$this->getData("groupId"):1; /* Tous les Groupes par défaut */ @@ -68,11 +88,6 @@ Class UserTemp extends CoordinationObj // --> recuperation du treeNode correspondant au noeurd $tabTreeGroup[0]=$myTreeGroup; //--> treeNodeUnique.... - /* gestion du lib en fonction de la langue courante */ - $currentCode=$GLOBALS["SYSTEM_USER_SESSION"]->langue->getCode(); - $defaultCode=$GLOBALS["SYSTEM_DEFAULT_LANGUAGE_CODE"]; - /* fin récupération des codes par defaut */ - //Récupération de l'identifiant de la communauté : methode en fin de page $nodeId = $this->recupCommunauty(); @@ -103,8 +118,6 @@ Class UserTemp extends CoordinationObj //OBTENIR LE GROUPE DE L'UTILISATEUR // var_dump($tabNodeGroupUser[$i]->getGroupId()); //On récupère les données de l'utilisateur concerné -// $titre = array(getMessage("mr"),getMessage("mrs"), getMessage("miss")); -// $GLOBALS["SYSTEM_TEMPLATE"]->MxText("ligne.vuser_title", $titre[$currentUser->getTitle()]); $GLOBALS["SYSTEM_TEMPLATE"]->MxText("ligne.vuser_first_name", $currentUser->getFirstName()); $GLOBALS["SYSTEM_TEMPLATE"]->MxText("ligne.vuser_last_name", $currentUser->getLastName()); $GLOBALS["SYSTEM_TEMPLATE"]->MxText("ligne.vuser_login", $currentUser->getLogin()); @@ -121,9 +134,9 @@ Class UserTemp extends CoordinationObj $treeGroup = ""; for($n=(count($tabWayTreeGroup)-1);$n>=0;$n--){ if($n>0) - $treeGroup .= "/ ".$tabWayTreeGroup[$n]; + $treeGroup .= " / ".$tabWayTreeGroup[$n]; else - $treeGroup .= "/".$tabWayTreeGroup[$n].""; + $treeGroup .= " / ".$tabWayTreeGroup[$n].""; } } else { $treeGroup = "Aucun"; @@ -142,17 +155,17 @@ Class UserTemp extends CoordinationObj $GLOBALS["SYSTEM_CONTROL"]->messageSystem = "NoRegisterEntry"; } - printTabTreeGroup($tabTreeGroup, 0, "GROUP","id_Group"); - - $GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_delete", "button", "boutton", getMessage("user_delete"), " class=\"form-control\" onclick=\"javascript:Valid_register(2,'FManageRegister','user_id[]');\""); - $GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_accept", "button", "boutton", getMessage("user_accept"), " class=\"form-control\" onclick=\"javascript:Valid_register(1,'FManageRegister','user_id[]');\""); + printTabTreeGroup($tabTreeGroup, 0, "GROUP", "id_Group", '', getMessage("TxtGroup")); +// " onclick="history.back();"/> + $GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_delete", "button", "boutton", getMessage("user_delete"), " class=\"form\" onclick=\"javascript:Valid_register(2,'FManageRegister','user_id[]');\""); + $GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_accept", "button", "boutton", getMessage("user_accept"), " class=\"form\" onclick=\"javascript:Valid_register(1,'FManageRegister','user_id[]');\""); # Envoi du formulaire en fonction de l'action : encode le javascript $GLOBALS["SYSTEM_TEMPLATE"]->MxAttribut("urlAction0", formatUrl($this->getId(),"UserTemp","execManageRegister")); - $GLOBALS["SYSTEM_TEMPLATE"]->MxAttribut("urlAction1", formatUrl($this->getId(),"UserTemp","execManageRegister")); - $GLOBALS["SYSTEM_TEMPLATE"]->MxAttribut("urlAction2", formatUrl($this->getId(),"UserTemp","execDeleteManageRegister")); - return ""; + $GLOBALS["SYSTEM_TEMPLATE"]->MxAttribut("urlAction1", formatUrl($this->getId(),"UserTemp","execManageRegister")); + $GLOBALS["SYSTEM_TEMPLATE"]->MxAttribut("urlAction2", formatUrl($this->getId(),"UserTemp","execDeleteManageRegister")); + return ""; } /**