Skip to content

Commit

Permalink
0.7.6 rev 5005
Browse files Browse the repository at this point in the history
  • Loading branch information
nightflyza committed Apr 13, 2016
1 parent 6328539 commit db2d9c9
Show file tree
Hide file tree
Showing 14 changed files with 134 additions and 41 deletions.
2 changes: 1 addition & 1 deletion RELEASE
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.7.6 rev 5001
0.7.6 rev 5005
53 changes: 52 additions & 1 deletion api/libs/api.assignreport.php
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,56 @@ public function exportCSV($agentid) {
die();
}

/**
* extracts data from agentPring cache for future export in CSV
*
* @param int $agentid Existing agent ID in database
*
* @return void
*/
public function exportCSV2($agentid) {
$tmpArr = array();
$result = '';
$shortAddres = zb_AddressGetFulladdresslistCached();

if (!empty($this->altcfg)) {
$altercfg = $this->altcfg;
} else {
global $ubillingConfig;
$this->altcfg = $ubillingConfig->getAlter();
$altercfg = $this->altcfg;
}


if (file_exists(self::EXPORT_PATH . 'report_agentfinance.prindataraw')) {
$rawData = file_get_contents(self::EXPORT_PATH . 'report_agentfinance.prindataraw');
$tmpArr = unserialize($rawData);
$allservicenames = zb_VservicesGetAllNamesLabeled();
$this->loadUserRealnames();
$this->loadCashTypes();
if (!empty($tmpArr)) {
if (isset($tmpArr[$agentid])) {
if (!empty($tmpArr[$agentid])) {
//CSV header
$result.= __('Date') . ';' . __('Cash') . ';' . __('Full address') . ';' . __('Real Name') . ';' . __('Notes') . "\n";
//CSV data
foreach ($tmpArr[$agentid] as $io => $each) {
$summ = str_replace('.', ',', $each['summ']); //need for normal summ in excel
$timeStamp = strtotime($each['date']);
$newDate = date("Y-m-d", $timeStamp);
$result.=$newDate . ';' . $summ . ';' . @$shortAddres[$each['login']] . ';' . @$this->userRealnames[$each['login']] . ';' . zb_TranslatePaymentNote($each['note'], $allservicenames) . "\n";
}
}
}
}
}
$saveCsvName = self::EXPORT_PATH . 'report_agentfinance_' . $agentid . '_' . zb_rand_string(8) . '.csv';
$result = iconv('utf-8', 'windows-1251', $result);
file_put_contents($saveCsvName, $result);
zb_DownloadFile($saveCsvName, 'csv');
die();
}

