You are here

function merci_inventory_sync_fields in MERCI (Manage Equipment Reservations, Checkout and Inventory) 6

Field sync form

1 string reference to 'merci_inventory_sync_fields'
merci_inventory_admin_page in modules/merci_inventory/merci_inventory.module
Menu callback; sync fields

File

modules/merci_inventory/merci_inventory.module, line 69
Hooks and functions for MERCI Inventory

Code

function merci_inventory_sync_fields(&$form_state, $type_name) {
  $form = array();
  $form['merci_inventory_type'] = array(
    '#type' => 'hidden',
    '#value' => $type_name,
  );
  $form['merci_inventory_sync_to_types'] = array(
    '#type' => 'checkboxes',
    '#title' => t('Sync fields from') . ' <i>' . $type_name . '</i> ' . t('to these types'),
    '#options' => array(),
  );
  $types = merci_inventory_sync_resource_types();
  foreach ($types as $type) {
    $form['merci_inventory_sync_to_types']['#options'][$type] = $type;
  }

  // foreach
  $form['merci_inventory_submit'] = array(
    '#type' => 'submit',
    '#value' => t('Sync Fields'),
  );
  $form['#submit'] = array(
    'merci_inventory_sync_fields_submit',
  );
  return $form;
}