本文整理汇总了PHP中CRM_Upgrade_Form::assign方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Upgrade_Form::assign方法的具体用法?PHP CRM_Upgrade_Form::assign怎么用?PHP CRM_Upgrade_Form::assign使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Upgrade_Form
的用法示例。
在下文中一共展示了CRM_Upgrade_Form::assign方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
function upgrade_3_3_7($rev)
{
$dao = new CRM_Contact_DAO_Contact();
$dbName = $dao->_database;
$chkExtQuery = "SELECT TABLE_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = %1\n AND TABLE_NAME = 'civicrm_phone' AND COLUMN_NAME = 'phone_ext'";
$extensionExists = CRM_Core_DAO::singleValueQuery($chkExtQuery, array(1 => array($dbName, 'String')), TRUE, FALSE);
if (!$extensionExists) {
$colQuery = 'ALTER TABLE `civicrm_phone` ADD `phone_ext` VARCHAR( 16 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL AFTER `phone` ';
CRM_Core_DAO::executeQuery($colQuery);
}
// handle db changes done for CRM-8218
$alterContactDashboard = FALSE;
$dao = new CRM_Contact_DAO_DashboardContact();
$dbName = $dao->_database;
$chkContentQuery = "SELECT TABLE_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = %1\n AND TABLE_NAME = 'civicrm_dashboard_contact' AND COLUMN_NAME = 'content'";
$contentExists = CRM_Core_DAO::singleValueQuery($chkContentQuery, array(1 => array($dbName, 'String')), TRUE, FALSE);
if (!$contentExists) {
$alterContactDashboard = TRUE;
}
$upgrade = new CRM_Upgrade_Form();
$upgrade->assign('alterContactDashboard', $alterContactDashboard);
$upgrade->processSQL($rev);
}
示例2: upgrade_4_1_1
/**
* @param $rev
*/
public function upgrade_4_1_1($rev)
{
$upgrade = new CRM_Upgrade_Form();
$upgrade->assign('addDedupeEmail', !CRM_Core_DAO::checkFieldExists('civicrm_mailing', 'dedupe_email'));
$sql = "SELECT id FROM civicrm_worldregion LIMIT 1";
$upgrade->assign('worldRegionEmpty', !CRM_Core_DAO::singleValueQuery($sql));
$upgrade->processSQL($rev);
}
示例3: upgrade_3_4_6
/**
* @param $rev
*/
public function upgrade_3_4_6($rev)
{
$modifiedReportIds = array('event/summary', 'activity', 'Mailing/bounce', 'Mailing/clicks', 'Mailing/opened');
$instances = CRM_Core_DAO::executeQuery("SELECT id, form_values, report_id FROM civicrm_report_instance WHERE report_id IN ('" . implode("','", $modifiedReportIds) . "')");
while ($instances->fetch()) {
$formValues = unserialize($instances->form_values);
switch ($instances->report_id) {
case 'event/summary':
$eventDates = array('event_start_date_from', 'event_start_date_to', 'event_end_date_from', 'event_end_date_to');
foreach ($eventDates as $date) {
if (isset($formValues[$date]) && $formValues[$date] == ' ') {
$formValues[$date] = '';
}
}
break;
case 'activity':
if (isset($formValues['group_bys'])) {
if (is_array($formValues['group_bys'])) {
$orderBy = array();
$count = 0;
foreach ($formValues['group_bys'] as $col => $isSet) {
if (!$isSet) {
continue;
}
$orderBy[++$count] = array('column' => $col, 'order' => 'ASC');
}
if (!empty($orderBy)) {
$formValues['order_bys'] = $orderBy;
}
}
unset($formValues['group_bys']);
}
break;
case 'Mailing/bounce':
case 'Mailing/clicks':
case 'Mailing/opened':
$formValues['fields']['mailing_name'] = 1;
break;
}
// save updated instance criteria
$dao = new CRM_Report_DAO_ReportInstance();
$dao->id = $instances->id;
$dao->form_values = serialize($formValues);
$dao->save();
$dao->free();
}
$bulkEmailActivityType = CRM_Core_DAO::singleValueQuery("\nSELECT v.id\nFROM civicrm_option_value v,\n civicrm_option_group g\nWHERE v.option_group_id = g.id\n AND g.name = %1\n AND g.is_active = 1\n AND v.name = %2", array(1 => array('activity_type', 'String'), 2 => array('Bulk Email', 'String')));
// CRM-8852, reset contact field cache
CRM_Core_BAO_Cache::deleteGroup('contact fields');
$upgrade = new CRM_Upgrade_Form();
$upgrade->assign('bulkEmailActivityType', $bulkEmailActivityType);
$upgrade->processSQL($rev);
}
示例4: upgrade_3_2_1
/**
* @param $rev
*/
public function upgrade_3_2_1($rev)
{
//CRM-6565 check if Activity Index is already exists or not.
$addActivityTypeIndex = TRUE;
$indexes = CRM_Core_DAO::executeQuery('SHOW INDEXES FROM civicrm_activity');
while ($indexes->fetch()) {
if ($indexes->Key_name == 'UI_activity_type_id') {
$addActivityTypeIndex = FALSE;
}
}
// CRM-6563: restrict access to the upload dir, tighten access to the config-and-log dir
$config = CRM_Core_Config::singleton();
CRM_Utils_File::restrictAccess($config->uploadDir);
CRM_Utils_File::restrictAccess($config->configAndLogDir);
$upgrade = new CRM_Upgrade_Form();
$upgrade->assign('addActivityTypeIndex', $addActivityTypeIndex);
$upgrade->processSQL($rev);
}