Deprecated: Assigning the return value of new by reference is deprecated in /var/www/sdb/8/f/dev.art/wordpress/wp-settings.php on line 472

Deprecated: Assigning the return value of new by reference is deprecated in /var/www/sdb/8/f/dev.art/wordpress/wp-settings.php on line 487

Deprecated: Assigning the return value of new by reference is deprecated in /var/www/sdb/8/f/dev.art/wordpress/wp-settings.php on line 494

Deprecated: Assigning the return value of new by reference is deprecated in /var/www/sdb/8/f/dev.art/wordpress/wp-settings.php on line 530

Strict Standards: Declaration of Walker_Page::start_lvl() should be compatible with Walker::start_lvl(&$output) in /var/www/sdb/8/f/dev.art/wordpress/wp-includes/classes.php on line 594

Strict Standards: Declaration of Walker_Page::end_lvl() should be compatible with Walker::end_lvl(&$output) in /var/www/sdb/8/f/dev.art/wordpress/wp-includes/classes.php on line 594

Strict Standards: Declaration of Walker_Page::start_el() should be compatible with Walker::start_el(&$output) in /var/www/sdb/8/f/dev.art/wordpress/wp-includes/classes.php on line 594

Strict Standards: Declaration of Walker_Page::end_el() should be compatible with Walker::end_el(&$output) in /var/www/sdb/8/f/dev.art/wordpress/wp-includes/classes.php on line 594

Strict Standards: Declaration of Walker_PageDropdown::start_el() should be compatible with Walker::start_el(&$output) in /var/www/sdb/8/f/dev.art/wordpress/wp-includes/classes.php on line 611

Strict Standards: Declaration of Walker_Category::start_lvl() should be compatible with Walker::start_lvl(&$output) in /var/www/sdb/8/f/dev.art/wordpress/wp-includes/classes.php on line 705

Strict Standards: Declaration of Walker_Category::end_lvl() should be compatible with Walker::end_lvl(&$output) in /var/www/sdb/8/f/dev.art/wordpress/wp-includes/classes.php on line 705

Strict Standards: Declaration of Walker_Category::start_el() should be compatible with Walker::start_el(&$output) in /var/www/sdb/8/f/dev.art/wordpress/wp-includes/classes.php on line 705

Strict Standards: Declaration of Walker_Category::end_el() should be compatible with Walker::end_el(&$output) in /var/www/sdb/8/f/dev.art/wordpress/wp-includes/classes.php on line 705

Strict Standards: Declaration of Walker_CategoryDropdown::start_el() should be compatible with Walker::start_el(&$output) in /var/www/sdb/8/f/dev.art/wordpress/wp-includes/classes.php on line 728

Strict Standards: Redefining already defined constructor for class wpdb in /var/www/sdb/8/f/dev.art/wordpress/wp-includes/wp-db.php on line 306

Deprecated: Assigning the return value of new by reference is deprecated in /var/www/sdb/8/f/dev.art/wordpress/wp-includes/cache.php on line 103

Strict Standards: Redefining already defined constructor for class WP_Object_Cache in /var/www/sdb/8/f/dev.art/wordpress/wp-includes/cache.php on line 425

Deprecated: Assigning the return value of new by reference is deprecated in /var/www/sdb/8/f/dev.art/wordpress/wp-includes/query.php on line 21

Deprecated: Assigning the return value of new by reference is deprecated in /var/www/sdb/8/f/dev.art/wordpress/wp-includes/theme.php on line 623

Strict Standards: Redefining already defined constructor for class WP_Dependencies in /var/www/sdb/8/f/dev.art/wordpress/wp-includes/class.wp-dependencies.php on line 15

Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method Wordics::myWordics_init() should not be called statically in /var/www/sdb/8/f/dev.art/wordpress/wp-includes/plugin.php on line 311
Développement et arts numériques » drupal
Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /var/www/sdb/8/f/dev.art/wordpress/wp-includes/kses.php on line 947

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /var/www/sdb/8/f/dev.art/wordpress/wp-includes/kses.php on line 948

Archive

Posts Tagged ‘drupal’

Multigroup design in drupal

septembre 13th, 2009

Un commentaire sur la création de multigroup dans cck

Yes, very good module, i use a version from 10 august, everything works except differents display, i search a solution…

So, i demand me too why multigroup use delta, all works fine with, but, isn’t it really possible to add another field named gid or groupe_delta?

***************************************************************************************************************

This solutions have advantage to :
- don’t touch the delta (one delta by record for one field),
- don’t serialized any data.

One multigroup with different quantification for each field

In the form :

In this, field pen is enabled for just one field, the field color for more one.

vid   delta    gid     pen      vid   delta   gid   color
---------------------------------------------------------
1       0       0      bic1      1      0      0    green
1       1       1      bic2      1      1      1    blue          I have unordered
1       2       2      stab      1      4      2    red           delta2 to see that's
1       3       3      4color    1      3      3    blue          not a problem.
1       4       4      pilot1    1      7      4    blue
                                 1      2      3    red
                                 1      5      3    black
                                 1      6      3    green

