/**
  * On vérifie si l'utilisateur connecter est le propriétaire de la transaction en cours.
  * @return boolean
  */
 function isEditableNotificationMail()
 {
     $globalConf = new GlobalConfig();
     $idUser = $globalConf->getAuthenticatedUser()->getKeyValue();
     $idUserRegister = $this->getDataField(self::FIELDNAME_ID_USER)->getFieldValue();
     if ($idUser == $idUserRegister) {
         $isEditable = Chapitre::EDITABLE;
     } else {
         $isEditable = Chapitre::NOT_EDITABLE;
     }
     return $isEditable;
 }
示例#2
0
<?php

//  require("../lib/session.php");
//  include("functions.php");
//  include("../lib/functions.php");
require_once '../inc/main.php';
$globalConfig = new GlobalConfig();
$login = $globalConfig->getAuthenticatedUser()->getKeyValue();
$id_user = $globalConfig->getAuthenticatedUser()->getKeyValue();
$pass = $globalConfig->getAuthenticatedUser()->getDataField(UserModel::FIELDNAME_PASSWORD)->getFieldValue();
$id_type = $globalConfig->getAuthenticatedUser()->getDataField(UserModel::FIELDNAME_ID_TYPE)->getFieldValue();
identification1("salaries", $login, $pass, FALSE);
//echo"lettre old :$lettreold<br>";
if ($inserer == 'inserer') {
    /* Insertion dans la table geo */
    if ($geo != '') {
        $geo = addslashes($geo);
        $lettre = strtoupper($lettre);
        // verification existence lettre
        $req = "select * from geo where lettre='{$lettrenew}'";
        $result = DatabaseOperation::query($req);
        $nb = mysql_num_rows($result);
        if (!$nb) {
            $req = "insert into geo (geo,lettre) values ('{$geo}','{$lettrenew}')";
            $result = DatabaseOperation::query($req);
        }
    }
}
if ($modifier == 'modifier') {
    /* Insertion dans la table geo */
    if ($geo != '') {
/*
 Initialisation des variables
*/
$page_default = substr(strrchr($_SERVER['PHP_SELF'], '/'), '1', '-4');
$page_action = $page_default . '_post.php';
$page_pdf = $page_default . '_pdf.php';
$action = 'valider';
//Action proposée à la page _post.php
$method = 'method=post';
//Pour une url > 2000 caractères, ne pas utiliser utiliser GET
$html_table = 'table ' . 'border=0 ' . 'width=100% ' . 'class=titre ';
/**
 * Initilisation
 */
$globalConfig = new GlobalConfig();
$idUser = $globalConfig->getAuthenticatedUser()->getKeyValue();
$numeroDePageCourante = Lib::getParameterFromRequest('numeroPage', '1');
$arrayIdFtaRoleAcces = FtaRoleModel::getArrayIdFtaRoleByIdUser($idUser);
$idFtaRole = $arrayIdFtaRoleAcces["0"][FtaRoleModel::KEYNAME];
IntranetActionsModel::getNameSiteByWorkflow($paramIdUser, $paramArrayIdWorkflow);
if (!FtaRoleModel::isGestionnaire($idFtaRole)) {
    $titre = UserInterfaceMessage::FR_WARNING_ACCES_RIGHTS_TITLE;
    $message = UserInterfaceMessage::FR_WARNING_ACCES_RIGHTS;
    $redirection = "index.php";
    Lib::showMessage($titre, $message, $redirection, TRUE);
}
$bloc .= "<" . $html_table . "><tr class=titre>" . "<td>Espace de travail</td>" . "<td width=10% >Dossier FTA</td>" . "<td>Code Article</td>" . "<td>Désignation Commerciale</td>" . "<td>Classification actuelle</td>" . "<td>Modifier une classification</td>" . "</tr>";
/**
 * On récupère le tableau complet des dossier Fta n'ayant pas de classification
 */
$arrayDossierComplet = DatabaseOperation::convertSqlStatementWithoutKeyToArray("SELECT DISTINCT " . FtaModel::FIELDNAME_DOSSIER_FTA . " FROM " . FtaModel::TABLENAME . " , " . FtaActionSiteModel::TABLENAME . " , " . FtaWorkflowModel::TABLENAME . " , " . IntranetDroitsAccesModel::TABLENAME . " , " . IntranetActionsModel::TABLENAME . " , " . ClassificationFta2Model::TABLENAME . " WHERE " . FtaModel::TABLENAME . "." . FtaModel::FIELDNAME_WORKFLOW . " = " . FtaWorkflowModel::TABLENAME . "." . FtaWorkflowModel::KEYNAME . " AND " . FtaModel::TABLENAME . "." . FtaModel::FIELDNAME_ID_FTA_CLASSIFICATION2 . "=" . ClassificationFta2Model::TABLENAME . "." . ClassificationFta2Model::KEYNAME . " AND " . FtaWorkflowModel::TABLENAME . "." . FtaWorkflowModel::FIELDNAME_ID_INTRANET_ACTIONS . "=" . IntranetActionsModel::TABLENAME . "." . IntranetActionsModel::FIELDNAME_PARENT_INTRANET_ACTIONS . " AND " . IntranetDroitsAccesModel::TABLENAME . "." . IntranetDroitsAccesModel::FIELDNAME_ID_INTRANET_ACTIONS . "=" . IntranetActionsModel::TABLENAME . "." . IntranetActionsModel::KEYNAME . " AND " . FtaActionSiteModel::TABLENAME . "." . FtaActionSiteModel::FIELDNAME_ID_INTRANET_ACTIONS . " IN (" . IntranetActionsModel::TABLENAME . "." . IntranetActionsModel::KEYNAME . ")" . ' AND ( 0 ' . IntranetActionsModel::addIdIntranetAction($_SESSION[Acl::ACL_INTRANET_ACTIONS_VALIDE]) . ")" . " AND " . IntranetDroitsAccesModel::FIELDNAME_NIVEAU_INTRANET_DROITS_ACCES . "=" . IntranetNiveauAccesModel::NIVEAU_GENERIC_TRUE . " AND " . IntranetDroitsAccesModel::FIELDNAME_ID_USER . "=" . $idUser . " GROUP BY " . FtaModel::FIELDNAME_DOSSIER_FTA);
$paramIdFtaChapitreEncours = Lib::getParameterFromRequest('id_fta_chapitre_encours');
$paramSyntheseAction = Lib::getParameterFromRequest('synthese_action');
/**
 * One ne le récupère pas pour le cas de des rôle chef de projet et site
 */
//$idFtaRole = Lib::getParameterFromRequest(FtaRoleModel::KEYNAME);
$idFtaEtat = Lib::getParameterFromRequest(FtaEtatModel::KEYNAME);
$abreviationFtaEtat = Lib::getParameterFromRequest(FtaEtatModel::FIELDNAME_ABREVIATION);
$comeback = Lib::getParameterFromRequest(FtaEtatModel::KEYNAME);
$createurFtaOLD = Lib::getParameterFromRequest('createur_fta');
$createurFtaNEW = Lib::getParameterFromRequest(FtaModel::TABLENAME . '_' . FtaModel::FIELDNAME_CREATEUR);
/**
 * Initialisation
 */
$globalConfig = new GlobalConfig();
$idUser = $globalConfig->getAuthenticatedUser()->getKeyValue();
$nomPrenomConnect = $globalConfig->getAuthenticatedUser()->getPrenomNom();
$userModelOLD = new UserModel($createurFtaOLD);
$userModelNEW = new UserModel($createurFtaNEW);
$nomWorkflowOLD = $userModelOLD->getPrenomNom();
$nomWorkflowNEW = $userModelNEW->getPrenomNom();
$commentaire = FtaController::getCommentGestionnaireChange($nomWorkflowOLD, $nomWorkflowNEW, $nomPrenomConnect);
switch ($action) {
    /*
     S'il n'y a pas d'actions défini
    */
    case 'valider':
        if ($createurFtaOLD != $createurFtaNEW) {
            $modelFta = new FtaModel($paramIdFta);
            /**
             * Commentaire de modification du gestionnaire de la Fta
示例#5
0
 /**
  * Vérifie si l'utilisateur a toujours sa session active.
  * Sinon, c'est qu'elle a expirée.
  * @param GlobalConfig $paramGlobalConfig
  * @return boolean
  */
 public static function isUserSessionExpired(GlobalConfig $paramGlobalConfig)
 {
     $errorReturn = FALSE;
     if (!$paramGlobalConfig->getAuthenticatedUser()) {
         $errorReturn = TRUE;
     }
     return $errorReturn;
 }
示例#6
0
<?php

/* * *******
  Inclusions
 * ******* */
require_once '../inc/main.php';
print_page_begin($disable_full_page, $menu_file);
flush();
$fta_consultation = Acl::getValueAccesRights('fta_consultation');
if (!$fta_consultation) {
} else {
    /*
     * Initilisation
     */
    $globalConfig = new GlobalConfig();
    if ($globalConfig->getAuthenticatedUser()) {
        $id_user = $globalConfig->getAuthenticatedUser()->getKeyValue();
        $lieuGeo = $globalConfig->getAuthenticatedUser()->getLieuGeo();
    }
    /*     * ***********
          Début Code PHP
         * *********** */
    if ($id_user) {
        /*
         Initialisation des variables
        */
        $page_default = substr(strrchr($_SERVER['PHP_SELF'], '/'), '1', '-4');
        //   $page_action=$page_default.'_post.php';
        $page_action = 'transiter_post.php';
        //    $page_action = 'modification_fiche.php';
        $page_pdf = $page_default . '_pdf.php';
 /**
  * Envoi un mail d'information global (pour une liste de FTA)
  * @param array $paramSelectionFta
  * @param array $paramListeDiffusion
  * @param string $paramSubject
  * @param string $paramLogTransition
  */
 public static function buildEnvoiMailGlobal($paramSelectionFta, $paramListeDiffusion, $paramSubject, $paramLogTransition)
 {
     /**
      * Utilisateur connecté
      */
     $globalConfig = new GlobalConfig();
     $idUser = $globalConfig->getAuthenticatedUser()->getKeyValue();
     $url = $globalConfig->getConf()->getUrlFullRoot();
     $userModel = new UserModel($idUser);
     $nom = $userModel->getDataField(UserModel::FIELDNAME_NOM)->getFieldValue();
     $prenom = $userModel->getDataField(UserModel::FIELDNAME_PRENOM)->getFieldValue();
     $mailUser = $userModel->getDataField(UserModel::FIELDNAME_MAIL)->getFieldValue();
     $text = "Bonjour,\n" . "\tNous vous informons de la validation des Fiches Techniques Articles suivantes:\n";
     $req = " SELECT " . GeoModel::FIELDNAME_LIBELLE_SITE_AGIS . "," . FtaModel::KEYNAME . "," . FtaModel::FIELDNAME_CODE_ARTICLE_LDC . "," . FtaModel::FIELDNAME_LIBELLE . " FROM " . FtaModel::TABLENAME . ",  " . GeoModel::TABLENAME . " WHERE ( 0 " . FtaModel::addIdFta($paramSelectionFta) . " ) " . " AND " . GeoModel::TABLENAME . "." . GeoModel::KEYNAME . "=" . FtaModel::TABLENAME . "." . FtaModel::FIELDNAME_SITE_PRODUCTION . " ORDER BY " . GeoModel::FIELDNAME_LIBELLE_SITE_AGIS;
     $paramLogTransition .= "\n\n" . $req;
     $arrayFta = DatabaseOperation::convertSqlStatementWithoutKeyToArray($req);
     $typeMail = "Validation";
     //Parcours des FTA classé par site
     foreach ($arrayFta as $rowsFta) {
         //Classement par site d'assemblage
         if ($last_site != $rowsFta[GeoModel::FIELDNAME_LIBELLE_SITE_AGIS]) {
             $text .= "\n\nSite d'assemblage: " . $rowsFta[GeoModel::FIELDNAME_LIBELLE_SITE_AGIS] . "\n";
         }
         //Insertion de la ligne d'article
         $text .= "<a href='" . $url . "/fta/modification_fiche.php?" . FtaModel::KEYNAME . "=" . $rowsFta[FtaModel::KEYNAME] . "&synthese_action=all&comeback=0&" . FtaEtatModel::KEYNAME . "=3&" . FtaEtatModel::FIELDNAME_ABREVIATION . "=V&" . FtaRoleModel::KEYNAME . "=0' >" . $rowsFta[FtaModel::FIELDNAME_CODE_ARTICLE_LDC] . " " . $rowsFta[FtaModel::FIELDNAME_LIBELLE] . " </a>" . "\n";
         //Enregistrement du site
         $last_site = $rowsFta[GeoModel::FIELDNAME_LIBELLE_SITE_AGIS];
     }
     $sujetmail = "FTA/Validation: " . $paramSubject;
     $text .= "\n" . "Ces Articles sont maintenant disponibles et à jour dans l'ensemble de notre système informatique\n" . "\n" . "Bonne journée.\n" . "Intranet - FTA\n" . "\n" . "\n" . "NB : une ligne d'article est composée du code Article Arcadia et la DIN";
     /**
      * Envoi du mail d'information
      */
     foreach ($paramListeDiffusion as $mail_validation) {
         if (!is_string($mail_validation)) {
             $destinataire = $mail_validation[UserModel::FIELDNAME_MAIL];
             $liste_destinataire .= $mail_validation["prenom_nom"] . ": " . $destinataire . "\n";
             $expediteur = $prenom . " " . $nom . " <" . $mailUser . ">";
             envoismail($sujetmail, $text, $destinataire, $expediteur, $typeMail);
         }
     }
     /**
      * Envoi du mail de contrôle
      */
     $sujetmail = "FTA/Information \"" . $paramSubject;
     $corp = "DESTINATAIRES:\n" . $liste_destinataire . "\n" . "\n" . "Message envoyé:\n" . "\n" . $text . "\n\n" . $paramLogTransition;
     $expediteur = $prenom . " " . $nom . " <" . $mailUser . ">";
     envoismail($sujetmail, $corp, $mailUser, $expediteur, $typeMail);
 }