Example #1
0
 public function newSite()
 {
     $textStep1 = G::LoadTranslation('ID_PROCESSMAKER_REQUIREMENTS_DESCRIPTION_STEP4_1');
     $textStep2 = G::LoadTranslation('ID_PROCESSMAKER_REQUIREMENTS_DESCRIPTION_STEP5');
     $this->includeExtJS('installer/CardLayout', false);
     $this->includeExtJS('installer/Wizard', false);
     $this->includeExtJS('installer/Header', false);
     $this->includeExtJS('installer/Card', false);
     $this->includeExtJS('installer/newSite', false);
     $this->setJSVar('textStep1', $textStep1);
     $this->setJSVar('textStep2', $textStep2);
     $this->setJSVar('DB_ADAPTER', DB_ADAPTER);
     $aux = explode(':', DB_HOST);
     $this->setJSVar('DB_HOST', $aux[0]);
     $this->setJSVar('DB_PORT', isset($aux[1]) ? $aux[1] : (DB_ADAPTER == 'mssql' ? '1433' : '3306'));
     $this->setJSVar('DB_NAME', 'workflow');
     $this->setJSVar('DB_USER', '');
     $this->setJSVar('DB_PASS', '');
     $this->setJSVar('pathConfig', PATH_CORE . 'config' . PATH_SEP);
     $this->setJSVar('pathLanguages', PATH_LANGUAGECONT);
     $this->setJSVar('pathPlugins', PATH_PLUGINS);
     $this->setJSVar('pathXmlforms', PATH_XMLFORM);
     $this->setJSVar('pathShared', PATH_DATA);
     $this->setView('installer/newSite');
     G::RenderPage('publish', 'extJs');
 }
Example #2
0
 public function newSite()
 {
     $textStep1 = 'ProcessMaker stores all of its data in a database. This screen gives the installation program the information needed to create this database.<br><br>' . 'If you are installing ProcessMaker on a remote web server, you will need to get this information from your Database Server.';
     $textStep2 = 'ProcessMaker uses a workspaces to store data. Please select a valid workspace name and credentials to log in it.';
     $this->includeExtJS('installer/CardLayout', false);
     $this->includeExtJS('installer/Wizard', false);
     $this->includeExtJS('installer/Header', false);
     $this->includeExtJS('installer/Card', false);
     $this->includeExtJS('installer/newSite', false);
     $this->setJSVar('textStep1', $textStep1);
     $this->setJSVar('textStep2', $textStep2);
     $this->setJSVar('DB_ADAPTER', DB_ADAPTER);
     $aux = explode(':', DB_HOST);
     $this->setJSVar('DB_HOST', $aux[0]);
     $this->setJSVar('DB_PORT', isset($aux[1]) ? $aux[1] : (DB_ADAPTER == 'mssql' ? '1433' : '3306'));
     $this->setJSVar('DB_NAME', 'workflow');
     $this->setJSVar('DB_USER', '');
     $this->setJSVar('DB_PASS', '');
     $this->setJSVar('pathConfig', PATH_CORE . 'config' . PATH_SEP);
     $this->setJSVar('pathLanguages', PATH_LANGUAGECONT);
     $this->setJSVar('pathPlugins', PATH_PLUGINS);
     $this->setJSVar('pathXmlforms', PATH_XMLFORM);
     $this->setJSVar('pathShared', PATH_DATA);
     $this->setView('installer/newSite');
     G::RenderPage('publish', 'extJs');
 }
Example #3
0
 public function formPMGmail()
 {
     try {
         $this->includeExtJS('admin/pmGmail');
         if (!empty($_SESSION['__PMGMAIL_ERROR__'])) {
             $this->setJSVar('__PMGMAIL_ERROR__', $_SESSION['__PMGMAIL_ERROR__']);
             unset($_SESSION['__PMGMAIL_ERROR__']);
         }
         G::LoadClass("pmGoogleApi");
         $pmGoogle = new PMGoogleApi();
         $accountEmail = $pmGoogle->getServiceAccountEmail();
         $fileP12 = $pmGoogle->getServiceAccountP12();
         $fileJson = $pmGoogle->getAccountJson();
         $fileJson = $fileJson == null ? '' : $fileJson;
         $type = $pmGoogle->getTypeAuthentication();
         $enablePMGmail = $pmGoogle->getStatusService();
         $this->setJSVar('accountEmail', $accountEmail);
         $this->setJSVar('fileP12', $fileP12);
         $this->setJSVar('enablePMGmail', $enablePMGmail);
         $this->setJSVar('fileJson', $fileJson);
         $this->setJSVar('typeAuthentication', $type);
         G::RenderPage('publish', 'extJs');
     } catch (Exception $error) {
         $_SESSION['__PMGMAIL_ERROR__'] = $error->getMessage();
         die;
     }
 }
 /**
  * 
  * @url GET /editTemplate
  */
 public function editTemplate($params)
 {
     // Action Validations
     if (!isset($_REQUEST['TEMPLATE'])) {
         $_REQUEST['TEMPLATE'] = '';
     }
     if ($_REQUEST['TEMPLATE'] == '') {
         throw new Exception('The TEMPLATE parameter is empty.');
     }
     $data = array('CONTENT' => file_get_contents(PATH_DATA_MAILTEMPLATES . $_REQUEST['PRO_UID'] . PATH_SEP . $_REQUEST['TEMPLATE']), 'TEMPLATE' => $_REQUEST['TEMPLATE']);
     global $G_PUBLISH;
     $G_PUBLISH = new Publisher();
     $G_PUBLISH->AddContent('xmlform', 'xmlform', 'actionsByEmail/actionsByEmail_FileEdit', '', $data);
     G::RenderPage('publish', 'raw');
     die;
 }
