Beispiel #1
0
     }
 } elseif ($taux != "0" and $taux != "1") {
     $idFtaProcessusEtat = "2";
 } elseif ($taux == "1") {
     $idFtaProcessusEtat = "3";
 }
 $ftaProcessusEtatModel = new FtaProcessusEtatModel($idFtaProcessusEtat);
 //            $idSite = $ftaModel->getDataField(FtaModel::FIELDNAME_SITE_ASSEMBLAGE)->getFieldValue();
 $arrayIdFtaChapitre = DatabaseOperation::convertSqlStatementWithoutKeyToArray('SELECT DISTINCT ' . FtaChapitreModel::FIELDNAME_NOM_USUEL_CHAPITRE . ' FROM ' . FtaWorkflowStructureModel::TABLENAME . ',' . FtaChapitreModel::TABLENAME . ' WHERE ' . FtaWorkflowStructureModel::FIELDNAME_ID_FTA_WORKFLOW . '=' . $idFtaWorkflow . ' AND ' . FtaWorkflowStructureModel::FIELDNAME_ID_FTA_PROCESSUS . '=' . $id_fta_processus . ' AND ' . FtaChapitreModel::TABLENAME . '.' . FtaChapitreModel::KEYNAME . '=' . FtaWorkflowStructureModel::TABLENAME . '.' . FtaWorkflowStructureModel::FIELDNAME_ID_FTA_CHAPITRE);
 $nombreChapitre = count($arrayIdFtaChapitre);
 foreach ($arrayIdFtaChapitre as $rowsIdFtaChapitre) {
     $champChapitre .= $rowsIdFtaChapitre[FtaChapitreModel::FIELDNAME_NOM_USUEL_CHAPITRE] . '<br>';
 }
 //            $geoModel = new GeoModel($idSite);
 //            $nom_site = $geoModel->getDataField(GeoModel::FIELDNAME_GEO)->getFieldValue();
 $nom_fta_processus = $ftaProcessusModel->getDataField(FtaProcessusModel::FIELDNAME_NOM)->getFieldValue();
 $service_fta_processus = $ftaProcessusModel->getDataField(FtaProcessusModel::FIELDNAME_SERVICE)->getFieldValue();
 $couleur_fta_processus_etat = $ftaProcessusEtatModel->getDataField(FtaProcessusEtatModel::FIELDNAME_COULEUR_PROCESSUS_ETAT)->getFieldValue();
 $nom_fta_processus_etat = $ftaProcessusEtatModel->getDataField(FtaProcessusEtatModel::FIELDNAME_NOM_PROCESSUS_ETAT)->getFieldValue();
 //Ecriture du code HTML
 $bloc .= '
    <tr class=contenu >
         <td >
        &nbsp;' . $service_fta_processus . '
        </td>
       <td>   
        ' . $champChapitre . '
       </td> <td >
        &nbsp;' . round($taux * "100", "2") . '%
        </td>
        <td bgcolor=' . $couleur_fta_processus_etat . ' >
Beispiel #2
0
 /**
  * 
  * @return type
  */
 public function showDatesEcheanceProcessus()
 {
     //Variables locales
     $blocEcheanceLignes = "";
     $modelFtaProcessusDelai = new FtaProcessusDelaiModel();
     //Parcours et construction de toutes les échéances
     foreach ($this->getModel()->getArrayDataFieldEcheancesForProcessusCycle() as $modelFtaProcessusDelai) {
         //Construction des objets HTML de date
         $recordsetProcessus = new FtaProcessusModel($modelFtaProcessusDelai->getDataField(FtaProcessusDelaiModel::FIELDNAME_ID_FTA_PROCESSUS)->getFieldValue());
         $labelEcheance = "Echéance pour " . $recordsetProcessus->getDataField(FtaProcessusModel::FIELDNAME_NOM)->getFieldValue() . ": ";
         $dataFieldEcheance = $modelFtaProcessusDelai->getDataField(FtaProcessusDelaiModel::FIELDNAME_DATE_ECHEANCE_PROCESSUS);
         $dataFieldEcheance->setLabelCustom($labelEcheance);
         $HtmlElementEcheance = new DataFieldToHtmlInputCalendar($dataFieldEcheance);
         $blocEcheanceLignes .= $HtmlElementEcheance->getHtmlResult();
     }
     return $blocEcheanceLignes;
 }
