/**
  * Displays a particular model.
  * @param integer $id the ID of the model to be displayed
  */
 public function actionView($id)
 {
     try {
         $mTransactions = $this->loadModel($id);
         $mTransactions->mBillTo = $mTransactions->rBillTo ? $mTransactions->rBillTo : new ProTransactionsBillTo();
         $mTransactions->mPropertyDetail = $mTransactions->rPropertyDetail ? $mTransactions->rPropertyDetail : new ProTransactionsPropertyDetail();
         $mTransactions->aModelPropertyDocument = count($mTransactions->rPropertyDocument) ? $mTransactions->rPropertyDocument : ProTransactionsPropertyDocument::getDefaultArrayForCreate($mTransactions->type);
         $this->render('view', array('mTransactions' => $mTransactions, 'actions' => $this->listActionsCanAccess));
     } catch (Exception $e) {
         Yii::log("Exception " . print_r($e, true), 'error');
         throw new CHttpException("Exception " . print_r($e, true));
     }
 }
                    <th class="button-column last">Action</th>
                </tr>
            </thead>
            <tbody>
                <?php 
if (isset($_GET['id'])) {
    $transaction_id = $_GET['id'];
}
if (isset($_GET['type'])) {
    $type = $_GET['type'];
}
$list_PropertyDocument = ProTransactionsPropertyDocument::getListDocumentByTransaction($transaction_id);
if ($list_PropertyDocument) {
    $model_PropertyDocument = $list_PropertyDocument;
} else {
    $model_PropertyDocument = ProTransactionsPropertyDocument::getDefaultArrayForCreate($type);
}
foreach ($model_PropertyDocument as $key => $item) {
    ?>
                    <?php 
    $display_none = 'display_none';
    $display_none_title = '';
    $delete_class = 'delete_item_file';
    if ($key > 2) {
        $display_none = '';
        $display_none_title = 'display_none';
        $delete_class = 'delete_item_upload';
    }
    if (isset($_GET['id'])) {
        $id_trans = $_GET['id'];
        $file_name = ProTransactionsPropertyDocument::getDocumentOfTransactionAndTitle($id_trans, $item->title);
示例#3
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);
示例#5
0
 /**
  * @Author: ANH DUNG Jan 23, 2015
  * @Todo: View tenancy
  * @Param: $tenancy: id transaction - transaction_id
  */
 public function actionView($tenancy)
 {
     MyFormat::validateUserAccess(ROLE_AGENT);
     $this->pageTitle = "View Tenancy - " . Yii::app()->params['title'];
     try {
         $mTransactions = $this->validateLinkView($tenancy);
         if ($mTransactions->status == STATUS_TENANCY_DRAFT) {
             $this->redirect(Yii::app()->createAbsoluteUrl('member/agent/tenancy'));
         }
         $type = $mTransactions->type;
         $mTransactions->mBillTo = $mTransactions->rBillTo ? $mTransactions->rBillTo : new ProTransactionsBillTo();
         //            $mTransactions->mInternalCoBroke = $mTransactions->rInternalCoBroke?$mTransactions->rInternalCoBroke:( array() );
         $mTransactions->mPropertyDetail = $mTransactions->rPropertyDetail ? $mTransactions->rPropertyDetail : new ProTransactionsPropertyDetail();
         $mTransactions->aModelPropertyDocument = count($mTransactions->rPropertyDocument) ? $mTransactions->rPropertyDocument : ProTransactionsPropertyDocument::getDefaultArrayForCreate($type);
         //            $mTransactions->mVendorPurchaserDetail = $mTransactions->rVendorPurchaserDetail?$mTransactions->rVendorPurchaserDetail:( array() );
         //            $mTransactions->mPropertyDetail->scenario = 'CreateTransaction';
         //            $mTransactions->mBillTo->scenario = 'CreateVendorPurchaser';
         //            $mTransactions->scenario = 'CreateTransaction'; // default for sale
         //            ProTransactions::convertToUserDate($mTransactions);
         $this->render('ViewTransaction/ViewTransaction', array('mTransactions' => $mTransactions));
     } catch (Exception $exc) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
 }
示例#6
0
文件: view.php 项目: jasonhai/onehome
<?php

$cmsFormater = new CmsFormatter();
$data = array("name" => $model->listing ? $model->listing->property_name_or_address : "", "transaction_id" => $model->id);
$name_property = $cmsFormater->formatpropertyname($data);
if (!isset($_GET['next'])) {
    $this->breadcrumbs = array('Tenancies Approved' => array('index'), $name_property);
    $menus = array(array('label' => 'Tenancies Approved', 'url' => array('index')));
} else {
    $this->breadcrumbs = array('Tenancies New' => array('tenancies_new'), $name_property);
    $menus = array(array('label' => 'Tenancies New', 'url' => array('tenancies_new')));
}
$this->menu = ControllerActionsName::createMenusRoles($menus, $actions);
$mTransactions = $model;
$mTransactions->mBillTo = $mTransactions->rBillTo ? $mTransactions->rBillTo : new ProTransactionsBillTo();
$mTransactions->mPropertyDetail = $mTransactions->rPropertyDetail ? $mTransactions->rPropertyDetail : new ProTransactionsPropertyDetail();
$mTransactions->aModelPropertyDocument = count($mTransactions->rPropertyDocument) ? $mTransactions->rPropertyDocument : ProTransactionsPropertyDocument::getDefaultArrayForCreate($mTransactions->type);
?>

<?php 
include 'ViewTransaction/ViewTransaction.php';