Example #5
0
 function index($httpData)
 {
     if (!isset($httpData->id)) {
         throw new Exception('The Process ID was not set!');
     }
     require_once 'classes/model/Process.php';
     $process = ProcessPeer::retrieveByPK($httpData->id);
     if (get_class($process) != 'Process') {
         throw new Exception("The Process with UID: {$httpData->id} doesn't exist!");
     }
     $_SESSION['PROCESS'] = $httpData->id;
     $_SESSION['PROCESSMAP'] = 'BPMN';
     $this->includeExtJS('bpmn/MyWorkflow', true);
     $this->includeExtJS('bpmn/pmosExt', true);
     $this->includeExtJS('bpmn/TaskContext', true);
     $this->includeExtJS('bpmn/designerComponents', true);
     $this->includeExtJS('bpmn/designer', true);
     $this->includeExtJS('bpmn/Annotation', true);
     $this->includeExtJS('bpmn/bpmnShapes', true);
     $this->includeExtJS('bpmn/EventEmptyStart');
     $this->includeExtJS('bpmn/EventMessageStart');
     $this->includeExtJS('bpmn/EventTimerStart');
     $this->includeExtJS('bpmn/EventEmptyInter');
     $this->includeExtJS('bpmn/EventMessageRecInter');
     $this->includeExtJS('bpmn/EventMessageSendInter');
     $this->includeExtJS('bpmn/EventTimerInter');
     $this->includeExtJS('bpmn/EventEmptyEnd');
     $this->includeExtJS('bpmn/EventMessageEnd');
     $this->includeExtJS('bpmn/GatewayInclusive');
     $this->includeExtJS('bpmn/GatewayExclusiveData');
     $this->includeExtJS('bpmn/GatewayParallel');
     $this->includeExtJS('bpmn/GridPanel');
     $this->includeExtJS('bpmn/SubProcess');
     $this->includeExtJS('bpmn/ProcessOptions', true);
     $this->includeExtJS('bpmn/ProcessMapContext', true);
     $this->includeExtJS('bpmn/ProcessOptions', true);
     $this->setJSVar('pro_uid', $httpData->id);
     $this->setJSVar('pro_title', $process->getProTitle());
     $this->setView('bpmn/designer');
     G::RenderPage('publish', 'extJs');
 }
Example #6
0
 * customFunctions.php
 *  
 * ProcessMaker Open Source Edition
 * Copyright (C) 2004 - 2008 Colosa Inc.23
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 * 
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 * 
 * For more information, contact Colosa Inc, 2566 Le Jeune Rd., 
 * Coral Gables, FL, 33134, USA, or email info@colosa.com.
 * 
 */
if (($RBAC_Response = $RBAC->userCanAccess("PM_SETUP")) != 1) {
    return $RBAC_Response;
}
$G_ENABLE_BLANK_SKIN = true;
$dbc = new DBConnection();
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent('table', 'paged-table2', 'setup/Custom_Functions', '', '', '');
G::RenderPage('publish-treeview');
    /**
     * get setup Plugins
     *
     * @param unknown_type $default
     * @return void
     */
    public function setupPlugins ()
    {
        try {
            require_once(PATH_CORE . "methods" . PATH_SEP . "enterprise" . PATH_SEP . "enterprise.php");
            require_once("class.serverConfiguration.php");

            $iPlugins = 0;
            $oServerConf = & serverConf::getSingleton();
            $oServerConf->addPlugin( SYS_SYS, $this->_aPluginDetails );
            foreach ($this->_aPluginDetails as $namespace => $detail) {
                if (isset( $detail->enabled ) && $detail->enabled) {
                    if (! empty( $detail->sFilename ) && file_exists( $detail->sFilename )) {
                        $arrayFileInfo = pathinfo($detail->sFilename);
                        $sFilename = (($detail->sNamespace == "enterprise")? PATH_CORE. "methods" . PATH_SEP . "enterprise" . PATH_SEP : PATH_PLUGINS) . $arrayFileInfo["basename"];
                        if (! file_exists( $sFilename )) {
                            continue;
                        }
                        require_once $sFilename;
                        if (class_exists( $detail->sClassName )) {
                            $oPlugin = new $detail->sClassName( $detail->sNamespace, $detail->sFilename );
                            $this->_aPlugins[$detail->sNamespace] = $oPlugin;
                            $iPlugins ++;
                            $oPlugin->setup();
                        }
                    }
                }
            }
            $this->eevalidate();
            return $iPlugins;
        } catch (Exception $e) {
            global $G_PUBLISH;
            $aMessage['MESSAGE'] = $e->getMessage();
            $G_PUBLISH = new Publisher();
            $G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
            G::RenderPage( 'publish' );
            die();
        }
    }
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 * 
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 * 
 * For more information, contact Colosa Inc, 2566 Le Jeune Rd., 
 * Coral Gables, FL, 33134, USA, or email info@colosa.com.
 * 
 */
