ContractCost::showForm PHP Метод

showForm() публичный Метод

Print the contract cost form
public showForm ( $ID, $options = [] )
$ID integer ID of the item
$options array options used
    function showForm($ID, $options = array())
    {
        if ($ID > 0) {
            $this->check($ID, READ);
        } else {
            // Create item
            $options['contracts_id'] = $options['parent']->getField('id');
            $this->check(-1, CREATE, $options);
            $this->initBasedOnPrevious();
        }
        $this->showFormHeader($options);
        echo "<tr class='tab_bg_1'>";
        echo "<td>" . __('Name') . "</td>";
        echo "<td>";
        echo "<input type='hidden' name='contracts_id' value='" . $this->fields['contracts_id'] . "'>";
        Html::autocompletionTextField($this, 'name');
        echo "</td>";
        echo "<td>" . __('Cost') . "</td>";
        echo "<td>";
        echo "<input type='text' name='cost' value='" . Html::formatNumber($this->fields["cost"], true) . "'\n             size='14'>";
        echo "</td></tr>";
        echo "<tr class='tab_bg_1'><td>" . __('Begin date') . "</td>";
        echo "<td>";
        Html::showDateField("begin_date", array('value' => $this->fields['begin_date']));
        echo "</td>";
        $rowspan = 3;
        echo "<td rowspan='{$rowspan}'>" . __('Comments') . "</td>";
        echo "<td rowspan='{$rowspan}' class='middle'>";
        echo "<textarea cols='45' rows='" . ($rowspan + 3) . "' name='comment' >" . $this->fields["comment"] . "</textarea>";
        echo "</td></tr>\n";
        echo "<tr class='tab_bg_1'><td>" . __('End date') . "</td>";
        echo "<td>";
        Html::showDateField("end_date", array('value' => $this->fields['end_date']));
        echo "</td></tr>";
        echo "<tr class='tab_bg_1'><td>" . __('Budget') . "</td>";
        echo "<td>";
        Budget::dropdown(array('value' => $this->fields["budgets_id"]));
        echo "</td></tr>";
        $this->showFormButtons($options);
        return true;
    }