Profile::showFormSetup PHP Method

showFormSetup() public method

Print the central form for a profile
public showFormSetup ( $openform = true, $closeform = true )
$openform boolean open the form (true by default)
$closeform boolean close the form (true by default)
    function showFormSetup($openform = true, $closeform = true)
    {
        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() . "'>";
        }
        $dropdown_rights = CommonDBTM::getRights();
        unset($dropdown_rights[DELETE]);
        unset($dropdown_rights[UNLOCK]);
        $rights = array(array('itemtype' => 'Config', 'label' => __('General setup'), 'field' => 'config'), array('itemtype' => 'DisplayPreference', 'label' => __('Search result display'), 'field' => 'search_config'), array('itemtype' => 'Item_Devices', 'label' => _n('Component', 'Components', Session::getPluralNumber()), 'field' => 'device'), array('rights' => $dropdown_rights, 'label' => _n('Global dropdown', 'Global dropdowns', Session::getPluralNumber()), 'field' => 'dropdown'), __('Entity dropdowns'), array('itemtype' => 'Domain', 'label' => _n('Domain', 'Domains', Session::getPluralNumber()), 'field' => 'domain'), array('itemtype' => 'Location', 'label' => _n('Location', 'Locations', Session::getPluralNumber()), 'field' => 'location'), array('itemtype' => 'ITILCategory', 'label' => _n('Ticket category', 'Ticket categories', Session::getPluralNumber()), 'field' => 'itilcategory'), array('itemtype' => 'KnowbaseItemCategory', 'label' => _n('Knowledge base category', 'Knowledge base categories', Session::getPluralNumber()), 'field' => 'knowbasecategory'), array('itemtype' => 'Netpoint', 'label' => _n('Network outlet', 'Network outlets', Session::getPluralNumber()), 'field' => 'netpoint'), array('itemtype' => 'TaskCategory', 'label' => _n('Task category', 'Task categories', Session::getPluralNumber()), 'field' => 'taskcategory'), array('itemtype' => 'State', 'label' => _n('Status of items', 'Statuses of items', Session::getPluralNumber()), 'field' => 'state'), array('itemtype' => 'SolutionTemplate', 'label' => _n('Solution template', 'Solution templates', Session::getPluralNumber()), 'field' => 'solutiontemplate'), array('itemtype' => 'Calendar', 'label' => _n('Calendar', 'Calendars', Session::getPluralNumber()), 'field' => 'calendar'), array('itemtype' => 'DocumentType', 'label' => __('Document type'), 'field' => 'typedoc'), array('itemtype' => 'Link', 'label' => _n('External link', 'External links', Session::getPluralNumber()), 'field' => 'link'), array('itemtype' => 'Notification', 'label' => _n('Notification', 'Notifications', Session::getPluralNumber()), 'field' => 'notification'), array('itemtype' => 'SLA', 'label' => __('SLA'), 'field' => 'sla'));
        $this->displayRightsChoiceMatrix($rights, array('canedit' => $canedit, 'default_class' => 'tab_bg_2', 'title' => __('Setup')));
        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();
    }