Exemplo n.º 1
0
     $_SESSION['PFMDirectory'] = '';
     $oProcessMap->processFilesManager($oData->pro_uid);
     break;
 case 'exploreDirectory':
     $objData = G::json_decode($_REQUEST['data']);
     $_SESSION['PFMDirectory'] = $objData->{'main_directory'};
     $oProcessMap->exploreDirectory($oData->pro_uid, $oData->main_directory, $oData->directory);
     break;
 case 'deleteFile':
     $oProcessMap->deleteFile($oData->pro_uid, $oData->main_directory, $oData->directory, $oData->file);
     break;
 case 'deleteDirectory':
     $oProcessMap->deleteDirectory($oData->pro_uid, $oData->main_directory, $oData->directory, $oData->dir_to_delete);
     break;
 case 'downloadFile':
     $oProcessMap->downloadFile($oData->pro_uid, $oData->main_directory, $oData->directory, $oData->file);
     break;
 case 'deleteSubProcess':
     $sOutput = $oProcessMap->deleteSubProcess($oData->pro_uid, $oData->tas_uid);
     break;
 case 'subProcess_Properties':
     $oProcessMap->subProcess_Properties($oData->pro_uid, $oData->tas_uid, $oData->index);
     break;
 case 'showDetailsPMDWL':
     G::LoadClass('processes');
     $oProcesses = new Processes();
     $oProcesses->ws_open_public();
     $aFields = get_object_vars($oProcesses->ws_processGetData($oData->pro_uid));
     $aFields['description'] = nl2br($aFields['description']);
     $aFields['installSteps'] = nl2br($aFields['installSteps']);
     switch ($aFields['privacy']) {
Exemplo n.º 2
0
 /**
  *
  * @param string $sProcessUID {@min 32} {@max 32}
  * @param string $prfUid {@min 32} {@max 32}
  *
  *
  * @access public
  */
 public function downloadProcessFilesManager($sProcessUID, $prfUid)
 {
     try {
         $path = '';
         $criteria = new \Criteria("workflow");
         $criteria->addSelectColumn(\ProcessFilesPeer::PRF_PATH);
         $criteria->add(\ProcessFilesPeer::PRF_UID, $prfUid, \Criteria::EQUAL);
         $rsCriteria = \ProcessFilesPeer::doSelectRS($criteria);
         $rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
         $rsCriteria->next();
         while ($aRow = $rsCriteria->getRow()) {
             $path = $aRow['PRF_PATH'];
             $rsCriteria->next();
         }
         if ($path == '') {
             throw new \Exception(\G::LoadTranslation("ID_INVALID_VALUE_FOR", array('prf_uid')));
         }
         $sFile = end(explode("/",$path));
         $sPath = str_replace($sFile,'',$path);
         $sSubDirectory = substr(str_replace($sProcessUID,'',substr($sPath,(strpos($sPath, $sProcessUID)))),0,-1);
         $sMainDirectory = str_replace(substr($sPath, strpos($sPath, $sProcessUID)),'', $sPath);
         if ($sMainDirectory == PATH_DATA_MAILTEMPLATES) {
             $sMainDirectory = 'mailTemplates';
         } else {
             $sMainDirectory = 'public';
         }
         if (file_exists($path)) {
             $oProcessMap = new \processMap(new \DBConnection());
             $oProcessMap->downloadFile($sProcessUID,$sMainDirectory,$sSubDirectory,$sFile);
             die();
         } else {
             throw (new \Exception( 'Invalid value specified for path.'));
         }
     } catch (Exception $e) {
         throw $e;
     }
 }