Beispiel #1
0
 public function dropdownLinkActions($itemtype, $plugin_order_references_id, $plugin_order_orders_id, $entities_id)
 {
     global $CFG_GLPI;
     $rand = mt_rand();
     $reception = new PluginOrderReception();
     $actions[0] = Dropdown::EMPTY_VALUE;
     if ($reception->checkItemStatus($plugin_order_orders_id, $plugin_order_references_id, PluginOrderOrder::ORDER_DEVICE_DELIVRED)) {
         if (!in_array($itemtype, self::getTypesThanCannotBeGenerared())) {
             $actions['generation'] = __("Generate item", "order");
         }
         if ($itemtype::canView()) {
             $actions['createLink'] = __("Link to an existing item", "order");
             $actions['deleteLink'] = __("Delete item link", "order");
         }
     }
     $rand = Dropdown::showFromArray('generationActions', $actions);
     $params = array('action' => '__VALUE__', 'itemtype' => $itemtype, 'plugin_order_references_id' => $plugin_order_references_id, 'plugin_order_orders_id' => $plugin_order_orders_id, 'entities_id' => $entities_id);
     Ajax::updateItemOnSelectEvent("dropdown_generationActions{$rand}", "show_generationActions{$rand}", $CFG_GLPI["root_doc"] . "/plugins/order/ajax/linkactions.php", $params);
     echo "<span id='show_generationActions{$rand}'>&nbsp;</span>";
 }
Beispiel #2
0
 @author    the order plugin team
 @copyright Copyright (c) 2010-2015 Order plugin team
 @license   GPLv2+
            http://www.gnu.org/licenses/gpl.txt
 @link      https://forge.indepnet.net/projects/order
 @link      http://www.glpi-project.org/
 @since     2009
 ---------------------------------------------------------------------- */
include "../../../inc/includes.php";
header("Content-Type: text/html; charset=UTF-8");
Html::header_nocache();
Session::checkLoginUser();
$PluginOrderReception = new PluginOrderReception();
echo "<table width='950px' class='tab_cadre_fixe'>";
echo "<tr class='tab_bg_2'><td>" . __("Delivery date") . "</td><td>";
Html::showDateFormItem("delivery_date", date("Y-m-d"), true, 1);
echo "</td><td>";
echo __("Delivery form") . "</td><td>";
echo "<input type='text' name='delivery_number' size='20'>";
echo "</td><td>";
echo "<input type='hidden' name='plugin_order_references_id' value='" . $_POST['plugin_order_references_id'] . "'>";
echo "<input type='hidden' name='plugin_order_orders_id' value='" . $_POST['plugin_order_orders_id'] . "'>";
echo __("Number to deliver", "order") . "</td><td width='10%'>";
$nb = $PluginOrderReception->checkItemStatus($_POST['plugin_order_orders_id'], $_POST['plugin_order_references_id'], PluginOrderOrder::ORDER_DEVICE_NOT_DELIVRED);
Dropdown::showInteger('number_reception', '', 1, $nb);
echo "</td><td>";
echo __("Delivery status", "order") . "&nbsp;";
PluginOrderDeliveryState::Dropdown(array('name' => "plugin_order_deliverystates_id"));
echo "</td>";
echo "<td><input type='submit' name='bulk_reception' class='submit' value='" . _sx('button', 'Post') . "'></td></tr></table>";
Html::ajaxFooter();