[dev] Projects management module and Groups.php

Carlos Pedrinaci cpedrinaci at yahoo.es
Thu Sep 4 10:01:32 PDT 2003


Hi,

I've been porting the old module I had to Horde 3. It has already some
basic functionnality: http://xenic.net1.nerim.net/horde
You can log in using demo demo or demoX demoX ( where 1 <= X <= 15)
The projects module is under 'Development'.

As you can see there is not much functionnality but imo it can serve as
a good starting point.

The users are related to the projects via the Groups system so that we
can later on use the Permissions system in an easy way. That will
between other things allow us to use Nag's sharing tasks capability.

As a side issue related to the projects coding...
I had some problems with the Groups system. I thought they were over but
now I guess its not the case:

If you check out the site as it is at the moment, that is, with only one
project (xenic and demo being its administrators) the groups system
returns the correct results concerning users memberships. However if you
go and create a project with the user 'demo' the system thinks 'demo' is
only part of the team for that last project and not for the first one
(called "Project 1"). The same way 'xenic' who was also an administrator
for "Project 1" is afterwards not considered as part of its team
anymore!

I did some tests using the php shell and here you are the results:

require_once '../lib/Group.php';   
require_once '../projects/lib/Projects.php';   
require_once '../projects/lib/Driver.php';   
require_once '../projects/lib/Driver/sql.php';   

$project = Projects::getProjectById(4);   
if (!isset($project)) {   
   echo "Project not set";   
}   
$criteria = USERS_TEAM;   
$groups = &Group::singleton();   
$top_name = $groups->getGroupName($project['group_id']);   
$group_name = Projects::_buildGroupName($top_name, $criteria);   
echo $group_name . "<br />";   
              
if (($criteria == USERS_ANY) || ($criteria == USERS_TEAM)) {   
  $users = $groups->listAllUsers($group_name);   
  echo "It's true <br />";   
}   
else {   
   $users = $groups->listUsers($group_name);   
}   

foreach ($users as $userID){   
    echo $userID . "<br />";   
}   

$is = $groups ->userIsInGroup('xenic', $group_name, true);   
if($is){echo "He is!!??!!";}

---------
RESULTS :
---------
a) Before creating the second project:

Project 1:Developers
It's true 
demo13
demo12
demo11
demo10
demo1
demo
xenic
He is!!??!!

-> That result is correct as you would expect.

b) After having created another project with user 'demo':

Project 1:Developers
It's true 
demo13
demo12
demo11
demo10
demo1
He is!!??!!

-> That result is not coherent: listAllUsers doesn't find 'xenic' but
userIsInGroup does think 'xenic' should be in that list.

Any idea? 

Regards,

Carlos

PS: You can browse Projects Module's code in the same site.
    Apologies for the big mail.




More information about the dev mailing list