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


PHP CRM_Utils_Date::processDate方法代码示例

本文整理汇总了PHP中CRM_Utils_Date::processDate方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Utils_Date::processDate方法的具体用法?PHP CRM_Utils_Date::processDate怎么用?PHP CRM_Utils_Date::processDate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CRM_Utils_Date的用法示例。


在下文中一共展示了CRM_Utils_Date::processDate方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getContributionParams

 /**
  * Set the parameters to be passed to contribution create function
  *
  * @param array $params
  * @param integer $contactID
  * @param $financialTypeID
  * @param $online
  * @param $contributionPageId
  * @param $nonDeductibleAmount
  * @param $campaignId
  *
  * @param $isMonetary
  *
  * @param $pending
  * @param $paymentProcessorOutcome
  * @param $receiptDate
  *
  * @param $recurringContributionID
  * @param $isTest
  *
  * @param $addressID
  *
  * @param $softCreditToID
  *
  * @param $lineItems
  *
  * @internal param $financialType
  * @return array
  */
 public static function getContributionParams($params, $contactID, $financialTypeID, $online, $contributionPageId, $nonDeductibleAmount, $campaignId, $isMonetary, $pending, $paymentProcessorOutcome, $receiptDate, $recurringContributionID, $isTest, $addressID, $softCreditToID, $lineItems)
 {
     $contributionParams = array('contact_id' => $contactID, 'financial_type_id' => $financialTypeID, 'contribution_page_id' => $contributionPageId, 'receive_date' => CRM_Utils_Array::value('receive_date', $params) ? CRM_Utils_Date::processDate($params['receive_date']) : date('YmdHis'), 'non_deductible_amount' => $nonDeductibleAmount, 'total_amount' => $params['amount'], 'amount_level' => CRM_Utils_Array::value('amount_level', $params), 'invoice_id' => $params['invoiceID'], 'currency' => $params['currencyID'], 'source' => !$online || !empty($params['source']) ? CRM_Utils_Array::value('source', $params) : CRM_Utils_Array::value('description', $params), 'is_pay_later' => CRM_Utils_Array::value('is_pay_later', $params, 0), 'cancel_reason' => CRM_Utils_Array::value('cancel_reason', $params, 0), 'cancel_date' => isset($params['cancel_date']) ? CRM_Utils_Date::format($params['cancel_date']) : NULL, 'thankyou_date' => isset($params['thankyou_date']) ? CRM_Utils_Date::format($params['thankyou_date']) : NULL, 'campaign_id' => $campaignId, 'is_test' => $isTest, 'address_id' => $addressID, 'soft_credit_to' => $softCreditToID, 'line_item' => $lineItems, 'skipLineItem' => CRM_Utils_Array::value('skipLineItem', $params, 0));
     if (!$online && isset($params['thankyou_date'])) {
         $contributionParam['thankyou_date'] = $params['thankyou_date'];
     }
     if (!$online || $isMonetary) {
         if (empty($params['is_pay_later'])) {
             $contributionParams['payment_instrument_id'] = 1;
         }
     }
     if (!$pending && $paymentProcessorOutcome) {
         $contributionParams += array('fee_amount' => CRM_Utils_Array::value('fee_amount', $paymentProcessorOutcome), 'net_amount' => CRM_Utils_Array::value('net_amount', $paymentProcessorOutcome, $params['amount']), 'trxn_id' => $paymentProcessorOutcome['trxn_id'], 'receipt_date' => $receiptDate, 'trxn_result_code' => CRM_Utils_Array::value('trxn_result_code', $paymentProcessorOutcome), 'payment_processor' => CRM_Utils_Array::value('payment_processor', $paymentProcessorOutcome));
     }
     // CRM-4038: for non-en_US locales, CRM_Contribute_BAO_Contribution::add() expects localised amounts
     $contributionParams['non_deductible_amount'] = trim(CRM_Utils_Money::format($contributionParams['non_deductible_amount'], ' '));
     $contributionParams['total_amount'] = trim(CRM_Utils_Money::format($contributionParams['total_amount'], ' '));
     if ($recurringContributionID) {
         $contributionParams['contribution_recur_id'] = $recurringContributionID;
     }
     $contributionParams['contribution_status_id'] = $pending ? 2 : 1;
     if (isset($contributionParams['invoice_id'])) {
         $contributionParams['id'] = CRM_Core_DAO::getFieldValue('CRM_Contribute_DAO_Contribution', $contributionParams['invoice_id'], 'id', 'invoice_id');
     }
     return $contributionParams;
 }
