Subversion Repositories Applications.referentiel

Compare Revisions

Ignore whitespace Rev 23 → Rev 22

/trunk/interfaces/configurations/config.default.ini
15,7 → 15,7
; Nom de domaine pour l'URL de base de l'application : 162.38.234.6
domaine = "localhost"
; URL de base de l'application, si elle est laissée vide, l'application fonctionnera en Stand-alone
url_base = "http://{ref:domaine}/referentiel/"
url_base = "http://{ref:domaine}/referentiel/index.php"
; Mettre à true si l'application nécessite de s'identifier.
identification = false
 
36,7 → 36,7
; +------------------------------------------------------------------------------------------------------+
; Spécifique à l'application
; Url du Jrest utilisé pour les services web fournissant les données à l'application
url_jrest = "{ref:url_base}services/"
url_jrest = "http://localhost/referentiel/jrest/"
; Nom du fichier contenant les infos sur la version courante du manuel technique
manuel = "referentiel_v2.1.ini"
 
/trunk/interfaces/squelettes/form_traitement.tpl.html
File deleted
\ No newline at end of file
/trunk/interfaces/controleurs/Test.php
15,20 → 15,24
*/
class Test extends AppliControleur {
private $referentiel = null;
private $traitementDao = null;
private $messages = null;
private $projet = null;
private $tableStructureDao = null;
private $referentielDao = null;
private $manuel = null;
public function __construct() {
parent::__construct();
// Récupération de paramêtres
if (isset($_GET['ref'])) { // code du projet courrant
$this->referentiel = strtolower($_GET['ref']);
if (isset($_GET['projet'])) { // code du projet courrant
$this->projet = $_GET['projet'];
}
// Parser le fichier ini contenant certains règles liées à la version du manuel
$this->manuel = parse_ini_file(Config::get('dossier_configurations').DS.Config::get('manuel'));
// Chargement des DAO nécessaires
$this->traitementDao = new TraitementDao();
$this->tableStructureDao = $this->getModele('TableStructureDao');
$this->referentielDao = $this->getModele('ReferentielDao');
}
//+----------------------------------------------------------------------------------------------------------------+
37,54 → 41,8
* Fonction d'affichage par défaut, elle appelle la liste des administrateurs
*/
public function executerActionParDefaut() {
return $this->afficherInterface();
return '';
}
/**
* Affiche le formulaire de demande de traitement
*/
public function afficherInterface() {
$donnees = array();
$this->url->unsetVariablesRequete(array('module', 'action', 'ref'));
$donnees['url_form'] = $this->url->getUrl();
$donnees['url_module'] = 'Test';
$donnees['url_action'] = 'demanderTraitement';
// Traitement de l'info sur le code du référentiel
if (isset($this->referentiel)) {
$donnees['ref'] = $this->referentiel;
} else {
$this->messages[] = "Aucun code de projet de référentiel n'est indiqué (Ex. bdnff).";
}
$donnees['messages'] = $this->messages;
$this->setSortie(self::RENDU_CORPS, $this->getVue('form_traitement', $donnees), false);
}
/**
* Lance l'ajout d'un traitement
*/
public function demanderTraitement() {
$this->ajouterTraitement();
//$this->afficherInterface();
}
/**
* Lance l'ajout d'un traitement
*/
private function ajouterTraitement() {
if (!isset($this->referentiel)) {
$this->messages[] = "Aucun code de projet de référentiel n'est indiqué (Ex. bdnff).";
} else {
$resultat = $this->traitementDao->ajouterTraitement($this->referentiel);
Debug::printr($resultat);
if ($resultat != false) {
$this->messages[] = "Le traitement #'' a été ajouté.";
} else {
$this->messages[] = "Un problème est survenu lors de la tentative d'ajout du traitement.";
}
}
}
}
?>
/trunk/services/modules/Resultat.php
File deleted
\ No newline at end of file
/trunk/services/modules/Traitement.php
File deleted
\ No newline at end of file
/trunk/services/modules/Ref.php
130,24 → 130,5
}
return $sortie;
}
protected function traiterParametresPost($params_attendu, $params, $pourBDD = true) {
$sortie = array();
foreach ($params_attendu as $num => $nom) {
if (isset($params[$nom]) && $params[$nom] != '') {
if ($pourBDD) {
$params[$nom] = $this->bdd->quote($params[$nom]);
}
$sortie[$nom] = $params[$nom];
} else {
if ($pourBDD) {
$sortie[$nom] = 'NULL';
} else {
$sortie[$nom] = '';
}
}
}
return $sortie;
}
}
?>
/trunk/doc/bdd/referentiel.sql
11,7 → 11,6
 