$G_MAIN_MENU = "rbac";
$G_SUB_MENU = "rbac.userEdit";
$G_MENU_SELECTED = 0;
$uid = $HTTP_SESSION_VARS['CURRENT_USER'];
$dbc = new DBConnection(DB_HOST, DB_RBAC_USER, DB_RBAC_PASS, DB_RBAC_NAME);
$ses = new DBSession($dbc);
$stQry = "SELECT UID, USR_USE_LDAP FROM USERS where UID = {$uid} ";
$dset = $ses->Execute($stQry);
$row = $dset->Read();
$useLdap = $row['USR_USE_LDAP'] == 'Y';
$access = $RBAC->userCanAccess("RBAC_CREATE_USERS");
G::LoadClassRBAC("user");
$obj = new RBAC_User();
$obj->SetTo($dbc);
$obj->Load($uid);
$G_PUBLISH = new Publisher();
$G_PUBLISH->SetTo($dbc);
$G_PUBLISH->AddContent("xmlform", "xmlform", "rbac/userChangeLdap", "", $obj->Fields, "userChangeLdap2");
G::RenderPage("publish");
Example #9
0
                    $_SESSION['ACTION'] = 'jump';
                } else {
                    $Fields = $oCase->loadCase( $_SESSION['APPLICATION'], $_SESSION['INDEX']);
                    unset($_SESSION['ACTION']);
                }
                $_SESSION['CURRENT_TASK'] = $Fields['TAS_UID'];
                $_SESSION['STEP_POSITION'] = 0;
                require_once (PATH_METHODS . 'cases' . PATH_SEP . 'cases_Resume.php');

            }
            break;
        default: //APP_STATUS <> DRAFT and TO_DO
            $_SESSION['APPLICATION'] = $sAppUid;
            $_SESSION['INDEX'] = $oCase->getCurrentDelegationCase( $_GET['APP_UID'] );
            $_SESSION['PROCESS'] = $aFields['PRO_UID'];
            $_SESSION['TASK'] = - 1;
            $_SESSION['STEP_POSITION'] = 0;
            $Fields = $oCase->loadCase( $_SESSION['APPLICATION'], $_SESSION['INDEX']);
            $_SESSION['CURRENT_TASK'] = $Fields['TAS_UID'];

            require_once (PATH_METHODS . 'cases' . PATH_SEP . 'cases_Resume.php');
    }
} catch (Exception $e) {
    $aMessage = array ();
    $aMessage['MESSAGE'] = $e->getMessage();
    $G_PUBLISH = new Publisher();
    $G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
    G::RenderPage( 'publishBlank', 'blank' );
}

Example #10
0
     $Fields['APP_DOC_UID'] = $_POST['appDocId'];
     $Fields['actionType'] = $_POST['actionType'];
     $Fields['docVersion'] = $_POST['docVersion'];
     $G_PUBLISH->AddContent('xmlform', 'xmlform', 'cases/cases_AttachInputDocumentGeneral', '', $Fields, 'cases_SupervisorSaveDocument?UID=' . $_POST['docID'] . '&APP_UID=' . $_POST['appDocId']);
     G::RenderPage('publish', 'raw');
     break;
 case "inputDocumentVersionHistory":
     //krumo($_POST);
     $G_PUBLISH = new Publisher();
     $Fields['DOC_UID'] = $_POST['docID'];
     $Fields['APP_DOC_UID'] = $_POST['appDocId'];
     $G_PUBLISH->AddContent('propeltable', 'paged-table', 'cases/cases_InputdocsListHistory', $oCase->getInputDocumentsCriteria($_SESSION['APPLICATION'], $_SESSION['INDEX'], $_POST['docID'], $_POST['appDocId']), array());
     //$aFields
     //$G_PUBLISH->AddContent('xmlform', 'xmlform', 'cases/cases_AttachInputDocumentGeneral',
     // '', $Fields, 'cases_SaveDocument?UID=' . $_POST['docID']);
     G::RenderPage('publish', 'raw');
     break;
 case "getCountCasesFolder":
     //$json = new Services_JSON();
     $aTypes = array('to_do', 'draft', 'cancelled', 'sent', 'paused', 'completed', 'selfservice', 'to_revise', 'to_reassign');
     $aTypesID = array('to_do' => 'CASES_INBOX', 'draft' => 'CASES_DRAFT', 'cancelled' => 'CASES_CANCELLED', 'sent' => 'CASES_SENT', 'paused' => 'CASES_PAUSED', 'completed' => 'CASES_COMPLETED', 'selfservice' => 'CASES_SELFSERVICE', 'to_revise' => 'CASES_TO_REVISE', 'to_reassign' => 'CASES_TO_REASSIGN');
     if (!isset($_POST['A'])) {
         $oCases = new Cases();
         $aCount = $oCases->getAllConditionCasesCount($aTypes, true);
         echo Bootstrap::json_encode($aCount);
     } else {
         echo Bootstrap::json_encode($aTypesID);
     }
     break;
 case "previusJump":
     //require_once 'classes/model/Application.php';