/**
* do the payments search via some data interval
*
Expand Down Expand Up @@ -559,7 +609,8 @@ public function paymentSearch($datefrom, $dateto, $cashtypeid) {
$agRows = wf_TableRow($agCells, 'row1');

foreach ($this->agentsumm as $eachAgentId => $eachAgentStat) {
$exportControls = wf_Link("?module=report_agentfinance&exportcsvagentid=" . $eachAgentId, wf_img('skins/excel.gif', __('Export')), false, '');
$exportControls = wf_Link("?module=report_agentfinance&exportcsvagentid=" . $eachAgentId, wf_img('skins/excel.gif', __('Export') . ' ' . __('full')), false, '').' ';
$exportControls.= wf_Link("?module=report_agentfinance&exportcsvagentidshort=" . $eachAgentId, wf_img('skins/excel.gif', __('Export') . ' ' . __('short')), false, '').' ';
$exportControls.= wf_Link("?module=report_agentfinance&exporthtmlagentid=" . $eachAgentId, wf_img('skins/icon_print.png', __('Print')), false, '');
$agCells = wf_TableCell($this->agentsNamed[$eachAgentId]);
$agCells.= wf_TableCell($eachAgentStat['count']);
Expand Down
3 changes: 2 additions & 1 deletion api/libs/api.megogo.php
Original file line number Diff line number Diff line change
Expand Up @@ -709,8 +709,9 @@ public function tariffDelete($tariffId) {
*/
public function renderSubscribtionsReportMonthly() {
$result = '';
$selectedMonth = (wf_CheckPost(array('monthsel'))) ? $_POST['monthsel'] : date("m");
$inputs = wf_YearSelector('yearsel', __('Year'), false) . ' ';
$inputs.= wf_MonthSelector('monthsel', __('Month'), date("m"), false) . ' ';
$inputs.= wf_MonthSelector('monthsel', __('Month'), $selectedMonth, false) . ' ';
$inputs.= wf_Submit(__('Show'));
$result.= wf_Form('', 'POST', $inputs, 'glamour');
$curYear = (wf_CheckPost(array('yearsel'))) ? vf($_POST['yearsel'], 3) : curyear();
Expand Down
1 change: 1 addition & 0 deletions api/libs/api.opayz.php
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,7 @@ public function transactionAjaxSource() {
@$user_login = $this->allCustomers[$eachtransaction['customerid']];
@$user_realname = $this->allRealnames[$user_login];
$user_realname = str_replace('"', '', $user_realname);
$user_realname = str_replace('\\', '', $user_realname);
$user_realname = trim($user_realname);

@$user_address = $this->allAddress[$user_login];
Expand Down
53 changes: 32 additions & 21 deletions api/libs/api.switches.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,21 +185,21 @@ function web_SwitchModelSelector($selectname = 'switchmodelid') {
* @param string $snmptemplate
*/
function ub_SwitchModelAdd($name, $ports, $snmptemplate = '') {
$ports = vf($ports,3);
$ports = vf($ports, 3);
$nameClean = mysql_real_escape_string($name);
$snmptemplate = mysql_real_escape_string($snmptemplate);
if (empty($ports)) {
$ports='NULL';
$ports = 'NULL';
} else {
$ports="'".$ports."'";
$ports = "'" . $ports . "'";
}

if (empty($snmptemplate)) {
$snmptemplate='NULL';
$snmptemplate = 'NULL';
} else {
$snmptemplate="'".$snmptemplate."'";
$snmptemplate = "'" . $snmptemplate . "'";
}
$query = "INSERT INTO `switchmodels` (`id` ,`modelname` ,`ports`,`snmptemplate`) VALUES (NULL , '" . $nameClean . "', ". $ports . "," . $snmptemplate . ");";
$query = "INSERT INTO `switchmodels` (`id` ,`modelname` ,`ports`,`snmptemplate`) VALUES (NULL , '" . $nameClean . "', " . $ports . "," . $snmptemplate . ");";
nr_query($query);
log_register('SWITCHMODEL ADD `' . $name . '`');
}
Expand All @@ -212,7 +212,7 @@ function ub_SwitchModelAdd($name, $ports, $snmptemplate = '') {
* @return void
*/
function ub_SwitchModelDelete($modelid) {
$modelid = vf($modelid,3);
$modelid = vf($modelid, 3);
$query = 'DELETE FROM `switchmodels` WHERE `id` = "' . $modelid . '"';
nr_query($query);
log_register('SWITCHMODEL DELETE [' . $modelid . ']');
Expand Down Expand Up @@ -376,9 +376,15 @@ function web_SwitchEditForm($switchid) {
$result.=wf_Link('?module=switchpoller&switchid=' . $switchid, wf_img('skins/snmp.png') . ' ' . __('SNMP query'), false, 'ubButton');
}
}

if (!empty($switchdata['ip'])) {
$result.=wf_AjaxLink('?module=switches&backgroundicmpping='.$switchdata['ip'], wf_img('skins/ping_icon.png').' '.__('ICMP ping'), 'icmppingcontainer', false, 'ubButton');
$result.=wf_AjaxLink('?module=switches&backgroundicmpping=' . $switchdata['ip'], wf_img('skins/ping_icon.png') . ' ' . __('ICMP ping'), 'icmppingcontainer', false, 'ubButton');
}

if (isset($altCfg['SW_WEBNAV'])) {
if ($altCfg['SW_WEBNAV']) {
$result.=' ' . wf_tag('a', false, 'ubButton', 'href="http://' . $switchdata['ip'] . '" target="_BLANK"') . wf_img('skins/ymaps/globe.png') .' '.__('Go to the web interface') . wf_tag('a', true).' ';
}
}


Expand All @@ -391,7 +397,7 @@ function web_SwitchEditForm($switchid) {
if (cfr('SWITCHESEDIT')) {
$result.= wf_JSAlertStyled('?module=switches&switchdelete=' . $switchid, web_delete_icon() . ' ' . __('Delete'), 'Removing this may lead to irreparable results', 'ubButton');
}

if (!empty($switchdata['ip'])) {
$result.=wf_AjaxLoader();
$result.=wf_AjaxContainer('icmppingcontainer');
Expand Down Expand Up @@ -681,12 +687,12 @@ function web_SwitchesShow() {
} else {
$deathClock = '';
}

//switch location link
$switchLocator= wf_Link('?module=switches&gotoswitchbyip='.$ip, web_edit_icon(__('Go to switch')));
$switchLocator = wf_Link('?module=switches&gotoswitchbyip=' . $ip, web_edit_icon(__('Go to switch')));

//add switch as dead
$ajaxResult.=$devicefind.' '.$switchLocator . ' ' . $deathClock . $ip . ' - ' . $switch . '<br>';
$ajaxResult.=$devicefind . ' ' . $switchLocator . ' ' . $deathClock . $ip . ' - ' . $switch . '<br>';
}
} else {
$ajaxResult = __('Switches are okay, everything is fine - I guarantee');
Expand Down Expand Up @@ -761,7 +767,6 @@ function web_SwitchesShow() {
$tablecells.=wf_TableCell($eachswitch['desc']);
$switchcontrols = '';
if (cfr('SWITCHESEDIT')) {
//$switchcontrols.=wf_JSAlert('?module=switches&switchdelete=' . $eachswitch['id'], web_delete_icon(), 'Removing this may lead to irreparable results');
$switchcontrols.=wf_Link('?module=switches&edit=' . $eachswitch['id'], web_edit_icon());
}

Expand Down Expand Up @@ -797,6 +802,12 @@ function web_SwitchesShow() {
$switchcontrols.=$adcomments->getCommentsIndicator($eachswitch['id']);
}

if (isset($alterconf['SW_WEBNAV'])) {
if ($alterconf['SW_WEBNAV']) {
$switchcontrols.=' ' . wf_tag('a', false, '', 'href="http://' . $eachswitch['ip'] . '" target="_BLANK"') . wf_img('skins/ymaps/globe.png', __('Go to the web interface')) . wf_tag('a', true);
}
}

$tablecells.=wf_TableCell($switchcontrols);
$tablerows.=wf_tag('tr', false, 'row3', $lighter);
$tablerows.=$tablecells;
Expand Down Expand Up @@ -1139,12 +1150,12 @@ function zb_SwitchReplace($fromId, $toId, $employeeId) {
* @return int
*/
function zb_SwitchGetIdbyIP($ip) {
$result='';
$ip= mysql_real_escape_string($ip);
$query="SELECT `id`,`ip` from `switches` WHERE `ip`='".$ip."' LIMIT 1;";
$raw= simple_query($query);
$result = '';
$ip = mysql_real_escape_string($ip);
$query = "SELECT `id`,`ip` from `switches` WHERE `ip`='" . $ip . "' LIMIT 1;";
$raw = simple_query($query);
if (!empty($raw)) {
$result=$raw['id'];
$result = $raw['id'];
}
return ($result);
}
Expand Down
28 changes: 20 additions & 8 deletions api/libs/api.teskman.php
Original file line number Diff line number Diff line change
Expand Up @@ -1007,15 +1007,15 @@ function ts_TaskCreateFormUnified($address, $mobile, $phone, $login = '') {
} else {
$smsInputs = '';
}
$sup= wf_tag('sup').'*'.wf_tag('sup',true);

$sup = wf_tag('sup') . '*' . wf_tag('sup', true);

$inputs = '<!--ugly hack to prevent datepicker autoopen -->';
$inputs.= wf_tag('input',false, '', 'type="text" name="shittyhack" style="width: 0; height: 0; top: -100px; position: absolute;"');
$inputs.= wf_tag('input', false, '', 'type="text" name="shittyhack" style="width: 0; height: 0; top: -100px; position: absolute;"');
$inputs.=wf_HiddenInput('createtask', 'true');
$inputs.=wf_DatePicker('newstartdate');
$inputs.=wf_TimePickerPreset('newstarttime', '', '', false);
$inputs.=wf_tag('label') . __('Target date') . $sup. wf_tag('label', true);
$inputs.=wf_tag('label') . __('Target date') . $sup . wf_tag('label', true);
$inputs.=wf_delimiter();
$inputs.=wf_TextInput('newtaskaddress', __('Address') . $sup, $address, true, '30');
$inputs.=wf_HiddenInput('newtasklogin', $login);
Expand Down Expand Up @@ -1353,6 +1353,7 @@ function ts_TaskChangeForm($taskid) {
$allemployee = ts_GetAllEmployee();
$activeemployee = ts_GetActiveEmployee();
$alljobtypes = ts_GetAllJobtypes();
$messages = new UbillingMessageHelper();
$smsData = '';

if (!empty($taskdata)) {
Expand Down Expand Up @@ -1515,12 +1516,17 @@ function ts_TaskChangeForm($taskid) {


$form = wf_Form("", 'POST', $inputs, 'glamour');



if (cfr('TASKMANDELETE')) {
show_window('', wf_JSAlertStyled('?module=taskman&deletetask=' . $taskid, web_delete_icon() . ' ' . __('Remove this task - it is an mistake'), $messages->getDeleteAlert(), 'ubButton'));
}


//show editing form
if (cfr('TASKMANDONE')) {
show_window(__('If task is done'), $form);
}

} else {
$donecells = wf_TableCell(__('Finish date'), '30%');
$donecells.=wf_TableCell($taskdata['enddate']);
Expand All @@ -1535,11 +1541,17 @@ function ts_TaskChangeForm($taskid) {
$donerows.=wf_TableRow($donecells, 'row3');

$doneresult = wf_TableBody($donerows, '100%', '0', 'glamour');

if (cfr('TASKMANDELETE')) {
$doneresult.=wf_JSAlertStyled('?module=taskman&deletetask=' . $taskid, web_delete_icon() . ' ' . __('Remove this task - it is an mistake'), $messages->getDeleteAlert(), 'ubButton');
}

if (cfr('TASKMANDONE')) {
$doneresult.=wf_JSAlertStyled('?module=taskman&deletetask=' . $taskid, web_delete_icon() . ' ' . __('Remove this task - it is an mistake'), __('Removing this may lead to irreparable results'), 'ubButton');
$doneresult.='&nbsp;';
$doneresult.=wf_JSAlertStyled('?module=taskman&setundone=' . $taskid, wf_img('skins/icon_key.gif') . ' ' . __('No work was done'), __('Are you serious'), 'ubButton');
$doneresult.=wf_JSAlertStyled('?module=taskman&setundone=' . $taskid, wf_img('skins/icon_key.gif') . ' ' . __('No work was done'), $messages->getEditAlert(), 'ubButton');
}


show_window(__('Task is done'), $doneresult);
}
}
Expand Down
2 changes: 2 additions & 0 deletions api/libs/api.userdata.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ function zb_UserGetRealName($login) {
function zb_UserChangeRealName($login, $realname) {
$login = vf($login);
$realname = str_replace("'", '`', $realname);
$realname = str_replace('"', '``', $realname);
$realname = str_replace('\\', '', $realname);
$realname = mysql_real_escape_string($realname);

$query = "UPDATE `realname` SET `realname` = '" . $realname . "' WHERE `login`= '" . $login . "' ;";
Expand Down
4 changes: 3 additions & 1 deletion config/alter.ini
Original file line number Diff line number Diff line change
Expand Up @@ -479,4 +479,6 @@ MG_SALT="guessmeifyoucan"
;Megogo accounting type: 0 - per month, 1 - spread fee, and subscription fee will be charged for one day
MG_SPREAD=0
;Megogo partner profit percent
MG_PERCENT=15
MG_PERCENT=15
;Optional option - uncomment it for fast switch navigation control
;SW_WEBNAV=1
2 changes: 1 addition & 1 deletion config/permgroups.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
USERREG=TASKBAR,USERSEARCH,TAGS,USERPROFILE,USEREDIT,USERREG,CASH,ANNIHILATION,ALWAYSONLINE,BINDER,CONTRACT,CORPORATE,CREDIT,CREDITEXPIRE,DOWN,LIFESTORY,MAC,EMAIL,MOBILE,NOTES,ONLINE,PASSIVE,PASSWORD,PHONE,PLARPING,PLCHECKER,PLDHCP,PLDOCS,PLFEES,PLIPCHANGE,PLPINGER,RADIUS,PLSENDMESSAGE,PLDETAILS,PLVCASH,PRINTCHECK,REALNAME,RESET,USERSPEED,TARIFFEDIT,TRAFFSTATS,PDATA,OPTION82,CORPS,CONDET,CUDISCOUNTS
GEO=BUILDS,CITY,STREETS,VOLS,CUSTMAPEDIT,CUSTMAP,USERSMAP,SWITCHMAP
SYSTEM=TARIFFSPEED,VSERVICES,SWITCHES,SWITCHESEDIT,SWITCHM,TARIFFS,STGNEWADMIN,ARPDIAG,BACKUP,CASHTYPES,CFTYPES,DHCP,STGDOCSIS,DSHAPER,DSTAT,EVENTVIEW,LOUSYTARIFFS,MASSSEND,MULTINET,NAS,PERMISSIONS,REPORTMASTERADM,RULES,SQLCONSOLE,SYSCONF,MTSIGMON,MASSRESET,UHW,EXPRESSCARD,EXPRESSCARDREG,DOCSIS,ZBSMAN,SWITCHPOLL,MTEXTCONF,FREERADIUS,WATCHDOG,ZBSANN,SCINFO,PLVLANGEN,ADDVLAN,VLANMACHISTORY,SWITCHLOGIN
FINANCE=BANKSTA,CARDS,AGENTS,EMPLOYEE,OPENPAYZ,PAYEXPORT,PAYFIND,TASKMAN,TASKMANDATE,TASKMANDONE,TASKMANSEARCH,TASKMANTRACK,TICKETING,SIGREQ,CAPAB,SALARY,SALARYTASKS,SALARYTASKSVIEW,SALARYTSHEETS,WAREHOUSE,WAREHOUSEIN,WAREHOUSEOUT,WAREHOUSEDIR,FRIENDSHIP,DEALWITHIT
FINANCE=BANKSTA,CARDS,AGENTS,EMPLOYEE,OPENPAYZ,PAYEXPORT,PAYFIND,TASKMAN,TASKMANDATE,TASKMANDONE,TASKMANDELETE,TASKMANSEARCH,TASKMANTRACK,TICKETING,SIGREQ,CAPAB,SALARY,SALARYTASKS,SALARYTASKSVIEW,SALARYTSHEETS,WAREHOUSE,WAREHOUSEIN,WAREHOUSEOUT,WAREHOUSEDIR,FRIENDSHIP,DEALWITHIT
REPORTS=GENOCIDE,NDS,CARDREPORT,NEWMAC,REPORTCREXP,REPORTDSTAT,REPORTFINANCE,REPORTSIGNUP,STREETEPORT,SYSLOAD,REPORTTARIFFS,REPORTTRAFFIC,REPORTMASTER,SPEEDCONTROL,PLFUNDS,ASKOZIA,ASTERISK,REPORTAUTOFREEZE,REPORTNOSWPORT,SCREPORT,REPORTCOMPLEX
CATV=CATV,CATVCASH,CATVDECODEREDIT,CATVPROFILE,CATVSTATS,CATVTARIFFEDIT,CATVACT,CATVUSEREDIT,CATVBS,UKV,UKVREG,UKVTAR,UKVBST,UKVREP,UKVCASH,UKVDEL,UKVSEAL
8 changes: 4 additions & 4 deletions languages/russian/billing.php
Original file line number Diff line number Diff line change
Expand Up @@ -2216,10 +2216,10 @@

//rev 4986
$lang['def']['right to delete photostorage images'] = 'Право удалять изображения из хранилища';
$lang['def'][''] = '';
$lang['def'][''] = '';
$lang['def'][''] = '';
$lang['def'][''] = '';
$lang['def']['full'] = 'полный';
$lang['def']['short'] = 'короткий';
$lang['def']['Go to the web interface'] = 'Перейти в веб-интерфейс';
$lang['def']['right to delete tasks'] = 'Право удалять задания';
$lang['def'][''] = '';
$lang['def'][''] = '';

Expand Down
6 changes: 4 additions & 2 deletions languages/ukrainian/billing.php
Original file line number Diff line number Diff line change
Expand Up @@ -2232,7 +2232,9 @@

//rev 4986
$lang['def']['right to delete photostorage images'] = 'Право видаляти зображення зі сховища';


$lang['def']['full'] = 'повний';
$lang['def']['short'] = 'короткий';
$lang['def']['Go to the web interface'] = 'Перейти до веб-інтерфейсу';
$lang['def']['right to delete tasks'] = 'Право видаляти завдання';

?>
6 changes: 6 additions & 0 deletions modules/general/report_agentfinance/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@
$assignReport->exportCSV($_GET['exportcsvagentid']);
}

//CSV data export short printable
if (wf_CheckGet(array('exportcsvagentidshort'))) {
$assignReport->exportCSV2($_GET['exportcsvagentidshort']);
}


//show search form
show_window(__('Payment search'),$assignReport->paymentSearchForm());
show_window('', wf_Link('?module=report_finance', __('Back'), true, 'ubButton'));
Expand Down
7 changes: 6 additions & 1 deletion modules/general/taskman/module.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
<?php
$this->registerModule($module, 'main', 'Tasks', 'Nightfly', array('TASKMAN' => __('right to control tasks'),'TASKMANDATE'=>__('right to change tasks date'),'TASKMANDONE'=>__('right to mark tasks as done')));
$this->registerModule($module, 'main', 'Tasks', 'Nightfly', array(
'TASKMAN' => __('right to control tasks'),
'TASKMANDATE'=>__('right to change tasks date'),
'TASKMANDONE'=>__('right to mark tasks as done'),
'TASKMANDELETE'=>__('right to delete tasks')
));
?>
Binary file added skins/ymaps/globe.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit db2d9c9

Please sign in to comment.