상속: extends QTextBox
예제 #1
0
파일: payment.php 프로젝트: alcf/chms
 public function RenderCost($objItem)
 {
     // Required and Optional Products
     if ($objItem instanceof FormProduct) {
         switch ($objItem->FormPaymentTypeId) {
             case FormPaymentType::PayInFull:
             case FormPaymentType::DepositRequired:
                 return QApplication::DisplayCurrency($objItem->Cost);
             case FormPaymentType::Donation:
                 $txtDonation = $this->GetControl('txtDonation' . $objItem->Id);
                 if (!$txtDonation) {
                     $txtDonation = new QFloatTextBox($this->dtgProducts, 'txtDonation' . $objItem->Id);
                     $txtDonation->ActionParameter = $objItem->Id;
                     $txtDonation->Minimum = 0;
                     $txtDonation->Width = '60px';
                     $txtDonation->MaxLength = 8;
                     $txtDonation->Required = $objItem->FormProductTypeId == FormProductType::Required;
                     $txtDonation->AddAction(new QChangeEvent(), new QAjaxAction('txtDonation_Change'));
                     $txtDonation->AddAction(new QEnterKeyEvent(), new QAjaxAction('txtDonation_Change'));
                     $txtDonation->AddAction(new QEnterKeyEvent(), new QTerminateAction());
                 }
                 return '$ ' . $txtDonation->Render(false);
         }
         // Payment Entries
     } else {
         if ($objItem instanceof SignupPayment) {
             return null;
             // "Required with Choice" Products
         } else {
             if ($objItem == -1) {
                 $objProduct = FormProduct::Load($this->lstRequiredWithChoice->SelectedValue);
                 if (!$objProduct) {
                     return null;
                 }
                 switch ($objProduct->FormPaymentTypeId) {
                     case FormPaymentType::PayInFull:
                     case FormPaymentType::DepositRequired:
                         return QApplication::DisplayCurrency($objProduct->Cost);
                     case FormPaymentType::Donation:
                         $txtDonation = $this->GetControl('txtDonation' . $objProduct->Id);
                         if (!$txtDonation) {
                             $txtDonation = new QFloatTextBox($this->dtgProducts, 'txtDonation' . $objProduct->Id);
                             $txtDonation->ActionParameter = $objProduct->Id;
                             $txtDonation->Minimum = 0;
                             $txtDonation->Width = '60px';
                             $txtDonation->MaxLength = 8;
                             $txtDonation->Required = true;
                             $txtDonation->AddAction(new QChangeEvent(), new QAjaxAction('txtDonation_Change'));
                             $txtDonation->AddAction(new QEnterKeyEvent(), new QAjaxAction('txtDonation_Change'));
                             $txtDonation->AddAction(new QEnterKeyEvent(), new QTerminateAction());
                         }
                         return '$ ' . $txtDonation->Render(false);
                 }
             }
         }
     }
 }
예제 #2
0
파일: recurringInfo.php 프로젝트: alcf/chms
 public function RenderAmount(RecurringDonationItems $objItem = null)
 {
     if (!$objItem) {
         return $this->lblTotal->Render(false);
     }
     $txtAmount = $this->GetControl('txtAmount' . $this->dtgDonationItems->CurrentRowIndex);
     $lstFunds = $this->GetControl('lstFunds' . $this->dtgDonationItems->CurrentRowIndex);
     if (!$txtAmount) {
         $txtAmount = new QFloatTextBox($this->dtgDonationItems, 'txtAmount' . $this->dtgDonationItems->CurrentRowIndex);
         $txtAmount->ActionParameter = $this->dtgDonationItems->CurrentRowIndex;
         $txtAmount->AddAction(new QChangeEvent(), new QAjaxAction('txtAmount_Change'));
         $txtAmount->Width = '100px';
         if ($objItem != null) {
             $txtAmount->Text = $objItem->Amount;
         } else {
             $txtAmount->Text = '0.00';
         }
     }
     if (!is_null($lstFunds->SelectedValue)) {
         if (!$txtAmount->Enabled) {
             $txtAmount->Enabled = true;
         }
     } else {
         $txtAmount->Enabled = false;
         $txtAmount->Text = '0.00';
     }
     return '$ ' . $txtAmount->RenderWithError(false);
 }