예제 #1
0
파일: view.php 프로젝트: uldisn/ldm
    $this->widget("vendor.dbrisinajumi.audittrail.widgets.AudittrailViewTbButton", ['model_name' => get_class($model), 'model_id' => $model->getPrimaryKey()]);
}
echo CHtml::link('<img src="images/excel48.png">', array('viewExcel', 'id' => $model->id, 'lang' => Yii::app()->language));
$this->widget("bootstrap.widgets.TbButton", ["label" => Yii::t("LdmModule.crud", "Delete"), "type" => "danger", "icon" => "icon-trash icon-white", "size" => "large", "htmlOptions" => ["submit" => ["delete", "id" => $model->{$model->tableSchema->primaryKey}, "returnUrl" => Yii::app()->request->getParam("returnUrl") ? Yii::app()->request->getParam("returnUrl") : $this->createUrl("admin")], "confirm" => Yii::t("LdmModule.crud", "Do you want to delete this item?")], "visible" => Yii::app()->request->getParam("id") && (Yii::app()->user->checkAccess("Ldm.PfOrder.*") || Yii::app()->user->checkAccess("Ldm.PfOrder.Delete"))]);
?>
        </div>
    </div>
</div>



<div class="row">
    <div class="span3">

        <?php 
$this->widget('TbAceDetailView', ['data' => $model, 'attributes' => [['name' => 'number', 'type' => 'raw', 'value' => $this->widget('EditableField', ['model' => $model, 'attribute' => 'number', 'url' => $this->createUrl('/ldm/pfOrder/editableSaver')], true)], ['name' => 'client_ccmp_id', 'type' => 'raw', 'value' => $this->widget('EditableField', ['model' => $model, 'type' => 'select', 'url' => $this->createUrl('/ldm/pfOrder/editableSaver'), 'source' => CHtml::listData(CcmpCompany::model()->findAll(['limit' => 1000]), 'ccmp_id', 'itemLabel'), 'attribute' => 'client_ccmp_id'], true)], ['name' => 'order_date', 'type' => 'raw', 'value' => $this->widget('EditableField', ['model' => $model, 'type' => 'date', 'url' => $this->createUrl('/ldm/pfOrder/editableSaver'), 'attribute' => 'order_date'], true)], ['name' => 'desired_date', 'type' => 'raw', 'value' => $this->widget('EditableField', ['model' => $model, 'type' => 'date', 'url' => $this->createUrl('/ldm/pfOrder/editableSaver'), 'attribute' => 'desired_date'], true)], ['name' => 'planed_delivery_type', 'type' => 'raw', 'value' => $this->widget('EditableField', ['model' => $model, 'type' => 'select', 'url' => $this->createUrl('/ldm/pfOrder/editableSaver'), 'source' => CHtml::listData(PfDeliveryType::model()->findAll(['limit' => 1000]), 'id', 'itemLabel'), 'attribute' => 'planed_delivery_type'], true)], ['name' => 'groupage', 'type' => 'raw', 'value' => $this->widget('EditableField', ['model' => $model, 'attribute' => 'groupage', 'url' => $this->createUrl('/ldm/pfOrder/editableSaver')], true)], ['name' => 'loading_meters'], ['name' => 'm3'], ['name' => 'planed_dispatch_date', 'type' => 'raw', 'value' => $this->widget('EditableField', ['model' => $model, 'type' => 'date', 'url' => $this->createUrl('/ldm/pfOrder/editableSaver'), 'attribute' => 'planed_dispatch_date'], true)], ['name' => 'planed_delivery_date', 'type' => 'raw', 'value' => $this->widget('EditableField', ['model' => $model, 'type' => 'date', 'url' => $this->createUrl('/ldm/pfOrder/editableSaver'), 'attribute' => 'planed_delivery_date'], true)], ['name' => 'status', 'type' => 'raw', 'value' => $this->widget('EditableField', ['model' => $model, 'type' => 'select', 'url' => $this->createUrl('/ldm/pfOrder/editableSaver'), 'source' => $model->getEnumFieldLabels('status'), 'attribute' => 'status'], true)], ['name' => 'loading_meters', 'type' => 'raw', 'value' => $this->widget('EditableField', ['model' => $model, 'attribute' => 'loading_meters', 'url' => $this->createUrl('/ldm/pfOrder/editableSaver')], true)], ['name' => 'notes', 'type' => 'raw', 'value' => $this->widget('EditableField', ['model' => $model, 'attribute' => 'notes', 'url' => $this->createUrl('/ldm/pfOrder/editableSaver')], true)]]]);
?>
<br/><?php 
$this->widget('d2FilesWidget', ['module' => $this->module->id, 'model' => $model]);
?>
    </div>


    <div class="span9">
        <?php 
$this->renderPartial('_view-relations_grids', ['modelMain' => $model, 'ajax' => false]);
?>
    
    </div>
</div>
예제 #2
0
 public function loadModel($id)
 {
     $m = PfDeliveryType::model();
     // apply scope, if available
     $scopes = $m->scopes();
     if (isset($scopes[$this->scope])) {
         $m->{$this->scope}();
     }
     $model = $m->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, Yii::t('LdmModule.crud', 'The requested page does not exist.'));
     }
     return $model;
 }