本文整理汇总了PHP中CRM_Core_DAO::getfieldValue方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Core_DAO::getfieldValue方法的具体用法?PHP CRM_Core_DAO::getfieldValue怎么用?PHP CRM_Core_DAO::getfieldValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Core_DAO
的用法示例。
在下文中一共展示了CRM_Core_DAO::getfieldValue方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: preProcess
public function preProcess()
{
$job_id = CRM_Utils_Request::retrieve('jid', 'Positive', $this, NULL);
$queue_id = CRM_Utils_Request::retrieve('qid', 'Positive', $this, NULL);
$hash = CRM_Utils_Request::retrieve('h', 'String', $this, NULL);
$q = CRM_Mailing_Event_BAO_Queue::verify($job_id, $queue_id, $hash);
if ($q == NULL) {
// ERROR.
CRM_Core_Error::fatal(ts('Invalid form parameters.'));
CRM_Core_Error::statusBounce(ts('Invalid form parameters.'));
}
$mailing =& $q->getMailing();
if ($hash) {
$emailId = CRM_Core_DAO::getfieldValue('CRM_Mailing_Event_DAO_Queue', $hash, 'email_id', 'hash');
$this->_fromEmail = $fromEmail = CRM_Core_DAO::getfieldValue('CRM_Core_DAO_Email', $emailId, 'email');
$this->assign('fromEmail', $fromEmail);
}
// Show the subject instead of the name here, since it's being
// displayed to external contacts/users.
CRM_Utils_System::setTitle(ts('Forward Mailing: %1', array(1 => $mailing->subject)));
$this->set('queue_id', $queue_id);
$this->set('job_id', $job_id);
$this->set('hash', $hash);
}
示例2: deleteActivity
/**
* Function to delete the activity
*
* @param array $params associated array
*
* @return void
* @access public
*
*/
public static function deleteActivity(&$params, $moveToTrash = FALSE)
{
// CRM-9137
if (CRM_Utils_Array::value('id', $params) && !is_array($params['id'])) {
CRM_Utils_Hook::pre('delete', 'Activity', $params['id'], $params);
} else {
CRM_Utils_Hook::pre('delete', 'Activity', NULL, $params);
}
$transaction = new CRM_Core_Transaction();
if (is_array(CRM_Utils_Array::value('source_record_id', $params))) {
$sourceRecordIds = implode(',', $params['source_record_id']);
} else {
$sourceRecordIds = CRM_Utils_Array::value('source_record_id', $params);
}
$result = NULL;
if (!$moveToTrash) {
if (!isset($params['id'])) {
if (is_array($params['activity_type_id'])) {
$activityTypes = implode(',', $params['activity_type_id']);
} else {
$activityTypes = $params['activity_type_id'];
}
$query = "DELETE FROM civicrm_activity WHERE source_record_id IN ({$sourceRecordIds}) AND activity_type_id IN ( {$activityTypes} )";
$dao = CRM_Core_DAO::executeQuery($query);
} else {
$activity = new CRM_Activity_DAO_Activity();
$activity->copyValues($params);
$result = $activity->delete();
// CRM-8708
$activity->case_id = CRM_Case_BAO_Case::getCaseIdByActivityId($activity->id);
}
} else {
$activity = new CRM_Activity_DAO_Activity();
$activity->copyValues($params);
$activity->is_deleted = 1;
$result = $activity->save();
//log activty delete.CRM-4525.
$logMsg = 'Case Activity deleted for';
$msgs = array();
$sourceContactId = CRM_Core_DAO::getfieldValue('CRM_Activity_DAO_Activity', $activity->id, 'source_contact_id');
if ($sourceContactId) {
$msgs[] = " source={$sourceContactId}";
}
//get target contacts.
$targetContactIds = CRM_Activity_BAO_ActivityTarget::getTargetNames($activity->id);
if (!empty($targetContactIds)) {
$msgs[] = " target =" . implode(',', array_keys($targetContactIds));
}
//get assignee contacts.
$assigneeContactIds = CRM_Activity_BAO_ActivityAssignment::getAssigneeNames($activity->id);
if (!empty($assigneeContactIds)) {
$msgs[] = " assignee =" . implode(',', array_keys($assigneeContactIds));
}
$logMsg .= implode(', ', $msgs);
self::logActivityAction($activity, $logMsg);
}
// delete the recently created Activity
if ($result) {
$activityRecent = array('id' => $activity->id, 'type' => 'Activity');
CRM_Utils_Recent::del($activityRecent);
}
$transaction->commit();
if (isset($activity)) {
// CRM-8708
$activity->case_id = CRM_Case_BAO_Case::getCaseIdByActivityId($activity->id);
CRM_Utils_Hook::post('delete', 'Activity', $activity->id, $activity);
}
return $result;
}
示例3: deleteActivity
/**
* Function to delete the activity
* @param array $params associated array
*
* @return void
* @access public
*
*/
public function deleteActivity(&$params, $moveToTrash = false)
{
require_once 'CRM/Core/Transaction.php';
$transaction = new CRM_Core_Transaction();
if (!$moveToTrash) {
if (!isset($params['id'])) {
if (is_array($params['activity_type_id'])) {
$activityTypes = implode(',', $params['activity_type_id']);
} else {
$activityTypes = $params['activity_type_id'];
}
$query = "DELETE FROM civicrm_activity WHERE source_record_id = {$params['source_record_id']} AND activity_type_id IN ( {$activityTypes} )";
$dao = CRM_Core_DAO::executeQuery($query);
} else {
$activity = new CRM_Activity_DAO_Activity();
$activity->copyValues($params);
$result = $activity->delete();
}
} else {
$activity = new CRM_Activity_DAO_Activity();
$activity->copyValues($params);
$activity->is_deleted = 1;
$result = $activity->save();
//log activty delete.CRM-4525.
$logMsg = "Case Activity deleted for";
$msgs = array();
$sourceContactId = CRM_Core_DAO::getfieldValue('CRM_Activity_DAO_Activity', $activity->id, 'source_contact_id');
if ($sourceContactId) {
$msgs[] = " source={$sourceContactId}";
}
//get target contacts.
$targetContactIds = CRM_Activity_BAO_ActivityTarget::getTargetNames($activity->id);
if (!empty($targetContactIds)) {
$msgs[] = " target =" . implode(',', array_keys($targetContactIds));
}
//get assignee contacts.
$assigneeContactIds = CRM_Activity_BAO_ActivityAssignment::getAssigneeNames($activity->id);
if (!empty($assigneeContactIds)) {
$msgs[] = " assignee =" . implode(',', array_keys($assigneeContactIds));
}
$logMsg .= implode(', ', $msgs);
self::logActivityAction($activity, $logMsg);
}
// delete the recently created Activity
require_once 'CRM/Utils/Recent.php';
if ($result) {
$activityRecent = array('id' => $activity->id, 'type' => 'Activity');
CRM_Utils_Recent::del($activityRecent);
}
$transaction->commit();
return $result;
}
示例4: deleteActivity
/**
* Function to delete the activity
* @param array $params associated array
*
* @return void
* @access public
*
*/
public function deleteActivity(&$params, $moveToTrash = false)
{
require_once 'CRM/Core/Transaction.php';
$transaction = new CRM_Core_Transaction();
$activity =& new CRM_Activity_DAO_Activity();
$activity->copyValues($params);
if (!$moveToTrash) {
$result = $activity->delete();
} else {
$activity->is_deleted = 1;
$result = $activity->save();
//log activty delete.CRM-4525.
$logMsg = "Case Activity deleted for";
$msgs = array();
$sourceContactId = CRM_Core_DAO::getfieldValue('CRM_Activity_DAO_Activity', $activity->id, 'source_contact_id');
if ($sourceContactId) {
$msgs[] = " source={$sourceContactId}";
}
//get target contacts.
$targetContactIds = CRM_Activity_BAO_ActivityTarget::getTargetNames($activity->id);
if (!empty($targetContactIds)) {
$msgs[] = " target =" . implode(',', array_keys($targetContactIds));
}
//get assignee contacts.
$assigneeContactIds = CRM_Activity_BAO_ActivityAssignment::getAssigneeNames($activity->id);
if (!empty($assigneeContactIds)) {
$msgs[] = " assigne =" . implode(',', array_keys($assigneeContactIds));
}
$logMsg .= implode(', ', $msgs);
self::logActivityAction($activity, $logMsg);
}
// delete the recently created Activity
require_once 'CRM/Utils/Recent.php';
if ($result) {
CRM_Utils_Recent::del($activity->id);
}
$transaction->commit();
return $result;
}