本文整理汇总了PHP中Toolbox::getItemTypeFormUrl方法的典型用法代码示例。如果您正苦于以下问题:PHP Toolbox::getItemTypeFormUrl方法的具体用法?PHP Toolbox::getItemTypeFormUrl怎么用?PHP Toolbox::getItemTypeFormUrl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Toolbox
的用法示例。
在下文中一共展示了Toolbox::getItemTypeFormUrl方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getMenuContent
static function getMenuContent()
{
global $CFG_GLPI;
$menu = array();
$menu['title'] = self::getMenuName();
$menu['page'] = '/plugins/datainjection/front/clientinjection.form.php';
if (Session::haveRight(static::$rightname, READ)) {
$image_model = "<img src='" . $CFG_GLPI["root_doc"] . "/pics/rdv.png' title='";
$image_model .= PluginDatainjectionModel::getTypeName();
$image_model .= "' alt='" . PluginDatainjectionModel::getTypeName() . "'>";
$image_import = "<img src='" . $CFG_GLPI["root_doc"] . "/pics/actualiser.png' title='";
$image_import .= __s('Injection of the file', 'datainjection');
$image_import .= "' alt='" . __s('Injection of the file', 'datainjection') . "'>";
$menu['options']['client']['title'] = self::getMenuName();
$menu['options']['client']['page'] = Toolbox::getItemTypeSearchUrl('PluginDatainjectionModel', false);
$menu['options']['client']['links']['search'] = '/plugins/datainjection/front/clientinjection.form.php';
if (Session::haveRight('plugin_datainjection_model', READ)) {
$menu['options']['model']['title'] = PluginDatainjectionModel::getTypeName();
$menu['options']['model']['page'] = Toolbox::getItemTypeSearchUrl('PluginDatainjectionModel', false);
$menu['options']['model']['links']['search'] = Toolbox::getItemTypeSearchUrl('PluginDatainjectionModel', false);
$menu['options']['client']['links'][$image_model] = Toolbox::getItemTypeSearchUrl('PluginDatainjectionModel', false);
}
//$menu['options']['client']['links'][$image_model] = Toolbox::getItemTypeSearchUrl('PluginDatainjectionModel', false);
$menu['options']['model']['links'][$image_import] = '/plugins/datainjection/front/clientinjection.form.php';
if (Session::haveRight('plugin_datainjection_model', UPDATE) || Session::haveRight('plugin_datainjection_model', CREATE)) {
$menu['options']['model']['links']['add'] = Toolbox::getItemTypeFormUrl('PluginDatainjectionModel', false);
$menu['options']['client']['links'][$image_model] = Toolbox::getItemTypeSearchUrl('PluginDatainjectionModel', false);
}
}
return $menu;
}
示例2: getMenuContent
static function getMenuContent()
{
global $CFG_GLPI;
$menu = array();
$menu['title'] = self::getMenuName();
$menu['page'] = '/plugins/itilcategorygroups/front/category.php';
if (Session::haveRight('config', READ)) {
$menu['options']['model']['title'] = PluginItilcategorygroupsMenu::getTypeName();
$menu['options']['model']['page'] = Toolbox::getItemTypeSearchUrl('PluginItilcategorygroupsCategory', false);
$menu['options']['model']['links']['search'] = Toolbox::getItemTypeSearchUrl('PluginItilcategorygroupsCategory', false);
if (Session::haveRight('config', UPDATE)) {
$menu['options']['model']['links']['add'] = Toolbox::getItemTypeFormUrl('PluginItilcategorygroupsCategory', false);
}
}
return $menu;
}
示例3: getMenuContent
static function getMenuContent()
{
global $CFG_GLPI;
$menu = array();
// get Menu name :
$tab = plugin_version_uninstall();
$menu['title'] = $tab["name"];
$menu['page'] = '/plugins/uninstall/front/model.php';
if (Session::haveRight(PluginUninstallProfile::$rightname, READ)) {
$menu['options']['model']['title'] = self::getTypeName(1);
$menu['options']['model']['page'] = Toolbox::getItemTypeSearchUrl('PluginUninstallModel', false);
$menu['options']['model']['links']['search'] = Toolbox::getItemTypeSearchUrl('PluginUninstallModel', false);
if (Session::haveRight(PluginUninstallProfile::$rightname, UPDATE)) {
$menu['options']['model']['links']['add'] = Toolbox::getItemTypeFormUrl('PluginUninstallModel', false);
}
}
return $menu;
}
示例4: showOrderLink
public function showOrderLink($plugin_order_orders_id)
{
global $DB, $CFG_GLPI;
$PluginOrderOrder = new PluginOrderOrder();
$PluginOrderOrder_Item = new PluginOrderOrder_Item();
$PluginOrderReference = new PluginOrderReference();
$PluginOrderReception = new PluginOrderReception();
$PluginOrderOrder->getFromDB($plugin_order_orders_id);
$canedit = $PluginOrderOrder->canDeliver() && !$PluginOrderOrder->canUpdateOrder() && !$PluginOrderOrder->isCanceled();
$query_ref = "SELECT `glpi_plugin_order_orders_items`.`id` AS IDD,\n `glpi_plugin_order_orders_items`.`plugin_order_references_id` AS id,\n `glpi_plugin_order_references`.`name`,\n `glpi_plugin_order_references`.`itemtype`,\n `glpi_plugin_order_references`.`manufacturers_id`,\n `glpi_plugin_order_orders_items`.`price_taxfree`,\n `glpi_plugin_order_orders_items`.`discount`\n FROM `glpi_plugin_order_orders_items`, `glpi_plugin_order_references`\n WHERE `plugin_order_orders_id` = '{$plugin_order_orders_id}'\n AND `glpi_plugin_order_orders_items`.`plugin_order_references_id` = `glpi_plugin_order_references`.`id`\n AND `glpi_plugin_order_orders_items`.`states_id` = '" . PluginOrderOrder::ORDER_DEVICE_DELIVRED . "'\n GROUP BY `glpi_plugin_order_orders_items`.`plugin_order_references_id`\n ORDER BY `glpi_plugin_order_references`.`name`";
$result_ref = $DB->query($query_ref);
$numref = $DB->numrows($result_ref);
while ($data_ref = $DB->fetch_array($result_ref)) {
echo "<div class='center'><table class='tab_cadre_fixe'>";
if (!$numref) {
echo "<tr><th>" . __("No item to take delivery of", "order") . "</th></tr></table></div>";
} else {
$plugin_order_references_id = $data_ref["id"];
$itemtype = $data_ref["itemtype"];
$canuse = $itemtype != 'PluginOrderOther';
$item = new $itemtype();
$rand = mt_rand();
$query = "SELECT `glpi_plugin_order_orders_items`.`id` AS IDD,\n `glpi_plugin_order_references`.`id` AS id,\n `glpi_plugin_order_references`.`templates_id`,\n `glpi_plugin_order_orders_items`.`states_id`,\n `glpi_plugin_order_orders_items`.`delivery_date`,\n `glpi_plugin_order_orders_items`.`delivery_number`,\n `glpi_plugin_order_references`.`name`,\n `glpi_plugin_order_references`.`itemtype`,\n `glpi_plugin_order_orders_items`.`items_id`,\n `glpi_plugin_order_orders_items`.`price_taxfree`,\n `glpi_plugin_order_orders_items`.`discount`\n FROM `glpi_plugin_order_orders_items`, `glpi_plugin_order_references`\n WHERE `plugin_order_orders_id` = '{$plugin_order_orders_id}'\n AND `glpi_plugin_order_orders_items`.`plugin_order_references_id` = '{$plugin_order_references_id}'\n AND `glpi_plugin_order_orders_items`.`plugin_order_references_id` = `glpi_plugin_order_references`.`id`\n AND `glpi_plugin_order_orders_items`.`states_id` = '" . PluginOrderOrder::ORDER_DEVICE_DELIVRED . "'";
if ($itemtype == 'SoftwareLicense') {
$query .= " GROUP BY `glpi_plugin_order_orders_items`.`price_taxfree`,\n `glpi_plugin_order_orders_items`.`discount`";
}
$query .= " ORDER BY `glpi_plugin_order_references`.`name`";
$result = $DB->query($query);
$num = $DB->numrows($result);
echo "<tr><th><ul><li>";
echo "<a href=\"javascript:showHideDiv('generation{$rand}','generation_img{$rand}', " . "'" . $CFG_GLPI['root_doc'] . "/pics/plus.png','" . $CFG_GLPI['root_doc'] . "/pics/moins.png');\">";
echo "<img alt='' name='generation_img{$rand}' src=\"" . $CFG_GLPI['root_doc'] . "/pics/plus.png\">";
echo "</a>";
echo "</li></ul></th>";
echo "<th>" . __("Type") . "</th>";
echo "<th>" . __("Manufacturer") . "</th>";
echo "<th>" . __("Product reference", "order") . "</th>";
echo "</tr>";
echo "<tr class='tab_bg_1 center'>";
echo "<td></td>";
echo "<td align='center'>" . $item->getTypeName() . "</td>";
echo "<td align='center'>" . Dropdown::getDropdownName("glpi_manufacturers", $data_ref["manufacturers_id"]) . "</td>";
echo "<td>" . $PluginOrderReference->getReceptionReferenceLink($data_ref) . " ({$num})</td>";
echo "</tr>";
echo "</table>";
echo "<div class='center' id='generation{$rand}' style='display:none'>";
echo "<form method='post' name='order_generation_form{$rand}'\n id='order_generation_form{$rand}' action=\"" . Toolbox::getItemTypeFormUrl(__CLASS__) . "\">";
echo "<table class='tab_cadre_fixe'>";
echo "<tr>";
if ($canedit & $canuse) {
echo "<th width='15'></th>";
}
if ($itemtype != 'SoftwareLicense') {
echo "<th>" . __("ID") . "</th>";
} else {
echo "<th>" . __("Quantity", "order") . "</th>";
}
echo "<th>" . __("Reference") . "</th>";
echo "<th>" . __("Status") . "</th>";
echo "<th>" . __("Delivery date") . "</th>";
echo "<th>" . _n("Associated item", "Associated items", 2) . "</th></tr>";
while ($data = $DB->fetch_array($result)) {
$random = mt_rand();
$detailID = $data["IDD"];
echo "<tr class='tab_bg_2'>";
if ($canedit & $canuse) {
echo "<td width='15' align='left'>";
$sel = "";
if (isset($_GET["select"]) && $_GET["select"] == "all") {
$sel = "checked";
}
echo "<input type='checkbox' name='item[" . $detailID . "]' value='1' {$sel}>";
echo "</td>";
}
if ($itemtype != 'SoftwareLicense') {
echo "<td align='center'>" . $data["IDD"] . "</td>";
} else {
echo "<td align='center'>";
echo $PluginOrderOrder_Item->getTotalQuantityByRefAndDiscount($plugin_order_orders_id, $plugin_order_references_id, $data["price_taxfree"], $data["discount"]);
echo "</td>";
}
echo "<td align='center'>" . $PluginOrderReference->getReceptionReferenceLink($data) . "</td>";
echo "<td align='center'>" . $PluginOrderReception->getReceptionStatus($detailID) . "</td>";
echo "<td align='center'>" . Html::convDate($data["delivery_date"]) . "</td>";
echo "<td align='center'>" . $this->getReceptionItemName($data["items_id"], $data["itemtype"]);
echo "<input type='hidden' name='id[{$detailID}]' value='{$detailID}'>";
echo "<input type='hidden' name='name[{$detailID}]' value='" . $data["name"] . "'>";
echo "<input type='hidden' name='itemtype[{$detailID}]' value='" . $data["itemtype"] . "'>";
echo "<input type='hidden' name='templates_id[{$detailID}]' value='" . $data["templates_id"] . "'>";
echo "<input type='hidden' name='states_id[{$detailID}]' value='" . $data["states_id"] . "'>";
}
echo "</tr>";
echo "</table>";
if ($canedit & $canuse) {
Html::openArrowMassives("order_generation_form{$rand}", true);
echo "<input type='hidden' name='plugin_order_orders_id' value='{$plugin_order_orders_id}'>";
$entities_id = $PluginOrderOrder->fields['entities_id'];
$this->dropdownLinkActions($itemtype, $plugin_order_references_id, $plugin_order_orders_id, $entities_id);
Html::closeArrowMassives(array());
}
//.........这里部分代码省略.........
示例5: showForConfig
static function showForConfig($id)
{
global $CFG_GLPI, $DB;
$config = new PluginGeninventorynumberConfig();
$config->getFromDB($id);
$target = Toolbox::getItemTypeFormUrl(__CLASS__);
echo "<form name='form_core_config' method='post' action=\"{$target}\">";
echo "<div align='center'>";
echo "<table class='tab_cadre_fixe'>";
echo "<tr><th colspan='5'>" . __('PerDeviceTypeConfiguration', 'geninventorynumber') . "</th></tr>";
echo "<input type='hidden' name='id' value='{$id}'>";
echo "<input type='hidden' name='entities_id' value='0'>";
echo "<tr><th colspan='2'>" . __('GenerationModel', 'geninventorynumber');
echo "</th><th>" . __('Active') . "</th>";
echo "<th>" . __('UseGlobalIndex', 'geninventorynumber') . "</th>";
echo "<th colspan='2'>" . __('IndexPosition', 'geninventorynumber') . "</th></tr>";
foreach (getAllDatasFromTable(getTableForItemType(__CLASS__)) as $value) {
$itemtype = $value['itemtype'];
echo "<td class='tab_bg_1' align='center'>" . call_user_func(array($itemtype, 'getTypeName')) . "</td>";
echo "<td class='tab_bg_1'>";
echo "<input type='hidden' name='ids[{$itemtype}][id]' value='" . $value["id"] . "'>";
echo "<input type='hidden' name='ids[{$itemtype}][itemtype]' value='{$itemtype}'>";
echo "<input type='text' name='ids[{$itemtype}][template]' value=\"" . $value["template"] . "\">";
echo "</td>";
echo "<td class='tab_bg_1' align='center'>";
Dropdown::showYesNo("ids[{$itemtype}][is_active]", $value["is_active"]);
echo "</td>";
echo "<td class='tab_bg_1' align='center'>";
Dropdown::showYesNo("ids[{$itemtype}][use_index]", $value["use_index"]);
echo "</td>";
echo "<td class='tab_bg_1' align='center'>";
if ($value["is_active"] && !$value["use_index"]) {
echo "<input type='text' name='ids[{$itemtype}][index]' value='" . $value['index'] . "' size='12'>";
}
echo "</td>";
echo "</tr>";
}
echo "<tr class='tab_bg_1'><td align='center' colspan='5'>";
echo "<input type='submit' name='update_fields' value=\"" . _sx('button', 'Save') . "\" class='submit'>";
echo "</td></tr>";
echo "</table>";
Html::closeForm();
}