开发者ID:ruchirapingale,项目名称:civicrm-core,代码行数:55,代码来源:Confirm.php

示例2: postProcess

 public function postProcess()
 {
     $params = $this->_submitValues;
     $batchDetailsSql = " UPDATE civicrm_batch SET ";
     $batchDetailsSql .= "    title = %1 ";
     $batchDetailsSql .= " ,  description = %2 ";
     $batchDetailsSql .= " ,  banking_account = %3 ";
     $batchDetailsSql .= " ,  banking_date  = %4 ";
     $batchDetailsSql .= " ,  exclude_from_posting = %5 ";
     $batchDetailsSql .= " ,  contribution_type_id = %6 ";
     $batchDetailsSql .= " ,  payment_instrument_id = %7 ";
     $batchDetailsSql .= " WHERE id = %8 ";
     $bankingDate = CRM_Utils_Date::processDate($params['banking_date']);
     $sqlParams = array();
     $sqlParams[1] = array((string) $params['batch_title'], 'String');
     $sqlParams[2] = array((string) $params['description'], 'String');
     $sqlParams[3] = array((string) $params['banking_account'], 'String');
     $sqlParams[4] = array((string) $bankingDate, 'String');
     $sqlParams[5] = array((string) $params['exclude_from_posting'], 'String');
     $sqlParams[6] = array((string) $params['contribution_type_id'], 'String');
     $sqlParams[7] = array((string) $params['payment_instrument_id'], 'String');
     $sqlParams[8] = array((int) $params['id'], 'Integer');
     CRM_Core_DAO::executeQuery($batchDetailsSql, $sqlParams);
     drupal_goto('civicrm/batch/process', array('query' => array('bid' => $params['id'], 'reset' => '1')));
     CRM_Utils_System::civiExit();
 }
开发者ID:hoegrammer,项目名称:uk.co.vedaconsulting.module.justgivingImports,代码行数:26,代码来源:Batch.php

示例3: add

 /**
  * Takes an associative array and creates a discount item
  *
  * This function extracts all the params it needs to initialize the created
  * discount item. The params array could contain additional unused name/value
  * pairs
  *
  * @param array $params (reference ) an assoc array of name/value pairs
  *
  * @return object CRM_CiviDiscount_BAO_Item object
  * @access public
  * @static
  */
 static function add(&$params)
 {
     $item = new CRM_CiviDiscount_DAO_Item();
     $item->code = $params['code'];
     $item->description = $params['description'];
     $item->amount = $params['amount'];
     $item->amount_type = $params['amount_type'];
     $item->discount_term = $params['discount_term'];
     $item->count_max = $params['count_max'];
     $item->discount_msg = $params['discount_msg'];
     $item->filters = json_encode($params['filters']);
     $item->autodiscount = json_encode($params['autodiscount']);
     foreach ($params['multi_valued'] as $mv => $dontCare) {
         if (!empty($params[$mv])) {
             $item->{$mv} = CRM_Core_DAO::VALUE_SEPARATOR . implode(CRM_Core_DAO::VALUE_SEPARATOR, array_values($params[$mv])) . CRM_Core_DAO::VALUE_SEPARATOR;
         } else {
             $item->{$mv} = 'null';
         }
     }
     if (!empty($params['id'])) {
         $item->id = $params['id'];
     }
     $item->is_active = CRM_Utils_Array::value('is_active', $params) ? 1 : 0;
     $item->discount_msg_enabled = CRM_Utils_Array::value('discount_msg_enabled', $params) ? 1 : 0;
     if (!empty($params['active_on'])) {
         $item->active_on = CRM_Utils_Date::processDate($params['active_on']);
     } else {
         $item->active_on = 'null';
     }
     if (!empty($params['expire_on'])) {
         $item->expire_on = CRM_Utils_Date::processDate($params['expire_on']);
     } else {
         $item->expire_on = 'null';
     }
     if (!empty($params['organization_id'])) {
         $item->organization_id = $params['organization_id'];
     } else {
         $item->organization_id = 'null';
     }
     $id = empty($params['id']) ? NULL : $params['id'];
     $op = $id ? 'edit' : 'create';
     CRM_Utils_Hook::pre($op, 'CiviDiscount', $id, $params);
     $item->save();
     CRM_Utils_Hook::post($op, 'CiviDiscount', $item->id, $item);
     return $item;
 }
