Exemplo n.º 1
0
 /**
  * PROPFIND method handler
  *
  * @param array general parameter passing array
  * @param array return array for file properties
  * @return bool true on success
  */
 function PROPFIND(&$options, &$files)
 {
     $paths = $this->paths;
     // prepare property array
     $files["files"] = array();
     $pathClasses = PATH_DB . PATH_SEP . SYS_SYS . PATH_SEP . 'classes' . PATH_SEP;
     if (count($paths) == 0 && is_dir($pathClasses)) {
         $props = array();
         $props[] = $this->mkprop("displayname", 'Classes');
         $props[] = $this->mkprop("creationdate", filectime($pathClasses));
         $props[] = $this->mkprop("getlastmodified", filemtime($pathClasses));
         $props[] = $this->mkprop("lastaccessed", filemtime($pathClasses));
         $props[] = $this->mkprop("resourcetype", 'collection');
         $props[] = $this->mkprop("getcontenttype", 'httpd/unix-directory');
         $files["files"][] = array('path' => 'classes', 'props' => $props);
     }
     if (count($paths) > 0 && $paths[0] == 'classes' && is_dir($pathClasses)) {
         // try to open directory
         $handle = @opendir($pathClasses);
         if ($handle) {
             while ($filename = readdir($handle)) {
                 $ext = array_pop(explode('.', $filename));
                 if ($filename != "." && $filename != ".." && !is_dir($pathClasses . $filename) && $ext == 'php') {
                     $props = array();
                     $props[] = $this->mkprop("displayname", $filename);
                     $props[] = $this->mkprop("creationdate", filectime($pathClasses . $filename));
                     $props[] = $this->mkprop("getlastmodified", filemtime($pathClasses . $filename));
                     $props[] = $this->mkprop("getetag", fileatime($pathClasses . $filename));
                     $props[] = $this->mkprop("lastaccessed", filemtime($pathClasses . $filename));
                     $props[] = $this->mkprop("resourcetype", '');
                     $props[] = $this->mkprop("getcontenttype", 'text/plain');
                     $props[] = $this->mkprop("getcontentlength", filesize($pathClasses . $filename));
                     if (count($paths) == 1 || count($paths) == 2 && $paths[1] == $filename) {
                         $files["files"][] = array('path' => "classes/{$filename}", 'props' => $props);
                     }
                 }
             }
         }
     }
     //path classes
     $pathProcesses = PATH_DB . SYS_SYS . PATH_SEP;
     if (count($paths) == 0 && is_dir($pathProcesses)) {
         $props = array();
         $props[] = $this->mkprop("displayname", 'Processes');
         $props[] = $this->mkprop("creationdate", filectime($pathProcesses));
         $props[] = $this->mkprop("getlastmodified", filemtime($pathProcesses));
         $props[] = $this->mkprop("resourcetype", 'collection');
         $props[] = $this->mkprop("getcontenttype", 'httpd/unix-directory');
         $files["files"][] = array('path' => 'processes', 'props' => $props);
     }
     //list all active processes
     if (count($paths) == 1 && $paths[0] == 'processes' && is_dir($pathProcesses)) {
         // try to get the process directory list
         G::LoadClass('processMap');
         G::LoadClass('model/Process');
         $oProcessMap = new processMap();
         $oProcess = new Process();
         $c = $oProcessMap->getConditionProcessList();
         $oDataset = ProcessPeer::doSelectRS($c);
         $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
         $oDataset->next();
         while ($aRow = $oDataset->getRow()) {
             if ($aRow['PRO_STATUS'] == 'ACTIVE') {
                 $aProcess = $oProcess->load($aRow['PRO_UID']);
                 $props = array();
                 $props[] = $this->mkprop("displayname", $aProcess['PRO_TITLE']);
                 $props[] = $this->mkprop("creationdate", filectime($pathProcesses));
                 $props[] = $this->mkprop("getlastmodified", filemtime($pathProcesses));
                 $props[] = $this->mkprop("lastaccessed", filemtime($pathProcesses));
                 $props[] = $this->mkprop("resourcetype", 'collection');
                 $props[] = $this->mkprop("getcontenttype", 'httpd/unix-directory');
                 $files["files"][] = array('path' => "processes/" . $aRow['PRO_UID'], 'props' => $props);
             }
             $oDataset->next();
         }
     }
     //dir of processes
     //content of any process  ( the three major folders of Processes )
     $pathXmlform = $pathProcesses . 'xmlForms' . PATH_SEP;
     if (count($paths) == 2 && $paths[0] == 'processes' && is_dir($pathProcesses)) {
         $props = array();
         $props[] = $this->mkprop("displayname", 'xmlforms');
         $props[] = $this->mkprop("creationdate", filectime($pathXmlform));
         $props[] = $this->mkprop("getlastmodified", filemtime($pathXmlform));
         $props[] = $this->mkprop("lastaccessed", filemtime($pathXmlform));
         $props[] = $this->mkprop("resourcetype", 'collection');
         $props[] = $this->mkprop("getcontenttype", 'httpd/unix-directory');
         $files["files"][] = array('path' => 'processes/' . $paths[1] . '/xmlforms', 'props' => $props);
         $props[] = $this->mkprop("displayname", 'mailTemplates');
         $props[] = $this->mkprop("creationdate", filectime($pathProcesses));
         $props[] = $this->mkprop("getlastmodified", filemtime($pathProcesses));
         $props[] = $this->mkprop("lastaccessed", filemtime($pathProcesses));
         $props[] = $this->mkprop("resourcetype", 'collection');
         $props[] = $this->mkprop("getcontenttype", 'httpd/unix-directory');
         $files["files"][] = array('path' => 'processes/' . $paths[1] . '/mailTemplates', 'props' => $props);
         $props[] = $this->mkprop("displayname", 'public_html');
         $props[] = $this->mkprop("creationdate", filectime($pathProcesses));
         $props[] = $this->mkprop("getlastmodified", filemtime($pathProcesses));
         $props[] = $this->mkprop("lastaccessed", filemtime($pathProcesses));
         $props[] = $this->mkprop("resourcetype", 'collection');
         $props[] = $this->mkprop("getcontenttype", 'httpd/unix-directory');
         $files["files"][] = array('path' => 'processes/' . $paths[1] . '/public_html', 'props' => $props);
     }
     //content of any processes
     //list available xmlforms
     if (count($paths) == 3 && $paths[0] == 'processes' && $paths[2] == 'xmlforms' && is_dir($pathXmlform)) {
         $pathXmlform = $pathProcesses . 'xmlForms' . PATH_SEP . $paths[1] . PATH_SEP;
         $handle = @opendir($pathXmlform);
         if ($handle) {
             while ($filename = readdir($handle)) {
                 $ext = array_pop(explode('.', $filename));
                 if ($filename != "." && $filename != ".." && !is_dir($pathXmlform . $filename) && ($ext == 'xml' || $ext == 'html')) {
                     $props = array();
                     $props[] = $this->mkprop("displayname", $filename);
                     $props[] = $this->mkprop("creationdate", filectime($pathXmlform . $filename));
                     $props[] = $this->mkprop("getlastmodified", filemtime($pathXmlform . $filename));
                     $props[] = $this->mkprop("getetag", fileatime($pathXmlform . $filename));
                     $props[] = $this->mkprop("lastaccessed", filemtime($pathXmlform . $filename));
                     $props[] = $this->mkprop("resourcetype", '');
                     $props[] = $this->mkprop("getcontenttype", 'text/plain');
                     $props[] = $this->mkprop("getcontentlength", filesize($pathXmlform . $filename));
                     //if ( count( $paths ) == 1 || ( count( $paths ) == 2 && $paths[1] == $filename ) )
                     $files["files"][] = array('path' => 'processes/' . $paths[1] . '/xmlforms/' . $filename, 'props' => $props);
                 }
             }
         }
     }
     //content of xmlforms
     //list available mailTemplates
     $pathTemplates = $pathProcesses . 'mailTemplates' . PATH_SEP;
     if (count($paths) == 3 && $paths[0] == 'processes' && $paths[2] == 'mailTemplates' && is_dir($pathTemplates)) {
         $pathTemplates = $pathProcesses . 'mailTemplates' . PATH_SEP . $paths[1] . PATH_SEP;
         $handle = @opendir($pathTemplates);
         if ($handle) {
             while ($filename = readdir($handle)) {
                 $ext = array_pop(explode('.', $filename));
                 if ($filename != "." && $filename != ".." && !is_dir($pathTemplates . $filename)) {
                     $props = array();
                     $props[] = $this->mkprop("displayname", $filename);
                     $props[] = $this->mkprop("creationdate", filectime($pathTemplates . $filename));
                     $props[] = $this->mkprop("getlastmodified", filemtime($pathTemplates . $filename));
                     $props[] = $this->mkprop("getetag", fileatime($pathTemplates . $filename));
                     $props[] = $this->mkprop("lastaccessed", filemtime($pathTemplates . $filename));
                     $props[] = $this->mkprop("resourcetype", '');
                     $props[] = $this->mkprop("getcontenttype", 'text/plain');
                     $props[] = $this->mkprop("getcontentlength", filesize($pathTemplates . $filename));
                     //if ( count( $paths ) == 1 || ( count( $paths ) == 2 && $paths[1] == $filename ) )
                     $files["files"][] = array('path' => 'processes/' . $paths[1] . '/mailTemplates/' . $filename, 'props' => $props);
                 }
             }
         }
     }
     //content of mailTemplates
     //list available public_html files
     $pathPublic = $pathProcesses . 'public' . PATH_SEP;
     if (count($paths) == 3 && $paths[0] == 'processes' && $paths[2] == 'public_html' && is_dir($pathTemplates)) {
         $pathPublic = $pathProcesses . 'public' . PATH_SEP . $paths[1] . PATH_SEP;
         $handle = @opendir($pathPublic);
         if ($handle) {
             while ($filename = readdir($handle)) {
                 $ext = array_pop(explode('.', $filename));
                 if ($filename != "." && $filename != ".." && !is_dir($pathPublic . $filename)) {
                     $props = array();
                     $props[] = $this->mkprop("displayname", $filename);
                     $props[] = $this->mkprop("creationdate", filectime($pathPublic . $filename));
                     $props[] = $this->mkprop("getlastmodified", filemtime($pathPublic . $filename));
                     $props[] = $this->mkprop("getetag", fileatime($pathPublic . $filename));
                     $props[] = $this->mkprop("lastaccessed", filemtime($pathPublic . $filename));
                     $props[] = $this->mkprop("resourcetype", '');
                     $props[] = $this->mkprop("getcontenttype", 'text/plain');
                     $props[] = $this->mkprop("getcontentlength", filesize($pathPublic . $filename));
                     //if ( count( $paths ) == 1 || ( count( $paths ) == 2 && $paths[1] == $filename ) )
                     $files["files"][] = array('path' => 'processes/' . $paths[1] . '/public_html/' . $filename, 'props' => $props);
                 }
             }
         }
     }
     //content of public_html files
     /*
         if ( 1 ) {
           $props = array ();
           $props[] = $this->mkprop("displayname",     print_r ($pathPublic, 1) );
           $props[] = $this->mkprop("creationdate",    filectime( PATH_DB ) );
           $props[] = $this->mkprop("getlastmodified", filemtime( PATH_DB ) );
           $props[] = $this->mkprop("resourcetype",    'collection' );
           $props[] = $this->mkprop("getcontenttype",  'httpd/unix-directory' );
           $files["files"][] = array ( 'path' => '/' , 'props' => $props);
         } */
     // ok, all done
     return true;
 }
