}
}
if ($rev == '4.4.6'){
- $postUpgradeMessage .= '<br /><br /><strong>'. ts('Your contact image urls have been upgraded. If your contact image urls did not follow the standard format for image Urls they have not been upgraded. Please check the log to see image urls that were not upgraded.');
+ $postUpgradeMessage .= '<br /><br /><strong>'. ts('Your contact image urls have been upgraded. If your contact image urls did not follow the standard format for image Urls they have not been upgraded. Please check the log to see image urls that were not upgraded.');
}
}
END;
";
CRM_Core_DAO::executeQuery($query, array(), TRUE, NULL, FALSE, FALSE);
-
+
// CRM-13998 : missing alter statements for civicrm_report_instance
$this->addTask(ts('Confirm civicrm_report_instance sql table for upgrades'), 'updateReportInstanceTable');
$this->addTask($title, 'cleanupBackendImageUrls', $startId, $endId);
}
}
+ $this->addTask(ts('Update saved search information'), 'changeSavedSearch');
}
static function upgradeImageUrls(CRM_Queue_TaskContext $ctx, $startId, $endId){
$failures[$dao->id] = $dao->image_url;
}
}
- else{
+ else{
$failures[$dao->id] = $dao->image_url;
}
}
return TRUE;
}
+ static function changeSavedSearch(CRM_Queue_TaskContext $ctx) {
+ $membershipStatuses = array_flip(CRM_Member_PseudoConstant::membershipStatus());
+
+ $dao = new CRM_Contact_DAO_SavedSearch();
+ $dao->find();
+ while ($dao->fetch()) {
+ $formValues = CRM_Contact_BAO_SavedSearch::getFormValues($dao->id);
+ if (!empty($formValues['mapper'])) {
+ foreach ($formValues['mapper'] as $key => $value) {
+ foreach ($value as $k => $v) {
+ if ($v[0] == 'Membership' && in_array($v[1], array('membership_status', 'membership_status_id'))) {
+ $value = $formValues['value'][$key][$k];
+ $op = $formValues['operator'][$key][$k];
+ if ($op == 'IN') {
+ $value = trim($value);
+ $value = str_replace('(', '', $value);
+ $value = str_replace(')', '', $value);
+
+ $v = explode(',', $value);
+ $value = array();
+ foreach ($v as $k1 => $v2) {
+ if (is_numeric($v2)) {
+ break 2;
+ }
+ $value[$k1] = $membershipStatuses[$v2];
+ }
+ $formValues['value'][$key][$k] = "(" . implode(',', $value) . ")";
+ }
+ elseif (in_array($op, array('=', '!='))) {
+ if (is_numeric($value)) {
+ break;
+ }
+ $formValues['value'][$key][$k] = $membershipStatuses[$value];
+ }
+ }
+ }
+ }
+ $dao->form_values = serialize($formValues);
+ $dao->save();
+ }
+ }
+
+ return TRUE;
+ }
+
/**
* For WordPress/Joomla(?) sites which upgraded to 4.4.6, find back-end image_URLs
* (e.g. "http://example.com/wp-admin/admin.php?page=CiviCRM&q=civicrm/contact/imagefile&photo=123.jpg")
CRM_Core_BAO_WordReplacement::rebuild();
}
-
+
/***
* CRM-13998 missing alter statements for civicrm_report_instance
***/
public function updateReportInstanceTable() {
- // add civicrm_report_instance.name
+ // add civicrm_report_instance.name
$sql = "SELECT count(*) FROM information_schema.columns "
. "WHERE table_schema = database() AND table_name = 'civicrm_report_instance' AND COLUMN_NAME = 'name' ";
$res = CRM_Core_DAO::executeQuery($sql);
}
- // add civicrm_report_instance args
+ // add civicrm_report_instance args
$sql = "SELECT count(*) FROM information_schema.columns WHERE table_schema = database() AND table_name = 'civicrm_report_instance' AND COLUMN_NAME = 'args' ";