开发者ID:krishgopi,项目名称:org.civicrm.module.cividiscount,代码行数:59,代码来源:Item.php

示例4: postProcess

 function postProcess()
 {
     $params = $this->controller->exportValues($this->_name);
     $parent = $this->controller->getParent();
     if (!empty($params)) {
         $fields = array('mailing_name', 'mailing_from', 'mailing_to', 'sort_name');
         foreach ($fields as $field) {
             if (isset($params[$field]) && !CRM_Utils_System::isNull($params[$field])) {
                 if (substr($field, 7) != 'name') {
                     $parent->set($field, CRM_Utils_Date::unformat(CRM_Utils_Date::processDate($params[$field]), ''));
                 } else {
                     $parent->set($field, $params[$field]);
                 }
             } else {
                 $parent->set($field, null);
             }
         }
     }
 }
开发者ID:ksecor,项目名称:civicrm,代码行数:19,代码来源:Search.php

示例5: __construct

 function __construct(&$formValues)
 {
     $this->_formValues = $formValues;
     $this->_columns = array(ts('Contact Id') => 'contact_id', ts('Name') => 'display_name', ts('Donation Count') => 'donation_count', ts('Donation Amount') => 'donation_amount');
     $this->_amounts = array('min_amount_1' => ts('Min Amount One'), 'max_amount_1' => ts('Max Amount One'), 'min_amount_2' => ts('Min Amount Two'), 'max_amount_2' => ts('Max Amount Two'), 'exclude_min_amount' => ts('Exclusion Min Amount'), 'exclude_max_amount' => ts('Exclusion Max Amount'));
     $this->_dates = array('start_date_1' => ts('Start Date One'), 'end_date_1' => ts('End Date One'), 'start_date_2' => ts('Start Date Two'), 'end_date_2' => ts('End Date Two'), 'exclude_start_date' => ts('Exclusion Start Date'), 'exclude_end_date' => ts('Exclusion End Date'));
     $this->_checkboxes = array('is_first_amount' => ts('First Donation?'));
     foreach ($this->_amounts as $name => $title) {
         $this->{$name} = CRM_Utils_Array::value($name, $this->_formValues);
     }
     foreach ($this->_checkboxes as $name => $title) {
         $this->{$name} = CRM_Utils_Array::value($name, $this->_formValues, FALSE);
     }
     foreach ($this->_dates as $name => $title) {
         if (CRM_Utils_Array::value($name, $this->_formValues)) {
             $this->{$name} = CRM_Utils_Date::processDate($this->_formValues[$name]);
         }
     }
 }
开发者ID:peteainsworth,项目名称:civicrm-4.2.9-drupal,代码行数:19,代码来源:ContribSYBNT.php

