本文整理汇总了PHP中ConfigurationPeer类的典型用法代码示例。如果您正苦于以下问题:PHP ConfigurationPeer类的具体用法?PHP ConfigurationPeer怎么用?PHP ConfigurationPeer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ConfigurationPeer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: remove
/**
* @static
* @param $name
* @return void
*/
public static function remove($name)
{
$configuration = ConfigurationPeer::retrieveByName($name);
if ($configuration) {
$configuration->delete();
}
}
示例2: getInternetConnection
public static function getInternetConnection()
{
$data = array();
$criteria = new Criteria("workflow");
$criteria->addSelectColumn(ConfigurationPeer::CFG_VALUE);
$criteria->add(ConfigurationPeer::CFG_UID, "EE");
$criteria->add(ConfigurationPeer::OBJ_UID, "enterpriseConfiguration");
$rsCriteria = ConfigurationPeer::doSelectRS($criteria);
if ($rsCriteria->next()) {
$row = $rsCriteria->getRow();
$data = unserialize($row[0]);
}
return isset($data["internetConnection"]) ? intval($data["internetConnection"]) : 1;
}
示例3: 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';
}
}
示例4: get
/**
* Implementation for 'GET' method for Rest API
*
* @param mixed $cfgUid, $objUid, $proUid, $usrUid, $appUid Primary key
*
* @return array $result Returns array within multiple records or a single record depending if
* a single selection was requested passing id(s) as param
*/
protected function get($cfgUid = null, $objUid = null, $proUid = null, $usrUid = null, $appUid = null)
{
$result = array();
try {
$noArguments = true;
$argumentList = func_get_args();
foreach ($argumentList as $arg) {
if (!is_null($arg)) {
$noArguments = false;
}
}
if ($noArguments) {
$criteria = new Criteria('workflow');
$criteria->addSelectColumn(ConfigurationPeer::CFG_UID);
$criteria->addSelectColumn(ConfigurationPeer::OBJ_UID);
$criteria->addSelectColumn(ConfigurationPeer::CFG_VALUE);
$criteria->addSelectColumn(ConfigurationPeer::PRO_UID);
$criteria->addSelectColumn(ConfigurationPeer::USR_UID);
$criteria->addSelectColumn(ConfigurationPeer::APP_UID);
$dataset = AppEventPeer::doSelectRS($criteria);
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
while ($dataset->next()) {
$result[] = $dataset->getRow();
}
} else {
$record = ConfigurationPeer::retrieveByPK($cfgUid, $objUid, $proUid, $usrUid, $appUid);
if ($record) {
$result = $record->toArray(BasePeer::TYPE_FIELDNAME);
} else {
$paramValues = "";
foreach ($argumentList as $arg) {
$paramValues .= strlen($paramValues) ? ', ' : '';
if (!is_null($arg)) {
$paramValues .= "{$arg}";
} else {
$paramValues .= "NULL";
}
}
throw new RestException(417, "table Configuration ({$paramValues})");
}
}
} catch (RestException $e) {
throw new RestException($e->getCode(), $e->getMessage());
} catch (Exception $e) {
throw new RestException(412, $e->getMessage());
}
return $result;
}
示例5: deleteTask
/**
* Delete a task
*
* @param string $sTaskUID
* @return void
*/
public function deleteTask($sTaskUID = '')
{
try {
//Instance classes
$oTask = new Task();
$oTasks = new Tasks();
$oTaskUser = new TaskUser();
$oStep = new Step();
$oStepTrigger = new StepTrigger();
//Get task information
$aFields = $oTask->load($sTaskUID);
//Delete routes
$oTasks->deleteAllRoutesOfTask($aFields['PRO_UID'], $sTaskUID, true);
//Delete gateways
$oTasks->deleteAllGatewayOfTask($aFields['PRO_UID'], $sTaskUID, true);
//Delete the users assigned to task
$oCriteria = new Criteria('workflow');
$oCriteria->add(TaskUserPeer::TAS_UID, $sTaskUID);
$oDataset1 = TaskUserPeer::doSelectRS($oCriteria);
$oDataset1->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset1->next();
while ($aRow1 = $oDataset1->getRow()) {
$oTaskUser->remove($aRow1['TAS_UID'], $aRow1['USR_UID'], $aRow1['TU_TYPE'], $aRow1['TU_RELATION']);
$oDataset1->next();
}
//Delete the steps of task
$oCriteria = new Criteria('workflow');
$oCriteria->add(StepPeer::TAS_UID, $sTaskUID);
$oDataset1 = StepPeer::doSelectRS($oCriteria);
$oDataset1->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset1->next();
while ($aRow1 = $oDataset1->getRow()) {
//Delete the triggers assigned to step
/* $oCriteria = new Criteria('workflow');
$oCriteria->add(StepTriggerPeer::STEP_UID, $aRow1['STEP_UID']);
$oDataset2 = StepTriggerPeer::doSelectRS($oCriteria);
$oDataset2->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset2->next();
while ($aRow2 = $oDataset2->getRow()) {
$oStepTrigger->remove($aRow2['STEP_UID'], $aRow2['TAS_UID'], $aRow2['TRI_UID'], $aRow2['ST_TYPE']);
$oDataset2->next();
} */
$oStep->remove($aRow1['STEP_UID']);
$oDataset1->next();
}
//Delete step triggers
$oCriteria = new Criteria('workflow');
$oCriteria->add(StepTriggerPeer::TAS_UID, $sTaskUID);
StepTriggerPeer::doDelete($oCriteria);
//Delete permissions
$oCriteria = new Criteria('workflow');
$oCriteria->add(ObjectPermissionPeer::TAS_UID, $sTaskUID);
ObjectPermissionPeer::doDelete($oCriteria);
$oCriteria = new Criteria('workflow');
$oCriteria->add(ObjectPermissionPeer::OP_TASK_SOURCE, $sTaskUID);
ObjectPermissionPeer::doDelete($oCriteria);
//Delete Cases Schedulers
$criteria = new Criteria("workflow");
$criteria->add(CaseSchedulerPeer::TAS_UID, $sTaskUID, Criteria::EQUAL);
$result = CaseSchedulerPeer::doDelete($criteria);
//Delete Configuration
$criteria = new Criteria("workflow");
$criteria->add(ConfigurationPeer::OBJ_UID, $sTaskUID, Criteria::EQUAL);
$result = ConfigurationPeer::doDelete($criteria);
//Delete task
$oTask->remove($sTaskUID);
} catch (Exception $oError) {
throw $oError;
}
}
示例6: 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 = '';
示例7: getTaskExtraPropertiesRows
/**
* get rows related to Task extra properties of the process seleceted
*
* @param $proId process Uid
* @return $result
*/
public function getTaskExtraPropertiesRows($proId)
{
try {
$oCriteria = new Criteria('workflow');
$oCriteria->addSelectColumn( ConfigurationPeer::CFG_UID );
$oCriteria->addSelectColumn( ConfigurationPeer::OBJ_UID );
$oCriteria->addSelectColumn( ConfigurationPeer::CFG_VALUE );
$oCriteria->addSelectColumn( ConfigurationPeer::PRO_UID );
$oCriteria->addSelectColumn( ConfigurationPeer::USR_UID );
$oCriteria->addSelectColumn( ConfigurationPeer::APP_UID );
$oCriteria->add( TaskPeer::PRO_UID, $proId );
$oCriteria->add( ConfigurationPeer::CFG_UID, 'TAS_EXTRA_PROPERTIES' );
$oCriteria->addJoin( ConfigurationPeer::OBJ_UID, TaskPeer::TAS_UID );
$oDataset = ConfigurationPeer::doSelectRS( $oCriteria );
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$oDataset->next();
$aConfRows = array();
while ($aRow = $oDataset->getRow()) {
$aConfRows[] = $aRow;
$oDataset->next();
}
return $aConfRows;
} catch (Exception $oError) {
throw ($oError);
}
}
示例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');
$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;
}
}
示例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)
{
$this->initPropel(true);
$lang = "en";
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("-> 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->triggerContentUpdate($lang, $checkOnly);
if ($fill) {
CLI::logging("-> Rebuild Cache View\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: retrieveByPK
/**
* Retrieve object using using composite pkey values.
* @param string $cfg_uid
@param string $obj_uid
@param string $pro_uid
@param string $usr_uid
@param string $app_uid
* @param Connection $con
* @return Configuration
*/
public static function retrieveByPK($cfg_uid, $obj_uid, $pro_uid, $usr_uid, $app_uid, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$criteria = new Criteria();
$criteria->add(ConfigurationPeer::CFG_UID, $cfg_uid);
$criteria->add(ConfigurationPeer::OBJ_UID, $obj_uid);
$criteria->add(ConfigurationPeer::PRO_UID, $pro_uid);
$criteria->add(ConfigurationPeer::USR_UID, $usr_uid);
$criteria->add(ConfigurationPeer::APP_UID, $app_uid);
$v = ConfigurationPeer::doSelect($criteria, $con);
return !empty($v) ? $v[0] : null;
}
示例11: deleteProcess
//.........这里部分代码省略.........
}
//Delete the gateways of process
$oCriteria = new Criteria('workflow');
$oCriteria->add(GatewayPeer::PRO_UID, $sProcessUID);
$oDataset = GatewayPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
while ($aRow = $oDataset->getRow()) {
$oGateway->remove($aRow['GAT_UID']);
$oDataset->next();
}
//Delete the Event of process
$oCriteria = new Criteria('workflow');
$oCriteria->add(EventPeer::PRO_UID, $sProcessUID);
$oDataset = EventPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
while ($aRow = $oDataset->getRow()) {
$oEvent->remove($aRow['EVN_UID']);
$oDataset->next();
}
//Delete the swimlanes elements of process
$oCriteria = new Criteria('workflow');
$oCriteria->add(SwimlanesElementsPeer::PRO_UID, $sProcessUID);
$oDataset = SwimlanesElementsPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
while ($aRow = $oDataset->getRow()) {
$oSwimlaneElement->remove($aRow['SWI_UID']);
$oDataset->next();
}
//Delete the configurations of process
$oCriteria = new Criteria('workflow');
$oCriteria->add(ConfigurationPeer::PRO_UID, $sProcessUID);
$oDataset = ConfigurationPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
while ($aRow = $oDataset->getRow()) {
$oConfiguration->remove($aRow['CFG_UID'], $aRow['OBJ_UID'], $aRow['PRO_UID'], $aRow['USR_UID'], $aRow['APP_UID']);
$oDataset->next();
}
//Delete the DB sources of process
$oCriteria = new Criteria('workflow');
$oCriteria->add(DbSourcePeer::PRO_UID, $sProcessUID);
$oDataset = DbSourcePeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
while ($aRow = $oDataset->getRow()) {
/**
* note added by gustavo cruz gustavo-at-colosa-dot-com 27-01-2010
* in order to solve the bug 0004389, we use the validation function Exists
* inside the remove function in order to verify if the DbSource record
* exists in the Database, however there is a strange behavior within the
* propel engine, when the first record is erased somehow the "_deleted"
* attribute of the next row is set to true, so when propel tries to erase
* it, obviously it can't and trows an error. With the "Exist" function
* we ensure that if there is the record in the database, the _delete attribute must be false.
*
* note added by gustavo cruz gustavo-at-colosa-dot-com 28-01-2010
* I have just identified the source of the issue, when is created a $oDbSource DbSource object
* it's used whenever a record is erased or removed in the db, however the problem
* it's that the same object is used every time, and the delete method invoked
* sets the _deleted attribute to true when its called, of course as we use
* the same object, the first time works fine but trowns an error with the
* next record, cos it's the same object and the delete method checks if the _deleted
* attribute it's true or false, the attrib _deleted is setted to true the
示例12: update
public function update($fields)
{
require_once "classes/model/AppCacheView.php";
require_once "classes/model/Configuration.php";
$con = Propel::getConnection(TaskPeer::DATABASE_NAME);
try {
$con->begin();
$this->load($fields["TAS_UID"]);
$this->fromArray($fields, BasePeer::TYPE_FIELDNAME);
if ($this->validate()) {
$taskDefTitlePrevious = null;
$criteria = new Criteria("workflow");
$criteria->addSelectColumn(ContentPeer::CON_VALUE);
$criteria->add(ContentPeer::CON_CATEGORY, "TAS_DEF_TITLE");
$criteria->add(ContentPeer::CON_ID, $fields["TAS_UID"]);
$criteria->add(ContentPeer::CON_LANG, SYS_LANG);
$rsCriteria = ContentPeer::doSelectRS($criteria);
$rsCriteria->setFetchmode(ResultSet::FETCHMODE_ASSOC);
while ($rsCriteria->next()) {
$row = $rsCriteria->getRow();
$taskDefTitlePrevious = $row["CON_VALUE"];
}
$contentResult = 0;
if (array_key_exists("TAS_TITLE", $fields)) {
$contentResult += $this->setTasTitle($fields["TAS_TITLE"]);
}
if (array_key_exists("TAS_DESCRIPTION", $fields)) {
$contentResult += $this->setTasDescription($fields["TAS_DESCRIPTION"]);
}
if (array_key_exists("TAS_DEF_TITLE", $fields)) {
$contentResult += $this->setTasDefTitle($fields["TAS_DEF_TITLE"]);
}
if (array_key_exists("TAS_DEF_DESCRIPTION", $fields)) {
$contentResult += $this->setTasDefDescription($fields["TAS_DEF_DESCRIPTION"]);
}
if (array_key_exists("TAS_DEF_PROC_CODE", $fields)) {
$contentResult += $this->setTasDefProcCode($fields["TAS_DEF_PROC_CODE"]);
}
if (array_key_exists("TAS_DEF_MESSAGE", $fields)) {
$contentResult += $this->setTasDefMessage(trim($fields["TAS_DEF_MESSAGE"]));
}
if (array_key_exists("TAS_DEF_SUBJECT_MESSAGE", $fields)) {
$contentResult += $this->setTasDefSubjectMessage(trim($fields["TAS_DEF_SUBJECT_MESSAGE"]));
}
if (array_key_exists("TAS_CALENDAR", $fields)) {
$contentResult += $this->setTasCalendar($fields['TAS_UID'], $fields["TAS_CALENDAR"]);
}
$result = $this->save();
$result = $result == 0 ? $contentResult > 0 ? 1 : 0 : $result;
$con->commit();
if ($result == 1 && array_key_exists("TAS_DEF_TITLE", $fields) && $fields["TAS_DEF_TITLE"] != $taskDefTitlePrevious) {
$criteria = new Criteria("workflow");
$criteria->addAsColumn("APPCV_NUM_ROWS", "COUNT(DISTINCT " . AppCacheViewPeer::APP_UID . ")");
$criteria->add(AppCacheViewPeer::DEL_THREAD_STATUS, "OPEN");
$criteria->add(AppCacheViewPeer::TAS_UID, $fields["TAS_UID"]);
$rsCriteria = AppCacheViewPeer::doSelectRS($criteria);
$rsCriteria->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$rsCriteria->next();
$row = $rsCriteria->getRow();
$appcvNumRows = intval($row["APPCV_NUM_ROWS"]);
if ($appcvNumRows <= 1000) {
$appcv = new AppCacheView();
$appcv->appTitleByTaskCaseLabelUpdate($fields["TAS_UID"], SYS_LANG);
$result = 2;
} else {
//Delete record
$criteria = new Criteria("workflow");
$criteria->add(ConfigurationPeer::CFG_UID, "TAS_APP_TITLE_UPDATE");
$criteria->add(ConfigurationPeer::OBJ_UID, $fields["TAS_UID"]);
$criteria->add(ConfigurationPeer::CFG_VALUE, SYS_LANG);
$numRowDeleted = ConfigurationPeer::doDelete($criteria);
//Insert record
$conf = new Configuration();
$conf->create(array("CFG_UID" => "TAS_APP_TITLE_UPDATE", "OBJ_UID" => $fields["TAS_UID"], "CFG_VALUE" => SYS_LANG, "PRO_UID" => "", "USR_UID" => "", "APP_UID" => ""));
$result = 3;
}
}
return $result;
} else {
$con->rollback();
throw new Exception("Failed Validation in class " . get_class($this) . ".");
}
} catch (Exception $e) {
$con->rollback();
throw $e;
}
}
示例13: findPkSimple
/**
* Find object by primary key using raw SQL to go fast.
* Bypass doSelect() and the object formatter by using generated code.
*
* @param mixed $key Primary key to use for the query
* @param PropelPDO $con A connection object
*
* @return Configuration A model object, or null if the key is not found
*/
protected function findPkSimple($key, $con)
{
$sql = 'SELECT `ID`, `NAME`, `VALUE` FROM `configuration` WHERE `ID` = :p0';
try {
$stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key, PDO::PARAM_INT);
$stmt->execute();
} catch (Exception $e) {
Propel::log($e->getMessage(), Propel::LOG_ERR);
throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), $e);
}
$obj = null;
if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
$obj = new Configuration();
$obj->hydrate($row);
ConfigurationPeer::addInstanceToPool($obj, (string) $row[0]);
}
$stmt->closeCursor();
return $obj;
}
示例14: 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
}
示例15: fromArray
/**
* Populates the object using an array.
*
* This is particularly useful when populating an object from one of the
* request arrays (e.g. $_POST). This method goes through the column
* names, checking to see whether a matching key exists in populated
* array. If so the setByName() method is called for that column.
*
* You can specify the key type of the array by additionally passing one
* of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME,
* BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM.
* The default key type is the column's phpname (e.g. 'AuthorId')
*
* @param array $arr An array to populate the object from.
* @param string $keyType The type of keys the array uses.
* @return void
*/
public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
{
$keys = ConfigurationPeer::getFieldNames($keyType);
if (array_key_exists($keys[0], $arr)) {
$this->setId($arr[$keys[0]]);
}
if (array_key_exists($keys[1], $arr)) {
$this->setName($arr[$keys[1]]);
}
if (array_key_exists($keys[2], $arr)) {
$this->setValue($arr[$keys[2]]);
}
}