コード例 #1
0
 * 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_PUBLISH = new Publisher();
$fileGetStart = PATH_SKINS . SYS_SKIN . PATH_SEP . 'login_getStarted.html';
if (!file_exists($fileGetStart)) {
    $fileGetStart = PATH_SKIN_ENGINE . SYS_SKIN . PATH_SEP . 'login_getStarted.html';
    if (!file_exists($fileGetStart)) {
        $fileGetStart = PATH_CUSTOM_SKINS . SYS_SKIN . PATH_SEP . 'login_getStarted.html';
        if (!file_exists($fileGetStart)) {
            $fileGetStart = PATH_TPL . 'services/login_getStarted.html';
        }
    }
}
$oTemplatePower = new TemplatePower($fileGetStart);
$oTemplatePower->prepare();
/*
$oTemplatePower->newBlock('users');
$oTemplatePower->assign('USR_UID', $aUser['USR_UID']);
$oTemplatePower->assign('USR_FULLNAME', $aData['USR_FIRSTNAME'] . ' ' . $aData['USR_LASTNAME'] . ' (' . $aData['USR_USERNAME'] . ')');
*/
$oTemplatePower->assign("URL_MABORAK_JS", G::browserCacheFilesUrl("/js/maborak/core/maborak.js"));
$G_PUBLISH->AddContent('template', '', '', '', $oTemplatePower);
G::RenderPage('publish', 'raw');
コード例 #2
0
 } else {
     $G_FORM = new Form($sPRO_UID . '/' . $sDYNAFORM, PATH_DYNAFORM, SYS_LANG, false);
     $G_FORM->action = $http . $_SERVER['HTTP_HOST'] . '/sys' . SYS_SYS . '/' . SYS_LANG . '/' . SYS_SKIN . '/services/cases_StartExternal.php';
     $scriptCode = '';
     $scriptCode = $G_FORM->render(PATH_CORE . 'templates/' . 'xmlform' . '.html', $scriptCode);
     $scriptCode = str_replace('/controls/', $http . $_SERVER['HTTP_HOST'] . '/controls/', $scriptCode);
     $scriptCode = str_replace('/js/maborak/core/images/', $http . $_SERVER['HTTP_HOST'] . '/js/maborak/core/images/', $scriptCode);
     //render the template
     $pluginTpl = PATH_CORE . 'templates' . PATH_SEP . 'processes' . PATH_SEP . 'webentry.tpl';
     $template = new TemplatePower($pluginTpl);
     $template->prepare();
     require_once 'classes/model/Step.php';
     $oStep = new Step();
     $sUidGrids = $oStep->lookingforUidGrids($sPRO_UID, $sDYNAFORM);
     $template->assign("URL_MABORAK_JS", G::browserCacheFilesUrl("/js/maborak/core/maborak.js"));
     $template->assign("URL_TRANSLATION_ENV_JS", G::browserCacheFilesUrl("/jscore/labels/" . SYS_LANG . ".js"));
     $template->assign("siteUrl", $http . $_SERVER["HTTP_HOST"]);
     $template->assign("sysSys", SYS_SYS);
     $template->assign("sysLang", SYS_LANG);
     $template->assign("sysSkin", SYS_SKIN);
     $template->assign("processUid", $sPRO_UID);
     $template->assign("dynaformUid", $sDYNAFORM);
     $template->assign("taskUid", $sTASKS);
     $template->assign("dynFileName", $sPRO_UID . "/" . $sDYNAFORM);
     $template->assign("formId", $G_FORM->id);
     $template->assign("scriptCode", $scriptCode);
     if (sizeof($sUidGrids) > 0) {
         foreach ($sUidGrids as $k => $v) {
             $template->newBlock('grid_uids');
             $template->assign('siteUrl', $http . $_SERVER['HTTP_HOST']);
             $template->assign('gridFileName', $sPRO_UID . '/' . $v);
コード例 #3
0
ファイル: installer.php プロジェクト: nhenderson/processmaker
    public function forceTogenerateTranslationsFiles ($url)

    {

        $ch = curl_init();

        curl_setopt($ch, CURLOPT_URL, G::browserCacheFilesUrl((isset($_SERVER["HTTPS"])? (($_SERVER["HTTPS"] != "")? "https://" : "http://") : "http://") . $_SERVER["HTTP_HOST"] . "/js/ext/translation.en.js?r=" . rand(1, 10000)));

        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

        curl_setopt($ch, CURLOPT_FRESH_CONNECT, 1);

        curl_setopt($ch, CURLOPT_TIMEOUT, 60);

        curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 20);

        curl_exec($ch);

        curl_close($ch);

    }
コード例 #4
0
 public function getExtJsLibraries()
 {
     $script = '';
     if (isset($this->extJsLibrary) && is_array($this->extJsLibrary)) {
         foreach ($this->extJsLibrary as $file) {
             $script .= "  <script type='text/javascript' src='/js/ext/" . $file . ".js'></script>\n";
         }
     }
     if (!in_array($this->translationsFile, $this->extJsLibrary)) {
         $script = $script . "  <script type=\"text/javascript\" src=\"" . G::browserCacheFilesUrl($this->translationsFile) . "\"></script>\n";
     }
     return $script;
 }
コード例 #5
0
ファイル: WebEntry.php プロジェクト: emildev35/processmaker
 /**
  * Set value in WE_DATA
  *
  * @param string $webEntryUid Unique id of Web Entry
  *
  * return void
  */
 public function setWeData($webEntryUid)
 {
     try {
         //Verify data
         $this->throwExceptionIfNotExistsWebEntry($webEntryUid, $this->arrayFieldNameForException["webEntryUid"]);
         //Set variables
         $arrayWebEntryData = $this->getWebEntry($webEntryUid, true);
         $processUid = $arrayWebEntryData["PRO_UID"];
         $taskUid = $arrayWebEntryData["TAS_UID"];
         $dynaFormUid = $arrayWebEntryData["DYN_UID"];
         $webEntryMethod = $arrayWebEntryData["WE_METHOD"];
         $webEntryInputDocumentAccess = $arrayWebEntryData["WE_INPUT_DOCUMENT_ACCESS"];
         $webEntryData = "";
         $wsRoundRobin = 0;
         //0, 1 //0 - Cyclical Assignment
         $pathDataPublicProcess = PATH_DATA_PUBLIC . $processUid;
         //Delete previous files
         if (trim($arrayWebEntryData["WE_DATA"]) != "") {
             $fileName = str_replace(".php", "", trim($arrayWebEntryData["WE_DATA"]));
             $file = $pathDataPublicProcess . PATH_SEP . $fileName . ".php";
             if (is_file($file) && file_exists($file)) {
                 unlink($file);
                 unlink($pathDataPublicProcess . PATH_SEP . $fileName . "Post.php");
             }
         }
         //Create files
         \G::mk_dir($pathDataPublicProcess, 0777);
         $http = \G::is_https() ? "https://" : "http://";
         switch ($webEntryMethod) {
             case "WS":
                 require_once PATH_RBAC . "model" . PATH_SEP . "RbacUsers.php";
                 $user = new \RbacUsers();
                 $arrayUserData = $user->load($arrayWebEntryData["USR_UID"]);
                 $usrUsername = $arrayUserData["USR_USERNAME"];
                 $usrPassword = $arrayUserData["USR_PASSWORD"];
                 $dynaForm = new \Dynaform();
                 $arrayDynaFormData = $dynaForm->Load($arrayWebEntryData["DYN_UID"]);
                 //Creating sys.info;
                 $sitePublicPath = "";
                 if (file_exists($sitePublicPath . "")) {
                 }
                 //Creating the first file
                 $weTitle = $this->sanitizeFilename($arrayWebEntryData["WE_TITLE"]);
                 $fileName = $weTitle;
                 $fileContent = "<?php\n";
                 $fileContent .= "global \$_DBArray;\n";
                 $fileContent .= "if (!isset(\$_DBArray)) {\n";
                 $fileContent .= "  \$_DBArray = array();\n";
                 $fileContent .= "}\n";
                 $fileContent .= "\$_SESSION[\"PROCESS\"] = \"" . $processUid . "\";\n";
                 $fileContent .= "\$_SESSION[\"CURRENT_DYN_UID\"] = \"" . $dynaFormUid . "\";\n";
                 $fileContent .= "\$G_PUBLISH = new Publisher();\n";
                 $fileContent .= "G::LoadClass(\"pmDynaform\");\n";
                 $fileContent .= "\$a = new pmDynaform(array(\"CURRENT_DYNAFORM\" => \"" . $arrayWebEntryData["DYN_UID"] . "\"));\n";
                 $fileContent .= "if (\$a->isResponsive()) {";
                 $fileContent .= "  \$a->printWebEntry(\"" . $fileName . "Post.php\");";
                 $fileContent .= "} else {";
                 $fileContent .= "  \$G_PUBLISH->AddContent(\"dynaform\", \"xmlform\", \"" . $processUid . PATH_SEP . $dynaFormUid . "\", \"\", array(), \"" . $fileName . "Post.php\");\n";
                 $fileContent .= "  G::RenderPage(\"publish\", \"blank\");";
                 $fileContent .= "}";
                 file_put_contents($pathDataPublicProcess . PATH_SEP . $fileName . ".php", $fileContent);
                 //Creating the second file, the  post file who receive the post form.
                 $pluginTpl = PATH_TPL . "processes" . PATH_SEP . "webentryPost.tpl";
                 $template = new \TemplatePower($pluginTpl);
                 $template->prepare();
                 $template->assign("wsdlUrl", $http . $_SERVER["HTTP_HOST"] . "/sys" . SYS_SYS . "/" . SYS_LANG . "/" . SYS_SKIN . "/services/wsdl2");
                 $template->assign("wsUploadUrl", $http . $_SERVER["HTTP_HOST"] . "/sys" . SYS_SYS . "/" . SYS_LANG . "/" . SYS_SKIN . "/services/upload");
                 $template->assign("processUid", $processUid);
                 $template->assign("dynaformUid", $dynaFormUid);
                 $template->assign("taskUid", $taskUid);
                 $template->assign("wsUser", $usrUsername);
                 $template->assign("wsPass", \Bootstrap::getPasswordHashType() . ':' . $usrPassword);
                 $template->assign("wsRoundRobin", $wsRoundRobin);
                 if ($webEntryInputDocumentAccess == 0) {
                     //Restricted to process permissions
                     $template->assign("USR_VAR", "\$cInfo = ws_getCaseInfo(\$caseId);\n\t  \$USR_UID = \$cInfo->currentUsers->userId;");
                 } else {
                     //No Restriction
                     $template->assign("USR_VAR", "\$USR_UID = -1;");
                 }
                 $template->assign("dynaform", $arrayDynaFormData["DYN_TITLE"]);
                 $template->assign("timestamp", date("l jS \\of F Y h:i:s A"));
                 $template->assign("ws", SYS_SYS);
                 $template->assign("version", \System::getVersion());
                 $fileName = $pathDataPublicProcess . PATH_SEP . $weTitle . "Post.php";
                 file_put_contents($fileName, $template->getOutputContent());
                 //Creating the third file, only if this wsClient.php file doesn't exist.
                 $fileName = $pathDataPublicProcess . PATH_SEP . "wsClient.php";
                 $pluginTpl = PATH_CORE . "templates" . PATH_SEP . "processes" . PATH_SEP . "wsClient.php";
                 if (file_exists($fileName)) {
                     if (filesize($fileName) != filesize($pluginTpl)) {
                         copy($fileName, $pathDataPublicProcess . PATH_SEP . "wsClient.php.bak");
                         unlink($fileName);
                         $template = new \TemplatePower($pluginTpl);
                         $template->prepare();
                         file_put_contents($fileName, $template->getOutputContent());
                     }
                 } else {
                     $template = new \TemplatePower($pluginTpl);
                     $template->prepare();
                     file_put_contents($fileName, $template->getOutputContent());
                 }
                 //Event
                 $task = new \Task();
                 $arrayTaskData = $task->load($arrayWebEntryData["TAS_UID"]);
                 $weEventUid = $task->getStartingEvent();
                 if ($weEventUid != "") {
                     $event = new \Event();
                     $arrayEventData = array();
                     $arrayEventData["EVN_UID"] = $weEventUid;
                     $arrayEventData["EVN_RELATED_TO"] = "MULTIPLE";
                     $arrayEventData["EVN_ACTION"] = $dynaFormUid;
                     $arrayEventData["EVN_CONDITIONS"] = $usrUsername;
                     $result = $event->update($arrayEventData);
                 }
                 //WE_DATA
                 $webEntryData = $weTitle . ".php";
                 break;
             case "HTML":
                 global $G_FORM;
                 if (!class_exists("Smarty")) {
                     $loader = \Maveriks\Util\ClassLoader::getInstance();
                     $loader->addClass("Smarty", PATH_THIRDPARTY . "smarty" . PATH_SEP . "libs" . PATH_SEP . "Smarty.class.php");
                 }
                 $G_FORM = new \Form($processUid . "/" . $dynaFormUid, PATH_DYNAFORM, SYS_LANG, false);
                 $G_FORM->action = $http . $_SERVER["HTTP_HOST"] . "/sys" . SYS_SYS . "/" . SYS_LANG . "/" . SYS_SKIN . "/services/cases_StartExternal.php";
                 $scriptCode = "";
                 $scriptCode = $G_FORM->render(PATH_TPL . "xmlform" . ".html", $scriptCode);
                 $scriptCode = str_replace("/controls/", $http . $_SERVER["HTTP_HOST"] . "/controls/", $scriptCode);
                 $scriptCode = str_replace("/js/maborak/core/images/", $http . $_SERVER["HTTP_HOST"] . "/js/maborak/core/images/", $scriptCode);
                 //Render the template
                 $pluginTpl = PATH_TPL . "processes" . PATH_SEP . "webentry.tpl";
                 $template = new \TemplatePower($pluginTpl);
                 $template->prepare();
                 $step = new \Step();
                 $sUidGrids = $step->lookingforUidGrids($processUid, $dynaFormUid);
                 $template->assign("URL_MABORAK_JS", \G::browserCacheFilesUrl("/js/maborak/core/maborak.js"));
                 $template->assign("URL_TRANSLATION_ENV_JS", \G::browserCacheFilesUrl("/jscore/labels/" . SYS_LANG . ".js"));
                 $template->assign("siteUrl", $http . $_SERVER["HTTP_HOST"]);
                 $template->assign("sysSys", SYS_SYS);
                 $template->assign("sysLang", SYS_LANG);
                 $template->assign("sysSkin", SYS_SKIN);
                 $template->assign("processUid", $processUid);
                 $template->assign("dynaformUid", $dynaFormUid);
                 $template->assign("taskUid", $taskUid);
                 $template->assign("dynFileName", $processUid . "/" . $dynaFormUid);
                 $template->assign("formId", $G_FORM->id);
                 $template->assign("scriptCode", $scriptCode);
                 if (sizeof($sUidGrids) > 0) {
                     foreach ($sUidGrids as $k => $v) {
                         $template->newBlock("grid_uids");
                         $template->assign("siteUrl", $http . $_SERVER["HTTP_HOST"]);
                         $template->assign("gridFileName", $processUid . "/" . $v);
                     }
                 }
                 //WE_DATA
                 $html = str_replace("</body>", "</form></body>", str_replace("</form>", "", $template->getOutputContent()));
                 $webEntryData = $html;
                 break;
         }
         //Update
         //Update where
         $criteriaWhere = new \Criteria("workflow");
         $criteriaWhere->add(\WebEntryPeer::WE_UID, $webEntryUid);
         //Update set
         $criteriaSet = new \Criteria("workflow");
         $criteriaSet->add(\WebEntryPeer::WE_DATA, $webEntryData);
         \BasePeer::doUpdate($criteriaWhere, $criteriaSet, \Propel::getConnection("workflow"));
     } catch (\Exception $e) {
         throw $e;
     }
 }
コード例 #6
0
ファイル: main.php プロジェクト: emildev35/processmaker
 /**
  * SysLogin
  */
 public function sysLogin()
 {
     require_once "propel/Propel.php";
     require_once "creole/Creole.php";
     G::LoadClass('system');
     G::LoadThirdParty("pake", "pakeColor.class");
     Propel::init(PATH_CORE . "config/databases.php");
     Creole::registerDriver('dbarray', 'creole.contrib.DBArrayConnection');
     // getting posibles errors passed by GET method
     $this->getInUrlError();
     $availableWorkspace = $this->getWorkspacesAvailable();
     $availableWorkspaceList = array();
     foreach ($availableWorkspace as $ws) {
         $availableWorkspaceList[] = array($ws, $ws);
     }
     $aField['LOGIN_VERIFY_MSG'] = G::loadTranslation('LOGIN_VERIFY_MSG');
     //Get Server Configuration
     G::LoadClass('serverConfiguration');
     $oServerConf =& serverConf::getSingleton();
     $availableLangArray = $this->getLanguagesList();
     $this->includeExtJSLib('ux/virtualkeyboard');
     $this->setJSVar('sysLang', SYS_LANG);
     $this->includeExtJS('main/sysLogin');
     $this->setVar('logo_company', $this->getCompanyLogo());
     $this->setVar('pmos_version', System::getVersion());
     $footerText = G::LoadTranslation('ID_COPYRIGHT_FROM') . date('Y') . G::LoadTranslation('ID_COPYRIGHT_COL');
     $adviseText = G::LoadTranslation('ID_COLOSA_AND_CERTIFIED_PARTNERS');
     $this->setVar('footer_text', $footerText);
     $this->setVar('advise_text', $adviseText);
     //binding G::SendTemporalMessage() to Ext.msgBoxSlider.msgTopCenter()
     if (($flyNotify = $this->getFlyNotify()) !== false) {
         $this->setJSVar('flyNotify', $flyNotify);
     }
     $this->setJSVar('languages', $availableLangArray);
     $this->setJSVar('workspaces', $availableWorkspaceList);
     $this->setJSVar('wsPrivate', $oServerConf->getProperty('LOGIN_NO_WS'));
     $this->setJSVar('defaultLang', 'en');
     $this->setJSVar('defaultWS', '');
     $loginScript = $this->getHeadPublisher()->getExtJsLibraries();
     $loginScript .= $this->getHeadPublisher()->getExtJsScripts();
     $this->setVar("login_script", $loginScript);
     $this->setVar("login_vars", $this->getHeadPublisher()->getExtJsVariablesScript());
     $this->setVar("URL_TRANSLATION_JS", G::browserCacheFilesUrl("/js/ext/translation.en.js"));
     $this->setLayout("pm-modern-login");
     $this->render();
 }