当前位置: 首页>>代码示例>>PHP>>正文


PHP ConfigurationPeer::doCount方法代码示例

本文整理汇总了PHP中ConfigurationPeer::doCount方法的典型用法代码示例。如果您正苦于以下问题:PHP ConfigurationPeer::doCount方法的具体用法?PHP ConfigurationPeer::doCount怎么用?PHP ConfigurationPeer::doCount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ConfigurationPeer的用法示例。


在下文中一共展示了ConfigurationPeer::doCount方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: putTypeView

function putTypeView()
{
    require_once 'classes/model/Configuration.php';
    $oConfiguration = new Configuration();
    $oCriteria = new Criteria('workflow');
    $oCriteria->add(ConfigurationPeer::CFG_UID, 'StartNewCase');
    $oCriteria->add(ConfigurationPeer::USR_UID, $_SESSION['USER_LOGGED']);
    if (ConfigurationPeer::doCount($oCriteria)) {
        $conf = ConfigurationPeer::doSelect($oCriteria);
        return $conf[0]->getCfgValue();
    } else {
        return 'dropdown';
    }
}
开发者ID:emildev35,项目名称:processmaker,代码行数:14,代码来源:cases_New.php

示例2: Criteria

$oCriteria = new Criteria ( 'workflow' );

$oCriteria->add(ConfigurationPeer::CFG_UID, 'getStarted');

$oCriteria->add(ConfigurationPeer::OBJ_UID, '');

$oCriteria->add(ConfigurationPeer::CFG_VALUE, '1');

$oCriteria->add(ConfigurationPeer::PRO_UID, '');

$oCriteria->add(ConfigurationPeer::USR_UID, '');

$oCriteria->add(ConfigurationPeer::APP_UID, '');

$flagGettingStarted =  ConfigurationPeer::doCount($oCriteria);

if ($flagGettingStarted == 0) {

    $oHeadPublisher->addScriptCode('var flagGettingStarted = 1;');

} else {

    $oHeadPublisher->addScriptCode('var flagGettingStarted = 0;');

}



$dummy = '';
开发者ID:rrsc,项目名称:processmaker,代码行数:29,代码来源:login.php

