当前位置: 首页>>代码示例>>PHP>>正文


PHP CRM_Upgrade_Form::assign方法代码示例

本文整理汇总了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);
 }
开发者ID:peteainsworth,项目名称:civicrm-4.2.9-drupal,代码行数:23,代码来源:ThreeThree.php

示例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);
 }
开发者ID:hyebahi,项目名称:civicrm-core,代码行数:11,代码来源:FourOne.php

示例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);
 }
开发者ID:kidaa30,项目名称:yes,代码行数:56,代码来源:ThreeFour.php

示例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);
 }
开发者ID:kidaa30,项目名称:yes,代码行数:21,代码来源:ThreeTwo.php


注:本文中的CRM_Upgrade_Form::assign方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。