Beispiel #1
0
$pname = $matches[1];
if (cse($pname, ".vm")) {
    $pclass = "vps";
}
/*
if (!csa($matches[1], "-")) {
	$pclass = "client";
	$pname = $matches[1];
} else {
	$pp = explode("-", $matches[1]);
	$pclass = $pp[0];
	$pname = $pp[1];
}
*/
$pobject = new $pclass(null, null, $pname);
$pobject->get();
$tick = new Ticket(null, null, $ticketid);
$tick->get();
$param['state'] = 'open';
$param['text_reason'] = $message;
$param['pobject'] = $pobject;
$param['made_by'] = createClName($pclass, $pname);
$param['from_ad'] = $email->from;
$param = tickethistory::add($tick, 'tickethistory', $param);
$newob = new TicketHistory(null, null, $param['nname']);
$newob->ddate = time();
$tick->unread_flag = 'dull';
$newob->parent_clname = $tick->getClName();
$newob->create($param);
$newob->write();
$tick->write();
Beispiel #2
0
function __ajax_desc_tree()
{
    global $gbl, $sgbl, $login, $ghtml;
    $object = $gbl->__c_object;
    $icondir = get_image_path('/button/');
    $rclist = $object->getResourceChildList();
    $cid = $ghtml->node;
    if ($object->hasFileResource()) {
        $u = "a=show&k[class]=ffile&k[nname]=/";
        $u = $ghtml->getFullUrl($u);
        $v = createClName('ffile', '/');
        $ret[] = array('text' => "File", 'icon' => "{$icondir}/ffile_show.gif", 'hrefTarget' => 'mainframe', 'href' => $u, 'id' => "{$cid}&{$v}");
    }
    if ($ghtml->__resource_class) {
        $c = strfrom($ghtml->__resource_class, "__resource_");
        if (cse($c, "_l")) {
            $clname = $object->getChildNameFromDes($c);
            $list = $object->getList($clname, $totalcount);
            foreach ($list as $o) {
                $u = "a=show&k[class]={$o->getClass()}&k[nname]={$o->nname}";
                $u = $ghtml->getFullUrl($u);
                $ret[] = array('text' => basename($o->nname), 'icon' => "{$icondir}/{$o->getClass()}_list.gif", 'hrefTarget' => 'mainframe', 'href' => $u, 'id' => "{$cid}&{$o->getClName()}");
            }
        } else {
            if (cse($c, "_o")) {
                $clname = $object->getChildNameFromDes($c);
                $o = $object->getObject($clname);
                $u = "a=show&o={$o->getClass()}";
                $u = $ghtml->getFullUrl($u);
                $ret[] = array('text' => $o->getClass(), 'icon' => "{$icondir}/{$o->getClass()}_show.gif", 'hrefTarget' => 'mainframe', 'href' => $u, 'id' => "{$cid}&{$o->getClass()}");
            }
        }
        return $ret;
    }
    if ($ghtml->__title_function) {
        $t = $ghtml->__title_function;
        $alist = $object->createShowAlist($alist);
        foreach ($alist as $k => $v) {
            if (csb($k, "__title")) {
                if ($k !== $t) {
                    if ($insidetitle) {
                        $insidetitle = false;
                        break;
                    }
                    continue;
                }
                $insidetitle = true;
                continue;
            }
            if ($insidetitle) {
                $url = $ghtml->getFullUrl($v);
                if ($ghtml->is_special_url($url)) {
                    continue;
                }
                $urlinfo = $ghtml->getUrlInfo($url);
                $ret[] = array('text' => $urlinfo['description']['desc'], 'icon' => $urlinfo['image'], 'hrefTarget' => 'mainframe', 'leaf' => true, 'href' => $url, 'id' => "&end");
            }
        }
        return $ret;
    }
    if ($object->hasFunctions()) {
        $alist = $object->createShowAlist($alist);
        foreach ($alist as $k => $v) {
            if (!csb($k, "__title")) {
                continue;
            }
            $title = strfrom($k, "__title_");
            if ($title === 'mailaccount') {
                continue;
            }
            if ($title === 'custom') {
                continue;
            }
            $icon = "{$icondir}/__title_{$title}.gif";
            if (!lxfile_exists("__path_program_htmlbase/{$icon}")) {
                //lfile_put_contents("title.img", "$title.gif\n", FILE_APPEND);
                $icon = null;
            }
            $ret[] = array('text' => $v, 'icon' => $icon, 'hrefTarget' => '', 'href' => null, 'id' => "{$cid}&{$k}");
        }
    }
    foreach ($rclist as $c) {
        $clname = $object->getChildNameFromDes($c);
        $desc = get_description($clname);
        $desc = get_plural($desc);
        $url = $ghtml->getFullUrl("a=list&c={$clname}");
        $ret[] = array('text' => $desc, 'icon' => "{$icondir}/{$clname}_list.gif", 'hrefTarget' => 'mainframe', 'href' => $url, 'id' => "{$cid}&__resource_{$c}");
    }
    return $ret;
}
Beispiel #3
0
 static function addOneWatchdog($pserver, $service, $port, $command)
 {
     $v = new watchdog(null, $pserver, "{$service}___{$pserver}");
     $v->get();
     if ($v->dbaction !== 'add') {
         dprint("{$service} {$pserver} already exists...\n");
         return;
     }
     $v->servicename = $service;
     $v->port = $port;
     $v->action = $command;
     $v->status = "on";
     $v->added_by_system = "on";
     $v->syncserver = $pserver;
     $v->parent_clname = createClName('pserver', $pserver);
     $v->dbaction = 'add';
     $v->createExtraVariables();
     $v->was();
 }