@@ -58,11 +58,11 @@ discard block |
||
| 58 | 58 | ]]); |
| 59 | 59 | ?>)</h3> |
| 60 | 60 | <?php |
| 61 | - foreach (\Dashboard\Comment::getList([ 'where' => [ |
|
| 62 | - ['item_id', $item->id], |
|
| 63 | - ['model', $modelName], |
|
| 64 | - ], 'order' => ['date_create', 'desc']]) as $comment) { |
|
| 65 | - ?> |
|
| 61 | + foreach (\Dashboard\Comment::getList([ 'where' => [ |
|
| 62 | + ['item_id', $item->id], |
|
| 63 | + ['model', $modelName], |
|
| 64 | + ], 'order' => ['date_create', 'desc']]) as $comment) { |
|
| 65 | + ?> |
|
| 66 | 66 | <div class="row"> |
| 67 | 67 | <div class="col-sm-3" style="max-width: 300px;"> |
| 68 | 68 | <a href='/admin/Users/view/User/<?= $comment->user->pk(); ?>'><?= $comment->user->name(); ?></a><br /> |
@@ -73,14 +73,14 @@ discard block |
||
| 73 | 73 | </div> |
| 74 | 74 | </div> |
| 75 | 75 | <?php |
| 76 | - } |
|
| 77 | - ?> |
|
| 76 | + } |
|
| 77 | + ?> |
|
| 78 | 78 | </div> |
| 79 | 79 | <div> |
| 80 | 80 | <?php |
| 81 | - $form = new \Ui\Form(); |
|
| 82 | - $form->begin(); |
|
| 83 | - $form->input('textarea', 'comment', 'Комментарий'); |
|
| 84 | - $form->end(); |
|
| 85 | - ?> |
|
| 81 | + $form = new \Ui\Form(); |
|
| 82 | + $form->begin(); |
|
| 83 | + $form->input('textarea', 'comment', 'Комментарий'); |
|
| 84 | + $form->end(); |
|
| 85 | + ?> |
|
| 86 | 86 | </div> |
@@ -24,14 +24,14 @@ discard block |
||
| 24 | 24 | case 'relation': |
| 25 | 25 | $relations = $colInfo['modelName']::relations(); |
| 26 | 26 | $relValue = $relations[$colInfo['colParams']['relation']]['model']::get($item->$colName); |
| 27 | - $value = $relValue ? "<a href='/admin/" . str_replace('\\', '/view/', $relations[$colInfo['colParams']['relation']]['model']) . "/" . $relValue->pk() . "'>" . $relValue->name() . "</a>" : 'Не задано'; |
|
| 27 | + $value = $relValue ? "<a href='/admin/".str_replace('\\', '/view/', $relations[$colInfo['colParams']['relation']]['model'])."/".$relValue->pk()."'>".$relValue->name()."</a>" : 'Не задано'; |
|
| 28 | 28 | break; |
| 29 | 29 | } |
| 30 | 30 | break; |
| 31 | 31 | case 'image': |
| 32 | 32 | $file = Files\File::get($item->$colName); |
| 33 | 33 | if ($file) { |
| 34 | - $value = '<img src="' . $file->path . '?resize=60x120" />'; |
|
| 34 | + $value = '<img src="'.$file->path.'?resize=60x120" />'; |
|
| 35 | 35 | } else { |
| 36 | 36 | $value = '<img src="/static/system/images/no-image.png?resize=60x120" />'; |
| 37 | 37 | } |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | ]]); |
| 59 | 59 | ?>)</h3> |
| 60 | 60 | <?php |
| 61 | - foreach (\Dashboard\Comment::getList([ 'where' => [ |
|
| 61 | + foreach (\Dashboard\Comment::getList(['where' => [ |
|
| 62 | 62 | ['item_id', $item->id], |
| 63 | 63 | ['model', $modelName], |
| 64 | 64 | ], 'order' => ['date_create', 'desc']]) as $comment) { |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | $buttons = []; |
| 12 | 12 | foreach ($actions as $action => $actionParams) { |
| 13 | 13 | if (class_exists($actionParams['className']) && $actionParams['className']::$rowAction) { |
| 14 | - $buttons[]= $actionParams['className']::rowButton($dataManager, $item, $params, $actionParams); |
|
| 14 | + $buttons[] = $actionParams['className']::rowButton($dataManager, $item, $params, $actionParams); |
|
| 15 | 15 | } |
| 16 | 16 | } |
| 17 | 17 | echo implode(' ', $buttons); |
@@ -44,7 +44,7 @@ |
||
| 44 | 44 | 'map' => [ |
| 45 | 45 | ['name', 'type'], |
| 46 | 46 | ['required', 'save'], |
| 47 | - [ 'userfield'] |
|
| 47 | + ['userfield'] |
|
| 48 | 48 | ] |
| 49 | 49 | ] |
| 50 | 50 | ]; |
@@ -1,16 +1,16 @@ discard block |
||
| 1 | 1 | <fieldset> |
| 2 | 2 | <?php |
| 3 | - if (\Users\User::$cur->id) { |
|
| 4 | - $userAdds = Ecommerce\UserAdds::getList(['where' => ['user_id', \Users\User::$cur->id]]); |
|
| 5 | - $values = []; |
|
| 6 | - foreach ($userAdds as $userAdd) { |
|
| 7 | - $values[$userAdd->id] = $userAdd->values(['array' => true]); |
|
| 8 | - } |
|
| 9 | - if ($userAdds) { |
|
| 10 | - $form->input('select', 'userAddsId', 'Ваши контакты', ['values' => ['' => 'Выберите'] + Ecommerce\UserAdds::getList(['where' => ['user_id', \Users\User::$cur->id], 'forSelect' => true])]); |
|
| 11 | - echo '<hr />'; |
|
| 12 | - } |
|
| 13 | - ?> |
|
| 3 | + if (\Users\User::$cur->id) { |
|
| 4 | + $userAdds = Ecommerce\UserAdds::getList(['where' => ['user_id', \Users\User::$cur->id]]); |
|
| 5 | + $values = []; |
|
| 6 | + foreach ($userAdds as $userAdd) { |
|
| 7 | + $values[$userAdd->id] = $userAdd->values(['array' => true]); |
|
| 8 | + } |
|
| 9 | + if ($userAdds) { |
|
| 10 | + $form->input('select', 'userAddsId', 'Ваши контакты', ['values' => ['' => 'Выберите'] + Ecommerce\UserAdds::getList(['where' => ['user_id', \Users\User::$cur->id], 'forSelect' => true])]); |
|
| 11 | + echo '<hr />'; |
|
| 12 | + } |
|
| 13 | + ?> |
|
| 14 | 14 | <script> |
| 15 | 15 | var userAddsValues = <?= json_encode($values); ?>; |
| 16 | 16 | inji.onLoad(function () { |
@@ -24,9 +24,9 @@ discard block |
||
| 24 | 24 | }) |
| 25 | 25 | </script> |
| 26 | 26 | <?php |
| 27 | - } |
|
| 28 | - foreach (Ecommerce\UserAdds\Field::getList(['order' => ['weight', 'asc']]) as $field) { |
|
| 29 | - $form->input($field->type, "userAdds[fields][{$field->id}]", $field->name, ['required' => $field->required]); |
|
| 30 | - } |
|
| 31 | - ?> |
|
| 27 | + } |
|
| 28 | + foreach (Ecommerce\UserAdds\Field::getList(['order' => ['weight', 'asc']]) as $field) { |
|
| 29 | + $form->input($field->type, "userAdds[fields][{$field->id}]", $field->name, ['required' => $field->required]); |
|
| 30 | + } |
|
| 31 | + ?> |
|
| 32 | 32 | </fieldset> |
| 33 | 33 | \ No newline at end of file |
@@ -11,6 +11,11 @@ |
||
| 11 | 11 | { |
| 12 | 12 | function indexAction() |
| 13 | 13 | { |
| 14 | + |
|
| 15 | + /** |
|
| 16 | + * @param DOMDocument $xml |
|
| 17 | + * @param string $nodeName |
|
| 18 | + */ |
|
| 14 | 19 | function addToXml($xml, $parent, $nodeName, $text) |
| 15 | 20 | { |
| 16 | 21 | $node = $parent->appendChild($xml->createElement($nodeName)); |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | |
| 37 | 37 | addToXml($xml, $shop, 'name', \App::$cur->config['site']['name']); |
| 38 | 38 | addToXml($xml, $shop, 'company', \App::$cur->config['site']['company_name']); |
| 39 | - addToXml($xml, $shop, 'url', 'http://' . INJI_DOMAIN_NAME); |
|
| 39 | + addToXml($xml, $shop, 'url', 'http://'.INJI_DOMAIN_NAME); |
|
| 40 | 40 | |
| 41 | 41 | $currencies = $xml->createElement('currencies'); |
| 42 | 42 | $currency = $currencies->appendChild($xml->createElement('currency')); |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | $offers = $xml->createElement('offers'); |
| 61 | 61 | foreach (App::$cur->ecommerce->getItems() as $item) { |
| 62 | 62 | $offer = $offers->appendChild($xml->createElement('offer')); |
| 63 | - addToXml($xml, $offer, 'url', 'http://' . INJI_DOMAIN_NAME . '/ecommerce/view/' . $item->id); |
|
| 63 | + addToXml($xml, $offer, 'url', 'http://'.INJI_DOMAIN_NAME.'/ecommerce/view/'.$item->id); |
|
| 64 | 64 | addToXml($xml, $offer, 'price', $item->getPrice()->price); |
| 65 | 65 | addToXml($xml, $offer, 'currencyId', 'RUR'); |
| 66 | 66 | addToXml($xml, $offer, 'categoryId', $item->category_id); |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | |
| 87 | 87 | header("Content-Type: text/xml"); |
| 88 | 88 | header("Expires: Thu, 19 Feb 1998 13:24:18 GMT"); |
| 89 | - header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); |
|
| 89 | + header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT"); |
|
| 90 | 90 | header("Cache-Control: no-cache, must-revalidate"); |
| 91 | 91 | header("Cache-Control: post-check=0,pre-check=0"); |
| 92 | 92 | header("Cache-Control: max-age=0"); |
@@ -17,20 +17,20 @@ |
||
| 17 | 17 | <h1><?= $item->name(); ?></h1> |
| 18 | 18 | <ul class="item-options"> |
| 19 | 19 | <?php |
| 20 | - foreach ($item->options as $param) { |
|
| 21 | - if (!$param->item_option_view || !$param->value) |
|
| 22 | - continue; |
|
| 23 | - if ($param->item_option_type == 'select') { |
|
| 24 | - if (empty($param->option->items[$param->value])) |
|
| 25 | - continue; |
|
| 26 | - $value = $param->option->items[$param->value]->value; |
|
| 27 | - } else { |
|
| 28 | - $value = $param->value; |
|
| 29 | - } |
|
| 30 | - $paramName = $param->item_option_name; |
|
| 31 | - echo "<li>{$paramName}: {$value} {$param->item_option_postfix}</li>"; |
|
| 32 | - } |
|
| 33 | - ?> |
|
| 20 | + foreach ($item->options as $param) { |
|
| 21 | + if (!$param->item_option_view || !$param->value) |
|
| 22 | + continue; |
|
| 23 | + if ($param->item_option_type == 'select') { |
|
| 24 | + if (empty($param->option->items[$param->value])) |
|
| 25 | + continue; |
|
| 26 | + $value = $param->option->items[$param->value]->value; |
|
| 27 | + } else { |
|
| 28 | + $value = $param->value; |
|
| 29 | + } |
|
| 30 | + $paramName = $param->item_option_name; |
|
| 31 | + echo "<li>{$paramName}: {$value} {$param->item_option_postfix}</li>"; |
|
| 32 | + } |
|
| 33 | + ?> |
|
| 34 | 34 | </ul> |
| 35 | 35 | <div class="item-actions"> |
| 36 | 36 | <div class="item-price"> |
@@ -18,11 +18,13 @@ |
||
| 18 | 18 | <ul class="item-options"> |
| 19 | 19 | <?php |
| 20 | 20 | foreach ($item->options as $param) { |
| 21 | - if (!$param->item_option_view || !$param->value) |
|
| 22 | - continue; |
|
| 21 | + if (!$param->item_option_view || !$param->value) { |
|
| 22 | + continue; |
|
| 23 | + } |
|
| 23 | 24 | if ($param->item_option_type == 'select') { |
| 24 | - if (empty($param->option->items[$param->value])) |
|
| 25 | - continue; |
|
| 25 | + if (empty($param->option->items[$param->value])) { |
|
| 26 | + continue; |
|
| 27 | + } |
|
| 26 | 28 | $value = $param->option->items[$param->value]->value; |
| 27 | 29 | } else { |
| 28 | 30 | $value = $param->value; |
@@ -24,8 +24,8 @@ |
||
| 24 | 24 | 'label' => ['type' => 'text'], |
| 25 | 25 | 'type' => ['type' => 'text'], |
| 26 | 26 | 'required' => ['type' => 'bool'], |
| 27 | - 'form_id' => [ 'type' => 'select', 'source' => 'relation', 'relation' => 'form'], |
|
| 28 | - 'user_id' => [ 'type' => 'select', 'source' => 'relation', 'relation' => 'user'], |
|
| 27 | + 'form_id' => ['type' => 'select', 'source' => 'relation', 'relation' => 'form'], |
|
| 28 | + 'user_id' => ['type' => 'select', 'source' => 'relation', 'relation' => 'user'], |
|
| 29 | 29 | 'input_params' => ['type' => 'textarea'], |
| 30 | 30 | 'weight' => ['type' => 'number'] |
| 31 | 31 | ]; |
@@ -24,10 +24,10 @@ |
||
| 24 | 24 | public static $cols = [ |
| 25 | 25 | 'name' => ['type' => 'text'], |
| 26 | 26 | 'description' => ['type' => 'html'], |
| 27 | - 'user_id' => [ 'type' => 'select', 'source' => 'relation', 'relation' => 'user'], |
|
| 27 | + 'user_id' => ['type' => 'select', 'source' => 'relation', 'relation' => 'user'], |
|
| 28 | 28 | 'date_create' => ['type' => 'dateTime'], |
| 29 | 29 | //Менеджеры |
| 30 | - 'inputs' => [ 'type' => 'dataManager', 'relation' => 'inputs'], |
|
| 30 | + 'inputs' => ['type' => 'dataManager', 'relation' => 'inputs'], |
|
| 31 | 31 | ]; |
| 32 | 32 | public static $dataManagers = [ |
| 33 | 33 | 'manager' => [ |
@@ -2,17 +2,17 @@ |
||
| 2 | 2 | <div class="table-responsive"> |
| 3 | 3 | <table class="table table-bordered table-condensed table-striped table-hover"> |
| 4 | 4 | <?php |
| 5 | - $i = 0; |
|
| 6 | - foreach ($items as $item) { |
|
| 7 | - ?> |
|
| 5 | + $i = 0; |
|
| 6 | + foreach ($items as $item) { |
|
| 7 | + ?> |
|
| 8 | 8 | <tr> |
| 9 | 9 | <?php $this->widget('Ecommerce\items/item-tablerow', ['item' => $item]); ?> |
| 10 | 10 | </tr> |
| 11 | 11 | <?php |
| 12 | - if (!( ++$i % 3)) { |
|
| 13 | - echo '</div><div class="row">'; |
|
| 14 | - } |
|
| 15 | - } |
|
| 16 | - ?> |
|
| 12 | + if (!( ++$i % 3)) { |
|
| 13 | + echo '</div><div class="row">'; |
|
| 14 | + } |
|
| 15 | + } |
|
| 16 | + ?> |
|
| 17 | 17 | </table></div> |
| 18 | 18 | </div> |
| 19 | 19 | \ No newline at end of file |