Example #11
0
            G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
            G::header('location: ../login/login');
            die;
            break;
        case -2:
            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;
    }
}
try {
    /* Includes */
    G::LoadClass('processes');
    /* Render page */
    $G_MAIN_MENU = 'processmaker';
    $G_ID_MENU_SELECTED = 'PROCESSES';
    $G_PUBLISH = new Publisher();
    $G_PUBLISH->AddContent('xmlform', 'xmlform', 'processes/processes_Import', '', NULL, 'processes_ImportFile');
    G::RenderPage("publish", "blank");
} catch (Exception $e) {
    $G_PUBLISH = new Publisher();
    $aMessage['MESSAGE'] = $e->getMessage();
    $G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $aMessage);
    G::RenderPage('publish', "blank");
}
Example #12
0
 /**
  * getting default list
  *
  * @param string $httpData->PRO_UID (opional)
  */
 public function pmLogo($httpData)
 {
     global $RBAC;
     $RBAC->requirePermissions('PM_SETUP_ADVANCE');
     G::LoadClass('configuration');
     $c = new Configurations();
     $configPage = $c->getConfiguration('additionalTablesList', 'pageSize', '', $_SESSION['USER_LOGGED']);
     $Config['pageSize'] = isset($configPage['pageSize']) ? $configPage['pageSize'] : 20;
     $this->includeExtJS('admin/pmLogo');
     $this->setView('admin/pmLogo');
     //assigning js variables
     $this->setJSVar('FORMATS', $c->getFormats());
     $this->setJSVar('CONFIG', $Config);
     $this->setJSVar('PRO_UID', isset($_GET['PRO_UID']) ? $_GET['PRO_UID'] : false);
     if (isset($_SESSION['_cache_pmtables'])) {
         unset($_SESSION['_cache_pmtables']);
     }
     if (isset($_SESSION['ADD_TAB_UID'])) {
         unset($_SESSION['ADD_TAB_UID']);
     }
     //render content
     G::RenderPage('publish', 'extJs');
 }
Example #13
0
 public function export($httpData)
 {
     $this->includeExtJS('pmTables/export', $this->debug);
     //adding a javascript file .js
     $this->setView('pmTables/export');
     //adding a html file  .html.
     $toSend = array();
     $toSend['UID_LIST'] = $httpData->id;
     $this->setJSVar('EXPORT_TABLES', $toSend);
     G::RenderPage('publish', 'extJs');
 }
 /**
  * Function printForm
  *
  * @param string $filename
  * @param array $data
  * @return void
  */
 public function printForm($filename, $data = array())
 {
     global $G_PUBLISH;
     $G_PUBLISH = new Publisher();
     $G_PUBLISH->AddContent('xmlform', 'xmlform', $filename, '', $data, $this->popupSubmit);
     G::RenderPage("publish", "blank");
 }
