statusList() public static method

public static statusList ( ) : array
return array
Exemplo n.º 1
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.º 2
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 
}
Exemplo n.º 3
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.º 4
0
Arquivo: _form.php Projeto: yupe/yupe
echo Yii::t('OrderModule.order', 'are required');
?>
</div>

<?php 
echo $form->errorSummary($model);
?>
<div class="row">
    <div class="col-sm-12">
        <div class="row">
            <div class="col-sm-3">
                <?php 
echo $form->labelEx($model, 'status_id');
?>
                <?php 
$this->widget('bootstrap.widgets.TbSelect2', ['model' => $model, 'attribute' => 'status_id', 'data' => OrderHelper::statusList(), 'options' => ['placeholder' => Yii::t('OrderModule.order', 'Status'), 'width' => '100%']]);
?>
            </div>
            <div class="col-sm-3">
                <?php 
echo $form->datePickerGroup($model, 'date', ['widgetOptions' => ['options' => ['format' => 'dd.mm.yyyy', 'weekStart' => 1, 'autoclose' => true], 'htmlOptions' => ['id' => 'orderDate']], 'prepend' => '<i class="fa fa-calendar"></i>']);
?>
            </div>
            <div class="col-sm-3">
                <?php 
echo $form->labelEx($model, 'user_id');
?>
                <?php 
$this->widget('bootstrap.widgets.TbSelect2', ['model' => $model, 'attribute' => 'user_id', 'asDropDownList' => false, 'options' => ['minimumInputLength' => 2, 'placeholder' => Yii::t('OrderModule.order', 'Select client'), 'width' => '100%', 'allowClear' => true, 'ajax' => ['url' => Yii::app()->getController()->createUrl('/order/orderBackend/ajaxClientSearch'), 'dataType' => 'json', 'data' => 'js:function(term, page) { return {q: term }; }', 'results' => 'js:function(data) { return {results: data}; }'], 'formatResult' => 'js:productFormatResult', 'formatSelection' => 'js:productFormatSelection', 'initSelection' => $model->client ? 'js:function(element,callback){callback({name:"' . $model->client->getFullName() . '"})}' : false], 'htmlOptions' => ['id' => 'client-select']]);
?>
            </div>