Skip to content

Commit

Permalink
Ticket #4804 - Credits: Send/Grant forms shouldn't show info from Wit…
Browse files Browse the repository at this point in the history
…hdrawal one.
  • Loading branch information
AntonLV committed Sep 13, 2024
1 parent 81eedac commit c6d004f
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 10 deletions.
1 change: 0 additions & 1 deletion modules/boonex/credits/classes/BxCreditsConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ function __construct($aModule)
'OBJECT_FORM_CREDIT_DISPLAY_GRANT' => 'bx_credits_credit_grant',
'OBJECT_FORM_CREDIT_DISPLAY_SEND' => 'bx_credits_credit_send',
'OBJECT_FORM_CREDIT_DISPLAY_WITHDRAW_REQUEST' => 'bx_credits_credit_withdraw_request',
'OBJECT_FORM_CREDIT_DISPLAY_WITHDRAW_CONFIRM' => 'bx_credits_credit_withdraw_confirm',
'OBJECT_FORM_BUNDLE' => 'bx_credits_bundle',
'OBJECT_FORM_BUNDLE_DISPLAY_ADD' => 'bx_credits_bundle_add',
'OBJECT_FORM_BUNDLE_DISPLAY_EDIT' => 'bx_credits_bundle_edit',
Expand Down
19 changes: 15 additions & 4 deletions modules/boonex/credits/classes/BxCreditsFormCredit.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,21 @@ public function __construct($aInfo, $oTemplate = false)
if(($iUserId = bx_get('user_id')) !== false)
$this->_iUserId = (int)$iUserId;

if(isset($this->aInputs[$CNF['FIELD_C_AMOUNT']])) {
$sInfo = '_bx_credits_form_credit_input_amount_inf_';
switch($this->aParams['display']) {
case $CNF['OBJECT_FORM_CREDIT_DISPLAY_WITHDRAW_REQUEST']:
$sInfo .= 'wr';
break;

default:
$sInfo = '';
}

if($sInfo)
$this->aInputs[$CNF['FIELD_C_AMOUNT']]['info'] = _t($sInfo);
}

