示例#1
0
 protected function Form_Create()
 {
     $this->objOnlineDonation = OnlineDonation::Load(QApplication::PathInfo(0));
     if (!$this->objOnlineDonation) {
         QApplication::Redirect('/give/');
     }
     if ($this->objOnlineDonation->Hash != QApplication::PathInfo(1)) {
         QApplication::Redirect('/give/');
     }
     // Create the Short-Circuit Registratino form IF:
     // The person donating does not yet have a record AND
     // we still have the email-to-send in Session
     if (array_key_exists('onlineDonationEmailAddress' . $this->objOnlineDonation->Id, $_SESSION) && !$this->objOnlineDonation->Person->PublicLogin) {
         $this->txtUsername = new QTextBox($this);
         $this->txtUsername->Name = 'Username';
         $this->txtUsername->Required = true;
         $this->txtUsername->MaxLength = PublicLogin::UsernameMaxLength;
         $this->txtPassword = new QTextBox($this);
         $this->txtPassword->Name = 'Select a Password';
         $this->txtPassword->Required = true;
         $this->txtPassword->TextMode = QTextMode::Password;
         $this->txtPassword->Instructions = 'At least 6 characters long';
         $this->txtConfirmPassword = new QTextBox($this);
         $this->txtConfirmPassword->Name = 'Confirm Password';
         $this->txtConfirmPassword->Instructions = 'Must match above';
         $this->txtConfirmPassword->Required = true;
         $this->txtConfirmPassword->TextMode = QTextMode::Password;
         $this->lstQuestion = new QListBox($this);
         $this->lstQuestion->Name = '"Forgot Password" Question';
         $this->lstQuestion->AddItem('- Select One -', null);
         $this->lstQuestion->AddItem('What city were you born in?', 'What city were you born in?');
         $this->lstQuestion->AddItem('What is the name of your elementary school?', 'What is the name of your elementary school?');
         $this->lstQuestion->AddItem('What street did you grow up on?', 'What street did you grow up on?');
         $this->lstQuestion->AddItem('What is the name of your pet?', 'What is the name of your pet?');
         $this->lstQuestion->AddItem('What was the make and model of your first car?', 'What was the make and model of your first car?');
         $this->lstQuestion->AddItem('- Other... -', false);
         $this->lstQuestion->Required = true;
         $this->lstQuestion->AddAction(new QChangeEvent(), new QAjaxAction('lstQuestion_Refresh'));
         $this->txtQuestion = new QTextBox($this);
         $this->txtAnswer = new QTextBox($this);
         $this->txtAnswer->Name = 'Your Answer';
         $this->txtAnswer->Required = true;
         $this->lstQuestion_Refresh();
         $this->btnRegister = new QButton($this);
         $this->btnRegister->Text = 'Register';
         $this->btnRegister->CssClass = 'primary';
         $this->btnRegister->CausesValidation = true;
         $this->btnRegister->AddAction(new QClickEvent(), new QAjaxAction('btnRegister_Click'));
         $this->btnCancel = new QLinkButton($this);
         $this->btnCancel->Text = 'No Thanks';
         $this->btnCancel->CssClass = 'cancel';
         $this->btnCancel->AddAction(new QClickEvent(), new QJavaScriptAction('myAlcf.toggleShortCircuitReg(false);'));
         $this->btnCancel->AddAction(new QClickEvent(), new QTerminateAction());
     }
 }
 /**
  * Static Helper Method to Create using PK arguments
  * You must pass in the PK arguments on an object to load, or leave it blank to create a new one.
  * If you want to load via QueryString or PathInfo, use the CreateFromQueryString or CreateFromPathInfo
  * static helper methods.  Finally, specify a CreateType to define whether or not we are only allowed to 
  * edit, or if we are also allowed to create a new one, etc.
  * 
  * @param mixed $objParentObject QForm or QPanel which will be using this OnlineDonationMetaControl
  * @param integer $intId primary key value
  * @param QMetaControlCreateType $intCreateType rules governing OnlineDonation object creation - defaults to CreateOrEdit
  * @return OnlineDonationMetaControl
  */
 public static function Create($objParentObject, $intId = null, $intCreateType = QMetaControlCreateType::CreateOrEdit)
 {
     // Attempt to Load from PK Arguments
     if (strlen($intId)) {
         $objOnlineDonation = OnlineDonation::Load($intId);
         // OnlineDonation was found -- return it!
         if ($objOnlineDonation) {
             return new OnlineDonationMetaControl($objParentObject, $objOnlineDonation);
         } else {
             if ($intCreateType != QMetaControlCreateType::CreateOnRecordNotFound) {
                 throw new QCallerException('Could not find a OnlineDonation object with PK arguments: ' . $intId);
             }
         }
         // If EditOnly is specified, throw an exception
     } else {
         if ($intCreateType == QMetaControlCreateType::EditOnly) {
             throw new QCallerException('No PK arguments specified');
         }
     }
     // If we are here, then we need to create a new record
     return new OnlineDonationMetaControl($objParentObject, new OnlineDonation());
 }
 /**
  * This will save this object's CreditCardPayment instance,
  * updating only the fields which have had a control created for it.
  */
 public function SaveCreditCardPayment()
 {
     try {
         // Update any fields for controls that have been created
         if ($this->lstCreditCardStatusType) {
             $this->objCreditCardPayment->CreditCardStatusTypeId = $this->lstCreditCardStatusType->SelectedValue;
         }
         if ($this->lstCreditCardType) {
             $this->objCreditCardPayment->CreditCardTypeId = $this->lstCreditCardType->SelectedValue;
         }
         if ($this->txtCreditCardLastFour) {
             $this->objCreditCardPayment->CreditCardLastFour = $this->txtCreditCardLastFour->Text;
         }
         if ($this->txtTransactionCode) {
             $this->objCreditCardPayment->TransactionCode = $this->txtTransactionCode->Text;
         }
         if ($this->txtAuthorizationCode) {
             $this->objCreditCardPayment->AuthorizationCode = $this->txtAuthorizationCode->Text;
         }
         if ($this->txtAddressMatchCode) {
             $this->objCreditCardPayment->AddressMatchCode = $this->txtAddressMatchCode->Text;
         }
         if ($this->calDateAuthorized) {
             $this->objCreditCardPayment->DateAuthorized = $this->calDateAuthorized->DateTime;
         }
         if ($this->calDateCaptured) {
             $this->objCreditCardPayment->DateCaptured = $this->calDateCaptured->DateTime;
         }
         if ($this->txtAmountCharged) {
             $this->objCreditCardPayment->AmountCharged = $this->txtAmountCharged->Text;
         }
         if ($this->txtAmountFee) {
             $this->objCreditCardPayment->AmountFee = $this->txtAmountFee->Text;
         }
         if ($this->txtAmountCleared) {
             $this->objCreditCardPayment->AmountCleared = $this->txtAmountCleared->Text;
         }
         if ($this->lstPaypalBatch) {
             $this->objCreditCardPayment->PaypalBatchId = $this->lstPaypalBatch->SelectedValue;
         }
         if ($this->chkUnlinkedFlag) {
             $this->objCreditCardPayment->UnlinkedFlag = $this->chkUnlinkedFlag->Checked;
         }
         if ($this->lstStewardshipContribution) {
             $this->objCreditCardPayment->StewardshipContributionId = $this->lstStewardshipContribution->SelectedValue;
         }
         // Update any UniqueReverseReferences (if any) for controls that have been created for it
         if ($this->lstOnlineDonation) {
             $this->objCreditCardPayment->OnlineDonation = OnlineDonation::Load($this->lstOnlineDonation->SelectedValue);
         }
         if ($this->lstSignupPayment) {
             $this->objCreditCardPayment->SignupPayment = SignupPayment::Load($this->lstSignupPayment->SelectedValue);
         }
         // Save the CreditCardPayment object
         $this->objCreditCardPayment->Save();
         // Finally, update any ManyToManyReferences (if any)
     } catch (QCallerException $objExc) {
         $objExc->IncrementOffset();
         throw $objExc;
     }
 }
