Loading module/Application/src/Application/Controller/AbstractController.php +3 −1 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ use UnicaenApp\Controller\Plugin\ConfirmPlugin; use UnicaenApp\Controller\Plugin\Mail; use Zend\Http\Request as HttpRequest; use Zend\Mvc\Controller\AbstractActionController; use Zend\Mvc\Plugin\FlashMessenger\FlashMessenger; use ZfcUser\Controller\Plugin\ZfcUserAuthentication; /** Loading @@ -26,7 +27,7 @@ use ZfcUser\Controller\Plugin\ZfcUserAuthentication; * @method ZfcUserAuthentication zfcUserAuthentication() * @method HttpRequest getRequest() * @method UploaderPlugin uploader() * @method boolean isAllowed($resource, $privilege) * @method boolean isAllowed($resource, $privilege = null) * @method UrlThesePlugin urlThese() * @method UrlDoctorant urlDoctorant() * @method UrlFichier urlFichier() Loading @@ -34,6 +35,7 @@ use ZfcUser\Controller\Plugin\ZfcUserAuthentication; * @method UrlWorkflow urlWorkflow() * @method Mail mail() * @method ConfirmPlugin confirm() * @method FlashMessenger flashMessenger() */ class AbstractController extends AbstractActionController implements UserContextServiceAwareInterface Loading module/Application/src/Application/Controller/UtilisateurController.php +7 −8 Original line number Diff line number Diff line Loading @@ -60,12 +60,12 @@ class UtilisateurController extends \UnicaenAuth\Controller\UtilisateurControlle /** * @var AuthenticationService */ private $authenticationService; protected $authenticationService; /** * @var ShibService */ private $shibService; protected $shibService; /** * @var CreationUtilisateurForm Loading Loading @@ -235,8 +235,7 @@ class UtilisateurController extends \UnicaenAuth\Controller\UtilisateurControlle if (isset($currentIdentity['shib'])) { /** @var ShibUser $currentIdentity */ $currentIdentity = $currentIdentity['shib']; } elseif (isset($currentIdentity['ldap'])) { } elseif (isset($currentIdentity['ldap'])) { /** @var People $currentIdentity */ $currentIdentity = $currentIdentity['ldap']; } else { Loading Loading @@ -291,8 +290,7 @@ class UtilisateurController extends \UnicaenAuth\Controller\UtilisateurControlle if (isset($currentIdentity['shib'])) { /** @var ShibUser $currentIdentity */ $currentIdentity = $currentIdentity['shib']; } elseif (isset($currentIdentity['ldap'])) { } elseif (isset($currentIdentity['ldap'])) { /** @var People $currentIdentity */ $currentIdentity = $currentIdentity['ldap']; } else { Loading Loading @@ -425,7 +423,7 @@ class UtilisateurController extends \UnicaenAuth\Controller\UtilisateurControlle $utilisateurs = $this->utilisateurService->getRepository()->findByIndividu($individu, $isLocal = true); // done // NB: findByIndividu() avec $isLocal = true renverra 1 utilisateur au maximum $utilisateur = $utilisateurs ? current($utilisateurs) : null; if ($utilisateur === null AND $individu->getEmail() !== null) { if ($utilisateur === null and $individu->getEmail() !== null) { $utilisateur = $this->utilisateurService->getRepository()->findByUsername($individu->getEmail()); } Loading Loading @@ -471,7 +469,8 @@ class UtilisateurController extends \UnicaenAuth\Controller\UtilisateurControlle return $this->redirect()->toRoute('utilisateur/gerer-utilisateur', ['individu' => $individu->getId()], [], true); } public function initCompteAction() { public function initCompteAction() { $token = $this->params()->fromRoute('token'); $utilisateur = $this->utilisateurService->getRepository()->findByToken($token); Loading module/Application/src/Application/Entity/Db/Source.php +1 −1 Original line number Diff line number Diff line Loading @@ -5,7 +5,7 @@ namespace Application\Entity\Db; /** * Source */ class Source class Source extends \UnicaenDbImport\Entity\Db\Source { /** * @var string Loading module/Application/src/Application/Filter/ActeursFormatter.php +5 −10 Original line number Diff line number Diff line Loading @@ -7,9 +7,6 @@ use Zend\View\Helper\HtmlList; use Zend\Filter\AbstractFilter; use Zend\View\Renderer\PhpRenderer; //TODO JP 22/11/2017 doFormat need to be able to use Collection, These and array of Acteur // add the transformation in doFormat /** --- Class ActeursFormatteur --- * @var bool $asUl returned data type as unordered list (html) * @var bool $asSeparated returned data type as separated value Loading Loading @@ -66,7 +63,6 @@ class ActeursFormatter extends AbstractFilter { } /** Set the returned data type to separated value format and set the separator * @param string $separator (default = ", ") * @return $this */ public function asArray() Loading Loading @@ -104,7 +100,7 @@ class ActeursFormatter extends AbstractFilter { /** Format n array of acteurs * @param Acteur[] $acteurs * @return formated set of acteurs * @return string */ public function doFormat($acteurs) { Loading @@ -131,7 +127,7 @@ class ActeursFormatter extends AbstractFilter { /** This function format an array of acteurs as a unordered list * @param Acteur[] $acteurs * @return an unordered list * @return string */ private function doFormatUnorderedList($acteurs) { $acteurs = array_map([$this, 'htmlifyActeur'], $acteurs); Loading @@ -143,7 +139,7 @@ class ActeursFormatter extends AbstractFilter { /** This function format an array of acteurs as Separated Values object * @param Acteur[] $acteurs * @return Separated Values object * @return string Separated Values object */ private function doFormatSeparated($acteurs) { $acteurs = array_map([$this, 'htmlifyActeur'], $acteurs); Loading Loading @@ -202,7 +198,8 @@ class ActeursFormatter extends AbstractFilter { } /** Set the displayed keys * @param Array $params of keys [role, complement, qualite, etablissement] and boolean * @param array $params of keys [role, complement, qualite, etablissement] and boolean * @return ActeursFormatter */ public function paramFilter(array $params) { foreach ($params as $key => $value) { Loading @@ -223,14 +220,12 @@ class ActeursFormatter extends AbstractFilter { return $this; } public function filter($acteurs) { $results = []; /** @var Acteur $acteur */ foreach($acteurs as $acteur) { $keep = true; if ($keep && $this->contrainteRole != null && $acteur->getRole()->getCode() != $this->contrainteRole) $keep = false; if ($keep && $this->contrainteRoleLibelle != null && $acteur->getRole()->getLibelle() != $this->contrainteRoleLibelle) $keep = false; Loading Loading
module/Application/src/Application/Controller/AbstractController.php +3 −1 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ use UnicaenApp\Controller\Plugin\ConfirmPlugin; use UnicaenApp\Controller\Plugin\Mail; use Zend\Http\Request as HttpRequest; use Zend\Mvc\Controller\AbstractActionController; use Zend\Mvc\Plugin\FlashMessenger\FlashMessenger; use ZfcUser\Controller\Plugin\ZfcUserAuthentication; /** Loading @@ -26,7 +27,7 @@ use ZfcUser\Controller\Plugin\ZfcUserAuthentication; * @method ZfcUserAuthentication zfcUserAuthentication() * @method HttpRequest getRequest() * @method UploaderPlugin uploader() * @method boolean isAllowed($resource, $privilege) * @method boolean isAllowed($resource, $privilege = null) * @method UrlThesePlugin urlThese() * @method UrlDoctorant urlDoctorant() * @method UrlFichier urlFichier() Loading @@ -34,6 +35,7 @@ use ZfcUser\Controller\Plugin\ZfcUserAuthentication; * @method UrlWorkflow urlWorkflow() * @method Mail mail() * @method ConfirmPlugin confirm() * @method FlashMessenger flashMessenger() */ class AbstractController extends AbstractActionController implements UserContextServiceAwareInterface Loading
module/Application/src/Application/Controller/UtilisateurController.php +7 −8 Original line number Diff line number Diff line Loading @@ -60,12 +60,12 @@ class UtilisateurController extends \UnicaenAuth\Controller\UtilisateurControlle /** * @var AuthenticationService */ private $authenticationService; protected $authenticationService; /** * @var ShibService */ private $shibService; protected $shibService; /** * @var CreationUtilisateurForm Loading Loading @@ -235,8 +235,7 @@ class UtilisateurController extends \UnicaenAuth\Controller\UtilisateurControlle if (isset($currentIdentity['shib'])) { /** @var ShibUser $currentIdentity */ $currentIdentity = $currentIdentity['shib']; } elseif (isset($currentIdentity['ldap'])) { } elseif (isset($currentIdentity['ldap'])) { /** @var People $currentIdentity */ $currentIdentity = $currentIdentity['ldap']; } else { Loading Loading @@ -291,8 +290,7 @@ class UtilisateurController extends \UnicaenAuth\Controller\UtilisateurControlle if (isset($currentIdentity['shib'])) { /** @var ShibUser $currentIdentity */ $currentIdentity = $currentIdentity['shib']; } elseif (isset($currentIdentity['ldap'])) { } elseif (isset($currentIdentity['ldap'])) { /** @var People $currentIdentity */ $currentIdentity = $currentIdentity['ldap']; } else { Loading Loading @@ -425,7 +423,7 @@ class UtilisateurController extends \UnicaenAuth\Controller\UtilisateurControlle $utilisateurs = $this->utilisateurService->getRepository()->findByIndividu($individu, $isLocal = true); // done // NB: findByIndividu() avec $isLocal = true renverra 1 utilisateur au maximum $utilisateur = $utilisateurs ? current($utilisateurs) : null; if ($utilisateur === null AND $individu->getEmail() !== null) { if ($utilisateur === null and $individu->getEmail() !== null) { $utilisateur = $this->utilisateurService->getRepository()->findByUsername($individu->getEmail()); } Loading Loading @@ -471,7 +469,8 @@ class UtilisateurController extends \UnicaenAuth\Controller\UtilisateurControlle return $this->redirect()->toRoute('utilisateur/gerer-utilisateur', ['individu' => $individu->getId()], [], true); } public function initCompteAction() { public function initCompteAction() { $token = $this->params()->fromRoute('token'); $utilisateur = $this->utilisateurService->getRepository()->findByToken($token); Loading
module/Application/src/Application/Entity/Db/Source.php +1 −1 Original line number Diff line number Diff line Loading @@ -5,7 +5,7 @@ namespace Application\Entity\Db; /** * Source */ class Source class Source extends \UnicaenDbImport\Entity\Db\Source { /** * @var string Loading
module/Application/src/Application/Filter/ActeursFormatter.php +5 −10 Original line number Diff line number Diff line Loading @@ -7,9 +7,6 @@ use Zend\View\Helper\HtmlList; use Zend\Filter\AbstractFilter; use Zend\View\Renderer\PhpRenderer; //TODO JP 22/11/2017 doFormat need to be able to use Collection, These and array of Acteur // add the transformation in doFormat /** --- Class ActeursFormatteur --- * @var bool $asUl returned data type as unordered list (html) * @var bool $asSeparated returned data type as separated value Loading Loading @@ -66,7 +63,6 @@ class ActeursFormatter extends AbstractFilter { } /** Set the returned data type to separated value format and set the separator * @param string $separator (default = ", ") * @return $this */ public function asArray() Loading Loading @@ -104,7 +100,7 @@ class ActeursFormatter extends AbstractFilter { /** Format n array of acteurs * @param Acteur[] $acteurs * @return formated set of acteurs * @return string */ public function doFormat($acteurs) { Loading @@ -131,7 +127,7 @@ class ActeursFormatter extends AbstractFilter { /** This function format an array of acteurs as a unordered list * @param Acteur[] $acteurs * @return an unordered list * @return string */ private function doFormatUnorderedList($acteurs) { $acteurs = array_map([$this, 'htmlifyActeur'], $acteurs); Loading @@ -143,7 +139,7 @@ class ActeursFormatter extends AbstractFilter { /** This function format an array of acteurs as Separated Values object * @param Acteur[] $acteurs * @return Separated Values object * @return string Separated Values object */ private function doFormatSeparated($acteurs) { $acteurs = array_map([$this, 'htmlifyActeur'], $acteurs); Loading Loading @@ -202,7 +198,8 @@ class ActeursFormatter extends AbstractFilter { } /** Set the displayed keys * @param Array $params of keys [role, complement, qualite, etablissement] and boolean * @param array $params of keys [role, complement, qualite, etablissement] and boolean * @return ActeursFormatter */ public function paramFilter(array $params) { foreach ($params as $key => $value) { Loading @@ -223,14 +220,12 @@ class ActeursFormatter extends AbstractFilter { return $this; } public function filter($acteurs) { $results = []; /** @var Acteur $acteur */ foreach($acteurs as $acteur) { $keep = true; if ($keep && $this->contrainteRole != null && $acteur->getRole()->getCode() != $this->contrainteRole) $keep = false; if ($keep && $this->contrainteRoleLibelle != null && $acteur->getRole()->getLibelle() != $this->contrainteRoleLibelle) $keep = false; Loading