/** * Liste des Rôles auxquelles l'utilisateur à accès pour un workflow donnée * @param int $paramIdUser * @param int $paramWorkflow * @param FtaModel $ftaModel * @param string $paramSytheseAction * @param int $paramIdftaChapitreEncours * @return string */ public static function getRolesNavigationBar($paramIdUser, $paramWorkflow, FtaModel $ftaModel, $paramSytheseAction, $paramIdftaChapitreEncours, $paramIdFtaRoleEncours) { //Variable $listeRole = array(); $arrayRoleWorkflow = FtaRoleModel::getArrayIdFtaRoleByIdUserAndWorkflow($paramIdUser, $paramWorkflow); //Calcul du taux $taux_temp = FtaSuiviProjetModel::getArrayFtaTauxValidation($ftaModel, TRUE); if ($taux_temp["1"]) { foreach ($taux_temp["1"] as $id_fta_processus => $taux) { /** * On obtient le rôle pour lequel le processus correspond */ $arrayCheckRole = FtaWorkflowStructureModel::getArrayRoleByProcessusAndWorkflow($id_fta_processus, $paramWorkflow); $checkRole1 = array_intersect($arrayCheckRole, $arrayRoleWorkflow); if ($checkRole1) { $checkRole2 = array_intersect($arrayCheckRole, $listeRole); if (!$checkRole2) { /** * 0 en attente * entre 0 et 1 cours * 1 validé */ $listeRole[] = $arrayCheckRole["0"]; /** * Mise en forme du rôle en cours */ if ($arrayCheckRole["0"] == $paramIdFtaRoleEncours) { $font_size = "size=" . Navigation::FONT_SIZE_ROLE_ENCOURS; $font_flash = "<font " . $font_size . ">"; $image_flash1 = $font_flash . '[ ' . "</font>"; $image_flash2 = $font_flash . ' ]' . "</font>"; } else { $font_size = ""; $image_flash1 = '- '; $image_flash2 = ' -'; } if ($taux == "0") { /** * Vérification que tous les processus précédent soit validé si oui le processus est encours */ $taux_validation_processus = FtaProcessusModel::getFtaProcessusNonValidePrecedent($ftaModel->getKeyValue(), $id_fta_processus, $paramWorkflow); if ($taux_validation_processus == "1" or $taux_validation_processus === NULL) { $ftaRoleModel = new FtaRoleModel($arrayCheckRole["0"]); $roles .= $image_flash1 . ' <a href=' . 'modification_fiche' . '.php?' . 'id_fta=' . $ftaModel->getKeyValue() . '&id_fta_chapitre_encours=' . $paramIdftaChapitreEncours . '&synthese_action=' . $paramSytheseAction . '&id_fta_etat=' . $ftaModel->getDataField(FtaModel::FIELDNAME_ID_FTA_ETAT)->getFieldValue() . '&abreviation_fta_etat=' . $ftaModel->getModelFtaEtat()->getDataField(FtaEtatModel::FIELDNAME_ABREVIATION)->getFieldValue() . '&id_fta_role=' . $arrayCheckRole["0"] . '>' . $ftaRoleModel->getDataField(FtaRoleModel::FIELDNAME_DESCRIPTION_FTA_ROLE)->getFieldValue() . '</a> ' . $image_flash2 . ' '; } else { $ftaRoleModel = new FtaRoleModel($arrayCheckRole["0"]); /** * Liien vers l'historique sans la navigation */ $roles .= $image_flash1 . $ftaRoleModel->getDataField(FtaRoleModel::FIELDNAME_DESCRIPTION_FTA_ROLE)->getFieldValue() . $image_flash2 . ' '; } } elseif ($taux == "1" or $taux != "0" and $taux != "1") { $ftaRoleModel = new FtaRoleModel($arrayCheckRole["0"]); $roles .= $image_flash1 . ' <a href=' . 'modification_fiche' . '.php?' . 'id_fta=' . $ftaModel->getKeyValue() . '&id_fta_chapitre_encours=' . $paramIdftaChapitreEncours . '&synthese_action=' . $paramSytheseAction . '&id_fta_etat=' . $ftaModel->getDataField(FtaModel::FIELDNAME_ID_FTA_ETAT)->getFieldValue() . '&abreviation_fta_etat=' . $ftaModel->getModelFtaEtat()->getDataField(FtaEtatModel::FIELDNAME_ABREVIATION)->getFieldValue() . '&id_fta_role=' . $arrayCheckRole["0"] . '>' . $ftaRoleModel->getDataField(FtaRoleModel::FIELDNAME_DESCRIPTION_FTA_ROLE)->getFieldValue() . '</a> ' . $image_flash2 . ' '; } } } } $RoleNavigation = ' Rôles ' . $roles; } return $RoleNavigation; }
/** * Mise à jour du pourcentage d'avancement d'un Fta */ public function updateAvancementFta() { $idFta = $this->getKeyValue(); $idFtaWorkflow = $this->getDataField(FtaModel::FIELDNAME_WORKFLOW)->getFieldValue(); /** * Recalcul + stockage % Avancement */ $taux_temp = FtaSuiviProjetModel::getArrayFtaTauxValidation($this, FALSE); $recap[$idFta] = round($taux_temp['0'] * '100', '0') . '%'; $this->getDataField(FtaModel::FIELDNAME_POURCENTAGE_AVANCEMENT)->setFieldValue($recap[$idFta]); /** * Recalcul + stockage liste des services */ $listeIdRole = FtaRoleModel::getListeIdFtaRoleEncoursByIdFta($idFta, $idFtaWorkflow); $this->getDataField(FtaModel::FIELDNAME_LISTE_ID_FTA_ROLE)->setFieldValue($listeIdRole); $this->saveToDatabase(); }
$page_action = 'modification_fiche.php'; $page_pdf = $page_default . '_pdf.php'; $action = 'valider'; //Action proposée à la page _post.php $method = 'POST'; //Pour une url > 2000 caractères, ne pas utiliser utiliser GET $html_table = 'table ' . 'width=100% ' . 'class=titre_principal '; $detail_id_fta; //Identifiant de la fiche sur laquelle on souhaite un détail /* Récupération des données MySQL */ Navigation::initNavigation($id_fta, $id_fta_chapitre, $synthese_action, $comeback, $idFtaEtat, $abreviationFtaEtat, $idFtaRole, TRUE, TRUE); $navigue = Navigation::getHtmlNavigationBar(); //Calcul du taux $taux_temp = FtaSuiviProjetModel::getArrayFtaTauxValidation($ftaModel, TRUE); $details[$id_fta] = $taux_temp[1]; //Détail d'un FTA if ($id_fta) { $bloc .= ' <' . $html_table . '> <tr class=titre> <td> ' . DatabaseDescription::getFieldDocLabel(FtaRoleModel::TABLENAME, FtaRoleModel::FIELDNAME_DESCRIPTION_FTA_ROLE) . ' </td> <td> ' . DatabaseDescription::getFieldDocLabel(FtaChapitreModel::TABLENAME, FtaChapitreModel::FIELDNAME_NOM_CHAPITRE) . ' </td> <td> Taux </td>
/** * * @param type $paramFtaModel * @return type */ public static function getPourcentageFtaTauxValidation($paramFtaModel) { $tauxTemp = FtaSuiviProjetModel::getArrayFtaTauxValidation($paramFtaModel, FALSE); return round($tauxTemp[0] * 100, 0) . "%"; }