示例6: create

 /**
  * takes an associative array and creates a cancellation object
  *
  * the function extract all the params it needs to initialize the create a
  * resource object. the params array could contain additional unused name/value
  * pairs
  *
  * @param array $params (reference ) an assoc array of name/value pairs
  * @param array $ids    the array that holds all the db ids
  *
  * @return object CRM_Booking_BAO_Cancellation object
  * @access public
  * @static
  */
 static function create(&$values)
 {
     $bookingID = CRM_Utils_Array::value('booking_id', $values);
     if (!$bookingID) {
         return;
     } else {
         $transaction = new CRM_Core_Transaction();
         try {
             $params = array('option_group_name' => CRM_Booking_Utils_Constants::OPTION_BOOKING_STATUS, 'name' => CRM_Booking_Utils_Constants::OPTION_VALUE_CANCELLED);
             $result = civicrm_api3('OptionValue', 'get', $params);
             $params = array();
             $params['id'] = $bookingID;
             $params['status_id'] = CRM_Utils_Array::value('value', CRM_Utils_Array::value($result['id'], $result['values']));
             $booking = CRM_Booking_BAO_Booking::create($params);
             $params = array();
             $params['booking_id'] = $bookingID;
             $percentage = CRM_Utils_Array::value('cancellation_percentage', $values);
             $bookingTotal = CRM_Utils_Array::value('booking_total', $values);
             $cancellationFee = $bookingTotal * $percentage / 100;
             $additionalCharge = CRM_Utils_Array::value('additional_charge', $values);
             if (is_numeric($additionalCharge)) {
                 $cancellationFee += $additionalCharge;
                 $params['additional_fee'] = $additionalCharge;
             }
             $params['cancellation_date'] = CRM_Utils_Date::processDate(CRM_Utils_Array::value('cancellation_date', $values));
             $params['comment'] = CRM_Utils_Array::value('comment', $values);
             $params['cancellation_fee'] = $cancellationFee;
             self::add($params);
             $slots = CRM_Booking_BAO_Slot::getBookingSlot($bookingID);
             foreach ($slots as $slotId => $slots) {
                 $subSlots = CRM_Booking_BAO_SubSlot::getSubSlotSlot($slotId);
                 foreach ($subSlots as $subSlotId => $subSlot) {
                     CRM_Booking_BAO_SubSlot::cancel($subSlotId);
                 }
                 CRM_Booking_BAO_Slot::cancel($slotId);
             }
             // return TRUE;
         } catch (Exception $e) {
             $transaction->rollback();
             CRM_Core_Error::fatal($e->getMessage());
         }
     }
 }
开发者ID:sushantpaste,项目名称:civibooking,代码行数:57,代码来源:Cancellation.php

示例7: postProcess

 function postProcess()
 {
     $params = $this->controller->exportValues($this->_name);
     $startDate = CRM_Utils_Date::processDate($params['start_date'], null, false, 'Ymd');
     $endDate = CRM_Utils_Date::processDate($params['end_date'], null, false, 'Ymd');
     $includeMorning = CRM_Utils_Array::value('include_morning', $params, false);
     $showDetails = CRM_Utils_Array::value('show_details', $params, false);
     $notSignedOut = CRM_Utils_Array::value('not_signed_out', $params, false);
     $showBalances = CRM_Utils_Array::value('show_balances', $params, false);
     require_once 'SFS/Utils/ExtendedCare.php';
     if ($showBalances) {
         $showDetails = false;
         $summary =& SFS_Utils_ExtendedCare::balanceDetails();
     } else {
         $summary =& SFS_Utils_ExtendedCare::signoutDetails($startDate, $endDate, $includeMorning, $showDetails, $notSignedOut, $params['student_id']);
     }
     $this->assign('summary', $summary);
     $this->assign('showBalances', $showBalances);
     $this->assign('showDetails', $showDetails);
 }
开发者ID:pzingg,项目名称:sfschool,代码行数:20,代码来源:ExtendedCareSummary.php

示例8: run

 function run()
 {
     //get date value from url through get method
     $date = CRM_Utils_Request::retrieve('date', 'Positive', $this, FALSE, 0);
     //convert javascript.getTime() to PHP date format
     $date = date('m/d/Y', round($date / 1000));
     //get resources information by selected date
     $from = CRM_Utils_Date::processDate($date);
     $resources = CRM_Booking_BAO_Slot::getSlotDetailsOrderByResourceBetweenDate($from, $from);
     $values = array();
     //put resources result to values, being ready to display.
     $values['resources'] = $resources;
     //Convert date to compile with crmDate
     $values['dayview_select_date'] = DateTime::createFromFormat('m/d/Y', $date)->format('Y-m-d');
     //assign variables for use in a template
     $this->assign($values);
     // Example: Set the page-title dynamically; alternatively, declare a static title in xml/Menu/*.xml
     CRM_Utils_System::setTitle(ts('DayViewPrint'));
     parent::run();
 }
开发者ID:sushantpaste,项目名称:civibooking,代码行数:20,代码来源:DayView.php

