Entity::showAdvancedOptions PHP Method

showAdvancedOptions() static public method

static public showAdvancedOptions ( Entity $entity )
$entity Entity Entity object
    static function showAdvancedOptions(Entity $entity)
    {
        global $DB;
        $con_spotted = false;
        $ID = $entity->getField('id');
        if (!$entity->can($ID, READ)) {
            return false;
        }
        // Entity right applied (could be User::UPDATEAUTHENT)
        $canedit = $entity->can($ID, UPDATE);
        if ($canedit) {
            echo "<form method='post' name=form action='" . Toolbox::getItemTypeFormURL(__CLASS__) . "'>";
        }
        echo "<table class='tab_cadre_fixe'>";
        echo "<tr><th colspan='2'>" . __('Values for the generic rules for assignment to entities') . "</th></tr>";
        echo "<tr class='tab_bg_1'><td colspan='2' class='center'>" . __('These parameters are used as actions in generic rules for assignment to entities') . "</td></tr>";
        echo "<tr class='tab_bg_1'>";
        echo "<td>" . __('Information in inventory tool (TAG) representing the entity') . "</td>";
        echo "<td>";
        Html::autocompletionTextField($entity, "tag", array('size' => 100));
        echo "</td></tr>";
        if (Toolbox::canUseLdap()) {
            echo "<tr class='tab_bg_1'>";
            echo "<td>" . __('LDAP directory information attribute representing the entity') . "</td>";
            echo "<td>";
            Html::autocompletionTextField($entity, "ldap_dn", array('size' => 100));
            echo "</td></tr>";
        }
        echo "<tr class='tab_bg_1'>";
        echo "<td>" . __('Mail domain surrogates entity') . "</td>";
        echo "<td>";
        Html::autocompletionTextField($entity, "mail_domain", array('size' => 100));
        echo "</td></tr>";
        if (Toolbox::canUseLdap()) {
            echo "<tr><th colspan='2'>" . __('Values used in the interface to search users from a LDAP directory') . "</th></tr>";
            echo "<tr class='tab_bg_1'>";
            echo "<td>" . __('LDAP directory of an entity') . "</td>";
            echo "<td>";
            AuthLDAP::dropdown(array('value' => $entity->fields['authldaps_id'], 'emptylabel' => __('Default server'), 'condition' => "`is_active` = '1'"));
            echo "</td></tr>";
            echo "<tr class='tab_bg_1'>";
            echo "<td>" . __('LDAP filter associated to the entity (if necessary)') . "</td>";
            echo "<td>";
            Html::autocompletionTextField($entity, 'entity_ldapfilter', array('size' => 100));
            echo "</td></tr>";
        }
        if ($canedit) {
            echo "<tr>";
            echo "<td class='tab_bg_2 center' colspan='2'>";
            echo "<input type='hidden' name='id' value='" . $entity->fields["id"] . "'>";
            echo "<input type='submit' name='update' value=\"" . _sx('button', 'Save') . "\" class='submit'>";
            echo "</td></tr>";
            echo "</table>";
            Html::closeForm();
        } else {
            echo "</table>";
        }
    }