labelList() public static method

public static labelList ( ) : array
return array
Exemplo n.º 1
0
: <?php 
echo $ordersCount;
?>
</span>
            </h4>
        </div>

        <div id="<?php 
echo $this->getId();
?>
" class="panel-collapse collapse">
            <div class="panel-body">
                <div class="row">
                    <div class="col-sm-12">
                        <?php 
$this->widget('bootstrap.widgets.TbExtendedGridView', ['id' => 'orders-grid', 'type' => 'striped condensed', 'dataProvider' => $dataProvider, 'template' => '{items}', 'htmlOptions' => ['class' => false], 'columns' => [['name' => 'id', 'htmlOptions' => ['width' => '90px'], 'type' => 'raw', 'value' => function ($data) {
    return CHtml::link(Yii::t('OrderModule.order', 'Order #') . $data->id, ["/order/orderBackend/update", "id" => $data->id]);
}], ['name' => 'date', 'value' => function ($data) {
    return CHtml::link(Yii::app()->getDateFormatter()->formatDateTime($data->date, 'medium'), array("/order/orderBackend/update", "id" => $data->id));
}, 'type' => 'raw'], ['name' => 'name', 'htmlOptions' => ['width' => '400px']], ['name' => 'total_price', 'value' => function ($data) {
    return Yii::app()->getNumberFormatter()->formatCurrency($data->total_price, Yii::app()->getModule('store')->currency);
}], ['class' => 'yupe\\widgets\\EditableStatusColumn', 'name' => 'status_id', 'url' => $this->controller->createUrl('/order/orderBackend/inline'), 'source' => OrderHelper::statusList(), 'options' => OrderHelper::labelList()], ['class' => 'yupe\\widgets\\EditableStatusColumn', 'name' => 'paid', 'url' => $this->controller->createUrl('/order/orderBackend/inline'), 'source' => Order::model()->getPaidStatusList(), 'options' => [Order::PAID_STATUS_NOT_PAID => ['class' => 'label-danger'], Order::PAID_STATUS_PAID => ['class' => 'label-success']]]]]);
?>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<?php 
$this->endWidget();
Exemplo n.º 2
0
Arquivo: index.php Projeto: yupe/yupe
        <?php 
echo Yii::t('OrderModule.order', 'Orders');
?>
        <small><?php 
echo Yii::t('OrderModule.order', 'manage');
?>
</small>
    </h1>
</div>


<?php 
$this->widget('yupe\\widgets\\CustomGridView', ['id' => 'order-grid', 'type' => 'condensed', 'dataProvider' => $model->search(), 'filter' => $model, 'datePickers' => ['Order_date'], 'afterAjaxUpdate' => 'reinstallDatePicker', 'columns' => [['name' => 'id', 'htmlOptions' => ['width' => '90px'], 'type' => 'raw', 'value' => function ($data) {
    return CHtml::link($data->id, ["/order/orderBackend/update", "id" => $data->id]);
}], ['name' => 'date', 'type' => 'html', 'filter' => $this->widget('booster.widgets.TbDatePicker', ['model' => $model, 'attribute' => 'date', 'options' => ['format' => 'yyyy-mm-dd'], 'htmlOptions' => ['class' => 'form-control']], true), 'value' => function ($data) {
    return CHtml::link(Yii::app()->getDateFormatter()->formatDateTime($data->date, 'medium'), ["/order/orderBackend/update", "id" => $data->id]);
}], ['name' => 'name', 'type' => 'raw', 'value' => function ($data) {
    return isset($data->client) ? CHtml::link($data->client->getFullName(), ['/order/clientBackend/view', 'id' => $data->user_id]) : $data->name;
}, 'htmlOptions' => ['width' => '400px']], ['name' => 'total_price', 'value' => function ($data) {
    return Yii::app()->getNumberFormatter()->formatCurrency($data->total_price, Yii::app()->getModule('store')->currency);
}], ['class' => 'yupe\\widgets\\EditableStatusColumn', 'name' => 'status_id', 'url' => $this->createUrl('/order/orderBackend/inline'), 'source' => OrderHelper::statusList(), 'options' => OrderHelper::labelList()], ['name' => 'payment_method_id', 'value' => function ($data) {
    return $data->payment ? $data->payment->name : '---';
}, 'filter' => CHtml::listData(Payment::model()->findAll(), 'id', 'name')], ['class' => 'yupe\\widgets\\EditableStatusColumn', 'name' => 'paid', 'url' => $this->createUrl('/order/orderBackend/inline'), 'source' => $model->getPaidStatusList(), 'options' => [Order::PAID_STATUS_NOT_PAID => ['class' => 'label-danger'], Order::PAID_STATUS_PAID => ['class' => 'label-success']]], ['name' => 'delivery_id', 'header' => Yii::t('OrderModule.order', 'Delivery'), 'filter' => CHtml::listData(Delivery::model()->findAll(), 'id', 'name'), 'value' => function (Order $data) {
    return $data->delivery->name;
}], ['name' => 'manager_id', 'type' => 'raw', 'filter' => CHtml::listData(User::model()->findAll('access_level = :level', [':level' => User::ACCESS_LEVEL_ADMIN]), 'id', 'fullName'), 'value' => function ($data) {
    return isset($data->manager) ? \yupe\helpers\YText::shortName($data->manager->getFullName()) : null;
}], ['class' => 'yupe\\widgets\\CustomButtonColumn', 'buttons' => ['update' => ['visible' => function ($row, Order $order) {
    return $order->checkManager(Yii::app()->getUser());
}], 'delete' => ['visible' => function ($row, Order $order) {
    return $order->checkManager(Yii::app()->getUser());
}]]]]]);
Exemplo n.º 3
0
Arquivo: view.php Projeto: yupe/yupe
        <?php 
