本文整理汇总了PHP中Configurations::loadConfig方法的典型用法代码示例。如果您正苦于以下问题:PHP Configurations::loadConfig方法的具体用法?PHP Configurations::loadConfig怎么用?PHP Configurations::loadConfig使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Configurations
的用法示例。
在下文中一共展示了Configurations::loadConfig方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getProperties
/**
* Get all properties of an Task
* @var string $prj_uid. Uid for Process
* @var string $act_uid. Uid for Activity
* @var boolean $keyCaseToLower. Flag for case lower
*
* return object
*/
public function getProperties($prj_uid, $act_uid, $keyCaseToLower = false, $groupData = true)
{
try {
$prj_uid = $this->validateProUid($prj_uid);
$taskUid = $this->validateActUid($act_uid);
//G::LoadClass("configuration");
require_once PATH_TRUNK . "workflow" . PATH_SEP . "engine" . PATH_SEP . "classes" . PATH_SEP . "class.configuration.php";
$task = new \Task();
$arrayDataAux = $task->load($taskUid);
//$arrayDataAux["INDEX"] = 0;
//$arrayDataAux["IFORM"] = 1;
//$arrayDataAux["LANG"] = SYS_LANG;
//Assignment rules
if ($arrayDataAux["TAS_ASSIGN_TYPE"] == "SELF_SERVICE") {
$arrayDataAux["TAS_ASSIGN_TYPE"] = !empty($arrayDataAux["TAS_GROUP_VARIABLE"]) ? "SELF_SERVICE_EVALUATE" : $arrayDataAux["TAS_ASSIGN_TYPE"];
}
//Timing control
//Load Calendar Information
$calendar = new \Calendar();
$calendarInfo = $calendar->getCalendarFor("", "", $taskUid);
//If the function returns a DEFAULT calendar it means that this object doesn"t have assigned any calendar
$arrayDataAux["TAS_CALENDAR"] = $calendarInfo["CALENDAR_APPLIED"] != "DEFAULT" ? $calendarInfo["CALENDAR_UID"] : "";
//Notifications
$conf = new \Configurations();
$conf->loadConfig($x, "TAS_EXTRA_PROPERTIES", $taskUid, "", "");
$arrayDataAux["TAS_DEF_MESSAGE_TYPE"] = "text";
$arrayDataAux["TAS_DEF_MESSAGE_TEMPLATE"] = "alert_message.html";
if (isset($conf->aConfig["TAS_DEF_MESSAGE_TYPE"]) && isset($conf->aConfig["TAS_DEF_MESSAGE_TYPE"])) {
$arrayDataAux["TAS_DEF_MESSAGE_TYPE"] = $conf->aConfig["TAS_DEF_MESSAGE_TYPE"];
$arrayDataAux["TAS_DEF_MESSAGE_TEMPLATE"] = $conf->aConfig["TAS_DEF_MESSAGE_TEMPLATE"];
}
//Set data
$arrayData = array();
$keyCase = $keyCaseToLower ? CASE_LOWER : CASE_UPPER;
if (!$groupData) {
$arrayData = array_change_key_case($arrayDataAux, $keyCase);
return $arrayData;
}
//Definition
$arrayData["DEFINITION"] = array_change_key_case(array("TAS_PRIORITY_VARIABLE" => $arrayDataAux["TAS_PRIORITY_VARIABLE"], "TAS_DERIVATION_SCREEN_TPL" => $arrayDataAux["TAS_DERIVATION_SCREEN_TPL"]), $keyCase);
//Assignment Rules
$arrayData["ASSIGNMENT_RULES"] = array_change_key_case(array("TAS_ASSIGN_TYPE" => $arrayDataAux["TAS_ASSIGN_TYPE"], "TAS_ASSIGN_VARIABLE" => $arrayDataAux["TAS_ASSIGN_VARIABLE"], "TAS_GROUP_VARIABLE" => $arrayDataAux["TAS_GROUP_VARIABLE"], "TAS_SELFSERVICE_TIMEOUT" => $arrayDataAux["TAS_SELFSERVICE_TIMEOUT"], "TAS_SELFSERVICE_TIME" => $arrayDataAux["TAS_SELFSERVICE_TIME"], "TAS_SELFSERVICE_TIME_UNIT" => $arrayDataAux["TAS_SELFSERVICE_TIME_UNIT"], "TAS_SELFSERVICE_TRIGGER_UID" => $arrayDataAux["TAS_SELFSERVICE_TRIGGER_UID"], "TAS_SELFSERVICE_EXECUTION" => $arrayDataAux["TAS_SELFSERVICE_EXECUTION"]), $keyCase);
//Timing control
$arrayData["TIMING_CONTROL"] = array_change_key_case(array("TAS_TRANSFER_FLY" => $arrayDataAux["TAS_TRANSFER_FLY"], "TAS_DURATION" => $arrayDataAux["TAS_DURATION"], "TAS_TIMEUNIT" => $arrayDataAux["TAS_TIMEUNIT"], "TAS_TYPE_DAY" => $arrayDataAux["TAS_TYPE_DAY"], "TAS_CALENDAR" => $arrayDataAux["TAS_CALENDAR"]), $keyCase);
//Permissions
$arrayData["PERMISSIONS"] = array_change_key_case(array("TAS_TYPE" => $arrayDataAux["TAS_TYPE"]), $keyCase);
//Case Labels
$arrayData["CASE_LABELS"] = array_change_key_case(array("TAS_DEF_TITLE" => $arrayDataAux["TAS_DEF_TITLE"], "TAS_DEF_DESCRIPTION" => $arrayDataAux["TAS_DEF_DESCRIPTION"]), $keyCase);
//Notifications
$arrayData["NOTIFICATIONS"] = array_change_key_case(array("SEND_EMAIL" => $arrayDataAux["TAS_SEND_LAST_EMAIL"], "TAS_DEF_SUBJECT_MESSAGE" => $arrayDataAux["TAS_DEF_SUBJECT_MESSAGE"], "TAS_DEF_MESSAGE_TYPE" => $arrayDataAux["TAS_DEF_MESSAGE_TYPE"], "TAS_DEF_MESSAGE" => $arrayDataAux["TAS_DEF_MESSAGE"], "TAS_DEF_MESSAGE_TEMPLATE" => $arrayDataAux["TAS_DEF_MESSAGE_TEMPLATE"]), $keyCase);
$arrayData = array_change_key_case($arrayData, $keyCase);
return $arrayData;
} catch (Exception $e) {
throw $e;
}
}
示例2: 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;
}
}
示例3: getSystemDate
public function getSystemDate($dateTime, $type='dateFormat')
{
$oConf = new Configurations();
$oConf->getFormats();
$dateFormat = $oConf->UserConfig['dateFormat'];
$oConf->loadConfig($obj, 'ENVIRONMENT_SETTINGS', '');
$creationDateMask = isset($oConf->aConfig[$type]) ? $oConf->aConfig[$type] : '';
$creationDateMask = ($creationDateMask == '') ? $dateFormat : $creationDateMask;
if ($creationDateMask != '') {
if (strpos($dateTime, ' ') !== false) {
list ($date, $time) = explode(' ', $dateTime);
list ($y, $m, $d) = explode('-', $date);
list ($h, $i, $s) = explode(':', $time);
$newCreation = '';
$maskTime = array('d' => '%d', 'D' => '%A', 'j' => '%d', 'l' => '%A', 'G' => '%I', 'g' => '%i', 'N' => '%u', 'S' => '%d', 'w' => '%w', 'z' => '%j', 'W' => '%W', 'F' => '%B', 'm' => '%m', 'M' => '%B', 'n' => '%m', 'o' => '%Y', 'Y' => '%Y', 'y' => '%g', 'a' => '%p', 'A' => '%p', 'g' => '%I', 'G' => '%H', 'h' => '%I', 'H' => '%H', 'i' => '%M', 's' => '%S');
$creationDateMask = trim($creationDateMask);
if (strpos($creationDateMask, ' \\d\\e ') !== false) {
$creationDateMask = str_replace(' \\d\\e ', ' [xx] ', $creationDateMask);
}
for ($j = 0; $j < strlen($creationDateMask); $j++) {
if ($creationDateMask[$j] != ' ' && isset($maskTime[$creationDateMask[$j]])) {
$newCreation .= $maskTime[$creationDateMask[$j]];
} else {
$newCreation .= $creationDateMask[$j];
}
}
$langLocate = SYS_LANG;
require_once 'model/Language.php';
$language = new language();
$lanLocation = $language->findLocationByLanId(SYS_LANG);
$location = isset($lanLocation['LAN_LOCATION']) ? $lanLocation['LAN_LOCATION'] : '';
if (G::toLower(PHP_OS) == 'linux' || G::toLower(PHP_OS) == 'darwin') {
if (SYS_LANG == 'es') {
$langLocate = 'es_ES';
} else if (strlen(SYS_LANG) > 2) {
$langLocate = str_replace('-', '_', SYS_LANG);
} else if ($location != '') {
$langLocate = SYS_LANG.'_'.$location;
} else {
$langLocate = 'en_US';
}
} else {
switch (SYS_LANG) {
case 'es':
case 'es_ES':
$langLocate = 'ESN';
break;
case 'pt':
case 'pt-BR':
$langLocate = 'PTB';
break;
case 'en':
case 'en-US':
default:
$langLocate = 'EST';
break;
}
}
if (defined('PARTNER_FLAG')) {
setlocale(LC_TIME, $langLocate);
$dateTime = utf8_encode(strftime($newCreation, mktime($h, $i, $s, $m, $d, $y)));
} else {
setlocale(LC_TIME, $langLocate . ".utf8");
$dateTime = strftime($newCreation, mktime($h, $i, $s, $m, $d, $y));
}
if (strpos($dateTime, ' ') !== false) {
$dateTime = ucwords($dateTime);
}
if (strpos($dateTime, ' [xx] ') !== false) {
$dateTime = str_replace('[xx]', ' de ', $dateTime);
}
}
}
return $dateTime;
}
示例4: Configurations
global $_DBArray;
$_DBArray ['langOptions'] = $availableLangArray;
G::LoadClass('configuration');
//BootStrap::LoadClass('configuration');
$oConf = new Configurations();
$oConf->loadConfig($obj, 'ENVIRONMENT_SETTINGS', '');
$myUrl = explode("/", $_SERVER["REQUEST_URI"]);
if (isset($myUrl) && $myUrl != "") {
$aFields["USER_LANG"] = $myUrl[2];
} else {
$aFields["USER_LANG"] = isset($oConf->aConfig["login_defaultLanguage"])? $oConf->aConfig["login_defaultLanguage"] : SYS_LANG;
示例5: RenderContent0
//.........这里部分代码省略.........
$oPluginRegistry =& PMPluginRegistry::getSingleton();
if ($oPluginRegistry->isRegisteredFolder($aux[0])) {
$sPath = PATH_PLUGINS;
// . $aux[0] . PATH_SEP ;
}
}
}
$G_FORM = new Form($Part['File'], $sPath, SYS_LANG, true);
if (defined('ENABLE_ENCRYPT') && ENABLE_ENCRYPT == 'yes') {
$G_FORM->ajaxServer = urlencode(G::encrypt($Part['ajaxServer'], URL_KEY));
} else {
$G_FORM->ajaxServer = $Part['ajaxServer'];
}
$G_FORM->setValues($Part['Data']);
if (isset($_SESSION)) {
$_SESSION[$G_FORM->id] = $G_FORM->values;
}
G::LoadSystem('pagedTable');
$oTable = new pagedTable();
$oTable->template = 'templates/' . $Part['Template'] . '.html';
$G_FORM->xmlform = '';
$G_FORM->xmlform->fileXml = $G_FORM->fileName;
$G_FORM->xmlform->home = $G_FORM->home;
$G_FORM->xmlform->tree->attribute = $G_FORM->tree->attributes;
$G_FORM->values = array_merge($G_FORM->values, $Part['Data']);
$oTable->setupFromXmlform($G_FORM);
if (isset($Part['ajaxServer']) && $Part['ajaxServer'] !== '') {
$oTable->ajaxServer = $Part['ajaxServer'];
}
/* Start Block: Load user configuration for the pagedTable */
G::LoadClass('configuration');
$objUID = $Part['File'];
$conf = new Configurations();
$conf->loadConfig($oTable, 'pagedTable', $objUID, '', isset($_SESSION['USER_LOGGED']) ? $_SESSION['USER_LOGGED'] : '', '');
$oTable->__OBJ_UID = $objUID;
/* End Block */
/* Start Block: PagedTable Right Click */
G::LoadClass('popupMenu');
$pm = new popupMenu('gulliver/pagedTable_PopupMenu');
$pm->name = $oTable->id;
$fields = array_keys($oTable->fields);
foreach ($fields as $f) {
switch (strtolower($oTable->fields[$f]['Type'])) {
case 'javascript':
case 'button':
case 'private':
case 'hidden':
case 'cellmark':
break;
default:
$label = $oTable->fields[$f]['Label'] != '' ? $oTable->fields[$f]['Label'] : $f;
$label = str_replace("\n", ' ', $label);
$pm->fields[$f] = new XmlForm_Field_popupOption(new Xml_Node($f, 'complete', '', array('label' => $label, 'type' => 'popupOption', 'launch' => $oTable->id . '.showHideField("' . $f . '")')));
$pm->values[$f] = '';
}
}
$sc = '';
$pm->values['PAGED_TABLE_ID'] = $oTable->id;
print $pm->render(PATH_CORE . 'templates/popupMenu.html', $sc);
/* End Block */
$oTable->renderTable();
/* Start Block: Load PagedTable Right Click */
print '<script type="text/javascript">';
print $sc;
print 'loadPopupMenu_' . $oTable->id . '();';
print '</script>';
示例6: _getDefaultLocation
/**
* get user preferences for default redirect
* verifying if it has any preferences on configurations table
*/
public function _getDefaultLocation()
{
global $RBAC;
G::loadClass('configuration');
$oConf = new Configurations();
$oConf->loadConfig($x, 'USER_PREFERENCES', '', '', $_SESSION['USER_LOGGED'], '');
//$baseUrl = '/sys' . SYS_SYS . '/' . $this->lang . '/' . SYS_SKIN . '/';
if (isset($_COOKIE['workspaceSkin'])) {
$baseUrl = '/sys' . SYS_SYS . '/' . $this->lang . '/' . $_COOKIE['workspaceSkin'] . '/';
} else {
$baseUrl = '/sys' . SYS_SYS . '/' . $this->lang . '/' . SYS_SKIN . '/';
}
$url = '';
if (sizeof($oConf->aConfig) > 0) {
// this user has a configuration record
// backward compatibility, because now, we don't have user and dashboard menu.
if ($oConf->aConfig['DEFAULT_MENU'] == 'PM_USERS') {
$oConf->aConfig['DEFAULT_MENU'] = 'PM_SETUP';
}
switch ($oConf->aConfig['DEFAULT_MENU']) {
case 'PM_SETUP':
if ($RBAC->userCanAccess('PM_SETUP') == 1) {
$url = 'setup/main';
}
break;
case 'PM_FACTORY':
if ($RBAC->userCanAccess('PM_FACTORY') == 1) {
$url = 'processes/main';
}
break;
case 'PM_CASES':
if ($RBAC->userCanAccess('PM_CASES') == 1) {
$url = 'cases/main';
}
break;
case 'PM_USERS':
if ($RBAC->userCanAccess('PM_USERS') == 1) {
$url = 'setup/main';
}
break;
case 'PM_DASHBOARD':
if ($RBAC->userCanAccess('PM_DASHBOARD') == 1) {
$url = 'dashboard/main';
}
break;
}
}
if (empty($url)) {
if ($RBAC->userCanAccess('PM_FACTORY') == 1) {
$url = 'processes/main';
} elseif ($RBAC->userCanAccess('PM_SETUP') == 1) {
$url = 'setup/main';
} elseif ($RBAC->userCanAccess('PM_CASES') == 1) {
$url = 'cases/main';
} elseif ($RBAC->userCanAccess('PM_USERS') == 1) {
$url = 'setup/main';
} elseif ($RBAC->userCanAccess('PM_DASHBOARD') == 1) {
$url = 'dashboard/dashboard';
} else {
$url = 'users/myInfo';
}
}
return $baseUrl . $url;
}
示例7: getConfigGmail
public function getConfigGmail()
{
$conf = new Configurations();
$conf->loadConfig($gmail, 'GOOGLE_API_SETTINGS', '');
return $conf;
}
示例8: upgradeCacheView
/**
* Upgrade the AppCacheView table to the latest system version.
*
* This recreates the table and populates with data.
*
* @param bool $checkOnly only check if the upgrade is needed if true
* @param string $lang not currently used
*/
public function upgradeCacheView($fill = true, $checkOnly = false, $lang = "en")
{
$this->initPropel(true);
//require_once ('classes/model/AppCacheView.php');
//check the language, if no info in config about language, the default is 'en'
G::LoadClass("configuration");
$oConf = new Configurations();
$oConf->loadConfig($x, 'APP_CACHE_VIEW_ENGINE', '', '', '', '');
$appCacheViewEngine = $oConf->aConfig;
//setup the appcacheview object, and the path for the sql files
$appCache = new AppCacheView();
$appCache->setPathToAppCacheFiles(PATH_METHODS . 'setup' . PATH_SEP . 'setupSchemas' . PATH_SEP);
$userGrants = $appCache->checkGrantsForUser(false);
$currentUser = $userGrants['user'];
$currentUserIsSuper = $userGrants['super'];
//if user does not have the SUPER privilege we need to use the root user and grant the SUPER priv. to normal user.
if (!$currentUserIsSuper) {
$appCache->checkGrantsForUser(true);
$appCache->setSuperForUser($currentUser);
$currentUserIsSuper = true;
}
CLI::logging("-> Creating tables \n");
//now check if table APPCACHEVIEW exists, and it have correct number of fields, etc.
$res = $appCache->checkAppCacheView();
CLI::logging("-> Update DEL_LAST_INDEX field in APP_DELEGATION table \n");
//Update APP_DELEGATION.DEL_LAST_INDEX data
$res = $appCache->updateAppDelegationDelLastIndex($lang, $checkOnly);
CLI::logging("-> Verifying roles permissions in RBAC \n");
//Update table RBAC permissions
Bootstrap::LoadSystem( 'rbac' );
$RBAC = & RBAC::getSingleton();
$RBAC->initRBAC();
$result = $RBAC->verifyPermissions();
//.........这里部分代码省略.........
示例9: upgradeCacheView
/**
* Upgrade the AppCacheView table to the latest system version.
*
* This recreates the table and populates with data.
*
* @param bool $checkOnly only check if the upgrade is needed if true
* @param string $lang not currently used
*/
public function upgradeCacheView($fill = true, $checkOnly = false, $lang = "en")
{
$this->initPropel(true);
//require_once ('classes/model/AppCacheView.php');
//check the language, if no info in config about language, the default is 'en'
G::LoadClass("configuration");
$oConf = new Configurations();
$oConf->loadConfig($x, 'APP_CACHE_VIEW_ENGINE', '', '', '', '');
$appCacheViewEngine = $oConf->aConfig;
//setup the appcacheview object, and the path for the sql files
$appCache = new AppCacheView();
$appCache->setPathToAppCacheFiles(PATH_METHODS . 'setup' . PATH_SEP . 'setupSchemas' . PATH_SEP);
$userGrants = $appCache->checkGrantsForUser(false);
$currentUser = $userGrants['user'];
$currentUserIsSuper = $userGrants['super'];
//if user does not have the SUPER privilege we need to use the root user and grant the SUPER priv. to normal user.
if (!$currentUserIsSuper) {
$appCache->checkGrantsForUser(true);
$appCache->setSuperForUser($currentUser);
$currentUserIsSuper = true;
}
CLI::logging("-> Creating table\n");
//now check if table APPCACHEVIEW exists, and it have correct number of fields, etc.
$res = $appCache->checkAppCacheView();
CLI::logging("-> Update DEL_LAST_INDEX field in APP_DELEGATION table\n");
//Update APP_DELEGATION.DEL_LAST_INDEX data
$res = $appCache->updateAppDelegationDelLastIndex($lang, $checkOnly);
CLI::logging("-> Verifying roles permissions in RBAC \n");
//Update table RBAC permissions
Bootstrap::LoadSystem('rbac');
$RBAC =& RBAC::getSingleton();
$RBAC->initRBAC();
$result = $RBAC->verifyPermissions();
if (count($result) > 1) {
foreach ($result as $item) {
CLI::logging(" {$item}... \n");
}
} else {
CLI::logging(" All roles permissions already updated \n");
}
CLI::logging("-> Creating triggers\n");
//now check if we have the triggers installed
$triggers = array();
$triggers[] = $appCache->triggerAppDelegationInsert($lang, $checkOnly);
$triggers[] = $appCache->triggerAppDelegationUpdate($lang, $checkOnly);
$triggers[] = $appCache->triggerApplicationUpdate($lang, $checkOnly);
$triggers[] = $appCache->triggerApplicationDelete($lang, $checkOnly);
$triggers[] = $appCache->triggerSubApplicationInsert($lang, $checkOnly);
$triggers[] = $appCache->triggerContentUpdate($lang, $checkOnly);
if ($fill) {
CLI::logging("-> Rebuild Cache View with language {$lang}...\n");
//build using the method in AppCacheView Class
$res = $appCache->fillAppCacheView($lang);
//set status in config table
$confParams = array('LANG' => $lang, 'STATUS' => 'active');
}
$oConf->aConfig = $confParams;
$oConf->saveConfig('APP_CACHE_VIEW_ENGINE', '', '', '');
// removing casesList configuration records. TODO: removing these lines that resets all the configurations records
$oCriteria = new Criteria();
$oCriteria->add(ConfigurationPeer::CFG_UID, "casesList");
$oCriteria->add(ConfigurationPeer::OBJ_UID, array("todo", "draft", "sent", "unassigned", "paused", "cancelled"), Criteria::NOT_IN);
ConfigurationPeer::doDelete($oCriteria);
// end of reset
}
示例10: getProcessList
/**
* @param $action
* @param $categoryUid
* @param $userUid
* @return array
* @throws \PropelException
*/
public function getProcessList ($action, $categoryUid, $userUid)
{
//$action = isset( $_REQUEST['action'] ) ? $_REQUEST['action'] : null;
//$categoryUid = isset( $_REQUEST['CATEGORY_UID'] ) ? $_REQUEST['CATEGORY_UID'] : null;
//$userUid = (isset( $_SESSION['USER_LOGGED'] ) && $_SESSION['USER_LOGGED'] != '') ? $_SESSION['USER_LOGGED'] : null;
// global $oAppCache;
$oAppCache = new \AppCacheView();
$processes = array ();
$processes[] = array ('',G::LoadTranslation( 'ID_ALL_PROCESS' ));
//get the list based in the action provided
switch ($action) {
case 'draft':
$cProcess = $oAppCache->getDraftListCriteria( $userUid ); //fast enough
break;
case 'sent':
$cProcess = $oAppCache->getSentListProcessCriteria( $userUid ); // fast enough
break;
case 'simple_search':
case 'search':
//in search action, the query to obtain all process is too slow, so we need to query directly to
//process and content tables, and for that reason we need the current language in AppCacheView.
G::loadClass( 'configuration' );
$oConf = new \Configurations();
$oConf->loadConfig( $x, 'APP_CACHE_VIEW_ENGINE', '', '', '', '' );
$appCacheViewEngine = $oConf->aConfig;
$lang = isset( $appCacheViewEngine['LANG'] ) ? $appCacheViewEngine['LANG'] : 'en';
$cProcess = new Criteria( 'workflow' );
$cProcess->clearSelectColumns();
$cProcess->addSelectColumn( \ProcessPeer::PRO_UID );
$cProcess->addSelectColumn( \ContentPeer::CON_VALUE );
if ($categoryUid) {
$cProcess->add( \ProcessPeer::PRO_CATEGORY, $categoryUid );
}
$del = DBAdapter::getStringDelimiter();
$conds = array ();
$conds[] = array (ProcessPeer::PRO_UID,ContentPeer::CON_ID);
$conds[] = array (ContentPeer::CON_CATEGORY,$del . 'PRO_TITLE' . $del);
$conds[] = array (ContentPeer::CON_LANG,$del . $lang . $del);
$cProcess->addJoinMC( $conds, Criteria::LEFT_JOIN );
$cProcess->add( ProcessPeer::PRO_STATUS, 'ACTIVE' );
$cProcess->addAscendingOrderByColumn(ContentPeer::CON_VALUE);
$oDataset = ProcessPeer::doSelectRS( $cProcess );
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$oDataset->next();
while ($aRow = $oDataset->getRow()) {
$processes[] = array ($aRow['PRO_UID'],$aRow['CON_VALUE']
);
$oDataset->next();
}
return print G::json_encode( $processes );
break;
case 'unassigned':
$cProcess = $oAppCache->getUnassignedListCriteria( $userUid );
break;
case 'paused':
$cProcess = $oAppCache->getPausedListCriteria( $userUid );
break;
case 'to_revise':
$cProcess = $oAppCache->getToReviseListCriteria( $userUid );
break;
case 'to_reassign':
$cProcess = $oAppCache->getToReassignListCriteria($userUid);
break;
case 'gral':
$cProcess = $oAppCache->getGeneralListCriteria();
break;
case 'todo':
default:
$cProcess = $oAppCache->getToDoListCriteria( $userUid ); //fast enough
break;
}
//get the processes for this user in this action
$cProcess->clearSelectColumns();
$cProcess->addSelectColumn( \AppCacheViewPeer::PRO_UID );
$cProcess->addSelectColumn( \AppCacheViewPeer::APP_PRO_TITLE );
$cProcess->setDistinct( \AppCacheViewPeer::PRO_UID );
if ($categoryUid) {
require_once 'classes/model/Process.php';
$cProcess->addAlias( 'CP', 'PROCESS' );
$cProcess->add( 'CP.PRO_CATEGORY', $categoryUid, Criteria::EQUAL );
$cProcess->addJoin( \AppCacheViewPeer::PRO_UID, 'CP.PRO_UID', Criteria::LEFT_JOIN );
$cProcess->addAsColumn( 'CATEGORY_UID', 'CP.PRO_CATEGORY' );
}
$cProcess->addAscendingOrderByColumn(\AppCacheViewPeer::APP_PRO_TITLE);
$oDataset = \AppCacheViewPeer::doSelectRS( $cProcess, \Propel::getDbConnection('workflow_ro') );
$oDataset->setFetchmode( \ResultSet::FETCHMODE_ASSOC );
//.........这里部分代码省略.........
示例11: loadFields
/**
* loadFields for email configuration
* @autor Alvaro <alvaro@colosa.com>
*/
public function loadFields()
{
G::loadClass('configuration');
$oConfiguration = new Configurations();
$oConfiguration->loadConfig($x, 'Emails', '', '', '', '');
$fields = $oConfiguration->aConfig;
if (count($fields) > 0) {
$this->success = count($fields) > 0;
$passwd = $fields['MESS_PASSWORD'];
$passwdDec = G::decrypt($passwd, 'EMAILENCRYPT');
if (strpos($passwdDec, 'hash:') !== false) {
list($hash, $pass) = explode(":", $passwdDec);
$fields['MESS_PASSWORD'] = $pass;
}
}
$this->data = $fields;
}
示例12: getAllProcesses
function getAllProcesses($start, $limit, $category = NULL, $processName = NULL)
{
require_once PATH_RBAC . "model/RbacUsers.php";
require_once "classes/model/ProcessCategory.php";
require_once "classes/model/Users.php";
$user = new RbacUsers();
$aProcesses = array();
$categories = array();
$oCriteria = new Criteria('workflow');
$oCriteria->addSelectColumn(ProcessPeer::PRO_UID);
$oCriteria->addSelectColumn(ProcessPeer::PRO_PARENT);
$oCriteria->addSelectColumn(ProcessPeer::PRO_STATUS);
$oCriteria->addSelectColumn(ProcessPeer::PRO_CATEGORY);
$oCriteria->addSelectColumn(ProcessPeer::PRO_CREATE_DATE);
$oCriteria->addSelectColumn(ProcessPeer::PRO_CREATE_USER);
$oCriteria->addSelectColumn(ProcessPeer::PRO_DEBUG);
$oCriteria->addSelectColumn(UsersPeer::USR_UID);
$oCriteria->addSelectColumn(UsersPeer::USR_USERNAME);
$oCriteria->addSelectColumn(UsersPeer::USR_FIRSTNAME);
$oCriteria->addSelectColumn(UsersPeer::USR_LASTNAME);
$oCriteria->addSelectColumn(ProcessCategoryPeer::CATEGORY_UID);
$oCriteria->addSelectColumn(ProcessCategoryPeer::CATEGORY_NAME);
$oCriteria->add(ProcessPeer::PRO_UID, '', Criteria::NOT_EQUAL);
$oCriteria->add(ProcessPeer::PRO_STATUS, 'DISABLED', Criteria::NOT_EQUAL);
if (isset($category)) {
$oCriteria->add(ProcessPeer::PRO_CATEGORY, $category, Criteria::EQUAL);
}
$oCriteria->addJoin(ProcessPeer::PRO_CREATE_USER, UsersPeer::USR_UID, Criteria::LEFT_JOIN);
$oCriteria->addJoin(ProcessPeer::PRO_CATEGORY, ProcessCategoryPeer::CATEGORY_UID, Criteria::LEFT_JOIN);
$this->tmpCriteria = clone $oCriteria;
if ($start != '') {
$oCriteria->setOffset($start);
}
if ($limit != '' && !isset($category) && !isset($processName)) {
$oCriteria->setLimit($limit);
}
//execute a query to obtain numbers, how many cases there are by process
$casesCnt = $this->getCasesCountInAllProcesses();
//execute the query
$oDataset = ProcessPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$processes = array();
$uids = array();
while ($oDataset->next()) {
$processes[] = $oDataset->getRow();
$uids[] = $processes[sizeof($processes) - 1]['PRO_UID'];
}
//process details will have the info about the processes
$processesDetails = array();
//now get the labels for all process, using an array of Uids,
$c = new Criteria('workflow');
//$c->add ( ContentPeer::CON_CATEGORY, 'PRO_TITLE', Criteria::EQUAL );
$c->add(ContentPeer::CON_LANG, defined('SYS_LANG') ? SYS_LANG : 'en', Criteria::EQUAL);
$c->add(ContentPeer::CON_ID, $uids, Criteria::IN);
$dt = ContentPeer::doSelectRS($c);
$dt->setFetchmode(ResultSet::FETCHMODE_ASSOC);
while ($dt->next()) {
$row = $dt->getRow();
$processesDetails[$row['CON_ID']][$row['CON_CATEGORY']] = $row['CON_VALUE'];
}
G::loadClass('configuration');
$oConf = new Configurations();
$oConf->loadConfig($obj, 'ENVIRONMENT_SETTINGS', '');
foreach ($processes as $process) {
$proTitle = isset($processesDetails[$process['PRO_UID']]) && isset($processesDetails[$process['PRO_UID']]['PRO_TITLE']) ? $processesDetails[$process['PRO_UID']]['PRO_TITLE'] : '';
$proDescription = isset($processesDetails[$process['PRO_UID']]) && isset($processesDetails[$process['PRO_UID']]['PRO_DESCRIPTION']) ? $processesDetails[$process['PRO_UID']]['PRO_DESCRIPTION'] : '';
// verify if the title is already set on the current language
if (trim($proTitle) == '') {
// if not, then load the record to generate content for current language
$proData = $this->load($process['PRO_UID']);
$proTitle = $proData['PRO_TITLE'];
$proDescription = $proData['PRO_DESCRIPTION'];
}
//filtering by $processName
if (isset($processName) && $processName != '' && stripos($proTitle, $processName) === false) {
continue;
}
$casesCountTotal = 0;
if (isset($casesCnt[$process['PRO_UID']])) {
foreach ($casesCnt[$process['PRO_UID']] as $item) {
$casesCountTotal += $item;
}
}
//get user format from configuration
$userOwner = isset($oConf->aConfig['format']) ? $oConf->aConfig['format'] : '';
$creationDateMask = isset($oConf->aConfig['dateFormat']) ? $oConf->aConfig['dateFormat'] : '';
if ($userOwner != '') {
$userOwner = str_replace('@userName', $process['USR_USERNAME'], $userOwner);
$userOwner = str_replace('@firstName', $process['USR_FIRSTNAME'], $userOwner);
$userOwner = str_replace('@lastName', $process['USR_LASTNAME'], $userOwner);
if ($userOwner == " ( )") {
$userOwner = '-';
}
} else {
$userOwner = $process['USR_FIRSTNAME'] . ' ' . $process['USR_LASTNAME'];
}
//get date format from configuration
if ($creationDateMask != '') {
list($date, $time) = explode(' ', $process['PRO_CREATE_DATE']);
list($y, $m, $d) = explode('-', $date);
//.........这里部分代码省略.........
示例13: sendNotifications
public function sendNotifications($taskUid, $arrayTask, $arrayData, $applicationUid, $delIndex, $from = '')
{
try {
$arrayApplicationData = $this->loadCase($applicationUid);
$arrayData['APP_NUMBER'] = $arrayApplicationData['APP_NUMBER'];
if (!class_exists('System')) {
G::LoadClass('system');
}
$aConfiguration = System::getEmailConfiguration();
$msgError = "";
if (!isset($aConfiguration['MESS_ENABLED']) || $aConfiguration['MESS_ENABLED'] != '1') {
$msgError = "The default configuration wasn't defined";
$aConfiguration['MESS_ENGINE'] = '';
}
//Send derivation notification - Start
$oTask = new Task();
$aTaskInfo = $oTask->load($taskUid);
if ($aTaskInfo['TAS_SEND_LAST_EMAIL'] != 'TRUE') {
return false;
}
$from = G::buildFrom($aConfiguration, $from);
if (isset($aTaskInfo['TAS_DEF_SUBJECT_MESSAGE']) && $aTaskInfo['TAS_DEF_SUBJECT_MESSAGE'] != '') {
$sSubject = G::replaceDataField($aTaskInfo['TAS_DEF_SUBJECT_MESSAGE'], $arrayData);
} 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)) {
$tempale = PATH_CORE . "templates" . PATH_SEP . "mails" . PATH_SEP . "alert_message.html";
$copied = @copy($tempale, $fileTemplate);
if ($copied) {
$dataTemplate = array("prf_filename" => $conf["TAS_DEF_MESSAGE_TEMPLATE"], "prf_path" => $fileTemplate, "pro_uid" => $aTaskInfo["PRO_UID"], "usr_uid" => "00000000000000000000000000000001", "prf_uid" => G::generateUniqueID(), "prf_type" => "file", "prf_create_date" => date("Y-m-d H:i:s"));
$filesManager = new ProcessMaker\BusinessModel\FilesManager();
$filesManager->addProcessFilesManagerInDb($dataTemplate);
} else {
throw new Exception("Template file \"{$fileTemplate}\" does not exist.");
}
}
$sBody = file_get_contents($fileTemplate);
} else {
$sBody = nl2br($aTaskInfo['TAS_DEF_MESSAGE']);
}
G::LoadClass("tasks");
G::LoadClass("groups");
G::LoadClass("spool");
$task = new Tasks();
$group = new Groups();
$oUser = new Users();
foreach ($arrayTask as $aTask) {
$sTo = null;
$sCc = null;
if (isset($aTask['DEL_INDEX'])) {
$arrayData2 = $arrayData;
$appDelegation = AppDelegationPeer::retrieveByPK($applicationUid, $aTask['DEL_INDEX']);
if (!is_null($appDelegation)) {
$arrayData2['TAS_TITLE'] = Content::load('TAS_TITLE', '', $appDelegation->getTasUid(), SYS_LANG);
$arrayData2['DEL_TASK_DUE_DATE'] = $appDelegation->getDelTaskDueDate();
}
} else {
$arrayData2 = $arrayData;
}
if (isset($aTask['USR_UID']) && !empty($aTask['USR_UID'])) {
$user = new \ProcessMaker\BusinessModel\User();
$arrayUserData = $user->getUser($aTask['USR_UID'], true);
$arrayData2 = \ProcessMaker\Util\DateTime::convertUtcToTimeZone($arrayData2, trim($arrayUserData['USR_TIME_ZONE']) != '' ? trim($arrayUserData['USR_TIME_ZONE']) : \ProcessMaker\Util\System::getTimeZone());
} else {
$arrayData2 = \ProcessMaker\Util\DateTime::convertUtcToTimeZone($arrayData2);
}
$sBody2 = G::replaceDataGridField($sBody, $arrayData2, false);
switch ($aTask["TAS_ASSIGN_TYPE"]) {
case "SELF_SERVICE":
if ($swtplDefault == 1) {
G::verifyPath($pathEmail, true);
//Create if it does not exist
$fileTemplate = $pathEmail . G::LoadTranslation('ID_UNASSIGNED_MESSAGE');
if (!file_exists($fileTemplate) && file_exists(PATH_TPL . "mails" . PATH_SEP . G::LoadTranslation('ID_UNASSIGNED_MESSAGE'))) {
@copy(PATH_TPL . "mails" . PATH_SEP . G::LoadTranslation('ID_UNASSIGNED_MESSAGE'), $fileTemplate);
}
$sBody2 = G::replaceDataField(file_get_contents($fileTemplate), $arrayData2);
}
if (isset($aTask["TAS_UID"]) && !empty($aTask["TAS_UID"])) {
$arrayTaskUser = array();
$arrayAux1 = $task->getGroupsOfTask($aTask["TAS_UID"], 1);
foreach ($arrayAux1 as $arrayGroup) {
$arrayAux2 = $group->getUsersOfGroup($arrayGroup["GRP_UID"]);
foreach ($arrayAux2 as $arrayUser) {
$arrayTaskUser[] = $arrayUser["USR_UID"];
}
//.........这里部分代码省略.........
示例14: 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) {
//.........这里部分代码省略.........
示例15: isset
<?php
$request = isset($_REQUEST['request']) ? $_REQUEST['request'] : null;
switch ($request) {
case 'getLangList':
$Translations = G::getModel('Translation');
$result = new stdClass();
$result->rows = array();
$langs = $Translations->getTranslationEnvironments();
foreach ($langs as $lang) {
$result->rows[] = array('LAN_ID' => $lang['LOCALE'], 'LAN_NAME' => $lang['LANGUAGE']);
}
print G::json_encode($result);
break;
case 'saveSettings':
$memcache =& PMmemcached::getSingleton(defined('SYS_SYS') ? SYS_SYS : '');
G::LoadClass('configuration');
$conf = new Configurations();
$conf->loadConfig($obj, 'ENVIRONMENT_SETTINGS', '');
$conf->aConfig['login_enableForgotPassword'] = isset($_REQUEST['forgotPasswd']);
$conf->aConfig['login_enableVirtualKeyboard'] = isset($_REQUEST['virtualKeyboad']);
$conf->aConfig['login_defaultLanguage'] = isset($_REQUEST['lang']) ? $_REQUEST['lang'] : 'en';
$conf->saveConfig('ENVIRONMENT_SETTINGS', '');
//remove from memcache when this value is updated/created
$memcache->delete('flagForgotPassword');
$response->success = true;
echo G::json_encode($response);
break;
}