</div> <div class="export-form" style="display:none"> <?php //$this->renderPartial('_export', array('model' => $model,)); ?> </div> <?php $visible_columns = false; if (isset(Yii::app()->getModule('d2company')->options['admin_columns'])) { $visible_columns = Yii::app()->getModule('d2company')->options['admin_columns']; } $criteria = new CDbCriteria(); if (isset(Yii::app()->params['ccgr_group_sys_company'])) { $criteria->addNotInCondition('ccgr_id', array(Yii::app()->params['ccgr_group_sys_company'])); } $criteria->order = 'ccgr_name'; $group_filter = CHtml::listData(CcgrGroup::model()->findAll($criteria), 'ccgr_id', 'ccgr_name'); $grid_columns = array(array('name' => 'ccmp_name', 'header' => Yii::t('D2companyModule.crud', 'Name'), 'value' => '$data->ccmp_name', 'visible' => !$visible_columns || in_array('ccmp_name', $visible_columns)), array('name' => 'ccmp_ccnt_id', 'header' => Yii::t('D2companyModule.crud', 'Country'), 'value' => 'CHtml::value($data,\'ccmpCcnt.itemLabel\')', 'filter' => CHtml::listData(CcntCountry::model()->findAll(array('limit' => 1000)), 'ccnt_id', 'itemLabel'), 'htmlOptions' => array('style' => 'width:100px;'), 'visible' => !$visible_columns || in_array('ccmp_ccnt_id', $visible_columns)), array('name' => 'ccmp_office_ccit_id', 'header' => Yii::t('D2companyModule.crud', 'City'), 'value' => 'CHtml::value($data,\'ccmpOfficeCcit.itemLabel\')', 'filter' => CHtml::listData(CcitCity::model()->findAll(array('limit' => 1000)), 'ccit_id', 'itemLabel'), 'visible' => !$visible_columns || in_array('ccmp_office_ccit_id', $visible_columns)), array('name' => 'ccmp_registrtion_no', 'header' => Yii::t('D2companyModule.crud', 'Registration Nr'), 'visible' => !$visible_columns || in_array('ccmp_registrtion_no', $visible_columns)), array('name' => 'ccmp_registration_address', 'header' => Yii::t('D2companyModule.crud', 'Registration Address'), 'visible' => !$visible_columns || in_array('ccmp_registration_address', $visible_columns)), array('name' => 'ccmp_statuss', 'header' => Yii::t('D2companyModule.crud', 'State'), 'value' => '$data->getEnumColumnLabel(\'ccmp_statuss\')', 'visible' => !$visible_columns || in_array('ccmp_statuss', $visible_columns)), array('name' => 'ccxg_ccgr_id', 'header' => Yii::t('D2companyModule.crud', 'Group'), 'filter' => $group_filter, 'value' => '$data->ccgr_name', 'visible' => !$visible_columns || in_array('ccxg_ccgr_id', $visible_columns))); if (isset(Yii::app()->getModule('d2company')->options['admin_add_columns'])) { foreach (Yii::app()->getModule('d2company')->options['admin_add_columns'] as $add_column) { if (isset($add_column['header'])) { $add_column['header'] = Yii::t('D2companyModule.crud', $add_column['header']); } $grid_columns[] = $add_column; } } $grid_columns[] = array('class' => 'EButtonColumnWithClearFilters', 'buttons' => array('view' => array('visible' => 'Yii::app()->user->checkAccess("D2company.CcmpCompany.View") || Yii::app()->user->checkAccess("D2company.CcmpCompany.Update") || Yii::app()->user->checkAccess("Company.fullcontrol")'), 'update' => array('visible' => 'Yii::app()->user->checkAccess("Company.fullcontrol") ' . ' || Yii::app()->user->checkAccess("D2company.CcmpCompany.Update")'), 'delete' => array('visible' => 'FALSE')), 'viewButtonUrl' => 'Yii::app()->controller->createUrl("view", array("ccmp_id" => $data->ccmp_id))', 'updateButtonUrl' => 'Yii::app()->controller->createUrl("updateExtended", array("ccmp_id" => $data->ccmp_id))', 'deleteButtonUrl' => null, 'viewButtonOptions' => array('data-toggle' => 'tooltip'), 'updateButtonOptions' => array('data-toggle' => 'tooltip')); $this->widget('TbGridView', array('id' => 'ccmp-company-grid', 'type' => 'bordered condensed', 'dataProvider' => $model->searchForList(), 'filter' => $model, 'template' => '{items}{summary}{pager}', 'rowCssClassExpression' => '$data->cssclass', 'pager' => array('class' => 'TbPager', 'displayFirstAndLast' => true), 'columns' => $grid_columns));
if (Yii::app()->user->checkAccess("audittrail") && isset(Yii::app()->getModule('d2company')->options['audittrail']) && Yii::app()->getModule('d2company')->options['audittrail']) { Yii::import('audittrail.*'); $this->widget("vendor.dbrisinajumi.audittrail.widgets.AudittrailViewTbButton", array('model_name' => get_class($model), 'model_id' => $model->getPrimaryKey())); } ?> </div> </div> </div> <div class="row"> <div class="span5"> <?php $this->widget('TbAceDetailView', array('data' => $model, 'label_width' => 150, 'attributes' => array(array('name' => 'ccmp_name', 'type' => 'raw', 'value' => $this->widget('EditableField', array('model' => $model, 'attribute' => 'ccmp_name', 'url' => $this->createUrl('/d2company/ccmpCompany/editableSaver'), 'apply' => $can_edit), true)), array('name' => 'ccmp_ccnt_id', 'type' => 'raw', 'value' => $can_edit ? $this->widget('EditableField', array('model' => $model, 'type' => 'select', 'url' => $this->createUrl('/d2company/ccmpCompany/editableSaver'), 'source' => CHtml::listData(CcntCountry::model()->findAll(array('limit' => 1000)), 'ccnt_id', 'itemLabel'), 'attribute' => 'ccmp_ccnt_id', 'apply' => $can_edit), true) : (!empty($model->ccmp_ccnt_id) ? $model->ccmpCcnt->itemLabel : '')), array('name' => 'ccmp_registrtion_no', 'type' => 'raw', 'value' => $this->widget('EditableField', array('model' => $model, 'attribute' => 'ccmp_registrtion_no', 'url' => $this->createUrl('/d2company/ccmpCompany/editableSaver'), 'apply' => $can_edit), true), 'visible' => $can_edit || !empty($model->ccmp_registrtion_no)), array('name' => 'ccmp_vat_registrtion_no', 'type' => 'raw', 'value' => $this->widget('EditableField', array('model' => $model, 'attribute' => 'ccmp_vat_registrtion_no', 'url' => $this->createUrl('/d2company/ccmpCompany/editableSaver'), 'apply' => $can_edit), true), 'visible' => $can_edit || !empty($model->ccmp_vat_registrtion_no)), array('name' => 'ccmp_registration_date', 'type' => 'raw', 'value' => $this->widget('EditableField', array('model' => $model, 'type' => 'date', 'url' => $this->createUrl('/d2company/ccmpCompany/editableSaver'), 'attribute' => 'ccmp_registration_date', 'apply' => $can_edit), true), 'visible' => $can_edit || !empty($model->ccmp_registration_date)), array('name' => 'ccmp_registration_address', 'type' => 'raw', 'value' => $this->widget('EditableField', array('model' => $model, 'attribute' => 'ccmp_registration_address', 'url' => $this->createUrl('/d2company/ccmpCompany/editableSaver'), 'apply' => $can_edit), true), 'visible' => $can_edit || !empty($model->ccmp_registration_address)), array('name' => 'ccmp_official_ccit_id', 'type' => 'raw', 'value' => $this->widget('EditableField', array('model' => $model, 'type' => 'select', 'url' => $this->createUrl('/d2company/ccmpCompany/editableSaver'), 'source' => CHtml::listData(CcitCity::model()->findAll(array('limit' => 1000)), 'ccit_id', 'itemLabel'), 'attribute' => 'ccmp_official_ccit_id', 'apply' => $can_edit), true), 'visible' => $can_edit || !empty($model->ccmp_official_ccit_id)), array('name' => 'ccmp_official_address', 'type' => 'raw', 'value' => $this->widget('EditableField', array('model' => $model, 'attribute' => 'ccmp_official_address', 'url' => $this->createUrl('/d2company/ccmpCompany/editableSaver'), 'apply' => $can_edit), true), 'visible' => $can_edit || !empty($model->ccmp_official_address)), array('name' => 'ccmp_official_zip_code', 'type' => 'raw', 'value' => $this->widget('EditableField', array('model' => $model, 'attribute' => 'ccmp_official_zip_code', 'url' => $this->createUrl('/d2company/ccmpCompany/editableSaver'), 'apply' => $can_edit), true), 'visible' => $can_edit || !empty($model->ccmp_official_zip_code)), array('name' => 'ccmp_office_ccit_id', 'type' => 'raw', 'value' => $this->widget('EditableField', array('model' => $model, 'type' => 'select', 'url' => $this->createUrl('/d2company/ccmpCompany/editableSaver'), 'source' => CHtml::listData(CcitCity::model()->findAll(array('limit' => 1000)), 'ccit_id', 'itemLabel'), 'attribute' => 'ccmp_office_ccit_id', 'apply' => $can_edit), true), 'visible' => $can_edit || !empty($model->ccmp_office_ccit_id)), array('name' => 'ccmp_office_address', 'type' => 'raw', 'value' => $this->widget('EditableField', array('model' => $model, 'attribute' => 'ccmp_office_address', 'url' => $this->createUrl('/d2company/ccmpCompany/editableSaver'), 'apply' => $can_edit), true), 'visible' => $can_edit || !empty($model->ccmp_office_address)), array('name' => 'ccmp_office_zip_code', 'type' => 'raw', 'value' => $this->widget('EditableField', array('model' => $model, 'attribute' => 'ccmp_office_zip_code', 'url' => $this->createUrl('/d2company/ccmpCompany/editableSaver'), 'apply' => $can_edit), true), 'visible' => $can_edit || !empty($model->ccmp_office_zip_code)), array('name' => 'ccmp_statuss', 'type' => 'raw', 'value' => $this->widget('EditableField', array('model' => $model, 'type' => 'select', 'url' => $this->createUrl('/d2company/ccmpCompany/editableSaver'), 'source' => $model->getEnumFieldLabels('ccmp_statuss'), 'attribute' => 'ccmp_statuss', 'apply' => $can_edit), true), 'visible' => $can_edit || !empty($model->ccmp_statuss)), array('name' => 'ccmp_description', 'type' => 'raw', 'value' => $this->widget('EditableField', array('model' => $model, 'attribute' => 'ccmp_description', 'url' => $this->createUrl('/d2company/ccmpCompany/editableSaver'), 'apply' => $can_edit), true), 'visible' => $can_edit || !empty($model->ccmp_description)), array('name' => 'ccmp_office_phone', 'type' => 'raw', 'value' => $this->widget('EditableField', array('model' => $model, 'attribute' => 'ccmp_office_phone', 'url' => $this->createUrl('/d2company/ccmpCompany/editableSaver'), 'apply' => $can_edit), true), 'visible' => $can_edit || !empty($model->ccmp_office_phone)), array('name' => 'ccmp_office_email', 'type' => 'raw', 'value' => $this->widget('EditableField', array('model' => $model, 'attribute' => 'ccmp_office_email', 'url' => $this->createUrl('/d2company/ccmpCompany/editableSaver'), 'apply' => $can_edit), true), 'visible' => $can_edit || !empty($model->ccmp_office_email))))); $ccd = $model->cccdCustomData; $rows = array(); foreach ($ccd->attributes as $attribute_name => $attribute_value) { if ($attribute_name == 'cccd_ccmp_id') { continue; } $rows[] = array('name' => $attribute_name); } $this->widget('TbAceDetailView', array('data' => $ccd, 'label_width' => 150, 'attributes' => $rows)); ?> </div> <div class="span7"> <?php
?> <?php $this->widget("TbBreadcrumbs", array("links" => $this->breadcrumbs)); ?> <h1> <?php echo Yii::t('HillModule.model', 'Hille Demos'); ?> <small><?php echo Yii::t('HillModule.crud', 'Manage'); ?> </small> </h1> <?php $this->renderPartial("_toolbar", array("model" => $model)); $this->renderPartial('_search_range', array('model' => $model)); $this->widget('TbMenu', array('type' => 'tabs', 'items' => array(array('label' => 'Active', 'url' => ''), array('label' => 'New', 'url' => ''), array('label' => ' Closed', 'url' => '')))); Yii::beginProfile('HilleDemo.view.grid'); ?> <?php Yii::app()->clientScript->registerScript('re-install-date-picker', "\nfunction reinstallDatePicker(id, data) {\n filter_HilleDemo_dol_date_range_init();\n}\n"); $this->widget('TbGridView', array('id' => 'hille-demo-grid', 'dataProvider' => $model->search(), 'filter' => $model, 'template' => '{items}{summary}{pager}', 'type' => 'bordered condensed', 'rowCssClassExpression' => '$data->cssclass', 'pager' => array('class' => 'TbPager', 'displayFirstAndLast' => true), 'afterAjaxUpdate' => 'reinstallDatePicker', 'columns' => array(array('name' => 'hill_id'), array('class' => 'editable.EditableColumn', 'name' => 'hill_order_nr', 'editable' => array('url' => $this->createUrl('/hill/hilleDemo/editableSaver'))), array('class' => 'editable.EditableColumn', 'name' => 'hill_ref_id', 'editable' => array('url' => $this->createUrl('/hill/hilleDemo/editableSaver'))), array('class' => 'editable.EditableColumn', 'name' => 'hill_pol', 'editable' => array('type' => 'select', 'url' => $this->createUrl('/hill/hilleDemo/editableSaver'), 'source' => CHtml::listData(CcitCity::model()->findAll(array('limit' => 1000)), 'ccit_id', 'itemLabel'))), array('class' => 'editable.EditableColumn', 'name' => 'hill_destination', 'editable' => array('type' => 'select', 'url' => $this->createUrl('/hill/hilleDemo/editableSaver'), 'source' => CHtml::listData(CcitCity::model()->findAll(array('limit' => 1000)), 'ccit_id', 'itemLabel'))), array('class' => 'editable.EditableColumn', 'name' => 'hill_dol', 'editable' => array('type' => 'date', 'url' => $this->createUrl('/hill/hilleDemo/editableSaver')), 'filter' => $this->widget('application.widgets.TbFilterDateRangePicker', array('model' => $model, 'attribute' => 'dol_date_range'), TRUE)), array('class' => 'editable.EditableColumn', 'name' => 'hill_carrier_id', 'filter' => CHtml::listData(CcmpCompany::model()->findAll(array('limit' => 1000, 'order' => 'ccmp_name')), 'ccmp_id', 'ccmp_name'), 'editable' => array('type' => 'select', 'url' => $this->createUrl('/hill/hilleDemo/editableSaver'), 'source' => CHtml::listData(CcmpCompany::model()->findAll(array('limit' => 1000)), 'ccmp_id', 'itemLabel'))), array('class' => 'editable.EditableColumn', 'name' => 'hill_truck_nr', 'editable' => array('url' => $this->createUrl('/hill/hilleDemo/editableSaver'))), array('class' => 'editable.EditableColumn', 'name' => 'hill_cargo', 'editable' => array('type' => 'select', 'url' => $this->createUrl('/hill/hilleDemo/editableSaver'), 'source' => $model->getEnumFieldLabels('hill_cargo')), 'filter' => $model->getEnumFieldLabels('hill_cargo')), array('class' => 'editable.EditableColumn', 'name' => 'hill_importer_id', 'editable' => array('type' => 'select', 'url' => $this->createUrl('/hill/hilleDemo/editableSaver'), 'source' => CHtml::listData(CcmpCompany::model()->findAll(array('limit' => 1000)), 'ccmp_id', 'itemLabel'))), array('class' => 'editable.EditableColumn', 'name' => 'hill_status', 'editable' => array('type' => 'select', 'url' => $this->createUrl('/hill/hilleDemo/editableSaver'), 'source' => CHtml::listData(StstState::model()->findAll(array('limit' => 1000)), 'stst_id', 'itemLabel'), 'placement' => 'right')), array('class' => 'editable.EditableColumn', 'name' => 'hill_notes', 'editable' => array('type' => 'textarea', 'url' => $this->createUrl('/hill/hilleDemo/editableSaver'))), array('class' => 'editable.EditableColumn', 'name' => 'hill_planned_arrival', 'editable' => array('type' => 'date', 'url' => $this->createUrl('/hill/hilleDemo/editableSaver'))), array('class' => 'TbButtonColumn', 'buttons' => array('view' => array('visible' => 'Yii::app()->user->checkAccess("Hill.HilleDemo.View")'), 'update' => array('visible' => 'Yii::app()->user->checkAccess("Hill.HilleDemo.Update")'), 'delete' => array('visible' => 'Yii::app()->user->checkAccess("Hill.HilleDemo.Delete")')), 'viewButtonUrl' => 'Yii::app()->controller->createUrl("view", array("hill_id" => $data->hill_id))', 'updateButtonUrl' => 'Yii::app()->controller->createUrl("update", array("hill_id" => $data->hill_id))', 'deleteButtonUrl' => 'Yii::app()->controller->createUrl("delete", array("hill_id" => $data->hill_id))', 'viewButtonOptions' => array('data-toggle' => 'tooltip'), 'updateButtonOptions' => array('data-toggle' => 'tooltip'), 'deleteButtonOptions' => array('data-toggle' => 'tooltip'))))); Yii::endProfile('HilleDemo.view.grid');