Skip to content

Commit

Permalink
hotfix
Browse files Browse the repository at this point in the history
  • Loading branch information
leon-mbs committed Dec 29, 2020
1 parent b83f045 commit 520367b
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 5 deletions.
6 changes: 3 additions & 3 deletions www/app/modules/shop/pages/productlist.php
Original file line number Diff line number Diff line change
Expand Up @@ -355,15 +355,15 @@ public function onImageSubmit($sender) {
}
$r = ((double)$imagedata[0]) / $imagedata[1];
if ($r > 1.1 || $r < 0.9) {
$this->setError('squareimage');
return;
$this->setError('squareimage');
return;
}

$image = new \App\Entity\Image();
$image->content = file_get_contents($file['tmp_name']);
$image->mime = $imagedata['mime'];

$thumb = new \App\Thumb($filedata['tmp_name']);
$thumb = new \App\Thumb($file['tmp_name']);
$thumb->resize(256, 256);
$image->thumb = $thumb->getImageAsString();

Expand Down
8 changes: 7 additions & 1 deletion www/app/pages/service/import.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public function __construct() {
$form->add(new DropDownChoice("colinprice", $cols));
$form->add(new DropDownChoice("colmsr", $cols));
$form->add(new DropDownChoice("colbrand", $cols));
$form->add(new DropDownChoice("coldesc", $cols));
$form->add(new CheckBox("passfirst"));
$form->add(new CheckBox("preview"));

Expand Down Expand Up @@ -124,6 +125,7 @@ public function onImport($sender) {
$colinprice = $this->iform->colinprice->getValue();
$colmsr = $this->iform->colmsr->getValue();
$colbrand = $this->iform->colbrand->getValue();
$coldesc = $this->iform->coldesc->getValue();
if ($colname === '0') {
$this->setError('noselcolname');
return;
Expand Down Expand Up @@ -180,7 +182,8 @@ public function onImport($sender) {
'colmsr' => $row[$colmsr ],
'colinprice' => $row[$colinprice ],
'colprice' => $row[$colprice ],
'colbrand' => $row[$colbrand ]
'colbrand' => $row[$colbrand ] ,
'coldesc' => $row[$coldesc ]
);
}
return;
Expand Down Expand Up @@ -230,6 +233,9 @@ public function onImport($sender) {
if (strlen($row[$colbrand ]) > 0) {
$item->manufacturer = trim($row[$colbrand ]);
}
if (strlen(trim($row[$coldesc ])) > 0) {
$item->description = trim($row[$coldesc ]);
}
if ($price > 0) {
$item->{$pt} = $price;
}
Expand Down
2 changes: 1 addition & 1 deletion www/templates/modules/shop/pages/productlist.html
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ <h4>Редактирование</h4>
</div>
</div>
<div class="form-group row">
<label class="col-4" for="ename">Назва</label>
<label class="col-4" for="ename">Название</label>
<div class="col-8">
<input zippy="ename" type="text" class="form-control">
</div>
Expand Down
5 changes: 5 additions & 0 deletions www/templates/pages/service/import.html
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@ <h3>Импорт номенклатуры
<select style="width:100px;" zippy="colmsr" class="form-control ">
</select>
</div>
<div class="form-group ">
<label for="coldesc">Описание</label>
<select style="width:100px;" zippy="coldesc" class="form-control ">
</select>
</div>

<div class="form-group ">
<label data-label="colqty" for="colqty">Количество</label>
Expand Down
7 changes: 7 additions & 0 deletions www/templates_ua/pages/service/import.html
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ <h3>Імпорт номенклатури
<th class="text-right">Кіл.</th>
<th class="text-right">Обл. ціна</th>
<th class="text-right">Вiдп. ціна</th>

</tr>
{{#list}}
<tr>
Expand All @@ -133,6 +134,7 @@ <h3>Імпорт номенклатури
<td class="text-right">{{colqty}}</td>
<td class="text-right">{{colinprice}}</td>
<td class="text-right">{{colprice}}</td>

</tr>
{{/list}}
</table>
Expand Down Expand Up @@ -205,6 +207,11 @@ <h3>Імпорт накладної
<select style="width:100px;" zippy="ncolmsr" class="form-control ">
</select>
</div>
<div class="form-group ">
<label for="coldesc">Опис </label>
<select style="width:100px;" zippy="coldesc" class="form-control ">
</select>
</div>

<div class="form-group ">
<label data-label="ncolqty" for="ncolqty">Кількість</label>
Expand Down

0 comments on commit 520367b

Please sign in to comment.