Esempio n. 1
0
 /**
  * Returns tariff info ajax controls
  * 
  * @param string $tariffName
  * @return string
  */
 protected function getTariffInfoControls($tariffName)
 {
     $result = '';
     if (@$this->alterCfg['TARIFFINFO_IN_PROFILE']) {
         $containerId = 'TARIFFINFO_CONTAINER';
         if (!empty($tariffName)) {
             $result .= wf_AjaxLoader();
             $result .= wf_AjaxLink('?module=tariffinfo&tariff=' . $tariffName, wf_img('skins/tariffinfo.gif', __('Tariff info')), $containerId, false, '');
         }
     }
     return $result;
 }
Esempio n. 2
0
     }
     if ($_GET['ajax'] == 'connect_edit') {
         $swLogin->SwLoginEditConnForm($_GET['edit']);
     }
 }
 if (!isset($_GET['edit'])) {
     $megaForm = wf_AjaxLoader();
     $megaForm .= wf_AjaxLink(SwitchLogin::MODULE_URL . '&ajax=snmp', 'SNMP', 'megaContainer1', false, 'ubButton');
     $megaForm .= wf_AjaxLink(SwitchLogin::MODULE_URL . '&ajax=connect', 'Connect', 'megaContainer1', false, 'ubButton');
     $megaForm .= wf_tag('div', false, '', 'id="megaContainer1"') . wf_tag('div', true);
     show_window(__("Switches login data"), $megaForm);
     $swLogin->ShowSwAllLogin();
 } else {
     $megaEditForm = wf_AjaxLoader();
     $megaEditForm .= wf_AjaxLink(SwitchLogin::MODULE_URL . '&edit=' . $_GET['edit'] . '&ajax=snmp_edit', 'SNMP', 'megaContainer1', false, 'ubButton');
     $megaEditForm .= wf_AjaxLink(SwitchLogin::MODULE_URL . '&edit=' . $_GET['edit'] . '&ajax=connect_edit', 'Connect', 'megaContainer1', false, 'ubButton');
     $megaEditForm .= wf_tag('div', false, '', 'id="megaContainer1"') . wf_tag('div', true);
     show_warning(__("Are you sure that you want to change switch login data") . "?");
     show_window(__("Switches login data"), $megaEditForm);
     $back = wf_Link(SwitchLogin::MODULE_URL, __('Back'), false, 'ubButton');
     show_window('', $back);
 }
 if (isset($_POST['add'])) {
     $params = array('swmodel', 'SwMethod');
     if (wf_CheckPost($params)) {
         $model = $_POST['swmodel'];
         $snmpTemplate = $_POST['snmptemplate'];
         $login = $_POST['SwLogin'];
         $pass = $_POST['SwPass'];
         $method = $_POST['SwMethod'];
         $community = $_POST['RwCommunity'];
Esempio n. 3
0
function zb_NewMacShow()
{
    global $ubillingConfig;
    $billing_config = $ubillingConfig->getBilling();
    $alter_config = $ubillingConfig->getAlter();
    $allarp = array();
    $sudo = $billing_config['SUDO'];
    $cat = $billing_config['CAT'];
    $grep = $billing_config['GREP'];
    $tail = $billing_config['TAIL'];
    $alter_conf = parse_ini_file(CONFIG_PATH . 'alter.ini');
    $leases = $alter_conf['NMLEASES'];
    $leasemark = $alter_conf['NMLEASEMARK'];
    $command = $sudo . ' ' . $cat . ' ' . $leases . ' | ' . $grep . ' "' . $leasemark . '" | ' . $tail . ' -n 200';
    $rawdata = shell_exec($command);
    $allusedMacs = zb_getAllUsedMac();
    $result = '';
    //fdb cache preprocessing
    $fdbData_raw = rcms_scandir('./exports/', '*_fdb');
    if (!empty($fdbData_raw)) {
        $fdbArr = sn_SnmpParseFdbCacheArray($fdbData_raw);
        $fdbColumn = true;
    } else {
        $fdbArr = array();
        $fdbColumn = false;
    }
    $cells = wf_TableCell(__('MAC'));
    if (!empty($fdbColumn)) {
        $cells .= wf_TableCell(__('Switch'));
    }
    if ($alter_config['MACVEN_ENABLED']) {
        $cells .= wf_TableCell(__('Manufacturer'));
    }
    $rows = wf_TableRow($cells, 'row1');
    if (!empty($rawdata)) {
        $cleardata = exploderows($rawdata);
        foreach ($cleardata as $eachline) {
            preg_match('/[a-f0-9]{2}:[a-f0-9]{2}:[a-f0-9]{2}:[a-f0-9]{2}:[a-f0-9]{2}:[a-f0-9]{2}/i', $eachline, $matches);
            if (!empty($matches)) {
                $allarp[] = $matches[0];
            }
        }
        $un_arr = array_unique($allarp);
        if (!empty($un_arr)) {
            if ($alter_config['MACVEN_ENABLED']) {
                //adding ajax loader
                $result .= wf_AjaxLoader();
            }
            foreach ($un_arr as $io => $eachmac) {
                if (zb_checkMacFree($eachmac, $allusedMacs)) {
                    $cells = wf_TableCell(@$eachmac);
                    if (!empty($fdbColumn)) {
                        $cells .= wf_TableCell(sn_SnmpParseFdbExtract(@$fdbArr[$eachmac]));
                    }
                    if ($alter_config['MACVEN_ENABLED']) {
                        $containerName = 'NMRSMCNT_' . zb_rand_string(8);
                        $lookupVendorLink = wf_AjaxLink('?module=macvendor&mac=' . @$eachmac . '&raw=true', wf_img('skins/macven.gif', __('Device vendor')), $containerName, false, '');
                        $lookupVendorLink .= wf_tag('span', false, '', 'id="' . $containerName . '"') . '' . wf_tag('span', true);
                        $cells .= wf_TableCell($lookupVendorLink, '350');
                    }
                    $rows .= wf_TableRow($cells, 'row3');
                }
            }
        }
    }
    $result .= wf_TableBody($rows, '100%', '0', 'sortable');
    return $result;
}
Esempio n. 4
0
 function docsis_ModemProfileShow($modemid)
 {
     $modemid = vf($modemid, 3);
     $data = docsis_ModemGetData($modemid);
     $netdata = array();
     $netdata_q = "SELECT * from `nethosts` where `ip`='" . $data['ip'] . "'";
     $netdata = simple_queryall($netdata_q);
     $netdata = print_r($netdata, true);
     $netdata = nl2br($netdata);
     $alluserips = zb_UserGetAllIPs();
     $alluserips = array_flip($alluserips);
     $result = wf_Link("?module=docsis", __('Back'), false, 'ubButton');
     $ajaxcontainer = wf_AjaxLoader() . wf_AjaxLink("?module=docsis&ajaxsnmp=" . $modemid, __('Renew modem data'), 'ajaxdata', true, 'ubButton') . wf_tag('div', false, '', 'id="ajaxdata"') . wf_tag('div', true);
     $result .= wf_modal(__('Modem diagnostics'), __('Modem diagnostics'), $ajaxcontainer, 'ubButton', '500', '400');
     $result .= wf_modal(__('Networking data'), __('Networking data'), $netdata, 'ubButton', '500', '400');
     $result .= wf_delimiter();
     if (!empty($data)) {
         $cells = wf_TableCell(__('ID'));
         $cells .= wf_TableCell($data['id'] . ' ' . wf_JSAlert("?module=docsis&deletemodem=" . $modemid, web_delete_icon(), __('Removing this may lead to irreparable results')));
         $rows = wf_TableRow($cells, 'row3');
         $cells = wf_TableCell(__('IP'));
         $cells .= wf_TableCell($data['ip']);
         $rows .= wf_TableRow($cells, 'row3');
         $cells = wf_TableCell(__('MAC Lan'));
         $cells .= wf_TableCell($data['maclan']);
         $rows .= wf_TableRow($cells, 'row3');
         $cells = wf_TableCell(__('Date'));
         $cells .= wf_TableCell($data['date']);
         $rows .= wf_TableRow($cells, 'row3');
         if (isset($alluserips[$data['userbind']])) {
             $bindedLogin = $alluserips[$data['userbind']];
             $profileLink = ' ' . wf_Link('?module=userprofile&username='******' ' . $bindedLogin, false, '');
         } else {
             $profileLink = '';
         }
         $cells = wf_TableCell(__('Linked user'));
         $cells .= wf_TableCell($data['userbind'] . $profileLink);
         $rows .= wf_TableRow($cells, 'row3');
         $cells = wf_TableCell(__('Notes'));
         $cells .= wf_TableCell($data['note']);
         $rows .= wf_TableRow($cells, 'row3');
         $result .= wf_TableBody($rows, '100%', '0', '');
         $inputs = wf_TextInput('edituserbind', __('Linked user'), $data['userbind'], true, '40');
         $inputs .= wf_TextInput('editnote', __('Notes'), $data['note'], true, '40');
         $inputs .= wf_Submit(__('Save'));
         $form = wf_Form("", 'POST', $inputs, 'glamour');
         $result .= $form;
         show_window(__('Modem profile'), $result);
     } else {
         show_window(__('Error'), __('Strange exeption'));
     }
 }
Esempio n. 5
0
/**
 * Returns switch edit form for some existing device ID
 * 
 * @param int $switchid
 * @return string
 */
function web_SwitchEditForm($switchid)
{
    global $ubillingConfig;
    $switchid = vf($switchid, 3);
    $altCfg = $ubillingConfig->getAlter();
    $result = '';
    $allswitchmodels = zb_SwitchModelsGetAllTag();
    $switchdata = zb_SwitchGetData($switchid);
    $editinputs = wf_Selector('editmodel', $allswitchmodels, 'Model', $switchdata['modelid'], true);
    $editinputs .= wf_TextInput('editip', 'IP', $switchdata['ip'], true, 20);
    $editinputs .= wf_TextInput('editlocation', 'Location', $switchdata['location'], true, 30);
    $editinputs .= wf_TextInput('editdesc', 'Description', $switchdata['desc'], true, 30);
    $editinputs .= wf_TextInput('editsnmp', 'SNMP community', $switchdata['snmp'], true, 20);
    $editinputs .= wf_TextInput('editgeo', 'Geo location', $switchdata['geo'], true, 20);
    $editinputs .= web_SwitchUplinkSelector('editparentid', __('Uplink switch'), $switchdata['parentid']);
    $editinputs .= wf_tag('br');
    $editinputs .= wf_Submit('Save');
    $result .= wf_Form('', 'POST', $editinputs, 'glamour');
    $result .= wf_tag('div', false, '', 'style="clear:both;"') . wf_tag('div', true);
    $result .= wf_delimiter();
    $result .= wf_Link('?module=switches', __('Back'), false, 'ubButton');
    if (cfr('SWITCHPOLL')) {
        $fdbCacheName = 'exports/' . $switchdata['ip'] . '_fdb';
        if (file_exists($fdbCacheName)) {
            $result .= wf_Link('?module=switchpoller&fdbfor=' . $switchdata['ip'], wf_img('skins/menuicons/switchpoller.png') . ' ' . __('Current FDB cache'), false, 'ubButton');
        }
        if (!empty($switchdata['snmp'])) {
            $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');
    }
    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) . ' ';
        }
    }
    if (cfr('SWITCHEDIT')) {
        if (!ispos($switchdata['desc'], 'NP')) {
            $result .= wf_JSAlertStyled('?module=switchreplace&switchid=' . $switchid, wf_img('skins/duplicate_icon.gif') . ' ' . __('Replacement'), __('Are you serious'), 'ubButton') . ' ';
        }
    }
    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');
    }
    return $result;
}
Esempio n. 6
0
 /**
  * Renders available and enabled alerts into  DarkVoid notification area
  * 
  * @return void
  */
 protected function updateAlerts()
 {
     //new tickets alert
     if ($this->altCfg['TB_NEWTICKETNOTIFY']) {
         $newticketcount = zb_TicketsGetAllNewCount();
         if ($newticketcount != 0) {
             $this->alerts .= wf_Link('?module=ticketing', wf_img('skins/ticketnotify.gif', $newticketcount . ' ' . __('support tickets expected processing')), false);
         }
     }
     //new signups notification
     if ($this->altCfg['SIGREQ_ENABLED']) {
         $signups = new SignupRequests();
         $newreqcount = $signups->getAllNewCount();
         if ($newreqcount != 0) {
             $this->alerts .= wf_Link('?module=sigreq', wf_img('skins/sigreqnotify.gif', $newreqcount . ' ' . __('signup requests expected processing')), false);
         }
     }
     //check for unread messages in instant messanger
     if ($this->altCfg['TB_UBIM']) {
         if (cfr('UBIM')) {
             $unreadMessageCount = im_CheckForUnreadMessages();
             if ($unreadMessageCount) {
                 //we have new messages
                 $unreadIMNotify = __('You received') . ' ' . $unreadMessageCount . ' ' . __('new messages');
                 $urlIM = $unreadIMNotify . wf_delimiter() . wf_Link("?module=ubim&checknew=true", __('Click here to go to the instant messaging service.'), false, 'ubButton');
                 $this->alerts .= wf_Link("?module=ubim&checknew=true", wf_img("skins/ubim_blink.gif", $unreadMessageCount . ' ' . __('new message received')), false, '');
                 //$this->alerts.=wf_modalOpened(__('New messages received'), $urlIM, '450', '200');
             }
         }
     }
     //check sms sending queue
     if ($this->altCfg['WATCHDOG_ENABLED']) {
         $smsQueueCount = rcms_scandir(DATA_PATH . 'tsms/');
         $smsQueueCount = sizeof($smsQueueCount);
         if ($smsQueueCount > 0) {
             $this->alerts .= wf_Link("?module=tsmsqueue", wf_img("skins/sms.png", $smsQueueCount . ' ' . __('SMS in queue')), false, '');
         }
     }
     if ($this->altCfg['TB_TASKMANNOTIFY']) {
         //only "for me" tasks notification
         if ($this->altCfg['TB_TASKMANNOTIFY'] == 1) {
             $undoneTasksCount = ts_GetUndoneCountersMy();
             if ($undoneTasksCount > 0) {
                 $undoneAlert = $undoneTasksCount . ' ' . __('Undone tasks') . ' ' . __('for me');
                 $this->alerts .= wf_Link("?module=taskman&show=undone", wf_img("skins/jobnotify.png", $undoneAlert), false, '');
             }
         }
         //total undone tasks count notification
         if ($this->altCfg['TB_TASKMANNOTIFY'] == 2) {
             $undoneTasksCount = ts_GetUndoneCountersAll();
             if ($undoneTasksCount > 0) {
                 $undoneAlert = $undoneTasksCount . ' ' . __('Undone tasks') . ' ' . __('for all');
                 $this->alerts .= wf_Link("?module=taskman&show=undone", wf_img("skins/jobnotify.png", $undoneAlert), false, '');
             }
         }
         //total+my undone tasks count notification
         if ($this->altCfg['TB_TASKMANNOTIFY'] == 3) {
             $undoneTasksCount = ts_GetUndoneCountersAll();
             if ($undoneTasksCount > 0) {
                 $undoneTasksCountMy = ts_GetUndoneCountersMy();
                 $undoneAlert = $undoneTasksCount . ' ' . __('Undone tasks') . ': ' . __('for all') . ' ' . ($undoneTasksCount - $undoneTasksCountMy) . ' / ' . __('for me') . ' ' . $undoneTasksCountMy;
                 $this->alerts .= wf_Link("?module=taskman&show=undone", wf_img("skins/jobnotify.png", $undoneAlert), false, '');
             }
         }
     }
     //switchmon at notify area
     if ($this->altCfg['TB_SWITCHMON']) {
         $dead_raw = zb_StorageGet('SWDEAD');
         $last_pingtime = zb_StorageGet('SWPINGTIME');
         $deathTime = zb_SwitchesGetAllDeathTime();
         $deadarr = array();
         $content = '';
         if ($this->altCfg['SWYMAP_ENABLED']) {
             $content = wf_Link('?module=switchmap', wf_img('skins/swmapsmall.png', __('Switches map')), false);
         }
         $content .= wf_AjaxLoader() . wf_AjaxLink("?module=switches&forcereping=true&ajaxping=true", wf_img('skins/refresh.gif', __('Force ping')), 'switchping', true, '');
         if ($dead_raw) {
             $deadarr = unserialize($dead_raw);
             if (!empty($deadarr)) {
                 //there is some dead switches
                 $deadcount = sizeof($deadarr);
                 if ($this->altCfg['SWYMAP_ENABLED']) {
                     //getting geodata
                     $switchesGeo = zb_SwitchesGetAllGeo();
                 }
                 //ajax container
                 $content .= wf_tag('div', false, '', 'id="switchping"');
                 foreach ($deadarr as $ip => $switch) {
                     if ($this->altCfg['SWYMAP_ENABLED']) {
                         if (isset($switchesGeo[$ip])) {
                             if (!empty($switchesGeo[$ip])) {
                                 $devicefind = wf_Link('?module=switchmap&finddevice=' . $switchesGeo[$ip], wf_img('skins/icon_search_small.gif', __('Find on map'))) . ' ';
                             } else {
                                 $devicefind = '';
                             }
                         } else {
                             $devicefind = '';
                         }
                     } else {
                         $devicefind = '';
                     }
                     //check morgue records for death time
                     if (isset($deathTime[$ip])) {
                         $deathClock = wf_img('skins/clock.png', __('Switch dead since') . ' ' . $deathTime[$ip]) . ' ';
                     } else {
                         $deathClock = '';
                     }
                     //switch location link
                     $switchLocator = wf_Link('?module=switches&gotoswitchbyip=' . $ip, web_edit_icon(__('Go to switch')));
                     //add switch as dead
                     $content .= $devicefind . ' ' . $switchLocator . ' ' . $deathClock . $ip . ' - ' . $switch . '<br>';
                 }
                 //ajax container end
                 $content .= wf_delimiter() . __('Cache state at time') . ': ' . date("H:i:s", $last_pingtime) . wf_tag('div', true);
                 $this->alerts .= wf_tag('div', false, 'ubButton') . wf_modal(__('Dead switches') . ': ' . $deadcount, __('Dead switches'), $content, '', '500', '400') . wf_tag('div', true);
             } else {
                 $content .= wf_tag('div', false, '', 'id="switchping"') . __('Switches are okay, everything is fine - I guarantee') . wf_delimiter() . __('Cache state at time') . ': ' . date("H:i:s", $last_pingtime) . wf_tag('div', true);
                 $this->alerts .= wf_tag('div', false, 'ubButton') . wf_modal(__('All switches alive'), __('All switches alive'), $content, '', '500', '400') . wf_tag('div', true);
             }
         } else {
             $content .= wf_tag('div', false, '', 'id="switchping"') . __('Switches are okay, everything is fine - I guarantee') . wf_delimiter() . __('Cache state at time') . ': ' . @date("H:i:s", $last_pingtime) . wf_tag('div', true);
             $this->alerts .= wf_tag('div', false, 'ubButton') . wf_modal(__('All switches alive'), __('All switches alive'), $content, '', '500', '400') . wf_tag('div', true);
         }
     }
     file_put_contents(self::CACHE_PATH . self::CACHE_PREFIX . $this->myLogin, $this->alerts);
 }