Example #15
0
$html .= '<tr width="40%">';
$html .= '<td>' . G::LoadTranslation('ID_RESULT') . '</td>';
$html .= '<td><span id="selectedVariableLabel">@@SYS_LANG</span></td>';
$html .= '</tr>';
$html .= '<tr width="60%">';
$html .= '<td>' . G::LoadTranslation('ID_DESCRIPTION') . '</td>';
$html .= '<td><span id="desc_variables">' . G::LoadTranslation('ID_SYSTEM') . '</span></td>';
$html .= '</tr>';
$html .= '</table>';
$html .= '</div>';
$html .= '<br>';
$html .= '<table width="90%" align="center">';
$html .= '<tr><td>';
$html .= '<label for="desc_prefix">*<span id="desc_prefix">' . G::LoadTranslation('ID_TO_STRING') . '</span></label>';
$html .= '</td></tr>';
$html .= '</div>';
$html .= '</form>';
$display = 'raw';
$G_PUBLISH = new Publisher();
$oHeadPublisher =& headPublisher::getSingleton();
$oHeadPublisher->addScriptFile('/jscore/controls/variablePicker.js');
if (isset($_REQUEST['displayOption'])) {
    if ($_REQUEST['displayOption'] == 'tinyMCE') {
        $display = 'blank';
        $oHeadPublisher->addScriptFile('/js/tinymce/jscripts/tiny_mce/tiny_mce_popup.js');
        $oHeadPublisher->addScriptFile('/js/tinymce/jscripts/tiny_mce/plugins/pmVariablePicker/editor_plugin_src.js');
    }
}
echo $html;
G::RenderPage('publish', $display);
Example #16
0
    public function logout($oauthAccessTokenId, $refresh)
    {
        $aFields = array();

        if (!isset($_GET['u'])) {
            $aFields['URL'] = '';
        } else {
            $aFields['URL'] = htmlspecialchars(addslashes(stripslashes(strip_tags(trim(urldecode($_GET['u']))))));
        }

        if (!isset($_SESSION['G_MESSAGE'])) {
            $_SESSION['G_MESSAGE'] = '';
        }

        if (!isset($_SESSION['G_MESSAGE_TYPE'])) {
            $_SESSION['G_MESSAGE_TYPE'] = '';
        }

        $msg = $_SESSION['G_MESSAGE'];
        $msgType = $_SESSION['G_MESSAGE_TYPE'];

        if (!isset($_SESSION['FAILED_LOGINS'])) {
            $_SESSION['FAILED_LOGINS'] = 0;
            $_SESSION["USERNAME_PREVIOUS1"] = "";
            $_SESSION["USERNAME_PREVIOUS2"] = "";
        }

        $sFailedLogins = $_SESSION['FAILED_LOGINS'];
        $usernamePrevious1 = $_SESSION["USERNAME_PREVIOUS1"];
        $usernamePrevious2 = $_SESSION["USERNAME_PREVIOUS2"];

        $aFields['LOGIN_VERIFY_MSG'] = G::loadTranslation('LOGIN_VERIFY_MSG');

        //start new session
        @session_destroy();
        session_start();
        session_regenerate_id();

        setcookie("workspaceSkin", SYS_SKIN, time() + (24 * 60 * 60), "/sys" . SYS_SYS, null, false, true);

        if (strlen($msg) > 0) {
            $_SESSION['G_MESSAGE'] = $msg;
        }
        if (strlen($msgType) > 0) {
            $_SESSION['G_MESSAGE_TYPE'] = $msgType;
        }

        $_SESSION['FAILED_LOGINS'] = $sFailedLogins;
        $_SESSION["USERNAME_PREVIOUS1"] = $usernamePrevious1;
        $_SESSION["USERNAME_PREVIOUS2"] = $usernamePrevious2;

        /*----------------------------------********---------------------------------*/
        if (!class_exists('pmLicenseManager')) {
            G::LoadClass('pmLicenseManager');
        }
        $licenseManager =& \pmLicenseManager::getSingleton();
        if (in_array(md5($licenseManager->result), array('38afd7ae34bd5e3e6fc170d8b09178a3', 'ba2b45bdc11e2a4a6e86aab2ac693cbb'))) {
            $G_PUBLISH = new \Publisher();
            $G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/licenseExpired', '', array(), 'licenseUpdate');
            G::RenderPage('publish');
            die();
        }
        /*----------------------------------********---------------------------------*/

        try {
            $oatoken = new \OauthAccessTokens();
            $result = $oatoken->remove($oauthAccessTokenId);

            $response["status"] = "OK";
        } catch (Exception $e) {
            $response["status"]  = "ERROR";
            $response["message"] = $e->getMessage();
        }
        return $response;

    }
Example #17
0
 /**
  * Function printForm
  * @access public
  * @param string $filename
  * @param array $data
  * @return void
  */
 function printForm($filename, $data = array())
 {
     //    $G_FORM = new Form($filename, PATH_XMLFORM);
     //    echo $G_FORM->render(PATH_TPL . 'xmlform.html', $scriptContent);
     global $G_PUBLISH;
     $G_PUBLISH = new Publisher();
     $G_PUBLISH->AddContent('xmlform', 'xmlform', $filename, '', $data, $this->popupSubmit);
     G::RenderPage("publish", "blank");
 }
Example #18
0
 public function dashletInstanceForm($data)
 {
     try {
         $this->includeExtJS('dashboard/dashletInstanceForm', true, true);
         $this->setView('dashboard/dashletInstanceForm');
         if (!isset($data->DAS_INS_UID)) {
             $data->DAS_INS_UID = '';
         }
         $dashlets = $this->getDashlets();
         $this->setJSVar('storeDasUID', $dashlets);
         if ($data->DAS_INS_UID != '') {
             $this->pmDashlet->setup($data->DAS_INS_UID);
             $this->setJSVar('dashletInstance', $this->pmDashlet->getDashletInstance());
             $this->setJSVar('additionalFields', PMDashlet::getAdditionalFields(get_class($this->pmDashlet->getDashletObject())));
         } else {
             $dashletInstance = new stdclass();
             $dashletInstance->DAS_UID = $dashlets[0][0];
             $dashlet = new Dashlet();
             $dashletFields = $dashlet->load($dashletInstance->DAS_UID);
             $this->setJSVar('dashletInstance', $dashletInstance);
             $this->setJSVar('additionalFields', PMDashlet::getAdditionalFields($dashletFields['DAS_CLASS']));
         }
         G::RenderPage('publish', 'extJs');
         return null;
     } catch (Exception $error) {
         $_SESSION['__DASHBOARD_ERROR__'] = $error->getMessage();
         G::header('Location: dashletsList');
         die;
     }
 }
