コード例 #1
0
ファイル: editable.php プロジェクト: minpppst/rsc
				</thead>
				<tbody>
					<?php 
foreach ($modelos as $modelo) {
    ?>
					<tr>
					<?php 
    foreach ($modelo as $key => $value) {
        if ($value == array_values($modelo)[0]) {
            echo "<td>" . $value->nombreAccionEspecifica . "</td>";
        }
        ?>
						<td>
							<?php 
        echo Editable::widget(['model' => $value, 'name' => 'cantidad_' . $value->id, 'asPopover' => true, 'value' => $value->cantidad, 'afterInput' => function ($form, $widget) {
            echo Html::activeHiddenInput($widget->model, 'id');
        }, 'options' => ['class' => 'form-control']]);
        ?>
						</td>
					<?php 
    }
    ?>
					</tr>
					<?php 
}
?>
				</tbody>
			</table>
		</div>
	</div>
コード例 #2
0
    <div class="col-md-9">
        <div class="panel panel-default">
            <div class="panel-heading">
                <?php 
echo Html::encode($this->title);
?>
            </div>
            <div class="panel-body">

            <div class="form-horizontal">
				<div class="row">
					<div class="col-xs-12 col-md-12 col-lg-12 pull-left">

		            <?php 
foreach ($defaultValues as $key => $value) {
    echo '<div class="form-group field-store-name required">';
    echo '<label class="control-label col-sm-3" for="store-name">' . $key . '</label>';
    echo '<div class="col-sm-7">';
    echo Editable::widget(['name' => $key, 'value' => $value['value'], 'header' => $value['value'], 'format' => Editable::FORMAT_LINK, 'inputType' => Editable::INPUT_DROPDOWN_LIST, 'data' => $value['availableValues'], 'displayValueConfig' => $value['availableValues'], 'showButtonLabels' => true, 'asPopover' => false, 'options' => ['class' => 'form-control', 'prompt' => Yii::t('order', 'Select default value')], 'editableValueOptions' => ['class' => 'text-danger'], 'formOptions' => ['action' => Url::to(['setting/update'])], 'afterInput' => Html::hiddenInput('editableKey', $key)]);
    echo '</div>';
    echo '</div>';
}
?>
					</div>
				</div>
			</div>

            </div>
        </div>
    </div>
</div>
コード例 #3
0
ファイル: ban.php プロジェクト: dextercool/yii2-yiiboard
?>

<div class="yboard-ban-index">

    <p class="header2"><?php 
echo Html::encode($this->title);
?>
</p>

    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], ['attribute' => 'user_id', 'value' => function ($model, $index, $dataColumn) {
    return $model->member->profile->username;
}], ['attribute' => 'banned_by', 'value' => function ($model, $index, $dataColumn) {
    return $model->banner->profile->username;
}], ['attribute' => 'expires', 'format' => 'raw', 'value' => function ($model, $index, $dataColumn) {
    return Editable::widget(['value' => DateTimeCalculation::short($model->expires), 'name' => 'expires', 'options' => ['name' => 'expires'], 'format' => Editable::FORMAT_BUTTON, 'inputType' => Editable::INPUT_DATETIME, 'formOptions' => ['action' => url::to(['moderator/change-ban-period', 'id' => $model->id])]]);
}], 'ip', 'email:email', ['class' => 'yii\\grid\\ActionColumn', 'template' => '{lift} {reason}', 'buttons' => ['lift' => function ($url, $model, $key) {
    return Html::a('<span class="glyphicon glyphicon-tint"></span>', '#', ['title' => YBoard::t('yboard', 'Lift Ban'), 'onclick' => 'if(confirm("' . YBoard::t('yboard', 'Do you really Lift this Ban') . '")) { banLift("' . Yii::$app->urlManager->createAbsoluteUrl([$this->context->module->id . '/moderator/ban-lift', 'id' => $model->id]) . '"); }return false; ']);
}, 'reason' => function ($url, $model, $key) {
    return Html::a('<span class="glyphicon glyphicon-envelope"></span>', '#', ['title' => YBoard::t('yboard', 'Ban Reason'), 'onclick' => 'banMessage(\'' . $model->message . '\')']);
}]]]]);
?>

</div>

<?php 
Dialog::begin(['id' => 'dlgBanMsg', 'clientOptions' => ['modal' => true, 'title' => YBoard::t('yboard', 'Ban Reason'), 'autoOpen' => false, 'modal' => true, 'height' => 'auto', 'min-height' => 100, 'width' => 200, 'buttons' => [['text' => YBoard::t('yboard', 'close'), 'class' => 'btn btn-sm btn-danger', 'click' => new \yii\web\JsExpression(' function() { $( this ).dialog( "close" ); }')]]]]);
?>
    
    <div id="dlgBanMsgText" class="alert alert-warning panel"></div>
    
コード例 #4
0
ファイル: items.php プロジェクト: lzpfmh/dotplant2
        ?>
" target="_blank"><?php 
        echo $item->entity->getName();
        ?>
</a>
        <?php 
    }
    ?>
        </td>
        <td><?php 
    echo $item->product->convertedPrice();
    ?>
</td>
        <td>
            <?php 
    echo Editable::widget(['attribute' => 'quantity', 'options' => ['id' => 'edit-quantity' . $item->id], 'formOptions' => ['action' => ['change-order-item-quantity', 'id' => $item->id]], 'inputType' => Editable::INPUT_TEXT, 'model' => $item]);
    ?>
        </td>
        <td><?php 
    echo Yii::$app->formatter->asDecimal($item->quantity * $item->product->convertedPrice(), 2);
    ?>
</td>
        <td><?php 
    echo Html::a(\kartik\icons\Icon::show('remove'), ['delete-order-item', 'id' => $item->id], ['class' => 'btn btn-primary btn-xs do-not-print']);
    ?>
