Some enhancements/fixes for the community object and added dynamic resume community text in the community select form

This commit is contained in:
Rooty 2020-12-18 01:17:53 +01:00
parent ef89a6bfbb
commit b800bdbb49
3 changed files with 174 additions and 104 deletions

View File

@ -9,7 +9,7 @@
<mx:bloc id="blocName">
<div class="input-group col-xs-12 col-sm-8 col-lg-6 p-0 m-0">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-lg fa-indent mr-2"></i><span class="fa"><mx:image id="pictoLanguage"/><span class="text-danger"> *</span></span></span>
<span class="input-group-text"><i class="fa fa-lg"></i><span class="fa"><mx:image id="pictoLanguage"/><span class="text-danger"> *</span></span></span>
</div>
<mx:formField id="NodeEntry_name"/>
</div>
@ -66,7 +66,7 @@
<div class="row mb-1 w-100">
<div class="input-group col-xs-12 col-sm-3 col-lg-3 justify-content-center">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-lg fa-genderless"></i></span>
<span class="input-group-text"><i class="fa fa-lg fa-venus-mars"></i></span>
</div>
<mx:select id="user_title"/>
</div>

View File

@ -7,9 +7,6 @@
<div class="card-header"><mx:text id="registerCom"/><mx:text id="messageInscriptionNoeud"/></div>
<div class="card-body">
<div class="row alert alert-primary"><p><mx:text id="WarnNotSubs"/></p><p><mx:text id="TxtInscription"/></p><p><mx:text id="TxtInscription2"/></p></div>
<div class="container container-fluid">
<p class="font-weight-bolder"><mx:text id="TxtSubsIntro1"/> <mx:text id="TxtSubsIntro2"/></p>
</div>
<div class="row">
<div class="col-sm-4">
<img style="max-width: 200px;max-height: 200px;" src="./data/image/communities/<mx:text id="ComText"/>.png" alt="<mx:text id="ComText"/>" title="<mx:text id="ComText"/>"/>
@ -21,69 +18,126 @@
</div>
<div class="card-header"><h3><mx:text id="formUser1"/></h3></div>
<div class="card-body">
<div class="row">
<p class="input-group col-xs-12 col-sm-8 col-lg-3">
<span class="input-group-addon"><i class="fa fa-2x fa-venus-mars"></i></span><mx:select id="user_title" id="title"/>
</p>
<p class="input-group col-xs-12 col-sm-8 col-lg-3">
<span class="input-group-addon"><i class="fa fa-2x fa-user"><span class="text-danger"><span class="text-danger"> *</span></i></span><mx:formField id="user_first_name" id="firstname"/>
</p>
<p class="input-group col-xs-12 col-sm-8 col-lg-3">
<span class="input-group-addon"><i class="fa fa-2x fa-user"><span class="text-danger"> *</span></i></span><mx:formField id="user_last_name" id="lastname"/>
</p>
<p class="input-group col-xs-12 col-sm-8 col-lg-3">
<span class="input-group-addon"><i class="fa fa-2x fa-envelope-o"><span class="text-danger"> *</span></i></span><mx:formField id="user_mail" id="mail"/>
</p>
<div class="row mb-1 w-100">
<div class="input-group col-xs-12 col-sm-8 col-lg-3">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-lg fa-venus-mars"></i></span>
</div>
<mx:select id="user_title" id="title"/>
</div>
<div class="input-group col-xs-12 col-sm-8 col-lg-3">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-lg fa-user"><span class="text-danger"><span class="text-danger"> *</span></i></span>
</div>
<mx:formField id="user_first_name" id="firstname"/>
</div>
<div class="input-group col-xs-12 col-sm-8 col-lg-3">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-lg fa-user"><span class="text-danger"> *</span></i></span>
</div>
<mx:formField id="user_last_name" id="lastname"/>
</div>
<div class="input-group col-xs-12 col-sm-8 col-lg-3">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-lg fa-envelope-o"><span class="text-danger"> *</span></i></span>
</div>
<mx:formField id="user_mail" id="mail"/>
</div>
</div>
<div class="row">
<p class="input-group col-xs-12 col-sm-8 col-lg-3">
<span class="input-group-addon"><i class="fa fa-2x fa-user-secret"><span class="text-danger"> *</span></i></span><mx:formField id="user_login" id="loginUser"/>
</p>
<p class="input-group col-xs-12 col-sm-8 col-lg-3">
<span class="input-group-addon"><i class="fa fa-2x fa-user"><span class="text-danger"> *</span></i></span><mx:formField id="user_password" id="passwordUser"/>
</p>
<p class="input-group col-xs-12 col-sm-8 col-lg-3">
<span class="input-group-addon"><i class="fa fa-2x fa-user"><span class="text-danger"> *</span></i></span><mx:formField id="user_password2" id="password2"/>
</p>
<div class="row mb-1 w-100">
<div class="input-group col-xs-12 col-sm-8 col-lg-3">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-lg fa-user-secret"><span class="text-danger"> *</span></i></span>
</div>
<mx:formField id="user_login" id="loginUser"/>
</div>
<div class="input-group col-xs-12 col-sm-8 col-lg-3">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-lg fa-user"><span class="text-danger"> *</span></i></span>
</div>
<mx:formField id="user_password" id="passwordUser"/>
</div>
<div class="input-group col-xs-12 col-sm-8 col-lg-3">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-lg fa-user"><span class="text-danger"> *</span></i></span>
</div>
<mx:formField id="user_password2" id="password2"/>
</div>
</div>
<div class="row">
<p class="input-group col-xs-12 col-sm-8 col-lg-3">
<span class="input-group-addon"><i class="fa fa-2x fa-address-card-o"></i></span><mx:formField id="user_postal_adress" id="postaladress"/>
</p>
<p class="input-group col-xs-12 col-sm-8 col-lg-3">
<span class="input-group-addon"><i class="fa fa-2x fa-address-card-o"></i></span><mx:formField id="user_postal_code" id="postalcode"/>
</p>
<p class="input-group col-xs-12 col-sm-8 col-lg-3">
<span class="input-group-addon"><i class="fa fa-2x fa-address-card-o"></i></span><mx:formField id="user_city" id="city"/>
</p>
<p class="input-group col-xs-12 col-sm-8 col-lg-3">
<span class="input-group-addon"><i class="fa fa-2x fa-flag-o"><span class="text-danger"> *</span></i></span><mx:formField id="user_country" id="country"/>
</p>
<div class="row mb-1 w-100">
<div class="input-group col-xs-12 col-sm-8 col-lg-3">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-lg fa-address-card-o"></i></span>
</div>
<mx:formField id="user_postal_adress" id="postaladress"/>
</div>
<div class="input-group col-xs-12 col-sm-8 col-lg-3">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-lg fa-address-card-o"></i></span>
</div>
<mx:formField id="user_postal_code" id="postalcode"/>
</div>
<div class="input-group col-xs-12 col-sm-8 col-lg-3">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-lg fa-address-card-o"></i></span>
</div>
<mx:formField id="user_city" id="city"/>
</div>
<div class="input-group col-xs-12 col-sm-8 col-lg-3">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-lg fa-flag-o"><span class="text-danger"> *</span></i></span>
</div>
<mx:formField id="user_country" id="country"/>
</div>
</div>
<div class="row">
<p class="input-group col-xs-12 col-sm-8 col-lg-3">
<span class="input-group-addon"><i class="fa fa-2x fa-address-card-o"></i></span><mx:formField id="user_state" id="state"/>
</p>
<p class="input-group col-xs-12 col-sm-8 col-lg-3">
<span class="input-group-addon"><i class="fa fa-2x fa-mobile-phone"></i></span><mx:formField id="user_tel" id="tel"/>
</p>
<p class="input-group col-xs-12 col-sm-8 col-lg-3">
<span class="input-group-addon"><i class="fa fa-2x fa-birthday-cake"><span class="text-danger"> *</span></i></span><mx:formField id="user_birthdate" id="birthdate"/>
</p>
<div class="row mb-1 w-100">
<div class="input-group col-xs-12 col-sm-8 col-lg-3">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-lg fa-address-card-o"></i></span>
</div>
<mx:formField id="user_state" id="state"/>
</div>
<div class="input-group col-xs-12 col-sm-8 col-lg-3">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-lg fa-mobile-phone"></i></span>
</div>
<mx:formField id="user_tel" id="tel"/>
</div>
<div class="input-group col-xs-12 col-sm-8 col-lg-3">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-lg fa-birthday-cake"><span class="text-danger"> *</span></i></span>
</div>
<mx:formField id="user_birthdate" id="birthdate"/>
</div>
</div>
<div class="row">
<p class="input-group col-xs-12 col-sm-8 col-lg-3">
<span class="input-group-addon"><i class="fa fa-2x fa-globe"></i></span><mx:formField id="user_website" id="user_website"/>
</p>
<p class="input-group col-xs-12 col-sm-8 col-lg-3">
<span class="input-group-addon"><i class="fa fa-2x fa-facebook"></i></span><mx:formField id="user_facebook" id="user_facebook"/>
</p>
<p class="input-group col-xs-12 col-sm-8 col-lg-3">
<span class="input-group-addon"><i class="fa fa-2x fa-mastodon"></i></span><mx:formField id="user_mastodon" id="user_mastodon"/>
</p>
<p class="input-group col-xs-12 col-sm-8 col-lg-3">
<span class="input-group-addon"><i class="fa fa-2x fa-xmpp"></i></span><mx:formField id="user_jabber" id="user_jabber"/>
</p>
<div class="row mb-1 w-100">
<div class="input-group col-xs-12 col-sm-8 col-lg-3">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-lg fa-globe"></i></span>
</div>
<mx:formField id="user_website" id="user_website"/>
</div>
<div class="input-group col-xs-12 col-sm-8 col-lg-3">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-lg fa-facebook"></i></span>
</div>
<mx:formField id="user_facebook" id="user_facebook"/>
</div>
<div class="input-group col-xs-12 col-sm-8 col-lg-3">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-lg fa-mastodon"></i></span>
</div>
<mx:formField id="user_mastodon" id="user_mastodon"/>
</div>
<div class="input-group col-xs-12 col-sm-8 col-lg-3">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-lg fa-xmpp"></i></span>
</div>
<mx:formField id="user_jabber" id="user_jabber"/>
</div>
</div>
</div>
<div class="card-header"><h3><mx:text id="formChartSite"/></h3></div>
@ -96,7 +150,7 @@
<span class="action"><mx:checker id="charteSite" class="actionLegendCheckbox"/> (*) <mx:text id="iaccept"/></span>
</div>
<div class="card-footer">
<div class="qaptcha"></div>
<!-- <div class="qaptcha"></div> -->
<input type="submit" name="submit" class="btn btn-outline-secondary btn-lg btn-sm" aria-pressed="true" title="<mx:text id="tipValidButton"/>" value="<mx:text id="BtnValid"/>"/>
<input type="button" name="return" class="btn btn-outline-secondary btn-lg btn-sm" aria-pressed="true" title="<mx:text id="tipReturnButton"/>" value="<mx:text id="BtnComms"/>" onclick="javascript:window.location.href='<mx:text id="urlReturn"/>'"/>
<input type="button" name="return" class="btn btn-outline-secondary btn-lg btn-sm" aria-pressed="true" title="<mx:text id="tipReturnButton"/>" value="<mx:text id="BtnReturn"/>" onclick="history.back(); return false;"/>
@ -104,37 +158,3 @@
</div>
</form>
</div>
<!-- <p class="field" style="display: none;" id="blocBirthdate"><label for="birthdate" class="require"> (*) <mx:text id="user_birthdate"/></label><mx:formField id="user_birthdate" id="birthdate"/></p> -->
<!-- <p class="field"><label for="user_msn"><mx:text id="user_msn"/></label><mx:formField id="user_msn" id="user_msn"/></p> -->
<!-- <p class="field" id="blocAdrPostaleMand" style="display: none;"><label for="postaladdress" class="require">(*) <mx:text id="user_postal_address"/></label><mx:formField id="user_postal_adressmand" id="postaladressmand"/></p> -->
<!-- <p class="field"><label for="fax"><mx:text id="user_fax"/></label><mx:formField id="user_fax" id="fax"/></p> -->
<script type="text/javascript">
//<![CDATA[
// getElementById('fmtextinfo').setAttribute("autocomplete","off");
// getElementById('loginUser').setAttribute("autocomplete","off");
$(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: "<mx:text id="urlQaptcha"/>",
// txtLock: "<mx:text id="textQaptchaLock"/>",
// txtUnlock: "<mx:text id="textQaptchaUnlock"/>"
// });
});
// getElementById('fmtextinfo').setAttribute("autocomplete","off");
// getElementById('loginUser').setAttribute("autocomplete","off");
});
// ]]>
</script>

View File

@ -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: "<mx:text id=\"urlQaptcha\"/>",txtLock: \"<mx:text id=\"textQaptchaLock\"/>\",txtUnlock: \"<mx:text id=\"textQaptchaUnlock\"/>\"});});";
mxRawJs($arrayRawJs);
/* On inclus la template (voir package.template.php) */
@ -382,11 +383,29 @@ Class Community extends CoordinationObj
$libmyNoeud = $myNoeud->getLibelle($currentCode);
$messageInscriptionNoeud = "&nbsp;:&nbsp;".$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 "";