示例#4
0
 /**
  * Reload this OnlineDonation from the database.
  * @return void
  */
 public function Reload()
 {
     // Make sure we are actually Restored from the database
     if (!$this->__blnRestored) {
         throw new QCallerException('Cannot call Reload() on a new, unsaved OnlineDonation object.');
     }
     // Reload the Object
     $objReloaded = OnlineDonation::Load($this->intId);
     // Update $this's local variables to match
     $this->PersonId = $objReloaded->PersonId;
     $this->strConfirmationEmail = $objReloaded->strConfirmationEmail;
     $this->fltAmount = $objReloaded->fltAmount;
     $this->CreditCardPaymentId = $objReloaded->CreditCardPaymentId;
     $this->blnIsRecurringFlag = $objReloaded->blnIsRecurringFlag;
     $this->intStatus = $objReloaded->intStatus;
     $this->RecurringPaymentId = $objReloaded->RecurringPaymentId;
 }
 /**
  * Override method to perform a property "Get"
  * This will get the value of $strName
  *
  * @param string $strName Name of the property to get
  * @return mixed
  */
 public function __get($strName)
 {
     switch ($strName) {
         ///////////////////
         // Member Variables
         ///////////////////
         case 'Id':
             // Gets the value for intId (Read-Only PK)
             // @return integer
             return $this->intId;
         case 'OnlineDonationId':
             // Gets the value for intOnlineDonationId (Not Null)
             // @return integer
             return $this->intOnlineDonationId;
         case 'Amount':
             // Gets the value for fltAmount
             // @return double
             return $this->fltAmount;
         case 'DonationFlag':
             // Gets the value for blnDonationFlag (Not Null)
             // @return boolean
             return $this->blnDonationFlag;
         case 'StewardshipFundId':
             // Gets the value for intStewardshipFundId
             // @return integer
             return $this->intStewardshipFundId;
         case 'Other':
             // Gets the value for strOther
             // @return string
             return $this->strOther;
             ///////////////////
             // Member Objects
             ///////////////////
         ///////////////////
         // Member Objects
         ///////////////////
         case 'OnlineDonation':
             // Gets the value for the OnlineDonation object referenced by intOnlineDonationId (Not Null)
             // @return OnlineDonation
             try {
                 if (!$this->objOnlineDonation && !is_null($this->intOnlineDonationId)) {
                     $this->objOnlineDonation = OnlineDonation::Load($this->intOnlineDonationId);
                 }
                 return $this->objOnlineDonation;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'StewardshipFund':
             // Gets the value for the StewardshipFund object referenced by intStewardshipFundId
             // @return StewardshipFund
             try {
                 if (!$this->objStewardshipFund && !is_null($this->intStewardshipFundId)) {
                     $this->objStewardshipFund = StewardshipFund::Load($this->intStewardshipFundId);
                 }
                 return $this->objStewardshipFund;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
             ////////////////////////////
             // Virtual Object References (Many to Many and Reverse References)
             // (If restored via a "Many-to" expansion)
             ////////////////////////////
         ////////////////////////////
         // Virtual Object References (Many to Many and Reverse References)
         // (If restored via a "Many-to" expansion)
         ////////////////////////////
         case '__Restored':
             return $this->__blnRestored;
         default:
             try {
                 return parent::__get($strName);
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
     }
 }