/**
  * MOTEUR DE RECHERCHE
  * Cette fonction retourne l'affiche de l'interface du moteur de recherche
  * @param type $module
  * @param type $id_recherche
  * @param type $etat_table
  * @param type $id_recherche_etat
  * @param type $abreviation_recherche_etat
  * @param type $nom_recherche_recherche_etat
  * @param string $paramImageBordure
  * @param string $paramImageRecherche
  * @param type $champ_retour
  * @param int $paramNbLimiteDeResultat
  * @param type $url_page_depart
  * @param type $QUERY_STRING
  * @param type $PHP_SELF
  * @param type $nbligne
  * @param type $nbcol
  * @param type $champ_recherche
  * @param type $operateur_recherche
  * @param type $texte_recherche
  * @param type $champ_courant
  * @param type $operateur_courant
  * @param type $texte_courant
  * @param type $nb_col_courant
  * @param type $ajout_col
  * @param type $paramRequete
  * @param type $tab_resultat
  * @param type $module_table
  * @return type
  */
 public static function afficherMoteurDeRecherche($module, $id_recherche, $etat_table, $id_recherche_etat, $abreviation_recherche_etat, $nom_recherche_recherche_etat, $paramImageBordure, $paramImageRecherche, $champ_retour, $paramNbLimiteDeResultat, $url_page_depart, $QUERY_STRING, $PHP_SELF, $nbligne, $nbcol, $champ_recherche, $operateur_recherche, $texte_recherche, $champ_courant, $operateur_courant, $texte_courant, $nb_col_courant, $ajout_col, $paramRequete, $tab_resultat, $module_table, $nb_ligne_courant)
 {
     /*
      Définition des Variables
     */
     if ($url_page_depart == '') {
         if ($QUERY_STRING) {
             $url_page_depart = '(' . $PHP_SELF . '?' . $QUERY_STRING . ')';
         } else {
             $url_page_depart = '(' . $PHP_SELF . ')';
         }
     }
     $return = "";
     $_REQUEST['table_champ_retour'] = $module_table;
     // table du champ retour
     $_REQUEST['table_tous_champs_rech'] = $module_table . "_moteur_de_recherche";
     $tab_resultat;
     //Construction du code HTML
     $return .= "\n     <center>\n     <img src=" . $paramImageBordure . "> &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp\n     <img src=" . $paramImageBordure . "> &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp\n     <img src=" . $paramImageBordure . "> &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp\n     <img src=" . $paramImageBordure . "> &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp\n     <img src=" . $paramImageBordure . "> &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp\n     <img src=" . $paramImageBordure . "> &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp\n     <img src=" . $paramImageBordure . ">\n     <br>\n     </center>\n     <center>\n     <table width=100% border=1 valign=top cellspacing=0>\n     <tr>\n     <td class=titre_principal><img src=" . $paramImageRecherche . " WIDTH=70 HEIGHT=50 align=left> <br> Recherche <br><br></td>\n     </tr>\n     <tr>\n     <td colspan=3> ";
     $return .= MoteurDeRecherche::recuperationDesDonneesDeRecherche($module, $url_page_depart, $module_table, $champ_retour, $paramNbLimiteDeResultat, $nbligne, $nbcol, $champ_recherche, $operateur_recherche, $texte_recherche, $champ_courant, $operateur_courant, $texte_courant, $nb_col_courant, $nb_ligne_courant, $ajout_col);
     $return .= "</td>\n      </tr>\n      </table>\n      ";
     if ($tab_resultat) {
         $tab_resultat = explode(';;', $tab_resultat);
     }
     $return .= "\n     <table width=100% border=1 valign=top cellspacing=0>\n     <tr>\n     <td class=titre_principal> <br> Résultats <br><br></td>\n     </tr>\n     ";
     $choix = -1;
     // pour que l'on affiche les entetes du tableau une seule fois
     if ($paramRequete) {
         //On vérifie si le résultat n'est pas nul
         $result_requete_resultat = DatabaseOperation::convertSqlStatementWithoutKeyToArray($paramRequete);
         if (!$result_requete_resultat) {
             $titre = 'Moteur de Recherche';
             $message = UserInterfaceMessage::FR_WARNING_RECHERE_ERREUR;
             Lib::showMessage($titre, $message, $redirection);
         } elseif (count($result_requete_resultat) > ModuleConfig::VALUE_MAX_MOTEUR_RECHERCHE) {
             $message = UserInterfaceMessage::FR_WARNING_RECHERE . ModuleConfig::VALUE_MAX_MOTEUR_RECHERCHE;
             $redirection = "recherche.php";
             Lib::showMessage("Erreur", $message, $redirection);
         }
         //Regroupement par Etat du résultat
         $req = "SELECT * FROM {$etat_table} ";
         //Spécificité propre au module FTMP
         //Restriction par droit d'accès
         //  $acces= $module."_modification";
         //  echo $SESSION[$acces];
         if (!Acl::getValueAccesRights($module . "_modification") and $_SESSION["module"] == "fiches_mp_achats") {
             $req .= "WHERE " . $abreviation_recherche_etat . "='V' OR " . $abreviation_recherche_etat . "='E' ";
         }
         $result = DatabaseOperation::convertSqlStatementWithoutKeyToArray($req);
         foreach ($result as $rows) {
             //Construction de la reqûete de resultat propre à cet Etat
             $req1 = "{$paramRequete} AND " . $id_recherche_etat . "=" . $rows[$id_recherche_etat];
             $arrayFta = DatabaseOperation::convertSqlStatementWithoutKeyToArray($req1);
             //Si il y a des résltat on commence la construction du tableau
             if ($arrayFta) {
                 //Affichage de l'en-tête de regroupement
                 $return .= "<tr><td class=titre>" . $rows["nom_" . $etat_table] . "</td></tr>";
                 //Affichage des fiches
                 foreach ($arrayFta as $rowsFta) {
                     //echo $choix;
                     $return .= "<tr><td>" . TableauFicheView::getHtmlTable($rowsFta[$id_recherche], $choix, "0", "") . "</td></tr>";
                 }
             }
             $return .= "<br>";
         }
         // Fin de l'affichage des résultats;
     }
     //Dans le cas où un résultat de recherche est proposé, affichage du tableau
     //if ($tab_resultat){
     $return .= "</td></tr>\n     </table>\n     <br>\n     <img src=" . $paramImageBordure . "><img src=" . $paramImageBordure . "><img src=" . $paramImageBordure . "><img src=" . $paramImageBordure . "><img src=" . $paramImageBordure . "><img src=" . $paramImageBordure . ">\n     <img src=" . $paramImageBordure . "><img src=" . $paramImageBordure . "><img src=" . $paramImageBordure . "><img src=" . $paramImageBordure . "><img src=" . $paramImageBordure . "><img src=" . $paramImageBordure . ">\n     <img src=" . $paramImageBordure . "><img src=" . $paramImageBordure . "><img src=" . $paramImageBordure . "><img src=" . $paramImageBordure . "><img src=" . $paramImageBordure . "><img src=" . $paramImageBordure . ">\n     <img src=" . $paramImageBordure . "><img src=" . $paramImageBordure . "><img src=" . $paramImageBordure . "><img src=" . $paramImageBordure . "><img src=" . $paramImageBordure . "><img src=" . $paramImageBordure . ">\n     ";
     return $return;
     /*         * *****************************************************************************
               FIN MOTEUR DE RECHERCHE
              * ***************************************************************************** */
 }
        $Poids_ELEM = $rowsDossierFta[FtaModel::FIELDNAME_POIDS_ELEMENTAIRE];
        $abreviation_fta_etat = FtaEtatModel::getAbreviationEtatByIdEtat($rowsDossierFta[FtaModel::FIELDNAME_ID_FTA_ETAT]);
        //Désignation commerciale
        $din = TableauFicheView::getStringDINCompacted($designation_commerciale_fta, $LIBELLE, $NB_UNIT_ELEM, $Poids_ELEM);
        //Etat de la Fta
        $nomEtat = FtaEtatModel::getNameEtatByIdEtat($rowsDossierFta[FtaModel::FIELDNAME_ID_FTA_ETAT]);
        if (!$use) {
            $conseille = "(conseillé)";
            $use = "1";
        } else {
            $conseille = "";
        }
        /*
         * Attribution des couleurs de fonds suivant l'état de la FTA
         */
        $bgcolor = TableauFicheView::getHtmlCellBgColor($abreviation_fta_etat);
        $selection = '<input type=\'radio\' name=selection_fta value=\'' . $idFta . '\'  />' . $conseille;
        $tableau_fiches .= "<tr class=contenu>\r\n                              <td {$bgcolor_header} " . $selection_width . " > {$icon_header} {$selection}</td>\r\n                              ";
        $tableau_fiches .= "<td align=center {$bgcolor} {$largeur_html_C1}>" . $din . " (" . $nomEtat . ") " . "</a></td>" . "<td {$bgcolor} width=3%>" . $id_dossier_fta . "v" . $id_version_dossier_fta . "</td>";
        $tableau_fiches .= "<td {$bgcolor} width=\"1%\"> <b><font size=\"2\" color=\"#0000FF\">" . $code_article_ldc . "</font></b></td>";
        $tableau_fiches .= "</tr>";
    }
} else {
    $titre = UserInterfaceMessage::FR_WARNING_DATA_DOSSIER_FTA_TITLE;
    $message = UserInterfaceMessage::FR_WARNING_DATA_DOSSIER_FTA;
    Lib::showMessage($titre, $message, $redirection);
}
$bouton_submit = FtaView::getHtmlButtonSubmit();
$bouton_retour_vers_fta = FtaView::getHtmlButtonReturnFta($paramIdFta, $paramIdFtaChapitreEncours, $paramSyntheseAction, $idFtaEtat, $abreviationFtaEtat, FtaRoleModel::ID_FTA_ROLE_COMMUN);
$titre = "Sélectionner la Fta à  associer";
/* * ************
Esempio n. 3
0
 /**
  * Barre de naviagtion de la Fta
  * @param type $paramActivationComplete
  * @return string
  */
 protected static function buildNavigationBar($paramActivationComplete)
 {
     //Variables
     $globalConfig = new GlobalConfig();
     UserModel::checkUserSessionExpired($globalConfig);
     $idUser = $globalConfig->getAuthenticatedUser()->getKeyValue();
     $html_table = 'table ' . 'border=1 ' . 'width=100% ' . 'class=contenu ';
     if (self::$id_fta) {
         $checkIdFta = self::$ftaModel->getDataField(FtaModel::KEYNAME)->getFieldValue();
         if (!$checkIdFta) {
             $titre = UserInterfaceMessage::FR_WARNING_PARAM_ID_FTA_TITLE;
             $message = UserInterfaceMessage::FR_WARNING_PARAM_ID_FTA_NOT_EXISTANT;
             $redirection = "index.php";
             Lib::showMessage($titre, $message, $redirection);
         }
     } else {
         $titre = UserInterfaceMessage::FR_WARNING_PARAM_ID_FTA_TITLE;
         $message = UserInterfaceMessage::FR_WARNING_PARAM_ID_FTA;
         $redirection = "index.php";
         Lib::showMessage($titre, $message, $redirection);
     }
     //Récupère la page en cours
     $arrayFtaEtatAndFta = DatabaseOperation::convertSqlStatementWithoutKeyToArray('SELECT ' . FtaModel::KEYNAME . ', ' . FtaModel::FIELDNAME_CREATEUR . ', ' . FtaModel::FIELDNAME_ARTICLE_AGROLOGIC . ', ' . FtaModel::FIELDNAME_DOSSIER_FTA . ', ' . FtaModel::FIELDNAME_VERSION_DOSSIER_FTA . ', ' . FtaModel::FIELDNAME_LIBELLE . ', ' . FtaModel::FIELDNAME_DESIGNATION_COMMERCIALE . ', ' . FtaModel::FIELDNAME_CODE_ARTICLE_LDC . ', ' . FtaWorkflowModel::FIELDNAME_DESCRIPTION_FTA_WORKFLOW . ', ' . FtaModel::FIELDNAME_COMMENTAIRE . ' FROM ' . FtaModel::TABLENAME . ',' . FtaEtatModel::TABLENAME . ',' . FtaWorkflowModel::TABLENAME . ' WHERE ' . FtaModel::KEYNAME . '=' . self::$id_fta . ' AND ' . FtaEtatModel::TABLENAME . '.' . FtaEtatModel::KEYNAME . '=' . FtaModel::TABLENAME . '.' . FtaModel::FIELDNAME_ID_FTA_ETAT . ' AND ' . FtaWorkflowModel::TABLENAME . '.' . FtaWorkflowModel::KEYNAME . '=' . FtaModel::TABLENAME . '.' . FtaModel::FIELDNAME_WORKFLOW);
     /**
      * Liste des Rôles auxquelles l'utilisateur à accès pour un workflow donnée
      */
     $arrayRoleWorkflow = FtaRoleModel::getArrayIdFtaRoleByIdUserAndWorkflow($idUser, self::$id_fta_workflow);
     if (count($arrayRoleWorkflow) > "1") {
         $RoleNavigation = FtaRoleModel::getRolesNavigationBar($idUser, self::$id_fta_workflow, self::$ftaModel, self::$synthese_action, self::$id_fta_chapitre_encours, self::$id_fta_role);
     } else {
         $ftaRoleModel = new FtaRoleModel(self::$id_fta_role);
     }
     $siteDeProduction = self::$ftaModel->getDataField(FtaModel::FIELDNAME_SITE_PRODUCTION)->getFieldValue();
     $geoModel = new GeoModel($siteDeProduction);
     foreach ($arrayFtaEtatAndFta as $rowsFtaEtatAndFta) {
         //Récupération des informations préalables
         //Nom de l'assistante de projet responsable:
         $userModel = new UserModel($rowsFtaEtatAndFta[FtaModel::FIELDNAME_CREATEUR]);
         $createur = $userModel->getPrenomNom();
         //Construction du Menu
         $menu_navigation = self::buildMenu($arrayRoleWorkflow, $rowsFtaEtatAndFta, $html_table, $RoleNavigation, $geoModel, $createur, $ftaRoleModel);
     }
     if ($paramActivationComplete) {
         //Si une action est donnée, alors construction du menu des chapitres
         $menu_navigation .= self::CheckSyntheseAction();
     }
     //Lien de retour rapide
     /**
      * Version avec le rewrite
      */
     //        self::$comeback_url = 'index-' . self::$id_fta_etat . '-' . self::$abreviation_etat . '-' . self::$id_fta_role . '-' . self::$synthese_action . '.html';
     if (self::$comeback == "1") {
         //                   self::$comeback_url = 'index.php?id_fta_etat=' . self::$id_fta_etat . '&nom_fta_etat=' . self::$abreviation_etat . '&id_fta_role=' . self::$id_fta_role . '&synthese_action=' . self::$synthese_action;
         $_SESSION["comeback_url"] = $_SERVER["HTTP_REFERER"];
     } elseif ($_SESSION["comeback_url"] == "") {
         $_SESSION["comeback_url"] = 'index.php?id_fta_etat=' . self::$id_fta_etat . '&nom_fta_etat=' . self::$abreviation_etat . '&id_fta_role=' . self::$id_fta_role . '&synthese_action=' . self::$synthese_action;
     }
     $menu_navigation .= '</tr><tr><td colspan=6 >
 <a href=' . $_SESSION["comeback_url"] . '><img src=../lib/images/bouton_retour.png alt=\'\' title=\'Retour\' width=\'18\' height=\'15\' border=\'0\' /> Retour</a> |
 ';
     if ($paramActivationComplete) {
         //Corps du menu
         $accesTransitionButton = FtaTransitionModel::isAccesTransitionButton(self::$id_fta_role, self::$id_fta_workflow);
         $idIntranetActionsSiteDeProduction = FtaActionSiteModel::getArrayIdIntranetActionByWorkflowAndSiteDeProduction(self::$id_fta_workflow, $siteDeProduction);
         $checkAccesButtonBySiteProd = IntranetActionsModel::isAccessFtaActionByIdUserFtaWorkflowAndSiteDeProduction($idUser, self::$id_fta_workflow, $idIntranetActionsSiteDeProduction);
         $tauxRound = FtaSuiviProjetModel::getPourcentageFtaTauxValidation(self::$ftaModel);
         /**
          * Bouton de trasition
          */
         $transition = TableauFicheView::getHmlLinkTransiter(self::$id_fta, self::$id_fta_role, self::$abreviation_etat, $checkAccesButtonBySiteProd, $accesTransitionButton, self::$synthese_action, $tauxRound, "18", " Transiter");
         /**
          * Bouton d'accès au rendu PDF de la FTA
          */
         $pdf = TableauFicheView::getHtmlLinkPDF(self::$abreviation_etat, self::$id_fta, self::$id_fta_workflow, "18", "Export PDF");
         if ($transition) {
             $transition = " | " . $transition;
         }
         if ($pdf) {
             $pdf = " | " . $pdf;
         }
         $historique = " | " . TableauFicheView::getHtmlLinkHistoriqueModfify(self::$abreviation_etat, self::$id_fta, self::$synthese_action, self::$id_fta_etat, self::$id_fta_role, "18", "Historique de modification");
         $menu_navigation .= '
                 <a href=historique-' . self::$id_fta . '-' . self::$id_fta_chapitre_encours . '-' . self::$id_fta_etat . '-' . self::$abreviation_etat . '-' . self::$id_fta_role . '-' . self::$synthese_action . '.html ><img src=./images/graphique.png alt=\'\' title=\'Etat d\'avancement\' width=\'18\' height=\'15\' border=\'0\' /> Etat d\'avancement</a>' . $historique . ' | <a href=fta2arcadia_summary.php?' . FtaModel::KEYNAME . '=' . self::$id_fta . '&id_fta_chapitre_encours=' . self::$id_fta_chapitre_encours . '&' . FtaEtatModel::KEYNAME . '=' . self::$id_fta_etat . '&' . FtaEtatModel::FIELDNAME_ABREVIATION . '=' . self::$abreviation_etat . '&' . FtaRoleModel::KEYNAME . '=' . self::$id_fta_role . '&synthese_action=' . self::$synthese_action . ' ><img src=./images/icone_information.png alt=\'\' title=\'Fta2Arcadia width=\'18\' height=\'15\' border=\'0\' /> Fta2Arcadia</a>' . $transition . $pdf . ' 
                    </td></tr>                       
                    </table>
                    ';
     }
     return $menu_navigation;
     //return $return raplacera menu_navigation;
 }
Esempio n. 4
0
function visualiser_fiches($paramIdFtaEtat, $choix, $isLimit, $order_common)
{
    $tableau_fiches = TableauFicheView::getHtmlTable($paramIdFtaEtat, $choix, $isLimit, $order_common);
    return $tableau_fiches;
}