Ejemplo n.º 1
0
 /**
  * Returns ADcomments indicator
  * 
  * @return string
  */
 protected function getAdcommentsIndicator()
 {
     $result = '';
     if (!isset($this->alterCfg['NO_ADCOMMENTS_IN_PROFILE'])) {
         if ($this->alterCfg['ADCOMMENTS_ENABLED']) {
             $adcomments = new ADcomments('USERNOTES');
             $result = ' ' . wf_Link('?module=notesedit&username='******'');
         } else {
             $result = '';
         }
     }
     return $result;
 }
Ejemplo n.º 2
0
                simple_update_field('switches', 'snmp', $_POST['editsnmp'], "WHERE `id`='" . $switchid . "'");
                simple_update_field('switches', 'geo', $_POST['editgeo'], "WHERE `id`='" . $switchid . "'");
                if ($_POST['editparentid'] != $switchid) {
                    simple_update_field('switches', 'parentid', $_POST['editparentid'], "WHERE `id`='" . $switchid . "'");
                }
                log_register('SWITCH CHANGE [' . $switchid . ']' . ' IP ' . $_POST['editip'] . " LOC `" . $_POST['editlocation'] . "`");
                rcms_redirect("?module=switches&edit=" . $switchid);
            } else {
                show_error(__('Access denied'));
            }
        }
        //render switch edit form
        show_window(__('Edit switch'), web_SwitchEditForm($switchid));
        //minimap container
        if ($altCfg['SWYMAP_ENABLED']) {
            if (!empty($switchdata['geo'])) {
                show_window(__('Mini-map'), wf_delimiter() . web_SwitchMiniMap($switchdata));
            }
        }
        //downlinks list
        web_SwitchDownlinksList($switchid);
        //additional comments engine
        if ($altCfg['ADCOMMENTS_ENABLED']) {
            $adcomments = new ADcomments('SWITCHES');
            show_window(__('Additional comments'), $adcomments->renderComments($switchid));
        }
        show_window('', wf_Link('?module=switches', 'Back', true, 'ubButton'));
    }
} else {
    show_error(__('Access denied'));
}
Ejemplo n.º 3
0
/**
 * Returns data for jq fullcalendar widget with all tasks
 * 
 * @global object $ubillingConfig
 * @return string
 */
