예제 #1
0
 public function showForm()
 {
     $this->getFromDB(1);
     echo "<div class='center'>";
     echo "<form name='form' method='post' action='" . $this->getFormURL() . "'>";
     echo "<input type='hidden' name='id' value='1'>";
     echo "<table class='tab_cadre_fixe'>";
     echo "<tr><th colspan='2'>" . __("Plugin configuration", "order") . "</th></tr>";
     echo "<tr class='tab_bg_1' align='center'>";
     echo "<td>" . __("Default VAT", "order") . "</td>";
     echo "<td>";
     PluginOrderOrderTax::Dropdown(array('name' => "default_taxes", 'value' => $this->fields["default_taxes"], 'display_emptychoice' => true, 'emptylabel' => __("No VAT", "order")));
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1' align='center'>";
     echo "<td>" . __("Use validation process", "order") . "</td>";
     echo "<td>";
     Dropdown::showYesNo("use_validation", $this->fields["use_validation"]);
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1' align='center'>";
     echo "<td>" . __("Order generation in ODT", "order") . "</td><td>";
     Dropdown::showYesNo("generate_order_pdf", $this->fields["generate_order_pdf"]);
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1' align='center'>";
     echo "<td>" . __("Activate suppliers quality satisfaction", "order") . "</td>";
     echo "<td>";
     Dropdown::showYesNo("use_supplier_satisfaction", $this->fields["use_supplier_satisfaction"]);
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1' align='center'>";
     echo "<td>" . __("Display order's suppliers informations", "order") . "</td><td>";
     Dropdown::showYesNo("use_supplier_informations", $this->fields["use_supplier_informations"]);
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1' align='center'>";
     echo "<td>" . __("Color to be displayed when order due date is overtaken", "order") . "</td>";
     echo "<td>";
     echo "<input type='color' name='shoudbedelivered_color'\n               value='" . $this->fields['shoudbedelivered_color'] . "'>";
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1' align='center'>";
     echo "<td>" . __("Copy order documents when a new item is created", "order") . "</td>";
     echo "<td>";
     Dropdown::showYesNo("copy_documents", $this->fields["copy_documents"]);
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1' align='center'>";
     echo "<td>" . __("Default heading when adding a document to an order", "order") . "</td>";
     echo "<td>";
     DocumentCategory::Dropdown(array('value' => $this->fields["documentcategories_id"]));
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1' align='center'>";
     echo "<td>" . __("Author group", "order") . ' (' . __("Default values") . ")</td>";
     echo "<td>";
     Group::Dropdown(array('value' => $this->fields["groups_id_author"], 'name' => 'groups_id_author'));
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1' align='center'>";
     echo "<td>" . __("Recipient group", "order") . ' (' . __("Default values") . ")</td>";
     echo "<td>";
     Group::Dropdown(array('value' => $this->fields["groups_id_recipient"], 'name' => 'groups_id_recipient'));
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1' align='center'>";
     echo "<td>" . __("Recipient") . ' (' . __("Default values") . ")</td>";
     echo "<td>";
     User::Dropdown(array('name' => 'users_id_recipient', 'value' => $this->fields["users_id_recipient"], 'right' => 'all', 'entity' => 0));
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1' align='center'>";
     echo "<td>" . __("Hide inactive budgets", 'order') . "</td>";
     echo "<td>";
     Dropdown::showYesNo("hide_inactive_budgets", $this->fields["hide_inactive_budgets"]);
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1' align='center'>";
     echo "<td>" . __("Transmit budget change to linked assets", 'order') . "</td>";
     echo "<td>";
     Dropdown::showYesNo("transmit_budget_change", $this->fields["transmit_budget_change"]);
     echo "</td>";
     echo "</tr>";
     // Automatic actions
     echo "<tr class='tab_bg_1' align='center'>";
     echo "<th colspan='2'>" . __("Automatic actions when delivery", "order") . "</th>";
     echo "</tr>";
     // ASSETS
     echo "<tr class='tab_bg_1' align='center'>";
     echo "<th colspan='2'>" . __('Item') . "</th>";
     echo "</tr>";
     echo "<tr class='tab_bg_1' align='center'>";
     echo "<td>" . __("Enable automatic generation", "order") . "</td>";
     echo "<td>";
     Dropdown::showYesNo("generate_assets", $this->canGenerateAsset());
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1' align='center'>";
     echo "<td>" . __("Default state", "order") . "</td>";
     echo "<td>";
     State::Dropdown(array('name' => 'default_asset_states_id', 'value' => $this->fields["default_asset_states_id"], 'entity' => $_SESSION["glpiactiveentities"]));
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1' align='center'>";
     echo "<td>" . __("Add order location to item", "order") . "</td>";
     echo "<td>";
     Dropdown::showYesNo("add_location", $this->canAddLocation());
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1' align='center'>";
     echo "<td>" . __("Add billing details to item", "order") . "</td><td>";
     Dropdown::showYesNo("add_bill_details", $this->canAddBillDetails());
     echo "</td>";
     echo "</tr>";
     if ($this->canGenerateAsset()) {
         echo "<tr class='tab_bg_1' align='center'>";
         echo "<td>" . __("Default name", "order") . "</td>";
         echo "<td>";
         Html::autocompletionTextField($this, "generated_name");
         echo "</td>";
         echo "</tr>";
         echo "<tr class='tab_bg_1' align='center'>";
         echo "<td>" . __("Default serial number", "order") . "</td>";
         echo "<td>";
         Html::autocompletionTextField($this, "generated_serial");
         echo "</td>";
         echo "</tr>";
         echo "<tr class='tab_bg_1' align='center'>";
         echo "<td>" . __("Default inventory number", "order") . "</td>";
         echo "<td>";
         Html::autocompletionTextField($this, "generated_otherserial");
         echo "</td>";
         echo "</tr>";
         // TICKETS
         echo "<tr class='tab_bg_1' align='center'>";
         echo "<th colspan='2'>" . __("Ticket") . "</th>";
         echo "</tr>";
         echo "<tr class='tab_bg_1' align='center'>";
         echo "<td>" . TicketTemplate::getTypeName(1) . "</td>";
         echo "<td>";
         Dropdown::show('TicketTemplate', array('name' => 'tickettemplates_id_delivery', 'value' => $this->fields['tickettemplates_id_delivery']));
         echo "</td>";
         echo "</tr>";
     }
     /* Workflow */
     echo "<tr class='tab_bg_1' align='center'>";
     echo "<th colspan='2'>" . __("Order lifecycle", "order") . "</th>";
     echo "</tr>";
     echo "<tr class='tab_bg_1' align='center'>";
     echo "<td>" . __("State before validation", "order") . "</td>";
     echo "<td>";
     PluginOrderOrderState::Dropdown(array('name' => 'order_status_draft', 'value' => $this->fields["order_status_draft"]));
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1' align='center'>";
     echo "<td>" . __("Waiting for validation state", "order") . "</td>";
     echo "<td>";
     PluginOrderOrderState::Dropdown(array('name' => 'order_status_waiting_approval', 'value' => $this->fields["order_status_waiting_approval"]));
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1' align='center'>";
     echo "<td>" . __("Validated order state", "order") . "</td>";
     echo "<td>";
     PluginOrderOrderState::Dropdown(array('name' => 'order_status_approved', 'value' => $this->fields["order_status_approved"]));
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1' align='center'>";
     echo "<td>" . __("Order being delivered state", "order") . "</td>";
     echo "<td>";
     PluginOrderOrderState::Dropdown(array('name' => 'order_status_partially_delivred', 'value' => $this->fields["order_status_partially_delivred"]));
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1' align='center'>";
     echo "<td>" . __("Order delivered state", "order") . "</td>";
     echo "<td>";
     PluginOrderOrderState::Dropdown(array('name' => 'order_status_completly_delivered', 'value' => $this->fields["order_status_completly_delivered"]));
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1' align='center'>";
     echo "<td>" . __("Order paied state", "order") . "</td>";
     echo "<td>";
     PluginOrderOrderState::Dropdown(array('name' => 'order_status_paid', 'value' => $this->fields["order_status_paid"]));
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1' align='center'>";
     echo "<td>" . __("Canceled order state", "order") . "</td>";
     echo "<td>";
     PluginOrderOrderState::Dropdown(array('name' => 'order_status_canceled', 'value' => $this->fields["order_status_canceled"]));
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1' align='center'>";
     echo "<td colspan='2' align='center'>";
     echo "<input type='submit' name='update' value=\"" . _sx("button", "Post") . "\" class='submit' >";
     echo "</td>";
     echo "</tr>";
     echo "</table>";
     Html::closeForm();
     echo "</div>";
 }