Page 1 of 1

List Your Property

PostPosted: 11 Aug 2015, 14:57
by Ashwini
if , type=rent
{
how to hide, 'independent floor ' property type in dropdownbox.
}

Re: List Your Property

PostPosted: 12 Aug 2015, 17:20
by Koduc
First of all, you should find ID of "independent floor". Go to "Control Panel" - Reference "Property types"
Open for edit ''independent floor' and you can find id in URL (for example, id=12).

Edit file /protected/modules/apartments/views/backend/__form_general.php and replace this code
Code: Select all
<div class="rowold">
    <?php echo $form->labelEx($model, 'obj_type_id'); ?>
    <?php echo $form->dropDownList($model, 'obj_type_id', Apartment::getObjTypesArray(), array('class' => 'width240', 'id' => 'obj_type')); ?>
    <?php echo $form->error($model, 'obj_type_id'); ?>
</div>

to
Code: Select all
<?php
    $objTypesArr 
=  Apartment::getObjTypesArray();
    if($model->type == 1 && isset($objTypesArr[12])){
        unset($objTypesArr[12]);
    }
?>

<div class="rowold">
    <?php echo $form->labelEx($model, 'obj_type_id'); ?>
    <?php echo $form->dropDownList($model, 'obj_type_id', $objTypesArr, array('class' => 'width240', 'id' => 'obj_type')); ?>
    <?php echo $form->error($model, 'obj_type_id'); ?>
</div>

(replace "12" to your ID number)

PostPosted: 13 Aug 2015, 09:31
by Ashwini
Thank you very much.. it's working properly..thanks a lot.