function ts_JGetAllTasks()
{
    global $ubillingConfig;
    $altCfg = $ubillingConfig->getAlter();
    //ADcomments init
    if ($altCfg['ADCOMMENTS_ENABLED']) {
        $adcomments = new ADcomments('TASKMAN');
        $adcFlag = true;
    } else {
        $adcFlag = false;
    }
    $allemployee = ts_GetAllEmployee();
    $alljobdata = ts_GetAllJobtypesData();
    $curyear = curyear();
    $curmonth = date("m");
    //per employee filtering
    $displaytype = isset($_POST['displaytype']) ? $_POST['displaytype'] : 'all';
    if ($displaytype == 'onlyme') {
        $whoami = whoami();
        $curempid = ts_GetEmployeeByLogin($whoami);
        $appendQuery = " AND `employee`='" . $curempid . "'";
    } else {
        $appendQuery = '';
    }
    if ($curmonth != 1 and $curmonth != 12) {
        $query = "SELECT * from `taskman` WHERE `startdate` LIKE '" . $curyear . "-%' " . $appendQuery . " ORDER BY `date` ASC";
    } else {
        if ($appendQuery) {
            $appendQuery = str_replace('AND', 'WHERE', $appendQuery);
        }
        $query = "SELECT * from `taskman` " . $appendQuery . " ORDER BY `date` ASC";
    }
    $allundone = simple_queryall($query);
    $result = '';
    $i = 1;
    $taskcount = sizeof($allundone);
    if (!empty($allundone)) {
        foreach ($allundone as $io => $eachtask) {
            if ($i != $taskcount) {
                $thelast = ',';
            } else {
                $thelast = '';
            }
            $startdate = strtotime($eachtask['startdate']);
            $startdate = date("Y, n-1, j", $startdate);
            //time ordering
            if (!empty($eachtask['starttime'])) {
                $startTime = $eachtask['starttime'];
                $startTime = substr($startTime, 0, 5) . ' ';
                $startTimeTimestamp = ', ' . str_replace(':', ', ', $startTime);
            } else {
                $startTime = '';
                $startTimeTimestamp = '';
            }
            if ($eachtask['enddate'] != '') {
                $enddate = strtotime($eachtask['enddate']);
                $enddate = date("Y, n-1, j", $enddate);
            } else {
                $enddate = $startdate;
            }
            if ($eachtask['status'] == 0) {
                $coloring = "className : 'undone',";
                if (isset($alljobdata[$eachtask['jobtype']])) {
                    if (!empty($alljobdata[$eachtask['jobtype']]['jobcolor'])) {
                        $coloring = "className : 'jobcolorcustom_" . $eachtask['jobtype'] . "',";
                    } else {
                        $coloring = "className : 'undone',";
                    }
                } else {
                    $jobColorClass = "className : 'undone',";
                }
            } else {
                $coloring = '';
            }
            //adcomments detect
            if ($adcFlag) {
                $adcommentsCount = $adcomments->getCommentsCount($eachtask['id']);
            } else {
                $adcommentsCount = 0;
            }
            if ($adcommentsCount > 0) {
                $adcText = ' (' . $adcommentsCount . ')';
            } else {
                $adcText = '';
            }
            $result .= "\n                      {\n                        title: '" . $startTime . $eachtask['address'] . " - " . @$alljobdata[$eachtask['jobtype']]['jobname'] . $adcText . "',\n                        start: new Date(" . $startdate . $startTimeTimestamp . "),\n                        end: new Date(" . $enddate . "),\n                        " . $coloring . "\n                        url: '?module=taskman&edittask=" . $eachtask['id'] . "'\n\t\t      }\n                    " . $thelast;
        }
    }
    return $result;
}
Ejemplo n.º 4
0
                     $custmaps->itemEdit($editItemId, $_POST['edititemtype'], $_POST['edititemgeo'], $_POST['edititemname'], $_POST['edititemlocation']);
                     rcms_redirect('?module=custmaps&edititem=' . $editItemId);
                 } else {
                     show_error(__('Permission denied'));
                 }
             }
             //show item edit form
             show_window(__('Edit'), $custmaps->itemEditForm($editItemId));
             //photostorage link
             if ($altCfg['PHOTOSTORAGE_ENABLED']) {
                 $imageControl = wf_Link('?module=photostorage&scope=CUSTMAPSITEMS&itemid=' . $editItemId . '&mode=list', wf_img('skins/photostorage.png') . ' ' . __('Upload images'), false, 'ubButton');
                 show_window('', $imageControl);
             }
             //additional comments
             if ($altCfg['ADCOMMENTS_ENABLED']) {
                 $adcomments = new ADcomments('CUSTMAPITEMS');
                 show_window(__('Additional comments'), $adcomments->renderComments($editItemId));
             }
         }
     } else {
         if (!wf_CheckGet(array('duplicates'))) {
             //render map items list
             show_window(__('Objects') . ': ' . $custmaps->mapGetName($_GET['showitems']), $custmaps->renderItemsList($_GET['showitems']));
         } else {
             //show duplicate map objects
             show_window(__('Show duplicates') . ': ' . $custmaps->mapGetName($_GET['showitems']), $custmaps->renderItemDuplicateList($_GET['showitems']));
         }
     }
 } else {
     $mapId = $_GET['showmap'];
     $placemarks = '';
Ejemplo n.º 5
0
/**
 * Returns list of all available switches devices with its controls. Also catches ajaxping and forcereping events.
 * 
 * @return string
 */
function web_SwitchesShow()
{
    global $ubillingConfig;
    $alterconf = $ubillingConfig->getAlter();
    $allswitches = zb_SwitchesGetAll();
    $modelnames = zb_SwitchModelsGetAllTag();
    $currenttime = time();
    $reping_timeout = $alterconf['SW_PINGTIMEOUT'];
    $deathTime = zb_SwitchesGetAllDeathTime();
    //counters
    $countTotal = 0;
    $countAlive = 0;
    $countDead = 0;
    $countNp = 0;
    $countOnMap = 0;
    $countSwpoll = 0;
    $countMtsigmon = 0;
    $countOlt = 0;
    $countLinked = 0;
    //non realtime switches pinging
    $last_pingtime = zb_StorageGet('SWPINGTIME');
    if (!$last_pingtime) {
        zb_SwitchesRepingAll();
        zb_StorageSet('SWPINGTIME', $currenttime);
        $last_pingtime = $currenttime;
    } else {
        if ($currenttime > $last_pingtime + $reping_timeout * 60) {
            // normal timeout reping sub here
            zb_SwitchesRepingAll();
            zb_StorageSet('SWPINGTIME', $currenttime);
        }
    }
    //force total reping and update cache
    if (wf_CheckGet(array('forcereping'))) {
        zb_SwitchesRepingAll();
        zb_StorageSet('SWPINGTIME', $currenttime);
        if (wf_CheckGet(array('ajaxping'))) {
            $dead_raw = zb_StorageGet('SWDEAD');
            $deathTime = zb_SwitchesGetAllDeathTime();
            $deadarr = array();
            $ajaxResult = '';
            if ($dead_raw) {
                $deadarr = unserialize($dead_raw);
                if (!empty($deadarr)) {
                    //there is some dead switches
                    $deadcount = sizeof($deadarr);
                    if ($alterconf['SWYMAP_ENABLED']) {
                        //getting geodata
                        $switchesGeo = zb_SwitchesGetAllGeo();
                    }
                    //ajax container
                    $ajaxResult .= wf_tag('div', false, '', 'id="switchping"');
                    foreach ($deadarr as $ip => $switch) {
                        if ($alterconf['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
                        $ajaxResult .= $devicefind . ' ' . $switchLocator . ' ' . $deathClock . $ip . ' - ' . $switch . '<br>';
                    }
                } else {
                    $ajaxResult = __('Switches are okay, everything is fine - I guarantee');
                }
            }
            $ajaxResult .= wf_delimiter() . __('Cache state at time') . ': ' . date("H:i:s");
            print $ajaxResult;
            //darkvoid update
            $notifyArea = new DarkVoid();
            $notifyArea->flushCache();
            die;
        }
    }
    //load dead switches cache
    $dead_switches_raw = zb_StorageGet('SWDEAD');
    if (!$dead_switches_raw) {
        $dead_switches = array();
    } else {
        $dead_switches = unserialize($dead_switches_raw);
    }
    //create new ADcomments object if enabled
    if ($alterconf['ADCOMMENTS_ENABLED']) {
        $adcomments = new ADcomments('SWITCHES');
    }
    $tablecells = wf_TableCell(__('ID'));
    $tablecells .= wf_TableCell(__('IP'));
    $tablecells .= wf_TableCell(__('Location'));
    $tablecells .= wf_TableCell(__('Active'));
    $tablecells .= wf_TableCell(__('Model'));
    $tablecells .= wf_TableCell(__('SNMP community'));
    $tablecells .= wf_TableCell(__('Geo location'));
    $tablecells .= wf_TableCell(__('Description'));
    $tablecells .= wf_TableCell(__('Actions'));
    $tablerows = wf_TableRow($tablecells, 'row1');
    $lighter = 'onmouseover="this.className = \'row2\';" onmouseout="this.className = \'row3\';" ';
    if (!empty($allswitches)) {
        foreach ($allswitches as $io => $eachswitch) {
            if (isset($dead_switches[$eachswitch['ip']])) {
                if (isset($deathTime[$eachswitch['ip']])) {
                    $obituary = __('Switch dead since') . ' ' . $deathTime[$eachswitch['ip']];
                } else {
                    $obituary = '';
                }
                $aliveled = web_red_led($obituary);
                $aliveflag = '0';
                $countDead++;
            } else {
                if (strpos($eachswitch['desc'], 'NP') === false) {
                    $aliveled = web_green_led();
                    $aliveflag = '1';
                    $countAlive++;
                } else {
                    $aliveled = web_yellow_led();
                    $aliveflag = '2';
                    $countNp++;
                }
            }
            $tablecells = wf_TableCell($eachswitch['id']);
            $tablecells .= wf_TableCell($eachswitch['ip'], '', '', 'sorttable_customkey="' . ip2int($eachswitch['ip']) . '"');
            $tablecells .= wf_TableCell($eachswitch['location']);
            $tablecells .= wf_TableCell($aliveled, '', '', 'sorttable_customkey="' . $aliveflag . '"');
            $tablecells .= wf_TableCell(@$modelnames[$eachswitch['modelid']]);
            $tablecells .= wf_TableCell($eachswitch['snmp']);
            $tablecells .= wf_TableCell($eachswitch['geo']);
            $tablecells .= wf_TableCell($eachswitch['desc']);
            $switchcontrols = '';
            if (cfr('SWITCHESEDIT')) {
                $switchcontrols .= wf_Link('?module=switches&edit=' . $eachswitch['id'], web_edit_icon());
            }
            if (cfr('SWITCHPOLL')) {
                if (!empty($eachswitch['snmp']) and ispos($eachswitch['desc'], 'SWPOLL')) {
                    $switchcontrols .= '&nbsp;' . wf_Link('?module=switchpoller&switchid=' . $eachswitch['id'], wf_img('skins/snmp.png', __('SNMP query')));
                    $countSwpoll++;
                }
            }
            if ($alterconf['SWYMAP_ENABLED']) {
                if (!empty($eachswitch['geo'])) {
                    $switchcontrols .= wf_Link('?module=switchmap&finddevice=' . $eachswitch['geo'], wf_img('skins/icon_search_small.gif', __('Find on map')));
                    $countOnMap++;
                }
                if (!empty($eachswitch['parentid'])) {
                    $switchcontrols .= wf_Link('?module=switchmap&finddevice=' . $eachswitch['geo'] . '&showuplinks=true&traceid=' . $eachswitch['id'], wf_img('skins/ymaps/uplinks.png', __('Uplink switch')));
                    $countLinked++;
                }
            }
            if (ispos($eachswitch['desc'], 'MTSIGMON')) {
                $countMtsigmon++;
            }
            if (ispos($eachswitch['desc'], 'OLT')) {
                $countOlt++;
            }
            if ($alterconf['ADCOMMENTS_ENABLED']) {
                $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;
            $tablerows .= wf_tag('tr', true);
            $countTotal++;
        }
    }
    $result = wf_TableBody($tablerows, '100%', '0', 'sortable');
    $result .= wf_img('skins/icon_active.gif') . ' ' . __('Alive switches') . ' - ' . ($countAlive + $countNp) . ' (' . $countAlive . '+' . $countNp . ')' . wf_tag('br');
    $result .= wf_img('skins/icon_inactive.gif') . ' ' . __('Dead switches') . ' - ' . $countDead . wf_tag('br');
    $result .= wf_img('skins/yellow_led.png') . ' ' . __('NP switches') . ' - ' . $countNp . wf_tag('br');
    $result .= wf_img('skins/snmp.png') . ' ' . __('SWPOLL query') . ' - ' . $countSwpoll . wf_tag('br');
    $result .= wf_img('skins/wifi.png') . ' ' . __('MTSIGMON devices') . ' - ' . $countMtsigmon . wf_tag('br');
    $result .= wf_img('skins/pon_icon.gif') . ' ' . __('OLT devices') . ' - ' . $countOlt . wf_tag('br');
    $result .= wf_img('skins/icon_search_small.gif') . ' ' . __('Placed on map') . ' - ' . $countOnMap . wf_tag('br');
    $result .= wf_img('skins/ymaps/uplinks.png') . ' ' . __('Have uplinks') . ' - ' . $countLinked . wf_tag('br');
    $result .= wf_tag('br') . wf_tag('b') . __('Total') . ': ' . $countTotal . wf_tag('b', true) . wf_tag('br');
    return $result;
}
Ejemplo n.º 6
0
 /**
  * Returns list of duplicate coords/name items for some existing map
  * 
  * @param int $mapid
  * @return string
  */
 public function renderItemDuplicateList($mapid)
 {
     $mapid = vf($mapid, 3);
     $result = '';
     $messages = new UbillingMessageHelper();
     $itemsCount = 0;
     $filterArray = array();
     if ($this->altCfg['ADCOMMENTS_ENABLED']) {
         $adcomments = new ADcomments('CUSTMAPITEMS');
         $adc = true;
     } else {
         $adc = false;
     }
     //counting unique geo coords
     if (!empty($this->allItems)) {
         foreach ($this->allItems as $ia => $eachItem) {
             if ($eachItem['mapid'] == $mapid) {
                 if (isset($filterArray[$eachItem['geo']])) {
                     $filterArray[$eachItem['geo']]++;
                 } else {
                     $filterArray[$eachItem['geo']] = 1;
                 }
             }
         }
     }
     $result .= wf_Link('?module=custmaps&showitems=' . $mapid, __('Back'), false, 'ubButton');
     $result .= wf_delimiter();
     $cells = wf_TableCell(__('ID'));
     $cells .= wf_TableCell(__('Type'));
     $cells .= wf_TableCell(__('Geo location'));
     $cells .= wf_TableCell(__('Name'));
     $cells .= wf_TableCell(__('Location'));
     $cells .= wf_TableCell(__('Actions'));
     $rows = wf_TableRow($cells, 'row1');
     if (!empty($this->allItems)) {
         foreach ($this->allItems as $io => $each) {
             $indicator = $adc ? $adcomments->getCommentsIndicator($each['id']) : '';
             if ($each['mapid'] == $mapid) {
                 if (isset($filterArray[$each['geo']])) {
                     if ($filterArray[$each['geo']] > 1) {
                         $cells = wf_TableCell($each['id']);
                         $cells .= wf_TableCell($this->itemGetTypeName($each['type']));
                         $cells .= wf_TableCell($each['geo']);
                         $cells .= wf_TableCell($each['name']);
                         $cells .= wf_TableCell($each['location']);
                         $actLinks = '';
                         if (cfr('CUSTMAPEDIT')) {
                             $actLinks .= wf_JSAlertStyled('?module=custmaps&deleteitem=' . $each['id'], web_delete_icon(), $messages->getDeleteAlert()) . ' ';
                         }
                         $actLinks .= wf_JSAlertStyled('?module=custmaps&edititem=' . $each['id'], web_edit_icon(), $messages->getEditAlert()) . ' ';
                         $actLinks .= wf_Link('?module=custmaps&showmap=' . $each['mapid'] . '&locateitem=' . $each['geo'] . '&zoom=' . $this->ymapsCfg['FINDING_ZOOM'], wf_img('skins/icon_search_small.gif', __('Find on map')), false) . ' ';
                         $actLinks .= $indicator;
                         $cells .= wf_TableCell($actLinks);
                         $rows .= wf_TableRow($cells, 'row3');
                         $itemsCount++;
                     }
                 }
             }
         }
     }
     $result .= wf_TableBody($rows, '100%', '0', 'sortable');
     $result .= __('Total') . ': ' . $itemsCount;
     return $result;
     return $result;
 }
Ejemplo n.º 7
0
<?php

if (cfr('NOTES')) {
    if (isset($_GET['username'])) {
        $login = vf($_GET['username']);
        // change notes if need
        if (isset($_POST['newnotes'])) {
            $notes = $_POST['newnotes'];
            zb_UserDeleteNotes($login);
            zb_UserCreateNotes($login, $notes);
            rcms_redirect("?module=notesedit&username=" . $login);
        }
        $current_notes = zb_UserGetnotes($login);
        $useraddress = zb_UserGetFullAddress($login) . ' (' . $login . ')';
        // Edit form construct
        $fieldnames = array('fieldname1' => __('Current notes'), 'fieldname2' => __('New notes'));
        $fieldkey = 'newnotes';
        $form = web_EditorStringDataForm($fieldnames, $fieldkey, $useraddress, $current_notes);
        show_window(__('Edit notes'), $form);
        //additional notes
        $altCfg = $ubillingConfig->getAlter();
        if ($altCfg['ADCOMMENTS_ENABLED']) {
            $adcomments = new ADcomments('USERNOTES');
            show_window(__('Additional comments'), $adcomments->renderComments($login));
        }
        //user controls here
        show_window('', web_UserControls($login));
    }
} else {
    show_error(__('You cant control this module'));
}
Ejemplo n.º 8
0
 /**
  * Renders json formatted data for jquery data tables list
  * 
  * @return string
  */
 public function ajaxOnuData()
 {
     $allRealnames = zb_UserGetAllRealnames();
     $allAddress = zb_AddressGetFulladdresslistCached();
     if ($this->altCfg['ADCOMMENTS_ENABLED']) {
         $adcomments = new ADcomments('PONONU');
         $adc = true;
     } else {
         $adc = false;
     }
     $this->loadSignalsCache();
     $result = '{ 
               "aaData": [ ';
     if (!empty($this->allOnu)) {
         foreach ($this->allOnu as $io => $each) {
             if (!empty($each['login'])) {
                 $userLogin = trim($each['login']);
                 $userLink = wf_Link('?module=userprofile&username='******' ' . @$allAddress[$userLogin], false);
                 $userLink = str_replace('"', '', $userLink);
                 $userLink = trim($userLink);
                 @($userRealName = $allRealnames[$userLogin]);
                 $userRealName = str_replace('"', '', $userRealName);
                 $userRealName = trim($userRealName);
             } else {
                 $userLink = '';
                 $userRealName = '';
             }
             //checking adcomments availability
             if ($adc) {
                 $indicatorIcon = $adcomments->getCommentsIndicator($each['id']);
                 $indicatorIcon = str_replace('"', '\'', $indicatorIcon);
                 $indicatorIcon = trim($indicatorIcon);
             } else {
                 $indicatorIcon = '';
             }
             $actLinks = wf_Link('?module=ponizer&editonu=' . $each['id'], web_edit_icon(), false);
             $actLinks = str_replace('"', '', $actLinks);
             $actLinks = trim($actLinks);
             $actLinks .= ' ' . $indicatorIcon;
             //coloring signal
             if (isset($this->signalCache[$each['mac']])) {
                 $signal = $this->signalCache[$each['mac']];
                 if ($signal > 0 or $signal < -25) {
                     $sigColor = '#ab0000';
                 } else {
                     $sigColor = '#005502';
                 }
             } elseif (isset($this->signalCache[$each['serial']])) {
                 $signal = $this->signalCache[$each['serial']];
                 if ($signal > 0 or $signal < -25) {
                     $sigColor = '#ab0000';
                 } else {
                     $sigColor = '#005502';
                 }
             } else {
                 $signal = __('No');
                 $sigColor = '#000000';
             }
             $result .= '
                 [
                 "' . $each['id'] . '",
                 "' . $this->getModelName($each['onumodelid']) . '",
                 "' . @$this->allOltDevices[$each['oltid']] . '",
                 "' . $each['ip'] . '",
                 "' . $each['mac'] . '",
                 "<font color=' . $sigColor . '>' . $signal . '</font>",
                 "' . $userLink . '",
                 "' . $userRealName . '",
                 "' . $actLinks . '"
                 ],';
         }
     }
     $result = substr($result, 0, -1);
     $result .= '] 
     }';
     return $result;
 }
Ejemplo n.º 9
0
                    $salary->jobEdit($_POST['editsalaryjobid'], $_POST['editsalaryemployeeid'], $_POST['editsalaryjobtypeid'], $_POST['editsalaryfactor'], $_POST['editsalaryoverprice'], $_POST['editsalarynotes']);
                    rcms_redirect($salary::URL_TS . $_GET['edittask']);
                }
                //salary job creation
                if (wf_CheckPost(array('newsalarytaskid', 'newsalaryemployeeid', 'newsalaryjobtypeid'))) {
                    $salary->createSalaryJob($_POST['newsalarytaskid'], $_POST['newsalaryemployeeid'], $_POST['newsalaryjobtypeid'], $_POST['newsalaryfactor'], $_POST['newsalaryoverprice'], $_POST['newsalarynotes']);
                    rcms_redirect($salary::URL_TS . $_GET['edittask']);
                }
            }
            //display task change form
            ts_TaskChangeForm($_GET['edittask']);
            //photostorage integration
            if ($altCfg['PHOTOSTORAGE_ENABLED']) {
                $photoStorage = new PhotoStorage('TASKMAN', $_GET['edittask']);
                $photostorageControl = wf_Link('?module=photostorage&scope=TASKMAN&mode=list&itemid=' . $_GET['edittask'], wf_img('skins/photostorage.png') . ' ' . __('Upload images'), false, 'ubButton');
                $photostorageControl .= wf_delimiter();
                $photosList = $photoStorage->renderImagesRaw();
                show_window(__('Photostorage'), $photostorageControl . $photosList);
            }
            //additional comments
            if ($altCfg['ADCOMMENTS_ENABLED']) {
                $adcomments = new ADcomments('TASKMAN');
                show_window(__('Additional comments'), $adcomments->renderComments($_GET['edittask']));
            }
        }
    } else {
        show_window(__('Typical problems'), ts_TaskProblemsEditForm());
    }
} else {
    show_error(__('Access denied'));
}
Ejemplo n.º 10
0
 /**
  * shows selected signup request by its ID
  * 
  * @param int $requid Existing signup request ID
  * 
  * @return void
  */
 public function showRequest($reqid)
 {
     $requid = vf($reqid, 3);
     $reqdata = $this->getData($reqid);
     if (empty($reqdata['apt'])) {
         $apt = 0;
     } else {
         $apt = $reqdata['apt'];
     }
     $shortaddress = $reqdata['street'] . ' ' . $reqdata['build'] . '/' . $apt;
     $taskCreateControls = wf_modal(wf_img('skins/createtask.gif', __('Create task')), __('Create task'), ts_TaskCreateFormSigreq($shortaddress, $reqdata['phone']), '', '420', '500');
     $cells = wf_TableCell(__('Date'));
     $cells .= wf_TableCell($reqdata['date'] . ' ' . $taskCreateControls);
     $rows = wf_TableRow($cells, 'row3');
     $whoislink = self::URL_WHOIS . $reqdata['ip'];
     $iplookup = wf_Link($whoislink, $reqdata['ip'], false, '');
     $cells = wf_TableCell(__('IP'));
     $cells .= wf_TableCell($iplookup);
     $rows .= wf_TableRow($cells, 'row3');
     $reqAddress = $reqdata['street'] . ' ' . $reqdata['build'] . '/' . $apt;
     //Construct capability create form if enabled
     if ($this->altcfg['CAPABDIR_ENABLED']) {
         $capabDir = new CapabilitiesDirectory(true);
         $capabCreateForm = $capabDir->createForm($reqAddress, $reqdata['phone'], $reqdata['service'] . ' ' . $reqdata['notes']);
         $capabControl = wf_modal(wf_img_sized('skins/icon_cake.png', __('Available connection capabilities'), 10), __('Create connection capability'), $capabCreateForm, '', '400', '300');
     } else {
         $capabControl = '';
     }
     $cells = wf_TableCell(__('Full address'));
     $cells .= wf_TableCell($reqAddress . ' ' . $capabControl);
     $rows .= wf_TableRow($cells, 'row3');
     $cells = wf_TableCell(__('Real Name'));
     $cells .= wf_TableCell($reqdata['realname']);
     $rows .= wf_TableRow($cells, 'row3');
     $cells = wf_TableCell(__('Phone'));
     $cells .= wf_TableCell($reqdata['phone']);
     $rows .= wf_TableRow($cells, 'row3');
     $cells = wf_TableCell(__('Service'));
     $cells .= wf_TableCell($reqdata['service']);
     $rows .= wf_TableRow($cells, 'row3');
     $cells = wf_TableCell(__('Processed'));
     $cells .= wf_TableCell(web_bool_led($reqdata['state']));
     $rows .= wf_TableRow($cells, 'row3');
     $cells = wf_TableCell(__('Notes'));
     $notes = nl2br($reqdata['notes']);
     $notes = str_replace('Tariff:', __('Tariff') . ':', $notes);
     $notes = str_replace('Email:', __('Email') . ':', $notes);
     $cells .= wf_TableCell($notes);
     $rows .= wf_TableRow($cells, 'row3');
     $result = wf_TableBody($rows, '100%', '0', 'glamour');
     $actlinks = wf_Link('?module=sigreq', __('Back'), false, 'ubButton');
     if ($reqdata['state'] == 0) {
         $actlinks .= wf_Link('?module=sigreq&reqdone=' . $reqid, wf_img_sized('skins/icon_active.gif', '', '10') . ' ' . __('Close'), false, 'ubButton');
     } else {
         $actlinks .= wf_Link('?module=sigreq&requndone=' . $reqid, wf_img_sized('skins/icon_inactive.gif', '', '10') . ' ' . __('Open'), false, 'ubButton');
     }
     $deletelink = ' ' . wf_JSAlert("?module=sigreq&deletereq=" . $reqid, web_delete_icon(), 'Are you serious');
     show_window(__('Signup request') . ': ' . $reqid . $deletelink, $result);
     show_window('', $actlinks);
     //additional comments
     if ($this->altcfg['ADCOMMENTS_ENABLED']) {
         $adcomments = new ADcomments('SIGREQ');
         show_window(__('Additional comments'), $adcomments->renderComments($requid));
     }
 }
