In creating a reservation, I have added additional fields for a client, rooms and locations. But since the MERCI choices does not show in the reservation fields, I cannot change the order of the fields. Is there a way to make the MERCI choices show in the reservations fields?

Comments

aanschut’s picture

Version: 7.x-2.x-dev » 7.x-2.0
darrick’s picture

Implement https://api.drupal.org/api/drupal/modules!field!field.api.php/function/h...

You can do this in a separate module or else post a patch for merci back here. If I get some time I can do it.

Should be something like this:

function merci_field_extra_fields() {
  $extra['node']['merci_reservation'] = array(
    'form' => array(
      'choice_wrapper' => array(
        'label' => t('Merci choices'),
        'description' => t('Merci choices'),
        'weight' => -4,
      ),
    ),
    'display' => array(
      'merci_reservations' => array(
        'label' => t('Reservations'),
        'description' => t('Reservations'),
        'weight' => 0,
      ),
    ),
  );

  return $extra;
}
aanschut’s picture

darrick,
Thank you for the quick reply. Your code works great. I can move the MERCI choices around. I also was able to get the MERCI status listed as a field as well. Once I figure out where this might go in merci.module, I will post a patch.

		function merci_field_extra_fields() {
		  $extra['node']['merci_reservation'] = array(
		    'form' => array(
		      'choice_wrapper' => array(
		        'label' => t('MERCI choices'),
		        'description' => t('MERCI choices'),
		        'weight' => -4,
		      ),
		      'merci_reservation_status' => array(
		        'label' => t('MERCI status'),
		        'description' => t('MERCI status'),
		        'weight' => -3,
		      ),
		    ),
		    'display' => array(
		      'merci_reservations' => array(
		        'label' => t('Choices'),
		        'description' => t('Choices'),
		        'weight' => 0,
		      ),
		      'merci_reservations' => array(
		        'label' => t('Status'),
		        'description' => t('Status'),
		        'weight' => 0,
		      ),
		    ),
		  );
		  return $extra;
		}