Esempio n. 7
0
/**
 * Return contact list 
 * 
 * @return string
 */
function im_ContactList()
{
    $me = whoami();
    @($employeeNames = unserialize(ts_GetAllEmployeeLoginsCached()));
    $alladmins = rcms_scandir(DATA_PATH . "users/");
    $activeAdmins = im_GetActiveAdmins();
    $result = '';
    $rows = '';
    if (!empty($alladmins)) {
        foreach ($alladmins as $eachadmin) {
            if ($eachadmin != $me) {
                //need checks for unread messages for each user
                if (wf_CheckGet(array('checknew'))) {
                    $unreadCounter = im_CheckForUnreadMessagesByUser($eachadmin);
                    if ($unreadCounter != 0) {
                        $blinker = wf_img('skins/icon_mail.gif');
                    } else {
                        $blinker = '';
                    }
                } else {
                    $blinker = '';
                }
                if (isset($activeAdmins[$eachadmin])) {
                    $aliveFlag = web_bool_led(true);
                } else {
                    $aliveFlag = web_bool_led(false);
                }
                $conatactAvatar = gravatar_ShowAdminAvatar($eachadmin, '32') . ' ';
                $adminName = isset($employeeNames[$eachadmin]) ? $employeeNames[$eachadmin] : $eachadmin;
                $threadLink = wf_AjaxLink("?module=ubim&showthread=" . $eachadmin, $adminName . ' ' . $blinker, 'threadContainer', false, 'ubimcontact');
                //$threadLink.=$blinker;
                $cells = wf_TableCell($aliveFlag, '', '', 'valign="center" align="center"');
                $cells .= wf_TableCell($conatactAvatar, '35', '', 'valign="center" align="left"');
                $cells .= wf_TableCell($threadLink, '', '', 'valign="center" align="left"');
                $rows .= wf_TableRow($cells, '');
            }
        }
        $result = wf_TableBody($rows, '100%', '0', 'glamour');
        $result .= wf_delimiter() . wf_Link("?module=ubim&avatarcontrol=true", __('Avatar control'), false, 'ubButton');
    }
    return $result;
}
Esempio n. 8
0
 $alterconfig = rcms_parse_ini_file(CONFIG_PATH . 'alter.ini');
 $parseMe = '';
 $cloneFlag = false;
 $arping_path = $alterconfig['ARPING'];
 $arping_iface = $alterconfig['ARPING_IFACE'];
 $arping_options = $alterconfig['ARPING_EXTRA_OPTIONS'];
 $sudo_path = $config['SUDO'];
 $userdata = zb_UserGetStargazerData($login);
 $user_ip = $userdata['IP'];
 $command = $sudo_path . ' ' . $arping_path . ' ' . $arping_iface . ' ' . $arping_options . ' ' . $user_ip;
 $raw_result = shell_exec($command);
 if (wf_CheckGet(array('ajax'))) {
     die($raw_result);
 }
 $ping_result = wf_AjaxLoader();
 $ping_result .= wf_AjaxLink('?module=pl_arping&username='******'&ajax=true', __('Renew'), 'ajaxarping', true, 'ubButton');
 $ping_result .= wf_tag('pre', false, '', 'id="ajaxarping"') . $raw_result . wf_tag('pre', true);
 //detecting duplicate MAC
 $rawArray = explodeRows($raw_result);
 if (!empty($rawArray)) {
     foreach ($rawArray as $io => $eachline) {
         if (ispos($eachline, 'packets transmitted')) {
             $parseMe = $eachline;
         }
     }
 }
 if (!empty($parseMe)) {
     $parseMe = explode(',', $parseMe);
     if (sizeof($parseMe) == 3) {
         $txCount = vf($parseMe[0], 3);
         $rxCount = vf($parseMe[1], 3);
Esempio n. 9
0
/**
 * Returns task creation form for userprofile usage
 * DEPRECATED: use ts_TaskCreateFormUnified instead this
 * 
 * @param string $address
 * @param string $mobile
 * @param string $phone
 * @param string $login
 * @return  string
 */
function ts_TaskCreateFormProfile($address, $mobile, $phone, $login)
{
    $altercfg = rcms_parse_ini_file(CONFIG_PATH . "alter.ini");
    $alljobtypes = ts_GetAllJobtypes();
    $allemployee = ts_GetActiveEmployee();
    //construct sms sending inputs
    if ($altercfg['SENDDOG_ENABLED']) {
        $smsInputs = wf_CheckInput('newtasksendsms', __('Send SMS'), false, false);
    } else {
        $smsInputs = '';
    }
    $sup = wf_tag('sup', false) . '*' . wf_tag('sup', true);
    $inputs = '<!--ugly hack to prevent datepicker autoopen --> <input 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_delimiter();
    $inputs .= wf_TextInput('newtaskaddress', __('Address') . $sup, $address, true, '30');
    //hidden for new task login input
    $inputs .= wf_HiddenInput('newtasklogin', $login);
    $inputs .= wf_tag('br');
    $inputs .= wf_TextInput('newtaskphone', __('Phone') . $sup, $mobile . ' ' . $phone, true, '30');
    $inputs .= wf_tag('br');
    $inputs .= wf_Selector('newtaskjobtype', $alljobtypes, __('Job type'), '', true);
    $inputs .= wf_tag('br');
    $inputs .= wf_Selector('newtaskemployee', $allemployee, __('Who should do'), '', true);
    $inputs .= wf_tag('br');
    $inputs .= wf_tag('label') . __('Job note') . wf_tag('label', true) . wf_tag('br');
    $inputs .= ts_TaskTypicalNotesSelector();
    $inputs .= wf_TextArea('newjobnote', '', '', true, '35x5');
    $inputs .= $smsInputs;
    $inputs .= wf_Submit(__('Create new task'));
    if (!empty($login)) {
        $inputs .= wf_AjaxLoader();
        $inputs .= ' ' . wf_AjaxLink('?module=prevtasks&username='******'skins/icon_search_small.gif', __('Previous user tasks')), 'taskshistorycontainer', false, '');
        $inputs .= wf_tag('br');
        $inputs .= wf_tag('div', false, '', 'id="taskshistorycontainer"') . wf_tag('div', true);
    }
    $result = wf_Form("?module=taskman&gotolastid=true", 'POST', $inputs, 'glamour');
    $result .= __('All fields marked with an asterisk are mandatory');
    return $result;
}
Esempio n. 10
0
/**
 * Returns custom report sysload scripts output
 * 
 * @param string $scriptoption option from alter.ini -> SYSLOAD_CUSTOM_SCRIPTS
 * 
 * @return string
 */
function web_ReportSysloadCustomScripts($scriptoption)
{
    $result = '';
    //internal script ajax handling
    if (wf_CheckGet(array('ajxcscrun'))) {
        $runpath = base64_decode($_GET['ajxcscrun']);
        if (!empty($runpath)) {
            $script_result = wf_tag('pre') . shell_exec($runpath) . wf_tag('pre', true);
            die($script_result);
        }
    }
    $scriptdata = explode(',', $scriptoption);
    if (!empty($scriptdata)) {
        $result .= wf_AjaxLoader();
        foreach ($scriptdata as $io => $eachscript) {
            $curScript = explode(':', $eachscript);
            if (!empty($curScript)) {
                $name = $curScript[0];
                $path = $curScript[1];
                $result .= wf_AjaxLink('?module=report_sysload&ajxcscrun=' . base64_encode($path), $name, 'custommoncontainder', false, 'ubButton');
            }
        }
        $result .= wf_delimiter();
        $result .= wf_tag('span', false, '', 'id="custommoncontainder"') . wf_tag('span', true);
    }
    return $result;
}
Esempio n. 11
0
 /**
  * Returns basic image controls
  * 
  * @param int $imageId existing image ID
  * @return string
  */
 protected function imageControls($imageId)
 {
     $result = wf_tag('br');
     $downloadUrl = self::MODULE_URL . '&scope=' . $this->scope . '&itemid=' . $this->itemId . '&download=' . $imageId;
     $result .= wf_Link($downloadUrl, wf_img('skins/icon_download.png', __('Download')), false, '');
     $deleteUrl = self::MODULE_URL . '&scope=' . $this->scope . '&itemid=' . $this->itemId . '&delete=' . $imageId;
     $result .= wf_AjaxLink($deleteUrl, web_delete_icon(), 'ajRefCont_' . $imageId, false, '');
     return $result;
 }
Esempio n. 12
0
        if (wf_CheckGet(array('packsize'))) {
            $addParams .= ' -s ' . vf($_GET['packsize'], 3);
        }
        if (wf_CheckGet(array('packcount'))) {
            $addParams .= ' -c ' . vf($_GET['packcount'], 3);
        }
        //setting ajax background params
        $addAjax = '';
        if (wf_CheckPost(array('packet'))) {
            $addAjax .= "&packsize=" . vf($_POST['packet'], 3);
            $addParams .= ' -s ' . vf($_POST['packet'], 3);
        }
        if (wf_CheckPost(array('count'))) {
            $addAjax .= "&packcount=" . vf($_POST['count'], 3);
            $addParams .= ' -c ' . vf($_POST['count'], 3);
        }
        $command = $sudo_path . ' ' . $ping_path . ' -i 0.01 -c 10 ' . $addParams . ' ' . $user_ip;
        $ping_result = wf_AjaxLoader();
        $ping_result .= wf_AjaxLink('?module=pl_pinger&username='******'&ajax=true' . $addAjax, __('Renew'), 'ajaxping', true, 'ubButton');
        $rawResult = shell_exec($command);
        if (wf_CheckGet(array('ajax'))) {
            die($rawResult);
        }
        $ping_result .= wf_tag('pre', false, '', 'id="ajaxping"') . $rawResult . wf_tag('pre', true);
        show_window(__('Settings'), wf_PlPingerOptionsForm());
        show_window(__('User pinger'), $ping_result);
        show_window('', web_UserControls($login));
    }
} else {
    show_error(__('You cant control this module'));
}