diff --git a/src/module_extraction/web_service/ws/ExtractionExtraction.class.sql.inc b/src/module_extraction/web_service/ws/ExtractionExtraction.class.sql.inc index 5e4c86d7461d574bbabc86de3109e79550fdd511..de8f6493a3cadc148c8a131a1f2fc8f75b982163 100755 --- a/src/module_extraction/web_service/ws/ExtractionExtraction.class.sql.inc +++ b/src/module_extraction/web_service/ws/ExtractionExtraction.class.sql.inc @@ -17,4 +17,6 @@ $aSql['getRtLayerWithCtId'] = 'SELECT distinct layer_id, layer, category, mutual $aSql['getRtLayer'] = 'SELECT distinct layer_id, layer, category, mutualized, statistique FROM [schema_extraction].rt_layer INNER JOIN s_extraction.commune ON rt_layer.ct_id = commune.ct_id'; $aSql['getUserGroups'] = 'SELECT name FROM [schema_framework]."group",[schema_framework].user_group WHERE "group".group_id = user_group.group_id AND user_group.user_id = [user_id]'; + +$aSql['getDepositFile'] = 'SELECT wk_params FROM [schema_gtf]."order" WHERE "order".order_id = [bo_id];' ?> \ No newline at end of file diff --git a/src/module_extraction/web_service/ws/Extraction_depots.class.inc b/src/module_extraction/web_service/ws/Extraction_depots.class.inc index 8cebd171435fa8f256ece051d04017f3d0a81034..8d96ea827c316c3266f17fc242e2de5a7f14c838 100755 --- a/src/module_extraction/web_service/ws/Extraction_depots.class.inc +++ b/src/module_extraction/web_service/ws/Extraction_depots.class.inc @@ -395,7 +395,7 @@ class Extraction_depots extends ExtractionExtraction $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->insertOrder('EM0160AYYTK48', 'sourceDir=' . end(explode("/", $sDirPath)) . '/' . $this->aValues["control_file_name"] . '|sourceMotif='.$sExtension); + $this->oBO->insertOrder('EM0160AYYTK48', 'sourceDir=' . end(explode("/", $sDirPath)) . '/' . $this->aValues["input_deposit_name"] . '|sourceMotif=' . $sExtension . '|schema=' . $sSchemaContrainte . '|format=ACAD'); } else { //Si l'extension n'est pas bonne $error_message .= $this->aValues["control_file_name"] . " format is not authaurized (". $sExtension . ")"; diff --git a/src/module_extraction/web_service/ws/Extractions.class.inc b/src/module_extraction/web_service/ws/Extractions.class.inc index 86ec09e6f62a0aaad1dd76aac384370172cda0c1..c3cbe333d6d860653c47565e529400cf5cd4a2b0 100755 --- a/src/module_extraction/web_service/ws/Extractions.class.inc +++ b/src/module_extraction/web_service/ws/Extractions.class.inc @@ -244,6 +244,13 @@ class Extractions extends ExtractionExtraction //Si l'extension est autorisée if (in_array($sExtension, explode("|", $this->aProperties['sig'])) || in_array($sExtension, explode("|", $this->aProperties['dao']))) { + $sSchemaContrainte = ""; + if (in_array($sExtension, explode("|", $this->aProperties['sig']))) { + $sSchemaContrainte = $this->aProperties["schema_sig"]; + } elseif (in_array($sExtension, explode("|", $this->aProperties['dao']))) + { + $sSchemaContrainte = $this->aProperties["schema_dao"]; + } // Méthode de transition. if (!empty($this->aValues['tr_status_method'])) { eval('$this->' . $this->aValues['tr_status_method'] . '();'); @@ -260,7 +267,7 @@ class Extractions extends ExtractionExtraction fwrite($fp, $this->aValues["input_deposit_file"]); fclose($fp); //Demande GTF - $this->oBO->insertOrder('EM0160AYYTK48', 'sourceDir=' . end(explode("/", $sDirPath)) . '/' . $this->aValues["control_file_name"] . '|sourceMotif=' . $sExtension); + $this->oBO->insertOrder('EM0160AYYTK48', 'sourceDir=' . end(explode("/", $sDirPath)) . '/' . $this->aValues["input_deposit_name"] . '|sourceMotif=' . $sExtension . '|schema=' . $sSchemaContrainte . '|format=ACAD'); } else { //Si l'extension n'est pas bonne $error_message .= $this->aValues["input_deposit_name"] . " format is not authaurized (" . $sExtension . ")"; @@ -567,6 +574,21 @@ class Extractions extends ExtractionExtraction // 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 accepté"); + + $sSql = $aSql['getDepositFile']; + $aSQLParams = array( + 'schema_gtf' => array('value' => $this->aProperties['schema_gtf'], 'type' => 'schema_name'), + 'bo_id' => array('value' => $this->aValues['bo_id'], 'type' => 'integer'), + ); + + $oPDOresult = $this->oConnection->oBd->executeWithParams($sSql, $aSQLParams); + if (!$this->oConnection->oBd->enErreur()) { + $aResult = $this->oConnection->oBd->getResultTableAssoc($oPDOresult); + foreach ($aResult as $sWkParams) { + $sParams[] = $sWkParams['wk_params']; + } + } + //$this->oBO->sendmail(id_du_mail_pour_dire_que_le_fichier_est_accepté); $this->trReception();