CVS edit link for gibus

I'm working for Sopinspace (http://www.sopinspace.com) and have developped a module for a customer, which is now in production (can be viewed on http://www.moietmonparc.com/biodiversite/priorities but it needs a drupal account on this site). Therefore we'd like to publish this module for the Drupal community. The module is called 'Priorities'. It implements a new functionnality:

'Priorities' module allows authorised users to choose a set of priorities for some defined node types. Each set of priorities applies to a node type. Authorised users can set a priority to each node of a defined node type. The priority is chosen between a set of six alternative (by default: Very important, Important, Mid important, Not important, Don't know and Won't say). Results are computed to show the node of utmost importance for voted users.

A typical usage of this module is to help in a decision making process. For each decision, it is recommended to create a new node type (based on article or page for eg.). Then, create a node of this node type for each alternative in this decision. The 'Priorities' module allows users to give a priority level to each alternative and outputs results sorted by score.

Label and color of each alternative is configurable, as well as title and node type for each priorities set.

The code has been reviewed with the Coder module to comply to Drupal Coding Standards (http://drupal.org/coding-standards) and is ready for its first release.

Since Sopinspace develop Drupal sites for its customers, we are likely to publish other modules or themes in the future...

Thanks for processing this CVS application!

PS: in this CVS application form, I've check "I will only commit code that is licensed under terms of the GNU public license, version 2", while the 'Priorities' module, as well as any future module, is supposed to be released under GPLv3 or later.

Comments

gibus’s picture

Title: gibus [gibus] » tarball of the 'Priorities' module
Component: Miscellaneous » Code
Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new10.58 KB

This is the code of the 'Priorities' module.

avpaderno’s picture

Title: tarball of the 'Priorities' module » gibus [gibus]
Component: Code » Miscellaneous

PS: in this CVS application form, I've check "I will only commit code that is licensed under terms of the GNU public license, version 2", while the 'Priorities' module, as well as any future module, is supposed to be released under GPLv3 or later.

As you approved, you can only release a module under GNU License v2, which is the same license used by Drupal. As the module depends from Drupal code, module and Drupal must use the same license.

gibus’s picture

Well OK for GPLv2. This is not the best choice (I've been involved in fight against software patents and other Free Software campaigns, including the collaborative drafting of GPLv3), but it's OK. Maybe you can point me on some discussion about Drupal core to upgrade to GPLv3?

avpaderno’s picture

Status: Needs review » Needs work

It's not clear what the code is doing in priorities_enable(), which should go in priorities.install.

gibus’s picture

StatusFileSize
new10.62 KB

priorities_enable rebuilds the menu links (i.e. two links: set priorities/get results) for each set of priorities. I've move the function to priorities.install as you've instructed and changed a little bit the comment.

gibus’s picture

Status: Needs work » Needs review
avpaderno’s picture

Status: Needs review » Needs work

I still don't understand why the code should rebuild the menus all times it is enabled.
Then, what are the vantages of using this module, rather than using a vocabulary?

gibus’s picture

Status: Needs work » Needs review

Every set of priorities defined gives access to 2 pages: one to set the priorities, one to see the results. These pages are linked from the navigation menu, under the name of the set of priorities. Therefore, when you enable the module, all pair of pages for each set of priorities should be enabled in the menu. Is it more clear?

The advantage of using this module is to allow users to give some kind of score to a set of alternatives and to see the sorted results by "score", i.e. for a set of alternatives (i.e. a set of priorities) you can see how users like each alternative. This is something completly different from vocabulary.

avpaderno’s picture

Status: Needs review » Needs work
  1.     $link['mlid'] = 0;
        $link['link_title'] = t('@title', array('@title', $priorities['title']));
    

    A string with just placeholders doesn't contain anything that can be translated; the call to t() is useless.

  2. function priorities_uninstall() {
      drupal_uninstall_schema('priorities');
      db_query("DELETE FROM {variable} WHERE name LIKE 'priorities_%'");
    }
    

    It is better to explicitly delete all the Drupal variables defined from the module with variable_del(). There could be other modules with a name starting with priorities_.

  3. See the Drupal coding standards to understand how a module code should be written. In particular see the namespace respect part.
gibus’s picture

Status: Needs work » Needs review
StatusFileSize
new10.68 KB

OK changes applied as required.

avpaderno’s picture

Status: Needs review » Fixed

I apologize for the delay in the approval.
I am still not convinced about the module, but I will let the users judge about that.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

avpaderno’s picture

Component: Miscellaneous » new project application
Assigned: Unassigned » avpaderno
Issue summary: View changes