Update: Solution has been found and Position has been filled. Thanks Everyone :)

Hi Experts,

I need quick help from expert drupal developer/s who knows how to alter forms and form elements and their display in drupal 6.

Here is the scanario:
I am using Drupal 6 with CCK-3 (for CCK multigroup feature).
Content type is story and I have created a 'Multigroup fieldset' > Activity with two fields 'activity_name' and 'activity_date' under it. I have set the max values limit to 'unlimited' giving me magical 'add more values' button.
Now, Everything is fine and on node/add or edit forms, when I wish to add new fileds/values, I simply click 'add more values' button and a new fieldset appears using AHAH/ajaxified callbacks at the end of existing fieldsets.

All I need is: the new fieldset to appear on top of existing fieldsets and not at the end like it is by default.
Check this screenshot to see exactly what I am asking for. : http://postimage.org/image/ifngfi623/

Only local images are allowed.

If you still having problem understanding the issue, feel free to contact me using the contact form.

Anyone who will show this working on their side (server or via skype screenshare), will be rewarded the job and instant payment will be made via paypal. Just need it done before Monday or asap.

Let me know if any questions.

Thanks.

Comments

websule94’s picture

Thanks Everyone for all your positive and quick replied, in-spite of it being a weekend. I am truly impressed by the pool of talent and community spirit you guys have.

Just to let all new readers know, that Solution has been found and position has been filled. I would love to work with you guys next time.

Thanks again.

odyseg’s picture

Hi webnextech,

do you mind sharing the solution for this matter?

thanks

jvizcarrondo’s picture

Webnextech can not share the solution because he has not paid the realization of this. Usually I have much care for new users who place advertisements on "Paid Drupal services" with little iteration in the community, but I receive an email response mail @webnextech.com seemed to me that this was a serious company, the required payment was $ 40 (a gift, is sunday remember) and this is the date and even I have no payment, WebNext Technologies seems to have done as forest gump "run forest run". If this happens with this company for just $ 40 I do not want to imagine what happens with a really high amount, poor customers who fall into their hands and give any advance payment. I'm tired of waiting for payment (almost 10 days) and a little good publicity they do not like bad :-).

In addition, as not all act in this way and I believe in community work, below is the patch that allows you the option to reverse the order of the fields in Content Multigroup.

diff --git a/modules/content_multigroup/content_multigroup.admin.inc b/modules/content_multigroup/content_multigroup.admin.inc
index 7e7ca58..6d088e0 100644
--- a/modules/content_multigroup/content_multigroup.admin.inc
+++ b/modules/content_multigroup/content_multigroup.admin.inc
@@ -432,6 +432,13 @@ function content_multigroup_group_edit_form(&$form, &$form_state) {
       '#value' => $group['settings']['multigroup']['subgroup'],
     );
   }
+  //add reverse option
+  $form['settings']['multigroup']['content_multigroup_order'] = array(
+    '#title' => t('Reverse the order of the items'),
+    '#type' => 'checkbox',
+    '#default_value' => variable_get('content_multigroup_' . $group_name, FALSE),
+    '#return_value' => '1',
+  );
 
   $form['settings']['multigroup']['multiple-columns'] = array(
     '#type' => 'checkbox',
@@ -478,6 +485,8 @@ function content_multigroup_group_edit_form(&$form, &$form_state) {
 
   $form['#validate'][] = 'content_multigroup_group_edit_form_validate';
   $form['#submit'][] = 'content_multigroup_group_edit_form_submit';
+  //add order field submit
+  $form['#submit'][] = 'content_multigroup_group_edit_form_order_submit';
 }
 
 /**
@@ -529,3 +538,10 @@ function content_multigroup_group_edit_form_submit($form, &$form_state) {
     menu_rebuild();
   }
 }
+
+/**
+ * Implementation of content_multigroup_group_edit_form_order_submit().
+ */
+function content_multigroup_group_edit_form_order_submit($form, &$form_state) {
+  variable_set('content_multigroup_' . $form_state['values']['group_name'], $form_state['values']['settings']['multigroup']['content_multigroup_order']);
+}
diff --git a/modules/content_multigroup/content_multigroup.install b/modules/content_multigroup/content_multigroup.install
index 9e12be3..c64d31a 100644
--- a/modules/content_multigroup/content_multigroup.install
+++ b/modules/content_multigroup/content_multigroup.install
@@ -23,6 +23,8 @@ function content_multigroup_install() {
 function content_multigroup_uninstall() {
   drupal_load('module', 'content');
   content_notify('uninstall', 'content_multigroup');
+  // Remove order variables.
+  db_query("DELETE FROM {variable} WHERE name LIKE '%s'", 'content_multigroup%');
 }
 
 /**
diff --git a/modules/content_multigroup/content_multigroup.node_form.inc b/modules/content_multigroup/content_multigroup.node_form.inc
index fa4815d..03697f5 100644
--- a/modules/content_multigroup/content_multigroup.node_form.inc
+++ b/modules/content_multigroup/content_multigroup.node_form.inc
@@ -267,7 +267,10 @@ function content_multigroup_group_form(&$form, &$form_state, $group, $delta) {
 
   // Reset the form '#node' back to its original value.
   $form['#node'] = $node;
-  
+  //Inverse order field
+  if (variable_get('content_multigroup_' . $group_name, FALSE)) {
+    $element[$group_name][$delta]['#weight'] = -$delta;
+  }  
   return $element;
 }

Juan

ekidman’s picture

Juan,

Thanks for posting this. I'm trying to make certain multigroup fields display inverted. So that when you add a new item, it automatically goes on top of the other items when you view the node. This patch makes the new field go to the top of the list in the node edit form, but when I view the node it still posts it to the bottom. I'm trying to avoid users having to drag every new item to the top every time they post something, so am looking for a good solution. Is there any way this patch can be modified to allow the fields to also display inverted??

Any help would be great, this issue has been holding me up. Thanks