CREATE TABLE ref_traitement (
id_traitement INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
referentiel_code VARCHAR(50) NULL ,
nom VARCHAR(100) NULL ,
date_debut DATETIME NULL ,
date_fin DATETIME NULL ,
20,12 → 19,6
 
 
 
 
 
 
 
 
 
CREATE TABLE ref_resultat (
id_resultat INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
ce_traitement INTEGER UNSIGNED NULL ,
/trunk/doc/bdd/referentiel.xml
265,7 → 265,7
<TABLES>
<TABLE ID="27977" Tablename="ref_traitement" PrevTableName="Table_01" XPos="87" YPos="74" TableType="0" TablePrefix="0" nmTable="0" Temporary="0" UseStandardInserts="0" StandardInserts="\n" TableOptions="DelayKeyTblUpdates=0\nPackKeys=0\nRowChecksum=0\nRowFormat=0\nUseRaid=0\nRaidType=0\n" Comments="" Collapsed="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="2" >
<COLUMNS>
<COLUMN ID="27979" ColName="id_traitement" PrevColName="" Pos="0" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="1" NotNull="1" AutoInc="1" IsForeignKey="0" DefaultValue="" Comments="Id auto incr\195\169ment\195\169 de la demande de traitement">
<COLUMN ID="27979" ColName="id_traitement" PrevColName="" Pos="0" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="1" NotNull="1" AutoInc="1" IsForeignKey="0" DefaultValue="" Comments="">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
272,30 → 272,24
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="28015" ColName="referentiel_code" PrevColName="" Pos="5" idDatatype="20" DatatypeParams="(50)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Code du r\195\169f\195\169rentiel \195\160 traiter (ex. BDNFF).">
<COLUMN ID="27984" ColName="nom" PrevColName="" Pos="4" idDatatype="20" DatatypeParams="(100)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="27984" ColName="nom" PrevColName="" Pos="4" idDatatype="20" DatatypeParams="(100)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Nom du traitement">
<COLUMN ID="27982" ColName="date_debut" PrevColName="" Pos="2" idDatatype="15" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="27982" ColName="date_debut" PrevColName="" Pos="2" idDatatype="15" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Date et heure de d\195\169but du lancement du traitement">
<COLUMN ID="27983" ColName="date_fin" PrevColName="" Pos="3" idDatatype="15" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="">
<OPTIONSELECTED>
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="27983" ColName="date_fin" PrevColName="" Pos="3" idDatatype="15" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Date et heure de fin de traitement">
<COLUMN ID="27981" ColName="meta_date_creation" PrevColName="date_creation" Pos="1" idDatatype="15" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="">
<OPTIONSELECTED>
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="27981" ColName="meta_date_creation" PrevColName="date_creation" Pos="1" idDatatype="15" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Date et heure de cr\195\169ation de la demande de traitement.">
<OPTIONSELECTED>
</OPTIONSELECTED>
</COLUMN>
</COLUMNS>
<RELATIONS_START>
<RELATION_START ID="27995" />
/trunk/bibliotheque/dao/TraitementDao.php
File deleted
\ No newline at end of file
/trunk/bibliotheque/dao/Dao.php
22,9 → 22,6
$this->url_jrest = config::get('url_jrest');
}
//+----------------------------------------------------------------------------------------------------------------+
// ACCESSEURS
public function avoirLimitation() {
$limitation = false;
if (!is_null($this->limite_debut) && !is_null($this->limite_nbre)) {
52,37 → 49,4
public function getLimiteNbre() {
return $this->limite_nbre;
}
//+----------------------------------------------------------------------------------------------------------------+
// MÉTHODES
protected function envoyerRequeteAjout($url, Array $donnees) {
$retour = $this->envoyerRequete($url, $donnees, 'PUT');
return $retour;
}
protected function envoyerRequeteModif($url, $donnees) {
$retour = $this->envoyerRequete($url, $donnees, 'POST');
return $retour;
}
protected function envoyerRequeteSuppression($url) {
$retour = $this->envoyerRequete($url, $donnees, 'DELETE');
return $retour;
}
private function envoyerRequete($url, Array $donnees, $mode) {
$retour = false;
if ($mode != 'PUT' && $mode != 'POST' && $mode != 'DELETE') {
$e = "Le mode de requête '$mode' n'est pas accepté!";
trigger_error($e, E_USER_WARNING);
} else {
$contexte = stream_context_create(
array('http' => array(
'method' => $mode,
'header' => "Content-type: application/x-www-form-urlencoded\r\n",
'content' => http_build_query($donnees))));
$retour = file_get_contents($url, false, $contexte);
}
return $retour;
}
}