public static function showOrderSupplierSurvey($ID) { global $DB, $CFG_GLPI; $order = new PluginOrderOrder(); $order->getFromDB($ID); $survey = new self(); $table = getTableForItemType(__CLASS__); Session::initNavigateListItems(__CLASS__, __("Order", "order") . " = " . $order->fields["name"]); $candelete = $order->can($ID, DELETE); $query = "SELECT * FROM `{$table}` WHERE `plugin_order_orders_id` = '{$ID}' "; $result = $DB->query($query); $rand = mt_rand(); echo "<div class='center'>"; echo "<form method='post' name='show_suppliersurvey{$rand}' id='show_suppliersurvey{$rand}' " . " action=\"" . Toolbox::getItemTypeFormURL(__CLASS__) . "\">"; echo "<input type='hidden' name='plugin_order_orders_id' value='" . $ID . "'>"; echo "<table class='tab_cadre_fixe'>"; echo "<tr><th colspan='5'>" . __("Supplier quality", "order") . "</th></tr>"; echo "<tr><th> </th>"; echo "<th>" . __("Supplier") . "</th>"; echo "<th>" . __("Note", "order") . "</th>"; echo "<th>" . __("Comment on survey", "order") . "</th>"; echo "</tr>"; if ($DB->numrows($result) > 0) { while ($data = $DB->fetch_array($result)) { Session::addToNavigateListItems(__CLASS__, $data['id']); echo "<input type='hidden' name='item[" . $data["id"] . "]' value='" . $ID . "'>"; echo "<tr class='tab_bg_1 center'>"; echo "<td>"; if ($candelete) { echo "<input type='checkbox' name='check[" . $data["id"] . "]'"; if (isset($_POST['check']) && $_POST['check'] == 'all') { echo " checked "; } echo ">"; } echo "</td>"; $link = Toolbox::getItemTypeFormURL(__CLASS__); echo "<td><a href='" . $link . "?id=" . $data["id"] . "&plugin_order_orders_id=" . $ID . "'>" . Dropdown::getDropdownName("glpi_suppliers", $data["suppliers_id"]) . "</a></td>"; echo "<td>"; $total = $survey->getTotalNotation($ID); echo $total . " / 10"; echo "</td>"; echo "<td>"; echo $data["comment"]; echo "</td>"; echo "</tr>"; } echo "</table>"; if ($candelete) { echo "<div class='center'>"; Html::openArrowMassives("show_suppliersurvey{$rand}", true); Html::closeArrowMassives(array("delete" => __("Delete permanently"))); echo "</div>"; } } else { echo "</table>"; } Html::closeForm(); echo "</div>"; }