本文整理汇总了PHP中Group::dropdown方法的典型用法代码示例。如果您正苦于以下问题:PHP Group::dropdown方法的具体用法?PHP Group::dropdown怎么用?PHP Group::dropdown使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Group
的用法示例。
在下文中一共展示了Group::dropdown方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: displaySearchForm
/**
* Display group form
**/
function displaySearchForm()
{
global $_SERVER, $_GET, $CFG_GLPI;
echo "<form action='" . $_SERVER["PHP_SELF"] . "' method='post'>";
echo "<table class='tab_cadre' cellpadding='5'>";
echo "<tr class='tab_bg_1 center'>";
echo "<td>";
echo __('Group') . " ";
Group::dropdown(array('name =>' => "group", 'value' => $_GET["group"], 'entity' => $_SESSION["glpiactive_entity"], 'condition' => "is_itemgroup"));
echo "</td>";
// Display Reset search
echo "<td>";
echo "<a href='" . $CFG_GLPI["root_doc"] . "/plugins/reports/report/equipmentbygroups/equipmentbygroups.php?reset_search=reset_search'>" . "<img title='" . __s('Blank') . "' alt='" . __s('Blank') . "' src='" . $CFG_GLPI["root_doc"] . "/pics/reset.png' class='calendrier'></a>";
echo "</td>";
echo "<td>";
echo "<input type='submit' value='Valider' class='submit' />";
echo "</td>";
echo "</tr></table>";
Html::closeForm();
}
示例2: showForm
/**
* Print the peripheral form
*
* @param $ID integer ID of the item
* @param $options array
* - target filename : where to go when done.
* - withtemplate boolean : template or basic item
*
* @return boolean item found
**/
function showForm($ID, $options = array())
{
global $CFG_GLPI;
$target = $this->getFormURL();
$withtemplate = $this->initForm($ID, $options);
$this->showFormHeader($options);
echo "<tr class='tab_bg_1'>";
//TRANS: %1$s is a string, %2$s a second one without spaces between them : to change for RTL
echo "<td>" . sprintf(__('%1$s%2$s'), __('Name'), isset($options['withtemplate']) && $options['withtemplate'] ? "*" : "");
echo "</td>";
echo "<td>";
$objectName = autoName($this->fields["name"], "name", isset($options['withtemplate']) && $options['withtemplate'] == 2, $this->getType(), $this->fields["entities_id"]);
Html::autocompletionTextField($this, "name", array('value' => $objectName));
echo "</td>\n";
echo "<td>" . __('Status') . "</td>\n";
echo "<td>";
State::dropdown(array('value' => $this->fields["states_id"], 'entity' => $this->fields["entities_id"], 'condition' => "`is_visible_peripheral`"));
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Location') . "</td>\n";
echo "<td>";
Location::dropdown(array('value' => $this->fields["locations_id"], 'entity' => $this->fields["entities_id"]));
echo "</td>\n";
echo "<td>" . __('Type') . "</td>\n";
echo "<td>";
PeripheralType::dropdown(array('value' => $this->fields["peripheraltypes_id"]));
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Technician in charge of the hardware') . "</td>\n";
echo "<td>";
User::dropdown(array('name' => 'users_id_tech', 'value' => $this->fields["users_id_tech"], 'right' => 'own_ticket', 'entity' => $this->fields["entities_id"]));
echo "</td>";
echo "<td>" . __('Manufacturer') . "</td>\n";
echo "<td>";
Manufacturer::dropdown(array('value' => $this->fields["manufacturers_id"]));
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Group in charge of the hardware') . "</td>";
echo "<td>";
Group::dropdown(array('name' => 'groups_id_tech', 'value' => $this->fields['groups_id_tech'], 'entity' => $this->fields['entities_id'], 'condition' => '`is_assign`'));
echo "</td>";
echo "<td>" . __('Model') . "</td>\n";
echo "<td>";
PeripheralModel::dropdown(array('value' => $this->fields["peripheralmodels_id"]));
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Alternate username number') . "</td>\n";
echo "<td>";
Html::autocompletionTextField($this, "contact_num");
echo "</td>";
echo "<td>" . __('Serial number') . "</td>\n";
echo "<td>";
Html::autocompletionTextField($this, "serial");
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Alternate username') . "</td>\n";
echo "<td>";
Html::autocompletionTextField($this, "contact");
echo "</td>\n";
echo "<td>" . sprintf(__('%1$s%2$s'), __('Inventory number'), isset($options['withtemplate']) && $options['withtemplate'] ? "*" : "") . "</td>\n";
echo "<td>";
$objectName = autoName($this->fields["otherserial"], "otherserial", isset($options['withtemplate']) && $options['withtemplate'] == 2, $this->getType(), $this->fields["entities_id"]);
Html::autocompletionTextField($this, "otherserial", array('value' => $objectName));
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('User') . "</td>\n";
echo "<td>";
User::dropdown(array('value' => $this->fields["users_id"], 'entity' => $this->fields["entities_id"], 'right' => 'all'));
echo "</td>\n";
echo "<td>" . __('Management type') . "</td>\n";
echo "<td>";
Dropdown::showGlobalSwitch($this->fields["id"], array('withtemplate' => $withtemplate, 'value' => $this->fields["is_global"], 'management_restrict' => $CFG_GLPI["peripherals_management_restrict"], 'target' => $target));
echo "</td></tr>\n";
// Display auto inventory informations
$rowspan = 2;
$inventory_show = false;
if (!empty($ID) && $this->fields["is_dynamic"]) {
$inventory_show = true;
$rowspan -= 1;
}
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Group') . "</td>\n";
echo "<td>";
Group::dropdown(array('value' => $this->fields["groups_id"], 'entity' => $this->fields["entities_id"], 'condition' => '`is_itemgroup`'));
echo "</td>\n";
echo "<td rowspan='{$rowspan}'>" . __('Comments') . "</td>\n";
echo "<td rowspan='{$rowspan}'>\n <textarea cols='45' rows='" . ($rowspan + 3) . "' name='comment' >" . $this->fields["comment"];
echo "</textarea></td></tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Brand') . "</td>\n";
//.........这里部分代码省略.........
示例3: showForm
/**
* Print the phone form
*
* @param $ID integer ID of the item
* @param $options array
* - target filename : where to go when done.
* - withtemplate boolean : template or basic item
*
* @return boolean item found
**/
function showForm($ID, $options = array())
{
global $CFG_GLPI;
$target = $this->getFormURL();
$withtemplate = $this->initForm($ID, $options);
$this->showFormHeader($options);
echo "<tr class='tab_bg_1'>";
//TRANS: %1$s is a string, %2$s a second one without spaces between them : to change for RTL
echo "<td>" . sprintf(__('%1$s%2$s'), __('Name'), isset($options['withtemplate']) && $options['withtemplate'] ? "*" : "") . "</td>";
echo "<td>";
$objectName = autoName($this->fields["name"], "name", isset($options['withtemplate']) && $options['withtemplate'] == 2, $this->getType(), $this->fields["entities_id"]);
Html::autocompletionTextField($this, 'name', array('value' => $objectName));
echo "</td>";
echo "<td>" . __('Status') . "</td>";
echo "<td>";
State::dropdown(array('value' => $this->fields["states_id"], 'entity' => $this->fields["entities_id"], 'condition' => "`is_visible_phone`='1'"));
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Location') . "</td>";
echo "<td>";
Location::dropdown(array('value' => $this->fields["locations_id"], 'entity' => $this->fields["entities_id"]));
echo "</td>";
echo "<td>" . __('Type') . "</td>";
echo "<td>";
PhoneType::dropdown(array('value' => $this->fields["phonetypes_id"]));
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Technician in charge of the hardware') . "</td>";
echo "<td>";
User::dropdown(array('name' => 'users_id_tech', 'value' => $this->fields["users_id_tech"], 'right' => 'own_ticket', 'entity' => $this->fields["entities_id"]));
echo "</td>";
echo "<td>" . __('Manufacturer') . "</td>";
echo "<td>";
Manufacturer::dropdown(array('value' => $this->fields["manufacturers_id"]));
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Group in charge of the hardware') . "</td>";
echo "<td>";
Group::dropdown(array('name' => 'groups_id_tech', 'value' => $this->fields['groups_id_tech'], 'entity' => $this->fields['entities_id'], 'condition' => '`is_assign`'));
echo "</td>";
echo "<td>" . __('Model') . "</td>";
echo "<td>";
PhoneModel::dropdown(array('value' => $this->fields["phonemodels_id"]));
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Alternate username number') . "</td>";
echo "<td>";
Html::autocompletionTextField($this, "contact_num");
echo "</td>";
echo "<td>" . __('Serial number') . "</td>";
echo "<td>";
Html::autocompletionTextField($this, "serial");
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Alternate username') . "</td><td>";
Html::autocompletionTextField($this, "contact");
echo "</td>";
echo "<td>" . sprintf(__('%1$s%2$s'), __('Inventory number'), isset($options['withtemplate']) && $options['withtemplate'] ? "*" : "") . "</td>";
echo "<td>";
$objectName = autoName($this->fields["otherserial"], "otherserial", isset($options['withtemplate']) && $options['withtemplate'] == 2, $this->getType(), $this->fields["entities_id"]);
Html::autocompletionTextField($this, 'otherserial', array('value' => $objectName));
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('User') . "</td>";
echo "<td>";
User::dropdown(array('value' => $this->fields["users_id"], 'entity' => $this->fields["entities_id"], 'right' => 'all'));
echo "</td>";
echo "<td>" . __('Management type') . "</td>";
echo "<td>";
Dropdown::showGlobalSwitch($this->fields["id"], array('withtemplate' => $withtemplate, 'value' => $this->fields["is_global"], 'management_restrict' => $CFG_GLPI["phones_management_restrict"], 'target' => $target));
echo "</td></tr>\n";
// Display auto inventory informations
$rowspan = 7;
$inventory_show = false;
if (!empty($ID) && $this->fields["is_dynamic"]) {
$inventory_show = true;
$rowspan -= 2;
}
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Group') . "</td>";
echo "<td>";
Group::dropdown(array('value' => $this->fields["groups_id"], 'entity' => $this->fields["entities_id"], 'condition' => '`is_itemgroup`'));
echo "</td>";
echo "<td rowspan='{$rowspan}'>" . __('Comments') . "</td>";
echo "<td rowspan='{$rowspan}'>\n <textarea cols='45' rows='" . ($rowspan + 3) . "' name='comment' class='form-control' >" . $this->fields["comment"];
echo "</textarea></td></tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Brand') . "</td>";
echo "<td>";
Html::autocompletionTextField($this, "brand");
//.........这里部分代码省略.........
示例4: showActorsPartForm
/**
* show actor part in ITIL object form
*
* @param $ID integer ITIL object ID
* @param $options array options for default values ($options of showForm)
*
* @return nothing display
**/
function showActorsPartForm($ID, array $options)
{
global $CFG_GLPI;
$showuserlink = 0;
if (User::canView()) {
$showuserlink = 1;
}
$options['_default_use_notification'] = 1;
if (isset($options['entities_id'])) {
$options['_default_use_notification'] = Entity::getUsedConfig('is_notif_enable_default', $options['entities_id'], '', 1);
}
// check is_hidden fields
foreach (array('_users_id_requester', '_groups_id_requester', '_users_id_observer', '_groups_id_observer', '_users_id_assign', '_groups_id_assign', '_suppliers_id_assign') as $f) {
$is_hidden[$f] = false;
if (isset($options['_tickettemplate']) && $options['_tickettemplate']->isHiddenField($f)) {
$is_hidden[$f] = true;
}
}
$can_admin = $this->canAdminActors();
$can_assign = $this->canAssign();
$can_assigntome = $this->canAssignToMe();
if (isset($options['_noupdate']) && !$options['_noupdate']) {
$can_admin = false;
$can_assign = false;
$can_assigntome = false;
}
// Manage actors : requester and assign
echo "<table class='tab_cadre_fixe' id='mainformtable5'>";
echo "<tr class='tab_bg_1'>";
echo "<th rowspan='2' width='13%'>" . __('Actor') . "</th>";
echo "<th width='29%'>";
if (!$is_hidden['_users_id_requester'] || !$is_hidden['_groups_id_requester']) {
_e('Requester');
}
$rand_requester = -1;
$candeleterequester = false;
if ($ID && $can_admin && (!$is_hidden['_users_id_requester'] || !$is_hidden['_groups_id_requester'])) {
$rand_requester = mt_rand();
echo " ";
echo "<img title=\"" . __s('Add') . "\" alt=\"" . __s('Add') . "\"\n onClick=\"" . Html::jsShow("itilactor{$rand_requester}") . "\"\n class='pointer' src='" . $CFG_GLPI["root_doc"] . "/pics/add_dropdown.png'>";
$candeleterequester = true;
}
echo "</th>";
echo "<th width='29%'>";
if (!$is_hidden['_users_id_observer'] || !$is_hidden['_groups_id_observer']) {
_e('Watcher');
}
$rand_observer = -1;
$candeleteobserver = false;
if ($ID && $can_admin && (!$is_hidden['_users_id_observer'] || !$is_hidden['_groups_id_observer'])) {
$rand_observer = mt_rand();
echo " ";
echo "<img title=\"" . __s('Add') . "\" alt=\"" . __s('Add') . "\"\n onClick=\"" . Html::jsShow("itilactor{$rand_observer}") . "\"\n class='pointer' src='" . $CFG_GLPI["root_doc"] . "/pics/add_dropdown.png'>";
$candeleteobserver = true;
} else {
if ($ID > 0 && !in_array($this->fields['status'], $this->getClosedStatusArray()) && !$is_hidden['_users_id_observer'] && !$this->isUser(CommonITILActor::OBSERVER, Session::getLoginUserID()) && !$this->isUser(CommonITILActor::REQUESTER, Session::getLoginUserID())) {
echo " ";
Html::showSimpleForm($this->getFormURL(), 'addme_observer', __('Associate myself'), array($this->getForeignKeyField() => $this->fields['id']), $CFG_GLPI["root_doc"] . "/pics/addme.png");
}
}
echo "</th>";
echo "<th width='29%'>";
if (!$is_hidden['_users_id_assign'] || !$is_hidden['_groups_id_assign'] || !$is_hidden['_suppliers_id_assign']) {
_e('Assigned to');
}
$rand_assign = -1;
$candeleteassign = false;
if ($ID && ($can_assign || $can_assigntome) && (!$is_hidden['_users_id_assign'] || !$is_hidden['_groups_id_assign'] || !$is_hidden['_suppliers_id_assign']) && $this->isAllowedStatus($this->fields['status'], CommonITILObject::ASSIGNED)) {
$rand_assign = mt_rand();
echo " ";
echo "<img title=\"" . __s('Add') . "\" alt=\"" . __s('Add') . "\"\n onClick=\"" . Html::jsShow("itilactor{$rand_assign}") . "\"\n class='pointer' src='" . $CFG_GLPI["root_doc"] . "/pics/add_dropdown.png'>";
}
if ($ID && $can_assigntome && !in_array($this->fields['status'], $this->getClosedStatusArray()) && !$is_hidden['_users_id_assign'] && !$this->isUser(CommonITILActor::ASSIGN, Session::getLoginUserID()) && $this->isAllowedStatus($this->fields['status'], CommonITILObject::ASSIGNED)) {
Html::showSimpleForm($this->getFormURL(), 'addme_assign', __('Associate myself'), array($this->getForeignKeyField() => $this->fields['id']), $CFG_GLPI["root_doc"] . "/pics/addme.png");
}
if ($ID && $can_assign) {
$candeleteassign = true;
}
echo "</th></tr>";
echo "<tr class='tab_bg_1 top'>";
echo "<td>";
if ($rand_requester >= 0) {
$this->showActorAddForm(CommonITILActor::REQUESTER, $rand_requester, $this->fields['entities_id'], $is_hidden);
}
// Requester
if (!$ID) {
$reqdisplay = false;
if ($can_admin && !$is_hidden['_users_id_requester']) {
$this->showActorAddFormOnCreate(CommonITILActor::REQUESTER, $options);
$reqdisplay = true;
} else {
$delegating = User::getDelegateGroupsForUser($options['entities_id']);
//.........这里部分代码省略.........
示例5: showForm
function showForm($ID, $options = array())
{
$PluginRacksConfig = new PluginRacksConfig();
$this->initForm($ID, $options);
$this->showFormHeader($options);
//ligne 1
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Name') . "</td><td>";
$objectName = autoName($this->fields["name"], "name", isset($options['withtemplate']) && $options['withtemplate'] == 2, $this->getType(), $this->fields["entities_id"]);
Html::autocompletionTextField($this, 'name', array('value' => $objectName));
echo "</td>";
echo "<td>" . __('Size') . "</td><td>";
Dropdown::showInteger("rack_size", $this->fields["rack_size"], 1, 100, 1);
echo " " . __('U', 'racks') . "</td>";
echo "</tr>";
//ligne 2
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Manufacturer') . "</td><td>";
Manufacturer::dropdown(array('value' => $this->fields["manufacturers_id"]));
echo "</td>";
echo "<td >" . __('Location') . "</td>";
echo "<td>";
Location::dropdown(array('value' => $this->fields["locations_id"], 'entity' => $this->fields["entities_id"]));
echo "</td>";
echo "</tr>";
echo "<tr class='tab_bg_1'>";
echo "<td >" . __('Technician in charge of the hardware') . "</td>";
echo "<td >";
User::dropdown(array('name' => 'users_id_tech', 'value' => $this->fields["users_id_tech"], 'right' => 'interface', 'entity' => $this->fields["entities_id"]));
echo "</td>";
echo "<td>" . __('Place', 'racks');
echo "</td><td>";
$PluginRacksRoomLocation = new PluginRacksRoomLocation();
$PluginRacksRoomLocation->dropdownRoomLocations("plugin_racks_roomlocations_id", $this->fields["plugin_racks_roomlocations_id"], $this->fields["entities_id"]);
echo "</td>";
echo "</tr>";
//ligne 4
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Group in charge of the hardware') . "</td><td>";
Group::dropdown(array('name' => 'groups_id_tech', 'value' => $this->fields['groups_id_tech'], 'entity' => $this->fields['entities_id'], 'condition' => '`is_assign`'));
echo "</td>";
echo "<td>" . __('Width', 'racks') . "</td><td>";
echo "<input type='text' name='width' \n value=\"" . Html::formatNumber($this->fields["width"], true) . "\" size='10'> ";
$PluginRacksConfig->getUnit("size");
echo "</td>";
echo "</tr>";
//ligne 5
echo "<tr class='tab_bg_1'>";
echo "</td>";
echo "<td>" . __('Serial number') . "</td>";
echo "<td >";
Html::autocompletionTextField($this, 'serial');
echo "</td>";
echo "<td>" . __('Height', 'racks') . "</td><td>";
echo "<input type='text' name='height' \n value=\"" . Html::formatNumber($this->fields["height"], true) . "\" size='10'> ";
$PluginRacksConfig->getUnit("size");
echo "</td>";
echo "</tr>";
//ligne 6
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Inventory number') . "</td>";
echo "<td>";
Html::autocompletionTextField($this, 'otherserial');
echo "</td>";
echo "<td>" . __('Weight', 'racks') . "</td><td>";
echo "<input type='text' name='weight' \n value=\"" . Html::formatNumber($this->fields["weight"], true) . "\" size='10'> ";
$PluginRacksConfig->getUnit("weight");
echo "</td>";
echo "</tr>";
//ligne 7
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Model') . "</td>";
echo "<td>";
Dropdown::show('PluginRacksRackModel', array('name' => "plugin_racks_rackmodels_id", 'value' => $this->fields["plugin_racks_rackmodels_id"]));
echo "</td>";
echo "<td>" . __('Depth', 'racks') . "</td><td>";
echo "<input type='text' name='depth' \n value=\"" . Html::formatNumber($this->fields["depth"], true) . "\" size='10'> ";
$PluginRacksConfig->getUnit("size");
echo "</td>";
echo "</tr>";
//ligne 8
echo "<tr class='tab_bg_1'>";
echo "<td >" . __('Type') . "</td><td>";
Dropdown::show('PluginRacksRackType', array('value' => $this->fields["plugin_racks_racktypes_id"]));
echo "</td>";
echo "<td >" . __('Status') . "</td><td>";
Dropdown::show('PluginRacksRackState', array('value' => $this->fields["plugin_racks_rackstates_id"]));
echo "</td>";
echo "</tr>";
//ligne 9
echo "<tr class='tab_bg_1'>";
echo "<td colspan='2'>";
if ((!isset($options['withtemplate']) || $options['withtemplate'] == 0) && !empty($this->fields['template_name'])) {
echo "<span class='small_space'>";
printf(__('Created from the template %s'), $this->fields['template_name']);
echo "</span>";
} else {
echo " ";
}
echo "</td><td colspan='2'>";
//.........这里部分代码省略.........
示例6: showSelectionForm
/**
* Show the planning selection form
*
* @param $type planning type : can be day, week, month
* @param $date working date
* @param $usertype type of planning to view : can be user or group
* @param $value ID of the item
* @param $limititemtype itemtype only display this itemtype (default '')
*
* @return Display form
**/
static function showSelectionForm($type, $date, $usertype, $value, $limititemtype = '')
{
global $CFG_GLPI;
switch ($type) {
case "month":
$split = explode("-", $date);
$year_next = $split[0];
$month_next = $split[1] + 1;
if ($month_next > 12) {
$year_next++;
$month_next -= 12;
}
$year_prev = $split[0];
$month_prev = $split[1] - 1;
if ($month_prev == 0) {
$year_prev--;
$month_prev += 12;
}
$next = $year_next . "-" . sprintf("%02u", $month_next) . "-" . $split[2];
$prev = $year_prev . "-" . sprintf("%02u", $month_prev) . "-" . $split[2];
break;
default:
$time = strtotime($date);
$step = 0;
switch ($type) {
case "week":
$step = WEEK_TIMESTAMP;
break;
case "day":
$step = DAY_TIMESTAMP;
break;
}
$next = $time + $step + 10;
$prev = $time - $step;
$next = strftime("%Y-%m-%d", $next);
$prev = strftime("%Y-%m-%d", $prev);
break;
}
$uID = 0;
$gID = 0;
switch ($usertype) {
case 'my':
$uID = $_SESSION['glpiID'];
break;
case 'mygroups':
if (!Session::haveRight("show_group_planning", "1")) {
exit;
}
$gID = 'mine';
break;
case 'users':
if (!Session::haveRight("show_all_planning", "1")) {
exit;
}
$uID = $value;
break;
case 'groups':
if (!Session::haveRight("show_all_planning", "1")) {
exit;
}
$gID = $value;
break;
}
echo "<div class='center'><form method='get' name='form' action='planning.php'>\n";
echo "<table class='tab_cadre_fixe'><tr class='tab_bg_1'>";
echo "<td>";
echo "<a href=\"" . $CFG_GLPI["root_doc"] . "/front/planning.php?type=" . $type . "&uID=" . $uID . "&date={$prev}&usertype={$usertype}&gID={$gID}&limititemtype={$limititemtype}\">";
echo "<img src='" . $CFG_GLPI["root_doc"] . "/pics/left.png' alt=\"" . __s('Previous') . "\"\n title=\"" . __s('Previous') . "\"></a>";
echo "</td>";
switch ($usertype) {
case 'users':
echo "<td>";
$rand_user = User::dropdown(array('name' => 'uID', 'value' => $value, 'right' => 'interface', 'all' => 1, 'entity' => $_SESSION["glpiactive_entity"]));
echo "</td>";
break;
case 'groups':
echo "<td>";
$rand_group = Group::dropdown(array('value' => $value, 'name' => 'gID', 'entity' => $_SESSION["glpiactive_entity"], 'condition' => '`is_usergroup`'));
echo "</td>";
break;
}
echo "</td>";
echo "<td>";
Dropdown::showItemTypes('limititemtype', $CFG_GLPI['planning_types'], array('value' => $limititemtype));
echo "</td>";
echo "<td>";
Html::showDateFormItem("date", $date, false);
echo '</td><td>';
echo "<select name='type'>";
//.........这里部分代码省略.........
示例7: showForm
function showForm($ID, $options = array())
{
global $CFG_GLPI;
if ($ID > 0) {
$this->check($ID, 'r');
} else {
$this->check(-1, 'w');
$this->getEmpty();
}
$canedit = $this->can($ID, 'w');
$canrecu = $this->can($ID, 'recursive');
$this->showTabs($options);
$this->showFormHeader($options);
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Name') . "</td><td>";
Html::autocompletionTextField($this, "name", array('size' => 34));
echo "</td><td>" . _n('Status', 'Statuses', 1) . "</td><td>";
State::dropdown(array('value' => $this->fields["states_id"]));
echo "</td></tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Location') . "</td><td>";
if ($canedit) {
Location::dropdown(array('value' => $this->fields["locations_id"], 'entity' => $this->fields["entities_id"]));
} else {
echo Dropdown::getDropdownName("glpi_locations", $this->fields["locations_id"]);
}
echo "</td><td>" . __('Type') . "</td><td>";
Dropdown::show('PluginAppliancesApplianceType', array('value' => $this->fields["plugin_appliances_appliancetypes_id"], 'entity' => $this->fields["entities_id"]));
echo "</td></tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Technician in charge of the hardware') . "</td><td>";
if ($canedit) {
User::dropdown(array('name' => 'users_id_tech', 'value' => $this->fields['users_id_tech'], 'right' => 'own_ticket', 'entity' => $this->fields['entities_id']));
} else {
echo getUsername($this->fields['users_id_tech']);
}
echo "</td><td>" . __('Environment', 'appliances') . "</td><td>";
Dropdown::show('PluginAppliancesEnvironment', array('value' => $this->fields["plugin_appliances_environments_id"]));
echo "</td></tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Group in charge of the hardware') . "</td><td>";
if ($canedit) {
Group::dropdown(array('name' => 'groups_id_tech', 'value' => $this->fields['groups_id_tech'], 'entity' => $this->fields['entities_id'], 'condition' => '`is_assign`'));
} else {
echo Dropdown::getDropdownName("glpi_groups", $this->fields["groups_id"]);
}
echo "</td><td>" . __('Serial number') . "</td><td>";
Html::autocompletionTextField($this, 'serial');
echo "</td></tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('User') . "</td>";
echo "<td>";
User::dropdown(array('value' => $this->fields["users_id"], 'entity' => $this->fields["entities_id"], 'right' => 'all'));
echo "</td><td>" . __('Inventory number') . "</td><td>";
Html::autocompletionTextField($this, 'otherserial');
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Group') . "</td>";
echo "<td>";
Group::dropdown(array('value' => $this->fields["groups_id"], 'entity' => $this->fields["entities_id"], 'condition' => '`is_itemgroup`'));
echo "</td>";
echo "<td rowspan='4'>" . __('Comments') . "</td>";
echo "<td rowspan='4' class='middle'>";
echo "<textarea cols='45' rows='5' name='comment' >" . $this->fields["comment"] . "</textarea>";
echo "</td></tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Associable to a ticket') . "</td><td>";
Dropdown::showYesNo('is_helpdesk_visible', $this->fields['is_helpdesk_visible']);
echo "</td></tr>";
echo "<tr class='tab_bg_1'>";
// dropdown relationtype added
echo "<td>" . __('Item to link', 'appliances') . "</td><td>";
if ($canedit && !($ID && countElementsInTable(array("glpi_plugin_appliances_relations", "glpi_plugin_appliances_appliances_items"), "glpi_plugin_appliances_relations.plugin_appliances_appliances_items_id\n = glpi_plugin_appliances_appliances_items.id\n AND glpi_plugin_appliances_appliances_items.plugin_appliances_appliances_id\n = {$ID}"))) {
PluginAppliancesRelation::dropdownType("relationtype", $this->fields["relationtype"]);
} else {
echo PluginAppliancesRelation::getTypeName($this->fields["relationtype"]);
$rand = mt_rand();
$comment = __('Flag change forbidden. Linked items found.');
$image = "/pics/lock.png";
echo " <img alt='' src='" . $CFG_GLPI["root_doc"] . $image . "' onmouseout=\"cleanhide('comment_relationtypes{$rand}')\" " . " onmouseover=\"cleandisplay('comment_relationtypes{$rand}')\">";
echo "<span class='over_link' id='comment_relationtypes{$rand}'>{$comment}</span>";
}
echo "</td></tr>";
echo "<tr class='tab_bg_1'>";
echo "<td colspan='2' class='center'>" . sprintf(__('%1$s: %2$s'), __('Last update'), Html::convDateTime($this->fields["date_mod"]));
echo "</td></tr>";
$this->showFormButtons($options);
echo "<div id='tabcontent'></div>";
echo "<script type='text/javascript'>loadDefaultTab();</script>";
return true;
}
示例8: printf
echo '<br>';
printf(__('%1$s: %2$s'), __('Email'), "<input type='text' size='25' name='_itil_" . $_POST["actortype"] . "[alternative_email]'>");
}
echo "</span>";
}
break;
case "group":
$cond = '`is_requester`';
if ($_POST["actortype"] == 'assign') {
$cond = '`is_assign`';
}
$param = array('name' => '_itil_' . $_POST["actortype"] . '[groups_id]', 'entity' => $_POST['entity_restrict'], 'condition' => $cond, 'rand' => $rand);
if ($_POST["itemtype"] == 'Ticket' && $_POST["actortype"] == 'assign') {
$param['toupdate'] = array('value_fieldname' => 'value', 'to_update' => "countgroupassign_{$rand}", 'url' => $CFG_GLPI["root_doc"] . "/ajax/ticketassigninformation.php", 'moreparams' => array('groups_id_assign' => '__VALUE__'));
}
$rand = Group::dropdown($param);
if ($_POST["itemtype"] == 'Ticket' && $_POST["actortype"] == 'assign') {
echo "<br><span id='countgroupassign_{$rand}'>";
echo "</span>";
}
break;
case "supplier":
$options = array('name' => '_itil_' . $_POST["actortype"] . '[suppliers_id]', 'entity' => $_POST['entity_restrict'], 'rand' => $rand);
if ($CFG_GLPI["use_mailing"]) {
$withemail = isset($_POST["allow_email"]) ? $_POST["allow_email"] : false;
$paramscomment = array('value' => '__VALUE__', 'allow_email' => $withemail, 'field' => '_itil_' . $_POST["actortype"], 'typefield' => "supplier", 'use_notification' => $_POST["use_notif"]);
// Fix rand value
$options['rand'] = $rand;
$options['toupdate'] = array('value_fieldname' => 'value', 'to_update' => "notif_supplier_{$rand}", 'url' => $CFG_GLPI["root_doc"] . "/ajax/uemailUpdate.php", 'moreparams' => $paramscomment);
}
if ($_POST["itemtype"] == 'Ticket') {
示例9: showForm
//.........这里部分代码省略.........
$hash = $hashe["hash"];
$hash_id = $hashe["id"];
}
$alert = '';
} else {
$alert = __('There is no encryption key for this entity', 'accounts');
}
$aeskey = new PluginAccountsAesKey();
//aeskey non enregistre
if ($hash) {
if (!$aeskey->getFromDBByHash($hash_id) || !$aeskey->fields["name"]) {
echo "<td>" . __('Encryption key', 'accounts') . "</div></td><td>";
echo "<input type='password' autocomplete='off' name='aeskey' id='aeskey'>";
echo Html::hidden('encrypted_password', array('value' => $this->fields["encrypted_password"], 'id' => 'encrypted_password'));
echo Html::hidden('good_hash', array('value' => $hash, 'id' => 'good_hash'));
echo Html::hidden('wrong_key_locale', array('value' => __('Wrong encryption key', 'accounts'), 'id' => 'wrong_key_locale'));
if (!empty($ID) || $ID > 0) {
$url = $this->getFormURL();
echo " <input type='button' id='decrypte_link' name='decrypte' value='" . __s('Uncrypt', 'accounts') . "'\n class='submit'>";
}
echo "</td>";
} else {
echo "<td></td><td>";
echo "</td>";
}
} else {
echo "<td>" . __('Encryption key', 'accounts') . "</div></td><td><div class='red'>";
echo $alert;
echo "</div></td>";
}
if ($_SESSION['glpiactiveprofile']['interface'] == 'central') {
echo "<td>" . __('Affected User', 'accounts') . "</td><td>";
if ($this->canCreate()) {
User::dropdown(array('value' => $this->fields["users_id"], 'entity' => $this->fields["entities_id"], 'right' => 'all'));
} else {
echo getUserName($this->fields["users_id"]);
}
echo "</td>";
} else {
echo "<td>" . __('Affected User', 'accounts') . "</td><td>";
echo getUserName($this->fields["users_id"]);
echo "</td>";
}
echo "</tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Password') . "</td>";
echo "<td>";
//aeskey enregistre
if (isset($hash_id) && $aeskey->getFromDBByHash($hash_id) && $aeskey->fields["name"]) {
echo Html::hidden('good_hash', array('value' => $hash, 'id' => 'good_hash'));
echo Html::hidden('aeskey', array('value' => $aeskey->fields["name"], 'id' => 'aeskey', 'autocomplete' => 'off'));
echo Html::hidden('encrypted_password', array('value' => $this->fields["encrypted_password"], 'id' => 'encrypted_password'));
echo Html::hidden('wrong_key_locale', array('value' => __('Wrong encryption key', 'accounts'), 'id' => 'wrong_key_locale'));
echo Html::scriptBlock("auto_decrypt();");
}
echo "<input type='text' name='hidden_password' id='hidden_password' size='30' >";
echo "</td>";
if ($_SESSION['glpiactiveprofile']['interface'] == 'central') {
echo "<td>" . __('Affected Group', 'accounts') . "</td><td>";
if (self::canCreate()) {
Dropdown::show('Group', array('value' => $this->fields["groups_id"], 'condition' => '`is_itemgroup`'));
} else {
echo Dropdown::getDropdownName("glpi_groups", $this->fields["groups_id"]);
}
echo "</td>";
} else {
示例10: showForm
//.........这里部分代码省略.........
case 'User':
$section_questions_user[$question['id']] = $question['name'];
break;
case 'Group':
$section_questions_group[$question['id']] = $question['name'];
break;
case 'Supplier':
$section_questions_supplier[$question['id']] = $question['name'];
break;
}
}
$questions_user_list[$section['name']] = $section_questions_user;
$questions_group_list[$section['name']] = $section_questions_group;
$questions_supplier_list[$section['name']] = $section_questions_supplier;
}
// Get available questions for actors lists
$actors = array('requester' => array(), 'observer' => array(), 'assigned' => array());
$query = "SELECT id, actor_role, actor_type, actor_value, use_notification\n FROM glpi_plugin_formcreator_targettickets_actors\n WHERE plugin_formcreator_targettickets_id = " . $this->getID();
$result = $GLOBALS['DB']->query($query);
while ($actor = $GLOBALS['DB']->fetch_array($result)) {
$actors[$actor['actor_role']][$actor['id']] = array('actor_type' => $actor['actor_type'], 'actor_value' => $actor['actor_value'], 'use_notification' => $actor['use_notification']);
}
$img_user = '<img src="../../../pics/users.png" alt="' . __('User') . '" title="' . __('User') . '" width="20" />';
$img_group = '<img src="../../../pics/groupes.png" alt="' . __('Group') . '" title="' . __('Group') . '" width="20" />';
$img_supplier = '<img src="../../../pics/supplier.png" alt="' . __('Supplier') . '" title="' . __('Supplier') . '" width="20" />';
$img_mail = '<img src="../pics/email.png" alt="' . __('Yes') . '" title="' . __('Email followup') . ' ' . __('Yes') . '" />';
$img_nomail = '<img src="../pics/email-no.png" alt="' . __('No') . '" title="' . __('Email followup') . ' ' . __('No') . '" />';
echo '<table class="tab_cadre_fixe">';
echo '<tr><th colspan="3">' . __('Ticket actors', 'formcreator') . '</th></tr>';
echo '<tr>';
echo '<th width="33%">';
echo _n('Requester', 'Requesters', 1) . ' ';
echo '<img title="Ajouter" alt="Ajouter" onclick="displayRequesterForm()" class="pointer"
id="btn_add_requester" src="../../../pics/add_dropdown.png">';
echo '<img title="Annuler" alt="Annuler" onclick="hideRequesterForm()" class="pointer"
id="btn_cancel_requester" src="../../../pics/delete.png" style="display:none">';
echo '</th>';
echo '<th width="34%">';
echo _n('Watcher', 'Watchers', 1) . ' ';
echo '<img title="Ajouter" alt="Ajouter" onclick="displayWatcherForm()" class="pointer"
id="btn_add_watcher" src="../../../pics/add_dropdown.png">';
echo '<img title="Annuler" alt="Annuler" onclick="hideWatcherForm()" class="pointer"
id="btn_cancel_watcher" src="../../../pics/delete.png" style="display:none">';
echo '</th>';
echo '<th width="33%">';
echo __('Assigned to') . ' ';
echo '<img title="Ajouter" alt="Ajouter" onclick="displayAssignedForm()" class="pointer"
id="btn_add_assigned" src="../../../pics/add_dropdown.png">';
echo '<img title="Annuler" alt="Annuler" onclick="hideAssignedForm()" class="pointer"
id="btn_cancel_assigned" src="../../../pics/delete.png" style="display:none">';
echo '</th>';
echo '</tr>';
echo '<tr>';
// Requester
echo '<td valign="top">';
// => Add requester form
echo '<form name="form_target" id="form_add_requester" method="post" style="display:none" action="' . $GLOBALS['CFG_GLPI']['root_doc'] . '/plugins/formcreator/front/targetticket.form.php">';
Dropdown::showFromArray('actor_type', array('' => Dropdown::EMPTY_VALUE, 'creator' => __('Form requester', 'formcreator'), 'validator' => __('Form validator', 'formcreator'), 'person' => __('Specific person', 'formcreator'), 'question_person' => __('Person from the question', 'formcreator'), 'group' => __('Specific group', 'formcreator'), 'question_group' => __('Group from the question', 'formcreator')), array('on_change' => 'formcreatorChangeActorRequester(this.value)'));
echo '<div id="block_requester_user" style="display:none">';
User::dropdown(array('name' => 'actor_value_person', 'right' => 'all', 'all' => 0));
echo '</div>';
echo '<div id="block_requester_group" style="display:none">';
Group::dropdown(array('name' => 'actor_value_group'));
echo '</div>';
echo '<div id="block_requester_question_user" style="display:none">';
Dropdown::showFromArray('actor_value_question_person', $questions_user_list, array('value' => $this->fields['due_date_question']));
示例11: showAddGroupForm
/**
* Display 'Group' part of self::showAddPlanningForm spcified by planning type dropdown.
* Actually called by ajax/planning.php
*
* @since 9.1
*
* @return Nothing (display function)
*/
static function showAddGroupForm($params = array())
{
$condition = "is_task = 1";
// filter groups
if (!Session::haveRight('planning', self::READALL)) {
$condition .= " AND id IN(" . implode(',', $_SESSION['glpigroups']) . ")";
}
echo __("Group") . " : <br>";
Group::dropdown(array('entity' => $_SESSION['glpiactive_entity'], 'entity_sons' => $_SESSION['glpiactive_entity_recursive'], 'condition' => $condition));
echo "<br /><br />";
echo Html::hidden('action', array('value' => 'send_add_group_form'));
echo Html::submit(_sx('button', 'Add'));
}
示例12: showForm
/**
* Print the computer form
*
* @param $ID integer ID of the item
* @param $options array
* - target for the Form
* - withtemplate template or basic computer
*
*@return Nothing (display)
**/
function showForm($ID, $options = array())
{
global $CFG_GLPI, $DB;
$this->initForm($ID, $options);
$this->showFormHeader($options);
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Creation date') . "</td>";
echo "<td>";
$date = $this->fields["date"];
if (!$ID) {
$date = $_SESSION['glpi_currenttime'];
}
Html::showDateTimeField("date", array('value' => $date, 'timestep' => 1, 'maybeempty' => false));
echo "</td>";
if ($ID) {
echo "<td>" . __('Last update') . "</td>";
echo "<td >" . Html::convDateTime($this->fields["date_mod"]) . "</td>";
} else {
echo "<td colspan='2'> </td>";
}
echo "</tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Name') . "</td>";
echo "<td>";
Html::autocompletionTextField($this, 'name');
echo "</td>";
echo "<td>" . __('Code') . "</td>";
echo "<td>";
Html::autocompletionTextField($this, 'code');
echo "</td>";
echo "</tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Priority') . "</td>";
echo "<td>";
CommonITILObject::dropdownPriority(array('value' => $this->fields['priority'], 'withmajor' => 1));
echo "</td>";
echo "<td>" . __('As child of') . "</td>";
echo "<td>";
$this->dropdown(array('entity' => $this->fields['entities_id'], 'value' => $this->fields['projects_id'], 'used' => array($this->fields['id'])));
echo "</td>";
echo "</tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . _x('item', 'State') . "</td>";
echo "<td>";
ProjectState::dropdown(array('value' => $this->fields["projectstates_id"]));
echo "</td>";
echo "<td>" . __('Percent done') . "</td>";
echo "<td>";
Dropdown::showNumber("percent_done", array('value' => $this->fields['percent_done'], 'min' => 0, 'max' => 100, 'step' => 5, 'unit' => '%'));
echo "</td>";
echo "</tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Type') . "</td>";
echo "<td>";
ProjectType::dropdown(array('value' => $this->fields["projecttypes_id"]));
echo "</td>";
echo "<td>" . __('Show on global GANTT') . "</td>";
echo "<td>";
Dropdown::showYesNo("show_on_global_gantt", $this->fields["show_on_global_gantt"]);
echo "</td>";
echo "</tr>";
echo "<tr><td colspan='4' class='subheader'>" . __('Manager') . "</td></tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('User') . "</td>";
echo "<td>";
User::dropdown(array('name' => 'users_id', 'value' => $this->fields["users_id"], 'right' => 'see_project', 'entity' => $this->fields["entities_id"]));
echo "</td>";
echo "<td>" . __('Group') . "</td>";
echo "<td>";
Group::dropdown(array('name' => 'groups_id', 'value' => $this->fields['groups_id'], 'entity' => $this->fields['entities_id'], 'condition' => '`is_manager`'));
echo "</td></tr>\n";
echo "<tr><td colspan='4' class='subheader'>" . __('Planning') . "</td></tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Planned start date') . "</td>";
echo "<td>";
Html::showDateTimeField("plan_start_date", array('value' => $this->fields['plan_start_date']));
echo "</td>";
echo "<td>" . __('Real start date') . "</td>";
echo "<td>";
Html::showDateTimeField("real_start_date", array('value' => $this->fields['real_start_date']));
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Planned end date') . "</td>";
echo "<td>";
Html::showDateTimeField("plan_end_date", array('value' => $this->fields['plan_end_date']));
echo "</td>";
echo "<td>" . __('Real end date') . "</td>";
echo "<td>";
Html::showDateTimeField("real_end_date", array('value' => $this->fields['real_end_date']));
echo "</td></tr>\n";
//.........这里部分代码省略.........
示例13: showForm
/**
* Print the Software form
*
* @param $ID integer ID of the item
* @param $options array of possible options:
* - target filename : where to go when done.
* - withtemplate boolean : template or basic item
*
*@return boolean item found
**/
function showForm($ID, $options = array())
{
$this->initForm($ID, $options);
$this->showFormHeader($options);
$canedit = $this->canEdit($ID);
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Name') . "</td>";
echo "<td>";
Html::autocompletionTextField($this, "name");
echo "</td>";
echo "<td>" . __('Publisher') . "</td><td>";
Manufacturer::dropdown(array('value' => $this->fields["manufacturers_id"]));
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Location') . "</td><td>";
Location::dropdown(array('value' => $this->fields["locations_id"], 'entity' => $this->fields["entities_id"]));
echo "</td>";
echo "<td>" . __('Category') . "</td><td>";
SoftwareCategory::dropdown(array('value' => $this->fields["softwarecategories_id"]));
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Technician in charge of the hardware') . "</td><td>";
User::dropdown(array('name' => 'users_id_tech', 'value' => $this->fields["users_id_tech"], 'right' => 'own_ticket', 'entity' => $this->fields["entities_id"]));
echo "</td>";
echo "<td>" . __('Associable to a ticket') . "</td><td>";
Dropdown::showYesNo('is_helpdesk_visible', $this->fields['is_helpdesk_visible']);
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Group in charge of the hardware') . "</td>";
echo "<td>";
Group::dropdown(array('name' => 'groups_id_tech', 'value' => $this->fields['groups_id_tech'], 'entity' => $this->fields['entities_id'], 'condition' => '`is_assign`'));
echo "</td>";
echo "<td rowspan='4' class='middle'>" . __('Comments') . "</td>";
echo "<td class='center middle' rowspan='4'>";
echo "<textarea cols='45' rows='8' name='comment' >" . $this->fields["comment"] . "</textarea>";
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td >" . __('User') . "</td>";
echo "<td >";
User::dropdown(array('value' => $this->fields["users_id"], 'entity' => $this->fields["entities_id"], 'right' => 'all'));
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Group') . "</td><td>";
Group::dropdown(array('value' => $this->fields["groups_id"], 'entity' => $this->fields["entities_id"], 'condition' => '`is_itemgroup`'));
echo "</td></tr>\n";
// UPDATE
echo "<tr class='tab_bg_1'>";
//TRANS: a noun, (ex : this software is an upgrade of..)
echo "<td>" . __('Upgrade') . "</td><td>";
Dropdown::showYesNo("is_update", $this->fields['is_update']);
echo " " . __('from') . " ";
Software::dropdown(array('value' => $this->fields["softwares_id"]));
echo "</td></tr>\n";
$this->showFormButtons($options);
return true;
}
示例14: showSpecificMassiveActionsParameters
/**
* @see CommonDBTM::showSpecificMassiveActionsParameters()
**/
function showSpecificMassiveActionsParameters($input = array())
{
switch ($input['action']) {
case "add_user_group":
case "add_supervisor_group":
case "add_delegatee_group":
if ($input['itemtype'] == 'User') {
Group::dropdown(array('condition' => '`is_usergroup`'));
echo "<br><br><input type='submit' name='massiveaction' class='submit' value='" . _sx('button', 'Add') . "'>";
return true;
}
if ($input['itemtype'] == 'Group') {
User::dropdown(array('right' => "all"));
echo "<br><br><input type='submit' name='massiveaction' class='submit' value='" . _sx('button', 'Add') . "'>";
return true;
}
break;
default:
return parent::showSpecificMassiveActionsParameters($input);
}
return false;
}
示例15: Copyright
Uninstall plugin is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with uninstall. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------
@package uninstall
@author the uninstall plugin team
@copyright Copyright (c) 2010-2013 Uninstall plugin team
@license GPLv2+
http://www.gnu.org/licenses/gpl.txt
@link https://forge.indepnet.net/projects/uninstall
@link http://www.glpi-project.org/
@since 2009
---------------------------------------------------------------------- */
include '../../../inc/includes.php';
header("Content-Type: text/html; charset=UTF-8");
Html::header_nocache();
if (Session::haveRight(PluginUninstallProfile::$rightname, READ)) {
switch ($_POST["id"]) {
case 'old':
echo "<input type='hidden' name='groups_id' value='-1'>";
echo Dropdown::EMPTY_VALUE;
break;
case 'set':
Group::dropdown(array('value' => $_POST["groups_id"], 'entity' => $_POST["entities_id"], 'entity_sons' => $_POST["entity_sons"], 'emptylabel' => __('None')));
break;
}
}