From 95785743c93591033d0e76900f6ffdb45981d2f5 Mon Sep 17 00:00:00 2001 From: "leon.mbs@gmail.com" Date: Sun, 10 Nov 2024 12:46:51 +0200 Subject: [PATCH 01/11] =?UTF-8?q?fix=20=20=D0=B7=D0=B0=D1=80=D0=BF=D0=BB?= =?UTF-8?q?=D0=B0=D1=82=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- www/app/entity/item.php | 19 +++++-- www/app/pages/doc/calcsalary.php | 50 +++++++++++++++++-- www/app/pages/register/salarylist.php | 4 +- .../pages/reference/salarytypelist.html | 10 +++- www/templates/pages/register/salarylist.html | 14 +----- www/templates/pages/timesheet.html | 15 +++++- 6 files changed, 86 insertions(+), 26 deletions(-) diff --git a/www/app/entity/item.php b/www/app/entity/item.php index 79441f7fa..12aa5df59 100644 --- a/www/app/entity/item.php +++ b/www/app/entity/item.php @@ -868,6 +868,7 @@ public function getID() { * @param mixed $item_id */ public static function packStBC($price,$qty,$item_id) { + /* $common = \App\System::getOptions("common"); if($common['amdigits'] == 1) { @@ -886,8 +887,13 @@ public static function packStBC($price,$qty,$item_id) { //убираем нули $price= intval($price) ; $qty= intval($qty) ; + */ + $price=doubleval(\App\Helper::fa($price)); + $qty=doubleval(\App\Helper::fqty($qty)); + + - $barcode = strlen($price) . $price .strlen($qty) . $qty . $item_id; + $barcode = "".$price.'-'.$qty. '-' . $item_id; return $barcode; } @@ -898,18 +904,21 @@ public static function packStBC($price,$qty,$item_id) { * @param mixed $barcode */ public static function unpackStBC($barcode) { - $common = \App\System::getOptions("common"); + /* $common = \App\System::getOptions("common"); $lprice= substr($barcode,0,1); $price= substr($barcode,1,$lprice); $lqty= substr($barcode,$lprice+1,1); $qty= substr($barcode,$lprice+2,$lqty); $id= substr($barcode,$lprice+2+$lqty); + */ + + $s=explode('-',$barcode) ; - $item= Item::load(trim($id)); + $item= Item::load(trim($s[2])); if($item != null) { - $item->price = \App\Helper::fa($price); - $item->quantity =\App\Helper::fqty($qty); + $item->price = \App\Helper::fa($s[0]); + $item->quantity =\App\Helper::fqty($s[1]); } return $item; diff --git a/www/app/pages/doc/calcsalary.php b/www/app/pages/doc/calcsalary.php index 99f35c1ff..983cfb5f0 100644 --- a/www/app/pages/doc/calcsalary.php +++ b/www/app/pages/doc/calcsalary.php @@ -8,6 +8,7 @@ use App\Entity\MoneyFund; use App\Entity\SalType; use App\Entity\EmpAcc; +use App\Entity\TimeItem; use App\Helper as H; use App\System; @@ -70,6 +71,14 @@ public function __construct($docid = 0) { $calcvar .= "var salaryh = fa(emp.salaryh) \n" ; $calcvar .= "var hours = fa(emp.hours) \n" ; $calcvar .= "var days = fa(emp.days) \n" ; + $calcvar .= "var hours_week = fa(emp.hours_week) \n" ; + $calcvar .= "var hours_over = fa(emp.hours_over) \n" ; + $calcvar .= "var days_week = fa(emp.days_week) \n" ; + $calcvar .= "var days_vac = fa(emp.days_vac) \n" ; + $calcvar .= "var days_sick = fa(emp.days_sick) \n" ; + $calcvar .= "var days_bt = fa(emp.days_bt) \n" ; + + // из строки сотрудника в переменные foreach($this->_stlist as $st) { @@ -296,12 +305,45 @@ public function loaddata($args, $post) { $e['sellvalue'] = doubleval($emp->sellvalue) ; } - $sql="select sum(tm) as tm, count(distinct dd) as dd from (select date(t_start) as dd, (UNIX_TIMESTAMP(t_end)-UNIX_TIMESTAMP(t_start) - t_break*60) as tm from timesheet where t_type=1 and emp_id = {$emp->employee_id} and date(t_start)>=date({$from}) and date( t_start)<= date( {$to} ) ) t "; + + $e['hours'] =0; + $e['hours_week'] =0; + $e['hours_over'] =0; + $e['days'] =0; + $e['days_week'] =0; + $e['days_vac'] =0; + $e['days_sick'] =0; + $e['days_bt'] =0; + + $sql="select sum(tm) as tm, count(distinct dd) as dd,t_type from (select date(t_start) as dd, (UNIX_TIMESTAMP(t_end)-UNIX_TIMESTAMP(t_start) - t_break*60) as tm,t_type from timesheet where emp_id = {$emp->employee_id} and date(t_start)>=date({$from}) and date( t_start)<= date( {$to} ) ) t group by t_type "; - $t = $conn->GetRow($sql); - $e['hours'] = intval($t['tm']/3600); - $e['days'] = doubleval($t['dd']); + $rs = $conn->Execute($sql); + foreach($rs as $row) { + if($row['t_type']==TimeItem::TIME_WORK ) { + $e['hours'] += intval($row['tm']/3600); + $e['days'] += doubleval($row['dd']); + } + if($row['t_type']==TimeItem::TINE_WN ) { + $e['hours_week'] += intval($row['tm']/3600); + $e['days_week'] += doubleval($row['dd']); + } + if($row['t_type']==TimeItem::TINE_OVER ) { + $e['hours_over'] += intval($row['tm']/3600); + + } + if($row['t_type']==TimeItem::TINE_HL ) { + $e['days_vac'] += doubleval($row['dd']); + } + if($row['t_type']==TimeItem::TINE_ILL ) { + $e['days_sick'] += doubleval($row['dd']); + } + if($row['t_type']==TimeItem::TINE_BT ) { + $e['days_bt'] += doubleval($row['dd']); + } + } + + $e['invalid'] = $emp->invalid == 1 ; $e['salarytype'] = $emp->ztype ; diff --git a/www/app/pages/register/salarylist.php b/www/app/pages/register/salarylist.php index 4df50fcd3..ace5ee067 100644 --- a/www/app/pages/register/salarylist.php +++ b/www/app/pages/register/salarylist.php @@ -7,7 +7,7 @@ use App\Helper as H; use App\System; use Zippy\Html\DataList\DataView; -use Zippy\Html\DataList\Paginator; +use Zippy\Html\DataList\Pager; use Zippy\Html\Form\Date; use Zippy\Html\Form\DropDownChoice; use Zippy\Html\Form\Form; @@ -41,7 +41,7 @@ public function __construct() { $doclist = $this->add(new DataView('doclist', new SalListDataSource($this), $this, 'doclistOnRow')); - $this->add(new Paginator('pag', $doclist)); + $this->add(new Pager('pag', $doclist)); $doclist->setPageSize(H::getPG()); $this->add(new Panel("statuspan"))->setVisible(false); diff --git a/www/templates/pages/reference/salarytypelist.html b/www/templates/pages/reference/salarytypelist.html index 300f81169..ec96c5738 100644 --- a/www/templates/pages/reference/salarytypelist.html +++ b/www/templates/pages/reference/salarytypelist.html @@ -111,8 +111,14 @@
Коди контексту
salarym - оклад
salaryh - погодинна сума
sellvalue - виручка по продажних документах співробітника
- hours - години з облiку часу
- days - днi з облiку часу
+ hours - робочi години з облiку часу
+ days - робочi днi з облiку часу
+ hours_over - переробка
+ hours_week - години в вихiднi
+ days_week - днi в вихiднi
+ days_vac - днi вiдпустки
+ days_sick - лiкарнянi днi
+ days_bt - днi в вiдрядженнi
diff --git a/www/templates/pages/register/salarylist.html b/www/templates/pages/register/salarylist.html index cbd213a48..d89d44677 100644 --- a/www/templates/pages/register/salarylist.html +++ b/www/templates/pages/register/salarylist.html @@ -13,13 +13,8 @@

Журнал зарплат

- @@ -270,6 +270,19 @@

Новий запис

this.editbreak = this.break; $('#editmodal').modal('show') + } , + ontype:function(){ + + this.edited = 0; + if(this.edittype == 1 || this.edittype == 3 ){ + this.editbreak = this.break; + } else { + this.editbreak=0 + } + + + + } , save:function(i){ From a832f01ddb08270b59339bbfa1c5c5b743b61717 Mon Sep 17 00:00:00 2001 From: "leon.mbs@gmail.com" Date: Sun, 10 Nov 2024 20:18:34 +0200 Subject: [PATCH 02/11] fix --- www/app/entity/crontask.php | 2 +- www/app/entity/item.php | 33 +++------------------------- www/app/pages/jobs.php | 1 + www/templates/404.html | 3 +-- www/templates/pages/userprofile.html | 8 +++---- 5 files changed, 10 insertions(+), 37 deletions(-) diff --git a/www/app/entity/crontask.php b/www/app/entity/crontask.php index fb65203d0..6fce222d1 100644 --- a/www/app/entity/crontask.php +++ b/www/app/entity/crontask.php @@ -102,7 +102,7 @@ public static function do(): void { \App\Helper::setKeyVal('lastcronm', time()) ; //очищаем статистику - $dt = $conn->DBDate(strtotime('-1 month', time())) ; + $dt = $conn->DBDate(strtotime('-12 month', time())) ; $conn->Execute("delete from stats where category in (1,2,3,5,6) and dt < ". $dt) ; $conn->Execute(" OPTIMIZE TABLE stats " ) ; diff --git a/www/app/entity/item.php b/www/app/entity/item.php index 12aa5df59..ce22613b6 100644 --- a/www/app/entity/item.php +++ b/www/app/entity/item.php @@ -868,31 +868,10 @@ public function getID() { * @param mixed $item_id */ public static function packStBC($price,$qty,$item_id) { - /* - $common = \App\System::getOptions("common"); - - if($common['amdigits'] == 1) { - $price= $price *100 ; - } - - if($common['qtydigits'] ==1) { - $qty= $qty *10; - } - if($common['qtydigits'] ==2) { - $qty= $qty *100; - } - if($common['qtydigits'] ==3) { - $qty= $qty *1000 ; - } - //убираем нули - $price= intval($price) ; - $qty= intval($qty) ; - */ + $price=doubleval(\App\Helper::fa($price)); $qty=doubleval(\App\Helper::fqty($qty)); - - - + $barcode = "".$price.'-'.$qty. '-' . $item_id; return $barcode; @@ -904,13 +883,7 @@ public static function packStBC($price,$qty,$item_id) { * @param mixed $barcode */ public static function unpackStBC($barcode) { - /* $common = \App\System::getOptions("common"); - $lprice= substr($barcode,0,1); - $price= substr($barcode,1,$lprice); - $lqty= substr($barcode,$lprice+1,1); - $qty= substr($barcode,$lprice+2,$lqty); - $id= substr($barcode,$lprice+2+$lqty); - */ + $s=explode('-',$barcode) ; diff --git a/www/app/pages/jobs.php b/www/app/pages/jobs.php index 0cd46c452..21dfb1ea5 100644 --- a/www/app/pages/jobs.php +++ b/www/app/pages/jobs.php @@ -109,6 +109,7 @@ public function OnRow($row) { $row->stwait->setVisible(false); $row->sttoday->setVisible(false); $row->stpast->setVisible(false); + $row->done->setVisible(false); } diff --git a/www/templates/404.html b/www/templates/404.html index f5668f805..c9ffa7db9 100644 --- a/www/templates/404.html +++ b/www/templates/404.html @@ -7,8 +7,7 @@ - - + diff --git a/www/templates/pages/userprofile.html b/www/templates/pages/userprofile.html index 14304d5a1..e55063d6f 100644 --- a/www/templates/pages/userprofile.html +++ b/www/templates/pages/userprofile.html @@ -160,7 +160,7 @@

Принтер чеків

- Кодування, виставлене в принтері + Кодування, виставлене в принтері
@@ -181,7 +181,7 @@

Принтер етикеток

- Опис тут + Опис тут @@ -200,12 +200,12 @@

Принтер етикеток

- Кодування, виставлене в принтері + Кодування, виставлене в принтері
- From ee7bc97175493462d45d3c9235112ba939144bd4 Mon Sep 17 00:00:00 2001 From: "leon.mbs@gmail.com" Date: Mon, 11 Nov 2024 17:27:41 +0200 Subject: [PATCH 03/11] save --- www/app/pages/reference/itemlist.php | 23 ++++++++++++++- www/templates/pages/reference/eqlist.html | 5 ++-- www/templates/pages/reference/itemlist.html | 31 +++++++++++++++++++-- 3 files changed, 53 insertions(+), 6 deletions(-) diff --git a/www/app/pages/reference/itemlist.php b/www/app/pages/reference/itemlist.php index 93ec0d95c..3bfd81c18 100644 --- a/www/app/pages/reference/itemlist.php +++ b/www/app/pages/reference/itemlist.php @@ -55,6 +55,7 @@ public function __construct($add = false) { $this->add(new Panel('itemtable'))->setVisible(true); $this->itemtable->add(new ClickLink('addnew'))->onClick($this, 'addOnClick'); + $this->itemtable->add(new ClickLink('customlist'))->onClick($this, 'cfOnClick'); $this->itemtable->add(new Form('listform')); @@ -72,6 +73,7 @@ public function __construct($add = false) { $this->itemtable->add(new \Zippy\Html\Link\LinkList("taglist"))->onClick($this, 'OnTagList'); + $this->add(new Form('itemdetail'))->setVisible(false); $this->itemdetail->add(new TextInput('editname')); $this->itemdetail->add(new TextInput('editshortname')); @@ -173,6 +175,11 @@ public function __construct($add = false) { $this->setpanel->add(new Label('stotal')); $this->setpanel->add(new ClickLink('backtolist', $this, "onback")); + + $this->add(new Form('customform'))->setVisible(false); + $this->customform->add(new SubmitButton('savec'))->onClick($this, 'savec'); + $this->customform->add(new Button('cancelc'))->onClick($this, 'cancelOnClick'); + $this->_tvars['hp1'] = strlen($common['price1']) > 0 ? $common['price1'] : false; $this->_tvars['hp2'] = strlen($common['price2']) > 0 ? $common['price2'] : false; $this->_tvars['hp3'] = strlen($common['price3']) > 0 ? $common['price3'] : false; @@ -365,6 +372,7 @@ public function addOnClick($sender) { public function cancelOnClick($sender) { $this->itemtable->setVisible(true); $this->itemdetail->setVisible(false); + $this->customform->setVisible(false); } public function OnFilter($sender) { @@ -1106,6 +1114,8 @@ public function printStOnClick($sender) { } + + public function getSticker($args, $post) { $printer = \App\System::getOptions('printer') ; $user = \App\System::getUser() ; @@ -1199,7 +1209,18 @@ public function getSticker($args, $post) { } } - + + public function cfOnClick($sender) { + $this->itemtable->setVisible(false); + $this->customform->setVisible(true); + } + public function savec($sender) { + + + $this->itemtable->setVisible(true); + $this->customform->setVisible(false); + } + } class ItemDataSource implements \Zippy\Interfaces\DataSource diff --git a/www/templates/pages/reference/eqlist.html b/www/templates/pages/reference/eqlist.html index 4f0cbbe26..796ad0943 100644 --- a/www/templates/pages/reference/eqlist.html +++ b/www/templates/pages/reference/eqlist.html @@ -97,7 +97,8 @@

- +
+

Редагування

@@ -191,7 +192,7 @@

Редагування

- + From a382c98f78a19c897d0453e0c6e248af717c511e Mon Sep 17 00:00:00 2001 From: "leon.mbs@gmail.com" Date: Mon, 11 Nov 2024 20:47:35 +0200 Subject: [PATCH 05/11] save --- www/app/pages/doc/goodsissue.php | 29 ++++++++++++++------- www/app/pages/reference/itemlist.php | 20 ++++++++++---- www/templates/pages/reference/itemlist.html | 11 +++++--- 3 files changed, 42 insertions(+), 18 deletions(-) diff --git a/www/app/pages/doc/goodsissue.php b/www/app/pages/doc/goodsissue.php index 632a24635..c6a99a239 100644 --- a/www/app/pages/doc/goodsissue.php +++ b/www/app/pages/doc/goodsissue.php @@ -443,18 +443,29 @@ public function addcodeOnClick($sender) { $st = array_pop($st) ; $item = Item::load($st->item_id); - } - if ($item == null) { - $this->setWarn("Товар з кодом `{$code}` не знайдено"); - return; - } else { + } + if ($item != null) { $item->snumber = $code; - - } } - - + // проверка на стикер + if ($item == null) { + + $item = Item::unpackStBC($barcode); + $item->pureprice = $item->getPurePrice(); + $this->_itemlist[ ] = $item; + $this->_rownumber = 1; + + $this->docform->detail->Reload(); + $this->calcTotal(); + $this->calcPay(); + return; + } + if ($item == null) { + $this->setWarn("Товар з кодом `{$code}` не знайдено"); + return; + } + $qty = $item->getQuantity($store_id); if ($qty <= 0) { diff --git a/www/app/pages/reference/itemlist.php b/www/app/pages/reference/itemlist.php index 436e5f9ca..dd8f31ba0 100644 --- a/www/app/pages/reference/itemlist.php +++ b/www/app/pages/reference/itemlist.php @@ -39,6 +39,13 @@ public function __construct($add = false) { return; } + $options = System::getOptions('common'); + $this->_cflist = $options['cflist']; + if (is_array($this->_cflist) == false) { + $this->_cflist = []; + } + + $this->add(new Form('filter'))->onSubmit($this, 'OnFilter'); $this->filter->add(new TextInput('searchbrand')); @@ -240,6 +247,7 @@ public function itemlistOnRow(\Zippy\Html\DataList\DataRow $row) { $row->shownotes->setVisible(strlen($item->description ?? '') > 0); + $row->add(new ClickLink('cfedit',$this, 'cfeditOnClick'))->setVisible(count($this->_cflist)>0); $row->add(new ClickLink('copy'))->onClick($this, 'copyOnClick'); $row->add(new ClickLink('edit'))->onClick($this, 'editOnClick'); @@ -1215,11 +1223,6 @@ public function getSticker($args, $post) { public function cfOnClick($sender) { - $options = System::getOptions('common'); - $this->_cflist = $options['cflist']; - if (is_array($this->_cflist) == false) { - $this->_cflist = []; - } $this->customform->cflist->Reload(); $this->itemtable->setVisible(false); $this->customform->setVisible(true); @@ -1247,6 +1250,8 @@ public function onDelCF($sender) { $this->_cflist = array_diff_key($this->_cflist, array($item->id => $this->_cflist[$item->id])); $this->customform->cflist->Reload(); + + } public function savec($sender) { $options = System::getOptions('common'); @@ -1255,7 +1260,12 @@ public function savec($sender) { $this->itemtable->setVisible(true); $this->customform->setVisible(false); + $this->Reload(); + } + public function cfeditOnClick($sender) { + + } } diff --git a/www/templates/pages/reference/itemlist.html b/www/templates/pages/reference/itemlist.html index 0b2467e47..68e19c6fb 100644 --- a/www/templates/pages/reference/itemlist.html +++ b/www/templates/pages/reference/itemlist.html @@ -99,7 +99,7 @@

Довідник номенклатури @@ -135,6 +135,7 @@

Довідник номенклатури + @@ -178,12 +179,14 @@

Довідник номенклатури + +   + -     - +   - + From be3df2dc8c904165b3ec7feec788341066f2e50f Mon Sep 17 00:00:00 2001 From: "leon.mbs@gmail.com" Date: Tue, 12 Nov 2024 14:39:36 +0200 Subject: [PATCH 06/11] =?UTF-8?q?=D0=BF=D0=BE=D0=B4=D0=BF=D0=B8=D1=81?= =?UTF-8?q?=D0=BA=D0=B0=20=20=D0=BF=D0=BE=20=20chat=20id?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- www/app/entity/subscribe.php | 30 +++++++++++++++++---- www/app/pages/reference/itemlist.php | 26 ++++++++++++++++-- www/app/pages/subscribes.php | 4 +++ www/templates/pages/reference/itemlist.html | 26 ++++++++++++++++-- www/templates/pages/subscribes.html | 8 ++++++ 5 files changed, 85 insertions(+), 9 deletions(-) diff --git a/www/app/entity/subscribe.php b/www/app/entity/subscribe.php index 1b96343ca..a6e689e6c 100644 --- a/www/app/entity/subscribe.php +++ b/www/app/entity/subscribe.php @@ -31,6 +31,7 @@ class Subscribe extends \ZCL\DB\Entity public const RSV_WH = 4; public const RSV_SYSTEM = 5; public const RSV_DOCRESP = 6; + public const RSV_TG = 7; protected function init() { $this->sub_id = 0; @@ -47,6 +48,7 @@ protected function afterLoad() { $this->doctypename = (string)($xml->doctypename[0]); $this->msgsubject = (string)($xml->msgsubject[0]); $this->url = (string)($xml->url[0]); + $this->chat_id = (string)($xml->chat_id[0]); $this->username = (string)($xml->username[0]); $this->user_id = (int)($xml->user_id[0]); $this->state = (int)($xml->state[0]); @@ -75,6 +77,7 @@ protected function beforeSave() { $this->detail .= "{$this->username}"; $this->detail .= "{$this->msgsubject}"; $this->detail .= "{$this->url}"; + $this->detail .= "{$this->chat_id}"; $this->detail .= ""; @@ -108,8 +111,9 @@ public static function getMsgTypeList($rt=0) { } if(strlen(\App\System::getOption("common", 'tbtoken'))>0) { - $list[self::MSG_BOT] = "Телеграм бот"; + $list[self::MSG_BOT] = "Телеграм"; } + if($rt==self::RSV_CUSTOMER) { unset($list[self::MSG_NOTIFY]) ; @@ -121,6 +125,15 @@ public static function getMsgTypeList($rt=0) { unset($list[self::MSG_BOT]) ; unset($list[self::MSG_SMS]) ; } + + if($rt==self::RSV_TG ) { + unset($list[self::MSG_EMAIL]) ; + unset($list[self::MSG_VIBER]) ; + + unset($list[self::MSG_SMS]) ; + unset($list[self::MSG_NOTIFY]) ; + } + return $list; @@ -139,6 +152,7 @@ public static function getRecieverList($et=0) { $list[self::RSV_SYSTEM] = "Системний лог"; $list[self::RSV_USER] = "Користувач системи"; $list[self::RSV_WH] = "Web Hook"; + $list[self::RSV_TG] = "Телеграм"; return $list; } @@ -183,9 +197,7 @@ public static function onDocumentState($doc_id, $state) { } } - if($c==null && $u== null){ - continue; - } + if ($c != null ) { $options['phone'] = $c->phone; @@ -201,6 +213,9 @@ public static function onDocumentState($doc_id, $state) { $options['chat_id'] = $u->chat_id; $options['notifyuser'] = $u->user_id; } + if ($sub->reciever_type == self::RSV_TG) { + $options['chat_id'] = $sub->chat_id;; + } $options['doc'] = $doc; @@ -250,7 +265,10 @@ public static function onNewCustomer($customer_id) { $options['chat_id'] = $u->chat_id; $options['notifyuser'] = $u->user_id; } -// $options['c'] = $c; +// + if ($sub->reciever_type == self::RSV_TG) { + $options['chat_id'] = $sub->chat_id;; + } $text = $sub->getTextCust($c); @@ -303,6 +321,7 @@ private function sendmsg($text, $options=[]){ if(strlen($options['chat_id'])>0 && $this->msg_type == self::MSG_BOT) { $ret = self::sendBot($options['chat_id'], $text, $this->attach==1 ? $options['doc'] : null,$this->html==1) ; } + if($this->reciever_type == self::RSV_WH) { $ret = self::sendHook($this->url, $text) ; } @@ -819,3 +838,4 @@ public static function sendHook($url, $text) { } } +////217130115 \ No newline at end of file diff --git a/www/app/pages/reference/itemlist.php b/www/app/pages/reference/itemlist.php index dd8f31ba0..f70236a54 100644 --- a/www/app/pages/reference/itemlist.php +++ b/www/app/pages/reference/itemlist.php @@ -32,6 +32,7 @@ class ItemList extends \App\Pages\Base public $_serviceset = array(); public $_tag = '' ; public $_cflist = array(); + public $_cflistv = array(); public function __construct($add = false) { parent::__construct(); @@ -191,6 +192,12 @@ public function __construct($add = false) { $this->customform->add(new DataView('cflist', new ArrayDataSource(new Bind($this, '_cflist')), $this, 'cfOnRow')); $this->customform->add(new SubmitLink('addnewcf'))->onClick($this, 'OnAddCF'); + $this->add(new Form('customformv'))->setVisible(false); + $this->customformv->add(new SubmitButton('savecv'))->onClick($this, 'savec'); + $this->customformv->add(new Button('cancelcv'))->onClick($this, 'cancelOnClick'); + $this->customformv->add(new TextInput('cflistvitem')) ; + $this->customform->add(new DataView('cflistv', new ArrayDataSource(new Bind($this, '_cflistv')), $this, 'cfvOnRow')); + $this->_tvars['hp1'] = strlen($common['price1']) > 0 ? $common['price1'] : false; $this->_tvars['hp2'] = strlen($common['price2']) > 0 ? $common['price2'] : false; $this->_tvars['hp3'] = strlen($common['price3']) > 0 ? $common['price3'] : false; @@ -385,6 +392,7 @@ public function cancelOnClick($sender) { $this->itemtable->setVisible(true); $this->itemdetail->setVisible(false); $this->customform->setVisible(false); + $this->customformv->setVisible(false); } public function OnFilter($sender) { @@ -1237,7 +1245,7 @@ public function OnAddCF($sender) { $this->customform->cflist->Reload(); } - public function cfOnRow($row) { + public function cfOnRow($row) { $item = $row->getDataItem(); $row->add(new TextInput('cfcode', new Bind($item, 'code'))); $row->add(new TextInput('cfname', new Bind($item, 'name'))); @@ -1253,6 +1261,7 @@ public function onDelCF($sender) { } + public function savec($sender) { $options = System::getOptions('common'); $options['cflist'] = $this->_cflist; @@ -1264,9 +1273,22 @@ public function savec($sender) { } public function cfeditOnClick($sender) { + $item = $sender->getOwner()->getDataItem(); + $this->customformv->cflistvitem->setText($item->item_id); + + + $this->itemtable->setVisible(false); + $this->customformv->setVisible(true); } - + public function savecv($sender) { + + } + public function cfvOnRow($row) { + + } + + } class ItemDataSource implements \Zippy\Interfaces\DataSource diff --git a/www/app/pages/subscribes.php b/www/app/pages/subscribes.php index 7d3aae996..fa6b1b6d8 100644 --- a/www/app/pages/subscribes.php +++ b/www/app/pages/subscribes.php @@ -43,6 +43,7 @@ public function __construct() { $this->editform->add(new TextArea('editmsgtext')); $this->editform->add(new TextInput('editmsgsubject')); $this->editform->add(new TextInput('editurl')); + $this->editform->add(new TextInput('editchatid')); $this->editform->add(new DropDownChoice('editeventtype', Subscribe::getEventList(), Subscribe::EVENT_DOCSTATE))->onChange($this, 'update'); $this->editform->add(new DropDownChoice('editdoctype', H::getDocTypes(), 0)); @@ -97,6 +98,7 @@ public function update($sender) { $this->editform->edituser->setVisible($rt==Subscribe::RSV_USER); $this->editform->editurl->setVisible($rt == Subscribe::RSV_WH); + $this->editform->editchatid->setVisible($rt == Subscribe::RSV_TG); return; @@ -174,6 +176,7 @@ public function OnEdit($sender) { $this->editform->editmsgtext->setText($this->_sub->msgtext); $this->editform->editmsgsubject->setText($this->_sub->msgsubject); $this->editform->editurl->setText($this->_sub->url); + $this->editform->editchatid->setText($this->_sub->chat_id); $this->editform->editdisabled->setCheCked($this->_sub->disabled); $this->editform->editattach->setCheCked($this->_sub->attach); $this->editform->edithtml->setCheCked($this->_sub->html); @@ -204,6 +207,7 @@ public function OnSave($sender) { $this->_sub->msgtext = trim($this->editform->editmsgtext->getText()); $this->_sub->msgsubject = trim($this->editform->editmsgsubject->getText()); $this->_sub->url = trim($this->editform->editurl->getText()); + $this->_sub->chat_id = trim($this->editform->editchatid->getText()); $this->_sub->disabled = $this->editform->editdisabled->isCheCked() ? 1 : 0; $this->_sub->html = $this->editform->edithtml->isCheCked() ? 1 : 0; diff --git a/www/templates/pages/reference/itemlist.html b/www/templates/pages/reference/itemlist.html index 68e19c6fb..ef9cf0b7f 100644 --- a/www/templates/pages/reference/itemlist.html +++ b/www/templates/pages/reference/itemlist.html @@ -99,7 +99,7 @@

Довідник номенклатури @@ -626,7 +626,29 @@

Кастомнi поля

- +
+ +
+

Значення кастомних полiв

+ + + + + + + + + + +
+
+ + + +
+
+
+