SlaLevel::showForm PHP Méthode

showForm() public méthode

Show the rule
public showForm ( $ID, $options = [] ) : nothing
$ID ID of the rule
$options array of possible options
Résultat nothing
    function showForm($ID, $options = array())
    {
        $canedit = $this->can('sla', UPDATE);
        $this->initForm($ID, $options);
        $this->showFormHeader($options);
        echo "<tr class='tab_bg_1'>";
        echo "<td>" . __('Name') . "</td>";
        echo "<td>";
        Html::autocompletionTextField($this, "name");
        echo "</td>";
        echo "<td>" . __('Active') . "</td>";
        echo "<td>";
        Dropdown::showYesNo("is_active", $this->fields["is_active"]);
        echo "</td></tr>\n";
        $slt = new SLT();
        $slt->getFromDB($this->fields['slts_id']);
        echo "<tr class='tab_bg_1'>";
        echo "<td>" . SLT::getTypeName(1) . "</td>";
        echo "<td>" . $slt->getLink() . "</td>";
        echo "<td>" . __('Execution') . "</td>";
        echo "<td>";
        $delay = $slt->getSLTTime();
        self::dropdownExecutionTime('execution_time', array('max_time' => $delay, 'used' => self::getAlreadyUsedExecutionTime($slt->fields['id']), 'value' => $this->fields['execution_time']));
        echo "</td></tr>\n";
        echo "<tr class='tab_bg_1'>";
        echo "<td>" . __('Logical operator') . "</td>";
        echo "<td>";
        $this->dropdownRulesMatch(array('value' => $this->fields["match"]));
        echo "</td>";
        echo "<td colspan='2'>&nbsp;</td></tr>";
        $this->showFormButtons($options);
    }

Usage Example

Exemple #1
0
                }
                $item->redirectToList();
            }
            Html::back();
        } else {
            if (isset($_POST["add_action"])) {
                /// TODO create specific form
                $item->check($_POST['slalevels_id'], 'w');
                $action = new SlaLevelAction();
                $action->add($_POST);
                Html::back();
            } else {
                if (isset($_POST["add_criteria"])) {
                    $item->check($_POST['slalevels_id'], 'w');
                    $criteria = new SlaLevelCriteria();
                    $criteria->add($_POST);
                    Html::back();
                } else {
                    if (isset($_GET["id"]) && $_GET["id"] > 0) {
                        //print computer information
                        Html::header(SlaLevel::getTypeName(2), $_SERVER['PHP_SELF'], "config", "sla");
                        //show computer form to add
                        $item->showForm($_GET["id"]);
                        Html::footer();
                    }
                }
            }
        }
    }
}
Html::displayErrorAndDie('Lost');