if(isset($this->aInputs[$CNF['FIELD_C_MESSAGE']])) {
$sInfo = '_bx_credits_form_credit_input_message_inf_';
switch($this->aParams['display']) {
Expand All @@ -48,10 +63,6 @@ public function __construct($aInfo, $oTemplate = false)
case $CNF['OBJECT_FORM_CREDIT_DISPLAY_WITHDRAW_REQUEST']:
$sInfo .= 'wr';
break;

case $CNF['OBJECT_FORM_CREDIT_DISPLAY_WITHDRAW_CONFIRM']:
$sInfo .= 'wc';
break;
}

$this->aInputs[$CNF['FIELD_C_MESSAGE']]['info'] = _t($sInfo);
Expand Down
3 changes: 1 addition & 2 deletions modules/boonex/credits/install/langs/en.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,13 @@
<string name="_bx_credits_form_credit_input_result"><![CDATA[Result]]></string>
<string name="_bx_credits_form_credit_input_sys_amount"><![CDATA[Amount]]></string>
<string name="_bx_credits_form_credit_input_amount"><![CDATA[Amount]]></string>
<string name="_bx_credits_form_credit_input_amount_inf"><![CDATA[Minimum amount is {wdw_minimum} credits and remaining balance after withdrawal should be {wdw_remaining} credits.]]></string>
<string name="_bx_credits_form_credit_input_amount_inf_wr"><![CDATA[Minimum amount is {wdw_minimum} credits and remaining balance after withdrawal should be {wdw_remaining} credits.]]></string>
<string name="_bx_credits_form_credit_input_amount_err"><![CDATA[This field is essential. Please fill it in.]]></string>
<string name="_bx_credits_form_credit_input_sys_message"><![CDATA[Message]]></string>
<string name="_bx_credits_form_credit_input_message"><![CDATA[Message]]></string>
<string name="_bx_credits_form_credit_input_message_inf_g"><![CDATA[]]></string>
<string name="_bx_credits_form_credit_input_message_inf_s"><![CDATA[Indicate the purpose of sending to reflect it in history for future references]]></string>
<string name="_bx_credits_form_credit_input_message_inf_wr"><![CDATA[Payment instructions and other notes]]></string>
<string name="_bx_credits_form_credit_input_message_inf_wc"><![CDATA[Payment confirmation and other notes]]></string>
<string name="_bx_credits_form_credit_input_profile"><![CDATA[Profile]]></string>
<string name="_bx_credits_form_credit_input_sys_do_submit"><![CDATA[Submit]]></string>
<string name="_bx_credits_form_credit_input_do_submit"><![CDATA[Submit]]></string>
Expand Down
2 changes: 1 addition & 1 deletion modules/boonex/credits/install/sql/install.sql
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ INSERT INTO `sys_form_inputs`(`object`, `module`, `name`, `value`, `values`, `ch
('bx_credits_credit', 'bx_credits', 'cleared', '', '', 0, 'text', '_bx_credits_form_credit_input_sys_cleared', '_bx_credits_form_credit_input_cleared', '_bx_credits_form_credit_input_cleared_inf', 0, 0, 0, 'a:1:{s:8:"disabled";s:8:"disabled";}', '', '', '', '', '', 'Xss', '', 1, 0),
('bx_credits_credit', 'bx_credits', 'rate', '', '', 0, 'text', '_bx_credits_form_credit_input_sys_rate', '_bx_credits_form_credit_input_rate', '', 0, 0, 0, 'a:1:{s:8:"disabled";s:8:"disabled";}', '', '', '', '', '', 'Xss', '', 1, 0),
('bx_credits_credit', 'bx_credits', 'result', '', '', 0, 'text', '_bx_credits_form_credit_input_sys_result', '_bx_credits_form_credit_input_result', '', 0, 0, 0, 'a:1:{s:8:"disabled";s:8:"disabled";}', '', '', '', '', '', 'Xss', '', 1, 0),
('bx_credits_credit', 'bx_credits', 'amount', '', '', 0, 'text', '_bx_credits_form_credit_input_sys_amount', '_bx_credits_form_credit_input_amount', '_bx_credits_form_credit_input_amount_inf', 1, 0, 0, '', '', '', 'Avail', '', '_bx_credits_form_credit_input_amount_err', 'Xss', '', 1, 0),
('bx_credits_credit', 'bx_credits', 'amount', '', '', 0, 'text', '_bx_credits_form_credit_input_sys_amount', '_bx_credits_form_credit_input_amount', '', 1, 0, 0, '', '', '', 'Avail', '', '_bx_credits_form_credit_input_amount_err', 'Xss', '', 1, 0),
('bx_credits_credit', 'bx_credits', 'message', '', '', 0, 'textarea', '_bx_credits_form_credit_input_sys_message', '_bx_credits_form_credit_input_message', '', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 1, 0),
('bx_credits_credit', 'bx_credits', 'profile', '', '', 0, 'custom', '_bx_credits_form_credit_input_sys_profile', '_bx_credits_form_credit_input_profile', '', 1, 0, 0, '', '', '', '', '', '', 'Xss', '', 1, 0),
('bx_credits_credit', 'bx_credits', 'controls', '', 'do_submit,do_cancel', 0, 'input_set', '', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
Expand Down
3 changes: 1 addition & 2 deletions modules/boonex/russian/data/langs/bx_credits/ru.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,13 @@
<string name="_bx_credits_form_credit_input_result"><![CDATA[Результат]]></string>
<string name="_bx_credits_form_credit_input_sys_amount"><![CDATA[Количество]]></string>
<string name="_bx_credits_form_credit_input_amount"><![CDATA[Количество]]></string>
<string name="_bx_credits_form_credit_input_amount_inf"><![CDATA[Минимальная сумма составляет {wdw_minimum} кредитов, а остаток после снятия должен составлять {wdw_remaining} кредитов.]]></string>
<string name="_bx_credits_form_credit_input_amount_inf_wr"><![CDATA[Минимальная сумма составляет {wdw_minimum} кредитов, а остаток после снятия должен составлять {wdw_remaining} кредитов.]]></string>
<string name="_bx_credits_form_credit_input_amount_err"><![CDATA[Это поле обязательно. Пожалуйста, заполните его.]]></string>
<string name="_bx_credits_form_credit_input_sys_message"><![CDATA[Сообщение]]></string>
<string name="_bx_credits_form_credit_input_message"><![CDATA[Сообщение]]></string>
<string name="_bx_credits_form_credit_input_message_inf_g"><![CDATA[]]></string>
<string name="_bx_credits_form_credit_input_message_inf_s"><![CDATA[Укажите цель отправки, чтобы отразить её в истории для дальнейшего использования]]></string>
<string name="_bx_credits_form_credit_input_message_inf_wr"><![CDATA[Платежные инструкции и другие примечания]]></string>
<string name="_bx_credits_form_credit_input_message_inf_wc"><![CDATA[Подтверждение оплаты и другие примечания]]></string>
<string name="_bx_credits_form_credit_input_profile"><![CDATA[Профиль]]></string>
<string name="_bx_credits_form_credit_input_sys_do_submit"><![CDATA[Выполнить]]></string>
<string name="_bx_credits_form_credit_input_do_submit"><![CDATA[Выполнить]]></string>
Expand Down

0 comments on commit c6d004f

Please sign in to comment.