Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotfix #143

Merged
merged 5 commits into from
Mar 16, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
hotfix
  • Loading branch information
leon-mbs committed Mar 16, 2021
commit c6ceb89f626dbfc9402161b2bca2b770a786a81e
1 change: 1 addition & 0 deletions www/app/entity/user.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ protected function init() {
$this->user_id = 0;
$this->defstore = 0;
$this->defmf = 0;
$this->deffirm = 0;
$this->hidesidebar = 0;
$this->pagesize = 25;
$this->createdon = time();
Expand Down
18 changes: 15 additions & 3 deletions www/app/pages/base.php
Original file line number Diff line number Diff line change
Expand Up @@ -221,9 +221,21 @@ public function goDocView() {
}

private function generateTosats() {

$this->_tvars["toasts"] = array();
// $this->_tvars["toasts"][] = array('title'=>"title:\"Задайте склад по умолчанию в профиле\"") ;

if(\App\Session::getSession()->toasts == true) return;//уже показан

$user = System::getUser() ;
if($user->defstore ==0) {
$this->_tvars["toasts"][] = array('title'=>"title:\"".Helper::l("nodefstore")."\"") ;
}
if($user->deffirm ==0) {
$this->_tvars["toasts"][] = array('title'=>"title:\"".Helper::l("nodeffirm")."\"") ;
}
if($user->defmf ==0) {
$this->_tvars["toasts"][] = array('title'=>"title:\"".Helper::l("nodefmf")."\"") ;
}

\App\Session::getSession()->toasts = true;
}
}
2 changes: 1 addition & 1 deletion www/app/pages/register/gilist.php
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ public function updateStatusButtons() {
$this->statuspan->statusform->closeorder->setVisible(false);
if ($this->_doc->headerdata['order_id'] > 0) {
$order = Document::load($this->_doc->headerdata['order_id']);
if ($order->payamount == $order->payed) {
if ($order->payamount == $order->payed || $order->headerdata['payment']==0) {
$this->statuspan->statusform->closeorder->setVisible(true);
}
}
Expand Down
3 changes: 2 additions & 1 deletion www/app/pages/userlogin.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ public function onsubmit($sender) {
$user = Helper::login($login, $password);

if ($user instanceof User) {
\App\Session::getSession()->clean() ;
$user->lastlogin = time();
$user->save();
System::setUser($user);
Expand All @@ -96,7 +97,7 @@ public function onsubmit($sender) {

setcookie("remember", $user->user_id . '_' . md5($user->user_id . $_config['common']['salt']), time() + 60 * 60 * 24 * 30);
}
//$logger->info('Logined ' . $user->userlogin . ', ' . $_SERVER["REMOTE_ADDR"]);

if ($_config['modules']['shop'] == 1) {
App::Redirect('\App\Pages\Main');
} else {
Expand Down
5 changes: 5 additions & 0 deletions www/app/session.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,9 @@ public static function getSession() {
return $_SESSION['App_session'];
}

public function clean(){
$this->values = array();
$this->filter = array();

}
}
7 changes: 5 additions & 2 deletions www/templates/lang.json
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,9 @@
"custcreated": "Добавлен %s пользователем %s",
"custlastdoc": "Последний документ %s от %s. Всего %s" ,
"noselfprice": "Не расчитана себестоимость готовой продукции %s",
"enterleadsource": "Не введен источник лида",
"enterleadstatus": "Не введено состояние лида"
"enterleadsource": "Не введен источник лида",
"enterleadstatus": "Не введено состояние лида",
"nodefstore": "Укажите в профиле склад по умолчанию",
"nodefmf": "Укажите в профиле кассу по умолчанию",
"nodeffirm": "Укажите в профиле компанию по умолчанию"
}
1 change: 1 addition & 0 deletions www/templates/pages/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -781,6 +781,7 @@ <h6 class="text-center text-white-50">_______________</h6>
{{#toasts}}
$(document).Toasts('create', {
icon: 'fa fa-exclamation-triangle text-warning',
position:'bottomRight',
{{{title}}}

})
Expand Down
2 changes: 1 addition & 1 deletion www/templates/pages/doc/warranty.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ <h3>Гарантийный талон</h3>
<div class="col-6">
<input type="button" value="Отменить" zippy="backtolist" class="btn btn-light ">
<input zippy="savedoc" type="submit" value="Сохранить" class="btn btn-outline-primary ">
&nbsp;<input zippy="execdoc" type="submit" value="Закрить" class="btn btn-outline-info ">
&nbsp;<input zippy="execdoc" type="submit" value="Закрыть" class="btn btn-outline-info ">

</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion www/templates/pages/register/paylist.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ <h3>Журнал платежей </h3>


<br><a zippy="csv">Экспорт в Excel</a>
<br><small>Удаление производится внесением отрицательного значения</small>
<br><small>Отмена и изменение платежа производится путем отмены и перепроведения соответствующего документа</small>
<table class="table table-sm ">
<tr>

Expand Down
6 changes: 5 additions & 1 deletion www/templates_ua/lang.json
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,10 @@
"custlastdoc": "Останнiй документ %s вiд %s. Всього %s",
"noselfprice": "Не розрахована собівартість готової продукції %s",
"enterleadsource": "Не введено джероло лiда",
"enterleadstatus": "Не введений стан лiда"
"enterleadstatus": "Не введений стан лiда",
"nodefstore": "Вкажiть в профiлi склад за замовчанням",
"nodefmf": "Вкажiть в профiлi касу за замовчанням",
"nodeffirm": "Вкажiть в профiлi компанiю за замовчанням"


}
11 changes: 11 additions & 0 deletions www/templates_ua/pages/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -758,6 +758,17 @@ <h6 class="text-center text-white-50">_______________</h6>


<script>
{{#toasts}}
$(document).Toasts('create', {
icon: 'fa fa-exclamation-triangle text-warning',
position:'bottomRight',
{{{title}}}

})

{{/toasts}}


toastr.options = {
"closeButton": true,
"debug": false,
Expand Down
2 changes: 1 addition & 1 deletion www/templates_ua/pages/register/paylist.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ <h3>Журнал платежів </h3>


<br><a zippy="csv">Експорт в Excel</a>
<br><small>Видалення виконуєтся введенням вiд'ємного значення</small>
<br><small>Скасування і зміна платежу проводиться шляхом скасування і перепроведення відповідного документу</small>

<table class="table table-sm ">
<tr>
Expand Down