示例9: postProcess

 function postProcess()
 {
     $params = $this->controller->exportValues($this->_name);
     $parent = $this->controller->getParent();
     $parent->set('searchResult', 1);
     if (!empty($params)) {
         $fields = array('title', 'event_type_id', 'start_date', 'end_date', 'eventsByDates');
         foreach ($fields as $field) {
             if (isset($params[$field]) && !CRM_Utils_System::isNull($params[$field])) {
                 if (substr($field, -4) == 'date') {
                     $parent->set($field, CRM_Utils_Date::unformat(CRM_Utils_Date::processDate($params[$field]), ''));
                 } else {
                     $parent->set($field, $params[$field]);
                 }
             } else {
                 $parent->set($field, null);
             }
         }
     }
 }
开发者ID:ksecor,项目名称:civicrm,代码行数:20,代码来源:SearchEvent.php

示例10: postProcess

 function postProcess()
 {
     $values = $this->exportValues();
     $selectedDate = CRM_Utils_Array::value('dayview_select_date', $values);
     //get booking slots from selected date
     $from = CRM_Utils_Date::processDate($selectedDate);
     $resources = CRM_Booking_BAO_Slot::getSlotDetailsOrderByResourceBetweenDate($from, $from);
     //put resources result to values, being ready to display.
     $values['resources'] = $resources;
     if (empty($resources)) {
         //check empty result
         //Convert date to show on no match found view
         $values['dayview_select_date'] = DateTime::createFromFormat('m/d/Y', $selectedDate)->format('d/m/Y');
     } else {
         //Convert date to compile with crmDate
         $values['dayview_select_date'] = DateTime::createFromFormat('m/d/Y', $selectedDate)->format('Y-m-d');
     }
     //assign values to show on template
     $this->assign($values);
     //parent::postProcess();
 }
开发者ID:sushantpaste,项目名称:civibooking,代码行数:21,代码来源:DayView.php

示例11: postProcess

 function postProcess()
 {
     $params = $this->controller->exportValues($this->_name);
     CRM_Contact_BAO_Query::fixDateValues($params["mailing_relative"], $params['mailing_from'], $params['mailing_to']);
     $parent = $this->controller->getParent();
     if (!empty($params)) {
         $fields = array('mailing_name', 'mailing_from', 'mailing_to', 'sort_name', 'campaign_id', 'mailing_status', 'sms');
         foreach ($fields as $field) {
             if (isset($params[$field]) && !CRM_Utils_System::isNull($params[$field])) {
                 if (in_array($field, array('mailing_from', 'mailing_to')) && !$params["mailing_relative"]) {
                     $time = $field == 'mailing_to' ? '235959' : NULL;
                     $parent->set($field, CRM_Utils_Date::processDate($params[$field], $time));
                 } else {
                     $parent->set($field, $params[$field]);
                 }
             } else {
                 $parent->set($field, NULL);
             }
         }
     }
 }
开发者ID:peteainsworth,项目名称:civicrm-4.2.9-drupal,代码行数:21,代码来源:Search.php

示例12: postProcess

 public function postProcess()
 {
     $params = $this->controller->exportValues($this->_name);
     $parent = $this->controller->getParent();
     $parent->set('searchResult', 1);
     if (!empty($params)) {
         $fields = array('title', 'event_type_id', 'start_date', 'end_date', 'eventsByDates', 'campaign_id');
         foreach ($fields as $field) {
             if (isset($params[$field]) && !CRM_Utils_System::isNull($params[$field])) {
                 if (substr($field, -4) == 'date') {
                     $time = $field == 'end_date' ? '235959' : NULL;
                     $parent->set($field, CRM_Utils_Date::processDate($params[$field], $time));
                 } else {
                     $parent->set($field, $params[$field]);
                 }
             } else {
                 $parent->set($field, NULL);
             }
         }
     }
 }
开发者ID:agloa,项目名称:tournament,代码行数:21,代码来源:SearchEvent.php

