Menu

adding new class

mdemmert
2011-01-27
2015-02-24
  • mdemmert

    mdemmert - 2011-01-27

    Hello to all,
    I need help to adding a new class. My team leader is asking if we can add a new class named 'Region'. Hm I don't know if it possible. The structure we need is Organization - Region - Location. And the Region class must associate with the Contact class. Is it possible to do this?
    Many thanks
    Markus

     
  • mdemmert

    mdemmert - 2011-01-28

    Hello to all,
    got it and it seems to working good. But I have a prob. with the menu. The navigation on the left show me 'Menu:Region' and on the top in the main window 'Menu:Region+'. Have someone a idea how I can change this?
    Thanks Markus

     
  • dguembel

    dguembel - 2011-01-28

    Well, you figured it out by yourself ;-) However, I am not certain that what you want to do is necessary: You could also re-use de Location class to include regions, e.g. a Location "production plant X" in Bavaria as part of "Company X" could use "production plant X" as a Location, with "Bavaria" defined as the "Standort der Mutterfirma" (in German)? Alternatovely, you could do the same with two layers of "Organisation", too, if you prefer.

    But then, maybe I'm second-guessing what you are trying to do, and I'm all wrong?

     
  • Denis

    Denis - 2011-01-28

    Just about the 'Menu:Region' and 'Menu:Region+': these are entries in the 'dictionary', because the menu labels can (should) be translated. So just add the two entries in the appropriate language/dictionary file for the module.

     
  • mdemmert

    mdemmert - 2011-02-01

    Hello to all,
    thanks for the info. But have still problems with the menu. This lines I had added to model.itop-config-mgmt.php

    new OQLMenuNode('Region', 'SELECT Region', $oConfigManagementGroup->GetIndex(), 3 /* fRank */, true /* bSearch */);
    

    and here in en.dict.itop-config-mgmt.php

    //
    // Class: Region
    //
    Dict::Add('EN US', 'English', 'English', array(
        'Class:Region' => 'Region',
        'Class:Region+' => 'Any type of location: Region',
        'Class:Region/Attribute:name' => 'Name',
        'Class:Region/Attribute:name+' => '',
        'Class:Region/Attribute:status' => 'Status',
        'Class:Region/Attribute:status+' => '',
        'Class:Region/Attribute:status/Value:active' => 'Active',
        'Class:Region/Attribute:status/Value:active+' => 'Active',
        'Class:Region/Attribute:status/Value:inactive' => 'Inactive',
        'Class:Region/Attribute:status/Value:inactive+' => 'Inactive',
        'Class:Region/Attribute:org_id' => 'Owner organization',
        'Class:Region/Attribute:org_id+' => '',
        'Class:Region/Attribute:org_name' => 'Name of the owner organization',
        'Class:Region/Attribute:org_name+' => '',
        'Class:Region/Attribute:parent_id' => 'Parent location',
        'Class:Region/Attribute:parent_id+' => '',
        'Class:Region/Attribute:parent_name' => 'Parent name',
        'Class:Region/Attribute:parent_name+' => '',
        'Class:Region/Attribute:contact_list' => 'Contacts',
        'Class:Region/Attribute:contact_list+' => 'Contacts located on this site',
        'Class:Region/Attribute:infra_list' => 'Infrastructure',
        'Class:Region/Attribute:infra_list+' => 'CIs located on this site',
    ));
    

    But the menu on left still shows 'Menu:Region'. Any other suggestion?
    Many thanks for your help.
    Brgds Markus

     
  • Denis

    Denis - 2011-02-01

    Just add the following lines in the dictionary:

    Dict::Add('EN US', 'English', 'English', array( 
          'Menu:Region' => 'Regions',
          'Menu:Region+' => 'All Regions',
    ));
    

    You can merge them with the dictionary entries for the fields of the 'Region' object if you wish. In the end all translations are stored in one big hash array.

     
  • mdemmert

    mdemmert - 2011-02-02

    Hi dflaven,
    thanks that is working. Has someone experience to create a new AttributeExternalKey, AttributeExternalField to a new class?
    Thanks Markus

     
  • Ronald

    Ronald - 2015-02-24

    hi mdemmert,

    I have same problem with regards creating new class table for my new table.
    Could you please share it to me step-by-step instruction.
    Many thanks in advance.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.