Example #19
0
/**
 * welcome.php for plugin er2
 *
 *
 */
try {
    /* Render page */
    $oHeadPublisher =& headPublisher::getSingleton();
    $G_MAIN_MENU = "processmaker";
    $G_ID_MENU_SELECTED = "ID_ER2_MNU_01";
    //$G_SUB_MENU             = "setup";
    //$G_ID_SUB_MENU_SELECTED = "ID_ER2_02";
    $config = array();
    $config["pageSize"] = 15;
    $config["message"] = "Hello world!";
    $config["ws"] = $_SESSION["WORKSPACE"];
    $config["skin"] = $_SESSION["currentSkin"];
    $config["action"] = "draft";
    $oHeadPublisher->addContent("er2/er2StartCase");
    //Adding a html file .html
    $oHeadPublisher->addExtJsScript("er2/er2StartCase", false);
    //Adding a javascript file .js
    $oHeadPublisher->assign("CONFIG", $config);
    G::RenderPage("publish", "extJs");
} catch (Exception $e) {
    $G_PUBLISH = new Publisher();
    $aMessage["MESSAGE"] = $e->getMessage();
    $G_PUBLISH->AddContent("xmlform", "xmlform", "er2/messageShow", "", $aMessage);
    G::RenderPage("publish", "blank");
}
 /**
  * Prints the Dynaform in format HTML
  *
  * @param object $A
  * @return array
  */
 public function render_htmledit($A)
 {
     $script = '';
     $file = G::decrypt($A, URL_KEY);
     ob_start();
     global $G_PUBLISH;
     $form = new Form($file, PATH_DYNAFORM, SYS_LANG, true);
     $G_PUBLISH = new Publisher();
     $G_PUBLISH->publisherId = '';
     $html = $this->get_htmlcode($A);
     if (!is_string($html)) {
         $error = $html;
         $html = '';
     } else {
         $error = 0;
     }
     $HtmlEditor = array('URL' => $A, 'HTML' => $html, 'DYN_UID' => $file);
     $G_PUBLISH->AddContent('xmlform', 'xmlform', 'dynaforms/dynaforms_HtmlEditor', '', $HtmlEditor, '', '');
     G::RenderPage("publish", 'raw');
     return array('error' => $error, 'html' => ob_get_clean());
 }
        case -1:
            G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
            G::header('location: ../login/login');
            die;
            break;
        case -2:
            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;
    }
}
if (($RBAC_Response = $RBAC->userCanAccess("PM_USERS")) != 1) {
    return $RBAC_Response;
}
$dept = new Department();
$DptoUid = isset($_GET['UID']) ? urldecode($_GET['UID']) : '';
if ($DptoUid) {
    $aFields = $dept->Load($DptoUid);
} else {
    $aFields = array();
}
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'departments/departments_Edit', '', $aFields, 'departments_Save');
G::RenderPage("publish", "raw");
 public function render($type = 'mvc')
 {
     G::RenderPage('publish', $type, null, $this->layout);
 }
Example #23
0
            }
        }
    } else {
        list($gridName, $gridId) = explode('-', $table['ADD_TAB_GRID']);
        $G_FORM = new Form($table['PRO_UID'] . '/' . $gridId, PATH_DYNAFORM, SYS_LANG, false);
        $gridFields = $G_FORM->getVars(false);
        foreach ($gridFields as $gfield) {
            if (!in_array($gfield['sName'], $tableFields)) {
                $fieldsList[] = array('FIELD_UID' => $gfield['sName'] . '-' . $gfield['sType'], 'FIELD_NAME' => $gfield['sName']);
            }
        }
    }
    $oHeadPublisher->assign('avFieldsList', $fieldsList);
}
$repTabPluginPermissions = false;
global $G_TMP_MENU;
$oMenu = new Menu();
$oMenu->load('setup');
foreach ($oMenu->Options as $i => $option) {
    if ($oMenu->Types[$i] == 'private' && $oMenu->Id[$i] == 'PLUGIN_REPTAB_PERMISSIONS') {
        $repTabPluginPermissions = array();
        $repTabPluginPermissions['label'] = $oMenu->Labels[$i];
        $repTabPluginPermissions['fn'] = $oMenu->Options[$i];
        break;
    }
}
$oHeadPublisher->assign('_plugin_permissions', $repTabPluginPermissions);
$oHeadPublisher->assign('PRO_UID', isset($_GET['PRO_UID']) ? $_GET['PRO_UID'] : false);
$oHeadPublisher->assign('TABLE', $table);
G::RenderPage('publish', 'extJs');
Example #24
0
<?php

