From 5fda507cd23d3b800d608e64cc1747dd6f78ab55 Mon Sep 17 00:00:00 2001 From: "tristan.champomier" Date: Sat, 10 Apr 2021 17:41:14 +0200 Subject: [PATCH] Fixed issue #70 --- .../addcom/actionadmin.mxt | 18 ++++---- lib/object_coordination/addcom/addcom.php | 43 +++++++++---------- 2 files changed, 29 insertions(+), 32 deletions(-) diff --git a/data/template/lcube6/object_coordination/addcom/actionadmin.mxt b/data/template/lcube6/object_coordination/addcom/actionadmin.mxt index e66a87d..8ee71d9 100755 --- a/data/template/lcube6/object_coordination/addcom/actionadmin.mxt +++ b/data/template/lcube6/object_coordination/addcom/actionadmin.mxt @@ -39,7 +39,7 @@
- + *
@@ -52,7 +52,7 @@

-
+
@@ -77,7 +77,7 @@
-
+
@@ -127,7 +127,7 @@
- + *
@@ -135,25 +135,25 @@
- + *
- + *
- + *
- + *
@@ -179,7 +179,7 @@
- + *
diff --git a/lib/object_coordination/addcom/addcom.php b/lib/object_coordination/addcom/addcom.php index 23113a6..e01c1d3 100755 --- a/lib/object_coordination/addcom/addcom.php +++ b/lib/object_coordination/addcom/addcom.php @@ -108,23 +108,22 @@ var $tabForbidden=array("adminentrynode", "admingroup", "adminnode", "home", "ad if(!$tabPOST) { $titre = array(getMessage("mr"),getMessage("mrs"), getMessage("miss")); - $GLOBALS["SYSTEM_TEMPLATE"]->MxSelect("user_title", "user_title", "", $titre, getMessage("user_title"), "", "", "class=\"form\" required=\"true\" title=\"".htmlspecialchars(getMessage("tipSelectTitle"), ENT_QUOTES)."\""); - $GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_first_name", "text", "user_first_name", "", "class=\"form\" required=\"true\" title=\"".htmlspecialchars(getMessage("tipFirstName"), ENT_QUOTES)."\"", getMessage("user_first_name")); - $GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_last_name", "text", "user_last_name", "", "class=\"form\" required=\"true\" title=\"".htmlspecialchars(getMessage("tipLastName"), ENT_QUOTES)."\"", getMessage("user_last_name")); + $GLOBALS["SYSTEM_TEMPLATE"]->MxSelect("user_title", "user_title", "", $titre, getMessage("user_title"), "", "", "class=\"form\" title=\"".htmlspecialchars(getMessage("tipSelectTitle"), ENT_QUOTES)."\""); + $GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_first_name", "text", "user_first_name", "", "class=\"form\" title=\"".htmlspecialchars(getMessage("tipFirstName"), ENT_QUOTES)."\"", getMessage("user_first_name")); + $GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_last_name", "text", "user_last_name", "", "class=\"form\" title=\"".htmlspecialchars(getMessage("tipLastName"), ENT_QUOTES)."\"", getMessage("user_last_name")); $GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_login", "text", "user_login", "", "class=\"form\" required=\"true\" title=\"".htmlspecialchars(getMessage("tipLogin"), ENT_QUOTES)."\"", getMessage("user_login")); $GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_password", "password", "user_password", "", "class=\"form\" required=\"true\" title=\"".htmlspecialchars(getMessage("tipPassword"), ENT_QUOTES)."\"", getMessage("user_password")); $GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_password2", "password", "user_password2", "", "class=\"form\" required=\"true\" title=\"".htmlspecialchars(getMessage("tipPassword2"), ENT_QUOTES)."\"", getMessage("user_password")); $GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_mail", "text", "user_mail", "", "class=\"form\" required=\"true\" title=\"".htmlspecialchars(getMessage("tipCourriel"), ENT_QUOTES)."\"", getMessage("user_mail")); - $GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_birthdate", "text", "user_birthdate", "", "class=\"form\" title=\"".htmlspecialchars(getMessage("tipBirthDate"), ENT_QUOTES)."\"", getMessage("user_birthdate")); - $GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_postal_code", "text", "user_postal_code", "", "class=\"form\" required=\"true\" title=\"".htmlspecialchars(getMessage("tipPostalCode"), ENT_QUOTES)."\"", getMessage("user_postal_code")); - $GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_postal_address", "text", "user_postal_address", "", "class=\"form\" required=\"true\" title=\"".htmlspecialchars(getMessage("tipPostalAddress"), ENT_QUOTES)."\"", getMessage("user_postal_address")); + $GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_birthdate", "text", "user_birthdate", "", "class=\"form\" required=\"true\" title=\"".htmlspecialchars(getMessage("tipBirthDate"), ENT_QUOTES)."\"", getMessage("user_birthdate")); + $GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_postal_code", "text", "user_postal_code", "", "class=\"form\" title=\"".htmlspecialchars(getMessage("tipPostalCode"), ENT_QUOTES)."\"", getMessage("user_postal_code")); + $GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_postal_address", "text", "user_postal_address", "", "class=\"form\" title=\"".htmlspecialchars(getMessage("tipPostalAddress"), ENT_QUOTES)."\"", getMessage("user_postal_address")); $GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_city", "text", "user_city", "", "class=\"form\" title=\"".htmlspecialchars(getMessage("tipCity"), ENT_QUOTES)."\"", getMessage("user_city")); $GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_state", "text", "user_state", "", "class=\"form\" title=\"".htmlspecialchars(getMessage("tipState"), ENT_QUOTES)."\"", getMessage("user_state")); $GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_country", "text", "user_country", "", "class=\"form\" required=\"true\" title=\"".htmlspecialchars(getMessage("tipCountry"), ENT_QUOTES)."\"", getMessage("user_country")); $GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_tel", "text", "user_tel", "", "class=\"form\" title=\"".htmlspecialchars(getMessage("tipTel"), ENT_QUOTES)."\"", getMessage("user_tel")); $GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_fax", "text", "user_fax", "", "class=\"form\" title=\"".htmlspecialchars(getMessage("tipFax"), ENT_QUOTES)."\"", getMessage("user_fax")); $GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_website", "text", "user_website", "", "class=\"form\" title=\"".htmlspecialchars(getMessage("tipWebsite"), ENT_QUOTES)."\"", getMessage("user_website")); -// $GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_msn", "text", "user_msn", "", "class=\"form\" title=\"".htmlspecialchars(getMessage("tipMsn"), ENT_QUOTES)."\"", getMessage("user_msn")); $GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_jabber", "text", "user_jabber", "", "class=\"form\" title=\"".htmlspecialchars(getMessage("tipJabber"), ENT_QUOTES)."\"", getMessage("user_jabber")); $GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_facebook", "text", "user_facebook", "", "class=\"form\" title=\"".htmlspecialchars(getMessage("tipFacebook"), ENT_QUOTES)."\"", getMessage("user_facebook")); $GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_mastodon", "text", "user_mastodon", "", "class=\"form\" title=\"".htmlspecialchars(getMessage("tipMastodon"), ENT_QUOTES)."\"", getMessage("user_mastodon")); @@ -132,23 +131,22 @@ var $tabForbidden=array("adminentrynode", "admingroup", "adminnode", "home", "ad else // On raffiche les données saisies par l'utilisateur { $titre = array(getMessage("mr"),getMessage("mrs"), getMessage("miss")); - $GLOBALS["SYSTEM_TEMPLATE"]->MxSelect("user_title", "user_title", $_POST['user_title'], $titre, getMessage("user_title"), "", "", "class=\"form\" required=\"true\" title=\"".htmlspecialchars(getMessage("tipSelectTitle"), ENT_QUOTES)."\""); - $GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_first_name", "text", "user_first_name", $_POST['user_first_name'], "class=\"form\" required=\"true\" title=\"".htmlspecialchars(getMessage("tipFirstName"), ENT_QUOTES)."\"", getMessage("user_first_name")); - $GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_last_name", "text", "user_last_name", $_POST['user_last_name'], "class=\"form\" required=\"true\" title=\"".htmlspecialchars(getMessage("tipLastName"), ENT_QUOTES)."\"", getMessage("user_last_name")); + $GLOBALS["SYSTEM_TEMPLATE"]->MxSelect("user_title", "user_title", $_POST['user_title'], $titre, getMessage("user_title"), "", "", "class=\"form\" title=\"".htmlspecialchars(getMessage("tipSelectTitle"), ENT_QUOTES)."\""); + $GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_first_name", "text", "user_first_name", $_POST['user_first_name'], "class=\"form\" title=\"".htmlspecialchars(getMessage("tipFirstName"), ENT_QUOTES)."\"", getMessage("user_first_name")); + $GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_last_name", "text", "user_last_name", $_POST['user_last_name'], "class=\"form\" title=\"".htmlspecialchars(getMessage("tipLastName"), ENT_QUOTES)."\"", getMessage("user_last_name")); $GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_login", "text", "user_login", $_POST['user_login'], "class=\"form\" required=\"true\" title=\"".htmlspecialchars(getMessage("tipLogin"), ENT_QUOTES)."\"", getMessage("user_login")); $GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_password", "password", "user_password", "", "class=\"form\" required=\"true\" title=\"".htmlspecialchars(getMessage("tipPassword"), ENT_QUOTES)."\"", getMessage("user_password")); $GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_password2", "password", "user_password2", "", "class=\"form\" required=\"true\" title=\"".htmlspecialchars(getMessage("tipPassword2"), ENT_QUOTES)."\"", getMessage("user_password")); $GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_mail", "text", "user_mail", $_POST['user_mail'], "class=\"form\" required=\"true\" title=\"".htmlspecialchars(getMessage("tipCourriel"), ENT_QUOTES)."\"", getMessage("user_mail")); - $GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_birthdate", "text", "user_birthdate", "", "class=\"form\" title=\"".htmlspecialchars(getMessage("tipBirthDate"), ENT_QUOTES)."\"", getMessage("user_birthdate")); - $GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_postal_code", "text", "user_postal_code", $_POST['user_postal_code'], "class=\"form\" required=\"true\" title=\"".htmlspecialchars(getMessage("tipPostalCode"), ENT_QUOTES)."\"", getMessage("user_postal_code")); - $GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_postal_address", "text", "user_postal_address", $_POST['user_postal_address'], "class=\"form\" required=\"true\" title=\"".htmlspecialchars(getMessage("tipPostalAddress"), ENT_QUOTES)."\"", getMessage("user_postal_address")); + $GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_birthdate", "text", "user_birthdate", "", "class=\"form\" required=\"true\" title=\"".htmlspecialchars(getMessage("tipBirthDate"), ENT_QUOTES)."\"", getMessage("user_birthdate")); + $GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_postal_code", "text", "user_postal_code", $_POST['user_postal_code'], "class=\"form\" title=\"".htmlspecialchars(getMessage("tipPostalCode"), ENT_QUOTES)."\"", getMessage("user_postal_code")); + $GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_postal_address", "text", "user_postal_address", $_POST['user_postal_address'], "class=\"form\" title=\"".htmlspecialchars(getMessage("tipPostalAddress"), ENT_QUOTES)."\"", getMessage("user_postal_address")); $GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_city", "text", "user_city", $_POST['user_city'], "class=\"form\" title=\"".htmlspecialchars(getMessage("tipCity"), ENT_QUOTES)."\"", getMessage("user_city")); $GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_state", "text", "user_state", $_POST['user_state'], "class=\"form\" title=\"".htmlspecialchars(getMessage("tipState"), ENT_QUOTES)."\"", getMessage("user_state")); $GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_country", "text", "user_country", $_POST['user_country'], "class=\"form\" required=\"true\" title=\"".htmlspecialchars(getMessage("tipCountry"), ENT_QUOTES)."\"", getMessage("user_country")); $GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_tel", "text", "user_tel", $_POST['user_tel'], "class=\"form\" title=\"".htmlspecialchars(getMessage("tipTel"), ENT_QUOTES)."\"", getMessage("user_tel")); $GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_fax", "text", "user_fax", $_POST['user_fax'], "class=\"form\" title=\"".htmlspecialchars(getMessage("tipFax"), ENT_QUOTES)."\"", getMessage("user_fax")); $GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_website", "text", "user_website", $_POST['user_website'], "class=\"form\" title=\"".htmlspecialchars(getMessage("tipWebsite"), ENT_QUOTES)."\"", getMessage("user_website")); -// $GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_msn", "text", "user_msn", $_POST['user_msn'], "class=\"form\" title=\"".htmlspecialchars(getMessage("tipMsn"), ENT_QUOTES)."\"", getMessage("user_msn")); $GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_jabber", "text", "user_jabber", $_POST['user_jabber'], "class=\"form\" title=\"".htmlspecialchars(getMessage("tipJabber"), ENT_QUOTES)."\"", getMessage("user_jabber")); $GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_facebook", "text", "user_facebook", $_POST['user_facebook'], "class=\"form\" title=\"".htmlspecialchars(getMessage("tipFacebook"), ENT_QUOTES)."\"", getMessage("user_facebook")); $GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_mastodon", "text", "user_mastodon", $_POST['user_mastodon'], "class=\"form\" title=\"".htmlspecialchars(getMessage("tipMastodon"), ENT_QUOTES)."\"", getMessage("user_mastodon")); @@ -178,13 +176,12 @@ var $tabForbidden=array("adminentrynode", "admingroup", "adminnode", "home", "ad } $GLOBALS['SYSTEM_TEMPLATE']->MxText("blocName.txtNodeEntryName", getMessage("txtNodeEntryName")); - // $GLOBALS['SYSTEM_TEMPLATE']->MxAttribut("blocName.nameInput", "nameLanguageA".$tab[$i]->getCode()); - $GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("blocName.NodeEntry_name", "text", "nameLanguage".$tab[$i]->getCode(), $nameLanguage, "class=\"form\"", getMessage("txtNodeEntryName")); + $GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("blocName.NodeEntry_name", "text", "nameLanguage".$tab[$i]->getCode(), $nameLanguage, "class=\"form\" required=\"true\"", getMessage("txtNodeEntryName")); $GLOBALS["SYSTEM_TEMPLATE"]->MxAttribut("previewtemplate",getMessage("TxtPreview")); $GLOBALS["SYSTEM_TEMPLATE"]->MxBloc("blocName", "loop"); } - $GLOBALS['SYSTEM_TEMPLATE']->MxSelect("icone", "iconeN", '', $tabIcone, 'Icône de la communauté', '', 'id="iconeN"', "class=\"form\" title=\"".htmlspecialchars(getMessage("txtNodeIcon"), ENT_QUOTES)."\"", getMessage("txtNodeIcon")); + $GLOBALS['SYSTEM_TEMPLATE']->MxSelect("icone", "iconeN", '', $tabIcone, 'Icône de la communauté', '', 'id="iconeN"', "class=\"form\" required=\"false\" title=\"".htmlspecialchars(getMessage("txtNodeIcon"), ENT_QUOTES)."\"", getMessage("txtNodeIcon")); $GLOBALS["SYSTEM_TEMPLATE"]->MxImage("pictoObject", $GLOBALS['CONF_DATA_PATH']."data/image/icons/node/defaultnode.png", getMessage("PreviewPicto")); $GLOBALS['SYSTEM_TEMPLATE']->MxText("txtNodeType", getMessage("txtNodeType")); @@ -193,7 +190,7 @@ var $tabForbidden=array("adminentrynode", "admingroup", "adminnode", "home", "ad printTabCommProfiles($selected='', $MxBlocName="COMMPROFILES", $name="NodeEntry_type"); $GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("NodeEntry_typereg", "text", "NodeEntry_typereg","", "class=\"form\"", getMessage("txtNodeTypereg")); - $GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("NodeEntry_domain", "text", "NodeEntry_domain","", "class=\"form\"", getMessage("txtNodeDomain")); + $GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("NodeEntry_domain", "text", "NodeEntry_domain","", "class=\"form\" required=\"true\"", getMessage("txtNodeDomain")); /* pour chaque classe et en fonction de la langue */ for ($i=0; $iMxText("actionAdminClass.classValue", $value); $GLOBALS['SYSTEM_TEMPLATE']->MxText("actionAdminClass.className", $name); - //MxCheckerField(string $path, string $type, string $name, string $value, [string $checked], [string $attribut]); /* if (!in_array($GLOBALS["SYSTEM_REGISTER"]["COORDINATION_OBJ"][$i], $this->tabForbidden)) {*/ $GLOBALS["SYSTEM_TEMPLATE"]->MxCheckerField("actionAdminClass.classId", "checkbox", "class_id[]", $GLOBALS["SYSTEM_REGISTER"]["COORDINATION_OBJ"][$i], "", ""); @@ -239,7 +235,7 @@ var $tabForbidden=array("adminentrynode", "admingroup", "adminnode", "home", "ad } @closedir($handle); asort($tabIcone); - $GLOBALS['SYSTEM_TEMPLATE']->MxSelect("TEMPLATE_ADMIN", "template", $tabIcone, $tabIcone, "", 7, "", "class=\"form\""); + $GLOBALS['SYSTEM_TEMPLATE']->MxSelect("TEMPLATE_ADMIN", "template", $tabIcone, $tabIcone, "", 7, "", "class=\"form\" required=\"true\""); /* Fin Affichage des templates */ $GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("BtnAdd", "button", "boutton", getMessage("BtnAdd"), "class=\"form\""); @@ -267,12 +263,15 @@ function execAdmin() $defaultCode=$GLOBALS["SYSTEM_DEFAULT_LANGUAGE_CODE"]; /* fin récupération des codes par défaut */ + var_dump($_POST); + exit(0); + $chaine=""; if($_POST) { foreach($_POST as $cle=>$val) { - if($val=="" && ($cle !="NodeEntry_type" && $cle !="NodeEntry_typereg" && $cle !="NodeEntry_domain" && $cle !="user_fax" && $cle !="user_mastodon" && $cle !="user_jabber" && $cle !="user_facebook" && $cle !="user_msn" && $cle !="user_website" && $cle="contentResumeInfos" && $cle="contentTextInfos")) + if($val=="" && ($cle !="user_title" && $cle !="user_firt_name" && $cle !="user_last_name" && $cle !="user_postal_code" && $cle !="user_postal_address" && $cle !="user_city" && $cle !="state" && $cle !="NodeEntry_type" && $cle !="NodeEntry_typereg" && $cle !="user_tel" && $cle !="user_fax" && $cle !="user_mastodon" && $cle !="user_jabber" && $cle !="user_facebook" && $cle !="user_msn" && $cle !="user_website" && $cle="contentResumeInfos" && $cle="contentTextInfos")) { $chaine .= getMessage($cle).", "; } @@ -331,10 +330,8 @@ function execAdmin() $MyUser->setCity($_POST['user_city']); $MyUser->setState($_POST['user_state']); $MyUser->setCountry($_POST['user_country']); -// $MyUser->setOrganisation($_POST['user_organisation']); $MyUser->setTel($_POST['user_tel']); $MyUser->setFax($_POST['user_fax']); -// $MyUser->setComment(array($_POST['user_comment'])); $MyUser->setWebSite($_POST['user_website']); $MyUser->setMsn($_POST['user_msn']); $MyUser->setJabber($_POST['user_jabber']);