If the user destroy the group, a choice is done to clear or not the gid field. If he decide or not to guard gids, the field’s definition is transform to multivalues field (if more than one field).

If he construct another group, a demand from system if a reinit for each field integrated is necessary, if not he can find all the ancients groups (a possibility to rename group).

It can be an option in multigroup to have syncs groups (as now, pseudo unique field who redefine the hook to define the number of fields to one by group line) with advantages to have table style display.

For view to see all group, a join on the gid is necessary like with the delta actually.

***************************************************************************************************************

Multi Group recursivity

The last idea is to have reccursion, it’s more complicated but possible
—————————————————————————————–
So the mains ideas to have a recursion is to have :
- a parent groupe id
- all group have a different id
- all records for one field have a different delta

For the same example :


brand  brandAdresse---------------------------------------------------------Groupe branding information
                articles----------------------------------------------------Groupe articles's families
                     identities---------------------------------------------Groupe articles's identities
                           options------------------------------------------Groupe articles's options
                                             color              ref---------Groupe articles's specifications
bic    elsewhere
       another place
                pen
                     classic
                            with rubber
                                             blue               ref1016
                                             red                ref1013
                                             green              ref1017
                            without rubber
                                             blue               ref1018
                                             red                ref1019
                                             green              ref1015
pilot  elsewhere
                pen
                    smarty
...

We take as rules:
-the vid is identical for all
-the delta is different for all in same field
-the gid is one for one group
-the gpid (parentid refer gid parent)

i use the notation delta-gid-gpid


                          adresse
            brand       Location ref   article        option       colors              ref1            brandref

br_gr  0    bic 0-0-0     refa 0-0-0
br_gr  0                  refc 2-0-0----------------------------------------------------------------------------------------unordered
ar_gr  2                                pen 0-2-0
ar_gr  2                                pen 3-2-0---------------------------------------------------------------------------unordered
op_gr  5                                       with rubber    0-5-2
re_gr  8                                                           blue  0-8-5      ref1496 0-8-5    7zz54155   0-8-5
  idem 9                                                           red   1-9-5      ref1639 1-9-5    6zz78451   1-9-5
  idem 10                                                          green 2-10-5     ref1018 2-10-5   7aa87459  2-10-5
  idem 10                                                          green 8-10-5                      7aa87460 10-10-5-------unordered
op_gr  6                                       without rubber 1-6-2
re_gr  11                                                          blue  3-11-6    ref1012 3-11-6    6zz47854 3-11-6
  idem 12                                                          red   4-12-6    ref1020 4-12-6    7aa65231 4-12-6
  idem 12                                                                          ref1025 5-12-6    7aa65271 5-12-6
  idem 12                                                                          ref1028 6-12-6    7aa65241 6-12-6
  idem 13                                                          green 5-13-6    ref1023 7-13-6    7aa58549 7-13-6
ar_gr  3                                pen 2-3-0---------------------------------------------------------------------------unordered
br_gr  1    pilot 1-1-1   refb 1-1-1
ar_gr  4                                pen 1-4-1
op_gr  7                                       with top       2-7-4
re_gr  14                                                          red   6-14-7    ref1028 8-14-7    1526326 8-14-7
  idem 15                                                          blue  7-15-7    ref1024 9-15-7    1542632 9-15-7

The unordered values have been add after to watch if an add is possible.

Use Cases

Each groupe have an add option.

In the first step, before any data is included, just the higher group is visible, and two links, add “same group” and add “sub group”. In this case add Brand and add Article. The add sub is inactive if less than one field is populate by value in his parent.

If add sub is click, a sub group is populate in memory, a gid incremented and a gpid included : all fields in this group inherit of this values.

If default data for a field or data add by user to a field, a increment delta is create for the field, and the gid and the parent gid are remember (save in the group).

We can move a sub group and attach to another group, by changing any gpid for fields in it (no for fields in sub sub groups).

View Integration

To render in view, each field must have link with parents.

For the exemple of the pen from bic without rubber and green have this :



                                |-------- join-----------|
                                |                        |
bic 0-0-0    refa 0-0-0   pen 0-2-0   without rubber 1-6-2   green 5-13-6    ref1023 7-13-6    7aa58549 7-13-6
      |             |             |                    |                |                 |                  |
      |             |----join-----|                    |-------join-----|                 |                  |
      |----------join-------------|                    |--------------------join----------|                  |
                                                       |--------------------------------------join-----------|

A join is add when add a field to view
- if one of parent field is present.
- if one of children field is present.
- for all join (a child is join to all parents) <- for this i’m not sure, all join, or just one

Groups of multiples values are allowed as normal (with delta) with add a restriction on the gid.

User can filter by group_id each field.

***************************************************************************************************************

I imagine that’s not the first time, that a person propose one of this solutions, and i agree with the others than have this idea before, and support in this direction.

Best Regards,

Nicolas

Author: Nicolas de Marqué Categories: Développement Tags: ,