Ejemplo n.º 11
0
 /**
  * Renders outcoming operation view interface
  * 
  * @param int $id
  * @return string
  */
 public function outcomingView($id)
 {
     $id = vf($id, 3);
     $result = '';
     if (isset($this->allOutcoming[$id])) {
         $operationData = $this->allOutcoming[$id];
         $cells = wf_TableCell(__('ID') . ' ' . $this->qrControl('out', $id), '30%', 'row2');
         $cells .= wf_TableCell($id);
         $rows = wf_TableRow($cells, 'row3');
         $cells = wf_TableCell(__('Date'), '30%', 'row2');
         $cells .= wf_TableCell($operationData['date']);
         $rows .= wf_TableRow($cells, 'row3');
         $cells = wf_TableCell(__('Destination'), '30%', 'row2');
         $cells .= wf_TableCell($this->outDests[$operationData['desttype']] . $this->outDestControl($operationData['desttype'], $operationData['destparam']));
         $rows .= wf_TableRow($cells, 'row3');
         $cells = wf_TableCell(__('Category'), '30%', 'row2');
         $cells .= wf_TableCell(@$this->allCategories[$this->allItemTypes[$operationData['itemtypeid']]['categoryid']]);
         $rows .= wf_TableRow($cells, 'row3');
         $cells = wf_TableCell(__('Warehouse item type'), '30%', 'row2');
         $cells .= wf_TableCell(@$this->allItemTypeNames[$operationData['itemtypeid']]);
         $rows .= wf_TableRow($cells, 'row3');
         $cells = wf_TableCell(__('Count'), '30%', 'row2');
         $cells .= wf_TableCell($operationData['count'] . ' ' . $this->unitTypes[$this->allItemTypes[$operationData['itemtypeid']]['unit']]);
         $rows .= wf_TableRow($cells, 'row3');
         $cells = wf_TableCell(__('Price per unit'), '30%', 'row2');
         $cells .= wf_TableCell($operationData['price']);
         $rows .= wf_TableRow($cells, 'row3');
         $cells = wf_TableCell(__('Sum'), '30%', 'row2');
         $cells .= wf_TableCell($operationData['price'] * $operationData['count']);
         $rows .= wf_TableRow($cells, 'row3');
         $cells = wf_TableCell(__('Warehouse storage'), '30%', 'row2');
         $cells .= wf_TableCell($this->allStorages[$operationData['storageid']]);
         $rows .= wf_TableRow($cells, 'row3');
         $cells = wf_TableCell(__('Notes'), '30%', 'row2');
         $cells .= wf_TableCell($operationData['notes']);
         $rows .= wf_TableRow($cells, 'row3');
         $result .= wf_TableBody($rows, '100%', 0, 'wh_viewer');
         if ($this->altCfg['PHOTOSTORAGE_ENABLED']) {
             $photoStorage = new PhotoStorage(self::PHOTOSTORAGE_SCOPE, $operationData['itemtypeid']);
             $result .= $photoStorage->renderImagesRaw();
         }
     } else {
         $result = $this->messages->getStyledMessage(__('Strange exeption') . ' NO_EXISTING_OUTCOME_ID', 'error');
     }
     //ADcomments support
     if ($this->altCfg['ADCOMMENTS_ENABLED']) {
         $adcomments = new ADcomments('WAREHOUSEOUTCOME');
         $result .= wf_tag('h3') . __('Additional comments') . wf_tag('h3', true);
         $result .= $adcomments->renderComments($id);
     }
     return $result;
 }
Ejemplo n.º 12
0
 /**
  * returns some existing user profile
  * 
  * @param int $userid existing user`s ID
  * 
  * @return string
  */
 public function userProfile($userid)
 {
     $userid = vf($userid, 3);
     if (isset($this->users[$userid])) {
         $userData = $this->users[$userid];
         $rows = '';
         //zero apt numbers as private builds
         if ($this->altCfg['ZERO_TOLERANCE']) {
             $apt = $userData['apt'] == '0' ? '' : '/' . $userData['apt'];
         } else {
             $apt = '/' . $userData['apt'];
         }
         //photostorage integration
         if ($this->altCfg['PHOTOSTORAGE_ENABLED']) {
             $photoControl = wf_Link(self::URL_PHOTOSTORAGE . $userid, wf_img_sized('skins/photostorage.png', __('Upload images'), '10'), false);
         } else {
             $photoControl = '';
         }
         //additional user comments
         if ($this->altCfg['ADCOMMENTS_ENABLED']) {
             $adcomments = new ADcomments('UKVUSERPROFILE');
         }
         //task creation control
         if ($this->altCfg['CREATETASK_IN_PROFILE']) {
             $shortAddress = $userData['street'] . ' ' . $userData['build'] . $apt;
             $taskForm = ts_TaskCreateFormUnified($shortAddress, $userData['mobile'], $userData['phone'], '');
             $taskControl = wf_modal(wf_img('skins/createtask.gif', __('Create task')), __('Create task'), $taskForm, '', '420', '500');
         } else {
             $taskControl = '';
         }
         $cells = wf_TableCell(__('Full address') . ' ' . $taskControl, '20%', 'row2');
         $cells .= wf_TableCell($userData['city'] . ' ' . $userData['street'] . ' ' . $userData['build'] . $apt);
         $rows .= wf_TableRow($cells, 'row3');
         $cells = wf_TableCell(__('Real Name') . ' ' . $photoControl, '20%', 'row2');
         $cells .= wf_TableCell($userData['realname']);
         $rows .= wf_TableRow($cells, 'row3');
         $cells = wf_TableCell(__('Phone'), '20%', 'row2');
         $cells .= wf_TableCell($userData['phone']);
         $rows .= wf_TableRow($cells, 'row3');
         $cells = wf_TableCell(__('Mobile'), '20%', 'row2');
         $cells .= wf_TableCell($userData['mobile']);
         $rows .= wf_TableRow($cells, 'row3');
         $cells = wf_TableCell(wf_tag('b') . __('Contract') . wf_tag('b', true), '20%', 'row2');
         $cells .= wf_TableCell(wf_tag('b') . $userData['contract'] . wf_tag('b', true));
         $rows .= wf_TableRow($cells, 'row3');
         $cells = wf_TableCell(__('Tariff'), '20%', 'row2');
         $cells .= wf_TableCell(@$this->tariffs[$userData['tariffid']]['tariffname']);
         $rows .= wf_TableRow($cells, 'row3');
         $cells = wf_TableCell(wf_tag('b') . __('Cash') . wf_tag('b', true), '20%', 'row2');
         $cells .= wf_TableCell(wf_tag('b') . $userData['cash'] . wf_tag('b', true));
         $rows .= wf_TableRow($cells, 'row3');
         $cells = wf_TableCell(__('Connected'), '20%', 'row2');
         $cells .= wf_TableCell(web_bool_led($userData['active']));
         $rows .= wf_TableRow($cells, 'row3');
         $cells = wf_TableCell(__('User contract date'), '20%', 'row2');
         $cells .= wf_TableCell($userData['regdate']);
         $rows .= wf_TableRow($cells, 'row3');
         $cells = wf_TableCell(__('Internet account'), '20%', 'row2');
         $inetLink = !empty($userData['inetlogin']) ? wf_Link(self::URL_INET_USER_PROFILE . $userData['inetlogin'], web_profile_icon() . ' ' . $userData['inetlogin'], false, '') : '';
         $cells .= wf_TableCell($inetLink);
         $rows .= wf_TableRow($cells, 'row3');
         $cells = wf_TableCell(__('Cable seal'), '20%', 'row2');
         $cells .= wf_TableCell($userData['cableseal']);
         $rows .= wf_TableRow($cells, 'row3');
         $cells = wf_TableCell(__('Notes'), '20%', 'row2');
         $cells .= wf_TableCell($userData['notes']);
         $rows .= wf_TableRow($cells, 'row3');
         $profileData = wf_TableBody($rows, '100%', 0, '');
         $profilePlugins = '';
         if (cfr('UKV')) {
             $profilePlugins .= wf_tag('div', false, 'dashtask', 'style="height:75px; width:75px;"') . wf_modal(wf_img('skins/icon_orb_big.gif', __('User lifestory')), __('User lifestory'), $this->userLifeStoryForm($userid), '', '800', '600') . __('Details') . wf_tag('div', true);
         }
         if (cfr('UKVCASH')) {
             $profilePlugins .= wf_tag('div', false, 'dashtask', 'style="height:75px; width:75px;"') . wf_modal(wf_img('skins/ukv/money.png', __('Cash')), __('Finance operations'), $this->userManualPaymentsForm($userid), '', '600', '250') . __('Cash') . wf_tag('div', true);
         }
         if (cfr('UKVREG')) {
             $profilePlugins .= wf_tag('div', false, 'dashtask', 'style="height:75px; width:75px;"') . wf_modalAuto(wf_img('skins/ukv/useredit.png', __('Edit user')), __('Edit user'), $this->userEditForm($userid), '') . __('Edit') . wf_tag('div', true);
         }
         if (cfr('UKVSEAL')) {
             $profilePlugins .= wf_tag('div', false, 'dashtask', 'style="height:75px; width:75px;"') . wf_modalAuto(wf_img('skins/ukv/cableseal.png', __('Cable seal')), __('Cable seal'), $this->userCableSealForm($userid), '') . __('Cable seal') . wf_tag('div', true);
         }
         if (cfr('UKVDEL')) {
             $profilePlugins .= wf_tag('div', false, 'dashtask', 'style="height:75px; width:75px;"') . wf_modal(wf_img('skins/annihilation.gif', __('Deleting user')), __('Deleting user'), $this->userDeletionForm($userid), '', '800', '300') . __('Delete') . wf_tag('div', true);
         }
         //main view construction
         $profilecells = wf_tag('td', false, '', 'valign="top"') . $profileData . wf_tag('td', true);
         $profilerows = wf_TableRow($profilecells);
         $profilecells = wf_tag('td', false, '', 'width="128" valign="top"') . $profilePlugins . wf_tag('td', true);
         $profilerows .= wf_TableRow($profilecells);
         $result = wf_TableBody($profilerows, '100%', '0');
         $result .= $this->userPaymentsRender($userid);
         //additional user comments
         if ($this->altCfg['ADCOMMENTS_ENABLED']) {
             $result .= wf_tag('h3') . __('Additional comments') . wf_tag('h3', true);
             $result .= $adcomments->renderComments($userid);
         }
         return $result;
     } else {
         throw new Exception(self::EX_USER_NOT_EXISTS);
     }
 }
