Date index for Nov 2003


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [achievo] add a new field



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

f.deville dot 

> I already read the guide to develop achievo extentions, but I wander if
> there is no easier way, because I really don't need an extra module, only
> an extra field in de projects database.
> Is this possible ?

What you need is a 'minimodule' which just adds the field to the
projects node. It can be done without a module, but that would mean you
would have to modify the sources every time you upgrade Achievo.

Since creating such a mini-module is actually explained in part 3 of the
guides, which is not yet available, here's a small example to get you going:

1) Create a directory in your achievo_modules dir for your new module.
For example, name it crelan, to signify that it's a crelan (as I believe
your company is called) specific module.

2) Add the field to the project table in the database (for example
msprojectid).

3) Code the module; create a module.inc in your module directory like this:

<?php

  $modifiers[] = "project.project";

  class mod_crelan extends atkModule
  {
    function project_modifier(&$node)
    {
      $node->add(new atkAttribute("msprojectid"));
    }
  }
?>

This actually is all the code you need.

4) Finally add the module to config.inc.php (near the bottom, in the
module section), and you'll be able to enter your msproject id's.

Now, if you want a dropdown and a separate table with msprojects, you
would have to add a class to the module and replace the atkAttribute
above with an atkManyToOneRelation, but you can probably get that from
the guides.

Greetings,
Ivo


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQE/weKh95NUnGFZm9cRAgOKAJ0Y05MKURS20NQiDjxqfmCFpgn0ggCgkK45
yn2vmuik6votI5APwKc+vJI=
=yFxm
-----END PGP SIGNATURE-----


http://www.achievo.org/lists achievo.org - ©1999-2002 ibuildings.nl BV