Toggle navigation
Hot Examples
FR
EN
RU
DE
FR
ES
PT
IT
JP
ZH
KO
PHP
PHP
C#
Java
Go
C++
Python
JS
TS
Rechercher
PHP Dropdown::show Exemples
Langage de programmation:
PHP
Class/Type:
Dropdown
Méthode/Fonction:
show
Exemples au hotexamples.com:
30
PHP Dropdown::show - 30 exemples trouvés
. Ce sont les exemples réels les mieux notés de
Dropdown::show
à partir du pack glpi extraits de projets open source. Vous pouvez noter les exemples pour nous aider à en améliorer la qualité.
Méthodes fréquemment utilisées
Afficher
Cacher
getDropdownName(30)
showYesNo(30)
getYesNo(30)
show(30)
showNumber(30)
showInteger(30)
showFromArray(30)
showAllItems(30)
importExternal(22)
showItemTypes(22)
showTimeStamp(21)
showLanguages(19)
getValueWithUnit(12)
showSelectItemFromItemtypes(10)
showGlobalSwitch(8)
showItemTypeMenu(8)
showItemType(7)
display(7)
showHours(7)
getLanguageName(7)
import(6)
__construct(6)
getDeviceItemTypes(6)
showForMassiveAction(6)
draw(6)
dropdownTypes(5)
getStandardDropdownItemTypes(5)
showOutputFormat(5)
showPrivatePublicSwitch(4)
showGMT(4)
getGlobalSwitch(3)
widget(3)
showListLimit(3)
dropdownIcons(3)
addOption(3)
showAdvanceDateRestrictionSwitch(2)
ShowYesNo(2)
getDropdownArrayNames(2)
showItemTypeList(1)
showYesno(1)
toString(1)
whereModel(1)
GetYesNo(1)
prependOption(1)
setValue(1)
dropdownUsedItemTypes(1)
__toString(1)
addLi(1)
addNewCondition(1)
addOptgroup(1)
Méthodes fréquemment utilisées
getDropdownName (30)
showYesNo (30)
getYesNo (30)
show (30)
showNumber (30)
showInteger (30)
showFromArray (30)
showAllItems (30)
importExternal (22)
showItemTypes (22)
Méthodes fréquemment utilisées
showTimeStamp (21)
showLanguages (19)
getValueWithUnit (12)
showSelectItemFromItemtypes (10)
showGlobalSwitch (8)
showItemTypeMenu (8)
showItemType (7)
display (7)
showHours (7)
getLanguageName (7)
import (6)
__construct (6)
getDeviceItemTypes (6)
showForMassiveAction (6)
draw (6)
dropdownTypes (5)
getStandardDropdownItemTypes (5)
showOutputFormat (5)
showPrivatePublicSwitch (4)
showGMT (4)
Méthodes fréquemment utilisées
import (6)
__construct (6)
getDeviceItemTypes (6)
showForMassiveAction (6)
draw (6)
dropdownTypes (5)
getStandardDropdownItemTypes (5)
showOutputFormat (5)
showPrivatePublicSwitch (4)
showGMT (4)
getGlobalSwitch (3)
widget (3)
showListLimit (3)
dropdownIcons (3)
addOption (3)
showAdvanceDateRestrictionSwitch (2)
ShowYesNo (2)
getDropdownArrayNames (2)
showItemTypeList (1)
showYesno (1)
toString (1)
whereModel (1)
GetYesNo (1)
prependOption (1)
setValue (1)
dropdownUsedItemTypes (1)
__toString (1)
addLi (1)
addNewCondition (1)
addOptgroup (1)
Related in langs
WritingStyle (C#)
FrameworkContainerForUnityChild (C#)
int (C++)
ov_read (C++)
TrimExt (Go)
NewMockAcknowledger (Go)
MondrianLookupMapUserRoleListMapper (Java)
Attribute (Java)
getserial (Python)
bwaindex (Python)
Méthodes fréquemment utilisées
getGlobalSwitch (3)
widget (3)
showListLimit (3)
dropdownIcons (3)
addOption (3)
showAdvanceDateRestrictionSwitch (2)
ShowYesNo (2)
getDropdownArrayNames (2)
showItemTypeList (1)
showYesno (1)
toString (1)
whereModel (1)
GetYesNo (1)
prependOption (1)
setValue (1)
dropdownUsedItemTypes (1)
__toString (1)
addLi (1)
addNewCondition (1)
addOptgroup (1)
addOptgroupObject (1)
addSeperator (1)
add_option (1)
appendOption (1)
appendOptionClass (1)
appendOptionTitle (1)
getMultiSelectReadonlySeparator (1)
setSelected (1)
getReadonlyLink (1)
getType (1)
getValues (1)
getdropdownname (1)
pekerjaan (1)
render (1)
set (1)
setDropdownTitle (1)
setLabel (1)
setMultiSelectReadonlySeparator (1)
setReadonlyLink (1)
widgett (1)
Associées
WPSC_Payment_Gateway_Paypal_Express_Checkout
commitLanguagePack
oa_social_login_https_on
IntegerNumber
Schedule
EQUESTIONS_CMP_Answer
ShiftEntries_upcoming_for_user
Group
Rdfdb
InputHistoryData
show()
static
public
méthode
Print out an HTML "
" for a dropdown with preselected value static public show ( $itemtype, $options = [] ) : boolean $itemtype itemtype used for create dropdown $options array of possible options: - name : string / name of the select (default is depending itemtype) - value : integer / preselected value (default -1) - comments : boolean / is the comments displayed near the dropdown (default true) - toadd : array / array of specific values to add at the begining - entity : integer or array / restrict to a defined entity or array of entities (default -1 : no restriction) - entity_sons : boolean / if entity restrict specified auto select its sons only available if entity is a single value not an array (default false) - toupdate : array / Update a specific item on select change on dropdown (need value_fieldname, to_update, url (see Ajax::updateItemOnSelectEvent for information) and may have moreparams) - used : array / Already used items ID: not to display in dropdown (default empty) - on_change : string / value to transmit to "onChange" - rand : integer / already computed rand value - condition : string / aditional SQL condition to limit display - displaywith : array / array of field to display with request - emptylabel : Empty choice's label (default self::EMPTY_VALUE) - display_emptychoice : Display emptychoice ? (default true) - display : boolean / display or get string (default true) - width : specific width needed (default auto adaptive) - permit_select_parent : boolean / for tree dropdown permit to see parent items not available by default (default false) - specific_tags : array of HTML5 tags to add the the field - url : url of the ajax php code which should return the json data to show in the dropdown Résultat boolean : false if error and random id if OK Dropdown Class Documentation Exemple #1 0 Afficher le fichier Fichier : advanced_execution.class.php Projet : paisdelconocimiento/glpi-smartcities /** * Show form * * @global type $CFG_GLPI * @param type $ID * @param type $options */ function showForm($ID = 0, $options = array()) { global $CFG_GLPI; echo "<div class='center first-bloc'>"; echo "<form name='field_form' method='post' action='" . Toolbox::getItemTypeFormURL(__CLASS__) . "'>"; echo "<table class='tab_cadre_fixe'>"; echo "<tr class='tab_bg_1'>"; echo "<th>" . self::getTypeName() . "</th>"; echo "</tr>"; echo "<tr class='tab_bg_1'>"; echo "<td class='tab_bg_2 center'>"; echo PluginShellcommandsCommandGroup::getTypeName(1) . " "; Dropdown::show('PluginShellcommandsCommandGroup', array('entity' => $_SESSION['glpiactive_entity'], 'width' => 200)); echo "</td>"; echo "</tr>"; echo "<tr class='tab_bg_1'>"; echo "<td class='tab_bg_2 center'>"; $this->getEditValue(); echo "</td>"; echo "</tr>"; echo "<tr>"; echo "<td class='tab_bg_2 center'>"; echo "<input type='button' class='submit' onclick='shellcommand_advanced_execution(\"" . $CFG_GLPI['root_doc'] . "\",\"field_form\", \"advanced_execution_result\");' name='advanced_execution' value='" . __('Execute') . "'/>"; echo "</td>"; echo "</tr>"; echo "</table>"; Html::closeForm(); echo "</div>"; echo "<div class='spaced' id='advanced_execution_result'></div>"; } Exemple #2 0 Afficher le fichier Fichier : dropdown-field.class.php Projet : jcr0ch4/formcreator public function displayField($canEdit = true) { if ($canEdit) { $rand = mt_rand(); $required = $this->fields['required'] ? ' required' : ''; echo '<div class="form_field">'; if (!empty($this->fields['values'])) { if ($this->fields['values'] == 'User') { User::dropdown(array('name' => 'formcreator_field_' . $this->fields['id'], 'value' => $this->getValue(), 'comments' => false, 'right' => 'all', 'display_emptychoice' => $this->fields['show_empty'], 'rand' => $rand)); } else { Dropdown::show($this->fields['values'], array('name' => 'formcreator_field_' . $this->fields['id'], 'value' => $this->getValue(), 'comments' => false, 'display_emptychoice' => $this->fields['show_empty'], 'rand' => $rand)); } } echo '</div>' . PHP_EOL; echo '<script type="text/javascript"> jQuery(document).ready(function($) { jQuery("#dropdown_formcreator_field_' . $this->fields['id'] . $rand . '").on("select2-selecting", function(e) { formcreatorChangeValueOf (' . $this->fields['id'] . ', e.val); }); }); </script>'; } else { echo $this->getAnswer(); } } Exemple #3 0 Afficher le fichier Fichier : config.class.php Projet : paisdelconocimiento/glpi-smartcities 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>"; } } } Exemple #4 0 Afficher le fichier Fichier : config.class.php Projet : geldarr/hack-space 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>"; } Exemple #5 0 Afficher le fichier Fichier : category.class.php Projet : erchbox/itilcategorygroups function showForm($id, $options = array()) { if (!$this->can($id, READ)) { return false; } $this->showFormHeader($options); echo "<tr>"; echo "<td><label>" . __('Name') . " :</label></td>"; echo "<td style='width:30%'>"; echo Html::autocompletionTextField($this, "name"); echo "</td>"; $rand = mt_rand(); echo "<td><label for='dropdown_is_active{$rand}'>" . __('Active') . " :</label></td>"; echo "<td style='width:30%'>"; Dropdown::showYesNo('is_active', $this->fields['is_active'], -1, array('rand' => $rand)); echo "</td></tr>"; $rand = mt_rand(); echo "<tr>"; echo "<td><label for='dropdown_itilcategories_id{$rand}'>" . __('Category') . " :</label></td>"; echo "<td>"; Dropdown::show('ITILCategory', array('value' => $this->fields['itilcategories_id'], 'rand' => $rand)); echo "</td><td colspan='2'></td></tr>"; $rand = mt_rand(); echo "<tr>"; echo "<td><label for='dropdown_is_incident{$rand}'>" . __('Visible for an incident') . " :</label></td>"; echo "<td>"; Dropdown::showYesNo('is_incident', $this->fields['is_incident'], -1, array('rand' => $rand)); echo "</td>"; $rand = mt_rand(); echo "<td><label for='dropdown_is_request{$rand}'>" . __('Visible for a request') . " :</label></td>"; echo "<td>"; Dropdown::showYesNo('is_request', $this->fields['is_request'], -1, array('rand' => $rand)); echo "</td></tr>"; echo "<tr class='tab_bg_1'>"; echo "<td><label for='comment'>" . __('Comments') . " : </label></td>"; echo "<td align='left'>"; echo "<textarea name='comment' id='comment' style='width:100%; height:70px;'>"; echo $this->fields["comment"] . "</textarea>"; echo "</td></tr>"; echo "<tr><td colspan='4'><hr></td></tr>"; echo "<tr><td><label for='groups_id_level1[]'>" . ucfirst(__('Level 1', 'itilcategorygroups')) . " :</label></td>"; echo "<td>"; self::multipleDropdownGroup(1, $this->fields['itilcategories_id'], $this->fields['view_all_lvl1']); echo "</td>"; echo "<td><label for='groups_id_level2[]'>" . ucfirst(__('Level 2', 'itilcategorygroups')) . " :</label></td>"; echo "<td>"; self::multipleDropdownGroup(2, $this->fields['itilcategories_id'], $this->fields['view_all_lvl2']); echo "</td></tr>"; echo "<tr><td><label for='groups_id_level3[]'>" . ucfirst(__('Level 3', 'itilcategorygroups')) . " :</label></td>"; echo "<td>"; self::multipleDropdownGroup(3, $this->fields['itilcategories_id'], $this->fields['view_all_lvl3']); echo "</td>"; echo "<td><label for='groups_id_level4[]'>" . ucfirst(__('Level 4', 'itilcategorygroups')) . " :</label></td>"; echo "<td>"; self::multipleDropdownGroup(4, $this->fields['itilcategories_id'], $this->fields['view_all_lvl4']); echo "</td></tr>"; $this->showFormButtons($options); Html::closeForm(); } Exemple #6 0 Afficher le fichier Fichier : resourcespeciality.class.php Projet : geldarr/hack-space /** * Display list of specialities depending on rank * * @static * @param $options */ static function showSpeciality($options) { $rankId = $options['plugin_resources_ranks_id']; $entity = $options['entity']; $rand = $options['rand']; if ($rankId > 0) { $condition = " `plugin_resources_ranks_id` = '" . $rankId . "'"; Dropdown::show('PluginResourcesResourceSpeciality', array('entity' => $entity, 'condition' => $condition)); } else { echo "<select name='plugin_resources_resourcespecialities_id'\n id='dropdown_plugin_resources_resourcespecialities_id{$rand}'>"; echo "<option value='0'>" . Dropdown::EMPTY_VALUE . "</option></select>"; } } Exemple #7 0 Afficher le fichier Fichier : configsnmpnetworking.class.php Projet : Hawke/fusioninventory-for-glpi function showForm($target, $ID) { global $LANG; echo "<form method='post' name='functionalities_form' id='functionalities_form' action='" . $target . "'>"; echo "<table class='tab_cadre_fixe' cellpadding='5'>"; echo "<tr>"; echo "<th colspan='2'>"; echo $LANG['plugin_fusioninventory']["functionalities"][3] . " - " . $LANG["Menu"][1] . " :"; echo "</th>"; echo "</tr>"; echo "<tr class='tab_bg_1'>"; echo "<td>" . $LANG['plugin_fusioninventory']["functionalities"][20] . "</td>"; echo "<td>"; Dropdown::show('State', array('name' => "active_device_state", 'value' => $this->getValue("active_device_state"))); echo "</td>"; echo "</tr>"; echo "<tr class='tab_bg_1'>"; echo "<td>" . $LANG['plugin_fusioninventory']["functionalities"][21] . "</td>"; echo "<td>"; Dropdown::showInteger("history_wire", $this->getValue('history_wire'), 0, 100); echo "</td>"; echo "</tr>"; echo "<tr class='tab_bg_1'>"; echo "<td>" . $LANG['plugin_fusioninventory']["functionalities"][22] . "</td>"; echo "<td>"; Dropdown::showInteger("history_ports_state", $this->getValue('history_ports_state'), 0, 100); echo "</td>"; echo "</tr>"; echo "<tr class='tab_bg_1'>"; echo "<td>" . $LANG['plugin_fusioninventory']["functionalities"][23] . "</td>"; echo "<td>"; Dropdown::showInteger("history_unknown_mac", $this->getValue('history_unknown_mac'), 0, 100); echo "</td>"; echo "</tr>"; echo "<tr class='tab_bg_1'>"; echo "<td>" . $LANG['plugin_fusioninventory']["functionalities"][24] . "</td>"; echo "<td>"; Dropdown::showInteger("history_snmp_errors", $this->getValue('history_snmp_errors'), 0, 100); echo "</td>"; echo "</tr>"; echo "<tr class='tab_bg_1'>"; echo "<td>" . $LANG['plugin_fusioninventory']["functionalities"][25] . "</td>"; echo "<td>"; Dropdown::showInteger("history_process", $this->getValue('history_process'), 0, 100); echo "</td>"; echo "</tr>"; echo "<tr class='tab_bg_1'><td align='center' colspan='3'>"; echo "<input type='hidden' name='tabs' value='snmp_networking' />"; echo "<input type='submit' name='update' value=\"" . $LANG["buttons"][2] . "\" class='submit' ></div></td></tr>"; echo "</table></form>"; } Exemple #8 0 Afficher le fichier Fichier : notificationstate.class.php Projet : geldarr/hack-space function showAddForm($target) { echo "<div align='center'><form method='post' action=\"{$target}\">"; echo "<table class='tab_cadre_fixe' cellpadding='5'><tr ><th colspan='2'>"; echo __('add not-used status in expiration mail', 'certificates') . "</th></tr>"; echo "<tr class='tab_bg_1'><td>"; Dropdown::show('PluginCertificatesCertificateState', array('name' => "plugin_certificates_certificatestates_id")); echo "</td>"; echo "<td>"; echo "<div align='center'><input type='submit' name='add' value=\"" . __s('Post') . "\" class='submit' ></div></td></tr>"; echo "</table>"; Html::closeForm(); echo "</div>"; } Exemple #9 0 Afficher le fichier Fichier : planning.class.php Projet : JULIO8/respaldo_glpi public static function showSelectionForm($date, $type = 'week', $usertype, $uID = 0, $gID = 0) { global $LANG, $CFG_GLPI; saveCFG(); $CFG_GLPI["use_ajax"] = false; echo "<form method='get' id='planning-form'>"; echo "<div data-role='collapsible' data-collapsed='true'>"; echo "<h3>" . $LANG['plugin_mobile']['common'][5] . "</h3>"; echo "<div>"; echo "<div class='ui-body ui-body-c'>"; echo "<h4>" . $LANG['common'][34] . "</h4>"; echo "<div data-role='fieldcontain'>"; echo "<fieldset data-role='controlgroup'>"; echo "<input type='radio' id='radio_user' name='usertype' value='user' " . ($usertype == "user" ? "checked" : "") . ">"; echo "<label for='radio_user'>"; $rand_user = User::dropdown(array('name' => 'uID', 'value' => $uID, 'comments' => false, 'right' => 'interface', 'all' => 1, 'entity' => $_SESSION["glpiactive_entity"])); echo "</label>"; echo "<input type='radio' id='radio_group' name='usertype' value='group' " . ($usertype == "group" ? "checked" : "") . ">"; echo "<label for='radio_group'>"; $rand_group = Dropdown::show('Group', array('value' => $gID, 'comments' => false, 'name' => 'gID', 'entity' => $_SESSION["glpiactive_entity"])); echo "</label>"; echo "<input type='radio' id='radio_user_group' name='usertype' value='user_group' " . ($usertype == "user_group" ? "checked" : "") . ">"; echo "<label for='radio_user_group'>"; echo $LANG['joblist'][3]; echo "</label>"; echo "</fieldset>"; echo "</div>"; echo "</div><br /><div class='ui-body ui-body-c'>"; echo "<h4>" . $LANG['common'][27] . "</h4>"; echo "<input type='date' name='date' id='date' value='" . $date . "' />"; echo "<select name='type'>"; echo "<option value='day' " . ($type == "day" ? " selected " : "") . ">" . $LANG['planning'][5] . "</option>"; echo "<option value='week' " . ($type == "week" ? " selected " : "") . ">" . $LANG['planning'][6] . "</option>"; echo "<option value='month' " . ($type == "month" ? " selected " : "") . ">" . $LANG['planning'][14] . "</option>"; echo "</select>"; echo "<hr />"; echo "<input type='submit' class='button' name='submit' Value='" . $LANG['buttons'][7] . "' data-theme='a' data-inline='true' />"; echo "</div>"; echo "</div>"; echo "</div><!-- /collapsible -->"; //echo "</form>"; Html::closeForm(); /*echo "<script type='text/javascript'>"; echo "$('.datepickerinput').each(function(){"; echo "$(this).after( $( '<div />' ).datepicker({ altField: '#' + $(this).attr( 'id' ), showOtherMonths: true, dateFormat: 'yy-mm-dd' }) );"; echo "});"; echo "</script>\n";*/ restoreCFG(); } Exemple #10 0 Afficher le fichier Fichier : notificationstate.class.php Projet : paisdelconocimiento/glpi-smartcities public function showAddForm($target) { echo "<div align='center'><form method='post' action=\"{$target}\">"; echo "<table class='tab_cadre_fixe' cellpadding='5'><tr ><th colspan='2'>"; echo __('Add a unused status for expiration mailing', 'accounts') . "</th></tr>"; echo "<tr class='tab_bg_1'><td>"; Dropdown::show('PluginAccountsAccountState', array('name' => "plugin_accounts_accountstates_id")); echo "</td>"; echo "<td>"; echo "<div align='center'>"; echo "<input type='submit' name='add' value=\"" . _sx('button', 'Add') . "\" class='submit' >"; echo "</div></td></tr>"; echo "</table>"; Html::closeForm(); echo "</div>"; } Exemple #11 0 Afficher le fichier Fichier : group_group.class.php Projet : geldarr/hack-space 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(); } Exemple #12 0 Afficher le fichier Fichier : contractnature.class.php Projet : geldarr/hack-space /** * Display contractnature's list depending on resourcesituation * * @static * @param $options */ static function showContractnature($options) { $resourceSituationId = $options['plugin_resources_resourcesituations_id']; $entity = $options['entity']; $rand = $options['rand']; if ($resourceSituationId > 0) { $resourceSituation = new PluginResourcesResourceSituation(); $resourceSituation->getFromDB($resourceSituationId); if ($isContractLinked = $resourceSituation->fields["is_contract_linked"]) { if ($isContractLinked == 1) { Dropdown::show('PluginResourcesContractnature', array('entity' => $entity)); } } else { echo "<select name='plugin_resources_contractnatures_id'\n id='dropdown_plugin_resources_contractnatures_id{$rand}'>"; echo "<option value='0'>" . Dropdown::EMPTY_VALUE . "</option></select>"; } } else { echo "<select name='plugin_resources_contractnatures_id'\n id='dropdown_plugin_resources_contractnatures_id{$rand}'>"; echo "<option value='0'>" . Dropdown::EMPTY_VALUE . "</option></select>"; } } Exemple #13 0 Afficher le fichier Fichier : ruledictionnarysoftwarecollection.class.php Projet : ryukansent/Thesis-SideB function warningBeforeReplayRulesOnExistingDB($target) { global $LANG, $CFG_GLPI; echo "<form name='testrule_form' id='softdictionnary_confirmation' method='post' action=\"" . $target . "\">\n"; echo "<div class='center'>"; echo "<table class='tab_cadre_fixe'>"; echo "<tr><th colspan='2' class='b'>" . $LANG['rulesengine'][92] . "</th</tr>\n"; echo "<tr><td class='tab_bg_2 center'>"; echo "<img src=\"" . $CFG_GLPI["root_doc"] . "/pics/warning.png\"></td>"; echo "<td class='tab_bg_2 center'>" . $LANG['rulesengine'][93] . "</td></tr>\n"; echo "<tr><th colspan='2' class='b'>" . $LANG['rulesengine'][95] . "</th</tr>\n"; echo "<tr><td class='tab_bg_2 center'>" . $LANG['rulesengine'][96] . "</td>"; echo "<td class='tab_bg_2 center'>"; Dropdown::show('Manufacturer', array('name' => 'manufacturer')); echo "</td></tr>\n"; echo "<tr><td class='tab_bg_2 center' colspan='2'>"; echo "<input type='submit' name='replay_rule' value=\"" . $LANG['buttons'][2] . "\" class='submit'>"; echo "<input type='hidden' name='replay_confirm' value='replay_confirm'"; echo "</td></tr>"; echo "</table>\n"; echo "</div></form>\n"; return true; } Exemple #14 0 Afficher le fichier Fichier : softwarelicense.class.php Projet : glpi-project/glpi /** * Print the Software / license form * * @param $ID integer Id of the version or the template to print * @param $options array of possible options: * - target form target * - softwares_id ID of the software for add process * * @return true if displayed false if item not found or not right to display **/ function showForm($ID, $options = array()) { global $CFG_GLPI; $softwares_id = -1; if (isset($options['softwares_id'])) { $softwares_id = $options['softwares_id']; } if ($ID < 0) { // Create item $this->fields['softwares_id'] = $softwares_id; $this->fields['number'] = 1; $soft = new Software(); if ($soft->getFromDB($softwares_id) && in_array($_SESSION['glpiactive_entity'], getAncestorsOf('glpi_entities', $soft->getEntityID()))) { $options['entities_id'] = $soft->getEntityID(); } } $this->initForm($ID, $options); $this->showFormHeader($options); // Restore saved value or override with page parameter if (!isset($options['template_preview'])) { if (isset($_REQUEST)) { $saved = Html::cleanPostForTextArea($_REQUEST); } } foreach ($this->fields as $name => $value) { if (isset($saved[$name]) && empty($this->fields[$name])) { $this->fields[$name] = $saved[$name]; } } echo "<input type='hidden' name='withtemplate' value='" . $options['withtemplate'] . "'>"; echo "<tr class='tab_bg_1'>"; echo "<td>" . Software::getTypeName(1) . "</td>"; echo "<td>"; if ($ID > 0) { $softwares_id = $this->fields["softwares_id"]; echo "<input type='hidden' name='softwares_id' value='{$softwares_id}'>"; echo "<a href='software.form.php?id=" . $softwares_id . "'>" . Dropdown::getDropdownName("glpi_softwares", $softwares_id) . "</a>"; } else { Dropdown::show('Software', array('condition' => "`is_template`='0' AND `is_deleted`='0'", 'entity' => $_SESSION['glpiactive_entity'], 'entity_sons' => $_SESSION['glpiactive_entity_recursive'], 'on_change' => 'this.form.submit()', 'value' => $softwares_id)); } echo "</td>"; echo "<td colspan='2'>"; echo "</td></tr>\n"; echo "<tr class='tab_bg_1'>"; 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_softwarelicense`")); 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>" . __('Type') . "</td>"; echo "<td>"; SoftwareLicenseType::dropdown(array('value' => $this->fields["softwarelicensetypes_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>" . __('Publisher') . "</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>" . __('Serial number') . "</td>"; echo "<td>"; Html::autocompletionTextField($this, "serial"); 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>" . sprintf(__('%1$s%2$s'), __('Inventory number'), isset($options['withtemplate']) && $options['withtemplate'] ? "*" : ""); echo "</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>" . __('Group') . "</td><td>"; Group::dropdown(array('value' => $this->fields["groups_id"], 'entity' => $this->fields["entities_id"], 'condition' => '`is_itemgroup`')); echo "</td>"; echo "<td rowspan='4' class='middle'>" . __('Comments') . "</td>"; echo "<td class='center middle' rowspan='4'>"; echo "<textarea cols='45' rows='4' name='comment' >" . $this->fields["comment"] . "</textarea>"; echo "</td></tr>\n"; echo "<tr class='tab_bg_1'>"; echo "<td>" . __('Version in use') . "</td>"; echo "<td>"; SoftwareVersion::dropdownForOneSoftware(array('name' => "softwareversions_id_use", 'softwares_id' => $this->fields["softwares_id"], 'value' => $this->fields["softwareversions_id_use"])); echo "</td></tr>"; echo "<tr class='tab_bg_1'>"; echo "<td>" . __('Purchase version') . "</td>"; echo "<td>"; SoftwareVersion::dropdownForOneSoftware(array('name' => "softwareversions_id_buy", 'softwares_id' => $this->fields["softwares_id"], 'value' => $this->fields["softwareversions_id_buy"])); echo "</td></tr>\n"; echo "<tr class='tab_bg_1'>"; echo "<td>" . _x('quantity', 'Number') . "</td>"; echo "<td>"; Dropdown::showNumber("number", array('value' => $this->fields["number"], 'min' => 1, 'max' => 10000, 'step' => 1, 'toadd' => array(-1 => __('Unlimited')))); if ($ID > 0) { echo " "; if ($this->fields['is_valid']) { echo "<span class='green'>" . _x('adjective', 'Valid') . '<span>'; } else { echo "<span class='red'>" . _x('adjective', 'Invalid') . '<span>'; } } echo "</td></tr>\n"; echo "<tr class='tab_bg_1'>"; echo "<td>" . __('Expiration') . "</td>"; echo "<td>"; Html::showDateField('expire', array('value' => $this->fields["expire"])); if ($ID && is_null($this->fields["expire"])) { echo "<br>" . __('Never expire') . " "; Html::showToolTip(__('On search engine, use "Expiration contains NULL" to search licenses with no expiration date')); } Alert::displayLastAlert('SoftwareLicense', $ID); echo "</td><td colspan='2'></td></tr>\n"; $this->showFormButtons($options); return true; } Exemple #15 0 Afficher le fichier Fichier : snmpauth.class.php Projet : Hawke/fusioninventory-for-glpi function showForm($target, $ID = '') { global $DB, $CFG_GLPI, $LANG; PluginFusioninventoryAuth::checkRight("snmp_authentification", "r"); if ($ID != '') { $this->getFromDB($ID); } else { $this->getEmpty(); } $this->showTabs($ID, "", $_SESSION['glpi_tab']); echo "<div align='center'><form method='post' name='' id='' action=\"" . $target . "\">"; echo "<table class='tab_cadre' cellpadding='5' width='950'><tr><th colspan='2'>"; echo $ID == '' ? $LANG['plugin_fusioninventory']["model_info"][7] : $LANG['plugin_fusioninventory']["model_info"][3]; echo " :</th></tr>"; echo "<tr class='tab_bg_1'>"; echo "<td align='center'>" . $LANG["common"][16] . "</td>"; echo "<td align='center'>"; echo "<input type='text' name='name' value='" . $this->fields["name"] . "'/>"; echo "</td>"; echo "</tr>"; echo "<tr class='tab_bg_1'>"; echo "<td align='center'>" . $LANG['plugin_fusioninventory']["model_info"][2] . "</td>"; echo "<td align='center'>"; Dropdown::show("PluginFusioninventorySnmpversion", array('name' => "FK_snmp_version", 'value' => $this->fields["FK_snmp_version"], 'comments' => false)); echo "</td>"; echo "</tr>"; echo "<tr class='tab_bg_1'>"; echo "<td align='center'>" . $LANG['plugin_fusioninventory']["snmpauth"][1] . "</td>"; echo "<td align='center'>"; echo "<input type='text' name='community' value='" . $this->fields["community"] . "'/>"; echo "</td>"; echo "</tr>"; echo "<tr class='tab_bg_1'>"; echo "<td align='center'>" . $LANG['plugin_fusioninventory']["snmpauth"][2] . "</td>"; echo "<td align='center'>"; echo "<input type='text' name='sec_name' value='" . $this->fields["sec_name"] . "'/>"; echo "</td>"; echo "</tr>"; echo "<tr class='tab_bg_1'>"; echo "<td align='center'>" . $LANG['plugin_fusioninventory']["snmpauth"][4] . "</td>"; echo "<td align='center'>"; Dropdown::show("PluginFusioninventorySnmpprotocolauth", array('name' => "auth_protocol", 'value' => $this->fields["auth_protocol"], 'comments' => false)); echo "</td>"; echo "</tr>"; echo "<tr class='tab_bg_1'>"; echo "<td align='center'>" . $LANG['plugin_fusioninventory']["snmpauth"][5] . "</td>"; echo "<td align='center'>"; echo "<input type='text' name='auth_passphrase'\n value='" . $this->fields["auth_passphrase"] . "'/>"; echo "</td>"; echo "</tr>"; echo "<tr class='tab_bg_1'>"; echo "<td align='center'>" . $LANG['plugin_fusioninventory']["snmpauth"][6] . "</td>"; echo "<td align='center'>"; Dropdown::show("PluginFusioninventorySnmpprotocolpriv", array('name' => "priv_protocol", 'value' => $this->fields["priv_protocol"], 'comments' => false)); echo "</td>"; echo "</tr>"; echo "<tr class='tab_bg_1'>"; echo "<td align='center'>" . $LANG['plugin_fusioninventory']["snmpauth"][7] . "</td>"; echo "<td align='center'>"; echo "<input type='text' name='priv_passphrase'\n value='" . $this->fields["priv_passphrase"] . "'/>"; echo "</td>"; echo "</tr>"; echo "<tr class='tab_bg_2'><td colspan='2'>"; if (PluginFusioninventory::haveRight("snmp_authentification", "w")) { if ($ID == '') { echo "<div align='center'><input type='submit' name='add'\n value=\"" . $LANG["buttons"][8] . "\" class='submit' >"; } else { echo "<input type='hidden' name='ID' value='" . $ID . "'/>"; echo "<div align='center'><input type='submit' name='update'\n value=\"" . $LANG["buttons"][7] . "\" class='submit' >"; if (!$this->fields["deleted"]) { echo " \n <input type='submit' name='delete'\n value=\"" . $LANG["buttons"][6] . "\" class='submit'>"; } else { echo " \n <input type='submit' name='restore'\n value=\"" . $LANG["buttons"][21] . "\" class='submit'>"; echo " \n <input type='submit' name='purge'\n value=\"" . $LANG["buttons"][22] . "\" class='submit'>"; } } } echo "</td>"; echo "</tr>"; echo "</table></form></div>"; } Exemple #16 0 Afficher le fichier Fichier : networkname.class.php Projet : kipman/glpi /** * @param $networkPortID **/ static function showFormForNetworkPort($networkPortID) { global $DB, $CFG_GLPI; $name = new self(); $number_names = 0; if ($networkPortID > 0) { $query = "SELECT `id`\n FROM `" . $name->getTable() . "`\n WHERE `itemtype` = 'NetworkPort'\n AND `items_id` = '{$networkPortID}'\n AND `is_deleted` = '0'"; $result = $DB->query($query); if ($DB->numrows($result) > 1) { echo "<tr class='tab_bg_1'><th colspan='4'>" . __("Several network names available! Go to the tab 'Network Name' to manage them.") . "</th></tr>\n"; return; } switch ($DB->numrows($result)) { case 1: $nameID = $DB->fetch_assoc($result); $name->getFromDB($nameID['id']); break; case 0: $name->getEmpty(); break; } } else { $name->getEmpty(); } echo "<tr class='tab_bg_1'><th colspan='4'>"; // If the networkname is defined, we must be able to edit it. So we make a link if ($name->getID() > 0) { echo "<a href='" . $name->getLinkURL() . "'>" . self::getTypeName(1) . "</a>"; echo "<input type='hidden' name='NetworkName_id' value='" . $name->getID() . "'> \n"; Html::showSimpleForm($name->getFormURL(), 'unaffect', _sx('button', 'Dissociate'), array('id' => $name->getID()), $CFG_GLPI["root_doc"] . '/pics/sub_dropdown.png'); } else { echo self::getTypeName(1); } echo "</th>\n"; echo "</tr><tr class='tab_bg_1'>"; echo "<td>" . self::getTypeName(1) . "</td><td>\n"; Html::autocompletionTextField($name, "name", array('name' => 'NetworkName_name')); echo "</td>\n"; echo "<td>" . FQDN::getTypeName(1) . "</td><td>"; Dropdown::show(getItemTypeForTable(getTableNameForForeignKeyField("fqdns_id")), array('value' => $name->fields["fqdns_id"], 'name' => 'NetworkName_fqdns_id', 'entity' => $name->getEntityID(), 'displaywith' => array('view'))); echo "</td>\n"; echo "</tr><tr class='tab_bg_1'>\n"; echo "<td>" . IPAddress::getTypeName(Session::getPluralNumber()); IPAddress::showAddChildButtonForItemForm($name, 'NetworkName__ipaddresses'); echo "</td>"; echo "<td>"; IPAddress::showChildsForItemForm($name, 'NetworkName__ipaddresses'); echo "</td>"; // MoYo : really need to display it here ? // make confure because not updatable // echo "<td>".IPNetwork::getTypeName(Session::getPluralNumber())." "; // Html::showToolTip(__('IP network is not included in the database. However, you can see current available networks.')); // echo "</td><td>"; // IPNetwork::showIPNetworkProperties($name->getEntityID()); // echo "</td>\n"; echo "<td colspan='2'> </td>"; echo "</tr>\n"; } Exemple #17 0 Afficher le fichier Fichier : task.class.php Projet : geldarr/hack-space function showSpecificMassiveActionsParameters($input = array()) { switch ($input['action']) { case "Install": Dropdown::showAllItems("item_item", 0, 0, -1, self::getTypes()); echo "<input type=\"submit\" name=\"massiveaction\" class=\"submit\" value='" . _sx('button', 'Post') . "'>"; return true; break; case "Desinstall": Dropdown::showAllItems("item_item", 0, 0, -1, self::getTypes()); echo "<input type=\"submit\" name=\"massiveaction\" class=\"submit\" value='" . _sx('button', 'Post') . "'>"; return true; break; case "Duplicate": Dropdown::show('Entity'); echo " <input type=\"submit\" name=\"massiveaction\" class=\"submit\" value='" . _sx('button', 'Post') . "'>"; return true; break; case "Transfert": Dropdown::show('Entity'); echo " <input type=\"submit\" name=\"massiveaction\" class=\"submit\" value='" . _sx('button', 'Post') . "'>"; return true; break; default: return parent::showSpecificMassiveActionsParameters($input); break; } return false; } Exemple #18 0 Afficher le fichier Fichier : task.class.php Projet : InfotelGLPI/tasklists /** * @since version 0.85 * * @see CommonDBTM::showMassiveActionsSubForm() * */ static function showMassiveActionsSubForm(MassiveAction $ma) { switch ($ma->getAction()) { case "transfer": Dropdown::show('Entity'); echo Html::submit(_x('button', 'Post'), array('name' => 'massiveaction')); return true; break; } return parent::showMassiveActionsSubForm($ma); } Exemple #19 0 Afficher le fichier Fichier : snmp.class.php Projet : Hawke/fusioninventory-for-glpi static function auth_dropdown($selected = "") { global $DB; $plugin_fusioninventory_snmp_auth = new PluginFusioninventorySnmpauth(); $config = new PluginFusioninventoryConfig(); if ($config->getValue("authsnmp") == "file") { echo $plugin_fusioninventory_snmp_auth->selectbox($selected); } else { if ($config->getValue("authsnmp") == "DB") { Dropdown::show("PluginFusioninventorySnmpauth", array('name' => "FK_snmp_connection", 'value' => $selected, 'comments' => false)); } } } Exemple #20 0 Afficher le fichier Fichier : dropdownRubDocument.php Projet : ryukansent/Thesis-SideB along with GLPI; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -------------------------------------------------------------------------- */ // ---------------------------------------------------------------------- // Original Author of file: Julien Dombre // Purpose of file: // ---------------------------------------------------------------------- if (strpos($_SERVER['PHP_SELF'], "dropdownRubDocument.php")) { $AJAX_INCLUDE = 1; define('GLPI_ROOT', '..'); include GLPI_ROOT . "/inc/includes.php"; header("Content-Type: text/html; charset=UTF-8"); header_nocache(); } checkCentralAccess(); // Make a select box if (isset($_POST["rubdoc"])) { if (!is_array($_POST['used'])) { $_POST['used'] = unserialize(stripslashes($_POST['used'])); } $used = array(); // Clean used array if (is_array($_POST['used']) && count($_POST['used']) > 0) { $query = "SELECT `id`\n FROM `glpi_documents`\n WHERE `id` IN (" . implode(',', $_POST['used']) . ")\n AND `documentcategories_id` = '" . $_POST["rubdoc"] . "'"; foreach ($DB->request($query) as $data) { $used[$data['id']] = $data['id']; } } Dropdown::show('Document', array('name' => $_POST['myname'], 'used' => $used, 'entity' => $_POST['entity'], 'rand' => $_POST['rand'], 'condition' => "glpi_documents.documentcategories_id='" . $_POST["rubdoc"] . "'")); } Exemple #21 0 Afficher le fichier Fichier : softwareversion.class.php Projet : ryukansent/Thesis-SideB /** * Print the Software / version form * * @param $ID Integer : Id of the version or the template to print * @param $options array * - target form target * - softwares_id ID of the software for add process * * @return true if displayed false if item not found or not right to display * **/ function showForm($ID, $options = array()) { global $CFG_GLPI, $LANG; $softwares_id = -1; if (isset($options['softwares_id'])) { $softwares_id = $options['softwares_id']; } if (!haveRight("software", "r")) { return false; } if ($ID > 0) { $this->check($ID, 'r'); } else { $soft = new Software(); $soft->getFromDB($softwares_id); // Create item $input = array('entities_id' => $soft->getEntityID(), 'is_recursive' => $soft->isRecursive()); $this->check(-1, 'w', $input); } $this->showTabs($options); $this->showFormHeader($options); echo "<tr class='tab_bg_1'><td>" . $LANG['help'][31] . " :</td>"; echo "<td>"; if ($ID > 0) { $softwares_id = $this->fields["softwares_id"]; } else { echo "<input type='hidden' name='softwares_id' value='{$softwares_id}'>"; } echo "<a href='software.form.php?id=" . $softwares_id . "'>" . Dropdown::getDropdownName("glpi_softwares", $softwares_id) . "</a>"; echo "</td>"; echo "<td rowspan='4' class='middle'>" . $LANG['common'][25] . " :</td>"; echo "<td class='center middle' rowspan='4'>"; echo "<textarea cols='45' rows='3' name='comment' >" . $this->fields["comment"]; echo "</textarea></td></tr>\n"; echo "<tr class='tab_bg_1'><td>" . $LANG['common'][16] . " :</td>"; echo "<td>"; autocompletionTextField($this, "name"); echo "</td></tr>\n"; echo "<tr class='tab_bg_1'><td>" . $LANG['setup'][5] . " :</td><td>"; Dropdown::show('OperatingSystem', array('value' => $this->fields["operatingsystems_id"])); echo "</td></tr>\n"; echo "<tr class='tab_bg_1'><td>" . $LANG['state'][0] . " :</td><td>"; Dropdown::show('State', array('value' => $this->fields["states_id"])); echo "</td></tr>\n"; // Only count softwareversions_id_buy (don't care of softwareversions_id_use if no installation) if (SoftwareLicense::countForVersion($ID) > 0 || Computer_SoftwareVersion::countForVersion($ID) > 0) { $options['candel'] = false; } $this->showFormButtons($options); $this->addDivForTabs(); return true; } Exemple #22 0 Afficher le fichier Fichier : dropdownjobdefinition.php Projet : korial29/fusioninventory-for-glpi } $options = array('name' => '_itil_' . $_POST["actortype"] . '[users_id]', 'entity' => $_POST['entity_restrict'], 'right' => $right, 'ldap_import' => TRUE); $withemail = FALSE; 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"]); // Fix rand value $options['rand'] = $rand; $options['toupdate'] = array('value_fieldname' => 'value', 'to_update' => "notif_user_{$rand}", 'url' => $CFG_GLPI["root_doc"] . "/ajax/uemailUpdate.php", 'moreparams' => $paramscomment); } $rand = User::dropdown($options); if ($CFG_GLPI["use_mailing"] == 1) { echo "<br><span id='notif_user_{$rand}'>"; if ($withemail) { echo __('Email followup') . ' : '; $rand = Dropdown::showYesNo('_itil_' . $_POST["actortype"] . '[use_notification]', 1); echo '<br>' . __('Email') . ' : '; echo "<input type='text' size='25' name='_itil_" . $_POST["actortype"] . "[alternative_email]'>"; } echo "</span>"; } break; case "group": $cond = $_POST["actortype"] == 'assign' ? $cond = '`is_assign`' : ($cond = '`is_requester`'); Dropdown::show('Group', array('name' => '_itil_' . $_POST["actortype"] . '[groups_id]', 'entity' => $_POST['entity_restrict'], 'condition' => $cond)); break; case "supplier": Dropdown::show('Supplier', array('name' => 'suppliers_id_assign', 'entity' => $_POST['entity_restrict'])); break; } } Exemple #23 0 Afficher le fichier Fichier : ports_date_connections.php Projet : Hawke/fusioninventory-for-glpi function displaySearchForm() { global $_SERVER, $_GET, $LANG, $CFG_GLPI; echo "<form action='" . $_SERVER["PHP_SELF"] . "' method='post'>"; echo "<table class='tab_cadre' cellpadding='5'>"; echo "<tr class='tab_bg_1' align='center'>"; echo "<td>"; echo $LANG["financial"][8] . " :"; $values = array(); $values["sup"] = ">"; $values["inf"] = "<"; $values["equal"] = "="; if (isset($_GET["contains"][1])) { if (strstr($_GET["contains"][1], "lt;")) { $_GET["dropdown_sup_inf"] = "inf"; $_GET["dropdown_calendar"] = str_replace("lt;", "", $_GET["contains"][1]); $_GET["dropdown_calendar"] = str_replace("&", "", $_GET["dropdown_calendar"]); $_GET["dropdown_calendar"] = str_replace("\\", "", $_GET["dropdown_calendar"]); $_GET["dropdown_calendar"] = str_replace("'", "", $_GET["dropdown_calendar"]); $_GET["dropdown_calendar"] = str_replace(" 00:00:00", "", $_GET["dropdown_calendar"]); $_GET["contains"][1] = "<" . $_GET["dropdown_calendar"]; } if (strstr($_GET["contains"][1], "gt;")) { $_GET["dropdown_sup_inf"] = "sup"; $_GET["dropdown_calendar"] = str_replace("gt;", "", $_GET["contains"][1]); $_GET["dropdown_calendar"] = str_replace("&", "", $_GET["dropdown_calendar"]); $_GET["dropdown_calendar"] = str_replace("\\", "", $_GET["dropdown_calendar"]); $_GET["dropdown_calendar"] = str_replace("'", "", $_GET["dropdown_calendar"]); $_GET["dropdown_calendar"] = str_replace(" 00:00:00", "", $_GET["dropdown_calendar"]); $_GET["contains"][1] = ">" . $_GET["dropdown_calendar"]; } if (strstr($_GET["contains"][1], "LIKE")) { $_GET["dropdown_sup_inf"] = "equal"; $_GET["dropdown_calendar"] = str_replace("=", "", $_GET["contains"][1]); $_GET["dropdown_calendar"] = str_replace("&", "", $_GET["dropdown_calendar"]); $_GET["dropdown_calendar"] = str_replace("\\", "", $_GET["dropdown_calendar"]); $_GET["dropdown_calendar"] = str_replace("'", "", $_GET["dropdown_calendar"]); $_GET["dropdown_calendar"] = str_replace("%", "", $_GET["dropdown_calendar"]); $_GET["dropdown_calendar"] = str_replace("LIKE ", "", $_GET["dropdown_calendar"]); $_GET["contains"][1] = "LIKE '" . $_GET["dropdown_calendar"] . "%'"; } } Dropdown::showFromArray("dropdown_sup_inf", $values, array('value' => isset($_GET["dropdown_sup_inf"]) ? $_GET["dropdown_sup_inf"] : "sup")); echo "</td>\n\t\t<td width='120'>"; showDateFormItem("dropdown_calendar", isset($_GET["dropdown_calendar"]) ? $_GET["dropdown_calendar"] : 0); echo "</td>"; echo "<td>" . $LANG["common"][15] . "</td>"; echo "<td>"; Dropdown::show("Location", array('name' => "location", 'value' => isset($_GET["location"]) ? $_GET["location"] : "")); echo "</td>"; // Display Reset search echo "<td>"; echo "<a href='" . $CFG_GLPI["root_doc"] . "/plugins/fusioninventory/report/ports_date_connections.php?reset_search=reset_search' ><img title=\"" . $LANG["buttons"][16] . "\" alt=\"" . $LANG["buttons"][16] . "\" src='" . $CFG_GLPI["root_doc"] . "/pics/reset.png' class='calendrier'></a>"; echo "</td>"; echo "<td>"; //Add parameters to uri to be saved as bookmarks $_SERVER["REQUEST_URI"] = buildBookmarkUrl($_SERVER["REQUEST_URI"], $_GET); showSaveBookmarkButton(BOOKMARK_SEARCH, PLUGIN_FUSIONINVENTORY_SNMP_NETWORKING_PORTS2); echo "</td>"; echo "<td>"; echo "<input type='submit' value='Valider' class='submit' />"; echo "</td>"; echo "</tr>"; echo "</table>"; echo "</form>"; } Exemple #24 0 Afficher le fichier Fichier : networkalias.class.php Projet : geldarr/hack-space /** * Print the network alias 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()) { // Show only simple form to add / edit $showsimple = false; if (isset($options['parent'])) { $showsimple = true; $options['networknames_id'] = $options['parent']->getID(); } $this->initForm($ID, $options); $recursiveItems = $this->recursivelyGetItems(); if (count($recursiveItems) == 0) { return false; } $lastItem = $recursiveItems[count($recursiveItems) - 1]; if (!$showsimple) { $this->showTabs(); } $options['entities_id'] = $lastItem->getField('entities_id'); $this->showFormHeader($options); echo "<tr class='tab_bg_1'><td>"; $this->displayRecursiveItems($recursiveItems, 'Type'); echo " :</td>\n<td>"; if (!($ID > 0)) { echo "<input type='hidden' name='networknames_id' value='" . $this->fields["networknames_id"] . "'>\n"; } $this->displayRecursiveItems($recursiveItems, isset($options['popup']) ? "Name" : "Link"); echo "</td><td>" . __('Name') . "</td><td>\n"; Html::autocompletionTextField($this, "name"); echo "</td></tr>\n"; echo "<tr class='tab_bg_1'>"; echo "<td>" . FQDN::getTypeName() . "</td><td>"; Dropdown::show(getItemTypeForTable(getTableNameForForeignKeyField("fqdns_id")), array('value' => $this->fields["fqdns_id"], 'name' => 'fqdns_id', 'entity' => $this->getEntityID(), 'displaywith' => array('view'))); echo "</td>"; echo "<td>" . __('Comments') . "</td>"; echo "<td><textarea cols='45' rows='4' name='comment' >" . $this->fields["comment"]; echo "</textarea></td>\n"; echo "</tr>\n"; $this->showFormButtons($options); if (!$showsimple) { $this->addDivForTabs(); } return true; } Exemple #25 0 Afficher le fichier Fichier : networkport.class.php Projet : gaforeror/glpi /** * @see CommonDBTM::showSpecificMassiveActionsParameters() **/ function showSpecificMassiveActionsParameters($input = array()) { switch ($input['action']) { case "assign_vlan": Vlan::dropdown(); echo " " . __('Tagged') . " <input type='checkbox' name='tagged' value='1'>"; echo " <input type='submit' name='assign_vlan' class='submit' value='" . __s('Associate') . "'>"; return true; case "unassign_vlan": Vlan::dropdown(); echo " <input type='submit' name='unassign_vlan' class='submit' value='" . __s('Dissociate') . "'>"; return true; case "move_port": Dropdown::show('NetworkEquipment', array('name' => 'items_id')); echo " <input type='submit' name='move' class='submit' value=\"" . __s('Move') . "\">"; return true; default: return parent::showSpecificMassiveActionsParameters($input); } return false; } Exemple #26 0 Afficher le fichier Fichier : ticket.class.php Projet : gaforeror/glpi /** * @since version 0.84 * * @param $field * @param $name (default '') * @param $values (default '') * @param $options array * * @return string **/ static function getSpecificValueToSelect($field, $name = '', $values = '', array $options = array()) { if (!is_array($values)) { $values = array($field => $values); } $options['display'] = false; switch ($field) { case 'items_id': if (isset($values['itemtype']) && !empty($values['itemtype'])) { $options['name'] = $name; $options['value'] = $values[$field]; return Dropdown::show($values['itemtype'], $options); } break; case 'type': $options['value'] = $values[$field]; return self::dropdownType($name, $options); case 'global_validation': $options['global'] = true; $options['value'] = $values[$field]; return TicketValidation::dropdownStatus($name, $options); } return parent::getSpecificValueToSelect($field, $name, $values, $options); } Exemple #27 0 Afficher le fichier Fichier : transfer.class.php Projet : ryukansent/Thesis-SideB function showTransferList() { global $LANG, $DB, $CFG_GLPI; if (isset($_SESSION['glpitransfer_list']) && count($_SESSION['glpitransfer_list'])) { echo "<div class='center b'>" . $LANG['transfer'][5] . "<br>" . $LANG['transfer'][6] . "</div>"; echo "<table class='tab_cadre_fixe' >"; echo '<tr><th>' . $LANG['transfer'][7] . '</th><th>' . $LANG['transfer'][8] . " : "; $rand = Dropdown::show('Transfer', array('name' => 'id', 'comments' => false, 'toupdate' => array('value_fieldname' => 'id', 'to_update' => "transfer_form", 'url' => $CFG_GLPI["root_doc"] . "/ajax/transfers.php"))); echo '</th></tr>'; echo "<tr><td class='tab_bg_1 top'>"; foreach ($_SESSION['glpitransfer_list'] as $itemtype => $tab) { if (count($tab)) { $table = getTableForItemType($itemtype); $query = "SELECT `{$table}`.`id`,\n `{$table}`.`name`,\n `glpi_entities`.`completename` AS locname,\n `glpi_entities`.`id` AS entID\n FROM `{$table}`\n LEFT JOIN `glpi_entities`\n ON (`{$table}`.`entities_id` = `glpi_entities`.`id`)\n WHERE `{$table}`.`id` IN " . $this->createSearchConditionUsingArray($tab) . "\n ORDER BY locname, `{$table}`.`name`"; $entID = -1; if (!class_exists($itemtype)) { continue; } $item = new $itemtype(); if ($result = $DB->query($query)) { if ($DB->numrows($result)) { echo '<h3>' . $item->getTypeName() . '</h3>'; while ($data = $DB->fetch_assoc($result)) { if ($entID != $data['entID']) { if ($entID != -1) { echo '<br>'; } $entID = $data['entID']; if ($entID > 0) { echo '<strong>' . $data['locname'] . '</strong><br>'; } else { echo '<strong>' . $LANG['entity'][2] . '</strong><br>'; } } echo $data['name'] ? $data['name'] . "<br>" : "(" . $data['id'] . ")<br>"; } } } } } echo "</td><td class='tab_bg_2 top'>"; if (countElementsInTable('glpi_transfers') == 0) { echo $LANG['search'][15]; } else { $params = array('id' => '__VALUE__'); ajaxUpdateItemOnSelectEvent("dropdown_ID{$rand}", "transfer_form", $CFG_GLPI["root_doc"] . "/ajax/transfers.php", $params, false); } echo "<div class='center' id='transfer_form'>"; echo "<a href='" . $CFG_GLPI["root_doc"] . "/front/transfer.action.php?clear=1'>" . $LANG['transfer'][4] . "</a>"; echo "</div>"; echo '</td></tr>'; echo '</table>'; } else { echo $LANG['common'][24]; } } Exemple #28 0 Afficher le fichier Fichier : simcard_item.class.php Projet : picaro04/simcard static function showForItem(CommonDBTM $item) { global $DB, $LANG; if (!$item->canView()) { return false; } // if (PluginSimcardSimcard::canCreate()) { // if ($item->canEdit($item->getField('id'))) { // $url = Toolbox::getItemTypeFormURL('PluginSimcardSimcard'); // $url.= "?itemtype=".$item->getType()."&items_id=".$item->getID()."&id=-1"; // echo "<div class='center'><a href='$url'>".__s('New SIM card', 'simcard')."</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'>" . __s('Associated item') . "</th></tr>"; if (!empty($results)) { echo "<tr><th></th>"; echo "<th>" . __s('Entity') . "</th>"; echo "<th>" . __s('Name') . "</th>"; echo "<th>" . __s('IMSI') . "</th>"; echo "<th>" . __s('Inventory number') . "</th>"; echo "</tr>"; foreach ($results as $data) { $tmp = new PluginSimcardSimcard(); $tmp->getFromDB($data['plugin_simcard_simcards_id']); echo "<tr>"; echo "<td>"; if (PluginSimcardSimcard::canDelete()) { 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 (PluginSimcardSimcard::canUpdate()) { 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']; } 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=\"" . _sx('button', 'Save') . "\" class='submit'>"; echo "</td></tr>"; if (!empty($results)) { Html::openArrowMassives('items', true); Html::closeArrowMassives(array('delete_items' => _sx('button', 'Disconnect'))); } } echo "</table>"; Html::closeForm(); echo "</div>"; } Exemple #29 0 Afficher le fichier Fichier : contact.class.php Projet : euqip/glpi-smartcities /** * Display form for agent configuration * * @param $items_id integer ID * @param $options array * *@return bool true if form is ok * **/ function showForm($items_id, $options=array()) { global $DB,$CFG_GLPI; if ($items_id == '0') { $a_list = $this->find("`users_id`='".$_POST['id']."'", '', 1); if (count($a_list)) { $array = current($a_list); $items_id = $array['id']; } } if ($items_id != '0') { $this->getFromDB($items_id); } else { $this->getEmpty(); } $this->showFormHeader($options); if ($items_id!='') { $this->getFromDB($items_id); echo "<tr class='tab_bg_1'>"; echo "<td>".__('Template name')." :</td>"; echo "<td align='center'>"; Dropdown::show("PluginMonitoringContacttemplate", array('name' => 'plugin_monitoring_contacttemplates_id', 'value'=> $this->fields['plugin_monitoring_contacttemplates_id'])); echo "</td>"; echo "<td colspan='2'>"; echo "</td>"; echo "</tr>"; $this->showFormButtons($options); } else { // Add button for host creation echo "<tr>"; echo "<td colspan='4' align='center'>"; echo "<input name='users_id' type='hidden' value='".$_POST['id']."' />"; echo "<input name='add' value='".__('Manage this user for monitoring system', 'monitoring')."' class='submit' type='submit'></td>"; echo "</tr>"; $this->showFormButtons(array('canedit'=>false)); } return true; } Exemple #30 0 Afficher le fichier Fichier : hostconfig.class.php Projet : paisdelconocimiento/glpi-smartcities /** * * @param $items_id integer ID * @param $options array * *@return bool true if form is ok * **/ function showForm($items_id, $itemtype, $options = array()) { global $DB, $CFG_GLPI; $pmComponent = new PluginMonitoringComponent(); $pmRealm = new PluginMonitoringRealm(); $entities_id = 0; if ($itemtype == "Entity") { $entities_id = $items_id; } else { $item = new $itemtype(); $item->getFromDB($items_id); $entities_id = $item->fields['entities_id']; } $query = "SELECT * FROM `" . $this->getTable() . "`\n WHERE `items_id`='" . $items_id . "'\n AND `itemtype`='" . $itemtype . "'\n LIMIT 1"; $result = $DB->query($query); if ($DB->numrows($result) == '0') { $this->getEmpty(); if ($entities_id != '0' or $itemtype != 'Entity') { $this->fields['plugin_monitoring_components_id'] = -1; $this->fields['plugin_monitoring_realms_id'] = -1; $this->fields['jetlag'] = 100; } } else { $data = $DB->fetch_assoc($result); $this->getFromDB($data['id']); } echo "<form name='form' method='post'\n action='" . $CFG_GLPI['root_doc'] . "/plugins/monitoring/front/hostconfig.form.php'>"; echo "<table class='tab_cadre_fixe'"; echo "<tr class='tab_bg_1'>"; echo "<th colspan='4'>"; echo __('Hosts configuration', 'monitoring'); echo "</th>"; echo "</tr>"; echo "<tr class='tab_bg_1'>"; echo "<td>"; echo __('Component', 'monitoring') . " :"; echo "</td>"; echo "<td>"; $toadd = array(); if ($entities_id != '0' or $itemtype != 'Entity') { $toadd["-1"] = __('Inheritance of the parent entity'); } Dropdown::show('PluginMonitoringComponent', array('name' => 'plugin_monitoring_components_id', 'value' => $this->fields['plugin_monitoring_components_id'], 'toadd' => $toadd, 'display_emptychoice' => FALSE)); echo "</td>"; echo "<td>" . __('Reaml', 'monitoring') . " :</td>"; echo "<td>"; $toadd = array(); if ($entities_id != '0' or $itemtype != 'Entity') { $toadd["-1"] = __('Inheritance of the parent entity'); } Dropdown::show('PluginMonitoringRealm', array('name' => 'plugin_monitoring_realms_id', 'value' => $this->fields['plugin_monitoring_realms_id'], 'toadd' => $toadd, 'display_emptychoice' => FALSE)); echo "</td>"; echo "</tr>"; // Inheritance if ($this->fields['plugin_monitoring_components_id'] == '-1') { echo "<tr class='tab_bg_1'>"; if ($this->fields['plugin_monitoring_components_id'] == '-1') { echo "<td colspan='2' class='green center'>"; echo __('Inheritance of the parent entity') . " : "; $pmComponent->getFromDB($this->getValueAncestor("plugin_monitoring_components_id", $entities_id)); echo $pmComponent->fields['name']; echo "</td>"; } else { echo "<td colspan='2'>"; echo "</td>"; } if ($this->fields['plugin_monitoring_realms_id'] == '-1') { echo "<td colspan='2' class='green center'>"; echo __('Inheritance of the parent entity') . " : "; $pmRealm->getFromDB($this->getValueAncestor("plugin_monitoring_realms_id", $entities_id)); echo $pmRealm->fields['name']; echo "</td>"; } else { echo "<td colspan='2'>"; echo "</td>"; } echo "</tr>"; } echo "<tr class='tab_bg_1'>"; echo "<td>"; echo __('Jet lag', 'monitoring') . " :"; echo "</td>"; echo "<td>"; $elements = array('-11' => '-11', '-10' => '-10', '-9' => '-9', '-8' => '-8', '-7' => '-7', '-6' => '-6', '-5' => '-5', '-4' => '-4', '-3' => '-3', '-2' => '-2', '-1' => '-1', '0' => '0', '1' => '+1', '2' => '+2', '3' => '+3', '4' => '+4', '5' => '+5', '6' => '+6', '7' => '+7', '8' => '+8', '9' => '+9', '10' => '+10', '11' => '+11', '12' => '+12', '13' => '+13', '14' => '+14'); if ($entities_id != '0' or $itemtype != 'Entity') { $elements["100"] = __('Inheritance of the parent entity'); } Dropdown::showFromArray('jetlag', $elements, array('value' => $this->fields['jetlag'])); echo "</td>"; echo "<td colspan='2'></td>"; echo "</tr>"; // Inheritance if ($this->fields['jetlag'] == '100') { echo "<tr class='tab_bg_1'>"; if ($this->fields['jetlag'] == '100') { echo "<td colspan='2' class='green center'>"; echo __('Inheritance of the parent entity') . " : "; echo $elements[$this->getValueAncestor("jetlag", $entities_id)]; echo "</td>"; } else { echo "<td colspan='2'>"; echo "</td>"; } echo "<td colspan='2'>"; echo "</td>"; echo "</tr>"; } /* if ($itemtype == 'Entity' AND $items_id == '0') { echo "<tr class='tab_bg_1'>"; echo "<td>"; echo __('Shinken Server', 'monitoring')." :"; echo "</td>"; echo "<td>"; Dropdown::show("Computer", array( 'name' => 'computers_id', 'value' => $this->fields['computers_id'] )); echo "</td>"; echo "<td colspan='2'></td>"; echo "</tr>"; } */ if ($this->canCreate()) { echo "<tr class='tab_bg_1'>"; echo "<td colspan='4' align='center'>"; if (isset($this->fields['id']) and $this->fields['id'] != '') { echo "<input type='hidden' name='id' value='" . $this->fields['id'] . "'/>"; } echo "<input type='hidden' name='itemtype' value='" . $itemtype . "'/>"; echo "<input type='hidden' name='items_id' value='" . $items_id . "'/>"; echo "<input type='submit' name='update' value=\"" . __('Save') . "\" class='submit'>"; echo "</td>"; echo "</tr>"; } echo "</table>"; Html::closeForm(); return true; } Fonctions les mieux classées | Classes les mieux classées | Documentation | Politique de confidentialité | Advertise with us PHP | C# (CSharp) | Java | Golang | C++ (Cpp) | Python | JavaScript | TypeScript EN | RU | DE | FR | ES | PT | IT | JP | ZH | KO