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