Profile::showFormAdmin PHP Méthode

showFormAdmin() public méthode

Print the central form for a profile
public showFormAdmin ( $openform = true, $closeform = true )
$openform boolean open the form (true by default)
$closeform boolean close the form (true by default)
    function showFormAdmin($openform = true, $closeform = true)
    {
        global $DB;
        if (!self::canView()) {
            return false;
        }
        echo "<div class='spaced'>";
        if (($canedit = Session::haveRightsOr(self::$rightname, array(CREATE, UPDATE, PURGE))) && $openform) {
            echo "<form method='post' action='" . $this->getFormURL() . "'>";
        }
        $matrix_options = array('canedit' => $canedit, 'default_class' => 'tab_bg_4');
        $rights = array(array('itemtype' => 'User', 'label' => _n('User', 'Users', Session::getPluralNumber()), 'field' => 'user', 'row_class' => 'tab_bg_2'), array('itemtype' => 'Entity', 'label' => _n('Entity', 'Entities', Session::getPluralNumber()), 'field' => 'entity'), array('itemtype' => 'Group', 'label' => _n('Group', 'Groups', Session::getPluralNumber()), 'field' => 'group'), array('itemtype' => 'Profile', 'label' => _n('Profile', 'Profiles', Session::getPluralNumber()), 'field' => 'profile'), array('itemtype' => 'QueuedMail', 'label' => __('Mail queue'), 'field' => 'queuedmail'), array('itemtype' => 'Backup', 'label' => __('Maintenance'), 'field' => 'backup'), array('itemtype' => 'Log', 'label' => _n('Log', 'Logs', Session::getPluralNumber()), 'field' => 'logs'));
        $matrix_options['title'] = __('Administration');
        $this->displayRightsChoiceMatrix($rights, $matrix_options);
        $rights = array(array('itemtype' => 'Rule', 'label' => __('Authorizations assignment rules'), 'field' => 'rule_ldap'), array('itemtype' => 'RuleImportComputer', 'label' => __('Rules for assigning a computer to an entity'), 'field' => 'rule_import'), array('itemtype' => 'RuleMailCollector', 'label' => __('Rules for assigning a ticket created through a mails receiver'), 'field' => 'rule_mailcollector'), array('itemtype' => 'RuleSoftwareCategory', 'label' => __('Rules for assigning a category to a software'), 'field' => 'rule_softwarecategories'), array('itemtype' => 'RuleTicket', 'label' => __('Business rules for tickets (entity)'), 'field' => 'rule_ticket', 'row_class' => 'tab_bg_2'), array('itemtype' => 'Transfer', 'label' => __('Transfer'), 'field' => 'transfer'));
        $matrix_options['title'] = _n('Rule', 'Rules', Session::getPluralNumber());
        $this->displayRightsChoiceMatrix($rights, $matrix_options);
        $rights = array(array('itemtype' => 'RuleDictionnaryDropdown', 'label' => __('Dropdowns dictionary'), 'field' => 'rule_dictionnary_dropdown'), array('itemtype' => 'RuleDictionnarySoftware', 'label' => __('Software dictionary'), 'field' => 'rule_dictionnary_software'), array('itemtype' => 'RuleDictionnaryPrinter', 'label' => __('Printers dictionnary'), 'field' => 'rule_dictionnary_printer'));
        $matrix_options['title'] = __('Dropdowns dictionary');
        $this->displayRightsChoiceMatrix($rights, $matrix_options);
        if ($canedit && $closeform) {
            echo "<div class='center'>";
            echo "<input type='hidden' name='id' value='" . $this->fields['id'] . "'>";
            echo "<input type='submit' name='update' value=\"" . _sx('button', 'Save') . "\" class='submit'>";
            echo "</div>\n";
            Html::closeForm();
        }
        echo "</div>";
        $this->showLegend();
    }