Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(fields): add several fields #475

Merged
merged 3 commits into from
Apr 29, 2022

Conversation

stonebuzz
Copy link
Contributor

@stonebuzz stonebuzz commented Mar 22, 2022

Add new fields

<optgroup label="Modèle" data-select2-id="31">
   <option value="dropdowncomputermodels" data-select2-id="32">Modèles d'ordinateurs</option>
   <option value="dropdownmonitormodels" data-select2-id="33">Modèles de moniteurs</option>
   <option value="dropdownnetworkequipmentmodels" data-select2-id="34">Modèles de matériels réseau</option>
   <option value="dropdownperipheralmodels" data-select2-id="35">Modèles de périphériques</option>
   <option value="dropdownphonemodels" data-select2-id="36">Modèles de téléphones</option>
   <option value="dropdownprintermodels" data-select2-id="37">Modèles d'imprimantes</option>
   <option value="dropdownenclosuremodels" data-select2-id="38">Modèles de châssis</option>
   <option value="dropdownpdumodels" data-select2-id="39">Modèles de PDU</option>
   <option value="dropdownrackmodels" data-select2-id="40">Modèles de baies</option>
   <option value="dropdownglpi\socketmodels" data-select2-id="41">Modèles de prise</option>
</optgroup>
<optgroup label="Parc" data-select2-id="42">
   <option value="dropdowncomputers" data-select2-id="43">Ordinateurs</option>
   <option value="dropdownmonitors" data-select2-id="44">Moniteurs</option>
   <option value="dropdownnetworkequipments" data-select2-id="45">Matériels réseau</option>
   <option value="dropdownperipherals" data-select2-id="46">Périphériques</option>
   <option value="dropdownphones" data-select2-id="47">Téléphones</option>
   <option value="dropdownprinters" data-select2-id="48">Imprimantes</option>
   <option value="dropdownsoftwarelicenses" data-select2-id="49">Licences</option>
   <option value="dropdowncertificates" data-select2-id="50">Certificats</option>
   <option value="dropdownenclosures" data-select2-id="51">Châssis</option>
   <option value="dropdownpdus" data-select2-id="52">PDU</option>
   <option value="dropdownlines" data-select2-id="53">Lignes</option>
   <option value="dropdownracks" data-select2-id="54">Baies</option>
   <option value="dropdownsoftwareversions" data-select2-id="55">Versions</option>
   <option value="dropdownclusters" data-select2-id="56">Clusters</option>
   <option value="dropdowncontracts" data-select2-id="57">Contrats</option>
   <option value="dropdownappliances" data-select2-id="58">Applicatifs</option>
   <option value="dropdowndatabaseinstances" data-select2-id="59">Instances de base de données</option>
   <option value="dropdowncables" data-select2-id="60">Câbles</option>
</optgroup>
<optgroup label="Type" data-select2-id="61">
   <option value="dropdowncomputertypes" data-select2-id="62">Types d'ordinateurs</option>
   <option value="dropdownmonitortypes" data-select2-id="63">Types de moniteur</option>
   <option value="dropdownnetworkequipmenttypes" data-select2-id="64">Types de matériels réseau</option>
   <option value="dropdownperipheraltypes" data-select2-id="65">Types de périphériques</option>
   <option value="dropdownphonetypes" data-select2-id="66">Types de téléphones</option>
   <option value="dropdownprintertypes" data-select2-id="67">Types d'imprimantes</option>
   <option value="dropdowndatabaseinstancetypes" data-select2-id="68">Types d'instances de base de données</option>
   <option value="dropdowncabletypes" data-select2-id="69">Types de câble</option>
</optgroup>
<optgroup label="Administration" data-select2-id="70">
   <option value="dropdownusers" data-select2-id="71">Utilisateurs</option>
   <option value="dropdowngroups" data-select2-id="72">Groupes</option>
</optgroup>
   <optgroup label="Autre" data-select2-id="73">
   <option value="dropdownoperatingsystems" data-select2-id="74">Systèmes d'exploitation</option>
</optgroup>

Move old type dropdownuser to new one dropdownusers

@stonebuzz stonebuzz self-assigned this Mar 22, 2022
Copy link
Contributor

@cedric-anne cedric-anne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this kind of dropdown could be added for all assets using:

  • $CFG_GLPI['asset_types'] to get asset classes and CommonDBTM::getModelClass() to ensure they have a model class;
  • use preg_match('/^dropdown(?<class>.+)$/', $data['type'], $matches) to extract target class (can be used also for existing dropdownuser and dropdownoperatingsystems, but for this one, the s have to be removed)

@cedric-anne cedric-anne force-pushed the feature/glpi-10.0 branch 2 times, most recently from c93eacf to 4108e66 Compare March 25, 2022 10:47
@stonebuzz stonebuzz changed the title feat(fields): add computer / network model fields feat(fields): add several fields Mar 29, 2022
@cedric-anne cedric-anne force-pushed the feature/glpi-10.0 branch 4 times, most recently from 3cdf230 to 9ac917e Compare April 5, 2022 14:22
@cedric-anne cedric-anne force-pushed the computer_switch_model branch 2 times, most recently from ee67fbe to d396219 Compare April 19, 2022 12:59
@cedric-anne cedric-anne deleted the branch pluginsGLPI:develop April 19, 2022 13:12
@cedric-anne cedric-anne reopened this Apr 19, 2022
@cedric-anne cedric-anne added this to the 1.15.0 milestone Apr 19, 2022
@cedric-anne cedric-anne changed the base branch from feature/glpi-10.0 to develop April 19, 2022 13:39
@cedric-anne cedric-anne merged commit fdc8eca into pluginsGLPI:develop Apr 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants