diff --git a/web_service/ws/Workspaces.class.inc b/web_service/ws/Workspaces.class.inc index d4670d928a5ca83b80037a5887d7381eb7955d9a..a9f9942df451c8a8d6dda2c930d1c484dec6da73 100755 --- a/web_service/ws/Workspaces.class.inc +++ b/web_service/ws/Workspaces.class.inc @@ -169,13 +169,11 @@ class Workspaces extends GTF { // Formatage de la colonne "form_type". if ($aReturn['sStatus'] == 1) { foreach ($this->aObjects as &$oWorkspace) { - $sFile = $this->aProperties['workspace_dir'] . "/" . $oWorkspace->aFields['workspace_id'] . '/form/Subform.json'; - if (!file_exists($sFile)) { + if (!fileExistsInWsDataDir('gtf', 'workspace', $oWorkspace->aFields['workspace_id'], 'form', 'Subform.json')) $oWorkspace->aFields['form_type'] = ''; - } else { - if ($oWorkspace->aFields['form_type'] != "custom") { + else { + if ($oWorkspace->aFields['form_type'] != "custom") $oWorkspace->aFields['form_type'] = "default"; - } } } $aXmlRacineAttribute['status'] = 1; @@ -1199,11 +1197,10 @@ class Workspaces extends GTF { $oWorkspace = new Workspace($this->aPath, $this->aValues, $this->aProperties, $this->oConnection); $oWorkspace->GET(); $this->aFields['workspace_key'] = $oWorkspace->aFields["key"]; - $sWidgetFilePath = $this->aProperties["vas_home"] . '/ws_data/gtf/widget/' . $this->aFields['workspace_key'] . '.html'; - // Le fichier existe ? - if (!file_exists($sWidgetFilePath)) { - $aReturn = array('status' => 0, 'error_code' => 13, 'message' => 'The file ' . $this->aFields['workspace_key'] . '.html' . 'does not exist.'); - WriteToErrorLog("The file '$sWidgetFilePath' does not exist."); + $sWidgetFile = $this->aFields['workspace_key'] . '.html'; + if (!fileExistsInWsDataDir('gtf', 'widget', '', '', $sWidgetFile)) { + $aReturn = array('status' => 0, 'error_code' => 13, 'message' => 'The file ' . $sWidgetFile . ' does not exist.'); + WriteToErrorLog("The file '$sWidgetFile' does not exist."); } return $aReturn; }