</td>
    </tr>
    <?php 
    if (isset($allItems[$item->id])) {
        ?>
        <?php 
コード例 #5
0
ファイル: EditableColumn.php プロジェクト: t-tomek/yii2-grid
    /**
     * Renders the data cell content.
     * @param mixed $model the data model
     * @param mixed $key the key associated with the data model
     * @param integer $index the zero-based index of the data model among the models array returned by [[GridView::dataProvider]].
     *
     * @return string the rendering result
     * @throws InvalidConfigException
     */
    public function renderDataCellContent($model, $key, $index)
    {
        $exception = false;
        $this->_editableOptions = $this->editableOptions;
        if (!empty($this->editableOptions) && $this->editableOptions instanceof Closure) {
            $this->_editableOptions = call_user_func($this->editableOptions, $model, $key, $index);
        }
        if (!is_array($this->_editableOptions)) {
            $this->_editableOptions = [];
        }
        if ($this->grid->pjax && empty($this->_editableOptions['pjaxContainerId'])) {
            $this->_editableOptions['pjaxContainerId'] = $this->grid->pjaxSettings['options']['id'];
        }
        if ($this->attribute !== null) {
            $this->_editableOptions['model'] = $model;
            $this->_editableOptions['attribute'] = '[' . $index . ']' . $this->attribute;
        } elseif (empty($this->_editableOptions['name']) && empty($this->_editableOptions['model'])) {
            $exception = true;
        } elseif (empty($this->_editableOptions['attribute'])) {
            $exception = true;
        }
        if ($exception) {
            throw new InvalidConfigException("You must setup either the 'attribute' for the EditableColumn OR setup the 'name' OR 'model'/'attribute' in '_editableOptions' (Exception raised for: key: '{$key}', index: '{$index}').");
        }
        $this->_editableOptions['displayValue'] = parent::renderDataCellContent($model, $key, $index);
        $params = Html::hiddenInput('editableIndex', $index) . Html::hiddenInput('editableKey', $key);
        if (empty($this->_editableOptions['beforeInput'])) {
            $this->_editableOptions['beforeInput'] = $params;
        } else {
            $this->_editableOptions['beforeInput'] .= $params;
        }
        if ($this->refreshGrid) {
            $view = $this->grid->getView();
            $grid = 'jQuery("#' . $this->grid->options['id'] . '")';
            $script = <<<JS
{$grid}.find('.kv-editable-input').each(function() {
    var \$input = \$(this);
    \$input.on('editableSuccess', function(){
        {$grid}.yiiGridView("applyFilter");
    });
});
JS;
            $view->registerJs($script);
        }
        return Editable::widget($this->_editableOptions);
    }
コード例 #6
0
ファイル: view.php プロジェクト: dosh93/shop
?>
    <?php 
if (Yii::$app->user->can('static-page-table/update')) {
    ?>
        <hr>
        <div class="row">
            <div class="col-md-5">
                <b>Статус: </b>
                <?php 
    echo Editable::widget(['model' => $model, 'name' => 'status', 'value' => $model->getStatus(), 'asPopover' => true, 'header' => 'Статус', 'format' => Editable::FORMAT_BUTTON, 'inputType' => Editable::INPUT_DROPDOWN_LIST, 'data' => $model->selectStatus(), 'options' => ['class' => 'form-control']]);
    ?>
            </div>
            <div class="col-md-4">
                <b>URL: </b>
                <?php 
    echo Editable::widget(['model' => $model, 'name' => 'url', 'value' => $model->url, 'asPopover' => true, 'header' => 'Статус', 'format' => Editable::FORMAT_LINK, 'inputType' => Editable::INPUT_TEXT, 'data' => $model->url, 'options' => ['class' => 'form-control']]);
    ?>
            </div>
            <div class="col-md-3">
                <?php 
    echo Html::a('Посмотреть', ['pred', 'id' => $model->id], ['target' => '_blank', 'class' => 'btn btn-info btn-block', 'data-toggle' => "tooltip", 'data-placement' => "top", 'title' => "Перед просмотром нужно сохранить"]);
    ?>
            </div>

        </div>
        <hr>
        <?php 
    $form = ActiveForm::begin();
    ?>
        <div class="row">
            <div class="col-md-12">
コード例 #7
0
ファイル: view.php プロジェクト: dosh93/shop
                </div>
                <?php 
if (Yii::$app->user->can('product/update')) {
    ?>
                    <div class="price">
                        <span><b>Настоящая цена: </b></span>
                        <span><?php 
    echo $model->sum;
    ?>
<span class='glyphicon glyphicon-ruble'></span></span>
                    </div>
                    <div class="product-status">
                        <span><b>Статус: </b></span>
                        <span>
                            <?php 
    echo Editable::widget(['model' => $model, 'name' => 'status', 'value' => $model->getStatus(), 'asPopover' => true, 'header' => 'Статус', 'format' => Editable::FORMAT_BUTTON, 'inputType' => Editable::INPUT_DROPDOWN_LIST, 'data' => $model->selectStatus(), 'options' => ['class' => 'form-control']]);
    ?>
                        </span>
                    </div>

                <?php 
}
?>
                <h3 class="text-center"><b>ОСТАЛОСЬ КУПОНОВ</b></h3>
                <p class=" text-center product-coupon"><span id="number_of_coupons<?php 
echo $model->id;
?>
"><?php 
echo $model->number_of_coupons . " " . FA::icon('tags');
?>
</span> </p>
コード例 #8
0
ファイル: index.php プロジェクト: edarkzero/mi_taller
<?php 
Modal::begin(['header' => '<h2>' . Yii::t('app', 'Items') . '</h2>', 'options' => ['id' => 'modal-assignment']]);
?>

    <div class="row">
        <div class="col-md-12">
            <?php 
Pjax::begin(['id' => $itemGridID . '-wrapper']);
?>
            <?php 
echo GridView::widget(['id' => $itemGridID, 'dataProvider' => $itemDataProvider, 'filterModel' => $itemSearchModel, 'rowOptions' => function ($model, $key, $index, $grid) {
    return $model->haveItems() ? ['class' => 'info'] : null;
}, 'tableOptions' => ['class' => 'table table-bordered table-hover table-select table-select-all'], 'columns' => [['class' => 'yii\\grid\\SerialColumn'], 'id', 'name', 'quantity', ['attribute' => 'quantity_user', 'label' => Yii::t('app', 'Quantity to use'), 'format' => 'raw', 'value' => function ($model, $key, $index, $column) use(&$itemGridID) {
    return Editable::widget(['name' => 'quantity_user', 'value' => !isset(Yii::$app->session['item'][$model->id]) ? $model->getItemQuantity() : Yii::$app->session['item'][$model->id], 'pjaxContainerId' => $itemGridID . '-wrapper', 'asPopover' => true, 'header' => Yii::t('app', 'Quantity'), 'options' => ['placeholder' => Yii::t('app', 'Enter a number')], 'beforeInput' => function ($form, $widget) use(&$model) {
        echo Html::input('hidden', 'item', $model->id);
    }]);
}], ['class' => 'yii\\grid\\ActionColumn', 'controller' => 'item', 'buttonOptions' => ['data-pjax' => '0']], ['class' => 'yii\\grid\\CheckboxColumn']]]);
?>
            <?php 
Pjax::end();
?>
        </div>
    </div>

    <div class="row">
        <div class="col-md-6">
            <?php 
echo Html::submitButton(Yii::t('app', 'Accept'), ['class' => 'btn btn-success', 'id' => 'item-submit-modal', 'name' => 'item-submit-modal']);
?>
        </div>
コード例 #9
0
ファイル: profile.php プロジェクト: dextercool/yii2-yiiboard
?>
                
<?php 
$basicInfo = DetailView::widget(['model' => $model, 'options' => ['class' => 'table table-striped detail-view'], 'attributes' => [['label' => YBoard::t('yboard', 'Birthday'), 'value' => $birthday == null ? YBoard::t('yboard', 'None') : $model->profile->{$birthday}], ['label' => YBoard::t('yboard', 'Gender'), 'value' => $model->profile->{$gender} == 1 ? YBoard::t('yboard', 'Male') : YBoard::t('yboard', 'Female')], ['label' => YBoard::t('yboard', 'Joined'), 'value' => $regdate == null ? YBoard::t('yboard', 'None') : date_format(date_timezone_set(date_timestamp_set(date_create(), $model->profile->{$regdate}), $timezone), 'l, d-M-y H:i T')], ['attribute' => 'location', 'format' => 'raw', 'value' => Editable::widget(['model' => $model, 'attribute' => 'location', 'type' => 'primary', 'format' => Editable::FORMAT_BUTTON, 'inputType' => Editable::INPUT_TEXT, 'editableValueOptions' => ['class' => 'text-success pad15-right'], 'formOptions' => ['action' => url::to(['member/usercp', 'id' => $model->id])]])], ['attribute' => 'signature', 'format' => 'raw', 'value' => Editable::widget(['model' => $model, 'attribute' => 'signature', 'type' => 'primary', 'format' => Editable::FORMAT_BUTTON, 'inputType' => Editable::INPUT_TEXT, 'editableValueOptions' => ['class' => 'text-success pad15-right'], 'formOptions' => ['action' => url::to(['member/usercp', 'id' => $model->id])]])], 'status']]);
?>
 


<?php 
$foroStatistics = DetailView::widget(['model' => $model, 'options' => ['class' => 'table table-striped detail-view'], 'attributes' => [['label' => YBoard::t('yboard', 'Last Visit'), 'value' => date_format(date_timezone_set(date_create($model->last_visit), $timezone), 'l, d-M-y H:i T')], 'appreciations', 'startedTopics', 'totalReplies', 'recentTopics:html']]);
?>
  

 
<?php 
$webInfo = DetailView::widget(['model' => $model, 'options' => ['class' => 'table table-striped detail-view'], 'attributes' => [['attribute' => 'blogger', 'format' => 'raw', 'value' => Editable::widget(['model' => $model, 'attribute' => 'blogger', 'type' => 'primary', 'format' => Editable::FORMAT_BUTTON, 'inputType' => Editable::INPUT_TEXT, 'editableValueOptions' => ['class' => 'text-success pad15-right'], 'formOptions' => ['action' => url::to(['member/usercp', 'id' => $model->id])]])], ['attribute' => 'contact_email', 'format' => 'raw', 'value' => Editable::widget(['model' => $model, 'attribute' => 'contact_email', 'type' => 'primary', 'format' => Editable::FORMAT_BUTTON, 'inputType' => Editable::INPUT_DROPDOWN_LIST, 'data' => [1 => 'Allow', 0 => 'Forbid'], 'displayValueConfig' => [0 => YBoard::t('yboard', 'Forbidden'), 1 => YBoard::t('yboard', 'Allowed')], 'editableValueOptions' => ['class' => 'text-success pad15-right'], 'formOptions' => ['action' => url::to(['member/usercp', 'id' => $model->id])], 'pluginEvents' => ["editableSuccess" => "function(event, val) { \n                        //console.log('Successful submission of value ' + val); \n                    }"]])], ['attribute' => 'contact_pm', 'format' => 'raw', 'value' => Editable::widget(['model' => $model, 'attribute' => 'contact_pm', 'type' => 'primary', 'format' => Editable::FORMAT_BUTTON, 'inputType' => Editable::INPUT_DROPDOWN_LIST, 'data' => [1 => 'Allow', 0 => 'Forbid'], 'displayValueConfig' => [0 => YBoard::t('yboard', 'Forbidden'), 1 => YBoard::t('yboard', 'Allowed')], 'editableValueOptions' => ['class' => 'text-success pad15-right'], 'formOptions' => ['action' => url::to(['member/usercp', 'id' => $model->id])], 'pluginEvents' => ["editableSuccess" => "function(event, val) { \n                        //console.log('Successful submission of value ' + val); \n                    }"]])], ['attribute' => 'facebook', 'format' => 'raw', 'value' => Editable::widget(['model' => $model, 'attribute' => 'facebook', 'type' => 'primary', 'format' => Editable::FORMAT_BUTTON, 'inputType' => Editable::INPUT_TEXT, 'editableValueOptions' => ['class' => 'text-success pad15-right'], 'formOptions' => ['action' => url::to(['member/usercp', 'id' => $model->id])]])], ['attribute' => 'skype', 'format' => 'raw', 'value' => Editable::widget(['model' => $model, 'attribute' => 'skype', 'type' => 'primary', 'format' => Editable::FORMAT_BUTTON, 'inputType' => Editable::INPUT_TEXT, 'editableValueOptions' => ['class' => 'text-success pad15-right'], 'formOptions' => ['action' => url::to(['member/usercp', 'id' => $model->id])]])], ['attribute' => 'google', 'format' => 'raw', 'value' => Editable::widget(['model' => $model, 'attribute' => 'google', 'type' => 'primary', 'format' => Editable::FORMAT_BUTTON, 'inputType' => Editable::INPUT_TEXT, 'editableValueOptions' => ['class' => 'text-success pad15-right'], 'formOptions' => ['action' => url::to(['member/usercp', 'id' => $model->id])]])], ['attribute' => 'linkedin', 'format' => 'raw', 'value' => Editable::widget(['model' => $model, 'attribute' => 'linkedin', 'type' => 'primary', 'format' => Editable::FORMAT_BUTTON, 'inputType' => Editable::INPUT_TEXT, 'editableValueOptions' => ['class' => 'text-success pad15-right'], 'formOptions' => ['action' => url::to(['member/usercp', 'id' => $model->id])]])], ['attribute' => 'metacafe', 'format' => 'raw', 'value' => Editable::widget(['model' => $model, 'attribute' => 'metacafe', 'type' => 'primary', 'format' => Editable::FORMAT_BUTTON, 'inputType' => Editable::INPUT_TEXT, 'editableValueOptions' => ['class' => 'text-success pad15-right'], 'formOptions' => ['action' => url::to(['member/usercp', 'id' => $model->id])]])], ['attribute' => 'github', 'format' => 'raw', 'value' => Editable::widget(['model' => $model, 'attribute' => 'github', 'type' => 'primary', 'format' => Editable::FORMAT_BUTTON, 'inputType' => Editable::INPUT_TEXT, 'editableValueOptions' => ['class' => 'text-success pad15-right'], 'formOptions' => ['action' => url::to(['member/usercp', 'id' => $model->id])]])], ['attribute' => 'orkut', 'format' => 'raw', 'value' => Editable::widget(['model' => $model, 'attribute' => 'orkut', 'type' => 'primary', 'format' => Editable::FORMAT_BUTTON, 'inputType' => Editable::INPUT_TEXT, 'editableValueOptions' => ['class' => 'text-success pad15-right'], 'formOptions' => ['action' => url::to(['member/usercp', 'id' => $model->id])]])], ['attribute' => 'tumblr', 'format' => 'raw', 'value' => Editable::widget(['model' => $model, 'attribute' => 'tumblr', 'type' => 'primary', 'format' => Editable::FORMAT_BUTTON, 'inputType' => Editable::INPUT_TEXT, 'editableValueOptions' => ['class' => 'text-success pad15-right'], 'formOptions' => ['action' => url::to(['member/usercp', 'id' => $model->id])]])], ['attribute' => 'twitter', 'format' => 'raw', 'value' => Editable::widget(['model' => $model, 'attribute' => 'twitter', 'type' => 'primary', 'format' => Editable::FORMAT_BUTTON, 'inputType' => Editable::INPUT_TEXT, 'editableValueOptions' => ['class' => 'text-success pad15-right'], 'formOptions' => ['action' => url::to(['member/usercp', 'id' => $model->id])]])], ['attribute' => 'website', 'format' => 'raw', 'value' => Editable::widget(['model' => $model, 'attribute' => 'website', 'type' => 'primary', 'format' => Editable::FORMAT_BUTTON, 'inputType' => Editable::INPUT_TEXT, 'editableValueOptions' => ['class' => 'text-success pad15-right'], 'formOptions' => ['action' => url::to(['member/usercp', 'id' => $model->id])]])], ['attribute' => 'wordpress', 'format' => 'raw', 'value' => Editable::widget(['model' => $model, 'attribute' => 'wordpress', 'type' => 'primary', 'format' => Editable::FORMAT_BUTTON, 'inputType' => Editable::INPUT_TEXT, 'editableValueOptions' => ['class' => 'text-success pad15-right'], 'formOptions' => ['action' => url::to(['member/usercp', 'id' => $model->id])]])], ['attribute' => 'yahoo', 'format' => 'raw', 'value' => Editable::widget(['model' => $model, 'attribute' => 'yahoo', 'type' => 'primary', 'format' => Editable::FORMAT_BUTTON, 'inputType' => Editable::INPUT_TEXT, 'editableValueOptions' => ['class' => 'text-success pad15-right'], 'formOptions' => ['action' => url::to(['member/usercp', 'id' => $model->id])]])], ['attribute' => 'youtube', 'format' => 'raw', 'value' => Editable::widget(['model' => $model, 'attribute' => 'youtube', 'type' => 'primary', 'format' => Editable::FORMAT_BUTTON, 'inputType' => Editable::INPUT_TEXT, 'editableValueOptions' => ['class' => 'text-success pad15-right'], 'formOptions' => ['action' => url::to(['member/usercp', 'id' => $model->id])]])]]]);
?>
  


<div class="yboard-member-view container">         
    <div class="row">
        <div class="col-md-2">
           <div class="center">
               <?php 
echo Html::img(isset($model->profile->image) ? $model->profile->image : $this->context->module->getRegisteredImage("empty.jpeg"), ['id' => 'user-avatar']);
?>
               <p class="pad5-top"><?php 
echo ucfirst($model->profile->{$this->context->module->userNameColumn});
?>
</p>
コード例 #10
0
use yii\helpers\Html;
use yii\widgets\Pjax;
AdminAssets::register($this);
?>

<?php 
Pjax::begin();
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'layout' => "{items}\n{pager}", 'columns' => [['attribute' => 'username', 'value' => function ($model) {
    return Html::a($model->username, ['/user/profile/show/' . $model->id]);
}, 'format' => 'html'], ['attribute' => 'email', 'value' => function ($model) {
    return Html::mailto($model->email, $model->email);
}, 'format' => 'html'], ['attribute' => 'user_type', 'value' => function ($model) {
    // return User::$userTypes[$model->user_type];
    if ($model->id !== Yii::$app->user->identity->id && Yii::$app->user->identity->user_type >= $model->user_type) {
        return Editable::widget(['header' => 'User Type', 'name' => 'User[user_type]', 'size' => 'md', 'format' => Editable::FORMAT_LINK, 'placement' => 'top', 'displayValue' => $model->type->displayName, 'value' => $model->user_type, 'inputType' => Editable::INPUT_DROPDOWN_LIST, 'data' => UserType::all(), 'beforeInput' => function ($form, $widget) use($model) {
            // echo $form->field($widget->model, 'id', ['labelOptions' => ['style' => 'display: none;']])->hiddenInput();
            echo Html::hiddenInput('User[id]', $model->id);
        }, 'formOptions' => ['action' => ['/user/admin/update-user-type']], 'buttonsTemplate' => '{submit}']);
    } else {
        // Can't modify your own account!
        return $model->type->displayName;
    }
}, 'format' => 'raw', 'filter' => User::$userTypes], ['attribute' => 'creation_date', 'value' => function ($model) {
    if (extension_loaded('intl')) {
        return Yii::t('user', '{0, date, dd/MM/yyyy hh:mma}', [strtotime($model->creation_date)]);
    } else {
        return date('d/m/Y h:ia', strtotime($model->creation_date));
    }
}, 'filter' => false], ['header' => 'Status', 'value' => function ($model) {
    $status = "";
    if ($model->isConfirmed) {
        $status .= "<span class='glyphicon glyphicon-ok lnch-status-icon ok' title='Confirmed' aria-hidden='true'></span>";
コード例 #11
0
ファイル: view.php プロジェクト: edarkzero/mi_taller
}], ['attribute' => 'customer_description', 'label' => Yii::t('app', 'Customer'), 'value' => function ($model, $key, $index, $column) {
    return $model->getCustomerDescription();
}], ['attribute' => 'price_total', 'label' => Yii::t('app', 'Total'), 'value' => function ($model, $key, $index, $column) {
    return Yii::$app->formatter->asCurrency($model->getPriceTotal());
}], ['attribute' => 'bp_description', 'label' => Yii::t('app', 'Description'), 'format' => 'raw', 'value' => function ($model, $key, $index, $column) use(&$billGridWrapper) {
    //return $model->getBillPersonalAmount();
    return Editable::widget(['name' => 'bp_description', 'value' => $model->getBillPersonalDescription(), 'pjaxContainerId' => $billGridWrapper, 'asPopover' => true, 'header' => Yii::t('app', 'Description'), 'options' => ['placeholder' => Yii::t('app', 'Enter a description')], 'beforeInput' => function ($form, $widget) use(&$model) {
        echo Html::input('hidden', 'bill', $model->id);
        echo Html::input('hidden', 'person', Yii::$app->request->queryParams['id']);
    }]);
}], ['attribute' => 'bp_amount', 'label' => Yii::t('app', 'Amount'), 'format' => 'raw', 'value' => function ($model, $key, $index, $column) use(&$billGridWrapper) {
    //return $model->getBillPersonalAmount();
    return Editable::widget(['name' => 'bp_amount', 'value' => $model->getBillPersonalAmount(), 'pjaxContainerId' => $billGridWrapper, 'asPopover' => true, 'header' => Yii::t('app', 'Amount'), 'options' => ['placeholder' => Yii::t('app', 'Enter a number')], 'beforeInput' => function ($form, $widget) use(&$model) {
        echo Html::input('hidden', 'bill', $model->id);
        echo Html::input('hidden', 'person', Yii::$app->request->queryParams['id']);
    }, 'afterInput' => function ($form, $widget) use(&$model) {
        //echo Html::label('Dividir pago','split-bill-'.$model->id).Html::checkbox('split-bill-'.$model->id,true);
        echo '<div class="checkbox"><label>' . Html::checkbox('split-bill', false, ['class' => 'bill-divide']) . '<span class="checkbox-material"><span class="check"></span></span> <span class="label-primary">' . Yii::t('app', 'Split payment') . '</span></label></div>';
    }]);
}], ['attribute' => 'paid', 'label' => Yii::t('app', 'Paid'), 'format' => 'raw', 'value' => function ($model, $key, $index, $column) {
    return Html::checkbox('', $model->getBillPersonalPaid());
}, 'filter' => Html::activeCheckbox($billSearchModel, 'bp_paid', ['label' => ''])], ['class' => 'yii\\grid\\CheckboxColumn']]]);
?>

        <?php 
Pjax::end();
?>

    </div>

</div>
コード例 #12
0
ファイル: _update.php プロジェクト: just-leo/cardgame-serial
</strong>
                    <?php 
} else {
    ?>
                        <i class="fa fa-fw fa-money"></i> Счет <strong class="pull-right"><i class="fa fa-fw fa-lock" aria-hidden="true"></i> заблокирован</strong>
                    <?php 
}
?>
                </h2>
            </div>
<!--            <div class="panel-body"></div>-->
            <?php 
if ($user->account) {
    ?>
                <?php 
    echo DetailView::widget(['model' => $user->account, 'attributes' => [['label' => 'Деньги:', 'value' => ''], ['attribute' => 'Money', 'format' => 'raw', 'value' => Yii::$app->formatter->asCurrency($user->account->Money) . ($user->account->InPawn > 0 ? ' <small>+ залог ' . Yii::$app->formatter->asCurrency($user->account->InPawn) . '</small>' : '')], 'Spend:currency', 'Charged:currency', ['label' => 'Бонусы:', 'value' => ''], 'Bonuses:currency', 'SpendBonuses:currency', 'ChargedBonuses:currency', ['attribute' => 'person.group.Name', 'visible' => !Yii::$app->user->identity->ServiceCard], ['attribute' => 'person.group.Name', 'visible' => Yii::$app->user->identity->ServiceCard, 'format' => 'raw', 'value' => Editable::widget(['model' => $user, 'name' => 'GroupID', 'attribute' => 'GroupID', 'displayValueConfig' => ArrayHelper::map(\common\models\cf\PersonsGroupRecord::findAll(['Deleted' => 0]), 'ID', 'Name'), 'asPopover' => true, 'header' => Yii::t('models', 'Group Name'), 'format' => Editable::FORMAT_BUTTON, 'inputType' => Editable::INPUT_DROPDOWN_LIST, 'data' => ArrayHelper::map(\common\models\cf\PersonsGroupRecord::findAll(['Deleted' => 0]), 'ID', 'Name'), 'options' => ['class' => 'form-control', 'prompt' => 'Выберите группу...'], 'editableValueOptions' => ['class' => 'text-danger'], 'formOptions' => ['action' => ['/user/admin/editable', 'id' => $user->id]]])], ['attribute' => 'level.Name', 'value' => $user->account->level->Name . ' (' . $user->account->level->Discount . '%)', 'visible' => !Yii::$app->user->identity->ServiceCard], ['visible' => Yii::$app->user->identity->ServiceCard, 'attribute' => 'level.Name', 'format' => 'raw', 'value' => Editable::widget(['model' => $user->account, 'name' => 'LevelID', 'attribute' => 'LevelID', 'displayValueConfig' => ArrayHelper::map(\common\models\cf\LevelsRecord::getAvailable(), 'ID', 'Name'), 'asPopover' => true, 'header' => Yii::t('models', 'Level Name'), 'format' => Editable::FORMAT_BUTTON, 'inputType' => Editable::INPUT_DROPDOWN_LIST, 'data' => ArrayHelper::map(\common\models\cf\LevelsRecord::getAvailable(), 'ID', 'Name'), 'options' => ['class' => 'form-control', 'prompt' => 'Выберите уровень...'], 'editableValueOptions' => ['class' => 'text-danger'], 'formOptions' => ['action' => ['/user/admin/editable-level', 'id' => $user->id]]])]]]);
    ?>
            <?php 
}
?>
            <ul class="list-group">
                <?php 