示例13: getContributionParams

 /**
  * Set the parameters to be passed to contribution create function.
  *
  * @param array $params
  * @param int $financialTypeID
  * @param float $nonDeductibleAmount
  * @param bool $pending
  * @param array $paymentProcessorOutcome
  * @param string $receiptDate
  * @param int $recurringContributionID
  *
  * @return array
  */
 public static function getContributionParams($params, $financialTypeID, $nonDeductibleAmount, $pending, $paymentProcessorOutcome, $receiptDate, $recurringContributionID)
 {
     $contributionParams = array('financial_type_id' => $financialTypeID, 'receive_date' => CRM_Utils_Array::value('receive_date', $params) ? CRM_Utils_Date::processDate($params['receive_date']) : date('YmdHis'), 'non_deductible_amount' => $nonDeductibleAmount, 'total_amount' => $params['amount'], 'tax_amount' => CRM_Utils_Array::value('tax_amount', $params), 'amount_level' => CRM_Utils_Array::value('amount_level', $params), 'invoice_id' => $params['invoiceID'], 'currency' => $params['currencyID'], 'is_pay_later' => CRM_Utils_Array::value('is_pay_later', $params, 0), 'cancel_reason' => CRM_Utils_Array::value('cancel_reason', $params, 0), 'cancel_date' => isset($params['cancel_date']) ? CRM_Utils_Date::format($params['cancel_date']) : NULL, 'thankyou_date' => isset($params['thankyou_date']) ? CRM_Utils_Date::format($params['thankyou_date']) : NULL, 'skipLineItem' => CRM_Utils_Array::value('skipLineItem', $params, 0));
     if ($paymentProcessorOutcome) {
         $contributionParams['payment_processor'] = CRM_Utils_Array::value('payment_processor', $paymentProcessorOutcome);
     }
     if (!$pending && $paymentProcessorOutcome) {
         $contributionParams += array('fee_amount' => CRM_Utils_Array::value('fee_amount', $paymentProcessorOutcome), 'net_amount' => CRM_Utils_Array::value('net_amount', $paymentProcessorOutcome, $params['amount']), 'trxn_id' => $paymentProcessorOutcome['trxn_id'], 'receipt_date' => $receiptDate, 'trxn_result_code' => CRM_Utils_Array::value('trxn_result_code', $paymentProcessorOutcome));
     }
     // CRM-4038: for non-en_US locales, CRM_Contribute_BAO_Contribution::add() expects localised amounts
     $contributionParams['non_deductible_amount'] = trim(CRM_Utils_Money::format($contributionParams['non_deductible_amount'], ' '));
     $contributionParams['total_amount'] = trim(CRM_Utils_Money::format($contributionParams['total_amount'], ' '));
     if ($recurringContributionID) {
         $contributionParams['contribution_recur_id'] = $recurringContributionID;
     }
     $contributionParams['contribution_status_id'] = $pending ? 2 : 1;
     if (isset($contributionParams['invoice_id'])) {
         $contributionParams['id'] = CRM_Core_DAO::getFieldValue('CRM_Contribute_DAO_Contribution', $contributionParams['invoice_id'], 'id', 'invoice_id');
     }
     return $contributionParams;
 }
开发者ID:hyebahi,项目名称:civicrm-core,代码行数:34,代码来源:Confirm.php

