Exemplo n.º 1
0
function trigger_autoports()
{
    $object = spotEntity('object', getBypassValue());
    amplifyCell($object);
    if (count($object['ports'])) {
        return '';
    }
    return count(getAutoPorts($object['objtype_id'])) ? 'attn' : '';
}
Exemplo n.º 2
0
function trigger_autoports()
{
    $object_id = getBypassValue();
    if (0 != getPortsCount($object_id)) {
        return '';
    }
    $object = spotEntity('object', $object_id);
    return count(getAutoPorts($object)) ? 'attn' : '';
}
Exemplo n.º 3
0
function executeAutoPorts($object_id = 0, $type_id = 0)
{
    if ($object_id == 0) {
        throw new InvalidArgException('$object_id', $object_id);
    }
    if ($type_id == 0) {
        throw new InvalidArgException('$type_id', $type_id);
    }
    foreach (getAutoPorts($type_id) as $autoport) {
        commitAddPort($object_id, $autoport['name'], $autoport['type'], '', '');
    }
}
Exemplo n.º 4
0
function renderAutoPortsForm($object_id)
{
    $info = spotEntity('object', $object_id);
    $ptlist = getPortOIFOptions();
    echo "<table class='widetable' border=0 cellspacing=0 cellpadding=5 align='center'>\n";
    echo "<caption>The following ports can be quickly added:</caption>";
    echo "<tr><th>type</th><th>name</th></tr>";
    foreach (getAutoPorts($info['objtype_id']) as $autoport) {
        echo "<tr><td>" . $ptlist[$autoport['type']] . "</td><td>{$autoport['name']}</td></tr>";
    }
    printOpFormIntro('generate');
    echo "<tr><td colspan=2 align=center>";
    echo "<input type=submit value='Generate'>";
    echo "</td></tr>";
    echo "</table></form>";
}
Exemplo n.º 5
0
function trigger_autoports()
{
    assertUIntArg('object_id');
    $object = spotEntity('object', $_REQUEST['object_id']);
    amplifyCell($object);
    if (count($object['ports'])) {
        return '';
    }
    return count(getAutoPorts($object['objtype_id'])) ? 'attn' : '';
}