本文整理汇总了PHP中DBAdapter类的典型用法代码示例。如果您正苦于以下问题:PHP DBAdapter类的具体用法?PHP DBAdapter怎么用?PHP DBAdapter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了DBAdapter类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: pushMsg
public function pushMsg($desc, $detail, $type = MSG_SYSINFO)
{
$o_db = new DBAdapter(array('host' => $this->dbConf->crawler->host, 'username' => $this->dbConf->crawler->username, 'password' => $this->dbConf->crawler->password, 'schema' => $this->dbConf->crawler->schema, 'host' => $this->dbConf->crawler->host));
$sql = "INSERT INTO " . $this->dbConf->crawler->schema . ".messages (m_description,m_detail) VALUES (";
$sql .= "'" . $type . addslashes($desc) . "','" . addslashes($detail) . "')";
//executeNoresSQL($query)
$done = false;
if (!$o_db->executeNoresSQL($sql)) {
unset($o_db);
} else {
unset($o_db);
$done = true;
}
return $done;
}
开发者ID:sergrin,项目名称:crawlers-il,代码行数:15,代码来源:Message.class.php
示例2: existsTitle
/**
* Verify if exists the title of a Group
*
* @param string $groupTitle Title
* @param string $groupUidExclude Unique id of Group to exclude
*
* return bool Return true if exists the title of a Group, false otherwise
*/
public function existsTitle($groupTitle, $groupUidExclude = "")
{
try {
$delimiter = \DBAdapter::getStringDelimiter();
$criteria = new \Criteria("workflow");
$criteria->addSelectColumn(\GroupwfPeer::GRP_UID);
$criteria->addAlias("CT", \ContentPeer::TABLE_NAME);
$arrayCondition = array();
$arrayCondition[] = array(\GroupwfPeer::GRP_UID, "CT.CON_ID", \Criteria::EQUAL);
$arrayCondition[] = array("CT.CON_CATEGORY", $delimiter . "GRP_TITLE" . $delimiter, \Criteria::EQUAL);
$arrayCondition[] = array("CT.CON_LANG", $delimiter . SYS_LANG . $delimiter, \Criteria::EQUAL);
$criteria->addJoinMC($arrayCondition, \Criteria::LEFT_JOIN);
if ($groupUidExclude != "") {
$criteria->add(\GroupwfPeer::GRP_UID, $groupUidExclude, \Criteria::NOT_EQUAL);
}
$criteria->add("CT.CON_VALUE", $groupTitle, \Criteria::EQUAL);
$rsCriteria = \GroupwfPeer::doSelectRS($criteria);
if ($rsCriteria->next()) {
return true;
} else {
return false;
}
} catch (\Exception $e) {
throw $e;
}
}
开发者ID:emildev35,项目名称:processmaker,代码行数:34,代码来源:Group.php
示例3: getTriggerCriteria
/**
* Get criteria for Trigger
*
* return object
*/
public function getTriggerCriteria()
{
try {
$delimiter = \DBAdapter::getStringDelimiter();
$criteria = new \Criteria("workflow");
$criteria->addSelectColumn(\TriggersPeer::TRI_UID);
$criteria->addAsColumn("TRI_TITLE", "CT.CON_VALUE");
$criteria->addAsColumn("TRI_DESCRIPTION", "CD.CON_VALUE");
$criteria->addSelectColumn(\TriggersPeer::TRI_TYPE);
$criteria->addSelectColumn(\TriggersPeer::TRI_WEBBOT);
$criteria->addSelectColumn(\TriggersPeer::TRI_PARAM);
$criteria->addAlias("CT", \ContentPeer::TABLE_NAME);
$criteria->addAlias("CD", \ContentPeer::TABLE_NAME);
$arrayCondition = array();
$arrayCondition[] = array(\TriggersPeer::TRI_UID, "CT.CON_ID", \Criteria::EQUAL);
$arrayCondition[] = array("CT.CON_CATEGORY", $delimiter . "TRI_TITLE" . $delimiter, \Criteria::EQUAL);
$arrayCondition[] = array("CT.CON_LANG", $delimiter . SYS_LANG . $delimiter, \Criteria::EQUAL);
$criteria->addJoinMC($arrayCondition, \Criteria::LEFT_JOIN);
$arrayCondition = array();
$arrayCondition[] = array(\TriggersPeer::TRI_UID, "CD.CON_ID", \Criteria::EQUAL);
$arrayCondition[] = array("CD.CON_CATEGORY", $delimiter . "TRI_DESCRIPTION" . $delimiter, \Criteria::EQUAL);
$arrayCondition[] = array("CD.CON_LANG", $delimiter . SYS_LANG . $delimiter, \Criteria::EQUAL);
$criteria->addJoinMC($arrayCondition, \Criteria::LEFT_JOIN);
return $criteria;
} catch (\Exception $e) {
throw $e;
}
}
开发者ID:emildev35,项目名称:processmaker,代码行数:33,代码来源:Trigger.php
示例4: getEvents
/**
* Get list for Events
* @var string $pro_uid. Uid for Process
* @var string $filter.
* @var string $evn_uid. Uid for Process
*
* @access public
* @author Brayan Pereyra (Cochalo) <[email protected]>
* @copyright Colosa - Bolivia
*
* @return array
*/
public function getEvents($pro_uid, $filter = '', $evn_uid = '')
{
$pro_uid = $this->validateProUid($pro_uid);
if ($evn_uid != '') {
$evn_uid = $this->validateEvnUid($evn_uid);
}
$oProcess = new \Process();
if (!$oProcess->processExists($pro_uid)) {
throw new \Exception(\G::LoadTranslation("ID_PROCESS_NOT_EXIST", array('pro_uid', $pro_uid)));
}
$sDelimiter = \DBAdapter::getStringDelimiter();
$oCriteria = new \Criteria('workflow');
$oCriteria->addSelectColumn(\EventPeer::EVN_UID);
$oCriteria->addSelectColumn(\EventPeer::EVN_ACTION);
$oCriteria->addSelectColumn(\EventPeer::EVN_STATUS);
$oCriteria->addSelectColumn(\EventPeer::EVN_WHEN_OCCURS);
$oCriteria->addSelectColumn(\EventPeer::EVN_RELATED_TO);
$oCriteria->addAsColumn('EVN_DESCRIPTION', \ContentPeer::CON_VALUE);
$aConditions = array();
$aConditions[] = array(\EventPeer::EVN_UID, \ContentPeer::CON_ID);
$aConditions[] = array(\ContentPeer::CON_CATEGORY, $sDelimiter . 'EVN_DESCRIPTION' . $sDelimiter);
$aConditions[] = array(\ContentPeer::CON_LANG, $sDelimiter . SYS_LANG . $sDelimiter);
$oCriteria->addJoinMC($aConditions, \Criteria::LEFT_JOIN);
$oCriteria->add(\EventPeer::PRO_UID, $pro_uid);
if ($evn_uid != '') {
$oCriteria->add(\EventPeer::EVN_UID, $evn_uid);
}
switch ($filter) {
case 'message':
$oCriteria->add(\EventPeer::EVN_ACTION, "SEND_MESSAGE");
break;
case 'conditional':
$oCriteria->add(\EventPeer::EVN_ACTION, "EXECUTE_CONDITIONAL_TRIGGER");
break;
case 'multiple':
$oCriteria->add(\EventPeer::EVN_ACTION, "EXECUTE_TRIGGER");
break;
}
$eventsArray = array();
$oDataset = \EventPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
while ($aRow = $oDataset->getRow()) {
$oEvent = new \Event();
$aFields = $oEvent->load($aRow['EVN_UID']);
$aRow = array_merge($aRow, $aFields);
$eventsArray[] = array_change_key_case($aRow, CASE_LOWER);
$oDataset->next();
}
if ($evn_uid != '' && empty($eventsArray)) {
throw new \Exception(\G::LoadTranslation("ID_ROW_DOES_NOT_EXIST"));
} elseif ($evn_uid != '' && !empty($eventsArray)) {
return current($eventsArray);
}
return $eventsArray;
}
开发者ID:emildev35,项目名称:processmaker,代码行数:68,代码来源:Event.php
示例5: loadByCategoryId
public function loadByCategoryId($sCategoryUid)
{
$c = new Criteria('workflow');
$del = DBAdapter::getStringDelimiter();
$c->clearSelectColumns();
$c->addSelectColumn(ProcessCategoryPeer::CATEGORY_NAME);
$c->add(ProcessCategoryPeer::CATEGORY_UID, $sCategoryUid);
$dataset = ProcessCategoryPeer::doSelectRS($c);
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$dataset->next();
$aRow = $dataset->getRow();
return $aRow['CATEGORY_NAME'];
}
开发者ID:emildev35,项目名称:processmaker,代码行数:13,代码来源:ProcessCategory.php
示例6: loadDefaultAccount
/**
* Get the evn_description column value.
*
* @return string
*/
public function loadDefaultAccount()
{
$c = new Criteria('workflow');
$del = DBAdapter::getStringDelimiter();
$c->clearSelectColumns();
$c->addSelectColumn(EmailServerPeer::MESS_ACCOUNT);
$c->add(EmailServerPeer::MESS_DEFAULT, 1);
$rs = EmailServerPeer::doSelectRS($c, Propel::getDBConnection('workflow_ro'));
$rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$rs->next();
$row = $rs->getRow();
$response = $row;
return $response;
}
开发者ID:emildev35,项目名称:processmaker,代码行数:19,代码来源:EmailServer.php
示例7: getCriteriaDBSList
public function getCriteriaDBSList($sProcessUID)
{
$sDelimiter = DBAdapter::getStringDelimiter();
$oCriteria = new Criteria('workflow');
$oCriteria->addSelectColumn(DbSourcePeer::DBS_UID);
$oCriteria->addSelectColumn(DbSourcePeer::PRO_UID);
$oCriteria->addSelectColumn(DbSourcePeer::DBS_TYPE);
$oCriteria->addSelectColumn(DbSourcePeer::DBS_SERVER);
$oCriteria->addSelectColumn(DbSourcePeer::DBS_DATABASE_NAME);
$oCriteria->addSelectColumn(DbSourcePeer::DBS_USERNAME);
$oCriteria->addSelectColumn(DbSourcePeer::DBS_PASSWORD);
$oCriteria->addSelectColumn(DbSourcePeer::DBS_PORT);
$oCriteria->addAsColumn('DBS_DESCRIPTION', 'C.CON_VALUE');
$oCriteria->addAlias('C', 'CONTENT');
$aConditions = array();
$aConditions[] = array(DbSourcePeer::DBS_UID, 'C.CON_ID');
$aConditions[] = array('C.CON_CATEGORY', $sDelimiter . 'DBS_DESCRIPTION' . $sDelimiter);
$aConditions[] = array('C.CON_LANG', $sDelimiter . SYS_LANG . $sDelimiter);
$oCriteria->addJoinMC($aConditions, Criteria::LEFT_JOIN);
$oCriteria->add(DbSourcePeer::PRO_UID, $sProcessUID);
return $oCriteria;
}
开发者ID:bqevin,项目名称:processmaker,代码行数:22,代码来源:DbSource.php
示例8: getCriteriaDBSList
public function getCriteriaDBSList($sProcessUID)
{
$sDelimiter = DBAdapter::getStringDelimiter();
$oCriteria = new Criteria('workflow');
$oCriteria->addSelectColumn(DbSourcePeer::DBS_UID);
$oCriteria->addSelectColumn(DbSourcePeer::PRO_UID);
$oCriteria->addSelectColumn(DbSourcePeer::DBS_TYPE);
$oCriteria->addAsColumn("DBS_SERVER", "CASE WHEN " . DbSourcePeer::DBS_TYPE . " = 'oracle' AND " . DbSourcePeer::DBS_CONNECTION_TYPE . " = 'TNS' THEN CONCAT('[', " . DbSourcePeer::DBS_TNS . ", ']') ELSE " . DbSourcePeer::DBS_SERVER . " END");
$oCriteria->addAsColumn("DBS_DATABASE_NAME", "CASE WHEN " . DbSourcePeer::DBS_TYPE . " = 'oracle' AND " . DbSourcePeer::DBS_CONNECTION_TYPE . " = 'TNS' THEN CONCAT('[', " . DbSourcePeer::DBS_TNS . ", ']') ELSE " . DbSourcePeer::DBS_DATABASE_NAME . " END");
$oCriteria->addSelectColumn(DbSourcePeer::DBS_USERNAME);
$oCriteria->addSelectColumn(DbSourcePeer::DBS_PASSWORD);
$oCriteria->addSelectColumn(DbSourcePeer::DBS_PORT);
$oCriteria->addAsColumn('DBS_DESCRIPTION', 'C.CON_VALUE');
$oCriteria->addAlias('C', 'CONTENT');
$aConditions = array();
$aConditions[] = array(DbSourcePeer::DBS_UID, 'C.CON_ID');
$aConditions[] = array('C.CON_CATEGORY', $sDelimiter . 'DBS_DESCRIPTION' . $sDelimiter);
$aConditions[] = array('C.CON_LANG', $sDelimiter . SYS_LANG . $sDelimiter);
$oCriteria->addJoinMC($aConditions, Criteria::LEFT_JOIN);
$oCriteria->add(DbSourcePeer::PRO_UID, $sProcessUID);
return $oCriteria;
}
开发者ID:norahmollo,项目名称:processmaker,代码行数:22,代码来源:DbSource.php
示例9: getSubprocesss
/**
* Get SubProcess in Process
*
* return object
*/
public function getSubprocesss($pro_uid, $tas_uid)
{
try {
$pro_uid = $this->validateProUid($pro_uid);
$tas_uid = $this->validateTasUid($tas_uid);
$oCriteria = new \Criteria('workflow');
$del = \DBAdapter::getStringDelimiter();
$oCriteria->add(SubProcessPeer::PRO_PARENT, $pro_uid);
$oCriteria->add(SubProcessPeer::TAS_PARENT, $tas_uid);
$oCriteria->addAsColumn('CON_VALUE', 'C1.CON_VALUE', 'CON_TITLE');
$oCriteria->addAlias("C1", 'CONTENT');
$tasTitleConds = array();
$tasTitleConds[] = array(SubProcessPeer::TAS_PARENT, 'C1.CON_ID');
$tasTitleConds[] = array('C1.CON_CATEGORY', $del . 'TAS_TITLE' . $del);
$tasTitleConds[] = array('C1.CON_LANG', $del . SYS_LANG . $del);
$oCriteria->addJoinMC($tasTitleConds, \Criteria::LEFT_JOIN);
$oDataset = SubProcessPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
$aRow = $oDataset->getRow();
$aRow = array_change_key_case($aRow, CASE_LOWER);
$response['spr_uid'] = $aRow['sp_uid'];
$response['spr_pro_parent'] = $aRow['pro_parent'];
$response['spr_tas_parent'] = $aRow['tas_parent'];
$response['spr_pro'] = $aRow['pro_uid'];
$response['spr_tas'] = $aRow['tas_uid'];
$response['spr_name'] = $aRow['con_value'];
$response['spr_synchronous'] = $aRow['sp_synchronous'];
$response['spr_variables_out'] = unserialize($aRow['sp_variables_out']);
if ((int) $response['spr_synchronous'] === 1) {
$response['spr_variables_in'] = unserialize($aRow['sp_variables_in']);
}
return $response;
} catch (\Exception $e) {
throw $e;
}
}
开发者ID:emildev35,项目名称:processmaker,代码行数:42,代码来源:Subprocess.php
示例10: array
if (strpos($_POST['server'], "\\")) {
$_POST['port'] = 'none';
}
$aData = array('DBS_UID' => $_POST['dbs_uid'], 'PRO_UID' => $_SESSION['PROCESS'], 'DBS_TYPE' => $_POST['type'], 'DBS_SERVER' => $_POST['server'], 'DBS_DATABASE_NAME' => $_POST['db_name'], 'DBS_USERNAME' => $_POST['user'], 'DBS_PASSWORD' => ($_POST['passwd'] == 'none' ? "" : G::encrypt($_POST['passwd'], $_POST['db_name'])) . "_2NnV3ujj3w", 'DBS_PORT' => $_POST['port'] == 'none' ? "" : $_POST['port'], 'DBS_ENCODE' => $_POST['enc']);
$oDBSource->update($aData);
$oContent->addContent('DBS_DESCRIPTION', '', $_POST['dbs_uid'], SYS_LANG, $_POST['desc']);
break;
case 'saveConnection':
$oDBSource = new DbSource();
$oContent = new Content();
if (strpos($_POST['server'], "\\")) {
$_POST['port'] = 'none';
}
$aData = array('PRO_UID' => $_SESSION['PROCESS'], 'DBS_TYPE' => $_POST['type'], 'DBS_SERVER' => $_POST['server'], 'DBS_DATABASE_NAME' => $_POST['db_name'], 'DBS_USERNAME' => $_POST['user'], 'DBS_PASSWORD' => ($_POST['passwd'] == 'none' ? "" : G::encrypt($_POST['passwd'], $_POST['db_name'])) . "_2NnV3ujj3w", 'DBS_PORT' => $_POST['port'] == 'none' ? "" : $_POST['port'], 'DBS_ENCODE' => $_POST['enc']);
$newid = $oDBSource->create($aData);
$sDelimiter = DBAdapter::getStringDelimiter();
$oContent->addContent('DBS_DESCRIPTION', '', $newid, SYS_LANG, $_POST['desc']);
break;
case 'deleteDbConnection':
try {
$oDBSource = new DbSource();
$oContent = new Content();
$DBS_UID = $_POST['dbs_uid'];
$PRO_UID = $_SESSION['PROCESS'];
$oDBSource->remove($DBS_UID, $PRO_UID);
$oContent->removeContent('DBS_DESCRIPTION', "", $DBS_UID);
$result->success = true;
$result->msg = G::LoadTranslation('ID_DBCONNECTION_REMOVED');
} catch (Exception $e) {
$result->success = false;
$result->msg = $e->getMessage();
开发者ID:bqevin,项目名称:processmaker,代码行数:31,代码来源:dbConnectionsAjax.php
示例11: populateStmtValues
/**
* Populates values in a prepared statement.
*
* This method is designed to work with the createSelectSql() method, which creates
* both the SELECT SQL statement and populates a passed-in array of parameter
* values that should be substituted.
*
* <code>
* $params = array();
* $sql = BasePeer::createSelectSql($criteria, $params);
* BasePeer::populateStmtValues($stmt, $params, Propel::getDatabaseMap($critera->getDbName()), Propel::getDB($criteria->getDbName()));
* </code>
*
* @param PDOStatement $stmt
* @param array $params array('column' => ..., 'table' => ..., 'value' => ...)
* @param DatabaseMap $dbMap
* @return int The number of params replaced.
* @see createSelectSql()
* @see doSelect()
*/
public static function populateStmtValues(PDOStatement $stmt, array $params, DatabaseMap $dbMap, DBAdapter $db)
{
$i = 1;
foreach ($params as $param) {
$tableName = $param['table'];
$columnName = $param['column'];
$value = $param['value'];
if (null === $value) {
$stmt->bindValue(':p' . $i++, null, PDO::PARAM_NULL);
} elseif (null !== $tableName) {
$cMap = $dbMap->getTable($tableName)->getColumn($columnName);
$type = $cMap->getType();
$pdoType = $cMap->getPdoType();
// FIXME - This is a temporary hack to get around apparent bugs w/ PDO+MYSQL
// See http://pecl.php.net/bugs/bug.php?id=9919
if ($pdoType == PDO::PARAM_BOOL && $db instanceof DBMySQL) {
$value = (int) $value;
$pdoType = PDO::PARAM_INT;
} elseif (is_numeric($value) && $cMap->isEpochTemporal()) {
// it's a timestamp that needs to be formatted
if ($type == PropelColumnTypes::TIMESTAMP) {
$value = date($db->getTimestampFormatter(), $value);
} else {
if ($type == PropelColumnTypes::DATE) {
$value = date($db->getDateFormatter(), $value);
} else {
if ($type == PropelColumnTypes::TIME) {
$value = date($db->getTimeFormatter(), $value);
}
}
}
} elseif ($value instanceof DateTime && $cMap->isTemporal()) {
// it's a timestamp that needs to be formatted
if ($type == PropelColumnTypes::TIMESTAMP || $type == PropelColumnTypes::BU_TIMESTAMP) {
$value = $value->format($db->getTimestampFormatter());
} else {
if ($type == PropelColumnTypes::DATE || $type == PropelColumnTypes::BU_DATE) {
$value = $value->format($db->getDateFormatter());
} else {
if ($type == PropelColumnTypes::TIME) {
$value = $value->format($db->getTimeFormatter());
}
}
}
} elseif (is_resource($value) && $cMap->isLob()) {
// we always need to make sure that the stream is rewound, otherwise nothing will
// get written to database.
rewind($value);
}
$stmt->bindValue(':p' . $i++, $value, $pdoType);
} else {
$stmt->bindValue(':p' . $i++, $value);
}
}
// foreach
}
开发者ID:RadioCampusFrance,项目名称:airtime,代码行数:76,代码来源:BasePeer.php
示例12: taskCase
/**
* task Case
*
* @param string sessionId : The session ID which is obtained when logging in
* @param string caseId : The case ID. The caseList() function can be used to find the ID number for cases
* @return $result returns the current task for a given case. Note that the logged-in user must have privileges
* to access the task
*/
public function taskCase ($caseId)
{
$result = array ();
try {
$oCriteria = new Criteria( 'workflow' );
$del = DBAdapter::getStringDelimiter();
$oCriteria->addSelectColumn( AppDelegationPeer::DEL_INDEX );
$oCriteria->addSelectColumn( AppDelegationPeer::TAS_UID );
$oCriteria->addAsColumn( 'TAS_TITLE', 'C1.CON_VALUE' );
$oCriteria->addAlias( "C1", 'CONTENT' );
$tasTitleConds = array ();
$tasTitleConds[] = array (AppDelegationPeer::TAS_UID,'C1.CON_ID');
$tasTitleConds[] = array ('C1.CON_CATEGORY',$del . 'TAS_TITLE' . $del);
$tasTitleConds[] = array ('C1.CON_LANG',$del . SYS_LANG . $del);
$oCriteria->addJoinMC( $tasTitleConds, Criteria::LEFT_JOIN );
$oCriteria->add( AppDelegationPeer::APP_UID, $caseId );
$oCriteria->add( AppDelegationPeer::DEL_THREAD_STATUS, 'OPEN' );
$oCriteria->add( AppDelegationPeer::DEL_FINISH_DATE, null, Criteria::ISNULL );
$oDataset = AppDelegationPeer::doSelectRS( $oCriteria );
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$oDataset->next();
while ($aRow = $oDataset->getRow()) {
$result[] = array (
'guid' => $aRow['TAS_UID'],
'name' => $aRow['TAS_TITLE'],
'delegate' => $aRow['DEL_INDEX']
);
$oDataset->next();
}
return $result;
} catch (Exception $e) {
$result[] = array ('guid' => $e->getMessage(),'name' => $e->getMessage(), 'delegate' => $e->getMessage() );
return $result;
}
}
开发者ID:nhenderson,项目名称:processmaker,代码行数:95,代码来源:class.wsBase.php
示例13: reportsPatch
/**
* Patch for reports by The Answer (17-10-2k8)
*
*
* @name reportsPatch
*
* param
* @return void
*/
function reportsPatch()
{
require_once 'classes/model/AppDelegation.php';
$oCriteria = new Criteria('workflow');
$del = DBAdapter::getStringDelimiter();
$oCriteria->addSelectColumn(AppDelegationPeer::APP_UID);
$oCriteria->addSelectColumn(AppDelegationPeer::DEL_INDEX);
$oCriteria->addSelectColumn(AppDelegationPeer::TAS_UID);
$oCriteria->addSelectColumn(AppDelegationPeer::DEL_DELEGATE_DATE);
$oCriteria->addSelectColumn(AppDelegationPeer::DEL_INIT_DATE);
$oCriteria->addSelectColumn(AppDelegationPeer::DEL_FINISH_DATE);
$oCriteria->addSelectColumn(AppDelegationPeer::DEL_DURATION);
$oDataset = AppDelegationPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
while ($aRow = $oDataset->getRow()) {
$oAppDelegation = new AppDelegation();
$aData['APP_UID'] = $aRow['APP_UID'];
$aData['DEL_INDEX'] = $aRow['DEL_INDEX'];
$aData['DEL_DELEGATE_DATE'] = $aRow['DEL_DELEGATE_DATE'];
if ($aRow['DEL_INIT_DATE'] == NULL) {
$aData['DEL_INIT_DATE'] = $aRow['DEL_DELEGATE_DATE'];
} else {
$aData['DEL_INIT_DATE'] = $aRow['DEL_INIT_DATE'];
}
//$aData['DEL_FINISH_DATE']=$aRow['DEL_FINISH_DATE'];
if ($aRow['DEL_DURATION'] != 0) {
G::LoadClass('dates');
$oDates = new dates();
$aData['DEL_DURATION'] = $oDates->calculateDuration($aData['DEL_INIT_DATE'], $aRow['DEL_FINISH_DATE'], null, null, $aRow['TAS_UID']);
}
$oAppDelegation->update($aData);
$oDataset->next();
}
return;
}
开发者ID:nshong,项目名称:processmaker,代码行数:45,代码来源:class.report.php
示例14: getExtTriggersList
public function getExtTriggersList($start, $limit, $sProcessUID = '')
{
$sDelimiter = DBAdapter::getStringDelimiter();
$oCriteria = new Criteria('workflow');
$oCriteria->addSelectColumn(TriggersPeer::TRI_UID);
$oCriteria->addSelectColumn(TriggersPeer::PRO_UID);
$oCriteria->add(TriggersPeer::PRO_UID, $sProcessUID);
$this->tmpCriteria = clone $oCriteria;
$oCriteria->addAsColumn('TRI_TITLE', 'C1.CON_VALUE');
$oCriteria->addAsColumn('TRI_DESCRIPTION', 'C2.CON_VALUE');
$oCriteria->addAlias('C1', 'CONTENT');
$oCriteria->addAlias('C2', 'CONTENT');
$aConditions = array();
$aConditions[] = array(TriggersPeer::TRI_UID, 'C1.CON_ID');
$aConditions[] = array('C1.CON_CATEGORY', $sDelimiter . 'TRI_TITLE' . $sDelimiter);
$aConditions[] = array('C1.CON_LANG', $sDelimiter . SYS_LANG . $sDelimiter);
$oCriteria->addJoinMC($aConditions, Criteria::LEFT_JOIN);
$aConditions = array();
$aConditions[] = array(TriggersPeer::TRI_UID, 'C2.CON_ID');
$aConditions[] = array('C2.CON_CATEGORY', $sDelimiter . 'TRI_TITLE' . $sDelimiter);
$aConditions[] = array('C2.CON_LANG', $sDelimiter . SYS_LANG . $sDelimiter);
$oCriteria->addJoinMC($aConditions, Criteria::LEFT_JOIN);
$oCriteria->add(TriggersPeer::PRO_UID, $sProcessUID);
$oCriteria->addAscendingOrderByColumn('TRI_TITLE');
if ($start != '') {
$oCriteria->setOffset($start);
}
if ($limit != '') {
$oCriteria->setLimit($limit);
}
$oDataset = TriggersPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
$triggersArray = "";
$triggersArray[] = array('TRI_UID' => 'char', 'PRO_UID' => 'char', 'TRI_TITLE' => 'char', 'TRI_DESCRIPTION' => 'char');
while ($aRow = $oDataset->getRow()) {
if ($aRow['TRI_TITLE'] == null || $aRow['TRI_TITLE'] == "") {
// There is no translation for this Trigger name, try to get/regenerate the label
$triggerO = new Triggers();
$triggerObj = $triggerO->load($aRow['TRI_UID']);
$aRow['TRI_TITLE'] = $triggerObj['TRI_TITLE'];
$aRow['TRI_DESCRIPTION'] = $triggerObj['TRI_DESCRIPTION'];
}
$triggersArray[] = $aRow;
$oDataset->next();
}
return $triggersArray;
}
开发者ID:rodrigoivan,项目名称:processmaker,代码行数:48,代码来源:class.processMap.php
示例15: getInputDocumentCriteria
/**
* Get criteria for InputDocument
*
* return object
*/
public function getInputDocumentCriteria()
{
try {
$delimiter = \DBAdapter::getStringDelimiter();
$criteria = new \Criteria("workflow");
$criteria->addSelectColumn(\InputDocumentPeer::INP_DOC_UID);
$criteria->addAsColumn("INP_DOC_TITLE", "CT.CON_VALUE");
$criteria->addAsColumn("INP_DOC_DESCRIPTION", "CD.CON_VALUE");
$criteria->addSelectColumn(\InputDocumentPeer::INP_DOC_FORM_NEEDED);
$criteria->addSelectColumn(\InputDocumentPeer::INP_DOC_ORIGINAL);
$criteria->addSelectColumn(\InputDocumentPeer::INP_DOC_PUBLISHED);
$criteria->addSelectColumn(\InputDocumentPeer::INP_DOC_VERSIONING);
$criteria->addSelectColumn(\InputDocumentPeer::INP_DOC_DESTINATION_PATH);
$criteria->addSelectColumn(\InputDocumentPeer::INP_DOC_TAGS);
$criteria->addSelectColumn(\InputDocumentPeer::INP_DOC_TYPE_FILE);
$criteria->addSelectColumn(\InputDocumentPeer::INP_DOC_MAX_FILESIZE);
$criteria->addSelectColumn(\InputDocumentPeer::INP_DOC_MAX_FILESIZE_UNIT);
$criteria->addAlias("CT", \ContentPeer::TABLE_NAME);
$criteria->addAlias("CD", \ContentPeer::TABLE_NAME);
$arrayCondition = array();
$arrayCondition[] = array(\InputDocumentPeer::INP_DOC_UID, "CT.CON_ID", \Criteria::EQUAL);
$arrayCondition[] = array("CT.CON_CATEGORY", $delimiter . "INP_DOC_TITLE" . $delimiter, \Criteria::EQUAL);
$arrayCondition[] = array("CT.CON_LANG", $delimiter . SYS_LANG . $delimiter, \Criteria::EQUAL);
$criteria->addJoinMC($arrayCondition, \Criteria::LEFT_JOIN);
$arrayCondition = array();
$arrayCondition[] = array(\InputDocumentPeer::INP_DOC_UID, "CD.CON_ID", \Criteria::EQUAL);
$arrayCondition[] = array("CD.CON_CATEGORY", $delimiter . "INP_DOC_DESCRIPTION" . $delimiter, \Criteria::EQUAL);
$arrayCondition[] = array("CD.CON_LANG", $delimiter . SYS_LANG . $delimiter, \Criteria::EQUAL);
$criteria->addJoinMC($arrayCondition, \Criteria::LEFT_JOIN);
return $criteria;
} catch (\Exception $e) {
throw $e;
}
}
开发者ID:emildev35,项目名称:processmaker,代码行数:39,代码来源:InputDocument.php
示例16: getOwnersByType
public function getOwnersByType($data)
{
$this->setResponseType('json');
$result = new stdclass();
$result->status = 'OK';
try {
switch ($data->type) {
case 'EVERYBODY':
$result->total = 0;
$result->owners = array();
break;
case 'USER':
require_once 'classes/model/Users.php';
$users = array();
$usersInstance = new Users();
$allUsers = $usersInstance->getAll();
foreach ($allUsers->data as $user) {
$users[] = array('OWNER_UID' => $user['USR_UID'], 'OWNER_NAME' => $user['USR_FIRSTNAME'] . ' ' . $user['USR_LASTNAME']);
}
usort($users, function ($str1, $str2) {
return strcmp(strtolower($str1["OWNER_NAME"]), strtolower($str2["OWNER_NAME"]));
});
$result->total = $allUsers->totalCount;
$result->owners = $users;
break;
case 'DEPARTMENT':
require_once 'classes/model/Department.php';
require_once 'classes/model/Content.php';
$departments = array();
//SELECT
$criteria = new Criteria('workflow');
$criteria->setDistinct();
$criteria->addSelectColumn(DepartmentPeer::DEP_UID);
$criteria->addSelectColumn(ContentPeer::CON_VALUE);
//FROM
$conditions = array();
$conditions[] = array(DepartmentPeer::DEP_UID, ContentPeer::CON_ID);
$conditions[] = array(ContentPeer::CON_CATEGORY, DBAdapter::getStringDelimiter() . 'DEPO_TITLE' . DBAdapter::getStringDelimiter());
$conditions[] = array(ContentPeer::CON_LANG, DBAdapter::getStringDelimiter() . 'en' . DBAdapter::getStringDelimiter());
$criteria->addJoinMC($conditions, Criteria::LEFT_JOIN);
//WHERE
$criteria->add(DepartmentPeer::DEP_STATUS, 'ACTIVE');
//ORDER BY
$criteria->addAscendingOrderByColumn(ContentPeer::CON_VALUE);
$dataset = DepartmentPeer::doSelectRS($criteria);
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$dataset->next();
while ($row = $dataset->getRow()) {
$departments[] = array('OWNER_UID' => $row['DEP_UID'], 'OWNER_NAME' => $row['CON_VALUE']);
$dataset->next();
}
$result->total = DepartmentPeer::doCount($criteria);
$result->owners = $departments;
break;
case 'GROUP':
require_once 'classes/model/Groupwf.php';
require_once 'classes/model/Content.php';
$groups = array();
//SELECT
$criteria = new Criteria('workflow');
$criteria->setDistinct();
$criteria->addSelectColumn(GroupwfPeer::GRP_UID);
$criteria->addSelectColumn(ContentPeer::CON_VALUE);
//FROM
$conditions = array();
$conditions[] = array(GroupwfPeer::GRP_UID, ContentPeer::CON_ID);
$conditions[] = array(ContentPeer::CON_CATEGORY, DBAdapter::getStringDelimiter() . 'GRP_TITLE' . DBAdapter::getStringDelimiter());
$conditions[] = array(ContentPeer::CON_LANG, DBAdapter::getStringDelimiter() . 'en' . DBAdapter::getStringDelimiter());
$criteria->addJoinMC($conditions, Criteria::LEFT_JOIN);
//WHERE
$criteria->add(GroupwfPeer::GRP_STATUS, 'ACTIVE');
//ORDER BY
$criteria->addAscendingOrderByColumn(ContentPeer::CON_VALUE);
$dataset = GroupwfPeer::doSelectRS($criteria);
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$dataset->next();
while ($row = $dataset->getRow()) {
$groups[] = array('OWNER_UID' => $row['GRP_UID'], 'OWNER_NAME' => $row['CON_VALUE']);
$dataset->next();
}
$result->total = GroupwfPeer::doCount($criteria);
$result->owners = $groups;
break;
}
} catch (Exception $error) {
$result->status = 'ERROR';
$result->message = $error->getMessage();
}
return $result;
}
开发者ID:norahmollo,项目名称:processmaker,代码行数:90,代码来源:dashboard.php
示例17: getTaskAdhocAssignee
/**
* Return a single Adhoc user or group assigned to an activity
*
* @param string $sProcessUID {@min 32} {@max 32}
* @param string $sTaskUID {@min 32} {@max 32}
* @param string $sAssigneeUID {@min 32} {@max 32}
*
* return array
*
* @access public
*/
public function getTaskAdhocAssignee($sProcessUID, $sTaskUID, $sAssigneeUID)
{
try {
Validator::proUid($sProcessUID, '$prj_uid');
$this->validateActUid($sTaskUID);
$iType = 2;
$aUsers = array();
$sDelimiter = \DBAdapter::getStringDelimiter();
$oCriteria = new \Criteria('workflow');
$oCriteria->addAsColumn('GRP_TITLE', 'C.CON_VALUE');
$oCriteria->addSelectColumn(\TaskUserPeer::TAS_UID);
$oCriteria->addSelectColumn(\TaskUserPeer::USR_UID);
$oCriteria->addSelectColumn(\TaskUserPeer::TU_TYPE);
$oCriteria->addSelectColumn(\TaskUserPeer::TU_RELATION);
$oCriteria->addAlias('C', 'CONTENT');
$aConditions = array();
$aConditions[] = array(\TaskUserPeer::USR_UID, 'C.CON_ID');
$aConditions[] = array('C.CON_CATEGORY', $sDelimiter . 'GRP_TITLE' . $sDelimiter);
$aConditions[] = array('C.CON_LANG', $sDelimiter . SYS_LANG . $sDelimiter);
$oCriteria->addJoinMC($aConditions, \Criteria::LEFT_JOIN);
$oCriteria->add(\TaskUserPeer::USR_UID, $sAssigneeUID);
$oCriteria->add(\TaskUserPeer::TAS_UID, $sTaskUID);
$oCriteria->add(\TaskUserPeer::TU_TYPE, $iType);
$oCriteria->add(\TaskUserPeer::TU_RELATION, 2);
$oDataset = \TaskUserPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
$c = 0;
$oTasks = new \Tasks();
$aAux = $oTasks->getGroupsOfTask($sTaskUID, 2);
$aUIDS1 = array();
foreach ($aAux as $aGroup) {
$aUIDS1[] = $aGroup['GRP_UID'];
}
$criteria = new \Criteria('workflow');
$criteria->addSelectColumn(\GroupwfPeer::GRP_UID);
$criteria->addSelectColumn(\GroupwfPeer::GRP_STATUS);
$criteria->addSelectColumn(\GroupwfPeer::GRP_UX);
$criteria->addAsColumn('GRP_TITLE', \ContentPeer::CON_VALUE);
$criteria->addJoin(\GroupwfPeer::GRP_UID, \ContentPeer::CON_ID, \Criteria::LEFT_JOIN);
$criteria->add(\ContentPeer::CON_CATEGORY, 'GRP_TITLE');
$criteria->add(\ContentPeer::CON_LANG, SYS_LANG);
$criteria->add(\GroupwfPeer::GRP_UID, $sAssigneeUID);
$criteria->addAscendingOrderByColumn(\ContentPeer::CON_VALUE);
$oDataset = \GroupwfPeer::doSelectRS($criteria);
$oDataset->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
$groups = array();
while ($oDataset->next()) {
$groups[] = $oDataset->getRow();
}
$result = array('rows' => $groups);
foreach ($result['rows'] as $results) {
if (in_array($results['GRP_UID'], $aUIDS1)) {
$c++;
$oCriteria = new \Criteria('workflow');
$oCriteria->addSelectColumn('COUNT(*) AS MEMBERS_NUMBER');
$oCriteria->add(\GroupUserPeer::GRP_UID, $results['GRP_UID']);
$oDataset2 = \GroupUserPeer::doSelectRS($oCriteria);
$oDataset2->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
$oDataset2->next();
$aRow2 = $oDataset2->getRow();
$aUsers[] = array('ada_uid' => $results['GRP_UID'], 'ada_name' => !isset($aRow2['GROUP_INACTIVE']) ? $results['GRP_TITLE'] . ' (' . $aRow2['MEMBERS_NUMBER'] . ' ' . ((int) $aRow2['MEMBERS_NUMBER'] == 1 ? \G::LoadTranslation('ID_USER') : \G::LoadTranslation('ID_USERS')) . ')' . '' : $results['GRP_TITLE'] . ' ' . $aRow2['GROUP_INACTIVE'], 'ada_lastname' => "", 'ada_username' => "", 'ada_type' => "group");
}
}
$oCriteria = new \Criteria('workflow');
$oCriteria->addSelectColumn(\UsersPeer::USR_FIRSTNAME);
$oCriteria->addSelectColumn(\UsersPeer::USR_LASTNAME);
$oCriteria->addSelectColumn(\UsersPeer::USR_USERNAME);
$oCriteria->addSelectColumn(\UsersPeer::USR_EMAIL);
$oCriteria->addSelectColumn(\TaskUserPeer::TAS_UID);
$oCriteria->addSelectColumn(\TaskUserPeer::USR_UID);
$oCriteria->addSelectColumn(\TaskUserPeer::TU_TYPE);
$oCriteria->addSelectColumn(\TaskUserPeer::TU_RELATION);
$oCriteria->addJoin(\TaskUserPeer::USR_UID, \UsersPeer::USR_UID, \Criteria::LEFT_JOIN);
$oCriteria->add(\TaskUserPeer::USR_UID, $sAssigneeUID);
$oCriteria->add(\TaskUserPeer::TAS_UID, $sTaskUID);
$oCriteria->add(\TaskUserPeer::TU_TYPE, $iType);
$oCriteria->add(\TaskUserPeer::TU_RELATION, 1);
$oDataset = \TaskUserPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
while ($aRow = $oDataset->getRow()) {
$aUsers = array('ada_uid' => $aRow['USR_UID'], 'ada_name' => $aRow['USR_FIRSTNAME'], 'ada_lastname' => $aRow['USR_LASTNAME'], 'ada_username' => $aRow['USR_USERNAME'], 'ada_type' => "user");
$oDataset->next();
}
if (empty($aUsers)) {
throw new \Exception(\G::LoadTranslation("ID_RECORD_NOT_FOUND", array($sAssigneeUID)));
} else {
return $aUsers;
//.........这里部分代码省略.........
开发者ID:emildev35,项目名称:processmaker,代码行数:101,代码来源:Task.php
示例18: switch
$req = $_POST['request'];
switch ($req) {
case 'showUsers':
/*
$sql = "SELECT USR_UID, USR_EMAIL, CONCAT(USR_FIRSTNAME, ' ' , USR_LASTNAME) AS USR_FULLNAME FROM USERS WHERE USR_STATUS = 'ACTIVE' AND USR_EMAIL <> ''";
*/
$sDataBase = 'database_' . strtolower(DB_ADAPTER);
if (G::LoadSystemExist($sDataBase)) {
G::LoadSystem($sDataBase);
$oDataBase = new database();
$sConcat = $oDataBase->concatString("USR_FIRSTNAME", "' '", "USR_LASTNAME");
}
$sql = " SELECT USR_UID, USR_EMAIL, " . $sConcat . " AS USR_FULLNAME FROM USERS " . " WHERE USR_STATUS = 'ACTIVE' AND USR_EMAIL <> ''";
$oCriteria = new Criteria('workflow');
$del = DBAdapter::getStringDelimiter();
$con = Propel::getConnection("workflow");
$stmt = $con->prepareStatement($sql);
$rs = $stmt->executeQuery();
$aRows[] = array('USR_UID' => 'char', 'USR_EMAIL' => 'char', 'USR_FULLNAME' => 'char');
while ($rs->next()) {
$aRows[] = array('USR_UID' => $rs->getString('USR_UID'), 'USR_EMAIL' => $rs->getString('USR_EMAIL'), 'USR_FULLNAME' => $rs->getString('USR_FULLNAME'));
}
//echo '<pre>';
|
请发表评论