Skip to content
Snippets Groups Projects
Commit 3c168a0a authored by Sofian pujo's avatar Sofian pujo
Browse files

Dépôt interdit si mauvaise extension

parent 7b40add7
Branches
Tags
No related merge requests found
...@@ -15,3 +15,5 @@ src/vitis/vas/rest/ws/* ...@@ -15,3 +15,5 @@ src/vitis/vas/rest/ws/*
! src/vitis/vas/rest/ws/vitis/ ! src/vitis/vas/rest/ws/vitis/
src/vitis/vas/sql/* src/vitis/vas/sql/*
! src/vitis/vas/sql/sqlQueries.xml ! src/vitis/vas/sql/sqlQueries.xml
utils - Copie/
<?php <?php
require_once __DIR__ . '/ExtractionExtraction.class.inc'; require_once __DIR__ . '/ExtractionExtraction.class.inc';
require_once dirname($_SERVER['SCRIPT_FILENAME']) . '/class/vitis_lib/Connection.class.inc'; require_once __DIR__. '/../../class/vitis_lib/Connection.class.inc';
/** /**
* \file Extraction.class.inc * \file Extraction.class.inc
...@@ -14,7 +14,8 @@ require_once dirname($_SERVER['SCRIPT_FILENAME']) . '/class/vitis_lib/Connection ...@@ -14,7 +14,8 @@ require_once dirname($_SERVER['SCRIPT_FILENAME']) . '/class/vitis_lib/Connection
* This class defines operation for one Extraction * This class defines operation for one Extraction
* *
*/ */
class Extraction extends ExtractionExtraction { class Extraction extends ExtractionExtraction
{
public $oError; public $oError;
...@@ -26,7 +27,8 @@ class Extraction extends ExtractionExtraction { ...@@ -26,7 +27,8 @@ class Extraction extends ExtractionExtraction {
* @param type $bShortcut false to reinit variables * @param type $bShortcut false to reinit variables
* @param type $oConnection connection object * @param type $oConnection connection object
*/ */
function __construct($aPath, $aValues, $properties, $bShortcut = false, $oConnection = false){ public function __construct($aPath, $aValues, $properties, $bShortcut = false, $oConnection = false)
{
parent::__construct($aPath, $aValues, $properties, $bShortcut, $oConnection); parent::__construct($aPath, $aValues, $properties, $bShortcut, $oConnection);
} }
...@@ -70,12 +72,14 @@ class Extraction extends ExtractionExtraction { ...@@ -70,12 +72,14 @@ class Extraction extends ExtractionExtraction {
/** /**
* get informations about mode * get informations about mode
*/ */
function GET() { public function GET()
{
require $this->sRessourcesFile; require $this->sRessourcesFile;
$this->aFields = $this->getFields($this->aProperties['schema_extraction'], "v_extraction", "bo_id"); $this->aFields = $this->getFields($this->aProperties['schema_extraction'], "v_extraction", "bo_id");
// Url vers l'acte d'engagement. // Url vers l'acte d'engagement.
if (!empty($this->aFields['ae'])) if (!empty($this->aFields['ae'])) {
$this->aFields['ae'] = $this->aProperties['web_server_name'] . '/' . $this->aProperties['ws_data_alias'] . '/extraction/extraction_extraction_extraction/documents/' . $this->aValues["my_vitis_id"] . '/ae/' . $this->aFields['ae']; $this->aFields['ae'] = $this->aProperties['web_server_name'] . '/' . $this->aProperties['ws_data_alias'] . '/extraction/extraction_extraction_extraction/documents/' . $this->aValues["my_vitis_id"] . '/ae/' . $this->aFields['ae'];
}
// Date au format Français. // Date au format Français.
if ($this->aProperties["language"] == 'fr') { if ($this->aProperties["language"] == 'fr') {
...@@ -87,7 +91,7 @@ class Extraction extends ExtractionExtraction { ...@@ -87,7 +91,7 @@ class Extraction extends ExtractionExtraction {
if (!empty($this->aFields['id_com'])) { if (!empty($this->aFields['id_com'])) {
//On donne les paramètres à remplacer dans la requête //On donne les paramètres à remplacer dans la requête
$aSQLParams = array( $aSQLParams = array(
'id_com' => array('value' => $this->aFields['id_com'], 'type' => 'group') 'id_com' => array('value' => $this->aFields['id_com'], 'type' => 'group'),
); );
$sSql = $aSql['getCommuneLabel']; $sSql = $aSql['getCommuneLabel'];
...@@ -105,29 +109,33 @@ class Extraction extends ExtractionExtraction { ...@@ -105,29 +109,33 @@ class Extraction extends ExtractionExtraction {
if (!empty($this->aFields['id_conseil'])) { if (!empty($this->aFields['id_conseil'])) {
$aSQLParams = array( $aSQLParams = array(
'id_conseil' => array('value' => $this->aFields['id_conseil'], 'type' => 'group') 'id_conseil' => array('value' => $this->aFields['id_conseil'], 'type' => 'group'),
); );
//$sSql = str_replace('[id_conseil]', str_replace('|', ',', $this->aFields['id_conseil']), $aSql['getConseilLabel']); //$sSql = str_replace('[id_conseil]', str_replace('|', ',', $this->aFields['id_conseil']), $aSql['getConseilLabel']);
$aConseil = [];
$sSql = $aSql['getConseilLabel']; $sSql = $aSql['getConseilLabel'];
$oPDOresult = $this->oConnection->oBd->executeWithParams($sSql, $aSQLParams); $oPDOresult = $this->oConnection->oBd->executeWithParams($sSql, $aSQLParams);
if (!$this->oConnection->oBd->enErreur()) { if (!$this->oConnection->oBd->enErreur()) {
while ($aLine = $this->oConnection->oBd->ligneSuivante($oPDOresult)) { while ($aLine = $this->oConnection->oBd->ligneSuivante($oPDOresult)) {
$aConseil[] = $aLine['nom_epci']; $aConseil[] = $aLine['nom_epci'];
} }
if (is_array($aConseil)) {
$this->aFields['id_conseil_label'] = implode(',', $aConseil); $this->aFields['id_conseil_label'] = implode(',', $aConseil);
} else {
$this->aFields['id_conseil_label'][0] = $aConseil;
}
} }
} }
// Nom de l'état de l'extraction. // Nom de l'état de l'extraction.
error_log(print_r($this->aFields['status'], true));
$this->aFields['status_name'] = $this->aFields['status']; $this->aFields['status_name'] = $this->aFields['status'];
} }
/** /**
* delete a Point_situation * delete a Point_situation
*/ */
function DELETE() { public function DELETE()
{
$this->oConnection->oBd->delete($this->aProperties['schema_extraction'], 'extraction', 'bo_id', $this->aValues["my_vitis_id"], 'integer'); $this->oConnection->oBd->delete($this->aProperties['schema_extraction'], 'extraction', 'bo_id', $this->aValues["my_vitis_id"], 'integer');
if ($this->oConnection->oBd->enErreur()) { if ($this->oConnection->oBd->enErreur()) {
$this->oError = new Error(1, $this->oConnection->oBd->getBDMessage()); $this->oError = new Error(1, $this->oConnection->oBd->getBDMessage());
...@@ -137,5 +145,3 @@ class Extraction extends ExtractionExtraction { ...@@ -137,5 +145,3 @@ class Extraction extends ExtractionExtraction {
} }
} }
?>
\ No newline at end of file
<?php <?php
require_once __DIR__ . "/../../class/vitis_lib/DbClass.class.inc";
require_once dirname($_SERVER['SCRIPT_FILENAME']) . "/class/vitis_lib/DbClass.class.inc"; require_once __DIR__ . '/../vitis/Vitis.class.inc';
require_once dirname($_SERVER['SCRIPT_FILENAME']) . '/ws/vitis/Vitis.class.inc';
require_once 'vmlib/logUtil.inc'; require_once 'vmlib/logUtil.inc';
class ExtractionExtraction extends Vitis { class ExtractionExtraction extends Vitis
{
//Chemin du fichier de ressources contenant les requêtes SQL //Chemin du fichier de ressources contenant les requêtes SQL
var $sRessourcesFile = 'ws/extraction/ExtractionExtraction.class.sql.inc'; public $sRessourcesFile = 'ws/extraction/ExtractionExtraction.class.sql.inc';
/** /**
* Upload un document dans le ws_data du module Extraction. * Upload un document dans le ws_data du module Extraction.
* @param type $sIndex * @param type $sIndex
* @param type $sFolder * @param type $sFolder
*/ */
function uploadDocument($sIndex, $sFolder) { public function uploadDocument($sIndex, $sFolder)
{
// Crée le répertoire si inexistant. // Crée le répertoire si inexistant.
$sDirPath = $this->aProperties['ws_data_dir'] . '/extraction/' . $sFolder . '/documents/' . $this->aValues["my_vitis_id"] . '/' . $sIndex . '/'; $sDirPath = $this->aProperties['ws_data_dir'] . '/extraction/' . $sFolder . '/documents/' . $this->aValues["my_vitis_id"] . '/' . $sIndex . '/';
if (!is_dir($sDirPath)) if (!is_dir($sDirPath)) {
mkdir($sDirPath, 0777, true); mkdir($sDirPath, 0777, true);
}
// Ecrit le fichier. // Ecrit le fichier.
if (!empty($_FILES[$sIndex])) { if (!empty($_FILES[$sIndex])) {
$sErrorMessage = uploadFile($sIndex, "", $sDirPath . $_FILES[$sIndex]["name"], $_FILES[$sIndex]['size'] + 1); $sErrorMessage = uploadFile($sIndex, "", $sDirPath . $_FILES[$sIndex]["name"], $_FILES[$sIndex]['size'] + 1);
if ($sErrorMessage != "") if ($sErrorMessage != "") {
writeToErrorLog($sErrorMessage); writeToErrorLog($sErrorMessage);
} }
else {
} else {
$sfileContentIndex = $sIndex . '_file'; $sfileContentIndex = $sIndex . '_file';
$sfileNameIndex = $sIndex . '_name'; $sfileNameIndex = $sIndex . '_name';
if (!empty($this->aValues[$sfileContentIndex])) { if (!empty($this->aValues[$sfileContentIndex])) {
...@@ -38,4 +42,3 @@ class ExtractionExtraction extends Vitis { ...@@ -38,4 +42,3 @@ class ExtractionExtraction extends Vitis {
} }
} }
} }
?>
\ No newline at end of file
...@@ -13,11 +13,11 @@ ...@@ -13,11 +13,11 @@
*/ */
require_once __DIR__ . '/ExtractionExtraction.class.inc'; require_once __DIR__ . '/ExtractionExtraction.class.inc';
require_once 'Extraction_depot.class.inc'; require_once 'Extraction_depot.class.inc';
require_once(__DIR__ . '/../../class/wab_lib/BusinessObject.class.inc'); require_once __DIR__ . '/../../class/wab_lib/BusinessObject.class.inc';
require_once __DIR__ . '/Extractions.class.inc'; require_once __DIR__ . '/Extractions.class.inc';
class Extraction_depots extends ExtractionExtraction
class Extraction_depots extends ExtractionExtraction { {
/** /**
* @SWG\Definition( * @SWG\Definition(
* definition="/extraction_depots", * definition="/extraction_depots",
...@@ -39,11 +39,11 @@ class Extraction_depots extends ExtractionExtraction { ...@@ -39,11 +39,11 @@ class Extraction_depots extends ExtractionExtraction {
* @param type $bShortcut false to reinit variables * @param type $bShortcut false to reinit variables
* @param type $oConnection connection object * @param type $oConnection connection object
*/ */
function __construct($aPath, $aValues, $properties, $bShortcut = false, $oConnection = false){ public function __construct($aPath, $aValues, $properties, $bShortcut = false, $oConnection = false)
{
parent::__construct($aPath, $aValues, $properties, $bShortcut, $oConnection); parent::__construct($aPath, $aValues, $properties, $bShortcut, $oConnection);
} }
/** /**
* @SWG\Get(path="/extraction_depots", * @SWG\Get(path="/extraction_depots",
* tags={"Extraction_depots"}, * tags={"Extraction_depots"},
...@@ -121,50 +121,39 @@ class Extraction_depots extends ExtractionExtraction { ...@@ -121,50 +121,39 @@ class Extraction_depots extends ExtractionExtraction {
* get Extraction_depots * get Extraction_depots
* @return Extraction_depots * @return Extraction_depots
*/ */
function GET() { public function GET()
if (!empty($this->aPath[2]))
{
if ($this->aPath[2] == "Tree")
{ {
if (!empty($this->aPath[2])) {
if ($this->aPath[2] == "Tree") {
$sDirPath = $this->aProperties['ws_data_dir'] . '/extraction/extraction_depot'; $sDirPath = $this->aProperties['ws_data_dir'] . '/extraction/extraction_depot';
//Création du dossier extraction_depot //Création du dossier extraction_depot
if (!is_dir($sDirPath)) if (!is_dir($sDirPath)) {
{
//Création du dossier du demandeur //Création du dossier du demandeur
if (!mkdir($sDirPath)) if (!mkdir($sDirPath)) {
{
//Mettre une erreur dans le log d'erreur //Mettre une erreur dans le log d'erreur
} }
} }
$sDirPath = $this->aProperties['ws_data_dir'] . '/extraction/extraction_depot/' . $_SERVER["REMOTE_ADDR"]; $sDirPath = $this->aProperties['ws_data_dir'] . '/extraction/extraction_depot/' . $_SERVER["REMOTE_ADDR"];
if (!is_dir($sDirPath)) if (!is_dir($sDirPath)) {
{ if (!mkdir($sDirPath)) {
if (!mkdir($sDirPath))
{
//Mettre une erreur dans le log d'erreur //Mettre une erreur dans le log d'erreur
} }
} }
$sDirPath = $this->aProperties['ws_data_dir'] . '/extraction/extraction_depot/' . $_SERVER["REMOTE_ADDR"] . "/Fichiers déposés"; $sDirPath = $this->aProperties['ws_data_dir'] . '/extraction/extraction_depot/' . $_SERVER["REMOTE_ADDR"] . "/Fichiers déposés";
if (!is_dir($sDirPath)) if (!is_dir($sDirPath)) {
{ if (!mkdir($sDirPath)) {
if (!mkdir($sDirPath))
{
//Mettre une erreur dans le log d'erreur //Mettre une erreur dans le log d'erreur
} }
} }
$sDirPath = $this->aProperties['ws_data_dir'] . '/extraction/extraction_depot/' . $_SERVER["REMOTE_ADDR"] . "/Résultats"; $sDirPath = $this->aProperties['ws_data_dir'] . '/extraction/extraction_depot/' . $_SERVER["REMOTE_ADDR"] . "/Résultats";
if (!is_dir($sDirPath)) if (!is_dir($sDirPath)) {
{ if (!mkdir($sDirPath)) {
if (!mkdir($sDirPath))
{
//Mettre une erreur dans le log d'erreur //Mettre une erreur dans le log d'erreur
} }
} }
$sDirPath = $this->aProperties['ws_data_dir'] . '/extraction/extraction_depot/' . $_SERVER["REMOTE_ADDR"]; $sDirPath = $this->aProperties['ws_data_dir'] . '/extraction/extraction_depot/' . $_SERVER["REMOTE_ADDR"];
return json_encode($this->getFolderInfos($sDirPath)); return json_encode($this->getFolderInfos($sDirPath));
} } elseif ($this->aPath[2] == "File") {
elseif ($this->aPath[2] == "File")
{
$this->getWorkspaceFile(); $this->getWorkspaceFile();
} }
} }
...@@ -173,7 +162,8 @@ class Extraction_depots extends ExtractionExtraction { ...@@ -173,7 +162,8 @@ class Extraction_depots extends ExtractionExtraction {
/** /**
* Get file. * Get file.
*/ */
function getWorkspaceFile() { public function getWorkspaceFile()
{
$aReturn = array('status' => 1, 'message' => ''); $aReturn = array('status' => 1, 'message' => '');
$sFilePath = $this->aProperties['ws_data_dir'] . '/extraction/extraction_depot/' . $_SERVER["REMOTE_ADDR"] . "/" . $this->aValues['file_name']; $sFilePath = $this->aProperties['ws_data_dir'] . '/extraction/extraction_depot/' . $_SERVER["REMOTE_ADDR"] . "/" . $this->aValues['file_name'];
// Le fichier existe ? // Le fichier existe ?
...@@ -191,7 +181,8 @@ class Extraction_depots extends ExtractionExtraction { ...@@ -191,7 +181,8 @@ class Extraction_depots extends ExtractionExtraction {
* @param string $sDirectoryPath * @param string $sDirectoryPath
* @return array $aTree * @return array $aTree
*/ */
function getFolderInfos($sDirectoryPath){ public function getFolderInfos($sDirectoryPath)
{
if (is_dir($sDirectoryPath)) { if (is_dir($sDirectoryPath)) {
$aContentDir = scandir($sDirectoryPath); $aContentDir = scandir($sDirectoryPath);
...@@ -216,7 +207,8 @@ class Extraction_depots extends ExtractionExtraction { ...@@ -216,7 +207,8 @@ class Extraction_depots extends ExtractionExtraction {
* @param string $sFilePath * @param string $sFilePath
* @return array * @return array
*/ */
function getFileInfos ($sFilePath){ public function getFileInfos($sFilePath)
{
$iFileSize = filesize($sFilePath); $iFileSize = filesize($sFilePath);
$sFileSize = $iFileSize . "octets"; $sFileSize = $iFileSize . "octets";
...@@ -299,14 +291,14 @@ class Extraction_depots extends ExtractionExtraction { ...@@ -299,14 +291,14 @@ class Extraction_depots extends ExtractionExtraction {
* delete [Class_name]s * delete [Class_name]s
* @return id of [Class_name]s deleted or error object if a [Class_name]s is not deleted * @return id of [Class_name]s deleted or error object if a [Class_name]s is not deleted
*/ */
function DELETES() { public function DELETES()
{
$sDirPath = $this->aProperties['ws_data_dir'] . '/extraction/extraction_depot/' . $_SERVER["REMOTE_ADDR"]; $sDirPath = $this->aProperties['ws_data_dir'] . '/extraction/extraction_depot/' . $_SERVER["REMOTE_ADDR"];
//On supprime le fichier //On supprime le fichier
$sMessage = unlink($sDirPath . "/" . $this->aValues['file_name']); $sMessage = unlink($sDirPath . "/" . $this->aValues['file_name']);
return $sMessage; return $sMessage;
} }
/** /**
* @SWG\Put(path="/[Class_name]s/{id_[Class_name]}", * @SWG\Put(path="/[Class_name]s/{id_[Class_name]}",
* tags={"[Class_name_upper]s"}, * tags={"[Class_name_upper]s"},
...@@ -341,12 +333,13 @@ class Extraction_depots extends ExtractionExtraction { ...@@ -341,12 +333,13 @@ class Extraction_depots extends ExtractionExtraction {
* update [Class_name]s * update [Class_name]s
* @return id of [Class_name]s updated or error object if a [Class_name]s is not updated * @return id of [Class_name]s updated or error object if a [Class_name]s is not updated
*/ */
function PUT() { public function PUT()
{
if (!empty($this->aValues["action"]) && $this->aValues["action"] == "Metadata") { if (!empty($this->aValues["action"]) && $this->aValues["action"] == "Metadata") {
$aReturn = $this->reintegrateMetadata(); $aReturn = $this->reintegrateMetadata();
$aXmlRacineAttribute['status'] = $aReturn['status']; $aXmlRacineAttribute['status'] = $aReturn['status'];
$sMessage = $this->asDocument('', 'vitis', $this->aValues['sEncoding'], True, $aXmlRacineAttribute, $this->aValues['sSourceEncoding'], $this->aValues['output']); $sMessage = $this->asDocument('', 'vitis', $this->aValues['sEncoding'], true, $aXmlRacineAttribute, $this->aValues['sSourceEncoding'], $this->aValues['output']);
} else { } else {
$sDirName = $this->aProperties['ws_data_dir'] . '/extraction/extraction_depot/' . $_SERVER["REMOTE_ADDR"]; $sDirName = $this->aProperties['ws_data_dir'] . '/extraction/extraction_depot/' . $_SERVER["REMOTE_ADDR"];
$error_message = ""; $error_message = "";
...@@ -359,7 +352,7 @@ class Extraction_depots extends ExtractionExtraction { ...@@ -359,7 +352,7 @@ class Extraction_depots extends ExtractionExtraction {
$aXmlRacineAttribute['status'] = 0; $aXmlRacineAttribute['status'] = 0;
$this->aFields = array(); $this->aFields = array();
$this->aFields['errorMessage'] = $error_message; $this->aFields['errorMessage'] = $error_message;
$sMessage = $this->asDocument('', 'vitis', $this->aValues['sEncoding'], True, $aXmlRacineAttribute, $this->aValues['sSourceEncoding'], $this->aValues['output']); $sMessage = $this->asDocument('', 'vitis', $this->aValues['sEncoding'], true, $aXmlRacineAttribute, $this->aValues['sSourceEncoding'], $this->aValues['output']);
return $sMessage; return $sMessage;
} }
// Si le dossier {id}/Fichiers déposés n'existe pas (Important pour gérer les erreurs) // Si le dossier {id}/Fichiers déposés n'existe pas (Important pour gérer les erreurs)
...@@ -370,7 +363,7 @@ class Extraction_depots extends ExtractionExtraction { ...@@ -370,7 +363,7 @@ class Extraction_depots extends ExtractionExtraction {
$aXmlRacineAttribute['status'] = 0; $aXmlRacineAttribute['status'] = 0;
$this->aFields = array(); $this->aFields = array();
$this->aFields['errorMessage'] = $error_message; $this->aFields['errorMessage'] = $error_message;
$sMessage = $this->asDocument('', 'vitis', $this->aValues['sEncoding'], True, $aXmlRacineAttribute, $this->aValues['sSourceEncoding'], $this->aValues['output']); $sMessage = $this->asDocument('', 'vitis', $this->aValues['sEncoding'], true, $aXmlRacineAttribute, $this->aValues['sSourceEncoding'], $this->aValues['output']);
return $sMessage; return $sMessage;
} }
...@@ -386,14 +379,12 @@ class Extraction_depots extends ExtractionExtraction { ...@@ -386,14 +379,12 @@ class Extraction_depots extends ExtractionExtraction {
if (!empty($this->aValues["control_file_file"])) { if (!empty($this->aValues["control_file_file"])) {
//if ($aReturn['sStatus'] == 1) { //if ($aReturn['sStatus'] == 1) {
$aXmlRacineAttribute['status'] = 1; $aXmlRacineAttribute['status'] = 1;
$sMessage = $this->asDocument('', 'vitis', $this->aValues['sEncoding'], True, $aXmlRacineAttribute, $this->aValues['sSourceEncoding'], $this->aValues['output']); $sMessage = $this->asDocument('', 'vitis', $this->aValues['sEncoding'], true, $aXmlRacineAttribute, $this->aValues['sSourceEncoding'], $this->aValues['output']);
$sDirPath = $this->aProperties["upload_dir"] . "/" . getUniqRandomId(); $sDirPath = $this->aProperties["upload_dir"] . "/" . getUniqRandomId();
while (is_dir($sDirPath)) while (is_dir($sDirPath)) {
{
$sDirPath = $this->aProperties["upload_dir"] . "/" . getUniqRandomId(); $sDirPath = $this->aProperties["upload_dir"] . "/" . getUniqRandomId();
} }
if (!mkdir($sDirPath)) if (!mkdir($sDirPath)) {
{
return false; return false;
} }
// Sauvegarde le nouveau fichier. // Sauvegarde le nouveau fichier.
...@@ -401,27 +392,25 @@ class Extraction_depots extends ExtractionExtraction { ...@@ -401,27 +392,25 @@ class Extraction_depots extends ExtractionExtraction {
fwrite($fp, $this->aValues["control_file_file"]); fwrite($fp, $this->aValues["control_file_file"]);
fclose($fp); fclose($fp);
//error_log($sDirPath.'/'.$this->aValues["control_file_name"]); $sExtension = '*.' . end(explode(".", $this->aValues["control_file_name"]));
if (in_array($sExtension, explode("|", $this->aProperties['sig'])) or in_array($sExtension, explode("|", $this->aProperties['dao']))) {
$this->oBO = new WabBusinessObject($this->oConnection->oBd, array(), $this->aValues, $this->aProperties, 'extraction', $this->aValues['bo_id']); $this->oBO = new WabBusinessObject($this->oConnection->oBd, array(), $this->aValues, $this->aProperties, 'extraction', $this->aValues['bo_id']);
$this->oBO->insertOrder('EM0160AYYTK48', 'sourceDir='.end(explode("/", $sDirPath)).'/'.$this->aValues["control_file_name"].'|sourceMotif=*.shp'); $this->oBO->insertOrder('EM0160AYYTK48', 'sourceDir=' . end(explode("/", $sDirPath)) . '/' . $this->aValues["control_file_name"] . '|sourceMotif='.$sExtension);
//$this->Extractions = new Extractions(__DIR__, $this->aValues, $this->aProperties); } else {
//Si l'extension n'est pas bonne
$error_message .= $this->aValues["control_file_name"] . " format is not authaurized (". $sExtension . ")";
writeToErrorLog("WARNING: " . $error_message);
//$fp = fopen($sDirName . "/Fichiers déposés/" . utf8_decode($this->aValues["control_file_name"]), "w"); $aXmlRacineAttribute['status'] = 0;
//fwrite($fp, $this->aValues["control_file_file"]); $this->aFields = array();
//fclose($fp); $this->aFields['errorMessage'] = $error_message;
//error_log(print_r($this->oBO,true)); $sMessage = $this->asDocument('', 'vitis', $this->aValues['sEncoding'], true, $aXmlRacineAttribute, $this->aValues['sSourceEncoding'], $this->aValues['output']);
//$this->oBO = new WabBusinessObject($this->oConnection->oBd, array(), $this->aValues, $this->aProperties, 'extraction', $this->aValues['bo_id']); return $sMessage;
//$this->oBO->insertOrder('EM0160AYYTK48', 'bo_id='.$this->aValues['bo_id']); }
} }
} }
return $sMessage; return $sMessage;
} }
} }
?>
\ No newline at end of file
...@@ -13,9 +13,11 @@ ...@@ -13,9 +13,11 @@
*/ */
require_once __DIR__ . '/ExtractionExtraction.class.inc'; require_once __DIR__ . '/ExtractionExtraction.class.inc';
require_once 'Extraction.class.inc'; require_once 'Extraction.class.inc';
require_once(dirname($_SERVER['SCRIPT_FILENAME']) . '/class/wab_lib/BusinessObject.class.inc');
class Extractions extends ExtractionExtraction { require_once __DIR__ . '/../../class/wab_lib/BusinessObject.class.inc';
class Extractions extends ExtractionExtraction
{
protected $iIdExtraction; protected $iIdExtraction;
/** /**
...@@ -39,7 +41,8 @@ class Extractions extends ExtractionExtraction { ...@@ -39,7 +41,8 @@ class Extractions extends ExtractionExtraction {
* @param type $bShortcut false to reinit variables * @param type $bShortcut false to reinit variables
* @param type $oConnection connection object * @param type $oConnection connection object
*/ */
function __construct($aPath, $aValues, $properties, $bShortcut = false, $oConnection = false){ public function __construct($aPath, $aValues, $properties, $bShortcut = false, $oConnection = false)
{
parent::__construct($aPath, $aValues, $properties, $bShortcut, $oConnection); parent::__construct($aPath, $aValues, $properties, $bShortcut, $oConnection);
} }
...@@ -141,10 +144,11 @@ class Extractions extends ExtractionExtraction { ...@@ -141,10 +144,11 @@ class Extractions extends ExtractionExtraction {
* get Extractions * get Extractions
* @return Extractions * @return Extractions
*/ */
function GET() { public function GET()
if (!empty($this->aPath[2]) && $this->aPath[2] == "Layers") {
if (!empty($this->aPath[2]) && $this->aPath[2] == "Layers") {
$sMessage = $this->getLayers(); $sMessage = $this->getLayers();
else { } else {
$aReturn = $this->genericGet($this->aProperties['schema_extraction'], "v_extraction", "bo_id"); $aReturn = $this->genericGet($this->aProperties['schema_extraction'], "v_extraction", "bo_id");
$sMessage = $aReturn['sMessage']; $sMessage = $aReturn['sMessage'];
} }
...@@ -177,7 +181,8 @@ class Extractions extends ExtractionExtraction { ...@@ -177,7 +181,8 @@ class Extractions extends ExtractionExtraction {
* insert extraction * insert extraction
* @return id of the extraction created * @return id of the extraction created
*/ */
function POST() { public function POST()
{
$aReturn = $this->genericPost($this->aProperties['schema_extraction'], 'extraction', $this->aProperties['schema_extraction'] . '.bo_id_extraction_seq', 'bo_id'); $aReturn = $this->genericPost($this->aProperties['schema_extraction'], 'extraction', $this->aProperties['schema_extraction'] . '.bo_id_extraction_seq', 'bo_id');
$this->aValues["bo_id"] = $this->aValues['my_vitis_id']; $this->aValues["bo_id"] = $this->aValues['my_vitis_id'];
eval('$this->' . $this->aValues['tr_status_method'] . '();'); eval('$this->' . $this->aValues['tr_status_method'] . '();');
...@@ -218,29 +223,28 @@ class Extractions extends ExtractionExtraction { ...@@ -218,29 +223,28 @@ class Extractions extends ExtractionExtraction {
* update extractions * update extractions
* @return id of extractions updated or error object if a extractions is not updated * @return id of extractions updated or error object if a extractions is not updated
*/ */
function PUT() { public function PUT()
{
// Upload l'acte d'engagement. // Upload l'acte d'engagement.
$this->uploadDocument('ae', 'extraction_extraction_extraction'); $this->uploadDocument('ae', 'extraction_extraction_extraction');
// //
$aReturn = $this->genericPut($this->aProperties['schema_extraction'], 'extraction', 'bo_id'); $aReturn = $this->genericPut($this->aProperties['schema_extraction'], 'extraction', 'bo_id');
$this->aValues["bo_id"] = $this->aValues['my_vitis_id']; $this->aValues["bo_id"] = $this->aValues['my_vitis_id'];
// Méthode de transition. // Méthode de transition.
if (!empty($this->aValues['tr_status_method'])) if (!empty($this->aValues['tr_status_method'])) {
eval('$this->' . $this->aValues['tr_status_method'] . '();'); eval('$this->' . $this->aValues['tr_status_method'] . '();');
}
//On vérifie que le fichier existe et ne soit pas vide //On vérifie que le fichier existe et ne soit pas vide
if (!empty($this->aValues['input_deposit_file'])) if (!empty($this->aValues['input_deposit_file'])) {
{
//On va déplacer le fichier dans un dossier temporaire //On va déplacer le fichier dans un dossier temporaire
$aXmlRacineAttribute['status'] = 1; $aXmlRacineAttribute['status'] = 1;
$sMessage = $this->asDocument('', 'vitis', $this->aValues['sEncoding'], True, $aXmlRacineAttribute, $this->aValues['sSourceEncoding'], $this->aValues['output']); $sMessage = $this->asDocument('', 'vitis', $this->aValues['sEncoding'], true, $aXmlRacineAttribute, $this->aValues['sSourceEncoding'], $this->aValues['output']);
$sDirPath = $this->aProperties["upload_dir"] . "/" . getUniqRandomId(); $sDirPath = $this->aProperties["upload_dir"] . "/" . getUniqRandomId();
while (is_dir($sDirPath)) while (is_dir($sDirPath)) {
{
$sDirPath = $this->aProperties["upload_dir"] . "/" . getUniqRandomId(); $sDirPath = $this->aProperties["upload_dir"] . "/" . getUniqRandomId();
} }
if (!mkdir($sDirPath)) if (!mkdir($sDirPath)) {
{
return false; return false;
} }
// Sauvegarde le nouveau fichier. // Sauvegarde le nouveau fichier.
...@@ -315,7 +319,8 @@ class Extractions extends ExtractionExtraction { ...@@ -315,7 +319,8 @@ class Extractions extends ExtractionExtraction {
* delete extractions * delete extractions
* @return id of extractions deleted or error object if a extractions is not deleted * @return id of extractions deleted or error object if a extractions is not deleted
*/ */
function DELETE() { public function DELETE()
{
$aReturn = $this->genericDelete($this->aProperties['schema_extraction'], 'extraction', 'bo_id'); $aReturn = $this->genericDelete($this->aProperties['schema_extraction'], 'extraction', 'bo_id');
return $aReturn['sMessage']; return $aReturn['sMessage'];
} }
...@@ -323,11 +328,11 @@ class Extractions extends ExtractionExtraction { ...@@ -323,11 +328,11 @@ class Extractions extends ExtractionExtraction {
/** /**
* Liste des couches. * Liste des couches.
*/ */
function getLayers() { public function getLayers()
{
require $this->sRessourcesFile; require $this->sRessourcesFile;
//On décode le json récupéré via le filtre //On décode le json récupéré via le filtre
if (!empty($this->aValues["filter"])) if (!empty($this->aValues["filter"])) {
{
$decode = $this->decodeJSONFilter($this->aValues["filter"], $this->aProperties['schema_extraction'], $this->aValues["table"]); $decode = $this->decodeJSONFilter($this->aValues["filter"], $this->aProperties['schema_extraction'], $this->aValues["table"]);
} }
...@@ -335,17 +340,18 @@ class Extractions extends ExtractionExtraction { ...@@ -335,17 +340,18 @@ class Extractions extends ExtractionExtraction {
$sJSONFilter = json_encode($this->aValues); $sJSONFilter = json_encode($this->aValues);
} }
if (!empty($sJSONFilter)) if (!empty($sJSONFilter)) {
{
$aJSONFilter = json_decode($sJSONFilter, true); $aJSONFilter = json_decode($sJSONFilter, true);
}
if (!empty($aJSONFilter["filter"])) {
if (is_object($aJSONFilter["filter"]) || is_array($aJSONFilter["filter"])) { if (is_object($aJSONFilter["filter"]) || is_array($aJSONFilter["filter"])) {
$sJSONFilter = json_encode($aJSONFilter["filter"]); $sJSONFilter = json_encode($aJSONFilter["filter"]);
} }
}
}
$aSQLParams = array( $aSQLParams = array(
'schema_framework' => array('value' => $this->aProperties['schema_framework'], 'type' => 'schema_name'), 'schema_framework' => array('value' => $this->aProperties['schema_framework'], 'type' => 'schema_name'),
'user_id' => array('value' => $_SESSION['ses_user_id'], 'type' => 'string') 'user_id' => array('value' => $_SESSION['ses_user_id'], 'type' => 'string'),
); );
$sSql = $aSql['getUserGroups']; $sSql = $aSql['getUserGroups'];
...@@ -356,8 +362,7 @@ class Extractions extends ExtractionExtraction { ...@@ -356,8 +362,7 @@ class Extractions extends ExtractionExtraction {
$aUserGroups[] = $aUserGroup['name']; $aUserGroups[] = $aUserGroup['name'];
} }
if ($this->aValues["filter"]) if (!empty($aValues["filter"])) {
{
$aSQLParams = array( $aSQLParams = array(
'schema_extraction' => array('value' => $this->aProperties['schema_extraction'], 'type' => 'schema_name'), 'schema_extraction' => array('value' => $this->aProperties['schema_extraction'], 'type' => 'schema_name'),
); );
...@@ -377,29 +382,26 @@ class Extractions extends ExtractionExtraction { ...@@ -377,29 +382,26 @@ class Extractions extends ExtractionExtraction {
$aCtResult = $this->oConnection->oBd->getResultTableAssoc($oPDOresult); $aCtResult = $this->oConnection->oBd->getResultTableAssoc($oPDOresult);
} }
// Restriction de l'utilisateur suivant ses groupes. // Restriction de l'utilisateur suivant ses groupes.
if (in_array('interne', $aUserGroups)) if (in_array('interne', $aUserGroups)) {
$sSqlParams = " ORDER BY category, layer_id;"; $sSqlParams = " ORDER BY category, layer_id;";
else if (in_array('restreint', $aUserGroups)) } else if (in_array('restreint', $aUserGroups)) {
$sSqlParams = " AND restriction <> 'interne' ORDER BY category, layer_id;"; $sSqlParams = " AND restriction <> 'interne' ORDER BY category, layer_id;";
else } else {
$sSqlParams = " AND restriction = 'public' ORDER BY category, layer_id;"; $sSqlParams = " AND restriction = 'public' ORDER BY category, layer_id;";
}
// Liste des cartes. // Liste des cartes.
$this->aFields['treeview_layers'] = array(); $this->aFields['treeview_layers'] = array();
//Requête pour récupérer les couches //Requête pour récupérer les couches
if ($this->aValues["filter"]) if (!empty($aValues["filter"])) {
{
$sSql = $aSql['getRtLayerWithCtId'] . $sSqlParams; $sSql = $aSql['getRtLayerWithCtId'] . $sSqlParams;
} } else {
else
{
$sSql = $aSql['getRtLayer'] . $sSqlParams; $sSql = $aSql['getRtLayer'] . $sSqlParams;
} }
//$ct_id = []; $ct_id;
if ($aCtResult) if (!empty($aCtResult)) {
{ for ($i = 0; $i < sizeof($aCtResult); $i++) {
for ($i = 0; $i < sizeof($aCtResult); $i++)
{
$ct_id .= $aCtResult[$i]["ct_id"] . "|"; $ct_id .= $aCtResult[$i]["ct_id"] . "|";
} }
//On retire la dernière pipe qui ne sert à rien //On retire la dernière pipe qui ne sert à rien
...@@ -411,15 +413,14 @@ class Extractions extends ExtractionExtraction { ...@@ -411,15 +413,14 @@ class Extractions extends ExtractionExtraction {
//error_log(print_r($aCtResult[$i]["ct_id"], true)); //error_log(print_r($aCtResult[$i]["ct_id"], true));
$aSQLParams = array( $aSQLParams = array(
'schema_extraction' => array('value' => $this->aProperties['schema_extraction'], 'type' => 'schema_name'), 'schema_extraction' => array('value' => $this->aProperties['schema_extraction'], 'type' => 'schema_name'),
'aCtId' => array('value' => $ct_idToSend, 'type' => 'group') 'aCtId' => array('value' => $ct_idToSend, 'type' => 'group'),
); );
$oPDOresult = $this->oConnection->oBd->executeWithParams($sSql, $aSQLParams); $oPDOresult = $this->oConnection->oBd->executeWithParams($sSql, $aSQLParams);
if (!$this->oConnection->oBd->enErreur()) { if (!$this->oConnection->oBd->enErreur()) {
$aRtLayer = $this->oConnection->oBd->getResultTableAssoc($oPDOresult); $aRtLayer = $this->oConnection->oBd->getResultTableAssoc($oPDOresult);
$aLayers = array(); $aLayers = array();
if (!empty($aRtLayer)) { if (!empty($aRtLayer)) {
foreach ($aRtLayer as $aLayer) foreach ($aRtLayer as $aLayer) {
{
$aLayers[$aLayer['category']][] = array("text" => $aLayer['layer'], "value" => $aLayer['layer_id'], "mutualized" => $aLayer['mutualized'], "statistique" => $aLayer['statistique']); $aLayers[$aLayer['category']][] = array("text" => $aLayer['layer'], "value" => $aLayer['layer_id'], "mutualized" => $aLayer['mutualized'], "statistique" => $aLayer['statistique']);
...@@ -427,26 +428,26 @@ class Extractions extends ExtractionExtraction { ...@@ -427,26 +428,26 @@ class Extractions extends ExtractionExtraction {
} }
$this->aFields['layers'] = $aLayers; $this->aFields['layers'] = $aLayers;
$aXmlRacineAttribute['status'] = 1; $aXmlRacineAttribute['status'] = 1;
$sMessage = $this->asDocument('', 'vitis', $this->aValues['sEncoding'], True, $aXmlRacineAttribute, $this->aValues['sSourceEncoding'], $this->aValues['output']); $sMessage = $this->asDocument('', 'vitis', $this->aValues['sEncoding'], true, $aXmlRacineAttribute, $this->aValues['sSourceEncoding'], $this->aValues['output']);
} else { } else {
$aXmlRacineAttribute['status'] = 0; $aXmlRacineAttribute['status'] = 0;
$this->aFields['error'] = "Request error."; $this->aFields['error'] = "Request error.";
$sMessage = $this->asDocument('', 'vitis', $this->aValues['sEncoding'], True, $aXmlRacineAttribute, $this->aValues['sSourceEncoding'], $this->aValues['output']); $sMessage = $this->asDocument('', 'vitis', $this->aValues['sEncoding'], true, $aXmlRacineAttribute, $this->aValues['sSourceEncoding'], $this->aValues['output']);
} }
} else { } else {
$aXmlRacineAttribute['status'] = 0; $aXmlRacineAttribute['status'] = 0;
$this->aFields['error'] = "Request error."; $this->aFields['error'] = "Request error.";
$sMessage = $this->asDocument('', 'vitis', $this->aValues['sEncoding'], True, $aXmlRacineAttribute, $this->aValues['sSourceEncoding'], $this->aValues['output']); $sMessage = $this->asDocument('', 'vitis', $this->aValues['sEncoding'], true, $aXmlRacineAttribute, $this->aValues['sSourceEncoding'], $this->aValues['output']);
} }
//error_log(print_r($sMessage, true)); //error_log(print_r($sMessage, true));
return $sMessage; return $sMessage;
} }
/** /**
* Transition Method trNouveau * Transition Method trNouveau
*/ */
function trNouveau() { public function trNouveau()
{
$this->oBO = new WabBusinessObject($this->oConnection->oBd, array(), $this->aValues, $this->aProperties, 'extraction', $this->aValues['bo_id']); $this->oBO = new WabBusinessObject($this->oConnection->oBd, array(), $this->aValues, $this->aProperties, 'extraction', $this->aValues['bo_id']);
// Check si la table existe si oui change l'état // Check si la table existe si oui change l'état
...@@ -457,9 +458,9 @@ class Extractions extends ExtractionExtraction { ...@@ -457,9 +458,9 @@ class Extractions extends ExtractionExtraction {
/** /**
* Transition Method trGenerer * Transition Method trGenerer
*/ */
function trGenerer() { public function trGenerer()
{
$this->oBO = new WabBusinessObject($this->oConnection->oBd, array(), $this->aValues, $this->aProperties, 'extraction', $this->aValues['bo_id']); $this->oBO = new WabBusinessObject($this->oConnection->oBd, array(), $this->aValues, $this->aProperties, 'extraction', $this->aValues['bo_id']);
// Check si la table existe si oui change l'état // Check si la table existe si oui change l'état
$this->oBO->wabSetStatus($this->aProperties["schema_extraction"], "extraction", "bo_id", $this->aValues["bo_id"], "AE Généré"); $this->oBO->wabSetStatus($this->aProperties["schema_extraction"], "extraction", "bo_id", $this->aValues["bo_id"], "AE Généré");
...@@ -468,7 +469,8 @@ class Extractions extends ExtractionExtraction { ...@@ -468,7 +469,8 @@ class Extractions extends ExtractionExtraction {
/** /**
* Transition Method trResoumettre * Transition Method trResoumettre
*/ */
function trResoumettre() { public function trResoumettre()
{
$this->oBO = new WabBusinessObject($this->oConnection->oBd, array(), $this->aValues, $this->aProperties, 'extraction', $this->aValues['bo_id']); $this->oBO = new WabBusinessObject($this->oConnection->oBd, array(), $this->aValues, $this->aProperties, 'extraction', $this->aValues['bo_id']);
// Check si la table existe si oui change l'état // Check si la table existe si oui change l'état
...@@ -480,7 +482,8 @@ class Extractions extends ExtractionExtraction { ...@@ -480,7 +482,8 @@ class Extractions extends ExtractionExtraction {
/** /**
* Transition Method trSoumettre * Transition Method trSoumettre
*/ */
function trSoumettre() { public function trSoumettre()
{
$this->oBO = new WabBusinessObject($this->oConnection->oBd, array(), $this->aValues, $this->aProperties, 'extraction', $this->aValues['bo_id']); $this->oBO = new WabBusinessObject($this->oConnection->oBd, array(), $this->aValues, $this->aProperties, 'extraction', $this->aValues['bo_id']);
// Check si la table existe si oui change l'état // Check si la table existe si oui change l'état
...@@ -492,7 +495,8 @@ class Extractions extends ExtractionExtraction { ...@@ -492,7 +495,8 @@ class Extractions extends ExtractionExtraction {
/** /**
* Transition Method trDemander * Transition Method trDemander
*/ */
function trDemander() { public function trDemander()
{
$this->oBO = new WabBusinessObject($this->oConnection->oBd, array(), $this->aValues, $this->aProperties, 'extraction', $this->aValues['bo_id']); $this->oBO = new WabBusinessObject($this->oConnection->oBd, array(), $this->aValues, $this->aProperties, 'extraction', $this->aValues['bo_id']);
$this->oBO->insertOrder('832HZ8J2PTCSG', 'bo_id=' . $this->aValues['bo_id']); $this->oBO->insertOrder('832HZ8J2PTCSG', 'bo_id=' . $this->aValues['bo_id']);
// Check si la table existe si oui change l'état // Check si la table existe si oui change l'état
...@@ -503,7 +507,8 @@ class Extractions extends ExtractionExtraction { ...@@ -503,7 +507,8 @@ class Extractions extends ExtractionExtraction {
/** /**
* Transition Method trReception * Transition Method trReception
*/ */
function trReception() { public function trReception()
{
$this->oBO = new WabBusinessObject($this->oConnection->oBd, array(), $this->aValues, $this->aProperties, 'extraction', $this->aValues['bo_id']); $this->oBO = new WabBusinessObject($this->oConnection->oBd, array(), $this->aValues, $this->aProperties, 'extraction', $this->aValues['bo_id']);
// Check si la table existe si oui change l'état // Check si la table existe si oui change l'état
...@@ -514,7 +519,8 @@ class Extractions extends ExtractionExtraction { ...@@ -514,7 +519,8 @@ class Extractions extends ExtractionExtraction {
/** /**
* Transition Method trDeposer * Transition Method trDeposer
*/ */
function trDeposer() { public function trDeposer()
{
$this->oBO = new WabBusinessObject($this->oConnection->oBd, array(), $this->aValues, $this->aProperties, 'extraction', $this->aValues['bo_id']); $this->oBO = new WabBusinessObject($this->oConnection->oBd, array(), $this->aValues, $this->aProperties, 'extraction', $this->aValues['bo_id']);
// Check si la table existe si oui change l'état // Check si la table existe si oui change l'état
$this->oBO->wabSetStatus($this->aProperties["schema_extraction"], "extraction", "bo_id", $this->aValues["bo_id"], "Fichier déposé"); $this->oBO->wabSetStatus($this->aProperties["schema_extraction"], "extraction", "bo_id", $this->aValues["bo_id"], "Fichier déposé");
...@@ -524,7 +530,8 @@ class Extractions extends ExtractionExtraction { ...@@ -524,7 +530,8 @@ class Extractions extends ExtractionExtraction {
/** /**
* Transition Method trAutoriser * Transition Method trAutoriser
*/ */
function trAutoriser() { public function trAutoriser()
{
$this->oBO = new WabBusinessObject($this->oConnection->oBd, array(), $this->aValues, $this->aProperties, 'extraction', $this->aValues['bo_id']); $this->oBO = new WabBusinessObject($this->oConnection->oBd, array(), $this->aValues, $this->aProperties, 'extraction', $this->aValues['bo_id']);
$this->oBO->insertOrder('8BCP8WGIOW4KO', 'bo_id=' . $this->aValues['bo_id']); $this->oBO->insertOrder('8BCP8WGIOW4KO', 'bo_id=' . $this->aValues['bo_id']);
// Check si la table existe si oui change l'état // Check si la table existe si oui change l'état
...@@ -535,7 +542,8 @@ class Extractions extends ExtractionExtraction { ...@@ -535,7 +542,8 @@ class Extractions extends ExtractionExtraction {
/** /**
* Transition Method trAccepter * Transition Method trAccepter
*/ */
function trAccepter() { public function trAccepter()
{
$this->oBO = new WabBusinessObject($this->oConnection->oBd, array(), $this->aValues, $this->aProperties, 'extraction', $this->aValues['bo_id']); $this->oBO = new WabBusinessObject($this->oConnection->oBd, array(), $this->aValues, $this->aProperties, 'extraction', $this->aValues['bo_id']);
// Check si la table existe si oui change l'état // Check si la table existe si oui change l'état
...@@ -548,7 +556,8 @@ class Extractions extends ExtractionExtraction { ...@@ -548,7 +556,8 @@ class Extractions extends ExtractionExtraction {
/** /**
* Transition Method trInvalider * Transition Method trInvalider
*/ */
function trInvalider() { public function trInvalider()
{
$this->oBO = new WabBusinessObject($this->oConnection->oBd, array(), $this->aValues, $this->aProperties, 'extraction', $this->aValues['bo_id']); $this->oBO = new WabBusinessObject($this->oConnection->oBd, array(), $this->aValues, $this->aProperties, 'extraction', $this->aValues['bo_id']);
// Check si la table existe si oui change l'état // Check si la table existe si oui change l'état
...@@ -556,13 +565,13 @@ class Extractions extends ExtractionExtraction { ...@@ -556,13 +565,13 @@ class Extractions extends ExtractionExtraction {
//$this->oBO->sendmail(id_du_mail_pour_dire_que_le_fichier_est_invalidé); //$this->oBO->sendmail(id_du_mail_pour_dire_que_le_fichier_est_invalidé);
$this->trRetour(); $this->trRetour();
} }
/** /**
* Transition Method trRetour * Transition Method trRetour
*/ */
function trRetour() { public function trRetour()
{
$this->oBO = new WabBusinessObject($this->oConnection->oBd, array(), $this->aValues, $this->aProperties, 'extraction', $this->aValues['bo_id']); $this->oBO = new WabBusinessObject($this->oConnection->oBd, array(), $this->aValues, $this->aProperties, 'extraction', $this->aValues['bo_id']);
// Check si la table existe si oui change l'état // Check si la table existe si oui change l'état
...@@ -573,7 +582,8 @@ class Extractions extends ExtractionExtraction { ...@@ -573,7 +582,8 @@ class Extractions extends ExtractionExtraction {
/** /**
* Transition Method trTerminerExtraction * Transition Method trTerminerExtraction
*/ */
function trTerminerExtraction() { public function trTerminerExtraction()
{
$this->oBO = new WabBusinessObject($this->oConnection->oBd, array(), $this->aValues, $this->aProperties, 'extraction', $this->aValues['bo_id']); $this->oBO = new WabBusinessObject($this->oConnection->oBd, array(), $this->aValues, $this->aProperties, 'extraction', $this->aValues['bo_id']);
// Check si la table existe si oui change l'état // Check si la table existe si oui change l'état
$this->oBO->wabSetStatus($this->aProperties["schema_extraction"], "extraction", "bo_id", $this->aValues["bo_id"], "Extraction terminée"); $this->oBO->wabSetStatus($this->aProperties["schema_extraction"], "extraction", "bo_id", $this->aValues["bo_id"], "Extraction terminée");
...@@ -583,7 +593,8 @@ class Extractions extends ExtractionExtraction { ...@@ -583,7 +593,8 @@ class Extractions extends ExtractionExtraction {
/** /**
* Transition Method trRefuser * Transition Method trRefuser
*/ */
function trRefuser() { public function trRefuser()
{
$this->oBO = new WabBusinessObject($this->oConnection->oBd, array(), $this->aValues, $this->aProperties, 'extraction', $this->aValues['bo_id']); $this->oBO = new WabBusinessObject($this->oConnection->oBd, array(), $this->aValues, $this->aProperties, 'extraction', $this->aValues['bo_id']);
// Check si la table existe si oui change l'état // Check si la table existe si oui change l'état
...@@ -593,5 +604,3 @@ class Extractions extends ExtractionExtraction { ...@@ -593,5 +604,3 @@ class Extractions extends ExtractionExtraction {
} }
} }
?>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment