From b800bdbb49ba2232db8ab2f51ab63cc9b83fc6b7 Mon Sep 17 00:00:00 2001 From: "tristan.champomier" Date: Fri, 18 Dec 2020 01:17:53 +0100 Subject: [PATCH] Some enhancements/fixes for the community object and added dynamic resume community text in the community select form --- .../addcom/actionadmin.mxt | 4 +- .../community/formlecture.mxt | 214 ++++++++++-------- .../community/community.php | 60 ++++- 3 files changed, 174 insertions(+), 104 deletions(-) diff --git a/data/template/lcube6/object_coordination/addcom/actionadmin.mxt b/data/template/lcube6/object_coordination/addcom/actionadmin.mxt index dc5708e..5b30918 100755 --- a/data/template/lcube6/object_coordination/addcom/actionadmin.mxt +++ b/data/template/lcube6/object_coordination/addcom/actionadmin.mxt @@ -9,7 +9,7 @@
- * + *
@@ -66,7 +66,7 @@
- +
diff --git a/data/template/lcube6/object_coordination/community/formlecture.mxt b/data/template/lcube6/object_coordination/community/formlecture.mxt index 0338c0e..e743b02 100755 --- a/data/template/lcube6/object_coordination/community/formlecture.mxt +++ b/data/template/lcube6/object_coordination/community/formlecture.mxt @@ -7,9 +7,6 @@

-
-

-
.png" alt="" title=""/> @@ -21,69 +18,126 @@

-
-

- -

-

- * -

-

- * -

-

- * -

+
+
+
+ +
+ +
+ +
+
+ * +
+ +
+ +
+
+ * +
+ +
+ +
+
+ * +
+ +
-
-

- * -

-

- * -

-

- * -

+
+
+
+ * +
+ +
+
+
+ * +
+ +
+
+
+ * +
+ +
-
-

- -

-

- -

-

- -

-

- * -

+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ * +
+ +
-
-

- -

-

- -

-

- * -

+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ * +
+ +
-
-

- -

-

- -

-

- -

-

- -

+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +

@@ -96,7 +150,7 @@ (*)
- - - - - - - diff --git a/lib/object_coordination/community/community.php b/lib/object_coordination/community/community.php index 538c3a6..414f6a8 100755 --- a/lib/object_coordination/community/community.php +++ b/lib/object_coordination/community/community.php @@ -53,6 +53,8 @@ Class Community extends CoordinationObj $defaultCode=$GLOBALS["SYSTEM_DEFAULT_LANGUAGE_CODE"]; /* fin récupération des codes par defaut */ + mxPageTitle("titlPageSelectCommunities"); + /* On inclus la template (voir package.template.php) */ WithBlocPath("Community", "actionLecture"); @@ -145,7 +147,6 @@ Class Community extends CoordinationObj //On récupère le texte du noeud choisi par l'internaute // $sql="SELECT * FROM ".DATA_ACCES_TABLE_PREFIX.DATA_ACCES_OBJECT_PREFIX."textentrynode WHERE node_id=".$idNode; $sql="SELECT * FROM ".DATA_ACCES_TABLE_PREFIX.DATA_ACCES_OBJECT_PREFIX."textentrynode WHERE node_id=".$idNode." AND langue_id=".$GLOBALS["SYSTEM_USER_SESSION"]->langue->getId(); - var_dump($sql); # Exécution de Requete $result=$GLOBALS['SYSTEM_DATABASE_CONN']->sql_query($sql); @@ -351,7 +352,6 @@ Class Community extends CoordinationObj /*Récupération des messages utilisateurs*/ addMessageFile("user.ini"); addMessageFile("subscriptions.ini"); - addMessageFile("adminaccounting.ini"); /* gestion du lib en fonction de la langue courante */ $currentCode=$GLOBALS["SYSTEM_USER_SESSION"]->langue->getCode(); @@ -370,7 +370,8 @@ Class Community extends CoordinationObj $arrayCallJs[] = "data/javascript/bootstrap-datepicker/1.9.0/locales/bootstrap-datepicker.fr.min.js"; mxCallJs($arrayCallJs); - $arrayRawJs[] = "\$(document).ready(function(){ $('.datepicker').datepicker(); });"; + $arrayRawJs[] = "\$(document).ready(function(){\$('.datepicker').datepicker(); });"; +// $arrayRawJs[] = "\$(document).ready(function(){\$(function(){\$(\"#fmtextinfo :input\").tooltip({position: \"top center\",offset: [0, 1],effect: \"slide\",opacity: 0.7,tip: '.tooltipRegUserForm'}),\$('.qaptcha').QapTcha({disabledSubmit: true,autoRevert : true,autoSubmit:false,PHPfile: "",txtLock: \"\",txtUnlock: \"\"});});"; mxRawJs($arrayRawJs); /* On inclus la template (voir package.template.php) */ @@ -382,11 +383,29 @@ Class Community extends CoordinationObj $libmyNoeud = $myNoeud->getLibelle($currentCode); $messageInscriptionNoeud = " : ".$libmyNoeud; $GLOBALS['SYSTEM_TEMPLATE']->MxText("messageInscriptionNoeud", $messageInscriptionNoeud); + + # Contenu du résumé de la communauté + $sql="SELECT * FROM ".DATA_ACCES_TABLE_PREFIX.DATA_ACCES_OBJECT_PREFIX."textentrynode WHERE node_id=".$_GET['param']." AND langue_id=".$GLOBALS["SYSTEM_USER_SESSION"]->langue->getId(); + $result=$GLOBALS['SYSTEM_DATABASE_CONN']->sql_query($sql); + + # Teste si il y a des enregistrements + if ($GLOBALS['SYSTEM_DATABASE_CONN']->sql_numrows()>0) + { + $list = $GLOBALS['SYSTEM_DATABASE_CONN']->sql_fetchrow(); + $text = $list['textentrynode_resume']; + $GLOBALS["SYSTEM_TEMPLATE"]->MxText("text_resume", $text); + } else { + $GLOBALS["SYSTEM_TEMPLATE"]->MxText("text_resume", $noCommunityTextResume); + } } + + # Destruction des éléments + $GLOBALS['SYSTEM_DATABASE_CONN']->sql_freeresult(); # Récupération des étiquette du formulaire $GLOBALS["SYSTEM_TEMPLATE"]->MxAttribut("urlAction", formatUrl($this->getId(),"Community","execLecture","",$_GET['param'])); $GLOBALS["SYSTEM_TEMPLATE"]->MxText("urlReturn",formatUrl($this->getId(),"Community","actionLecture")); +// $GLOBALS["SYSTEM_TEMPLATE"]->MxText("urlQaptcha", formatUrl($this->getId(),"Community","formLectureQaptcha")); # Affichage des champs de formulaire pour l'inscription if(!$tabPOST) { @@ -468,6 +487,37 @@ Class Community extends CoordinationObj } + public function formLectureQaptcha() + { + + $GLOBALS["SYSTEM_TEMPLATE"] = new ModeliXeQware($GLOBALS['SYSTEM_TEMPLATE_PATH'].$GLOBALS['SYSTEM_TEMPLATE_DIR']."object_coordination/community/ajaxdata.mxt"); + $GLOBALS["SYSTEM_TEMPLATE"]->SetMxFileParameter($GLOBALS['SYSTEM_TEMPLATE_PATH'].$GLOBALS['SYSTEM_TEMPLATE_DIR'].$GLOBALS['SYSTEM_TEMPLATE_CONF']); + $GLOBALS["SYSTEM_TEMPLATE"]->SetModeliXe(true); + + $aResponse['error'] = false; + + if(isset($_POST['action']) && isset($_POST['qaptcha_key'])) + { + $_SESSION['qaptcha_key'] = false; + + if(htmlentities($_POST['action'], ENT_QUOTES, 'UTF-8') == 'qaptcha') + { + $_SESSION['qaptcha_key'] = $_POST['qaptcha_key']; + echo json_encode($aResponse); + } + else + { + $aResponse['error'] = true; + echo json_encode($aResponse); + } + } + else + { + $aResponse['error'] = true; + echo json_encode($aResponse); + } + } + /** * Function permettant de controler les doublons, d'inscrire dans la bd et redirection avec message * @access public @@ -511,7 +561,7 @@ Class Community extends CoordinationObj if ($chaine != "") { $GLOBALS["SYSTEM_CONTROL"]->messageSystem = $chaine; - $GLOBALS["SYSTEM_TEMPLATE"]->MxBloc("DATA", "modify", $GLOBALS['SYSTEM_TEMPLATE_PATH'].$GLOBALS['SYSTEM_TEMPLATE_DIR']."object_coordination/Community/formlecture.mxt"); + $GLOBALS["SYSTEM_TEMPLATE"]->MxBloc("DATA", "modify", $GLOBALS['SYSTEM_TEMPLATE_PATH'].$GLOBALS['SYSTEM_TEMPLATE_DIR']."object_coordination/community/formlecture.mxt"); $GLOBALS["SYSTEM_TEMPLATE"]->WithMxPath("DATA", "relative"); $this->formLecture($_POST); return ""; @@ -521,7 +571,7 @@ Class Community extends CoordinationObj if($_POST["user_password"] != $_POST["user_password2"]) { $GLOBALS["SYSTEM_CONTROL"]->messageSystem = "password_error"; - $GLOBALS["SYSTEM_TEMPLATE"]->MxBloc("DATA", "modify", $GLOBALS['SYSTEM_TEMPLATE_PATH'].$GLOBALS['SYSTEM_TEMPLATE_DIR']."object_coordination/Community/formlecture.mxt"); + $GLOBALS["SYSTEM_TEMPLATE"]->MxBloc("DATA", "modify", $GLOBALS['SYSTEM_TEMPLATE_PATH'].$GLOBALS['SYSTEM_TEMPLATE_DIR']."object_coordination/community/formlecture.mxt"); $GLOBALS["SYSTEM_TEMPLATE"]->WithMxPath("DATA", "relative"); $this->formLecture($_POST); return "";