Exemplo n.º 2
0
#Global Definitions
require_once 'classes/model/DbSource.php';
require_once 'classes/model/Content.php';
$G_PUBLISH = new Publisher();
G::LoadClass('processMap');
G::LoadClass('ArrayPeer');
G::LoadClass('dbConnections');
global $_DBArray;
switch ($action) {
    case 'loadInfoAssigConnecctionDB':
        $oStep = new Step();
        return print $oStep->loadInfoAssigConnecctionDB($_POST['PRO_UID'], $_POST['DBS_UID']);
        break;
    case 'showDbConnectionsList':
        $oProcess = new processMap();
        $oCriteria = $oProcess->getConditionProcessList();
        if (ProcessPeer::doCount($oCriteria) > 0) {
            $aProcesses = array();
            $aProcesses[] = array('PRO_UID' => 'char', 'PRO_TITLE' => 'char');
            $oDataset = ArrayBasePeer::doSelectRS($oCriteria);
            $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
            $oDataset->next();
            $sProcessUID = '';
            while ($aRow = $oDataset->getRow()) {
                if ($sProcessUID == '') {
                    $sProcessUID = $aRow['PRO_UID'];
                }
                $aProcesses[] = array('PRO_UID' => isset($aRow['PRO_UID']) ? $aRow['PRO_UID'] : '', 'PRO_TITLE' => isset($aRow['PRO_TITLE']) ? $aRow['PRO_TITLE'] : '');
                $oDataset->next();
            }
            $_DBArray['PROCESSES'] = $aProcesses;
Exemplo n.º 3
0
            G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels');
            G::header('location: ../login/login');
            die;
            break;
        default:
            G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
            G::header('location: ../login/login');
            die;
            break;
    }
}
$G_MAIN_MENU = 'processmaker';
$G_SUB_MENU = 'process';
$G_ID_MENU_SELECTED = 'PROCESSES';
$G_ID_SUB_MENU_SELECTED = '-';
$aLabels['LANG'] = SYS_LANG;
$aLabels['PRO_EDIT'] = G::LoadTranslation('ID_EDIT');
$aLabels['PRO_DELETE'] = G::LoadTranslation('ID_DELETE');
$aLabels['ACTIVE'] = G::LoadTranslation('ID_ACTIVE');
$aLabels['INACTIVE'] = G::LoadTranslation('ID_INACTIVE');
$aLabels['CONFIRM'] = G::LoadTranslation('ID_MSG_CONFIRM_DELETE_PROCESS');
G::LoadClass('processMap');
$oProcess = new processMap();
$c = $oProcess->getConditionProcessList();
function activeFalse($value)
{
    return $value == "ACTIVE" ? "ID_ACTIVE" : "ID_INACTIVE";
}
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent('propeltable', 'paged-table', 'processes/processes_List', $c, $aLabels, '');
G::RenderPage('publish');