本文整理汇总了PHP中Html::closeArrowMassives方法的典型用法代码示例。如果您正苦于以下问题:PHP Html::closeArrowMassives方法的具体用法?PHP Html::closeArrowMassives怎么用?PHP Html::closeArrowMassives使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Html
的用法示例。
在下文中一共展示了Html::closeArrowMassives方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: showForm
function showForm()
{
global $DB;
$query = "SELECT * FROM\n `" . $this->getTable() . "`\n ORDER BY `states_id` ASC";
if ($result = $DB->query($query)) {
$number = $DB->numrows($result);
if ($number != 0) {
echo "<form method='post' name='massiveaction_form' id='massiveaction_form' action='" . $this->getFormURL() . "'>";
echo "<div align='center'>";
echo "<table class='tab_cadre_fixe' cellpadding='5'>";
echo "<tr>";
echo "<th>" . __('Status') . "</th><th></th>";
echo "</tr>";
while ($ligne = $DB->fetch_array($result)) {
$ID = $ligne["id"];
echo "<tr class='tab_bg_1'>";
echo "<td width='10'>";
echo "<input type='checkbox' name='item[{$ID}]'";
if (isset($_POST['check']) && $_POST['check'] == 'all') {
echo " checked ";
}
echo ">";
echo "</td>";
echo "<td>" . Dropdown::getDropdownName("glpi_states", $ligne["states_id"]) . "</td>";
echo "</tr>";
}
echo "</table></div>";
Html::openArrowMassives("massiveaction_form", true);
Html::closeArrowMassives(array('delete_state' => _sx('button', 'Delete permanently')));
Html::closeForm();
echo "<div align='center'><form method='post' action='" . $this->getFormURL() . "'>";
echo "<table class='tab_cadre_fixe' cellpadding='5'><tr ><th colspan='2'>";
echo __('Disposal status', 'financialreports') . " : </th></tr>";
echo "<tr class='tab_bg_1'><td>";
Dropdown::show('State', array('name' => "states_id", 'value' => $ligne["states_id"]));
echo "</td>";
echo "<td>";
echo "<div align='center'>";
echo "<input type='submit' name='add_state' value='" . _sx('button', 'Post') . "' class='submit' >";
echo "</div></td></tr>";
echo "</table>";
Html::closeForm();
echo "</div>";
} else {
echo "<div align='center'><form method='post' action='" . $this->getFormURL() . "'>";
echo "<table class='tab_cadre' cellpadding='5'><tr ><th colspan='2'>";
echo __('Disposal status', 'financialreports') . " : </th></tr>";
echo "<tr class='tab_bg_1'><td>";
Dropdown::show('State', array('name' => "states_id"));
echo "</td>";
echo "<td>";
echo "<div align='center'>";
echo "<input type='submit' name='add_state' value='" . _sx('button', 'Post') . "' class='submit' >";
echo "</div></td></tr>";
echo "</table>";
Html::closeForm();
echo "</div>";
}
}
}
示例2: showForm
function showForm($target)
{
global $DB;
$rand = mt_rand();
$query = "SELECT *\n FROM `" . $this->getTable() . "`\n ORDER BY `states_id` ASC ";
if ($result = $DB->query($query)) {
$number = $DB->numrows($result);
if ($number != 0) {
echo "<div align='center'><form method='post' name='massiveaction_form{$rand}' id='massiveaction_form{$rand}' action=\"{$target}\">";
echo "<table class='tab_cadre_fixe' cellpadding='5'>";
echo "<tr>";
echo "<th></th><th>" . _n('Status', 'Statuses', 2) . "</th>";
echo "</tr>";
while ($ligne = $DB->fetch_array($result)) {
$ID = $ligne["id"];
echo "<tr class='tab_bg_1'>";
echo "<td width='10' class='center'>";
echo "<input type='hidden' name='id' value='{$ID}'>";
echo "<input type='checkbox' name='item[{$ID}]' value='1'>";
echo "</td>";
echo "<td>" . Dropdown::getDropdownName("glpi_states", $ligne["states_id"]) . "</td>";
echo "</tr>";
}
Html::openArrowMassives("massiveaction_form{$rand}", true);
Html::closeArrowMassives(array('delete_state' => __('Delete permanently')));
echo "</table>";
Html::closeForm();
echo "</div>";
}
}
}
示例3: manageGroup
function manageGroup($groups_id)
{
global $CFG_GLPI;
$group = new Group();
if (Session::haveRight('group', 'w')) {
echo "<form method='post' name='' id='manageGroup' action=\"" . $CFG_GLPI['root_doc'] . "/plugins/escalade/front/group_group.form.php\">";
}
echo "<table width='950' class='tab_cadre_fixe'>";
echo "<tr>";
echo "<th colspan='2'>";
echo "Escalade";
echo "</th>";
echo "</tr>";
$gg_found = $this->find("groups_id_source='{$groups_id}'");
if (Session::haveRight('group', 'w')) {
$groups_id_used = array();
foreach ($gg_found as $gg) {
$groups_id_used[] = $gg['groups_id_destination'];
}
echo "<tr>";
echo "<td colspan='2' align='center'>";
Dropdown::show('Group', array('name' => 'groups_id_destination', 'condition' => "is_assign=1", 'used' => $groups_id_used));
echo "<input type='hidden' name='groups_id_source' value='" . $groups_id . "' />";
echo " <input type='submit' class='submit' name='addgroup' value='" . _sx('button', 'Add') . "'/>";
echo "</td>";
echo "</tr>";
}
foreach ($gg_found as $gg_id => $gg) {
$group->getFromDB($gg['groups_id_destination']);
echo "<tr class='tab_bg_1'>";
echo "<td width='30'>";
if (Session::haveRight('group', 'w')) {
echo "<input type='checkbox' name='delgroup[]' value='{$gg_id}' />";
}
echo "</td>";
echo "<td>";
echo $group->getLink(true);
echo "</td>";
echo "</tr>";
}
echo "</table>";
if (Session::haveRight('group', 'w')) {
Html::openArrowMassives("manageGroup", true);
Html::closeArrowMassives(array('deleteitem' => _sx('button', 'Delete permanently')));
}
Html::closeForm();
}
示例4: showForm
function showForm($target)
{
global $CFG_GLPI;
$categories = getAllDatasFromTable($this->getTable());
if (!empty($categories)) {
echo "<div align='center'>";
$rand = mt_rand();
echo "<form method='post' name='massiveaction_form_ticket{$rand}' \n id='massiveaction_form_ticket{$rand}' action='" . $target . "'>";
echo "<table class='tab_cadre_fixe' cellpadding='5'>";
echo "<tr>";
echo "<th></th><th>" . __('Category of created tickets', 'resources') . "</th>";
echo "</tr>";
foreach ($categories as $categorie) {
$ID = $categorie["id"];
echo "<tr class='tab_bg_1'>";
echo "<td class='center' width='10'>";
echo "<input type='hidden' name='id' value='{$ID}'>";
echo "<input type='checkbox' name='item[{$ID}]' value='1'>";
echo "</td>";
echo "<td>" . Dropdown::getDropdownName("glpi_itilcategories", $categorie["ticketcategories_id"]) . "</td>";
echo "</tr>";
}
Html::openArrowMassives("massiveaction_form_ticket{$rand}", true);
Html::closeArrowMassives(array('delete_ticket' => __s('Delete permanently')));
echo "</table>";
Html::closeForm();
echo "</div>";
} else {
echo "<div align='center'><form method='post' action='" . $target . "'>";
echo "<table class='tab_cadre_fixe' cellpadding='5'><tr ><th colspan='2'>";
echo __('Category of created tickets', 'resources') . "</th></tr>";
echo "<tr class='tab_bg_1'><td>";
Dropdown::show('ITILCategory', array('name' => "ticketcategories_id"));
echo "</td>";
echo "<td>";
echo "<div align='center'>";
echo "<input type='submit' name='add_ticket' value=\"" . _sx('button', 'Add') . "\" \n class='submit'>";
echo "</div></td></tr>";
echo "</table>";
Html::closeForm();
echo "</div>";
}
}
示例5: showObjectFieldsForm
/**
*
* Displat all fields present in DB for an itemtype
* @param $id the itemtype's id
*/
public static function showObjectFieldsForm($id)
{
global $DB, $GO_BLACKLIST_FIELDS, $GO_READONLY_FIELDS, $GO_FIELDS, $CFG_GLPI;
$url = Toolbox::getItemTypeFormURL(__CLASS__);
$object_type = new PluginGenericobjectType();
$object_type->getFromDB($id);
$itemtype = $object_type->fields['itemtype'];
$fields_in_db = PluginGenericobjectSingletonObjectField::getInstance($itemtype);
$used_fields = array();
//Reset fields definition only to keep the itemtype ones
$GO_FIELDS = array();
plugin_genericobject_includeCommonFields(true);
$file = GLPI_ROOT . "/plugins/genericobject/fields/constants/" . $object_type->fields['name'] . ".constant.php";
if (file_exists($file)) {
include $file;
}
PluginGenericobjectType::includeConstants($itemtype, true);
foreach ($GO_BLACKLIST_FIELDS as $autofield) {
if (!in_array($autofield, $used_fields)) {
$used_fields[$autofield] = $autofield;
}
}
echo "<div class='center'>";
echo "<form name='fieldslist' method='POST' action='{$url}'>";
echo "<table class='tab_cadre_fixe' >";
echo "<input type='hidden' name='id' value='{$id}'>";
echo "<tr class='tab_bg_1'><th colspan='7'>";
echo __("Fields associated with the object", "genericobject") . " : ";
echo $itemtype::getTypeName();
echo "</th></tr>";
echo "<tr class='tab_bg_1'>";
echo "<th width='10'></th>";
echo "<th>" . __("Label", "genericobject") . "</th>";
echo "<th>" . __("Name in DB", "genericobject") . "</th>";
echo "<th width='10'></th>";
echo "<th width='10'></th>";
echo "</tr>";
$total = count($fields_in_db);
$global_index = $index = 1;
foreach ($fields_in_db as $field => $value) {
self::displayFieldDefinition($url, $itemtype, $field, $index, $global_index == $total);
//All backlisted fields cannot be moved, and are listed first
if (!in_array($field, $GO_READONLY_FIELDS)) {
$index++;
}
//If it's a plugin dropdowns, get it's real name
//(it may not be the one from the DB, in case it's a global field)
$table = getTableNameForForeignKeyField($field);
/*if ($table != '' && isPluginItemType(getItemTypeForTable($table))) {
$classname = getItemTypeForTable($table);
$class = new $classname();
$used_fields[$class->getFieldName()] = $class->getFieldName();
} else {*/
$used_fields[$field] = $field;
//}
$global_index++;
}
echo "</table>";
Html::openArrowMassives('fieldslist', true);
Html::closeArrowMassives(array('delete' => __("Delete permanently")));
echo "<table class='tab_cadre'>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __("Add new field", "genericobject") . "</td>";
echo "<td align='left'>";
self::dropdownFields("new_field", $itemtype, $used_fields);
echo "</td>";
echo "<td>";
echo "<input type='submit' name='add_field' value=\"" . _sx('button', 'Add') . "\" class='submit'>";
echo "</tr>";
echo "</table>";
Html::closeForm();
echo "</div>";
}
示例6: 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());
}
//.........这里部分代码省略.........
示例7: manageGroup
function manageGroup($groups_id)
{
global $DB, $CFG_GLPI;
$group = new Group();
$a_groups_tmp = $group->find('', '`name`');
$a_groups = array();
foreach ($a_groups_tmp as $data) {
$a_groups[$data['id']] = $data['name'];
}
unset($a_groups[$groups_id]);
echo "<form method='post' name='' id='' action=\"" . $CFG_GLPI['root_doc'] . "/plugins/escalation/front/group_group.form.php\">";
echo "<table width='950' class='tab_cadre_fixe'>";
echo "<tr>";
echo "<th colspan='2'>";
echo "Escalade";
echo "</th>";
echo "</tr>";
$query = "SELECT * FROM `" . $this->getTable() . "`\n WHERE `groups_id_source`='" . $groups_id . "'";
$result = $DB->query($query);
echo "<tr>";
echo "<td colspan='2' align='center'>";
while ($data = $DB->fetch_array($result)) {
unset($a_groups[$data['groups_id_destination']]);
}
Dropdown::showFromArray("groups_id_destination", $a_groups);
echo "<input type='hidden' name='groups_id_source' value='" . $groups_id . "' />";
echo " <input type='submit' class='submit' name='addgroup' value='" . __('Add') . "'/>";
echo "</td>";
echo "</tr>";
$result = $DB->query($query);
while ($data = $DB->fetch_array($result)) {
$group->getFromDB($data['groups_id_destination']);
echo "<tr class='tab_bg_1'>";
echo "<td width='30'>";
echo "<input type='checkbox' name='delgroup[]' value='" . $data['id'] . "' />";
echo "</td>";
echo "<td>";
echo $group->getName();
echo "</td>";
echo "</tr>";
}
echo "</table>";
Html::openArrowMassives("delgroup", true);
Html::closeArrowMassives(array('deleteitem' => __('Delete permanently')));
Html::closeForm();
}
示例8: showAesKey
public function showAesKey($ID)
{
global $DB;
$this->h->getFromDB($ID);
Session::initNavigateListItems("PluginAccountsAesKey", __('Hash', 'accounts') . " = " . $this->h->fields["name"]);
$candelete = $this->h->can($ID, 'w');
$query = "SELECT *\n FROM `glpi_plugin_accounts_aeskeys`\n WHERE `plugin_accounts_hashes_id` = '{$ID}' ";
$result = $DB->query($query);
$rand = mt_rand();
echo "<div class='center'>";
echo "<form method='post' name='show_aeskey{$rand}' id='show_aeskey{$rand}' action=\"./aeskey.form.php\">";
echo "<input type='hidden' name='plugin_accounts_hashes_id' value='" . $ID . "'>";
echo "<table class='tab_cadre_fixe'>";
echo "<tr><th colspan='5'>" . __('Encryption key', 'accounts') . "</th></tr>";
echo "<tr><th> </th>";
echo "<th class='left'>" . __('Name') . "</th>";
echo "</tr>";
if ($DB->numrows($result) > 0) {
while ($data = $DB->fetch_array($result)) {
Session::addToNavigateListItems("PluginAccountsAesKey", $data['id']);
echo "<input type='hidden' name='item[" . $data["id"] . "]' value='" . $ID . "'>";
echo "<tr class='tab_bg_1 center'>";
echo "<td width='10'>";
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("PluginAccountsAesKey");
echo "<td class='left'><a href='" . $link . "?id=" . $data["id"] . "&plugin_accounts_hashes_id=" . $ID . "'>";
echo __('Encryption key', 'accounts') . "</a></td>";
echo "</tr>";
}
echo "</table>";
if ($candelete) {
Html::openArrowMassives("show_aeskey{$rand}", true);
Html::closeArrowMassives(array('delete' => __('Delete permanently')));
}
} else {
echo "</table>";
}
Html::closeForm();
echo "</div>";
}
示例9: showProcesses
//.........这里部分代码省略.........
$notupdated_number = new PluginOcsinventoryngMiniStat();
$notunique_number = new PluginOcsinventoryngMiniStat();
$linkedrefused_number = new PluginOcsinventoryngMiniStat();
$process_time = new PluginOcsinventoryngMiniStat();
$sql = "SELECT `id`, `processid`, SUM(`total_number_machines`) AS total_machines,\n `plugin_ocsinventoryng_ocsservers_id`, `status`, COUNT(*) AS threads_number,\n MIN(`start_time`) AS starting_date, MAX(`end_time`) AS ending_date,\n TIME_TO_SEC(MAX(`end_time`)) - TIME_TO_SEC(MIN(`start_time`)) AS duree,\n SUM(`imported_machines_number`) AS imported_machines,\n SUM(`synchronized_machines_number`) AS synchronized_machines,\n SUM(`linked_machines_number`) AS linked_machines,\n SUM(`failed_rules_machines_number`) AS failed_rules_machines,\n SUM(`notupdated_machines_number`) AS notupdated_machines,\n SUM(`not_unique_machines_number`) AS not_unique_machines_number,\n SUM(`link_refused_machines_number`) AS link_refused_machines_number,\n `end_time` >= DATE_ADD(NOW(), INTERVAL - " . $minfreq . " HOUR) AS DoStat\n FROM `" . $this->getTable() . "`\n GROUP BY `processid`\n ORDER BY `id` DESC\n LIMIT 50";
$result = $DB->query($sql);
echo "<div class='center'>";
echo "<form name='processes' id='processes' action='{$target}' method='post'>";
echo "<table class='tab_cadrehov'>";
echo "<tr><th colspan='16'>" . __('Processes execution of automatic actions', 'ocsinventoryng') . "</th></tr>";
echo "<tr>";
echo "<th> </th>";
echo "<th> </th>";
echo "<th>" . __('Status') . "</th>";
echo "<th>" . __('Number of threads', 'ocsinventoryng') . "</th>";
echo "<th>" . __('Beginning date of execution', 'ocsinventoryng') . "</th>";
echo "<th>" . __('Ending date of execution', 'ocsinventoryng') . "</th>";
echo "<th>" . __('Computers imported by automatic actions', 'ocsinventoryng') . "</th>";
echo "<th>" . __('Computers synchronized', 'ocsinventoryng') . "</th>";
echo "<th>" . __('Computers linked', 'ocsinventoryng') . "</th>";
echo "<th>" . __('Computers not imported by automatic actions', 'ocsinventoryng') . "</th>";
echo "<th>" . __('Computers not updated', 'ocsinventoryng') . "</th>";
echo "<th>" . __('Computers not unique', 'ocsinventoryng') . "</th>";
echo "<th>" . __('Computers refused', 'ocsinventoryng') . "</th>";
echo "<th>" . __('Process time execution', 'ocsinventoryng') . "</th>";
echo "<th>" . __('Server') . "</th>";
echo "<th> </th>";
echo "</th></tr>\n";
if ($DB->numrows($result)) {
while ($thread = $DB->fetch_array($result)) {
if ($config->fields["is_displayempty"] || $thread["status"] != PLUGIN_OCSINVENTORYNG_STATE_FINISHED || !$config->fields["is_displayempty"] && $thread["total_machines"] > 0 && $thread["status"] == PLUGIN_OCSINVENTORYNG_STATE_FINISHED) {
if ($thread["DoStat"] && $thread["status"] == PLUGIN_OCSINVENTORYNG_STATE_FINISHED) {
$imported_number->AddValue($thread["imported_machines"]);
$synchronized_number->AddValue($thread["synchronized_machines"]);
$linked_number->AddValue($thread["linked_machines"]);
$failed_number->AddValue($thread["failed_rules_machines"]);
$notupdated_number->AddValue($thread["notupdated_machines"]);
$notunique_number->AddValue($thread["not_unique_machines_number"]);
$linkedrefused_number->AddValue($thread["link_refused_machines_number"]);
$process_time->AddValue($thread["duree"]);
} else {
if ($imported_number->GetCount() > 0) {
$this->showshowStat($minfreq, $imported_number, $synchronized_number, $linked_number, $failed_number, $notupdated_number, $notunique_number, $linkedrefused_number, $process_time);
$imported_number->Reset();
}
}
echo "<tr class='tab_bg_1'>";
echo "<td width='10'>";
if ($canedit) {
echo "<input type='checkbox' name='item[" . $thread["processid"] . "]' value='1'>";
} else {
echo " ";
}
echo "</td>";
echo "<td class='center'>";
echo "<a href=\"./thread.form.php?pid=" . $thread["processid"] . "\">" . $thread["processid"] . "</a></td>";
echo "<td class='center'>";
$this->displayProcessStatusIcon($this->getProcessStatus($thread["processid"]));
echo "</td>";
echo "<td class='center'>" . $thread["threads_number"] . "</td>";
echo "<td class='center'>" . Html::convDateTime($thread["starting_date"]) . "</td>";
echo "<td class='center'>" . Html::convDateTime($thread["ending_date"]) . "</td>";
echo "<td class='center'>" . $thread["imported_machines"] . "</td>";
echo "<td class='center'>" . $thread["synchronized_machines"] . "</td>";
echo "<td class='center'>" . $thread["linked_machines"] . "</td>";
echo "<td class='center'>" . $thread["failed_rules_machines"] . "</td>";
echo "<td class='center'>" . $thread["notupdated_machines"] . "</td>";
echo "<td class='center'>" . $thread["not_unique_machines_number"] . "</td>";
echo "<td class='center'>" . $thread["link_refused_machines_number"] . "</td>";
echo "<td class='center'>";
if ($thread["status"] == PLUGIN_OCSINVENTORYNG_STATE_FINISHED) {
echo Html::timestampToString($thread["duree"]);
} else {
echo Dropdown::EMPTY_VALUE;
}
echo "</td>";
echo "<td class='center'>";
if ($thread["plugin_ocsinventoryng_ocsservers_id"] != -1) {
$ocsConfig = PluginOcsinventoryngOcsServer::getConfig($thread["plugin_ocsinventoryng_ocsservers_id"]);
echo "<a href=\"ocsserver.form.php?id=" . $ocsConfig["id"] . "\">" . $ocsConfig["name"] . "</a>";
} else {
_e('All servers', 'ocsinventoryng');
}
echo "</td>";
echo "<td class='center'>";
echo "<a href=\"detail.php?reset=reset_before&field[0]=" . "5&contains[0]=^" . $thread["processid"] . '$">' . "<img src='" . $CFG_GLPI["root_doc"] . "/pics/rdv.png'</a></td>";
echo "</tr>\n";
}
}
}
if ($imported_number->GetCount() > 0) {
$this->showshowStat($minfreq, $imported_number, $synchronized_number, $linked_number, $failed_number, $notupdated_number, $notunique_number, $linkedrefused_number, $process_time);
}
echo "</table>";
if ($canedit) {
Html::openArrowMassives("processes");
Html::closeArrowMassives(array("delete_processes" => _x('button', 'Delete permanently')));
}
Html::closeForm();
}
示例10: printf
echo "</tr>\n";
}
echo "<tr class='tab_bg_4'><td class='center' colspan='{$colspan}'>";
if ($i) {
printf(__('%1$s: %2$s'), __('Duplicate computers', 'reports'), $i);
} else {
_e('No item found');
}
echo "</td></tr>\n";
echo "</table>";
if ($canedit) {
if ($i) {
Html::openArrowMassives("massiveaction_form");
Dropdown::showForMassiveAction('Computer');
$options = array();
Html::closeArrowMassives($options);
}
Html::closeForm();
}
}
Html::footer();
function buildBookmarkUrl($url, $crit)
{
return $url . "?crit=" . $crit;
}
function getLastOcsUpdate($computers_id)
{
global $DB;
$query = "SELECT `last_ocs_update`\n FROM `glpi_ocslinks`\n WHERE `computers_id` = '{$computers_id}'";
$results = $DB->query($query);
if ($DB->numrows($results) > 0) {
示例11: showOrderSupplierInfos
public static function showOrderSupplierInfos($ID)
{
//TODO : en cours
global $DB;
$order = new PluginOrderOrder();
$order->getFromDB($ID);
$suppliers_id = $order->fields["suppliers_id"];
Session::initNavigateListItems(__CLASS__, __("Order", "order") . " = " . $order->fields["name"]);
$candelete = $order->can($ID, UPDATE);
$rand = mt_rand();
$link = Toolbox::getItemTypeFormURL(__CLASS__);
echo "<form method='post' name='show_supplierinfos{$rand}' id='show_supplierinfos{$rand}' " . "action=\"" . $link . "\">";
echo "<div class='center'>";
echo "<input type='hidden' name='plugin_order_orders_id' value='" . $ID . "'>";
$table = getTableForItemType(__CLASS__);
$nb_elements = countElementsInTable($table, "`plugin_order_orders_id` = '{$ID}'");
if ($nb_elements > 0) {
echo "<table class='tab_cadre_fixe'>";
echo "<tr><th colspan='4'>" . __("Supplier Detail", "order") . "</th></tr>";
echo "<tr>";
echo "<th> </th>";
echo "<th>" . __("Supplier") . "</th>";
echo "<th>" . __("Quote number", "order") . "</th>";
echo "<th>" . __("Order number") . "</th>";
echo "</tr>";
$datas = getAllDatasFromTable($table, "`plugin_order_orders_id` = '{$ID}'");
foreach ($datas as $data) {
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>";
echo "<td><a href='" . $link . "?id=" . $data["id"] . "&plugin_order_orders_id=" . $ID . "'>" . Dropdown::getDropdownName("glpi_suppliers", $data["suppliers_id"]) . "</a></td>";
echo "<td>" . $data["num_quote"] . "</td>";
echo "<td>" . $data["num_order"] . "</td>";
echo "</tr>";
}
echo "</table></div>";
if ($candelete) {
Html::openArrowMassives("show_supplierinfos{$rand}", true);
Html::closeArrowMassives(array('delete' => __("Delete permanently")));
}
}
Html::closeForm();
}
示例12: showItemFromPlugin
public function showItemFromPlugin($instID, $search = '')
{
global $DB, $CFG_GLPI;
if (!$this->canView()) {
return false;
}
$rand = mt_rand();
$PluginConnectionsConnection = new PluginConnectionsConnection();
if ($PluginConnectionsConnection->getFromDB($instID)) {
$canedit = $PluginConnectionsConnection->can($instID, UPDATE);
$query = "SELECT DISTINCT `itemtype`\n FROM `" . $this->getTable() . "`\n WHERE `plugin_connections_connections_id` = '" . (int) $instID . "'\n ORDER BY `itemtype`";
$result = $DB->query($query);
$number = $DB->numrows($result);
if (Session::isMultiEntitiesMode()) {
$colsup = 1;
} else {
$colsup = 0;
}
echo "<form method='post' name='connections_form{$rand}' id='connections_form{$rand}'\n action=\"" . $CFG_GLPI["root_doc"] . "/plugins/connections/front/connection.form.php\">";
echo "<div class='center'><table class='tab_cadrehov'>";
echo "<tr><th colspan='" . ($canedit ? 5 + $colsup : 4 + $colsup) . "'>" . __('Associated element') . ":</th></tr><tr>";
if ($canedit) {
echo "<th> </th>";
}
echo "<th>" . __('Type') . "</th>";
echo "<th>" . __('Name') . "</th>";
if (Session::isMultiEntitiesMode()) {
echo "<th>" . __('Entity') . "</th>";
}
echo "<th>" . __('Serial Number') . "</th>";
echo "<th>" . __('Inventory number') . "</th>";
echo "</tr>";
for ($i = 0; $i < $number; $i++) {
$type = $DB->result($result, $i, "itemtype");
if (!class_exists($type)) {
continue;
}
$item = new $type();
if ($item->canView()) {
$column = "name";
$table = getTableForItemType($type);
$itemTable = $this->getTable();
$entitiesRestrict = getEntitiesRestrictRequest(" AND ", 't', '', '', $item->maybeRecursive());
$mayBeTemplate = $item->maybeTemplate() ? " AND t.`is_template` = '0'" : '';
$query = "SELECT t.*, it.`id` AS items_id, `glpi_entities`.`ID` AS entity\n FROM `{$itemTable}` it, `{$table}` t\n LEFT JOIN `glpi_entities` ON (`glpi_entities`.`id` = t.`entities_id`)\n WHERE t.`id` = it.`items_id`\n AND it.`itemtype` = '{$type}'\n AND it.`plugin_connections_connections_id` = '{$instID}'\n {$entitiesRestrict}\n {$mayBeTemplate}\n ORDER BY `glpi_entities`.`completename`, t.`{$column}`;";
if ($result_linked = $DB->query($query)) {
if ($DB->numrows($result_linked)) {
Session::initNavigateListItems($type, __('Connections', 'connections') . " = " . $PluginConnectionsConnection->fields['name']);
while ($data = $DB->fetch_assoc($result_linked)) {
$item->getFromDB($data["id"]);
Session::addToNavigateListItems($type, $data["id"]);
$ID = $_SESSION["glpiis_ids_visible"] || empty($data["name"]) ? " (" . $data["id"] . ")" : "";
$link = Toolbox::getItemTypeFormURL($type);
$name = "<a href=\"" . $link . "?id=" . $data["id"] . "\">" . $data["name"] . $ID . "</a>";
echo "<tr class='tab_bg_1'>";
if ($canedit) {
echo "<td width='10'>";
$sel = isset($_GET["select"]) && "all" == $_GET["select"] ? "checked" : "";
echo "<input type='checkbox' name='item[" . $data["items_id"] . "]' value='1' " . $sel . ">";
echo "</td>";
}
echo "<td class='center'>" . $item->getTypeName() . "</td>";
$is_deleted = isset($data['is_deleted']) && $data['is_deleted'] ? "class='tab_bg_2_2'" : "";
echo "<td class='center' " . $is_deleted . ">" . $name . "</td>";
if (Session::isMultiEntitiesMode()) {
echo "<td class='center'>";
echo Dropdown::getDropdownName("glpi_entities", $data['entity']);
echo "</td>";
}
echo "<td class='center'>";
echo isset($data["serial"]) ? $data["serial"] : "-";
echo "</td>";
echo "<td class='center'>";
echo isset($data["otherserial"]) ? $data["otherserial"] : "-";
echo "</td>";
echo "</tr>";
}
}
}
}
}
if ($canedit) {
echo "<tr class='tab_bg_1'><td colspan='" . (3 + $colsup) . "' class='center'>";
echo "<input type='hidden' name='plugin_connections_connections_id' value='{$instID}'>";
Dropdown::showAllItems("items_id", 0, 0, $PluginConnectionsConnection->fields['is_recursive'] ? -1 : $PluginConnectionsConnection->fields['entities_id'], $this->getClasses());
echo "</td>";
echo "<td colspan='2' class='center' class='tab_bg_2'>";
echo "<input type='submit' name='additem' value=\"" . __('Add') . "\" class='submit'>";
echo "</td></tr>";
echo "</table></div>";
Html::openArrowMassives("connections_form{$rand}");
Html::closeArrowMassives(array('deleteitem' => __('Delete')));
} else {
echo "</table></div>";
}
echo Html::closeForm(false);
}
}
示例13: showReports
static function showReports($ID, $withtemplate = '')
{
global $DB, $CFG_GLPI;
$rand = mt_rand();
$resource = new PluginResourcesResource();
$resource->getFromDB($ID);
$canedit = $resource->can($ID, 'w');
Session::initNavigateListItems("PluginResourcesReportConfig", PluginResourcesResource::getTypeName(1) . " = " . $resource->fields["name"]);
$query = "SELECT `glpi_plugin_resources_reportconfigs`.`id`,\n `glpi_plugin_resources_reportconfigs`.`plugin_resources_resources_id`,\n `glpi_plugin_resources_reportconfigs`.`information`, \n `glpi_plugin_resources_reportconfigs`.`comment`\n FROM `glpi_plugin_resources_reportconfigs` ";
$query .= " LEFT JOIN `glpi_plugin_resources_resources` ON (`glpi_plugin_resources_resources`.`id` = `glpi_plugin_resources_reportconfigs`.`plugin_resources_resources_id`)";
$query .= " WHERE `glpi_plugin_resources_reportconfigs`.`plugin_resources_resources_id` = '{$ID}'";
$result = $DB->query($query);
$number = $DB->numrows($result);
$i = 0;
$row_num = 1;
if ($number != "0") {
if ($withtemplate < 2) {
echo "<form method='post' name='form_reports{$rand}' id='form_reports{$rand}' action=\"./reportconfig.form.php\">";
}
echo "<div align='center'><table class='tab_cadre_fixe'>";
echo "<tr><th colspan='5'>" . self::getTypeName(1) . "</th></tr>";
$sel = "";
if (isset($_GET["select"]) && $_GET["select"] == "all") {
$sel = "checked";
}
echo "<tr>";
if (plugin_resources_haveRight('resources', 'w') && $canedit && $withtemplate < 2) {
echo "<th> </th>";
}
echo "<th>" . __('Comments') . "</th>";
echo "<th>" . __('Information', 'Informations', 2) . "</th>";
if ($withtemplate < 2) {
echo "<th> </th>";
}
echo "</tr>";
while ($data = $DB->fetch_array($result)) {
Session::addToNavigateListItems("PluginResourcesReportConfig", $data['id']);
$i++;
$row_num++;
echo "<tr class='tab_bg_1 center'>";
if (plugin_resources_haveRight('resources', 'w') && $canedit && $withtemplate < 2) {
echo "<td width='10'>";
echo "<input type='checkbox' name='check[" . $data["id"] . "]'";
if (isset($_POST['check']) && $_POST['check'] == 'all') {
echo " checked ";
}
echo ">";
echo "</td>";
}
echo "<td class='left'>" . nl2br($data["comment"]) . "</td>";
echo "<td class='left'>" . nl2br($data["information"]) . "</td>";
if ($withtemplate < 2) {
echo "<td class='center'>";
echo "<a href='" . $CFG_GLPI["root_doc"] . "/plugins/resources/front/reportconfig.form.php?id=" . $data["id"] . "&plugin_resources_resources_id=" . $data["plugin_resources_resources_id"] . "'>";
_e('Update');
if ($_SESSION["glpiis_ids_visible"]) {
echo " (" . $data["id"] . ")";
}
echo "</a></td>";
}
echo "</tr>";
}
echo "</table></div>";
if ($number && $canedit && $withtemplate < 2) {
if (plugin_resources_haveRight('resources', 'w')) {
Html::openArrowMassives("form_reports{$rand}", true);
Html::closeArrowMassives(array('delete_report' => _sx('button', 'Delete permanently')));
}
}
if ($withtemplate < 2) {
Html::closeForm();
}
}
}
示例14: showForItem
static function showForItem(CommonDBTM $item)
{
global $DB, $LANG;
if (!$item->can($item->getID(), 'r')) {
return false;
}
if (Session::haveRight('simcard', 'w')) {
$url = Toolbox::getItemTypeFormURL('PluginSimcardSimcard');
$url .= "?itemtype=" . $item->getType() . "&items_id=" . $item->getID() . "&id=-1";
echo "<div class='center'><a href='{$url}'>" . $LANG['plugin_simcard'][10] . "</a></div><br>";
}
$results = getAllDatasFromTable(getTableForItemType(__CLASS__), "`items_id` = '" . $item->getID() . "' AND `itemtype`='" . get_class($item) . "'");
echo "<div class='spaced'>";
echo "<form id='items' name='items' method='post' action='" . Toolbox::getItemTypeFormURL(__CLASS__) . "'>";
echo "<table class='tab_cadre_fixehov'>";
echo "<tr><th colspan='6'>" . $LANG['document'][19] . "</th></tr>";
if (!empty($results)) {
echo "<tr><th></th>";
echo "<th>" . $LANG['entity'][0] . "</th>";
echo "<th>" . $LANG['common'][16] . "</th>";
echo "<th>" . $LANG['common'][19] . "</th>";
echo "<th>" . $LANG['common'][20] . "</th>";
echo "</tr>";
foreach ($results as $data) {
$tmp = new PluginSimcardSimcard();
$tmp->getFromDB($data['plugin_simcard_simcards_id']);
echo "<tr>";
echo "<td>";
if (Session::haveRight('simcard', 'w')) {
echo "<input type='checkbox' name='todelete[" . $data['id'] . "]'>";
}
echo "</td>";
echo "<td>";
echo Dropdown::getDropdownName('glpi_entities', $tmp->fields['entities_id']);
echo "</td>";
echo "<td>";
echo $tmp->getLink();
echo "</td>";
echo "<td>";
echo $tmp->fields['serial'];
echo "</td>";
echo "<td>";
echo $tmp->fields['otherserial'];
echo "</td>";
echo "</tr>";
}
}
if (Session::haveRight('simcard', 'w')) {
echo "<tr class='tab_bg_1'><td colspan='4' class='center'>";
echo "<input type='hidden' name='items_id' value='" . $item->getID() . "'>";
echo "<input type='hidden' name='itemtype' value='" . $item->getType() . "'>";
$used = array();
$query = "SELECT `id`\n FROM `glpi_plugin_simcard_simcards`\n WHERE `is_template`='0'\n AND `id` IN (SELECT `plugin_simcard_simcards_id`\n FROM `glpi_plugin_simcard_simcards_items`)";
foreach ($DB->request($query) as $use) {
$used[$use['id']] = $use['id'];
}
Dropdown::show('PluginSimcardSimcard', array('name' => "plugin_simcard_simcards_id", 'entity' => $item->fields['entities_id'], 'used' => $used));
echo "</td>";
echo "<td colspan='2' class='center' class='tab_bg_2'>";
echo "<input type='submit' name='additem' value=\"" . $LANG['buttons'][8] . "\" class='submit'>";
echo "</td></tr>";
if (!empty($results)) {
Html::openArrowMassives('items');
Html::closeArrowMassives(array('delete_items' => $LANG['buttons'][10]));
}
}
echo "</table>";
Html::closeForm();
echo "</div>";
}
示例15: execute
//.........这里部分代码省略.........
$param .= "{$key}=" . urlencode($val);
}
}
Dropdown::showOutputFormat();
Html::closeForm();
echo "</td></tr>";
echo "</table></div>";
Html::printPager($start, $nbtot, $_SERVER['PHP_SELF'], $param);
}
}
}
if (!isset($_POST["display_type"]) || $_POST["display_type"] == Search::HTML_OUTPUT) {
if (isset($options['withmassiveaction']) && class_exists($options['withmassiveaction'])) {
echo "<form method='post' name='massiveaction_form' id='massiveaction_form' action=\"" . $CFG_GLPI["root_doc"] . "/front/massiveaction.php\">";
}
}
plugin_reports_checkRight($this->plug, $this->name, "r");
if ($res && $nbtot > 0) {
$nbcols = $DB->num_fields($res);
$nbrows = $DB->numrows($res);
echo Search::showHeader($output_type, $nbrows, $nbcols, true);
echo Search::showNewLine($output_type);
$num = 1;
// fill $sqlcols with default sql query fields so we can validate $columns
$sqlcols = array();
for ($i = 0; $i < $nbcols; $i++) {
$colname = $DB->field_name($res, $i);
$sqlcols[] = $colname;
}
$colsname = array();
// if $columns is not empty, display $columns
if (count($this->columns) > 0) {
foreach ($this->columns as $colname => $column) {
// display only $columns that are valid
if (in_array($colname, $sqlcols)) {
$column->showTitle($output_type, $num);
$colsname[$colname] = $column;
}
}
} else {
// else display default columns from SQL query
foreach ($sqlcols as $colname) {
$column = new PluginReportsColumn($colname, $colname);
$column->showTitle($output_type, $num);
$colsname[$colname] = $column;
}
}
echo Search::showEndLine($output_type);
$prev = "";
for ($row_num = 2; $row = $DB->fetch_assoc($res); $row_num++) {
$crt = "";
foreach ($this->group_by as $colname) {
if (isset($row[$colname])) {
$crt .= $row[$colname] . "####";
}
}
echo Search::showNewLine($output_type);
$num = 1;
foreach ($colsname as $colname => $column) {
//If value needs to be modified on the fly
if (isset($this->columns_mapping[$colname]) && isset($this->columns_mapping[$colname][$row[$colname]])) {
$new_value = $this->columns_mapping[$colname][$row[$colname]];
$row[$colname] = $new_value;
}
if (!in_array($colname, $this->group_by)) {
$column->showValue($output_type, $row, $num, $row_num);
} else {
if ($crt == $prev) {
$column->showValue($output_type, $output_type == Search::CSV_OUTPUT ? $row : array(), $num, $row_num);
} else {
$column->showValue($output_type, $row, $num, $row_num, true);
}
}
}
// Each column
echo Search::showEndLine($output_type);
$prev = $crt;
}
// Each row
if (isset($options['withtotal']) && $options['withtotal']) {
echo Search::showNewLine($output_type);
$num = 1;
foreach ($colsname as $colname => $column) {
$column->showTotal($output_type, $num, $row_num);
}
echo Search::showEndLine($output_type);
}
}
echo Search::showFooter($output_type, $title);
if (!isset($_POST["display_type"]) || $_POST["display_type"] == Search::HTML_OUTPUT) {
if (isset($options['withmassiveaction']) && class_exists($options['withmassiveaction'])) {
Html::openArrowMassives("massiveaction_form", true);
Dropdown::showForMassiveAction($options['withmassiveaction']);
$options = array();
Html::closeArrowMassives($options);
Html::closeForm();
}
Html::footer();
}
}