Ejemplo n.º 13
0
 function web_UserEditShowForm($login)
 {
     global $ubillingConfig;
     $alter_conf = $ubillingConfig->getAlter();
     $stgdata = zb_UserGetStargazerData($login);
     $address = zb_UserGetFullAddress($login);
     $realname = zb_UserGetRealName($login);
     $phone = zb_UserGetPhone($login);
     $contract = zb_UserGetContract($login);
     $mobile = zb_UserGetMobile($login);
     $mail = zb_UserGetEmail($login);
     $notes = zb_UserGetNotes($login);
     $ip = $stgdata['IP'];
     $mac = zb_MultinetGetMAC($stgdata['IP']);
     $speedoverride = zb_UserGetSpeedOverride($login);
     $tariff = $stgdata['Tariff'];
     $credit = $stgdata['Credit'];
     $cash = $stgdata['Cash'];
     $password = $stgdata['Password'];
     $aonline = $stgdata['AlwaysOnline'];
     $dstatdisable = $stgdata['DisabledDetailStat'];
     $passive = $stgdata['Passive'];
     $down = $stgdata['Down'];
     $creditexpire = $stgdata['CreditExpire'];
     if ($alter_conf['PASSWORDSHIDE']) {
         $password = __('Hidden');
     }
     if ($speedoverride == '0') {
         $speedoverride = __('No');
     }
     if ($creditexpire > 0) {
         $creditexpire = date("Y-m-d", $creditexpire);
     } else {
         $creditexpire = __('No');
     }
     $cells = wf_TableCell(__('Parameter'));
     $cells .= wf_TableCell(__('Current value'));
     $cells .= wf_TableCell(__('Actions'));
     $rows = wf_TableRow($cells, 'row2');
     //express card
     if ($alter_conf['CRM_MODE']) {
         $cells = wf_TableCell(__('Express card'));
         $cells .= wf_TableCell('');
         $cells .= wf_TableCell(wf_Link('?module=expresscard&username='******'skins/express.gif') . ' ' . __('Edit')));
         $rows .= wf_TableRow($cells, 'row3');
     }
     //default fields editing
     $cells = wf_TableCell(__('Full address'));
     $cells .= wf_TableCell($address);
     $cells .= wf_TableCell(wf_Link('?module=binder&username='******'skins/icon_build.gif') . ' ' . __('Occupancy')));
     $rows .= wf_TableRow($cells, 'row3');
     $cells = wf_TableCell(__('Password'));
     $cells .= wf_TableCell($password);
     $cells .= wf_TableCell(wf_Link('?module=passwordedit&username='******'skins/icon_key.gif') . ' ' . __('Change') . ' ' . __('password')));
     $rows .= wf_TableRow($cells, 'row3');
     $cells = wf_TableCell(__('Real Name'));
     $cells .= wf_TableCell($realname);
     $cells .= wf_TableCell(wf_Link('?module=realnameedit&username='******'skins/icon_user.gif') . ' ' . __('Change') . ' ' . __('Real Name')));
     $rows .= wf_TableRow($cells, 'row3');
     $cells = wf_TableCell(__('Phone'));
     $cells .= wf_TableCell($phone);
     $cells .= wf_TableCell(wf_Link('?module=phoneedit&username='******'skins/icon_phone.gif') . ' ' . __('Change') . ' ' . __('phone')));
     $rows .= wf_TableRow($cells, 'row3');
     $cells = wf_TableCell(__('Mobile'));
     $cells .= wf_TableCell($mobile);
     $cells .= wf_TableCell(wf_Link('?module=mobileedit&username='******'skins/icon_mobile.gif') . ' ' . __('Change') . ' ' . __('mobile')));
     $rows .= wf_TableRow($cells, 'row3');
     $cells = wf_TableCell(__('Contract'));
     $cells .= wf_TableCell($contract);
     $cells .= wf_TableCell(wf_Link('?module=contractedit&username='******'skins/icon_link.gif') . ' ' . __('Change') . ' ' . __('contract')));
     $rows .= wf_TableRow($cells, 'row3');
     if ($alter_conf['CORPS_ENABLED']) {
         $greed = new Avarice();
         $corpsRuntime = $greed->runtime('CORPS');
         if (!empty($corpsRuntime)) {
             $corps = new Corps();
             $corpsCheck = $corps->userIsCorporate($login);
             $cells = wf_TableCell(__('User type'));
             if (cfr('CORPS')) {
                 $corpControls = wf_Link(Corps::URL_USER_MANAGE . $login, wf_img('skins/corporate_small.gif') . ' ' . __('Change') . ' ' . __('user type'));
             } else {
                 $corpControls = '';
             }
             if ($corpsCheck) {
                 $cells .= wf_TableCell(__('Corporate user'));
                 $cells .= wf_TableCell($corpControls);
             } else {
                 $cells .= wf_TableCell(__('Private user'));
                 $cells .= wf_TableCell($corpControls);
             }
             $rows .= wf_TableRow($cells, 'row3');
         }
     }
     $cells = wf_TableCell(__('Email'));
     $cells .= wf_TableCell($mail);
     $cells .= wf_TableCell(wf_Link('?module=mailedit&username='******'skins/icon_mail.gif') . ' ' . __('Change') . ' ' . __('email')));
     $rows .= wf_TableRow($cells, 'row3');
     $cells = wf_TableCell(__('Tariff'));
     $cells .= wf_TableCell($tariff);
     $cells .= wf_TableCell(wf_Link('?module=tariffedit&username='******'skins/icon_tariff.gif') . ' ' . __('Change') . ' ' . __('tariff')));
     $rows .= wf_TableRow($cells, 'row3');
     $cells = wf_TableCell(__('Speed override'));
     $cells .= wf_TableCell($speedoverride);
     $cells .= wf_TableCell(wf_Link('?module=speededit&username='******'skins/icon_speed.gif') . ' ' . __('Change') . ' ' . __('speed override')));
     $rows .= wf_TableRow($cells, 'row3');
     $cells = wf_TableCell(__('Credit'));
     $cells .= wf_TableCell($credit);
     $cells .= wf_TableCell(wf_Link('?module=creditedit&username='******'skins/icon_credit.gif') . ' ' . __('Change') . ' ' . __('credit limit')));
     $rows .= wf_TableRow($cells, 'row3');
     $cells = wf_TableCell(__('Credit expire'));
     $cells .= wf_TableCell($creditexpire);
     $cells .= wf_TableCell(wf_Link('?module=creditexpireedit&username='******'skins/icon_calendar.gif') . ' ' . __('Change') . ' ' . __('credit expire date')));
     $rows .= wf_TableRow($cells, 'row3');
     $cells = wf_TableCell(__('Balance'));
     $cells .= wf_TableCell($cash);
     $cells .= wf_TableCell(wf_Link('?module=addcash&username='******'#profileending', wf_img('skins/icon_dollar.gif') . ' ' . __('Finance operations')));
     $rows .= wf_TableRow($cells, 'row3');
     if (isset($alter_conf['SIGNUP_PAYMENTS']) && !empty($alter_conf['SIGNUP_PAYMENTS'])) {
         $payment = zb_UserGetSignupPrice($login);
         $paid = zb_UserGetSignupPricePaid($login);
         if ($payment != $paid && $payment > 0) {
             $cells = wf_TableCell(__('Signup paid'));
             $cells .= wf_TableCell(zb_UserGetSignupPricePaid($login) . '/' . zb_UserGetSignupPrice($login));
             $cells .= wf_TableCell(wf_Link('?module=signupprices&username='******'skins/icons/register.png', __('Edit signup price')) . ' ' . __('Edit signup price')));
             $rows .= wf_TableRow($cells, 'row3');
         }
     }
     $cells = wf_TableCell(__('IP'));
     $cells .= wf_TableCell($ip);
     $cells .= wf_TableCell(wf_Link('?module=pl_ipchange&username='******'skins/icon_ip.gif') . ' ' . __('Change') . ' ' . __('IP')));
     $rows .= wf_TableRow($cells, 'row3');
     $cells = wf_TableCell(__('MAC'));
     $cells .= wf_TableCell($mac);
     $cells .= wf_TableCell(wf_Link('?module=macedit&username='******'skins/icon_ether.gif') . ' ' . __('Change') . ' ' . __('MAC')));
     $rows .= wf_TableRow($cells, 'row3');
     $cells = wf_TableCell(__('AlwaysOnline'));
     $cells .= wf_TableCell(web_trigger($aonline));
     $cells .= wf_TableCell(wf_Link('?module=aoedit&username='******'skins/icon_online.gif') . ' ' . __('AlwaysOnline')));
     $rows .= wf_TableRow($cells, 'row3');
     $cells = wf_TableCell(__('Disable detailed stats'));
     $cells .= wf_TableCell(web_trigger($dstatdisable));
     $cells .= wf_TableCell(wf_Link('?module=dstatedit&username='******'skins/icon_stats.gif') . ' ' . __('Disable detailed stats')));
     $rows .= wf_TableRow($cells, 'row3');
     $cells = wf_TableCell(__('User passive'));
     $cells .= wf_TableCell(web_trigger($passive));
     $cells .= wf_TableCell(wf_Link('?module=passiveedit&username='******'skins/icon_passive.gif') . ' ' . __('User passive')));
     $rows .= wf_TableRow($cells, 'row3');
     $cells = wf_TableCell(__('User down'));
     $cells .= wf_TableCell(web_trigger($down));
     $cells .= wf_TableCell(wf_Link('?module=downedit&username='******'skins/icon_down.gif') . ' ' . __('User down')));
     $rows .= wf_TableRow($cells, 'row3');
     $cells = wf_TableCell(__('Passport data'));
     $cells .= wf_TableCell('');
     $cells .= wf_TableCell(wf_Link('?module=pdataedit&username='******'skins/icon_passport.gif') . ' ' . __('Change') . ' ' . __('passport data')));
     $rows .= wf_TableRow($cells, 'row3');
     if ($alter_conf['CONDET_ENABLED']) {
         $conDet = new ConnectionDetails();
         $cells = wf_TableCell(__('Connection details'));
         $cells .= wf_TableCell($conDet->renderData($login));
         $cells .= wf_TableCell(wf_Link('?module=condetedit&username='******'skins/cableseal_small.png') . ' ' . __('Change') . ' ' . __('Connection details')));
         $rows .= wf_TableRow($cells, 'row3');
     }
     //additional comments indication
     if ($alter_conf['ADCOMMENTS_ENABLED']) {
         $adcomments = new ADcomments('USERNOTES');
         $indicatorIcon = ' ' . wf_Link('?module=notesedit&username='******'');
     } else {
         $indicatorIcon = '';
     }
     $cells = wf_TableCell(__('Notes'));
     $cells .= wf_TableCell($notes . $indicatorIcon);
     $cells .= wf_TableCell(wf_Link('?module=notesedit&username='******'skins/icon_note.gif') . ' ' . __('Notes')));
     $rows .= wf_TableRow($cells, 'row3');
     $form = wf_TableBody($rows, '100%', '0');
     show_window(__('Edit user') . ' ' . $address, $form);
     cf_FieldEditor($login);
     show_window('', web_UserControls($login));
 }