示例3: get_object_vars

            $aFields = get_object_vars($oProcesses->ws_processGetData($oData->pro_uid));

            $aFields['description'] = nl2br($aFields['description']);
            $aFields['installSteps'] = nl2br($aFields['installSteps']);
            switch ($aFields['privacy']) {
                case 'FREE':
                    $aFields['link_label'] = G::LoadTranslation('ID_DOWNLOAD');
                    $aFields['link_href'] = '../processes/downloadPML?id=' . $oData->pro_uid . '&s=' . $sessionId;
                    break;
                case 'PUBLIC':
                    require_once 'classes/model/Configuration.php';
                    $oCriteria = new Criteria('workflow');
                    $oCriteria->addSelectColumn(ConfigurationPeer::CFG_VALUE);
                    $oCriteria->add(ConfigurationPeer::CFG_UID, 'REGISTER_INFORMATION');
                    $oCriteria->add(ConfigurationPeer::USR_UID, $_SESSION['USER_LOGGED']);
                    if (ConfigurationPeer::doCount($oCriteria) > 0) {
                        $oDataset = ConfigurationPeer::doSelectRS($oCriteria);
                        $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
                        $oDataset->next();
                        $aRow = $oDataset->getRow();
                        $aRI = unserialize($aRow['CFG_VALUE']);
                        try {
                            if ($oProcesses->ws_open($aRI['u'], $aRI['p']) == 1) {
                                $bExists = true;
                            } else {
                                $bExists = false;
                            }
                        } catch (Exception $oException) {
                            $bExists = false;
                        }
                        if ($bExists) {
开发者ID:hpx2206,项目名称:processmaker-1,代码行数:31,代码来源:processes_Ajax.php

示例4: sendNoteNotification

 public function sendNoteNotification($appUid, $usrUid, $noteContent, $noteRecipients, $sFrom = "")
 {
     try {
         require_once 'classes/model/Configuration.php';
         $oConfiguration = new Configuration();
         $sDelimiter = DBAdapter::getStringDelimiter();
         $oCriteria = new Criteria('workflow');
         $oCriteria->add(ConfigurationPeer::CFG_UID, 'Emails');
         $oCriteria->add(ConfigurationPeer::OBJ_UID, '');
         $oCriteria->add(ConfigurationPeer::PRO_UID, '');
         $oCriteria->add(ConfigurationPeer::USR_UID, '');
         $oCriteria->add(ConfigurationPeer::APP_UID, '');
         if (ConfigurationPeer::doCount($oCriteria) == 0) {
             $oConfiguration->create(array('CFG_UID' => 'Emails', 'OBJ_UID' => '', 'CFG_VALUE' => '', 'PRO_UID' => '', 'USR_UID' => '', 'APP_UID' => ''));
             $aConfiguration = array();
         } else {
             $aConfiguration = $oConfiguration->load('Emails', '', '', '', '');
             if ($aConfiguration['CFG_VALUE'] != '') {
                 $aConfiguration = unserialize($aConfiguration['CFG_VALUE']);
                 $passwd = $aConfiguration['MESS_PASSWORD'];
                 $passwdDec = G::decrypt($passwd, 'EMAILENCRYPT');
                 $auxPass = explode('hash:', $passwdDec);
                 if (count($auxPass) > 1) {
                     if (count($auxPass) == 2) {
                         $passwd = $auxPass[1];
                     } else {
                         array_shift($auxPass);
                         $passwd = implode('', $auxPass);
                     }
                 }
                 $aConfiguration['MESS_PASSWORD'] = $passwd;
             } else {
                 $aConfiguration = array();
             }
         }
         if (!isset($aConfiguration['MESS_ENABLED']) || $aConfiguration['MESS_ENABLED'] != '1') {
             return false;
         }
         $oUser = new Users();
         $aUser = $oUser->load($usrUid);
         $authorName = ($aUser['USR_FIRSTNAME'] != '' || $aUser['USR_LASTNAME'] != '' ? $aUser['USR_FIRSTNAME'] . ' ' . $aUser['USR_LASTNAME'] . ' ' : '') . '<' . $aUser['USR_EMAIL'] . '>';
         G::LoadClass('case');
         $oCase = new Cases();
         $aFields = $oCase->loadCase($appUid);
         $configNoteNotification['subject'] = G::LoadTranslation('ID_MESSAGE_SUBJECT_NOTE_NOTIFICATION') . " @#APP_TITLE ";
         $configNoteNotification['body'] = G::LoadTranslation('ID_CASE') . ": @#APP_TITLE<br />" . G::LoadTranslation('ID_AUTHOR') . ": {$authorName}<br /><br />{$noteContent}";
         /*
         if ($sFrom == '') {
             $sFrom = '"ProcessMaker"';
         }
         */
         if (isset($aConfiguration['MESS_FROM_NAME']) && $aConfiguration['MESS_FROM_NAME'] != '') {
             $sFrom = $aConfiguration['MESS_FROM_NAME'];
         }
         $hasEmailFrom = preg_match('/(.+)@(.+)\\.(.+)/', $sFrom, $match);
         if (!$hasEmailFrom || strpos($sFrom, $aConfiguration['MESS_ACCOUNT']) === false) {
             if ($aConfiguration['MESS_ENGINE'] != 'MAIL' && $aConfiguration['MESS_ACCOUNT'] != '') {
                 $sFrom .= ' <' . $aConfiguration['MESS_ACCOUNT'] . '>';
             } else {
                 if ($aConfiguration['MESS_ENGINE'] == 'MAIL') {
                     $sFrom .= ' <info@' . gethostbyaddr('127.0.0.1') . '>';
                 } else {
                     if ($aConfiguration['MESS_SERVER'] != '') {
                         if ($sAux = @gethostbyaddr($aConfiguration['MESS_SERVER'])) {
                             $sFrom .= ' <info@' . $sAux . '>';
                         } else {
                             $sFrom .= ' <info@' . $aConfiguration['MESS_SERVER'] . '>';
                         }
                     } else {
                         $sFrom .= ' <info@processmaker.com>';
                     }
                 }
             }
         }
         $sSubject = G::replaceDataField($configNoteNotification['subject'], $aFields);
         $sBody = nl2br(G::replaceDataField($configNoteNotification['body'], $aFields));
         G::LoadClass('spool');
         $oUser = new Users();
         $recipientsArray = explode(",", $noteRecipients);
         foreach ($recipientsArray as $recipientUid) {
             $aUser = $oUser->load($recipientUid);
             $sTo = ($aUser['USR_FIRSTNAME'] != '' || $aUser['USR_LASTNAME'] != '' ? $aUser['USR_FIRSTNAME'] . ' ' . $aUser['USR_LASTNAME'] . ' ' : '') . '<' . $aUser['USR_EMAIL'] . '>';
             $oSpool = new spoolRun();
             if ($aConfiguration['MESS_RAUTH'] == false || is_string($aConfiguration['MESS_RAUTH']) && $aConfiguration['MESS_RAUTH'] == 'false') {
                 $aConfiguration['MESS_RAUTH'] = 0;
             } else {
                 $aConfiguration['MESS_RAUTH'] = 1;
             }
             $oSpool->setConfig(array('MESS_ENGINE' => $aConfiguration['MESS_ENGINE'], 'MESS_SERVER' => $aConfiguration['MESS_SERVER'], 'MESS_PORT' => $aConfiguration['MESS_PORT'], 'MESS_ACCOUNT' => $aConfiguration['MESS_ACCOUNT'], 'MESS_PASSWORD' => $aConfiguration['MESS_PASSWORD'], 'SMTPAuth' => $aConfiguration['MESS_RAUTH'] == '1' ? true : false, 'SMTPSecure' => isset($aConfiguration['SMTPSecure']) ? $aConfiguration['SMTPSecure'] : ''));
             $oSpool->create(array('msg_uid' => '', 'app_uid' => $appUid, 'del_index' => 0, 'app_msg_type' => 'DERIVATION', 'app_msg_subject' => $sSubject, 'app_msg_from' => $sFrom, 'app_msg_to' => $sTo, 'app_msg_body' => $sBody, 'app_msg_cc' => '', 'app_msg_bcc' => '', 'app_msg_attach' => '', 'app_msg_template' => '', 'app_msg_status' => 'pending'));
             if ($aConfiguration['MESS_BACKGROUND'] == '' || $aConfiguration['MESS_TRY_SEND_INMEDIATLY'] == '1') {
                 $oSpool->sendMail();
             }
         }
         //Send derivation notification - End
     } catch (Exception $oException) {
         throw $oException;
     }
 }
开发者ID:bqevin,项目名称:processmaker,代码行数:99,代码来源:AppNotes.php

示例5: sendNotifications

 public function sendNotifications($sCurrentTask, $aTasks, $aFields, $sApplicationUID, $iDelegation, $sFrom = "")
 {
     try {
         $applicationData = $this->loadCase($sApplicationUID);
         $aFields["APP_NUMBER"] = $applicationData["APP_NUMBER"];
         $oConfiguration = new Configuration();
         $sDelimiter = DBAdapter::getStringDelimiter();
         $oCriteria = new Criteria('workflow');
         $oCriteria->add(ConfigurationPeer::CFG_UID, 'Emails');
         $oCriteria->add(ConfigurationPeer::OBJ_UID, '');
         $oCriteria->add(ConfigurationPeer::PRO_UID, '');
         $oCriteria->add(ConfigurationPeer::USR_UID, '');
         $oCriteria->add(ConfigurationPeer::APP_UID, '');
         if (ConfigurationPeer::doCount($oCriteria) == 0) {
             $oConfiguration->create(array('CFG_UID' => 'Emails', 'OBJ_UID' => '', 'CFG_VALUE' => '', 'PRO_UID' => '', 'USR_UID' => '', 'APP_UID' => ''));
             $aConfiguration = array();
         } else {
             $aConfiguration = $oConfiguration->load('Emails', '', '', '', '');
             if ($aConfiguration['CFG_VALUE'] != '') {
                 $aConfiguration = unserialize($aConfiguration["CFG_VALUE"]);
                 $passwd = $aConfiguration["MESS_PASSWORD"];
                 $passwdDec = G::decrypt($passwd, "EMAILENCRYPT");
                 $auxPass = explode('hash:', $passwdDec);
                 if (count($auxPass) > 1) {
                     if (count($auxPass) == 2) {
                         $passwd = $auxPass[1];
                     } else {
                         array_shift($auxPass);
                         $passwd = implode('', $auxPass);
                     }
                 }
                 $aConfiguration["MESS_PASSWORD"] = $passwd;
             } else {
                 $aConfiguration = array();
             }
         }
         if (!isset($aConfiguration['MESS_ENABLED']) || $aConfiguration['MESS_ENABLED'] != '1') {
             return false;
         }
         //Send derivation notification - Start
         $oTask = new Task();
         $aTaskInfo = $oTask->load($sCurrentTask);
         if ($aTaskInfo['TAS_SEND_LAST_EMAIL'] != 'TRUE') {
             return false;
         }
         if ($sFrom == '') {
             $sFrom = '"ProcessMaker"';
         }
         $hasEmailFrom = preg_match('/(.+)@(.+)\\.(.+)/', $sFrom, $match);
         if (!$hasEmailFrom || strpos($sFrom, $aConfiguration['MESS_ACCOUNT']) === false) {
             if ($aConfiguration['MESS_ENGINE'] != 'MAIL' && $aConfiguration['MESS_ACCOUNT'] != '') {
                 $sFrom .= ' <' . $aConfiguration['MESS_ACCOUNT'] . '>';
             } else {
                 if ($aConfiguration['MESS_ENGINE'] == 'MAIL') {
                     $sFrom .= ' <info@' . gethostbyaddr('127.0.0.1') . '>';
                 } else {
                     if ($aConfiguration['MESS_SERVER'] != '') {
                         if ($sAux = @gethostbyaddr($aConfiguration['MESS_SERVER'])) {
                             $sFrom .= ' <info@' . $sAux . '>';
                         } else {
                             $sFrom .= ' <info@' . $aConfiguration['MESS_SERVER'] . '>';
                         }
                     } else {
                         $sFrom .= ' <info@processmaker.com>';
                     }
                 }
             }
         }
         if (isset($aTaskInfo['TAS_DEF_SUBJECT_MESSAGE']) && $aTaskInfo['TAS_DEF_SUBJECT_MESSAGE'] != '') {
             $sSubject = G::replaceDataField($aTaskInfo['TAS_DEF_SUBJECT_MESSAGE'], $aFields);
         } else {
             $sSubject = G::LoadTranslation('ID_MESSAGE_SUBJECT_DERIVATION');
         }
         //erik: new behaviour for messages
         G::loadClass('configuration');
         $oConf = new Configurations();
         $oConf->loadConfig($x, 'TAS_EXTRA_PROPERTIES', $aTaskInfo['TAS_UID'], '', '');
         $conf = $oConf->aConfig;
         $pathEmail = PATH_DATA_SITE . "mailTemplates" . PATH_SEP . $aTaskInfo["PRO_UID"] . PATH_SEP;
         $swtplDefault = 0;
         $sBody = null;
         if (isset($conf["TAS_DEF_MESSAGE_TYPE"]) && isset($conf["TAS_DEF_MESSAGE_TEMPLATE"]) && $conf["TAS_DEF_MESSAGE_TYPE"] == "template" && $conf["TAS_DEF_MESSAGE_TEMPLATE"] != "") {
             if ($conf["TAS_DEF_MESSAGE_TEMPLATE"] == "alert_message.html") {
                 $swtplDefault = 1;
             }
             $fileTemplate = $pathEmail . $conf["TAS_DEF_MESSAGE_TEMPLATE"];
             if (!file_exists($fileTemplate)) {
                 throw new Exception("Template file \"{$fileTemplate}\" does not exist.");
             }
             $sBody = G::replaceDataGridField(file_get_contents($fileTemplate), $aFields);
         } else {
             $sBody = nl2br(G::replaceDataGridField($aTaskInfo["TAS_DEF_MESSAGE"], $aFields));
         }
         G::LoadClass("tasks");
         G::LoadClass("groups");
         G::LoadClass("spool");
         $task = new Tasks();
         $group = new Groups();
         $oUser = new Users();
         foreach ($aTasks as $aTask) {
//.........这里部分代码省略.........
开发者ID:rodrigoivan,项目名称:processmaker,代码行数:101,代码来源:class.case.php

示例6: forwardMail

    /**
     * 
     * @url POST /forwardMail
     */
    public function forwardMail($params)
    {
        if (!isset($_REQUEST['REQ_UID'])) {
            $_REQUEST['REQ_UID'] = '';
        }

        $criteria = new Criteria();
        $criteria->addSelectColumn(AbeConfigurationPeer::ABE_UID);
        $criteria->addSelectColumn(AbeConfigurationPeer::PRO_UID);
        $criteria->addSelectColumn(AbeConfigurationPeer::TAS_UID);

        $criteria->addSelectColumn(AbeRequestsPeer::ABE_REQ_UID);
        $criteria->addSelectColumn(AbeRequestsPeer::APP_UID);
        $criteria->addSelectColumn(AbeRequestsPeer::DEL_INDEX);
        $criteria->addSelectColumn(AbeRequestsPeer::ABE_REQ_SENT_TO);
        $criteria->addSelectColumn(AbeRequestsPeer::ABE_REQ_SUBJECT);
        $criteria->addSelectColumn(AbeRequestsPeer::ABE_REQ_BODY);
        $criteria->addSelectColumn(AbeRequestsPeer::ABE_REQ_ANSWERED);
        $criteria->addSelectColumn(AbeRequestsPeer::ABE_REQ_STATUS);

        $criteria->addSelectColumn(AppDelegationPeer::DEL_FINISH_DATE);

        $criteria->add(AbeRequestsPeer::ABE_REQ_UID, $_REQUEST['REQ_UID']);
        $criteria->addJoin(AbeRequestsPeer::ABE_UID, AbeConfigurationPeer::ABE_UID);
        $criteria->addJoin(AppDelegationPeer::APP_UID, AbeRequestsPeer::APP_UID);
        $criteria->addJoin(AppDelegationPeer::DEL_INDEX, AbeRequestsPeer::DEL_INDEX);
        $resultRes = AbeRequestsPeer::doSelectRS($criteria);
        $resultRes->setFetchmode(ResultSet::FETCHMODE_ASSOC);

        $resultRes->next();
        $dataRes = Array();

        if ($dataRes = $resultRes->getRow()) {
            if (is_null($dataRes['DEL_FINISH_DATE'])) {
                require_once 'classes/model/Configuration.php';
                G::LoadClass('spool');

                $configuration = new Configuration();
                $sDelimiter = DBAdapter::getStringDelimiter();
                $criteria = new Criteria('workflow');
                $criteria->add(ConfigurationPeer::CFG_UID, 'Emails');
                $criteria->add(ConfigurationPeer::OBJ_UID, '');
                $criteria->add(ConfigurationPeer::PRO_UID, '');
                $criteria->add(ConfigurationPeer::USR_UID, '');
                $criteria->add(ConfigurationPeer::APP_UID, '');

                if (ConfigurationPeer::doCount($criteria) == 0) {
                    $configuration->create(array('CFG_UID' => 'Emails', 'OBJ_UID' => '', 'CFG_VALUE' => '', 'PRO_UID' => '', 'USR_UID' => '', 'APP_UID' => ''));
                    $newConfiguration = array();
                } else {
                    $newConfiguration = $configuration->load('Emails', '', '', '', '');

                    if ($newConfiguration['CFG_VALUE'] != '') {
                        $newConfiguration = unserialize($newConfiguration['CFG_VALUE']);
                    } else {
                        $newConfiguration = array();
                    }
                }

                $spool = new spoolRun();
                $spool->setConfig(array(
                    'MESS_ENGINE' => $newConfiguration['MESS_ENGINE'],
                    'MESS_SERVER' => $newConfiguration['MESS_SERVER'],
                    'MESS_PORT' => $newConfiguration['MESS_PORT'],
                    'MESS_ACCOUNT' => $newConfiguration['MESS_ACCOUNT'],
                    'MESS_PASSWORD' => $newConfiguration['MESS_PASSWORD'],
                    'SMTPAuth' => $newConfiguration['MESS_RAUTH']
                ));

                $spool->create(array(
                    'msg_uid' => '',
                    'app_uid' => $dataRes['APP_UID'],
                    'del_index' => $dataRes['DEL_INDEX'],
                    'app_msg_type' => 'TEST',
                    'app_msg_subject' => $dataRes['ABE_REQ_SUBJECT'],
                    'app_msg_from' => $newConfiguration['MESS_ACCOUNT'],
                    'app_msg_to' => $dataRes['ABE_REQ_SENT_TO'],
                    'app_msg_body' => $dataRes['ABE_REQ_BODY'],
                    'app_msg_cc' => '',
                    'app_msg_bcc' => '',
                    'app_msg_attach' => '',
                    'app_msg_template' => '',
                    'app_msg_status' => 'pending'
                ));

                if ($spool->sendMail()) {
                    $dataRes['ABE_REQ_STATUS'] = 'SENT';

                    $message = 'The email was resend to: ' . $dataRes['ABE_REQ_SENT_TO'];
                } else {
                    $dataRes['ABE_REQ_STATUS'] = 'ERROR';
                    $message = 'There was a problem sending the email to: ' . $dataRes['ABE_REQ_SENT_TO'] . ', please try later.';
                }

                try {
                    $abeRequestsInstance = new AbeRequests();
//.........这里部分代码省略.........
开发者ID:hpx2206,项目名称:processmaker-1,代码行数:101,代码来源:ActionsByEmail.php

示例7: login


//.........这里部分代码省略.........
             if ($pluginRegistry->existsTrigger(PM_SINGLE_SIGN_ON)) {
                 if ($pluginRegistry->executeTriggers(PM_SINGLE_SIGN_ON, null)) {
                     // Start new session
                     @session_destroy();
                     session_start();
                     session_regenerate_id();
                     // Authenticate
                     $result = $this->authentication();
                     if ($result->success) {
                         // Redirect to landing page for the user
                         G::header('Location: ' . $result->url);
                         die;
                     }
                 }
             }
         }
     }
     //end log
     //start new session
     @session_destroy();
     session_start();
     session_regenerate_id();
     if (strlen($msg) > 0) {
         $_SESSION['G_MESSAGE'] = $msg;
     }
     if (strlen($msgType) > 0) {
         $_SESSION['G_MESSAGE_TYPE'] = $msgType;
     }
     $_SESSION['FAILED_LOGINS'] = $sFailedLogins;
     $availableLangArray = $this->getLanguagesList();
     G::LoadClass("serverConfiguration");
     $sflag = 0;
     if (($nextBeatDate = $this->memcache->get('nextBeatDate')) === false) {
         //get the serverconf singleton, and check if we can send the heartbeat
         $oServerConf =& serverConf::getSingleton();
         $sflag = $oServerConf->getHeartbeatProperty('HB_OPTION', 'HEART_BEAT_CONF');
         $sflag = trim($sflag) != '' ? $sflag : '1';
         //get date of next beat
         $nextBeatDate = $oServerConf->getHeartbeatProperty('HB_NEXT_BEAT_DATE', 'HEART_BEAT_CONF');
         $this->memcache->set('nextBeatDate', $nextBeatDate, 1 * 3600);
     } else {
         $sflag = '1';
     }
     if ($sflag == '1' && (strtotime("now") > $nextBeatDate || is_null($nextBeatDate))) {
         //To do: we need to change to ExtJs
         $this->setJSVar('flagHeartBeat', 1);
     } else {
         $this->setJSVar('flagHeartBeat', 0);
     }
     if (($flagGettingStarted = $this->memcache->get('flagGettingStarted')) === false) {
         require_once 'classes/model/Configuration.php';
         $oConfiguration = new Configuration();
         $oCriteria = new Criteria('workflow');
         $oCriteria->add(ConfigurationPeer::CFG_UID, 'getStarted');
         $oCriteria->add(ConfigurationPeer::OBJ_UID, '');
         $oCriteria->add(ConfigurationPeer::CFG_VALUE, '1');
         $oCriteria->add(ConfigurationPeer::PRO_UID, '');
         $oCriteria->add(ConfigurationPeer::USR_UID, '');
         $oCriteria->add(ConfigurationPeer::APP_UID, '');
         $flagGettingStarted = ConfigurationPeer::doCount($oCriteria);
         $this->memcache->set('flagGettingStarted', $flagGettingStarted, 8 * 3600);
     }
     $this->setJSVar('flagGettingStarted', $flagGettingStarted == 0);
     G::loadClass('configuration');
     $oConf = new Configurations();
     $oConf->loadConfig($obj, 'ENVIRONMENT_SETTINGS', '');
     $flagForgotPassword = isset($oConf->aConfig['login_enableForgotPassword']) ? $oConf->aConfig['login_enableForgotPassword'] : 'off';
     $this->includeExtJSLib('ux/virtualkeyboard');
     $this->includeExtJS('main/login');
     $this->setView('main/login');
     $oConf->loadConfig($obj, 'ENVIRONMENT_SETTINGS', '');
     $forgotPasswd = isset($oConf->aConfig['login_enableForgotPassword']) ? $oConf->aConfig['login_enableForgotPassword'] : false;
     $virtualKeyboad = isset($oConf->aConfig['login_enableVirtualKeyboard']) ? $oConf->aConfig['login_enableVirtualKeyboard'] : false;
     $defaultLanguaje = isset($oConf->aConfig['login_defaultLanguage']) ? $oConf->aConfig['login_defaultLanguage'] : 'en';
     $this->setJSVar('forgotPasswd', $forgotPasswd);
     $this->setJSVar('virtualKeyboad', $virtualKeyboad);
     $this->setJSVar('languages', $availableLangArray);
     $this->setJSVar('defaultLang', $defaultLanguaje);
     //binding G::SendTemporalMessage() to Ext.msgBoxSlider.msgTopCenter()
     if (($flyNotify = $this->getFlyNotify()) !== false) {
         $this->setJSVar('flyNotify', $flyNotify);
     }
     //binding G::SendTemporalMessage() to Ext.msgBoxSlider.msgTopCenter()
     if (isset($_GET['u'])) {
         $this->setJSVar('urlRequested', urldecode($_GET['u']));
     }
     $this->setVar('logo_company', $this->getCompanyLogo());
     $this->setVar('pmos_version', System::getVersion());
     $footerText = 'Copyright &copy; 2003-' . date('Y') . ' Colosa, Inc. All rights reserved.';
     $adviseText = 'Supplied free of charge with no support, certification, warranty,
         maintenance nor indemnity by Colosa and its Certified Partners. ';
     $this->setVar('footer_text', $footerText);
     $this->setVar('advise_text', $adviseText);
     $loginScript = $this->getHeadPublisher()->getExtJsLibraries();
     $loginScript .= $this->getHeadPublisher()->getExtJsScripts();
     $this->setVar('login_script', $loginScript);
     $this->setVar('login_vars', $this->getHeadPublisher()->getExtJsVariablesScript());
     $this->setLayout('pm-modern-login');
     $this->render();
 }
开发者ID:rodrigoivan,项目名称:processmaker,代码行数:101,代码来源:main.php

示例8: sendNoteNotification

 public function sendNoteNotification($appUid, $usrUid, $noteContent, $noteRecipients, $sFrom = "")
 {
     try {
         require_once 'classes/model/Configuration.php';
         $oConfiguration = new Configuration();
         $sDelimiter = DBAdapter::getStringDelimiter();
         $oCriteria = new Criteria('workflow');
         $oCriteria->add(ConfigurationPeer::CFG_UID, 'Emails');
         $oCriteria->add(ConfigurationPeer::OBJ_UID, '');
         $oCriteria->add(ConfigurationPeer::PRO_UID, '');
         $oCriteria->add(ConfigurationPeer::USR_UID, '');
         $oCriteria->add(ConfigurationPeer::APP_UID, '');
         if (ConfigurationPeer::doCount($oCriteria) == 0) {
             $oConfiguration->create(array('CFG_UID' => 'Emails', 'OBJ_UID' => '', 'CFG_VALUE' => '', 'PRO_UID' => '', 'USR_UID' => '', 'APP_UID' => ''));
             $aConfiguration = array();
         } else {
             $aConfiguration = $oConfiguration->load('Emails', '', '', '', '');
             if ($aConfiguration['CFG_VALUE'] != '') {
                 $aConfiguration = unserialize($aConfiguration['CFG_VALUE']);
                 $passwd = $aConfiguration['MESS_PASSWORD'];
                 $passwdDec = G::decrypt($passwd, 'EMAILENCRYPT');
                 if (strpos($passwdDec, 'hash:') !== false) {
                     list($hash, $pass) = explode(":", $passwdDec);
                     $aConfiguration['MESS_PASSWORD'] = $pass;
                 }
             } else {
                 $aConfiguration = array();
             }
         }
         if (!isset($aConfiguration['MESS_ENABLED']) || $aConfiguration['MESS_ENABLED'] != '1') {
             return false;
         }
         $oUser = new Users();
         $aUser = $oUser->load($usrUid);
         $authorName = ($aUser['USR_FIRSTNAME'] != '' || $aUser['USR_LASTNAME'] != '' ? $aUser['USR_FIRSTNAME'] . ' ' . $aUser['USR_LASTNAME'] . ' ' : '') . '<' . $aUser['USR_EMAIL'] . '>';
         G::LoadClass('case');
         $oCase = new Cases();
         $aFields = $oCase->loadCase($appUid);
         $configNoteNotification['subject'] = G::LoadTranslation('ID_MESSAGE_SUBJECT_NOTE_NOTIFICATION') . " @#APP_TITLE ";
         $configNoteNotification['body'] = G::LoadTranslation('ID_CASE') . ": @#APP_TITLE<br />" . G::LoadTranslation('ID_AUTHOR') . ": {$authorName}<br /><br />{$noteContent}";
         if ($sFrom == '') {
             $sFrom = '"ProcessMaker"';
         }
         if ($aConfiguration['MESS_ENGINE'] != 'MAIL' && $aConfiguration['MESS_ACCOUNT'] != '') {
             $sFrom .= ' <' . $aConfiguration['MESS_ACCOUNT'] . '>';
         } else {
             if ($aConfiguration['MESS_ENGINE'] == 'MAIL') {
                 $sFrom .= ' <info@' . gethostbyaddr('127.0.0.1') . '>';
             } else {
                 if ($aConfiguration['MESS_SERVER'] != '') {
                     if ($sAux = @gethostbyaddr($aConfiguration['MESS_SERVER'])) {
                         $sFrom .= ' <info@' . $sAux . '>';
                     } else {
                         $sFrom .= ' <info@' . $aConfiguration['MESS_SERVER'] . '>';
                     }
                 } else {
                     $sFrom .= ' <info@processmaker.com>';
                 }
             }
         }
         $sSubject = G::replaceDataField($configNoteNotification['subject'], $aFields);
         //erik: new behaviour for messages
         //G::loadClass('configuration');
         //$oConf = new Configurations;
         //$oConf->loadConfig($x, 'TAS_EXTRA_PROPERTIES', $aTaskInfo['TAS_UID'], '', '');
         //$conf = $oConf->aConfig;
         /*
               if( isset($conf['TAS_DEF_MESSAGE_TYPE']) && isset($conf['TAS_DEF_MESSAGE_TEMPLATE'])
                 && $conf['TAS_DEF_MESSAGE_TYPE'] == 'template' && $conf['TAS_DEF_MESSAGE_TEMPLATE'] != '') {
         
                 $pathEmail = PATH_DATA_SITE . 'mailTemplates' . PATH_SEP . $aTaskInfo['PRO_UID'] . PATH_SEP;
                 $fileTemplate = $pathEmail . $conf['TAS_DEF_MESSAGE_TEMPLATE'];
         
                 if ( ! file_exists ( $fileTemplate ) ) {
                   throw new Exception("Template file '$fileTemplate' does not exist.");
                 }
         
                 $sBody = G::replaceDataField(file_get_contents($fileTemplate), $aFields);
               } else {*/
         $sBody = nl2br(G::replaceDataField($configNoteNotification['body'], $aFields));
         /*}*/
         G::LoadClass('spool');
         $oUser = new Users();
         $recipientsArray = explode(",", $noteRecipients);
         foreach ($recipientsArray as $recipientUid) {
             $aUser = $oUser->load($recipientUid);
             $sTo = ($aUser['USR_FIRSTNAME'] != '' || $aUser['USR_LASTNAME'] != '' ? $aUser['USR_FIRSTNAME'] . ' ' . $aUser['USR_LASTNAME'] . ' ' : '') . '<' . $aUser['USR_EMAIL'] . '>';
             $oSpool = new spoolRun();
             $oSpool->setConfig(array('MESS_ENGINE' => $aConfiguration['MESS_ENGINE'], 'MESS_SERVER' => $aConfiguration['MESS_SERVER'], 'MESS_PORT' => $aConfiguration['MESS_PORT'], 'MESS_ACCOUNT' => $aConfiguration['MESS_ACCOUNT'], 'MESS_PASSWORD' => $aConfiguration['MESS_PASSWORD'], 'SMTPAuth' => $aConfiguration['MESS_RAUTH'] == '1' ? true : false, 'SMTPSecure' => isset($aConfiguration['SMTPSecure']) ? $aConfiguration['SMTPSecure'] : ''));
             $oSpool->create(array('msg_uid' => '', 'app_uid' => $appUid, 'del_index' => 1, 'app_msg_type' => 'DERIVATION', 'app_msg_subject' => $sSubject, 'app_msg_from' => $sFrom, 'app_msg_to' => $sTo, 'app_msg_body' => $sBody, 'app_msg_cc' => '', 'app_msg_bcc' => '', 'app_msg_attach' => '', 'app_msg_template' => '', 'app_msg_status' => 'pending'));
             if ($aConfiguration['MESS_BACKGROUND'] == '' || $aConfiguration['MESS_TRY_SEND_INMEDIATLY'] == '1') {
                 $oSpool->sendMail();
             }
         }
         //Send derivation notification - End
     } catch (Exception $oException) {
         throw $oException;
     }
 }
开发者ID:nshong,项目名称:processmaker,代码行数:99,代码来源:AppNotes.php

示例9: sendNotifications

 public function sendNotifications($sCurrentTask, $aTasks, $aFields, $sApplicationUID, $iDelegation, $sFrom = '')
 {
     try {
         $oConfiguration = new Configuration();
         $sDelimiter = DBAdapter::getStringDelimiter();
         $oCriteria = new Criteria('workflow');
         $oCriteria->add(ConfigurationPeer::CFG_UID, 'Emails');
         $oCriteria->add(ConfigurationPeer::OBJ_UID, '');
         $oCriteria->add(ConfigurationPeer::PRO_UID, '');
         $oCriteria->add(ConfigurationPeer::USR_UID, '');
         $oCriteria->add(ConfigurationPeer::APP_UID, '');
         if (ConfigurationPeer::doCount($oCriteria) == 0) {
             $oConfiguration->create(array('CFG_UID' => 'Emails', 'OBJ_UID' => '', 'CFG_VALUE' => '', 'PRO_UID' => '', 'USR_UID' => '', 'APP_UID' => ''));
             $aConfiguration = array();
         } else {
             $aConfiguration = $oConfiguration->load('Emails', '', '', '', '');
             if ($aConfiguration['CFG_VALUE'] != '') {
                 $aConfiguration = unserialize($aConfiguration["CFG_VALUE"]);
                 $passwd = $aConfiguration["MESS_PASSWORD"];
                 $passwdDec = G::decrypt($passwd, "EMAILENCRYPT");
                 if (strpos($passwdDec, "hash:") !== false) {
                     list($hash, $pass) = explode(":", $passwdDec);
                     $passwd = $pass;
                 }
                 $aConfiguration["MESS_PASSWORD"] = $passwd;
             } else {
                 $aConfiguration = array();
             }
         }
         if (!isset($aConfiguration['MESS_ENABLED']) || $aConfiguration['MESS_ENABLED'] != '1') {
             return false;
         }
         //Send derivation notification - Start
         $oTask = new Task();
         $aTaskInfo = $oTask->load($sCurrentTask);
         if ($aTaskInfo['TAS_SEND_LAST_EMAIL'] != 'TRUE') {
             return false;
         }
         if ($sFrom == '') {
             $sFrom = '"ProcessMaker"';
         }
         if ($aConfiguration['MESS_ENGINE'] != 'MAIL' && $aConfiguration['MESS_ACCOUNT'] != '') {
             $sFrom .= ' <' . $aConfiguration['MESS_ACCOUNT'] . '>';
         } else {
             if ($aConfiguration['MESS_ENGINE'] == 'MAIL') {
                 $sFrom .= ' <info@' . gethostbyaddr('127.0.0.1') . '>';
             } else {
                 if ($aConfiguration['MESS_SERVER'] != '') {
                     if ($sAux = @gethostbyaddr($aConfiguration['MESS_SERVER'])) {
                         $sFrom .= ' <info@' . $sAux . '>';
                     } else {
                         $sFrom .= ' <info@' . $aConfiguration['MESS_SERVER'] . '>';
                     }
                 } else {
                     $sFrom .= ' <info@processmaker.com>';
                 }
             }
         }
         if (isset($aTaskInfo['TAS_DEF_SUBJECT_MESSAGE']) && $aTaskInfo['TAS_DEF_SUBJECT_MESSAGE'] != '') {
             $sSubject = G::replaceDataField($aTaskInfo['TAS_DEF_SUBJECT_MESSAGE'], $aFields);
         } else {
             $sSubject = G::LoadTranslation('ID_MESSAGE_SUBJECT_DERIVATION');
         }
         //erik: new behaviour for messages
         G::loadClass('configuration');
         $oConf = new Configurations();
         $oConf->loadConfig($x, 'TAS_EXTRA_PROPERTIES', $aTaskInfo['TAS_UID'], '', '');
         $conf = $oConf->aConfig;
         if (isset($conf['TAS_DEF_MESSAGE_TYPE']) && isset($conf['TAS_DEF_MESSAGE_TEMPLATE']) && $conf['TAS_DEF_MESSAGE_TYPE'] == 'template' && $conf['TAS_DEF_MESSAGE_TEMPLATE'] != '') {
             $pathEmail = PATH_DATA_SITE . 'mailTemplates' . PATH_SEP . $aTaskInfo['PRO_UID'] . PATH_SEP;
             $fileTemplate = $pathEmail . $conf['TAS_DEF_MESSAGE_TEMPLATE'];
             if (!file_exists($fileTemplate)) {
                 throw new Exception("Template file '{$fileTemplate}' does not exist.");
             }
             $sBody = G::replaceDataField(file_get_contents($fileTemplate), $aFields);
         } else {
             $sBody = nl2br(G::replaceDataField($aTaskInfo['TAS_DEF_MESSAGE'], $aFields));
         }
         G::LoadClass('spool');
         $oUser = new Users();
         foreach ($aTasks as $aTask) {
             if (isset($aTask['USR_UID'])) {
                 $aUser = $oUser->load($aTask['USR_UID']);
                 $sTo = ($aUser['USR_FIRSTNAME'] != '' || $aUser['USR_LASTNAME'] != '' ? $aUser['USR_FIRSTNAME'] . ' ' . $aUser['USR_LASTNAME'] . ' ' : '') . '<' . $aUser['USR_EMAIL'] . '>';
                 $oSpool = new spoolRun();
                 $oSpool->setConfig(array('MESS_ENGINE' => $aConfiguration['MESS_ENGINE'], 'MESS_SERVER' => $aConfiguration['MESS_SERVER'], 'MESS_PORT' => $aConfiguration['MESS_PORT'], 'MESS_ACCOUNT' => $aConfiguration['MESS_ACCOUNT'], 'MESS_PASSWORD' => $aConfiguration['MESS_PASSWORD'], 'SMTPAuth' => $aConfiguration['MESS_RAUTH'] == '1' ? true : false, 'SMTPSecure' => isset($aConfiguration['SMTPSecure']) ? $aConfiguration['SMTPSecure'] : ''));
                 $oSpool->create(array('msg_uid' => '', 'app_uid' => $sApplicationUID, 'del_index' => $iDelegation, 'app_msg_type' => 'DERIVATION', 'app_msg_subject' => $sSubject, 'app_msg_from' => $sFrom, 'app_msg_to' => $sTo, 'app_msg_body' => $sBody, 'app_msg_cc' => '', 'app_msg_bcc' => '', 'app_msg_attach' => '', 'app_msg_template' => '', 'app_msg_status' => 'pending'));
                 if ($aConfiguration['MESS_BACKGROUND'] == '' || $aConfiguration['MESS_TRY_SEND_INMEDIATLY'] == '1') {
                     $oSpool->sendMail();
                 }
             }
         }
         //Send derivation notification - End
     } catch (Exception $oException) {
         throw $oException;
     }
 }
开发者ID:nshong,项目名称:processmaker,代码行数:97,代码来源:class.case.php


注:本文中的ConfigurationPeer::doCount方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。