switch ($RBAC->userCanAccess('PM_SUPERVISOR')) {
    case -2:
        G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels');
        G::header('location: ../login/login');
        die;
        break;
    case -1:
        G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
        G::header('location: ../login/login');
        die;
        break;
}
if (($RBAC_Response = $RBAC->userCanAccess("PM_USERS")) != 1) {
    return $RBAC_Response;
}
$G_MAIN_MENU = 'processmaker';
$G_SUB_MENU = 'cases';
$G_ID_MENU_SELECTED = 'CASES';
$G_ID_SUB_MENU_SELECTED = 'CASES_TO_REVISE';
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent('view', 'cases/cases_toRevise');
$G_PUBLISH->AddContent('smarty', 'cases/cases_toReviseIn', '', '', array());
G::RenderPage("publish-treeview");
 /**
  * get setup Plugins
  *
  * @param unknown_type $default
  * @return void
  */
 function setupPlugins()
 {
     try {
         $iPlugins = 0;
         G::LoadClass('serverConfiguration');
         $oServerConf =& serverConf::getSingleton();
         $oServerConf->addPlugin(SYS_SYS, $this->_aPluginDetails);
         foreach ($this->_aPluginDetails as $namespace => $detail) {
             if (isset($detail->enabled) && $detail->enabled) {
                 if (!empty($detail->sFilename) && file_exists($detail->sFilename)) {
                     if (strpos($detail->sFilename, PATH_SEP) !== false) {
                         $aux = explode(PATH_SEP, $detail->sFilename);
                     } else {
                         $aux = explode(chr(92), $detail->sFilename);
                     }
                     $sFilename = PATH_PLUGINS . $aux[count($aux) - 1];
                     if (!file_exists($sFilename)) {
                         continue;
                     }
                     require_once $sFilename;
                     if (class_exists($detail->sClassName)) {
                         $oPlugin = new $detail->sClassName($detail->sNamespace, $detail->sFilename);
                         $this->_aPlugins[$detail->sNamespace] = $oPlugin;
                         $iPlugins++;
                         $oPlugin->setup();
                     }
                 }
             }
         }
         $this->eevalidate();
         return $iPlugins;
     } catch (Exception $e) {
         global $G_PUBLISH;
         $aMessage['MESSAGE'] = $e->getMessage();
         $G_PUBLISH = new Publisher();
         $G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $aMessage);
         G::RenderPage('publish');
         die;
     }
 }
 /**
  * eventsList
  *
  * @param string $sProcessUID
  * @param string $type
  * @return boolean true
  * throw Exception $oError
  */
 public function eventsList($sProcessUID, $type)
 {
     try {
         global $G_PUBLISH;
         $G_PUBLISH = new Publisher();
         $oHeadPublisher =& headPublisher::getSingleton();
         $oHeadPublisher->addScriptFile('/jscore/events/events.js');
         switch ($type) {
             case 'message':
                 $EVN_ACTION = "SEND_MESSAGE";
                 break;
             case 'conditional':
                 $EVN_ACTION = "EXECUTE_CONDITIONAL_TRIGGER";
                 break;
             case 'multiple':
                 $EVN_ACTION = "EXECUTE_TRIGGER";
                 break;
         }
         $oCriteria = $this->getEventsCriteria($sProcessUID, $EVN_ACTION);
         $G_PUBLISH->AddContent('propeltable', 'paged-table', 'events/eventsShortList', $oCriteria, array('PRO_UID' => $sProcessUID, 'EVN_TYPE' => $EVN_ACTION));
         G::RenderPage('publish', 'raw');
         return true;
     } catch (Exception $oError) {
         throw $oError;
     }
 }
Example #27
0
    if (substr($LABEL_TRANSLATION, 0, 2) !== "**") {
        $title = $LABEL_TRANSLATION;
    } else {
        $title = str_replace("_", " ", ucwords($menuType));
    }
    $tabItems[$i]->title = $title;
    $i++;
}
///////
$tabActive = "";
if ($adminSelected != null) {
    foreach ($oMenu->Options as $i => $option) {
        if ($oMenu->Id[$i] == $adminSelected) {
            $tabActive = in_array($oMenu->Types[$i], array("", "admToolsContent")) ? "plugins" : $oMenu->Types[$i];
            break;
        }
    }
}
///////
$oHeadPublisher->addExtJsScript("setup/main", true);
//adding a javascript file .js
$oHeadPublisher->addContent("setup/main");
//adding a html file .html.
$oHeadPublisher->assign("tabActive", $tabActive);
$oHeadPublisher->assign("tabItems", $tabItems);
$oHeadPublisher->assign("_item_selected", $adminSelected != null ? $adminSelected : "");
G::RenderPage("publish", "extJs");
//this patch enables the load of the plugin list panel inside de main admin panel iframe
if (isset($_GET["action"]) && $_GET["action"] == "pluginsList") {
    echo "\n  <script type=\"text/javascript\">\n  document.getElementById(\"setup-frame\").src = \"pluginsList\";\n  </script>\n  ";
}
Example #28
0
<?php