Ejemplo n.º 14
0
 function zb_AsteriskParseCDR($data)
 {
     global $altcfg;
     $normalData = $data;
     $adcomments = new ADcomments('ASTERISK');
     // minus one SQL query per call
     // only one instance of object required
     if (!empty($normalData)) {
         $totalTime = 0;
         $callsCounter = 0;
         $cells = wf_TableCell('#');
         $cells .= wf_TableCell(__('Time'));
         $cells .= wf_TableCell(__('From'));
         $cells .= wf_TableCell(__('Real Name'));
         $cells .= wf_TableCell(__('Address'));
         $cells .= wf_TableCell(__('To'));
         $cells .= wf_TableCell(__('Type'));
         $cells .= wf_TableCell(__('Status'));
         $cells .= wf_TableCell(__('Talk time'));
         if (wf_CheckPost(array('countnum')) and !isset($user_login) and $_POST['countnum']) {
             $cells .= wf_TableCell(__('Назойливость'));
         } else {
             $cells .= wf_TableCell(__('Comments'));
         }
         $rows = wf_TableRow($cells, 'row1');
         foreach ($normalData as $io => $each) {
             if (isset($normalData[$io - 1]['src'])) {
                 if ($normalData[$io]['src'] == $normalData[$io - 1]['src'] and $normalData[$io - 1]['disposition'] == 'NO ANSWER' and $normalData[$io]['disposition'] != 'ANSWERED') {
                     continue;
                 }
                 if ($normalData[$io]['src'] == $normalData[$io - 1]['src'] and $normalData[$io - 1]['dst'] == 'hangup') {
                     continue;
                 }
                 if ($normalData[$io]['src'] == $normalData[$io - 1]['src'] and $normalData[$io - 1]['dst'] == 'musiconhold') {
                     continue;
                 }
             }
             $callsCounter++;
             $AsteriskGetLoginByNumberAraySrc = array(zb_AsteriskGetLoginByNumber($each['src']));
             foreach ($AsteriskGetLoginByNumberAraySrc as $data) {
                 $link_src = $data['link'];
                 $login = $data['login'];
                 $name_src = $data['name'];
                 $adres_src = $data['adres'];
             }
             $debugData = wf_tag('pre') . print_r($each, true) . wf_tag('pre', true);
             $startTime = $each['calldate'];
             //$startTime=  explode(' ', $each['calldate']);
             //@$startTime=$startTime[1];
             $tmpTime = strtotime($each['calldate']);
             $endTime = $tmpTime + $each['duration'];
             $endTime = date("H:i:s", $endTime);
             $answerTime = $tmpTime + ($each['duration'] - $each['billsec']);
             $answerTime = date("H:i:s", $answerTime);
             $tmpStats = __('Taken up the phone') . ': ' . $answerTime . "\n";
             $tmpStats .= __('End of call') . ': ' . $endTime;
             $sessionTimeStats = wf_tag('abbr', false, '', 'title="' . $tmpStats . '"');
             $sessionTimeStats .= $startTime;
             $sessionTimeStats .= wf_tag('abbr', true);
             $callDirection = '';
             $cells = wf_TableCell(wf_modal($callsCounter, $callsCounter, $debugData, '', '500', '600'), '', '', 'sorttable_customkey="' . $callsCounter . '"');
             $cells .= wf_TableCell($sessionTimeStats, '', '', 'sorttable_customkey="' . $tmpTime . '"');
             $cells .= wf_TableCell($link_src);
             $cells .= wf_TableCell($name_src);
             $cells .= wf_TableCell($adres_src);
             $AsteriskGetLoginByNumberArayDst = array(zb_AsteriskGetLoginByNumber($each['dst']));
             foreach ($AsteriskGetLoginByNumberArayDst as $data) {
                 $link_dst = $data['link'];
                 if (!empty($data['login'])) {
                     $login = $data['login'];
                 }
             }
             //$cells.=  wf_TableCell(zb_AsteriskGetNumAlias($each['dst']));
             $cells .= wf_TableCell($link_dst);
             $CallType = __('Dial');
             if (ispos($each['lastapp'], 'internal-caller-transfer')) {
                 $CallType = __('Call transfer');
             }
             $cells .= wf_TableCell($CallType);
             $callStatus = $each['disposition'];
             $statusIcon = '';
             if (ispos($each['disposition'], 'ANSWERED')) {
                 $callStatus = __('Answered');
                 $statusIcon = wf_img('skins/calls/phone_green.png');
             }
             if (ispos($each['disposition'], 'NO ANSWER')) {
                 $callStatus = __('No answer');
                 $statusIcon = wf_img('skins/calls/phone_red.png');
             }
             if (ispos($each['disposition'], 'BUSY')) {
                 $callStatus = __('Busy');
                 $statusIcon = wf_img('skins/calls/phone_yellow.png');
             }
             if (ispos($each['disposition'], 'FAILED')) {
                 $callStatus = __('Failed');
                 $statusIcon = wf_img('skins/calls/phone_fail.png');
             }
             $cells .= wf_TableCell($statusIcon . ' ' . $callStatus);
             $speekTime = $each['billsec'];
             $totalTime = $totalTime + $each['billsec'];
             $speekTime = zb_AsteriskFormatTime($speekTime);
             $cells .= wf_TableCell($speekTime, '', '', 'sorttable_customkey="' . $each['billsec'] . '"');
             if (wf_CheckPost(array('countnum')) and !isset($user_login) and $_POST['countnum']) {
                 $cells .= wf_TableCell(__($each['countnum']));
             } else {
                 if (!empty($login)) {
                     $itemId = $each['uniqueid'] . $each['disposition'][0];
                     if ($adcomments->haveComments($itemId)) {
                         $link_text = wf_tag('center') . $adcomments->getCommentsIndicator($itemId) . wf_tag('br') . wf_tag('span', false, '', 'style="font-size:14px;color: black;"') . zb_CheckCommentsForUser('ASTERISK', $itemId) . wf_tag('span', true) . wf_tag('center', true);
                     } else {
                         $link_text = wf_tag('center') . __('Add comments') . wf_tag('center', true);
                     }
                     $cells .= wf_TableCell(wf_Link('?module=asterisk&addComments=' . $itemId . '&username='******'#profileending', $link_text, false));
                 } else {
                     $cells .= wf_TableCell(__(''));
                 }
             }
             $rows .= wf_TableRow($cells, 'row3');
         }
         $result = wf_TableBody($rows, '100%', '0', 'sortable');
         $result .= __('Time spent on calls') . ': ' . zb_AsteriskFormatTime($totalTime) . wf_tag('br');
         $result .= __('Total calls') . ': ' . $callsCounter;
         show_window('', $result);
     }
 }