i need module developer (not free help , paid $$$)

Events happening in the community are now at Drupal community events on www.drupal.org.
bsam's picture

description of my website :
i build a website in drupal 6 for schools ، each school is an (OG_group)
i create theses content type :
1- school (group)
2- class (subgroup) - schools contains many classes -First, second, third, etc.
3- Lesson - group post .

And i made a classification of the lessons (physics chemistry mathematics etc )
as taxonomy terms ( the terms under one vocabulary for all schools) , any Class in school has its own terms .
what i need :There are two issues i need
first :
After I add teachers users (belong to teacher role) is supposed to assign a courses name that will be taught by him , add terms -courses names - to him
- when teacher create Lesson node the list of taxonomy term that will appear to him is the only term (courses names ) that has added before to him- not all vocabulary term .
same point in more details:
i need to create (admin page for manage teachers ) admin can choose schoole name to display list of all teachers in school then he can edit delete or dd to teacher his courses name -taxonomy terms- )

second
i need to add taxonomy term to group (class subgroup) , its ok to add it ass normal vocabulary , but i need create taxonomy here is this step, create not choose from list ):
- now i use Hierarchical Select but the another created term shown here (i need only create new term
this point in more details:
i need to create (admin page ) on witch admin can choose school name , then it display a list of classes in school - then
for any item in class list ,admin can add new taxonomy term to class -and he can delete or edit old term ( term here is taxonomy terms name - physics chemistry mathematics etc .)

I need someone have expert in Modules programming (am beginner ) , so who can help me

Comments

Some ideas

joel_osc's picture

I don't really understand your first question, but it sounds like you want classes to reference a course. In which case, what I would do is to have a course entity [node] reference in my class content type and use entityreference_prepopulate to populate is automatically via a customized 'Add class' url which passes in the course that the class will belong to.

For the second one I used an entity [user] reference (multiple) on course for instructor(s). And then on node_save wrote some custom code to add the instructors as og group admins.

The hook_node_insert is not too bad to code in your own module:

function lms_node_insert($node) {
  global $user;
  if ($node->type == 'course') {
    $items = field_get_items('node', $node, 'field_instructor');
    foreach ($items as $item) {
      $account = user_load($item['uid']);
      og_group('node', $node->nid, array('entity' => $account));
      og_role_grant('node', $node->nid, $account->uid, 3);
    }
  }
}

The update code is a bit trickier because you need to compensate for changes in the instructors field:

function lms_node_update($node) {
  if ($node->type == 'course') {
    $node_orig = clone $node->original;
    $orig_items = field_get_items('node', $node_orig, 'field_instructor');
    $old_uids = array();
    if ($orig_items) {
      foreach ($orig_items as $item) {
        $old_uids[] = $item['target_id'];
      }
    }
    $items = field_get_items('node', $node, 'field_instructor');
    $new_uids = array();
    if ($items) {
      foreach ($items as $item) {
        $new_uids[] = $item['target_id'];
      }
    }
    $remove = array_diff($old_uids, $new_uids);
    $add = array_diff($new_uids, $old_uids);
    if ($remove) {
      foreach ($remove as $uid) {
        $account = user_load($uid);
        og_ungroup('node', $node->nid, 'user', $account);
      }
    }
    foreach ($add as $uid) {
      $account = user_load($uid);
      og_group('node', $node->nid, array('entity' => $account));
      og_role_grant('node', $node->nid, $account->uid, 3);
    }
  }
}

There may be an easier way to do all of this, be happy to here some other ideas.

thank joel_osc

bsam's picture

thank joel_osc
am sorry not what I want , I have edit the topic to becomes even more pronounced
Thanks a lot Joel

really doesn't sound like you

btopro's picture

really doesn't sound like you need to develop code to do what you have listed above. Entity talk is D7 but you mentioned doing it in D6. I'd play with some D6 distributions and see what modules they used to accomplish certain things. Commons, Open Atrium, Open Scholar and ELMS all have organic groups powering them so at the very least go on drupal.org and look at the notes section for the latest stable release of each. This should help give you an idea of what modules are there to accomplish a lot of things in the courses as OG realm

hi man, There is a glools-ols

GloolsGuan's picture

hi man,

There is a glools-ols project for online education, It is a development version, but maybe you can find some useful things from glools-ols.
The second, If you can development your project by drupal7, We can have a talk about your project.

For Glools-OLS:
http://code.google.com/p/glools-ols/
There is no a downloadable version for you, but you can get the code by SVN.

best wishes.

The creator of GLOOLS.

Drupal in Education

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: