diff --git a/RELEASE b/RELEASE
index 3ce0108c2..7c7981009 100644
--- a/RELEASE
+++ b/RELEASE
@@ -1 +1 @@
-0.7.6 rev 5001
+0.7.6 rev 5005
diff --git a/api/libs/api.assignreport.php b/api/libs/api.assignreport.php
index e48ae3463..70c5f9add 100644
--- a/api/libs/api.assignreport.php
+++ b/api/libs/api.assignreport.php
@@ -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
*
@@ -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']);
diff --git a/api/libs/api.megogo.php b/api/libs/api.megogo.php
index ee7e28342..9e7987882 100644
--- a/api/libs/api.megogo.php
+++ b/api/libs/api.megogo.php
@@ -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();
diff --git a/api/libs/api.opayz.php b/api/libs/api.opayz.php
index 504995680..783c4dd62 100644
--- a/api/libs/api.opayz.php
+++ b/api/libs/api.opayz.php
@@ -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];
diff --git a/api/libs/api.switches.php b/api/libs/api.switches.php
index 04f40bfff..ddf31f386 100755
--- a/api/libs/api.switches.php
+++ b/api/libs/api.switches.php
@@ -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 . '`');
}
@@ -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 . ']');
@@ -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).' ';
+ }
}
@@ -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');
@@ -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 . '
';
+ $ajaxResult.=$devicefind . ' ' . $switchLocator . ' ' . $deathClock . $ip . ' - ' . $switch . '
';
}
} else {
$ajaxResult = __('Switches are okay, everything is fine - I guarantee');
@@ -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());
}
@@ -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;
@@ -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);
}
diff --git a/api/libs/api.teskman.php b/api/libs/api.teskman.php
index 4527c61c4..14b9ddee1 100755
--- a/api/libs/api.teskman.php
+++ b/api/libs/api.teskman.php
@@ -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 = '';
- $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);
@@ -1353,6 +1353,7 @@ function ts_TaskChangeForm($taskid) {
$allemployee = ts_GetAllEmployee();
$activeemployee = ts_GetActiveEmployee();
$alljobtypes = ts_GetAllJobtypes();
+ $messages = new UbillingMessageHelper();
$smsData = '';
if (!empty($taskdata)) {
@@ -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']);
@@ -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.=' ';
- $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);
}
}
diff --git a/api/libs/api.userdata.php b/api/libs/api.userdata.php
index 33cf6ce81..81981af71 100755
--- a/api/libs/api.userdata.php
+++ b/api/libs/api.userdata.php
@@ -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 . "' ;";
diff --git a/config/alter.ini b/config/alter.ini
index 412a7ad82..d822da0ce 100644
--- a/config/alter.ini
+++ b/config/alter.ini
@@ -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
\ No newline at end of file
+MG_PERCENT=15
+;Optional option - uncomment it for fast switch navigation control
+;SW_WEBNAV=1
\ No newline at end of file
diff --git a/config/permgroups.ini b/config/permgroups.ini
index 43d94164d..de2e5c2b1 100755
--- a/config/permgroups.ini
+++ b/config/permgroups.ini
@@ -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
\ No newline at end of file
diff --git a/languages/russian/billing.php b/languages/russian/billing.php
index a6da1ddd6..aae56dc19 100755
--- a/languages/russian/billing.php
+++ b/languages/russian/billing.php
@@ -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'][''] = '';
diff --git a/languages/ukrainian/billing.php b/languages/ukrainian/billing.php
index 0a3bec887..631f54726 100755
--- a/languages/ukrainian/billing.php
+++ b/languages/ukrainian/billing.php
@@ -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'] = 'Право видаляти завдання';
?>
diff --git a/modules/general/report_agentfinance/index.php b/modules/general/report_agentfinance/index.php
index 2b75f9b7f..294fcd9cd 100644
--- a/modules/general/report_agentfinance/index.php
+++ b/modules/general/report_agentfinance/index.php
@@ -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'));
diff --git a/modules/general/taskman/module.php b/modules/general/taskman/module.php
index 747316bd7..bafec8cfc 100755
--- a/modules/general/taskman/module.php
+++ b/modules/general/taskman/module.php
@@ -1,3 +1,8 @@
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')
+ ));
?>
diff --git a/skins/ymaps/globe.png b/skins/ymaps/globe.png
new file mode 100644
index 000000000..b8161e4c2
Binary files /dev/null and b/skins/ymaps/globe.png differ