if (Yii::$app->user->can('/accounts/charge-balance')) {
    ?>
                    <li class="list-group-item">
                    <?php 
    echo ButtonLink::widget(['label' => '<i class="fa fa-fw fa-plus" aria-hidden="true"></i> ' . Yii::t('app', 'Charge balance') . ' (мин.' . Yii::$app->formatter->asCurrency($user->group->MinMoneyToEmit) . ')', 'encodeLabel' => false, 'type' => 'primary', 'url' => ['/accounts/charge-balance', 'id' => $user->account->id], 'options' => ['class' => 'btn-block', 'id' => 'charge-button']]);
    ?>
                    </li>
                <?php 
}
コード例 #13
0
    echo dpodium\filemanager\components\Filemanager::getThumbnail($fileType, $model->object_url . $model->src_file_name, "250px", "250px");
    ?>
            </div>
        <?php 
}
?>
    </div>
    <div class="<?php 
echo $uploadType === 'full-page' ? 'col-lg-8 col-md-8 col-xs-12' : 'col-xs-12';
?>
">
        <?php 
$tagDisplayValue = json_encode($model->tags);
$objectUrl = $model->object_url . $model->src_file_name;
$btnCopyToClipboard = Html::button('<i class="fa fa-copy"></i>', ['class' => 'btn-copy btn-xs', 'title' => Yii::t('filemanager', 'Copy')]);
echo DetailView::widget(['model' => $model, 'attributes' => ['src_file_name', 'thumbnail_name', ['label' => $model->folder->getAttributeLabel('storage'), 'value' => $model->folder->storage], ['label' => $model->folder->getAttributeLabel('category'), 'value' => $model->folder->category], 'mime_type', 'dimension', ['label' => $model->getAttributeLabel('object_url'), 'format' => 'raw', 'value' => Html::tag('div', $objectUrl, ['class' => 'copy-object-url', 'style' => 'float: left']) . $btnCopyToClipboard], ['label' => $model->getAttributeLabel('caption'), 'format' => 'raw', 'value' => Editable::widget(['model' => $model, 'attribute' => 'caption', 'asPopover' => false])], ['label' => $model->getAttributeLabel('alt_text'), 'format' => 'raw', 'value' => Editable::widget(['model' => $model, 'attribute' => 'alt_text', 'asPopover' => false])], ['label' => $model->getAttributeLabel('description'), 'format' => 'raw', 'value' => Editable::widget(['model' => $model, 'attribute' => 'description', 'asPopover' => false, 'submitOnEnter' => false, 'inputType' => Editable::INPUT_TEXTAREA])], ['label' => $model->getAttributeLabel('tags'), 'format' => 'raw', 'value' => Editable::widget(['model' => $model, 'attribute' => 'tags', 'asPopover' => false, 'submitOnEnter' => false, 'inputType' => Editable::INPUT_SELECT2, 'displayValue' => implode(', ', $editableTagsLabel), 'options' => ['data' => $tags, 'options' => ['multiple' => true, 'placeholder' => Yii::t('filemanager', 'Enter or select tags...')], 'pluginOptions' => ['tags' => true, 'maximumInputLength' => 32]], 'pluginEvents' => ['editableReset' => "function(event) {\n                                jQuery('#' + event.currentTarget.id + ' .kv-editable-parent .input-group select').select2('val', {$tagDisplayValue});\n                            }"]])], 'created_at:dateTime', 'updated_at:dateTime']]);
?>
    </div>
