Modifying the register button in the community form depending of register status

This commit is contained in:
Rooty 2021-09-27 18:04:38 +02:00
parent e6ca195ed1
commit 89cada6b96
3 changed files with 16 additions and 4 deletions

View File

@ -46,6 +46,7 @@ ObjectPrintName = "Mes outils"
ObjectClientPrintName = "Mes Services"
allCom = "Toutes les communautés"
registerCom = "S'inscrire à la communauté "
registerComClosed = "Inscription fermée"
subscriptionCom = "Adhérer à "
selectCom = "Sélectionnez une communauté"
infoCom = "plus d'infos"

View File

@ -36,7 +36,9 @@
</div>
<div class="card w-100">
<div class="card-footer border-0 bg-white text-center">
<mx:formField id="inscrire" class="btn btn-outline-secondary btn-lg btn-sm" aria-pressed="true"/>
<mx:bloc id="blocRegisterCom">
<mx:formField id="inscrire" aria-pressed="true"/>
</mx:bloc id="blocRegisterCom">
<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;"/>
</div>
</div>

View File

@ -107,7 +107,10 @@ Class Community extends CoordinationObj
$GLOBALS["SYSTEM_TEMPLATE"]->MxAttribut("urlReturn", htmlentitiesconv($GLOBALS['CONF_PAGE_EXECUTION']."?id=".$GLOBALS['SYSTEM_USER_SESSION']->id."&system=navigationNode&navigationNodeId=".$GLOBALS["SYSTEM_USER_SESSION"]->entryNodeId));
$GLOBALS["SYSTEM_TEMPLATE"]->MxAttribut("urlAction", Navigation::formatUrl($this->GetId(), "Community", "actionLecture", $msg));
// if( $tabNode[$i][3] == "on" )
$GLOBALS["SYSTEM_TEMPLATE"]->MxAttribut("blocRegister".".urlAction", Navigation::formatUrl($this->GetId(), "Community", "actionLecture", $msg));
// else
// $GLOBALS["SYSTEM_TEMPLATE"]->MxBloc("blocRegister", "delete");
//Initialisation des compteurs
$j =1;
@ -187,8 +190,14 @@ Class Community extends CoordinationObj
$GLOBALS["SYSTEM_TEMPLATE"]->MxAttribut("bloc1.entrynodeid",$tabNode[$i][0]);
$GLOBALS["SYSTEM_TEMPLATE"]->MxText("bloc1.entrynodeselected"," selected='selected' ");
$url_inscrire = Navigation::formatUrl($this->GetId(),"Community","formlecture","",$tabNode[$i][0]);
$GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("inscrire", "button", "ok", getMessage("registerCom"), " onclick=\"javascript:window.location.href='$url_inscrire';\"");
if( $tabNode[$i][3] == "on" )
{
$url_inscrire = Navigation::formatUrl($this->GetId(),"Community","formlecture","",$tabNode[$i][0]);
$GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("blocRegisterCom".".inscrire", "button", "ok", getMessage("registerCom"), " onclick=\"javascript:window.location.href='$url_inscrire';\" class=\"btn btn-outline-secondary btn-lg btn-sm\"");
} else {
$GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("blocRegisterCom".".inscrire", "button", "ok", getMessage("registerComClosed"), "class=\"btn btn-secondary btn-lg btn-sm\" disabled");
}
}
else
{