本文整理汇总了PHP中Dropdown类的典型用法代码示例。如果您正苦于以下问题:PHP Dropdown类的具体用法?PHP Dropdown怎么用?PHP Dropdown使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Dropdown类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: displayTabContentForItem
static function displayTabContentForItem(CommonGLPI $item, $tabnum = 1, $withtemplate = 0)
{
echo "<form name='notificationtargets_form' id='notificationtargets_form'\n method='post' action=' ";
echo Toolbox::getItemTypeFormURL(__CLASS__) . "'>";
echo "<table class ='tab_cadre_fixe'>";
echo '<tr><th colspan="2">' . __('Access type', 'formcreator') . '</th></tr>';
echo '<td>' . __('Access', 'formcreator') . '</td>';
echo '<td>';
Dropdown::showFromArray('access_rights', array(PluginFormcreatorForm::ACCESS_PUBLIC => __('Public access', 'formcreator'), PluginFormcreatorForm::ACCESS_PRIVATE => __('Private access', 'formcreator'), PluginFormcreatorForm::ACCESS_RESTRICTED => __('Restricted access', 'formcreator')), array('value' => isset($item->fields["access_rights"]) ? $item->fields["access_rights"] : 1));
echo '</td>';
if ($item->fields["access_rights"] == PluginFormcreatorForm::ACCESS_RESTRICTED) {
echo '<tr><th colspan="2">' . self::getTypeName(2) . '</th></tr>';
$table = getTableForItemType(__CLASS__);
$table_profile = getTableForItemType('Profile');
$query = "SELECT p.`id`, p.`name`, IF(f.`plugin_formcreator_profiles_id` IS NOT NULL, 1, 0) AS `profile`\n FROM {$table_profile} p\n LEFT JOIN {$table} f\n ON p.`id` = f.`plugin_formcreator_profiles_id`\n AND f.`plugin_formcreator_forms_id` = " . (int) $item->fields['id'];
$result = $GLOBALS['DB']->query($query);
while (list($id, $name, $profile) = $GLOBALS['DB']->fetch_array($result)) {
$checked = $profile ? ' checked' : '';
echo '<tr><td colspan="2"><label>';
echo '<input type="checkbox" name="profiles_id[]" value="' . $id . '" ' . $checked . '> ';
echo $name;
echo '</label></td></tr>';
}
}
echo '<tr>';
echo '<td class="center" colspan="2">';
echo '<input type="hidden" name="profiles_id[]" value="0" />';
echo '<input type="hidden" name="form_id" value="' . (int) $item->fields['id'] . '" />';
echo '<input type="submit" name="update" value="' . __('Save') . '" class="submit" />';
echo "</td>";
echo "</tr>";
echo "</table>";
Html::closeForm();
}
示例2: showAllItems
static function showAllItems($myname, $value_type = 0, $value = 0, $entity_restrict = -1, $types, $locations_id = -1, $action = 'showItem')
{
global $DB, $CFG_GLPI;
$rand = mt_rand();
$plugin = new Plugin();
echo "<table border='0'><tr><td>\n";
if ($myname == 'type') {
$newtypes = array_flip($types);
unset($newtypes['Location']);
unset($newtypes['Netpoint']);
if ($plugin->isActivated("resources")) {
unset($newtypes['PluginResourcesResource']);
}
$types = array_flip($newtypes);
}
$rand = Dropdown::showItemTypes($myname, $types, array('emptylabel' => Dropdown::EMPTY_VALUE, 'width' => 150));
$params = array('type' => '__VALUE__', 'value' => $value, 'myname' => $myname, 'action' => $action, 'entity_restrict' => $entity_restrict, 'locations_id' => $locations_id);
Ajax::updateItemOnSelectEvent("dropdown_{$myname}{$rand}", "show_{$myname}{$rand}", $CFG_GLPI["root_doc"] . "/plugins/positions/ajax/dropdownAllItems.php", $params);
echo "</td><td>\n";
echo "<span id='show_{$myname}{$rand}'> </span>\n";
echo "</td></tr></table>\n";
if ($value > 0) {
echo "<script type='text/javascript' >\n";
echo "document.getElementById('item_type{$rand}').value='" . $value_type . "';";
echo "</script>\n";
$params["typetable"] = $value_type;
Ajax::updateItem("show_{$myname}{$rand}", $CFG_GLPI["root_doc"] . "/plugins/positions/ajax/dropdownAllItems.php", $params);
}
return $rand;
}
示例3: showconfigForm
function showconfigForm()
{
global $CFG_GLPI;
echo "<form name='form' method='post' action='" . $CFG_GLPI["root_doc"] . "/plugins/immobilizationsheets/front/config.form.php'>";
echo "<div align=\"center\">";
echo "<table class=\"tab_cadre_fixe\" cellspacing=\"2\" cellpadding=\"2\">";
echo "<tr><th colspan=\"2\">" . __('Options', 'immobilizationsheets') . "</th></tr>";
echo "<tr class='tab_bg_1 top'>";
echo "<td>" . __('Save sheets in GLPI', 'immobilizationsheets') . ": </td>";
echo "<td>";
Dropdown::showYesNo("use_backup", $this->fields["use_backup"]);
echo "</td>";
echo "<tr class='tab_bg_1 top'><td>";
echo __('Default Heading for sheets', 'immobilizationsheets') . ": </td>";
echo "<td>";
Dropdown::show('DocumentCategory', array('name' => "documentcategories_id", 'value' => $this->fields["documentcategories_id"]));
echo "</td>";
echo "<tr><th colspan='2'>";
echo "<input type='hidden' name='id' value='1'>";
echo "<input type=\"submit\" name=\"update_config\" class=\"submit\" value=\"" . __s('Post') . "\" >";
echo "</th></tr>";
echo "</table></div>";
Html::closeForm();
echo "<br>";
}
示例4: getDatasForTemplate
function getDatasForTemplate($event, $options = array())
{
global $CFG_GLPI, $DB;
$this->datas['##notimported.entity##'] = Dropdown::getDropdownName('glpi_entities', $options['entities_id']);
foreach ($options['notimported'] as $id => $item) {
$tmp = array();
$tmp['##notimported.name##'] = $item['name'];
$tmp['##notimported.serial##'] = $item['serial'];
$tmp['##notimported.entity##'] = Dropdown::getDropdownName('glpi_entities', $options['entities_id']);
$tmp['##notimported.ocsid##'] = $item['ocsid'];
$tmp['##notimported.deviceid##'] = $item['ocs_deviceid'];
$tmp['##notimported.tag##'] = $item['tag'];
$tmp['##notimported.ocsserver##'] = Dropdown::getDropdownName('glpi_plugin_ocsinventoryng_ocsservers', $item['ocsid']);
$tmp['##notimported.reason##'] = PluginOcsinventoryngNotimportedcomputer::getReason($item['reason']);
$url = $CFG_GLPI["url_base"] . "/index.php?redirect=plugin_ocsinventoryng_" . $item['id'];
$tmp['##notimported.url##'] = urldecode($url);
$this->datas['notimported'][] = $tmp;
}
$this->getTags();
foreach ($this->tag_descriptions[NotificationTarget::TAG_LANGUAGE] as $tag => $values) {
if (!isset($this->datas[$tag])) {
$this->datas[$tag] = $values['label'];
}
}
}
示例5: displaySpecificTypeField
function displaySpecificTypeField($ID, $field = array())
{
global $CFG_GLPI;
switch ($field['type']) {
case 'groups':
$groups = json_decode($this->fields[$field['name']], true);
if (!empty($groups)) {
echo "<table class='tab_cadrehov' cellpadding='5'>";
foreach ($groups as $key => $val) {
echo "<tr class='tab_bg_1 center'>";
echo "<td>";
echo Dropdown::getDropdownName("glpi_groups", $val);
echo "</td>";
echo "<td>";
Html::showSimpleForm(Toolbox::getItemTypeFormURL('PluginTimelineticketConfig'), 'delete_groups', _x('button', 'Delete permanently'), array('delete_groups' => 'delete_groups', 'id' => $ID, '_groups_id_assign' => $val), $CFG_GLPI["root_doc"] . "/pics/delete.png");
echo " </td>";
echo "</tr>";
}
echo "</table>";
} else {
_e('None');
}
break;
}
}
示例6: getDatasForTemplate
/**
* Get all data needed for template processing
**/
function getDatasForTemplate($event, $options = array())
{
global $LANG, $CFG_GLPI;
$this->datas['##contract.entity##'] = Dropdown::getDropdownName('glpi_entities', $options['entities_id']);
$events = $this->getEvents();
$this->datas['##contract.action##'] = $LANG['mailing'][39] . " - " . $events[$event];
foreach ($options['contracts'] as $id => $contract) {
$tmp = array();
$tmp['##contract.name##'] = $contract['name'];
$tmp['##contract.number##'] = $contract['num'];
if ($contract['contracttypes_id']) {
$tmp['##contract.type##'] = Dropdown::getDropdownName('glpi_contracttypes', $contract['contracttypes_id']);
} else {
$tmp['##contract.type##'] = "";
}
$tmp['##contract.time##'] = getWarrantyExpir($contract["begin_date"], $contract["duration"], $contract["notice"]);
$tmp['##contract.url##'] = urldecode($CFG_GLPI["url_base"] . "/index.php?redirect=contract_" . $id);
$this->datas['contracts'][] = $tmp;
}
$this->datas['##lang.contract.time##'] = $event == Alert::END ? $LANG['contract'][0] : $LANG['contract'][1];
$this->getTags();
foreach ($this->tag_descriptions[NotificationTarget::TAG_LANGUAGE] as $tag => $values) {
if (!isset($this->datas[$tag])) {
$this->datas[$tag] = $values['label'];
}
}
}
示例7: 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>";
}
}
}
示例8: getDatasForTemplate
function getDatasForTemplate($event, $options = array())
{
global $CFG_GLPI;
if ($event == 'AlertNotValidatedTypology') {
$this->datas['##typology.entity##'] = Dropdown::getDropdownName('glpi_entities', $options['entities_id']);
$this->datas['##lang.typology.entity##'] = __('Entity');
$this->datas['##typology.action##'] = __('Elements not match with the typology', 'typology');
$this->datas['##lang.typology.name##'] = PluginTypologyTypology::getTypeName(1);
$this->datas['##lang.typology.itemtype##'] = __('Type');
$this->datas['##lang.typology.items_id##'] = __('Name');
$this->datas['##lang.typology.error##'] = __('Error');
$this->datas['##lang.typology.url##'] = __('Link to the typology', 'typology');
$this->datas['##lang.typology.itemurl##'] = __('Link to the element', 'typology');
$this->datas['##lang.typology.itemuser##'] = __('User');
$this->datas['##lang.typology.itemlocation##'] = __('Location');
foreach ($options['items'] as $id => $item) {
$tmp = array();
$tmp['##typology.name##'] = $item['name'];
$itemtype = new $item['itemtype']();
$itemtype->getFromDB($item["items_id"]);
$tmp['##typology.itemtype##'] = $itemtype->getTypeName();
$tmp['##typology.items_id##'] = $itemtype->getName();
$tmp['##typology.error##'] = PluginTypologyTypology_Item::displayErrors($item['error'], false);
$tmp['##typology.url##'] = urldecode($CFG_GLPI["url_base"] . "/index.php?redirect=plugin_typology_" . $item['plugin_typology_typologies_id']);
$tmp['##typology.itemurl##'] = urldecode($CFG_GLPI["url_base"] . "/index.php?redirect=" . Toolbox::strtolower($item['itemtype']) . "_" . $item["items_id"]);
$tmp['##typology.itemuser##'] = getUserName($itemtype->fields["users_id"]);
$tmp['##typology.itemlocation##'] = Dropdown::getDropdownName("glpi_locations", $itemtype->fields['locations_id']);
$this->datas['typologyitems'][] = $tmp;
}
}
}
示例9: displayTabContentForItem
static function displayTabContentForItem(CommonGLPI $item, $tabnum = 1, $withtemplate = 0)
{
return;
$profile = new Profile();
$found_profiles = $profile->find("`interface` = 'central'");
$tab_profile = new self();
$found_tab_profiles = $tab_profile->find("`plugin_custom_tabs_id` = " . $item->getID());
echo "<form method='POST' action='tabprofile.form.php' />";
echo "<table class='tab_cadre_fixe'>";
echo "<tr><th colspan='4'>" . __("Visibility") . "</th></tr>";
$odd = 0;
foreach ($found_profiles as $profiles_id => $profile_fields) {
if ($odd % 2 === 0) {
echo "<tr>";
}
echo "<td>" . $profile_fields['name'] . "</td>";
echo "<td>";
Dropdown::showYesNo("tab_profile[{$profiles_id}]", 0);
echo "</td>";
if ($odd % 2 === 1) {
echo "</tr>";
}
$odd++;
}
if ($odd % 2 === 0) {
echo "</tr>";
}
echo "<tr><td colspan='4'><div class='center'>";
echo "<input type='submit' name='update' value=\"" . _sx('button', 'Post') . "\" class='submit'>";
echo "</div></td></tr>";
echo "</table>";
Html::closeForm();
return true;
}
示例10: pdfForTicket
static function pdfForTicket(PluginPdfSimplePDF $pdf, Ticket $job)
{
global $CFG_GLPI, $DB;
$ID = $job->getField('id');
//////////////followups///////////
$query = "SELECT *\n FROM `glpi_ticketcosts`\n WHERE `tickets_id` = '{$ID}'\n ORDER BY `begin_date`";
$result = $DB->query($query);
if (!$DB->numrows($result)) {
$pdf->setColumnsSize(100);
$pdf->displayLine(__('No ticket cost for this ticket', 'pdf'));
} else {
$pdf->setColumnsSize(60, 20, 20);
$pdf->displayTitle("<b>" . TicketCost::getTypeName($DB->numrows($result)), __('Ticket duration'), CommonITILObject::getActionTime($job->fields['actiontime']) . "</b>");
$pdf->setColumnsSize(20, 10, 10, 10, 10, 10, 10, 10, 10);
$pdf->setColumnsAlign('center', 'center', 'center', 'left', 'right', 'right', 'right', 'right', 'right');
$pdf->displayTitle("<b><i>" . __('Name') . "</i></b>", "<b><i>" . __('Begin date') . "</i></b>", "<b><i>" . __('End date') . "</i></b>", "<b><i>" . __('Budget') . "</i></b>", "<b><i>" . __('Duration') . "</i></b>", "<b><i>" . __('Time cost') . "</i></b>", "<b><i>" . __('Fixed cost') . "</i></b>", "<b><i>" . __('Material cost') . "</i></b>", "<b><i>" . __('Total cost') . "</i></b>");
while ($data = $DB->fetch_array($result)) {
$cost = TicketCost::computeTotalCost($data['actiontime'], $data['cost_time'], $data['cost_fixed'], $data['cost_material']);
$pdf->displayLine($data['name'], Html::convDate($data['begin_date']), Html::convDate($data['end_date']), Dropdown::getDropdownName('glpi_budgets', $data['budgets_id']), CommonITILObject::getActionTime($data['actiontime']), Html::formatNumber($data['cost_time']), Html::formatNumber($data['cost_fixed']), Html::formatNumber($data['cost_material']), Html::formatNumber($cost));
$total_time += $data['actiontime'];
$total_costtime += $data['actiontime'] * $data['cost_time'] / HOUR_TIMESTAMP;
$total_fixed += $data['cost_fixed'];
$total_material += $data['cost_material'];
$total += $cost;
}
$pdf->setColumnsSize(50, 10, 10, 10, 10, 10);
$pdf->setColumnsAlign('right', 'right', 'right', 'right', 'right', 'right');
$pdf->displayLine('<b>' . __('Total'), CommonITILObject::getActionTime($total_time), Html::formatNumber($total_costtime), Html::formatNumber($total_fixed), Html::formatNumber($total_material), Html::formatNumber($total));
}
$pdf->displaySpace();
}
示例11: showNewRuleForm
/**
* @see Rule::showNewRuleForm()
**/
function showNewRuleForm($ID)
{
echo "<form method='post' action='" . Toolbox::getItemTypeFormURL('Entity') . "'>";
echo "<table class='tab_cadre_fixe'>";
echo "<tr><th colspan='7'>" . __('Authorizations assignment rules') . "</th></tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td>" . __('Name') . "</td><td>";
Html::autocompletionTextField($this, "name", array('value' => '', 'size' => 33));
echo '</td><td>' . __('Description') . "</td><td>";
Html::autocompletionTextField($this, "description", array('value' => '', 'size' => 33));
echo "</td><td>" . __('Logical operator') . "</td><td>";
$this->dropdownRulesMatch();
echo "</td><td rowspan='2' class='tab_bg_2 center middle'>";
echo "<input type=hidden name='sub_type' value='" . get_class($this) . "'>";
echo "<input type=hidden name='entities_id' value='-1'>";
echo "<input type=hidden name='affectentity' value='{$ID}'>";
echo "<input type=hidden name='_method' value='AddRule'>";
echo "<input type='submit' name='execute' value=\"" . _sx('button', 'Add') . "\" class='submit'>";
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td class='center'>" . _n('Profile', 'Profiles', 1) . "</td><td>";
Profile::dropdown();
echo "</td><td><span class='small_space'>" . __('Recursive') . "</span></td><td colspan='3'>";
Dropdown::showYesNo("is_recursive", 0);
echo "</td></tr>\n";
echo "</table>";
Html::closeForm();
}
示例12: displayField
public function displayField($canEdit = true)
{
if ($canEdit) {
$rand = mt_rand();
$tab_values = array();
$required = $this->fields['required'] ? ' required' : '';
$values = $this->getAvailableValues();
echo '<div class="form_field">';
if (!empty($this->fields['values'])) {
foreach ($values as $value) {
if (trim($value) != '') {
$tab_values[$value] = $value;
}
}
if ($this->fields['show_empty']) {
$tab_values = array('' => '-----') + $tab_values;
}
Dropdown::showFromArray('formcreator_field_' . $this->fields['id'], $tab_values, array('value' => static::IS_MULTIPLE ? '' : $this->getValue(), 'values' => static::IS_MULTIPLE ? $this->getValue() : array(), 'rand' => $rand, 'multiple' => static::IS_MULTIPLE));
}
echo '</div>' . PHP_EOL;
echo '<script type="text/javascript">
jQuery(document).ready(function($) {
jQuery("#dropdown_formcreator_field_' . $this->fields['id'] . $rand . '").on("change", function(e) {
var selectedValues = jQuery("#dropdown_formcreator_field_' . $this->fields['id'] . $rand . '").val();
formcreatorChangeValueOf (' . $this->fields['id'] . ', selectedValues);
});
});
</script>';
} else {
echo '<div class="form_field">';
echo nl2br($this->getAnswer());
echo '</div>' . PHP_EOL;
}
}
示例13: getDatasForTemplate
function getDatasForTemplate($event, $options = array())
{
global $CFG_GLPI;
$this->datas['##notinfocom.entity##'] = Dropdown::getDropdownName('glpi_entities', $options['entities_id']);
$this->datas['##lang.notinfocom.entity##'] = __('Entity');
$events = $this->getAllEvents();
$this->datas['##lang.notinfocom.title##'] = $events[$event];
$this->datas['##lang.notinfocom.name##'] = __('Name');
$this->datas['##lang.notinfocom.urlname##'] = __('URL');
$this->datas['##lang.notinfocom.computertype##'] = __('Type');
$this->datas['##lang.notinfocom.operatingsystem##'] = __('Operating system');
$this->datas['##lang.notinfocom.state##'] = __('Status');
$this->datas['##lang.notinfocom.location##'] = __('Location');
$this->datas['##lang.notinfocom.urluser##'] = __('URL');
$this->datas['##lang.notinfocom.urlgroup##'] = __('URL');
$this->datas['##lang.notinfocom.user##'] = __('User');
$this->datas['##lang.notinfocom.group##'] = __('Group');
foreach ($options['notinfocoms'] as $id => $notinfocom) {
$tmp = array();
$tmp['##notinfocom.urlname##'] = urldecode($CFG_GLPI["url_base"] . "/index.php?redirect=computer_" . $notinfocom['id']);
$tmp['##notinfocom.name##'] = $notinfocom['name'];
$tmp['##notinfocom.computertype##'] = Dropdown::getDropdownName("glpi_computertypes", $notinfocom['computertypes_id']);
$tmp['##notinfocom.operatingsystem##'] = Dropdown::getDropdownName("glpi_operatingsystems", $notinfocom['operatingsystems_id']);
$tmp['##notinfocom.state##'] = Dropdown::getDropdownName("glpi_states", $notinfocom['states_id']);
$tmp['##notinfocom.location##'] = Dropdown::getDropdownName("glpi_locations", $notinfocom['locations_id']);
$tmp['##notinfocom.urluser##'] = urldecode($CFG_GLPI["url_base"] . "/index.php?redirect=user_" . $notinfocom['users_id']);
$tmp['##notinfocom.urlgroup##'] = urldecode($CFG_GLPI["url_base"] . "/index.php?redirect=group_" . $notinfocom['groups_id']);
$tmp['##notinfocom.user##'] = getUserName($notinfocom['users_id']);
$tmp['##notinfocom.group##'] = Dropdown::getDropdownName("glpi_groups", $notinfocom['groups_id']);
$tmp['##notinfocom.contact##'] = $notinfocom['contact'];
$this->datas['notinfocoms'][] = $tmp;
}
}
示例14: executeActions
function executeActions($output, $params)
{
if (count($this->actions)) {
foreach ($this->actions as $action) {
switch ($action->fields["action_type"]) {
case "assign":
$output[$action->fields["field"]] = $action->fields["value"];
break;
case "regex_result":
//Regex result : assign value from the regex
$res = "";
if (isset($this->regex_results[0])) {
$res .= RuleAction::getRegexResultById($action->fields["value"], $this->regex_results[0]);
} else {
$res .= $action->fields["value"];
}
if ($res != '' && ($action->fields["field"] != 'user' && $action->fields["field"] != 'otherserial' && $action->fields["field"] != 'software' && $action->fields["field"] != 'softwareversion')) {
$res = Dropdown::importExternal(getItemTypeForTable(getTableNameForForeignKeyField($action->fields['field'])), $res);
}
$output[$action->fields["field"]] = $res;
break;
default:
//plugins actions
$executeaction = clone $this;
$ouput = $executeaction->executePluginsActions($action, $output, $params);
break;
}
}
}
return $output;
}
示例15: showForGroup
static function showForGroup(Group $group)
{
global $DB;
$ID = $group->getField('id');
if (!$group->can($ID, READ)) {
return false;
}
$canedit = $group->can($ID, UPDATE);
if ($canedit) {
// Get data
$item = new self();
if (!$item->getFromDB($ID)) {
$item->getEmpty();
}
$rand = mt_rand();
echo "<form name='group_level_form{$rand}' id='group_level_form{$rand}' method='post'\n action='" . Toolbox::getItemTypeFormURL(__CLASS__) . "'>";
echo "<input type='hidden' name='" . self::$items_id . "' value='{$ID}' />";
echo "<div class='spaced'>";
echo "<table class='tab_cadre_fixe'>";
echo "<tr class='tab_bg_1'><th>" . __('Level attribution', 'itilcategorygroups') . "</th></tr>";
echo "<tr class='tab_bg_2'><td class='center'>";
Dropdown::showFromArray('lvl', array(NULL => "---", 1 => __('Level 1', 'itilcategorygroups'), 2 => __('Level 2', 'itilcategorygroups'), 3 => __('Level 3', 'itilcategorygroups'), 4 => __('Level 4', 'itilcategorygroups')), array('value' => $item->fields['lvl']));
echo "</td></tr>";
echo "</td><td class='center'>";
if ($item->fields["id"]) {
echo "<input type='hidden' name='id' value='" . $item->fields["id"] . "'>";
echo "<input type='submit' name='update' value=\"" . __('Save') . "\"\n class='submit'>";
} else {
echo "<input type='submit' name='add' value=\"" . __('Save') . "\" class='submit'>";
}
echo "</td></tr>";
echo "</table></div>";
Html::closeForm();
}
}