Skip to content

Commit

Permalink
0.5.5 rev 3570
Browse files Browse the repository at this point in the history
  • Loading branch information
nightflyza committed Jun 24, 2014
1 parent 25c8d7b commit 065cb0f
Show file tree
Hide file tree
Showing 12 changed files with 78 additions and 9 deletions.
2 changes: 1 addition & 1 deletion RELEASE
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.5.5 rev 3564
0.5.5 rev 3570
14 changes: 13 additions & 1 deletion api/libs/api.userreg.php
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,18 @@ function zb_RegPasswordProposal() {
return ($password);
}

function zb_CheckLoginRscriptdCompat($login) {
$maxLen=31;
if (strlen($login)>=$maxLen) {
$alert=__('Attention generated login longer than').' '.$maxLen.' '.__('bytes').'. '.__('This can lead to the inability to manage this user on remote NAS running rscriptd').'. ';
$alert.= __('Perhaps you need to shorten the alias, or use a different model for the generation of logins').'.';
$result= wf_modalOpened(__('Warning'), $alert, '500', '200');
} else {
$result='';
}
return ($result);
}

function web_UserRegFormNetData($newuser_data) {
$alterconf=rcms_parse_ini_file(CONFIG_PATH."alter.ini");
$safe_mode=$alterconf['SAFE_REGMODE'];
Expand Down Expand Up @@ -374,7 +386,7 @@ function web_UserRegFormNetData($newuser_data) {
<input type="text" name="login" value="'.$login_proposal.'" '.$modifier.'>
</td>
<td>
'.__('Login').'
'.__('Login').' '.zb_CheckLoginRscriptdCompat($login_proposal).'
</td>
</tr>
<tr class="row3">
Expand Down
14 changes: 14 additions & 0 deletions api/libs/api.workaround.php
Original file line number Diff line number Diff line change
Expand Up @@ -1668,6 +1668,12 @@ function web_PaymentsShow($query) {
$allcontracts= zb_UserGetAllContracts();
$allcontracts= array_flip($allcontracts);
}

//getting all users tariffs
if ($alter_conf['FINREP_TARIFF']) {
$alltariffs= zb_TariffsGetAllUsers();
}

$total=0;
$totalPaycount=0;

Expand All @@ -1682,6 +1688,10 @@ function web_PaymentsShow($query) {
$cells.= wf_TableCell(__('Login'));
$cells.= wf_TableCell(__('Full address'));
$cells.= wf_TableCell(__('Real Name'));
//optional tariff display
if ($alter_conf['FINREP_TARIFF']) {
$cells.=wf_TableCell(__('Tariff'));
}
$cells.= wf_TableCell(__('Cash type'));
$cells.= wf_TableCell(__('Notes'));
$cells.= wf_TableCell(__('Admin'));
Expand All @@ -1705,6 +1715,10 @@ function web_PaymentsShow($query) {
$cells.= wf_TableCell(wf_Link('?module=userprofile&username='.$eachpayment['login'], (web_profile_icon().' '.$eachpayment['login']), false, ''));
$cells.= wf_TableCell(@$alladrs[$eachpayment['login']]);
$cells.= wf_TableCell(@$allrealnames[$eachpayment['login']]);
//optional tariff display
if ($alter_conf['FINREP_TARIFF']) {
$cells.= wf_TableCell(@$alltariffs[$eachpayment['login']]);
}
$cells.= wf_TableCell(@__($alltypes[$eachpayment['cashtypeid']]));
$cells.= wf_TableCell($eachpayment['note']);
$cells.= wf_TableCell($eachpayment['admin']);
Expand Down
6 changes: 4 additions & 2 deletions config/alter.ini
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,8 @@ AUTO_LOGOUT_IDLE=0
;administrator logins for exclude of idle auto logout. comma separated.
AUTO_LOGOUT_EXCLUDE=""
; Is VOLS module enabled?
VOLS_ENABLED = 1
VOLS_ENABLED = 0
; is corporate users management enabled?
CORPS_ENABLED=1
CORPS_ENABLED=0
;finance report and payment search show tariff column
FINREP_TARIFF=0
1 change: 1 addition & 0 deletions config/optsaltcfg
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ UBIM_REFRESH=VARCHAR|Instant messenger refresh timeout in seconds
DEVCON_SQL_KEEP=TRIGGER|Query remains in SQL console after exec
DEVCON_VERBOSE_DEBUG=TRIGGER|Verbose debug data in developers console
FINREP_CONTRACT=TRIGGER|Show users contract in finance report
FINREP_TARIFF=TRIGGER|Show tariff column in finance report
SIGREP_CONTRACT=TRIGGER|Show users contract in signup report
TARIFFCHGAUTOCREDIT=TRIGGER|Automatically set the credit limit when you change the tariff
MIKROTIK_SUPPORT=TRIGGER|MikroTik extended support enabled
Expand Down
7 changes: 6 additions & 1 deletion languages/russian/billing.php
Original file line number Diff line number Diff line change
Expand Up @@ -1701,6 +1701,11 @@
$lang['def']['No existing tax types']='Нету существующих типов налогообложения';
$lang['def']['Corporate users management enabled']='Управление юр. лицами влючено';
$lang['def']['right to manage corps users']='Право управлять юридическими лицами';

$lang['def']['Show tariff column in finance report']='Показывать колонку тарифа в фин. отчете';
$lang['def']['bytes']='байт';
$lang['def']['Attention generated login longer than']='Внимание, сгенерированный логин длиннее';
$lang['def']['This can lead to the inability to manage this user on remote NAS running rscriptd']='Это может привести к невозможности управлять этим пользователем на удаленных NAS под управлением rscriptd';
$lang['def']['Warning']='Предупреждение';
$lang['def']['Perhaps you need to shorten the alias, or use a different model for the generation of logins']='Возможно вам стоит укоротить алиасы, либо использовать другую модель генерации логинов';

?>
6 changes: 6 additions & 0 deletions languages/ukrainian/billing.php
Original file line number Diff line number Diff line change
Expand Up @@ -1714,6 +1714,12 @@
$lang['def']['No existing tax types']='Немає існуючих типів оподаткування';
$lang['def']['Corporate users management enabled']='Керування юр. особами увімкнено';
$lang['def']['right to manage corps users']='Право керувати юридичними особами';
$lang['def']['Show tariff column in finance report']='Відображати тариф у фінзвіті';
$lang['def']['bytes']='байт';
$lang['def']['Attention generated login longer than']='Увага, згенерований логін довший за';
$lang['def']['This can lead to the inability to manage this user on remote NAS running rscriptd']='Це може призвести, до неможливості керувати віддаленими NAS під управлінням rscriptd';
$lang['def']['Warning']='Попередження';
$lang['def']['Perhaps you need to shorten the alias, or use a different model for the generation of logins']='Можливо вам варто скоротити аліаси або ж використовувати іншу модель генерації логінів';


?>
4 changes: 3 additions & 1 deletion modules/general/openpayz/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ function web_OPDoSearch($year,$month,$paysys) {
$alladdress= zb_AddressGetFulladdresslistCached();
$csvdata='';
$totalsumm=0;
$totalcount=0;
$query="SELECT * from `op_transactions` WHERE `date` LIKE '".$year."-".$month."-%' AND `paysys` LIKE '".$paysys."' ;";
$alltransactions=simple_queryall($query);

Expand Down Expand Up @@ -78,6 +79,7 @@ function web_OPDoSearch($year,$month,$paysys) {
$rows.= wf_TableRow($cells, 'row3');
if ($eachtransaction['summ']>0) {
$totalsumm=$totalsumm+$eachtransaction['summ'];
$totalcount=$totalcount+1;
}

$csvSumm= str_replace('.', ',', $eachtransaction['summ']);
Expand All @@ -88,7 +90,7 @@ function web_OPDoSearch($year,$month,$paysys) {
}

$result= wf_TableBody($rows, '100%', '0', 'sortable');
$result.= wf_tag('b').__('Cash').': '.$totalsumm. wf_tag('b',true);
$result.= __('Total').': '.$totalcount.' '.__('payments'). ' '.__('with total amount').' '.$totalsumm;

if (!empty($csvdata)) {
$exportFilename='exports/opsearch_'.$paysys.'_'.$year.'-'.$month.'.csv';
Expand Down
22 changes: 20 additions & 2 deletions modules/general/payfind/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,9 @@ function web_PaymentSearch($markers) {
$allcontracts = zb_UserGetAllContracts();
$allcontracts = array_flip($allcontracts);
}
if ($altercfg['FINREP_TARIFF']) {
$alltariffs= zb_TariffsGetAllUsers();
}
$allrealnames = zb_UserGetAllRealnames();
$alladdress = zb_AddressGetFulladdresslist();
$alltypes = zb_CashGetAllCashTypes();
Expand All @@ -322,14 +325,22 @@ function web_PaymentSearch($markers) {
}
$cells.= wf_TableCell(__('Full address'));
$cells.= wf_TableCell(__('Real Name'));
if ($altercfg['FINREP_TARIFF']) {
$cells.= wf_TableCell(__('Tariff'));
}
$cells.= wf_TableCell(__('Payment type'));
$cells.= wf_TableCell(__('Notes'));
$cells.= wf_TableCell(__('Admin'));
$rows = wf_TableRow($cells, 'row1');


if (!empty($allpayments)) {
$csvdata.=__('ID').';'.__('Date').';'.__('Cash').';'.__('PS%').';'.__('Profit').';'.__('Login').';'.__('Full address').';'.__('Real Name').';'.__('Payment type').';'.__('Notes').';'.__('Admin')."\n";
if ($altercfg['FINREP_TARIFF']) {
$csvTariffColumn=';'.__('Tariff');
} else {
$csvTariffColumn='';
}
$csvdata.=__('ID').';'.__('Date').';'.__('Cash').';'.__('PS%').';'.__('Profit').';'.__('Login').';'.__('Full address').';'.__('Real Name').$csvTariffColumn.';'.__('Payment type').';'.__('Notes').';'.__('Admin')."\n";
foreach ($allpayments as $io => $each) {
$cells = wf_TableCell($each['id']);
$cells.= wf_TableCell($each['date']);
Expand All @@ -356,6 +367,13 @@ function web_PaymentSearch($markers) {
@$paymentAddress=$alladdress[$each['login']];;
$cells.= wf_TableCell($paymentAddress);
$cells.= wf_TableCell($paymentRealname);
if ($altercfg['FINREP_TARIFF']) {
@$userTariff=$alltariffs[$each['login']];
$cells.= wf_TableCell($userTariff);
$csvTariff=';'.$userTariff;
} else {
$csvTariff='';
}
$cells.= wf_TableCell($paymentCashType);
//payment notes translation
if ($altercfg['TRANSLATE_PAYMENTS_NOTES']) {
Expand All @@ -381,7 +399,7 @@ function web_PaymentSearch($markers) {
$profitsumm=$profitsumm+$ourProfit;
}
$csvSumm= str_replace('.', ',', $each['summ']);
$csvdata.=$each['id'].';'.$each['date'].';'.$csvSumm.';'.$paySysPc.';'.$ourProfit.';'.$each['login'].';'.$paymentAddress.';'.$paymentRealname.';'.$paymentCashType.';'.$paynote.';'.$each['admin']."\n";
$csvdata.=$each['id'].';'.$each['date'].';'.$csvSumm.';'.$paySysPc.';'.$ourProfit.';'.$each['login'].';'.$paymentAddress.';'.$paymentRealname.$csvTariff.';'.$paymentCashType.';'.$paynote.';'.$each['admin']."\n";
}

}
Expand Down
2 changes: 1 addition & 1 deletion userstats/config/modules.d/payments
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
NAME="Payments"
NEED=""
NEED="PAYMENTS_ENABLED"
3 changes: 3 additions & 0 deletions userstats/config/userstats.ini
Original file line number Diff line number Diff line change
Expand Up @@ -165,3 +165,6 @@ PAYMENTID_QR=0

;Announcements module is enabled?
AN_ENABLED=0

;Previous payments module is enabled?
PAYMENTS_ENABLED=1
6 changes: 6 additions & 0 deletions userstats/modules/general/payments/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

function zbs_ShowUserPayments($login) {
$usConfig= zbs_LoadConfig();
if ($usConfig['PAYMENTS_ENABLED']) {
$allpayments=zbs_CashGetUserPayments($login);
$result='<table width="100%" border="0">';

Expand Down Expand Up @@ -33,6 +34,11 @@ function zbs_ShowUserPayments($login) {
}
$result.='</table>';
show_window(__('Last payments'),$result);
} else {
$result=__('This module is disabled');
show_window(__('Sorry'),$result);
}

}

$user_ip=zbs_UserDetectIp('debug');
Expand Down

0 comments on commit 065cb0f

Please sign in to comment.