예제 #1
0
 /**
  * On obtient le chapitre par défaut en redirection
  * @param int $paramIdFtaRole
  * @param int $paramIdFtaWorkflow
  * @param array $paramListeDesChapitres
  * @return array
  */
 public static function getIdFtaChapitreByDefault($paramIdFtaRole, $paramIdFtaWorkflow, $paramListeDesChapitres)
 {
     $arrayProcessusAcces = FtaWorkflowStructureModel::getArrayProcessusByRoleAndWorkflow($paramIdFtaRole, $paramIdFtaWorkflow);
     $ListeDesChapitresByUser = FtaChapitreModel::getIdFtaChapitreByArrayProcessusAndWorkflow($arrayProcessusAcces, $paramIdFtaWorkflow);
     if ($paramListeDesChapitres) {
         $ListeDesChapitresAcces = array_intersect($paramListeDesChapitres, $ListeDesChapitresByUser);
     }
     foreach ($ListeDesChapitresAcces as $key => $value) {
         $idFtaChapitre = $value;
     }
     if (!$idFtaChapitre) {
         $idFtaChapitre = FtaChapitreModel::ID_CHAPITRE_IDENTITE;
     }
     return $idFtaChapitre;
 }
 /**
  * Donne accès aux bouton de transition 
  * pour les utilisateur se trouvant en fin de parcours de l'espace de travail
  * @param int $paramIdFtaRole
  * @param int $paramIdFtaWorkflow
  * @return boolean
  */
 public static function isAccesTransitionButton($paramIdFtaRole, $paramIdFtaWorkflow)
 {
     $isAccesTransition = FALSE;
     /**
      * Liste des processus pouvant être validé
      */
     $arrayProcessusValidation = FtaProcessusCycleModel::getArrayProcessusValidationFTA($paramIdFtaWorkflow);
     /**
      * Listes des processus auxquel l'utilisateur connecté à les droits d'accès
      */
     $arrayProcessusAcces = FtaWorkflowStructureModel::getArrayProcessusByRoleAndWorkflow($paramIdFtaRole, $paramIdFtaWorkflow);
     $accesTransitionButton = array_intersect($arrayProcessusValidation, $arrayProcessusAcces);
     if ($accesTransitionButton) {
         $isAccesTransition = TRUE;
     }
     return $isAccesTransition;
 }