Menu

add extra field to location

mdemmert
2011-01-25
2012-12-19
  • mdemmert

    mdemmert - 2011-01-25

    Hello to all,
    need a little bit help. I will add an new textarea to the location properties. How I can do that ? Must I use the iTop_Customization-3.pdf. Or is it another way to add an extra textarea.
    Many thanks
    Markus

     
  • Denis

    Denis - 2011-01-25

    Hi Markus,

    You can take a look at the PDF document, because the principle is the same, but hopefully what you are looking for is simpler.

    Just edit the file 'modules/itop-config-mgmt-1.0.0/model.itop-config- mgmt.php'.

    Supposing that your new field will be called 'description', insert in the definition of the 'Location' class, after the line 90, the following line:

            MetaModel::Init_AddAttribute(new AttributeText("description", array("allowed_values"=>null, "sql"=>"description", "default_value"=>"", "is_null_allowed"=>true, "depends_on"=>array())));
    

    Also edit the line 97 to add the new field into the details:

            MetaModel::Init_SetZListItems('details', array('name', 'status', 'org_id', 'address', 'postal_code', 'city', 'country', 'description', 'parent_id', 'contact_list', 'infra_list'));
    

    Then, just apply the change to the database using the following SQL command:

    ALTER TABLE `location` ADD `description` TEXT NULL;
    

    That's it, your new field should be usable. You can put the final touch by editing the 'dictionary' as explained in the PDF to adjust the label of your new field, in  your favourite language.

    Hope this helps,

    - Denis

     
  • mdemmert

    mdemmert - 2011-01-25

    Hi Denis,
    your right is simpler. Works great for me,perfect!
    Thanks for your fast reply.
    Brgds Markus

     

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.