$this->widget('bootstrap.widgets.TbDetailView', ['data' => $model, 'attributes' => [['name' => 'full_name', 'value' => $model->getFullName()], 'nick_name', 'email', ['label' => Yii::t('OrderModule.order', 'Orders'), 'value' => CHtml::link($model->getOrderNumber(), ['/order/orderBackend/index', 'Order[user_id]' => $model->id]), 'type' => 'html'], 'birth_date', 'phone', ['label' => Yii::t('OrderModule.order', 'Money'), 'value' => '<span class="label label-success">' . Yii::app()->numberFormatter->formatCurrency($model->getOrderSum(), Yii::app()->getModule('store')->currency) . "</span>", 'type' => 'html'], 'location', 'site', 'about', ['name' => 'gender', 'value' => $model->getGender()], ['name' => 'status', 'value' => $model->getStatus()], ['name' => 'email_confirm', 'value' => $model->getEmailConfirmStatus()], ['name' => 'visit_time', 'value' => Yii::app()->getDateFormatter()->formatDateTime($model->visit_time)], ['name' => 'create_time', 'value' => Yii::app()->getDateFormatter()->formatDateTime($model->create_time)], ['name' => 'update_time', 'value' => Yii::app()->getDateFormatter()->formatDateTime($model->update_time)]]]);
?>
    </div>

    <div class="col-sm-8">
        <div class="row">
            <div class="col-sm-12">
                <?php 
$this->widget('bootstrap.widgets.TbExtendedGridView', ['id' => 'order-grid', 'type' => 'condensed', 'dataProvider' => $orders, 'template' => '{items}{pager}', 'columns' => [['name' => 'id', 'htmlOptions' => ['width' => '90px'], 'type' => 'raw', 'value' => function ($data) {
    return CHtml::link($data->id, ["/order/orderBackend/update", "id" => $data->id]);
}], ['name' => 'date', 'type' => 'html', 'filter' => $this->widget('booster.widgets.TbDatePicker', ['model' => $order, 'attribute' => 'date', 'options' => ['format' => 'yyyy-mm-dd'], 'htmlOptions' => ['class' => 'form-control']], true), 'value' => function ($data) {
    return CHtml::link(Yii::app()->getDateFormatter()->formatDateTime($data->date, 'short', false), ["/order/orderBackend/update", "id" => $data->id]);
}], ['name' => 'total_price', 'value' => function ($data) {
    return Yii::app()->getNumberFormatter()->formatCurrency($data->total_price, Yii::app()->getModule('store')->currency);
}], ['class' => 'yupe\\widgets\\EditableStatusColumn', 'name' => 'status_id', 'url' => $this->createUrl('/order/orderBackend/inline'), 'source' => OrderHelper::statusList(), 'options' => OrderHelper::labelList()], ['class' => 'yupe\\widgets\\EditableStatusColumn', 'name' => 'paid', 'url' => $this->createUrl('/order/orderBackend/inline'), 'source' => $order->getPaidStatusList(), 'options' => [Order::PAID_STATUS_NOT_PAID => ['class' => 'label-danger'], Order::PAID_STATUS_PAID => ['class' => 'label-success']]], ['name' => 'delivery_id', 'header' => Yii::t('OrderModule.order', 'Delivery'), 'filter' => CHtml::listData(Delivery::model()->findAll(), 'id', 'name'), 'value' => function ($data) {
    return $data->delivery->name;
}]]]);
?>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-12">
                <?php 
if (Yii::app()->hasModule('comment')) {
    ?>
                    <?php 
    $this->widget('application.modules.comment.widgets.CommentsWidget', ['view' => 'application.modules.order.views.orderBackend.comments', 'redirectTo' => Yii::app()->createUrl('/order/clientBackend/view', ['id' => $model->id]), 'model' => $model]);
    ?>
                <?php 
}