</div>
<?php 
if ($uploadType === 'full-page') {
    ?>
    <div class="row">
        <div class="col-xs-12" style="text-align: center; padding: 10px; border-top: 1px solid #E5E5E5">
            <?php 
    $cancelUrl = \Yii::$app->urlManager->createUrl(['/filemanager/files/index']);
    if (empty($view)) {
        $cancelUrl = \Yii::$app->urlManager->createUrl(['/filemanager/files/index', 'view' => 'grid']);
    }
    echo Html::a(Yii::t('filemanager', 'Cancel'), $cancelUrl, ['class' => 'btn']);
    ?>
コード例 #14
0
ファイル: view.php プロジェクト: mops1k/yiimine
            <dt><?php 
echo \Yii::t('app', '% Done');
?>
</dt>
            <dd>
                <?php 
echo Editable::widget(['model' => $model, 'attribute' => 'readiness_id', 'header' => \Yii::t('app', '% Done'), 'inputType' => Editable::INPUT_DROPDOWN_LIST, 'data' => Issue::getReadinessOptions(), 'options' => ['class' => 'form-control'], 'displayValue' => Issue::getReadinessOptions()[$model->readiness_id]]);
?>
            </dd>
            <dt><?php 
echo \Yii::t('app', 'Deadline');
?>
</dt>
            <dd>
                <?php 
echo Editable::widget(['model' => $model, 'attribute' => 'deadline', 'size' => 'md', 'inputType' => Editable::INPUT_DATE, 'displayValue' => $model->deadline, 'options' => ['pluginOptions' => ['autoclose' => true, 'format' => 'yyyy-mm-dd']]]);
?>
            </dd>
        </dl>
    </div>
    <div class="col-sm-6">

    </div>
</div>
<hr/>
<div class="row">
    <?php 
if ($model->description) {
    ?>
        <div class="col-sm-12">
            <strong><?php 
コード例 #15
0
ファイル: types.php プロジェクト: lnch/yii2-user-control
<?php 
$this->beginContent('@lnch/users/views/admin/__template-types.php');
echo $this->render('/_flash', ['module' => Yii::$app->getModule('user')]);
if (Yii::$app->user->has("users:create-permission")) {
    echo $this->render("_new-permission");
    $this->registerJs('$("document").ready(function(){ 
                $("#new_permission").on("pjax:end", function() {
                    $.pjax.reload({container:"#user-types-pjax"});  //Reload GridView
                });
            });');
}
echo "<div class='table table-responsive'>";
Pjax::begin(['id' => 'user-types-pjax']);
echo GridView::widget(['dataProvider' => $dataProvider, 'layout' => "{items}\n{pager}", 'columns' => [['attribute' => 'name'], ['attribute' => 'alias', 'format' => 'raw', 'value' => function ($model) {
    return Editable::widget(['pjaxContainerId' => 'user-types-pjax', 'header' => 'Alias', 'name' => 'UserType[alias]', 'size' => 'md', 'format' => Editable::FORMAT_LINK, 'placement' => 'top', 'displayValue' => $model->alias, 'value' => $model->alias, 'beforeInput' => function ($form, $widget) use($model) {
        // echo $form->field($widget->model, 'type_id', ['labelOptions' => ['style' => 'display: none;']])->hiddenInput();
        echo Html::hiddenInput('UserType[type_id]', $model->type_id);
    }, 'formOptions' => ['action' => ['/user/admin/type-alias']], 'buttonsTemplate' => '{submit}']);
}, 'contentOptions' => ['style' => 'min-width: 150px;']], ['attribute' => 'description'], ['header' => 'Permissions', 'content' => function ($model) {
    $perms = "";
    foreach ($model->permissions as $perm) {
        $perms .= "<span class='user-type-permission'>" . $perm->group . " : " . $perm->permission;
        if (Yii::$app->user->identity->isFounder) {
            $perms .= "<span class='founder-delete-permission' \n                                            data-group='" . $perm->group . "' \n                                            data-permission='" . $perm->permission . "'\n                                            data-confirm='Are you sure?'>Delete</span>";
        }
        $perms .= "</span>";
    }
    return "<div class='permissions-container'>" . $perms . "</div>";
}, 'format' => 'raw', 'contentOptions' => ['style' => 'width: 45%; min-width: 200px;']]]]);
Pjax::end();
echo "</div>";
$this->registerJs('$("document").ready(function(){ 
コード例 #16
0
ファイル: view.php プロジェクト: Razzwan/dotplant2
?>
</th>
                <td>
                    <?php 
echo $orderIsImmutable ? Html::encode($model->stage->name_short) : Editable::widget(['attribute' => 'order_stage_id', 'data' => \app\components\Helper::getModelMap(\app\modules\shop\models\OrderStage::className(), 'id', 'name_short'), 'displayValue' => $model->stage !== null ? Html::tag('span', $model->stage->name_short) : Html::tag('em', Yii::t('yii', '(not set)')), 'formOptions' => ['action' => ['update-stage', 'id' => $model->id]], 'inputType' => Editable::INPUT_DROPDOWN_LIST, 'model' => $model]);
?>
                </td>
            </tr>
            <tr>
                <th><?php 
echo $model->getAttributeLabel('payment_type_id');
?>
</th>
                <td>
                    <?php 
echo $orderIsImmutable ? null !== $model->paymentType ? Html::encode($model->paymentType->name) : Html::tag('em', Yii::t('yii', '(not set)')) : Editable::widget(['attribute' => 'payment_type_id', 'data' => \app\components\Helper::getModelMap(\app\modules\shop\models\PaymentType::className(), 'id', 'name'), 'displayValue' => $model->paymentType !== null ? Html::tag('span', $model->paymentType->name) : Html::tag('em', Yii::t('yii', '(not set)')), 'formOptions' => ['action' => ['update-payment-type', 'id' => $model->id]], 'inputType' => Editable::INPUT_DROPDOWN_LIST, 'model' => $model]);
?>
                </td>
            </tr>
            <?php 
foreach ($model->abstractModel->attributes as $name => $attribute) {
    ?>
                <tr>
                    <th><?php 
    echo $model->abstractModel->getAttributeLabel($name);
    ?>
</th>
                    <td>
                        <button data-toggle="modal" data-target="#custom-fields-modal" class="kv-editable-value kv-editable-link">
                            <?php 
    echo !empty($attribute) ? Html::encode($attribute) : Html::tag('em', Yii::t('yii', '(not set)'));
コード例 #17
0
ファイル: EditableColumn.php プロジェクト: thecocce/yii2-grid
 /**
  * Renders the data cell content.
  *
  * @param mixed   $model the data model
  * @param mixed   $key the key associated with the data model
  * @param integer $index the zero-based index of the data model among the models array returned by
  *     [[GridView::dataProvider]].
  *
  * @return string the rendering result
  * @throws InvalidConfigException
  */
 public function renderDataCellContent($model, $key, $index)
 {
     $readonly = $this->readonly;
     if ($readonly instanceof Closure) {
         $readonly = call_user_func($readonly, $model, $key, $index, $this);
     }
     if ($readonly === true) {
         return parent::renderDataCellContent($model, $key, $index);
     }
     $this->_editableOptions = $this->editableOptions;
     if (!empty($this->editableOptions) && $this->editableOptions instanceof Closure) {
         $this->_editableOptions = call_user_func($this->editableOptions, $model, $key, $index, $this);
     }
     if (!is_array($this->_editableOptions)) {
         $this->_editableOptions = [];
     }
     $options = ArrayHelper::getValue($this->_editableOptions, 'containerOptions', []);
     Html::addCssClass($options, $this->_css);
     $this->_editableOptions['containerOptions'] = $options;
     if ($this->grid->pjax && empty($this->_editableOptions['pjaxContainerId'])) {
         $this->_editableOptions['pjaxContainerId'] = $this->grid->pjaxSettings['options']['id'];
     }
     $strKey = $key;
     if (empty($key)) {
         throw new InvalidConfigException("Invalid or no primary key found for the grid data.");
     } elseif (!is_string($key) && !is_numeric($key)) {
         $strKey = serialize($key);
     }
     if ($this->attribute !== null) {
         $this->_editableOptions['model'] = $model;
         $this->_editableOptions['attribute'] = "[{$index}]{$this->attribute}";
     } elseif (empty($this->_editableOptions['name']) && empty($this->_editableOptions['model']) || !empty($this->_editableOptions['model']) && empty($this->_editableOptions['attribute'])) {
         throw new InvalidConfigException("You must setup the 'attribute' for your EditableColumn OR set one of 'name' OR 'model' & 'attribute'" . " in 'editableOptions' (Exception at index: '{$index}', key: '{$strKey}').");
     }
     $val = $this->getDataCellValue($model, $key, $index);
     if (!isset($this->_editableOptions['displayValue']) && $val !== null && $val !== '') {
         $this->_editableOptions['displayValue'] = parent::renderDataCellContent($model, $key, $index);
     }
     $params = Html::hiddenInput('editableIndex', $index) . Html::hiddenInput('editableKey', $strKey) . Html::hiddenInput('editableAttribute', $this->attribute);
     if (empty($this->_editableOptions['beforeInput'])) {
         $this->_editableOptions['beforeInput'] = $params;
     } else {
         $output = $this->_editableOptions['beforeInput'];
         $this->_editableOptions['beforeInput'] = function ($form, $widget) use($output, $params) {
             if ($output instanceof Closure) {
                 return $params . call_user_func($output, $form, $widget);
             } else {
                 return $params . $output;
             }
         };
     }
     if ($this->refreshGrid) {
         $id = $this->grid->options['id'];
         $this->_view->registerJs("kvRefreshEC('{$id}','{$this->_css}');");
     }
     return Editable::widget($this->_editableOptions);
 }
コード例 #18
0
ファイル: EditableColumn.php プロジェクト: hsleonis/basetech
    /**
     * Renders the data cell content.
     *
     * @param mixed   $model the data model
     * @param mixed   $key the key associated with the data model
     * @param integer $index the zero-based index of the data model among the models array returned by
     *     [[GridView::dataProvider]].
     *
     * @return string the rendering result
     * @throws InvalidConfigException
     */
    public function renderDataCellContent($model, $key, $index)
    {
        $readonly = $this->readonly;
        if ($readonly instanceof Closure) {
            $readonly = call_user_func($readonly, $model, $key, $index, $this);
        }
        if ($readonly === true) {
            return parent::renderDataCellContent($model, $key, $index);
        }
        $this->_editableOptions = $this->editableOptions;
        if (!empty($this->editableOptions) && $this->editableOptions instanceof Closure) {
            $this->_editableOptions = call_user_func($this->editableOptions, $model, $key, $index, $this);
        }
        if (!is_array($this->_editableOptions)) {
            $this->_editableOptions = [];
        }
        $options = ArrayHelper::getValue($this->_editableOptions, 'containerOptions', []);
        Html::addCssClass($options, $this->_css);
        $this->_editableOptions['containerOptions'] = $options;
        if ($this->grid->pjax && empty($this->_editableOptions['pjaxContainerId'])) {
            $this->_editableOptions['pjaxContainerId'] = $this->grid->pjaxSettings['options']['id'];
        }
        $strKey = $key;
        if (empty($key)) {
            throw new InvalidConfigException("Invalid or no primary key found for the grid data.");
        } elseif (!is_string($key) && !is_numeric($key)) {
            $strKey = serialize($key);
        }
        if ($this->attribute !== null) {
            $this->_editableOptions['model'] = $model;
            $this->_editableOptions['attribute'] = "[{$index}]{$this->attribute}";
            $type = ArrayHelper::getValue($this->_editableOptions, 'inputType', Editable::INPUT_TEXT);
        } elseif (empty($this->_editableOptions['name']) && empty($this->_editableOptions['model']) || !empty($this->_editableOptions['model']) && empty($this->_editableOptions['attribute'])) {
            throw new InvalidConfigException("You must setup the 'attribute' for your EditableColumn OR set one of 'name' OR 'model' & 'attribute' in 'editableOptions' (Exception at index: '{$index}', key: '{$strKey}').");
        }
        $val = $this->getDataCellValue($model, $key, $index);
        if (!isset($this->_editableOptions['displayValue']) && $val !== null && $val !== '') {
            $this->_editableOptions['displayValue'] = parent::renderDataCellContent($model, $key, $index);
        }
        $params = Html::hiddenInput('editableIndex', $index) . Html::hiddenInput('editableKey', $strKey);
        if (empty($this->_editableOptions['beforeInput'])) {
            $this->_editableOptions['beforeInput'] = $params;
        } else {
            $output = $this->_editableOptions['beforeInput'];
            $this->_editableOptions['beforeInput'] = function ($form, $widget) use($output, $params) {
                if ($output instanceof Closure) {
                    return $params . call_user_func($output, $form, $widget);
                } else {
                    return $params . $output;
                }
            };
        }
        if ($this->refreshGrid) {
            $view = $this->grid->getView();
            $grid = 'jQuery("#' . $this->grid->options['id'] . '")';
            $script = <<<JS
{$grid}.find('.{$this->_css}').each(function() {
    var \$el = \$(this);
    \$el.on('editableSuccess', function(){
        {$grid}.yiiGridView("applyFilter");
    });
});
JS;
            $view->registerJs($script);
        }
        return Editable::widget($this->_editableOptions);
    }
コード例 #19
0
ファイル: _managerOrder.php プロジェクト: kd-brinex/kd
}, 'vAlign' => 'middle'], ['label' => 'Комментарий', 'value' => 'description'], ['class' => '\\kartik\\grid\\ActionColumn', 'header' => '', 'template' => '{delete-main}', 'contentOptions' => ['class' => 'btn-group-sm'], 'buttons' => ['delete-main' => function ($url, $model) {
    return \yii\bootstrap\Html::button('<span class="glyphicon glyphicon-remove"></span>', ['class' => 'btn btn-danger', 'onClick' => 'deleteMainDetail("' . $url . '");']);
}]]], 'toolbar' => [['content' => '<div style="margin:0px 2px;display: inline-block">' . Html::a('<i class="glyphicon glyphicon-refresh"></i> Синхронизировать с <strong>1С</strong>', ['#'], ['title' => 'Отправить в 1C', 'class' => 'btn ' . ($order->isIn1C === null ? '' : 'btn-default disabled'), 'onClick' => 'sendTo1C(' . $order->id . ', this); return false', 'style' => $order->isIn1C === null ? 'background-color:#FFDC0E; color:#EC1421' : '']) . '</div>' . '<div style="margin:0px 2px;display: inline-block">' . Html::a('<i class="glyphicon glyphicon-rub"></i> Проценка', ['#'], ['title' => 'Проценка', 'class' => 'btn btn-success', 'onClick' => 'pricing(' . $order->id . ', this); return false']) . '</div>', 'options' => ['class' => 'btn-group-sm']]], 'panel' => ['heading' => '<h3 class="panel-title"><i class="glyphicon glyphicon-tasks"></i> Позиции</h3>', 'before' => '<div style="margin:0px 2px;display: inline-block">' . Html::a('<i class="glyphicon glyphicon-triangle-right"></i> К выборке', ['#'], ['id' => 'tableToggler', 'class' => 'btn btn-primary', 'onClick' => 'goTo(2); return false;', 'style' => 'display:none']) . '</div>' . '<div style="margin:0px 2px;display: inline-block">' . \kartik\editable\Editable::widget(['id' => 'add-position-button', 'name' => 'code', 'asPopover' => false, 'format' => 'button', 'inlineSettings' => ['options' => ['class' => 'add-position-button']], 'editableButtonOptions' => ['label' => '<i class="glyphicon glyphicon-plus"></i> Добавить позицию', 'class' => 'btn btn-danger'], 'value' => false, 'size' => 'md', 'showButtons' => false, 'ajaxSettings' => ['url' => '/autoparts/orders/pricing'], 'submitButton' => ['icon' => '<i class="glyphicon glyphicon-search"></i>'], 'formOptions' => ['id' => 'add-position-to-order-form'], 'afterInput' => function () use($order) {
    echo Html::hiddenInput('city_id', $order->store->city_id);
    echo Html::hiddenInput('order_id', $order->id);
    echo '<div class="form-group" style="float:left">' . Html::a('Из каталога', '/finddetails#w2-tab2', ['target' => '_blank', 'class' => 'btn btn-primary', 'data-pjax' => '0']) . '</div>';
}, 'options' => ['class' => 'form-control', 'placeholder' => 'Введите артикул...', 'required' => true], 'editableValueOptions' => ['style' => 'width: 0px;opacity: 0;'], 'pluginEvents' => ['editableSubmit' => 'function() {
                                    if($("#add-position-button").val() == "") return false;
                                    var content = $(".modal-body"),
                                        header = $(".modal-header");

                                        if($("#modal-body-2").length > 0) {
                                            $("#modal-body-2").remove();
                                        }

                                        if($("#modal-body-1").length == 0){
                                            content.attr("id","modal-body-1").hide();
                                        } else {
                                            $("#modal-body-1").hide();
                                        }

                                        header.after("<div class=\'loader\'></div>");

                            }', 'editableSuccess' => 'function(event, val, form, data) {
                                        $("#tableToggler").show();
                                        $(".loader").remove();
                                        $(".modal-header").after("<div class=\'modal-body\' id=\'modal-body-2\'></div>");
                                        $("#modal-body-2").html(data.table);
                            }']]) . '</div>', 'beforeOptions' => ['class' => 'btn-group-sm'], 'footer' => false]]);
$this->registerJs('
    $(document).on("pjax:end", function(){