diff --git a/src/UnicaenAuth/View/Helper/UserCurrent.php b/src/UnicaenAuth/View/Helper/UserCurrent.php index d086f7c380968b90473c11b4e76730c95b02adec..dfaf7757d7313cd7783a2c9c69b2184c7d941adf 100644 --- a/src/UnicaenAuth/View/Helper/UserCurrent.php +++ b/src/UnicaenAuth/View/Helper/UserCurrent.php @@ -52,7 +52,7 @@ class UserCurrent extends UserAbstract $selectableRoles = $this->getUserContext()->getSelectableIdentityRoles(); $role = current($selectableRoles) ?: $this->getUserContext()->getIdentityRole('user'); } - $status .= sprintf(", <small class='role-libelle'>%s</small>", !method_exists($role, '__toString') ? $role->getRoleId() : $role); + $status .= sprintf("<br/><small class='role-libelle'>%s</small>", !method_exists($role, '__toString') ? $role->getRoleId() : $role); } $userProfileHelper = $this->getView()->plugin('userProfile'); /* @var $userProfileHelper UserProfile */ @@ -77,13 +77,13 @@ class UserCurrent extends UserAbstract } $out = <<<EOS -<a class="navbar-link" +<a class="navbar-link dropdown-toggle" id="$id" title="$title" - data-placement="bottom" - data-toggle="popover" - data-html="true" - data-content="$content" + data-bs-placement="bottom" + data-bs-toggle="popover" + data-bs-html="true" + data-bs-content="$content" href="#">$status<span class="caret"></span></a> EOS; $out .= PHP_EOL; diff --git a/src/UnicaenAuth/View/Helper/UserProfile.php b/src/UnicaenAuth/View/Helper/UserProfile.php index 56393d96790e722794f1a22afc06d62bf93f3e37..f0cb706c3574894f717cdc8f333bba6b7d91bce6 100644 --- a/src/UnicaenAuth/View/Helper/UserProfile.php +++ b/src/UnicaenAuth/View/Helper/UserProfile.php @@ -36,7 +36,7 @@ class UserProfile extends UserAbstract */ public function render() { - $title = _("Profil utilisateur"); + $title = _("Rôle utilisateur"); $unknown = _("Inconnu"); $none = _("Aucun"); diff --git a/src/UnicaenAuth/View/Helper/UserProfileSelect.php b/src/UnicaenAuth/View/Helper/UserProfileSelect.php index 136634e5dd438d4ff6811b646249f194b0e051cc..c51c261242cf4fdf427a10d888bf9a3226cc7b19 100644 --- a/src/UnicaenAuth/View/Helper/UserProfileSelect.php +++ b/src/UnicaenAuth/View/Helper/UserProfileSelect.php @@ -2,6 +2,7 @@ namespace UnicaenAuth\View\Helper; use Zend\Permissions\Acl\Role\RoleInterface; +use Zend\View\Helper\HeadScript; /** * Aide de vue permettant à l'utilisateur de sélectionner son profil courant parmi @@ -79,18 +80,15 @@ class UserProfileSelect extends UserAbstract $url = $this->getView()->url('utilisateur/default', ['action' => 'selectionner-profil']); $redirectUrl = $this->getView()->url($this->redirectRoute ?: 'home'); - $html .= <<<EOS -<script> - $(function() { - $("input.$inputClass").change(function() { submitProfile(); }).tooltip({ delay: 500, placement: 'left' }); - }); - function submitProfile() - { + $js = <<<EOS +$(function() { + $("body").on("change", "input.$inputClass", function() { $("body *").css('cursor', 'wait'); $.post("$url", $(".$formClass").serializeArray(), function() { $(location).attr('href', "$redirectUrl"); }); - } -</script> + }); +}); EOS; + $this->view->inlineScript(HeadScript::SCRIPT, $js); return $html; } diff --git a/src/UnicaenAuth/View/Helper/UserUsurpationHelper.php b/src/UnicaenAuth/View/Helper/UserUsurpationHelper.php index 1f2d763b02a5740626ef09e122ef754e948c96fb..44db267357f0918d1be2bb0a4dcfa8ca0957f772 100644 --- a/src/UnicaenAuth/View/Helper/UserUsurpationHelper.php +++ b/src/UnicaenAuth/View/Helper/UserUsurpationHelper.php @@ -11,6 +11,7 @@ use Zend\Form\Element\Text; use Zend\Form\Form; use Zend\Form\View\Helper\Form as FormHelper; use Zend\Form\View\Helper\FormElement; +use Zend\View\Helper\HeadScript; use Zend\View\Renderer\PhpRenderer; /** @@ -145,26 +146,30 @@ class UserUsurpationHelper extends UserAbstract $html = ''; $html .= $formHelper->openTag($form); $html .= "<div><strong>Usurpation d'identité :</strong></div>"; - $html .= $formControlGroupHelper->__invoke($identity); - $html .= $formControlGroupHelper->__invoke($submit); + $html .= '<div class="row">' . PHP_EOL; + $html .= '<div class="col-sm-9">' . $formControlGroupHelper->__invoke($identity) . '</div>' . PHP_EOL; + $html .= '<div class="col-sm-3">' . $formControlGroupHelper->__invoke($submit) . '</div>' . PHP_EOL; + $html .= '</div>' . PHP_EOL; $html .= $formHelper->closeTag(); $formId = $form->getAttribute('id'); - $html .= <<<EOS -<script> - var form = $("#$formId").submit(function() { - $("body *").css('cursor', 'wait'); - }); - var input = form.find(".user-usurpation-input").on('input', function() { - updateUsurpationSubmit(); - }); - function updateUsurpationSubmit() { - form.find(".user-usurpation-submit").prop("disabled", input.val().length === 0); - } - updateUsurpationSubmit(); -</script> + $js = <<<EOS +$(function() { + $("body") + .on("input", ".user-usurpation-input", function() { + const input = $(this); + const submit = $(".user-usurpation-submit"); + input.val().length > 0 ? + submit.prop("disabled", false) : + submit.prop("disabled", true); + }) + .on("submit", "#$formId", function() { + $("body *").css('cursor', 'wait'); + }); +}); EOS; + $this->view->inlineScript(HeadScript::SCRIPT, $js); return $html; } @@ -209,6 +214,7 @@ EOS; $submit = new Submit('submit'); $submit->setValue("Usurper"); $submit->setAttributes([ + 'disabled' => true, 'class' => 'user-usurpation-submit btn btn-danger', ]); diff --git a/src/UnicaenAuth/View/Helper/partial/connect.phtml b/src/UnicaenAuth/View/Helper/partial/connect.phtml index 95defbde540db74121903026be43a563abefce50..ba278fbef74f18b055413c9afd5bd33f70f33207 100644 --- a/src/UnicaenAuth/View/Helper/partial/connect.phtml +++ b/src/UnicaenAuth/View/Helper/partial/connect.phtml @@ -28,10 +28,10 @@ use Zend\Form\Form; <?php if ($messages = $this->flashMessenger('zfcuser-login-form')): ?> <?php foreach ($messages as $message): ?> -<div class="messenger alert alert-danger "> - <button type="button" class="close" title="Fermer cette alerte" data-dismiss="alert">×</button> - <span class="glyphicon glyphicon-warning-sign"></span> +<div class="messenger alert alert-danger alert-dismissible "> + <span class="icon icon-avertissement"></span> <?php echo $message ?> <br> + <button type="button" class="btn-close" title="Fermer cette alerte" data-bs-dismiss="alert"></button> </div> <?php endforeach ?> <?php endif ?> diff --git a/tests/UnicaenAuthTest/View/Helper/_files/expected/user_current/logged-in-translated.phtml b/tests/UnicaenAuthTest/View/Helper/_files/expected/user_current/logged-in-translated.phtml index 14ae2ef23b455454a42e2bd0022ce44826cad756..c752fb54bb61b73f4ee70abaf6acc69afb7ecf4a 100644 --- a/tests/UnicaenAuthTest/View/Helper/_files/expected/user_current/logged-in-translated.phtml +++ b/tests/UnicaenAuthTest/View/Helper/_files/expected/user_current/logged-in-translated.phtml @@ -1,7 +1,7 @@ <a class="navbar-link" id="user-current-info" title="Auth user" - data-placement="bottom" - data-toggle="popover" - data-content="User Profile Helper MarkupUser Info Helper Markup" + data-bs-placement="bottom" + data-bs-toggle="popover" + data-bs-content="User Profile Helper MarkupUser Info Helper Markup" href="#">User Status Helper Markup</a> diff --git a/tests/UnicaenAuthTest/View/Helper/_files/expected/user_current/logged-in.phtml b/tests/UnicaenAuthTest/View/Helper/_files/expected/user_current/logged-in.phtml index 55a49900a137652012f3e59c6818bfacc8e3eee9..f9f9342a11786717c504ee445f4c99154de45825 100644 --- a/tests/UnicaenAuthTest/View/Helper/_files/expected/user_current/logged-in.phtml +++ b/tests/UnicaenAuthTest/View/Helper/_files/expected/user_current/logged-in.phtml @@ -1,7 +1,7 @@ <a class="navbar-link" id="user-current-info" title="Utilisateur connecté à l'application" - data-placement="bottom" - data-toggle="popover" - data-content="User Profile Helper MarkupUser Info Helper Markup" + data-bs-placement="bottom" + data-bs-toggle="popover" + data-bs-content="User Profile Helper MarkupUser Info Helper Markup" href="#">User Status Helper Markup</a> diff --git a/tests/UnicaenAuthTest/View/Helper/_files/expected/user_current/logged-out-translated.phtml b/tests/UnicaenAuthTest/View/Helper/_files/expected/user_current/logged-out-translated.phtml index 09fd022dd9caa4b29a1c941d3c4a5ca5aa815695..5df1c9263d196420d060fda4f0b92ce2d20cbf63 100644 --- a/tests/UnicaenAuthTest/View/Helper/_files/expected/user_current/logged-out-translated.phtml +++ b/tests/UnicaenAuthTest/View/Helper/_files/expected/user_current/logged-out-translated.phtml @@ -1,7 +1,7 @@ <a class="navbar-link" id="user-current-info" title="Auth user" - data-placement="bottom" - data-toggle="popover" - data-content="None" + data-bs-placement="bottom" + data-bs-toggle="popover" + data-bs-content="None" href="#">User Status Helper Markup</a> diff --git a/tests/UnicaenAuthTest/View/Helper/_files/expected/user_current/logged-out.phtml b/tests/UnicaenAuthTest/View/Helper/_files/expected/user_current/logged-out.phtml index 8e5a62d442e7a74679e8eb7def62a497fd413060..2a4258b043969fb3ac240bf419e68f4ab0429f6b 100644 --- a/tests/UnicaenAuthTest/View/Helper/_files/expected/user_current/logged-out.phtml +++ b/tests/UnicaenAuthTest/View/Helper/_files/expected/user_current/logged-out.phtml @@ -1,7 +1,7 @@ <a class="navbar-link" id="user-current-info" title="Utilisateur connecté à l'application" - data-placement="bottom" - data-toggle="popover" - data-content="Aucun" + data-bs-placement="bottom" + data-bs-toggle="popover" + data-bs-content="Aucun" href="#">User Status Helper Markup</a> diff --git a/view/unicaen-auth/auth/login-tabs.phtml b/view/unicaen-auth/auth/login-tabs.phtml index b22f9a9764402ea06db97b18b86d26799abb60d1..dca54544ae6797ba3235d17dbcf259b308afb0bb 100644 --- a/view/unicaen-auth/auth/login-tabs.phtml +++ b/view/unicaen-auth/auth/login-tabs.phtml @@ -19,7 +19,7 @@ use Zend\Form\Form; $form->prepare(); $form->setAttributes([ - 'class' => 'form-horizontal', + //'class' => 'form-horizontal', // .form-horizontal n'existe plus dans boostrap 4 'role' => 'form', ]); @@ -45,9 +45,9 @@ $activeHelper = null; $activeClass = ''; } ?> - <li role="presentation" class="<?php echo $activeClass ?>"> + <li role="presentation" class="nav-item"> <?php $query = $redirect ? ['redirect' => $redirect] : [] ?> - <a href="<?php echo $this->url('zfcuser/login', ['type' => $key], ['query' => $query]) ?>"><?php echo $helper->getTitle() ?></a> + <a class="nav-link <?php echo $activeClass ?>" href="<?php echo $this->url('zfcuser/login', ['type' => $key], ['query' => $query]) ?>"><?php echo $helper->getTitle() ?></a> </li> <?php endforeach ?> </ul> diff --git a/view/unicaen-auth/auth/login.phtml b/view/unicaen-auth/auth/login.phtml index 141524306d904f7ff7c7e104c3bda30fe2e0590c..0dc7974ec279832f74b6b741000df21cd73f626c 100644 --- a/view/unicaen-auth/auth/login.phtml +++ b/view/unicaen-auth/auth/login.phtml @@ -31,8 +31,10 @@ $this->headTitle("Connexion") ?> <!-- Création d'un compte local (si autorisée) --> <?php if ($enableRegistration) : ?> -<div id="div-connexion" class="panel panel-primary"> +<div id="div-connexion" class="card"> + <div class="card-body"> <?php echo $this->translate("Not registered?"); ?> <a href="<?php echo $this->url('zfcuser/register') . ($this->redirect ? '?redirect=' . $this->redirect : '') ?>"><?php echo $this->translate("Sign up!"); ?></a> + </div> </div> <?php endif; ?> diff --git a/view/unicaen-auth/auth/request-password-reset-form.phtml b/view/unicaen-auth/auth/request-password-reset-form.phtml index 61e8802100efd7029f08724fa3a3bc9a95c811d9..765abf37d4d2c4611cf3cb44a13f4e3374a14f4a 100644 --- a/view/unicaen-auth/auth/request-password-reset-form.phtml +++ b/view/unicaen-auth/auth/request-password-reset-form.phtml @@ -30,7 +30,7 @@ use Zend\Form\Form; echo $this->formInput($email); echo $this->formElementErrors($email, ['class' => 'text-danger']); ?> - <span class="help-block">Un lien à cliquer vous sera envoyé à cette adresse électronique.</span> + <span class="form-text">Un lien à cliquer vous sera envoyé à cette adresse électronique.</span> </p> <?php echo $this->formInput($form->get('csrf')); ?> diff --git a/view/unicaen-auth/droits/partial/tbl-link.phtml b/view/unicaen-auth/droits/partial/tbl-link.phtml index 799d42ec488d1aa5765543d0b6828ebf6caec4a0..08ff59240c87c3e123cefa17b71d3b84b36bcf1e 100644 --- a/view/unicaen-auth/droits/partial/tbl-link.phtml +++ b/view/unicaen-auth/droits/partial/tbl-link.phtml @@ -14,7 +14,7 @@ $canEdit = $this->isAllowed(Privileges::getResourceId(Privileges::DROIT_PRIVILEG <a href="javascript:void(0)" data-action="refuser" title="Privilège '<?php echo $privilege->getCategorie() ?> > '<?php echo $privilege ?>' accordé au rôle '<?php echo $role ?>'. Cliquez pour le retirer."> <?php endif; ?> - <span class="glyphicon glyphicon-ok text-success"></span> + <span class="icon iconly icon-oui text-success"></span> <?php if ($canEdit): ?> </a> <?php endif; ?> @@ -25,7 +25,7 @@ $canEdit = $this->isAllowed(Privileges::getResourceId(Privileges::DROIT_PRIVILEG <a href="javascript:void(0)" data-action="accorder" title="Privilège '<?php echo $privilege->getCategorie() ?> > <?php echo $privilege ?>' refusé au rôle '<?php echo $role ?>'. Cliquez pour l'accorder."> <?php endif; ?> - <span class="glyphicon glyphicon-remove text-danger refuse"></span> + <span class="icon iconly icon-non text-danger refuse"></span> <?php if ($canEdit): ?> </a> <?php endif; ?> diff --git a/view/unicaen-auth/droits/privileges.phtml b/view/unicaen-auth/droits/privileges.phtml index 8ce8e3ec1786b06180d441b15e77a29a045addf6..0db6305dfd7d4fe404869ba14e2e7a18b011951a 100644 --- a/view/unicaen-auth/droits/privileges.phtml +++ b/view/unicaen-auth/droits/privileges.phtml @@ -6,7 +6,7 @@ ?> <h1 class="page-header">Gestion des privilèges</h1> -<table class="droits-tbl table table-hover table-bordered table-condensed table-extra-condensed table-header-rotated" data-modifier-url="<?php echo $this->url('droits/privileges/modifier'); ?>"> +<table class="droits-tbl table table-hover table-bordered table-sm table-extra-condensed table-header-rotated" data-modifier-url="<?php echo $this->url('droits/privileges/modifier'); ?>"> <thead> <tr> <th class="separator"></th> diff --git a/view/unicaen-auth/droits/roles.phtml b/view/unicaen-auth/droits/roles.phtml index e511f9da1d00f72509fa9557fc780906a85032c3..bc2d109a7099afe39adb5173ddcb2af523dad60f 100644 --- a/view/unicaen-auth/droits/roles.phtml +++ b/view/unicaen-auth/droits/roles.phtml @@ -9,7 +9,7 @@ $canEdit = $this->isAllowed('privilege/'.Privileges::DROIT_ROLE_EDITION); $ajoutUrl = $this->url( 'droits/roles/edition' ); ?> -<table class="table table-condensed table-bordered"> +<table class="table table-sm table-bordered"> <tr> <th>Nom</th> <th>Parent</th> @@ -28,8 +28,8 @@ $ajoutUrl = $this->url( 'droits/roles/edition' ); <td><?php echo $role->getAccessibleExterieur() ? 'Oui' : 'Non'; ?></td> <?php if ($canEdit): ?> <td style="width:1%;white-space: nowrap;text-align: center"> - <a href="<?php echo $editionUrl; ?>" class="ajax-modal" data-event="role-edition"><span class="glyphicon glyphicon-edit"></span></a> - <a href="<?php echo $suppressionUrl; ?>" class="ajax-modal" data-event="role-suppression"><span class="glyphicon glyphicon-remove"></span></a> + <a href="<?php echo $editionUrl; ?>" class="ajax-modal" data-event="role-edition"><span class="icon iconly icon-modifier"></span></a> + <a href="<?php echo $suppressionUrl; ?>" class="ajax-modal" data-event="role-suppression"><span class="icon iconly icon-supprimer"></span></a> </td> <?php endif; ?> </tr>