if (!empty($newnasip) and !empty($newnasname)) { zb_NasAdd($newnetid, $newnasip, $newnasname, $newnastype, $newbandw); zb_NasConfigSave(); rcms_redirect("?module=nas"); } } // Show available NASes $allnas = zb_NasGetAllData(); // construct needed editor $titles = array('ID', 'Network', 'IP', 'NAS name', 'NAS type', 'Bandwidthd URL'); $keys = array('id', 'netid', 'nasip', 'nasname', 'nastype', 'bandw'); if (!wf_CheckGet(array('edit'))) { $altCfg = $ubillingConfig->getAlter(); if ($altCfg['FREERADIUS_ENABLED']) { $freeRadiusClientsData = web_FreeRadiusListClients(); $radiusControls = wf_modal(web_icon_extended(__('FreeRADIUS NAS parameters')), __('FreeRADIUS NAS parameters'), $freeRadiusClientsData, '', '600', '300'); } else { $radiusControls = ''; } show_window(__('Network Access Servers') . ' ' . $radiusControls, web_GridEditorNas($titles, $keys, $allnas, 'nas')); show_window(__('Add new'), web_NasAddForm()); //vlangen patch start if ($altCfg['VLANGEN_SUPPORT']) { $terminator = new VlanTerminator(); if (isset($_GET['DeleteTerminator'])) { $TermID = $_GET['DeleteTerminator']; $terminator->delete($TermID); rcms_redirect(VlanTerminator::MODULE_URL); } if (!isset($_GET['EditTerminator'])) { if (isset($_POST['AddTerminator'])) {
/** * Renders controls panel * * @return string */ public function renderControls() { $result = ''; $result .= wf_Link(self::URL_ME . '&' . self::URL_PAYROLL, wf_img('skins/ukv/report.png') . ' ' . __('Payroll'), false, 'ubButton'); $result .= wf_Link(self::URL_ME . '&' . self::URL_TSHEETS, wf_img('skins/icon_calendar.gif') . ' ' . __('Timesheet'), false, 'ubButton'); $result .= wf_Link(self::URL_ME . '&' . self::URL_FACONTROL, wf_img('skins/factorcontrol.png') . ' ' . __('Factor control'), false, 'ubButton'); $result .= wf_Link(self::URL_ME . '&' . self::URL_TWJ, wf_img('skins/question.png') . ' ' . __('Tasks without jobs'), false, 'ubButton'); $directoriesControls = wf_Link(self::URL_ME . '&' . self::URL_JOBPRICES, wf_img('skins/shovel.png') . ' ' . __('Job types'), false, 'ubButton'); $directoriesControls .= wf_Link(self::URL_ME . '&' . self::URL_WAGES, wf_img('skins/icon_user.gif') . ' ' . __('Employee wages'), false, 'ubButton'); $result .= wf_modalAuto(web_icon_extended() . ' ' . __('Directories'), __('Directories'), $directoriesControls, 'ubButton'); return $result; }
/** * Renders control panel for whole module * * @return string */ public function renderPanel() { $result = ''; $result .= wf_Link(self::URL_ME . '&' . self::URL_REPORTS . '&' . 'totalremains=true', wf_img_sized('skins/whstorage_icon.png') . ' ' . __('The remains in all storages'), false, 'ubButton'); if (cfr('WAREHOUSEIN')) { $result .= wf_Link(self::URL_ME . '&' . self::URL_IN, wf_img_sized('skins/whincoming_icon.png') . ' ' . __('Incoming operations'), false, 'ubButton'); } if (cfr('WAREHOUSEOUT')) { $result .= wf_Link(self::URL_ME . '&' . self::URL_OUT, wf_img_sized('skins/whoutcoming_icon.png') . ' ' . __('Outcoming operations'), false, 'ubButton'); } if (cfr('WAREHOUSERESERVE')) { $result .= wf_Link(self::URL_ME . '&' . self::URL_RESERVE, wf_img('skins/whreservation.png') . ' ' . __('Reserved'), false, 'ubButton'); } $dirControls = wf_Link(self::URL_ME . '&' . self::URL_CATEGORIES, wf_img_sized('skins/categories_icon.png') . ' ' . __('Warehouse categories'), false, 'ubButton'); $dirControls .= wf_Link(self::URL_ME . '&' . self::URL_ITEMTYPES, wf_img_sized('skins/folder_icon.png') . ' ' . __('Warehouse item types'), false, 'ubButton'); $dirControls .= wf_Link(self::URL_ME . '&' . self::URL_STORAGES, wf_img_sized('skins/whstorage_icon.png') . ' ' . __('Warehouse storages'), false, 'ubButton'); $dirControls .= wf_Link(self::URL_ME . '&' . self::URL_CONTRACTORS, wf_img_sized('skins/whcontractor_icon.png') . ' ' . __('Contractors'), false, 'ubButton'); if (cfr('WAREHOUSEDIR')) { $result .= wf_modalAuto(web_icon_extended() . ' ' . __('Directories'), __('Directories'), $dirControls, 'ubButton'); } return $result; }
/** * Returns NAS editing grid * * @param array $titles * @param array $keys * @param array $alldata * @param string $module * @param bool $delete * @param bool $edit * @param string $prefix * @return string */ function web_GridEditorNas($titles, $keys, $alldata, $module, $delete = true, $edit = true, $prefix = '') { // Получаем список сетей $networks = multinet_get_all_networks(); $cidrs = array(); if (!empty($networks)) { foreach ($networks as $network) { $cidrs[$network['id']] = $network['desc']; } } // Заголовок таблицы $cells = ''; foreach ($titles as $title) { $cells .= wf_TableCell(__($title)); } $cells .= wf_TableCell(__('Actions')); $rows = wf_TableRow($cells, 'row1'); // Содержимое таблицы if (!empty($alldata)) { foreach ($alldata as $data) { $cells = ''; $actions = ''; if ($delete) { $actions .= wf_JSAlert('?module=' . $module . '&' . $prefix . 'delete=' . $data['id'], web_delete_icon(), 'Removing this may lead to irreparable results'); } if ($edit) { $actions .= wf_Link('?module=' . $module . '&' . $prefix . 'edit=' . $data['id'], web_edit_icon()); } foreach ($keys as $key) { if (array_key_exists($key, $data)) { switch ($key) { case 'netid': $cells .= wf_TableCell($data[$key] . ': ' . $cidrs[$data[$key]]); break; case 'nastype': if ($data[$key] == 'mikrotik') { $actions .= wf_Link('?module=mikrotikextconf&nasid=' . $data['id'], web_icon_extended('MikroTik extended configuration')); } if ($data[$key] == 'radius') { $actions .= wf_Link('?module=freeradius&nasid=' . $data['id'], web_icon_freeradius('Set RADIUS-attributes')); } $cells .= wf_TableCell($data[$key]); break; default: $cells .= wf_TableCell($data[$key]); break; } } } $cells .= wf_TableCell($actions); $rows .= wf_TableRow($cells, 'row3'); } } // Результат - таблица $result = wf_TableBody($rows, '100%', 0, 'sortable'); // Отображаем результат return $result; }