Exemple #1
0
 public static function GetSomeInfoRecordWithNoOverideModel($mTransactions, $add_property)
 {
     $mTransactions->add_property = $add_property;
     $mTransactions->type = isset($_GET['type']) ? $_GET['type'] : ProTransactions::FOR_RENT;
     $mTransactions->listing_autocompelte = '';
     if (isset($_GET['listing_id']) && $_GET['listing_id']) {
         $mTransactions->listing_id = $_GET['listing_id'];
         $mTransactions->listing_autocompelte = $mTransactions->listing ? $mTransactions->listing->property_name_or_address : '';
     }
     $mTransactions->mPropertyDetail = $mTransactions->rPropertyDetail ? $mTransactions->rPropertyDetail : new ProTransactionsPropertyDetail();
     $mTransactions->aModelPropertyDocument = count($mTransactions->rPropertyDocument) ? $mTransactions->rPropertyDocument : ProTransactionsPropertyDocument::getDefaultArrayForCreate($mTransactions->type);
     $mTransactions->mTenatDefault = $mTransactions->rTenantDefault ? $mTransactions->rTenantDefault : new ProTransactionsVendorPurchaserDetail();
     $mTransactions->mLandlord = new ProTransactionsVendorPurchaserDetail();
     $mTransactions->mTenant = new ProTransactionsVendorPurchaserDetail();
     $mTransactions->mVendor = new ProTransactionsVendorPurchaserDetail();
     $mTransactions->mPurchaser = new ProTransactionsVendorPurchaserDetail();
     $mTransactions->mBillTo = new ProTransactionsBillTo();
     $mTransactions->mPropertyDetail->scenario = 'CreateTransactionTenancyOnly';
     $mTransactions->mTenatDefault->scenario = 'AgentAddTenantFromTenancy';
     $mTransactions->scenario = 'CreateTransactionForRentRecordTenancy_new';
     // for rent //CreateTransactionForRentRecordTenancy
     ProTransactions::copyFromListingToTransaction($mTransactions);
     ProTransactions::convertToUserDate($mTransactions);
     // Feb 02, 2015 , fix for update transaction
     $cAction = Yii::app()->controller->action->id;
     if ($cAction == 'update' && ProTransactions::IsTenancyTransaction($mTransactions)) {
         $mTransactions->mBillTo = $mTransactions->rBillTo ? $mTransactions->rBillTo : new ProTransactionsBillTo();
         $mTransactions->mBillTo->scenario = 'CreateVendorPurchaser';
     }
     // Feb 02, 2015 , fix for update transaction
 }
 {
     $this->pageTitle = "Engage Us - " . Yii::app()->params['title'];
     $this->layout = 'application.views.layouts.layout_user';
     $this->render('Engageus');
 }
 /**
  * @Author: ANH DUNG Nov 28, 2014
  * @Todo: On the Salesperson’s list of tenancy page, 
  * there is a new button called “ Record existing tenancy ” for 
  * creating a tenancy that does not require creating a transaction before it:
  * @param: $add_property: 1: ADD_EXISTING, 2: ADD_UNLISTED
  */
 public function actionRecord_existing_tenancy($add_property)
 {
     /** 1. get thông tin user login
      * 2. createnew tạo mới 1 transaction với status tạm =0, sau đó get thông tin liên quan
      * 3. get thông tin của listing đưa vào model của $mTransactionsPropertyDetail
      * 4. get thông tin của 3: Landlord, 4: Tenant Purchaser’s Details
      */
     MyFormat::validateUserAccess(ROLE_AGENT);
     $this->pageTitle = "Record existing tenancy - " . Yii::app()->params['title'];
     try {
         $mUser = Users::model()->findByPk(Yii::app()->user->id);
         $type = ProTransactions::FOR_RENT;
         $listing_id = 0;
         if (isset($_GET['listing_id'])) {
             $listing_id = $_GET['listing_id'];
         }
         // handle create new
         if (!isset($_GET['id'])) {
             $mTransactions = ProTransactions::CreateNewRecordTransaction($type, $listing_id);