Beispiel #3
0
 public function getArrayDataFieldEcheancesForProcessusCycle()
 {
     $dateEcheanceFta = $this->getDataField(FtaModel::FIELDNAME_DATE_ECHEANCE_FTA)->getFieldValue();
     $isEcheanceForThisFtaExist = NULL;
     //Date par processus
     $annee_date_echeance_fta = substr($dateEcheanceFta, 0, 4);
     $mois_date_echeance_fta = substr($dateEcheanceFta, 5, 2);
     $jour_date_echeance_fta = substr($dateEcheanceFta, 8, 2);
     $arrayModelFtaProcessusDelaiByIdProcessus = $this->getArrayModelFtaProcessusDelaiByIdProcessus();
     //Sélection de tous les processus appartenant au cycle de vie de la FTA
     $arrayIdProcessusFromFtaCycleDeVie = $this->getArrayIdProcessusFromFtaCycleDeVie();
     foreach ($arrayIdProcessusFromFtaCycleDeVie as $rows) {
         //Extraction des données du tableau PHP
         $idFtaProcessus = $rows[FtaProcessusModel::KEYNAME];
         $WeekSinceFirstProcessus = $rows[FtaProcessusCycleModel::FIELDNAME_DELAI];
         //Processus défini pour ce cycle de vie
         $modelFtaProcessusForCycle = new FtaProcessusModel($idFtaProcessus);
         //La FTA a-t-elle une échéance de renseignée pour ce processus ?
         if ($arrayModelFtaProcessusDelaiByIdProcessus != NULL) {
             $isEcheanceForThisFtaExist = array_key_exists($modelFtaProcessusForCycle->getKeyValue(), $arrayModelFtaProcessusDelaiByIdProcessus);
         }
         if ($isEcheanceForThisFtaExist) {
             //Si il existe, on récupère ce délai
             $modelFtaProcessusDelai = $arrayModelFtaProcessusDelaiByIdProcessus[$modelFtaProcessusForCycle->getKeyValue()];
         } else {
             //Si il n'existe pas, il faut initialiser l'échéance
             $modelFtaProcessusDelai = new FtaProcessusDelaiModel();
             $modelFtaProcessusDelai->setModelFtaById($this->getKeyValue());
             $modelFtaProcessusDelai->setModelFtaProcessusById($modelFtaProcessusForCycle->getKeyValue());
             //Mise à jour du tableau
             $arrayModelFtaProcessusDelaiByIdProcessus[$modelFtaProcessusForCycle->getDataField(FtaProcessusDelaiModel::FIELDNAME_ID_FTA_PROCESSUS)->getFieldValue()] = $modelFtaProcessusDelai;
         }
         //Récupération de la date d'échéance de la FTA définie pour ce processus
         if (($dateEcheanceFta == NULL or $dateEcheanceFta == "0000-00-00") and parent::getIsEditable()) {
             $modelFtaProcessusDelai->getDataField(FtaProcessusDelaiModel::FIELDNAME_DATE_ECHEANCE_PROCESSUS)->setFieldValue("");
         } else {
             $delai_jour = $WeekSinceFirstProcessus * ModuleConfig::DELAI_ECHEANCE_PROCESSUS_JOUR;
             $timestamp_date_echeance_fta = mktime(0, 0, 0, $mois_date_echeance_fta, $jour_date_echeance_fta - $delai_jour, $annee_date_echeance_fta);
             $dateDefaultEcheance = date("d-m-Y", $timestamp_date_echeance_fta);
             $modelFtaProcessusDelai->getDataField(FtaProcessusDelaiModel::FIELDNAME_DATE_ECHEANCE_PROCESSUS)->setFieldValue($dateDefaultEcheance);
         }
         $modelFtaProcessusDelai->saveToDatabase();
         //            $arrayDataFieldEcheancesForProcessusCycle[] = $modelFtaProcessusDelai->getDataField(FtaProcessusDelaiModel::FIELDNAME_DATE_ECHEANCE_PROCESSUS);
         $arrayDataFieldEcheancesForProcessusCycle[] = $modelFtaProcessusDelai;
         //Construction des objets HTML de date
         //            $labelEcheance = "Echéance pour " . $modelFtaProcessusDelai->getModelFtaProcessus()->getDataField(FtaProcessusModel::FIELDNAME_SERVICE)->getFieldValue() . ": ";
         //            $dataFieldEcheance = $modelFtaProcessusDelai->getDataField(FtaProcessusDelaiModel::FIELDNAME_DATE_ECHEANCE_PROCESSUS);
         //            $dataFieldEcheance->setLabelCustom($labelEcheance);
         //
         //            $HtmlElementEcheance = new DataFieldToHtmlInputCalendar($dataFieldEcheance);
         //
         //            $blocEcheanceLignes .= $HtmlElementEcheance->getHtmlResult();
     }
     return $arrayDataFieldEcheancesForProcessusCycle;
 }