示例14: postProcess

 function postProcess()
 {
     $current_status_ids = array();
     $dao = CRM_Core_DAO::executeQuery("SELECT id from civicrm_membership_status where is_current_member = 1");
     while ($dao->fetch()) {
         $current_status_ids[] = $dao->id;
     }
     $formValues = $this->exportValues();
     if (!isset($formValues['member_status_id'])) {
         $formValues['member_status_id'] = array();
     }
     $birth_date_from = CRM_Utils_Date::processDate($formValues['birth_date_from']);
     $birth_date_to = CRM_Utils_Date::processDate($formValues['birth_date_to']);
     $selector = new CRM_Rood_UpgradeSelector();
     $original_where = $selector->getWhere();
     $selector->setData($formValues['rood_mtype'], array_keys($formValues['member_status_id']), $birth_date_from, $birth_date_to);
     $selector->store();
     $where = $selector->getWhere();
     $count = CRM_Core_DAO::singleValueQuery("SELECT COUNT(*)\n      FROM civicrm_membership\n      INNER JOIN civicrm_contact ON civicrm_membership.contact_id = civicrm_contact.id\n      LEFT JOIN civicrm_membership sp_membership ON civicrm_contact.id = sp_membership.contact_id AND sp_membership.membership_type_id = '{$formValues['sp_mtype']}' AND sp_membership.status_id IN (" . implode(', ', $current_status_ids) . ")\n      " . $where . " AND sp_membership.id is null");
     $this->assign('found', $count);
     if ($where == $original_where && isset($_POST['continue']) && !empty($_POST['continue'])) {
         $queue = CRM_Queue_Service::singleton()->create(array('type' => 'Sql', 'name' => 'nl.sp.rood.upgrade', 'reset' => TRUE));
         $dao = CRM_Core_DAO::executeQuery("SELECT civicrm_membership.id\n       FROM civicrm_membership\n      INNER JOIN civicrm_contact ON civicrm_membership.contact_id = civicrm_contact.id\n      LEFT JOIN civicrm_membership sp_membership ON civicrm_contact.id = sp_membership.contact_id AND sp_membership.membership_type_id = '{$formValues['sp_mtype']}' AND sp_membership.status_id IN (" . implode(', ', $current_status_ids) . ")\n      " . $where . " AND sp_membership.id is null\n      ");
         $i = 1;
         while ($dao->fetch()) {
             $title = ts('Upgrade Rood lidmaatschappen %1 van %2', array(1 => $i, 2 => $count));
             //create a task without parameters
             $task = new CRM_Queue_Task(array('CRM_Rood_MembershipUpgrade', 'UpgradeFromQueue'), array($dao->id, $formValues), $title);
             //now add this task to the queue
             $queue->createItem($task);
             $i++;
         }
         $runner = new CRM_Queue_Runner(array('title' => ts('Upgrade rood lidmaatschappen'), 'queue' => $queue, 'errorMode' => CRM_Queue_Runner::ERROR_ABORT, 'onEnd' => array('CRM_Rood_Form_UpgradeRoodMembership', 'onEnd'), 'onEndUrl' => CRM_Utils_System::url('civicrm/member/upgrade_rood', 'reset=1')));
         $runner->runAllViaWeb();
         // does not return
     }
 }
开发者ID:SPnl,项目名称:nl.sp.rood,代码行数:37,代码来源:UpgradeRoodMembership.php

示例15: preProcess

 function preProcess()
 {
     parent::preProcess();
     //    	if(!empty($values['range_from']) && !empty($values['range_from'])) {
     //    		$from = CRM_Utils_Date::processDate($values['range_from'], null, null, 'Y-m-d');
     //    		$to = CRM_Utils_Date::processDate($values['range_to'], null, null, 'Y-m-d');
     //
     //    		$this->set('range_from', $from);
     //    		$this->set('range_to', $to);
     //    	}
     $values = array('range_from' => CRM_Utils_Request::retrieve('range_from', 'String', $this, false, null, 'POST'), 'range_to' => CRM_Utils_Request::retrieve('range_to', 'String', $this, false, null, 'POST'));
     if (!empty($values['range_from']) && !empty($values['range_from'])) {
         $from = CRM_Utils_Date::processDate($values['range_from'], null, null, 'Y-m-d');
         $to = CRM_Utils_Date::processDate($values['range_to'], null, null, 'Y-m-d');
         $fromDate = new DateTime($from);
         $toDate = new DateTime($to);
         $diff = $fromDate->diff($toDate);
         $days = $diff->days;
         //https://bugs.php.net/bug.php?id=51184
         if ($days == 6015) {
             $y1 = $fromDate->format('Y');
             $y2 = $toDate->format('Y');
             $z1 = $fromDate->format('z');
             $z2 = $toDate->format('z');
             $days = intval($y1 * 365.2425 + $z1) - intval($y2 * 365.2425 + $z2);
         }
         if ($days > 93 || $diff->m >= 3) {
             $this->setElementError('range_to', "Date range can't exceed 3 months");
             $this->set('range_from', null);
             $this->set('range_to', null);
         } else {
             $this->set('range_from', $from);
             $this->set('range_to', $to);
             $this->renderPayments();
         }
     }
 }
开发者ID:hoegrammer,项目名称:uk.co.vedaconsulting.module.justgivingImports,代码行数:37,代码来源:SourceUpload.php


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