switch ($_SERVER['REQUEST_METHOD']) {
    case 'GET':
        $G_PUBLISH = new Publisher();
        $tpl = array_key_exists('l', $_GET) ? 'oauth2/registration_done' : 'oauth2/register';
        $G_PUBLISH->AddContent('view', $tpl);
        G::RenderPage('publish', 'minimal');
        break;
    case 'POST':
        $data = $_POST['form'];
        $clientId = G::generateCode(32, 'ALPHA');
        $secret = G::generateUniqueID();
        $client = new OauthClients();
        $client->setClientId($clientId);
        $client->setClientSecret($secret);
        $client->setClientName($data['name']);
        $client->setClientDescription($data['description']);
        $client->setClientWebsite($data['web_site']);
        $client->setRedirectUri($data['callback_url']);
        $client->setUsrUid($_SESSION['USER_LOGGED']);
        $client->save();
        $data['clientId'] = $clientId;
        $data['secret'] = $secret;
        header('location: register?l=' . base64_encode(json_encode($data)));
        break;
}
Example #29
0
	$row=$query->read();
	$vrow=array($row['CAPTION']);
	$vrow[]='<a href="#" onclick="deleteLocation(\''.$row['UID'].'\')">'.G::LoadTranslation('ID_DELETE').'</a>';
	$table->addRow($r,$vrow);
}
$table->addRowTag($r,'lastRow','','');
	$table->addRow($r,
		array(
			$table->getBlock('text',array('value' => '', 'properties' => 'id="newLocation"')),
			'<a href="#" onclick="addLocation();">'.G::LoadTranslation('ID_ADD').'</a>'
			));
*/
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'setup/location', '', $param);
//$G_PUBLISH->AddContent('template', '', '', '', $table->tpl);
G::RenderPage('publish');
?>

<script language="javascript">
rowNumber=<?php 
echo $r;
?>
;
attachFunctionEventOnChange(document.getElementById('form[USR_CITY]'),changeRegion);
attachFunctionEventOnChange(document.getElementById('form[USR_COUNTRY]'),changeRegion);
function changeCity()
{
	var country=document.getElementById('form[USR_COUNTRY]');
	var city=document.getElementById('form[USR_CITY]');
	ajax_function('<?php 
echo G::encryptLink('cityAjax.php');
Example #30
0
    public function dynaformViewFromHistory()
    {
        ?>
        <link rel="stylesheet" type="text/css" href="/css/classic.css" />

        <script type="text/javascript">
            //!Code that simulated reload library javascript maborak
            var leimnud = {};
            leimnud.exec = "";
            leimnud.fix = {};
            leimnud.fix.memoryLeak = "";
            leimnud.browser = {};
            leimnud.browser.isIphone = "";
            leimnud.iphone = {};
            leimnud.iphone.make = function() {
            };
            function ajax_function(ajax_server, funcion, parameters, method)
            {
            }
            //!
        </script>

        <?php 
        global $G_PUBLISH;
        $_POST["HISTORY_ID"] = $_REQUEST["HISTORY_ID"];
        $_POST["DYN_UID"] = $_REQUEST["DYN_UID"];
        $G_PUBLISH = new Publisher();
        $FieldsHistory = unserialize($_SESSION["HISTORY_DATA"]);
        $Fields["APP_DATA"] = $FieldsHistory[$_POST["HISTORY_ID"]];
        //isset($FieldsHistory[$_POST["HISTORY_ID"]])? $FieldsHistory[$_POST["HISTORY_ID"]] : "";
        $Fields["APP_DATA"]["__DYNAFORM_OPTIONS"]["PREVIOUS_STEP_LABEL"] = "";
        $Fields["APP_DATA"]["__DYNAFORM_OPTIONS"]["NEXT_STEP_LABEL"] = "";
        $Fields["APP_DATA"]["__DYNAFORM_OPTIONS"]["NEXT_STEP"] = "#";
        $Fields["APP_DATA"]["__DYNAFORM_OPTIONS"]["NEXT_ACTION"] = "return false;";
        $G_PUBLISH->AddContent("dynaform", "xmlform", $_SESSION["PROCESS"] . "/" . $_POST["DYN_UID"], "", $Fields["APP_DATA"], "", "", "view");
        ?>

        <script type="text/javascript">

        <?php 
        global $G_FORM;
        ?>

            function loadForm_<?php 
        echo $G_FORM->id;
        ?>
(parametro1) {
            }
        </script>

        <?php 
        G::RenderPage("publish", "raw");
        ?>

        <style type="text/css">
            html {
                color: black !important;
            }

            body {
                color: black !important;
            }
        </style>

        <script type="text/javascript">

        <?php 
        global $G_FORM;
        ?>

            function loadForm_<?php 
        echo $G_FORM->id;
        ?>
(parametro1) {
            }
        </script>

        <?php 
    }