You are here

function uc_order_settings_form in Ubercart 6.2

Same name and namespace in other branches
  1. 5 uc_order/uc_order.module \uc_order_settings_form()
  2. 7.3 uc_order/uc_order.admin.inc \uc_order_settings_form()

Generates the settings form for orders.

1 string reference to 'uc_order_settings_form'
uc_order_menu in uc_order/uc_order.module
Implements hook_menu().

File

uc_order/uc_order.admin.inc, line 28
Order administration menu items.

Code

function uc_order_settings_form() {
  $form['admin'] = array(
    '#type' => 'fieldset',
    '#title' => t('Admin settings'),
    '#summary callback' => 'summarize_form',
    '#collapsible' => FALSE,
    '#collapsed' => FALSE,
  );
  $form['admin']['uc_order_number_displayed'] = array(
    '#type' => 'select',
    '#title' => t('Number of orders on overview screen'),
    '#options' => drupal_map_assoc(range(10, 100, 10)),
    '#summary' => t('Displaying @orders orders at a time on the admin overview', array(
      '@orders' => variable_get('uc_order_number_displayed', 30),
    )),
    '#default_value' => variable_get('uc_order_number_displayed', 30),
  );
  $form['admin']['uc_order_logging'] = array(
    '#type' => 'checkbox',
    '#title' => t('Enable order logging'),
    '#summary callback' => 'summarize_checkbox',
    '#summary arguments' => array(
      t('Order logging is enabled.'),
      t('Order logging is disabled.'),
    ),
    '#default_value' => variable_get('uc_order_logging', TRUE),
  );
  $form['admin']['uc_order_capitalize_addresses'] = array(
    '#type' => 'checkbox',
    '#title' => t('Capitalize address on order screens'),
    '#summary callback' => 'summarize_checkbox',
    '#summary arguments' => array(
      t('Addresses on order view pages are capitalized.'),
      t('Addresses on order view pages are not capitalized.'),
    ),
    '#default_value' => variable_get('uc_order_capitalize_addresses', TRUE),
  );
  $form['customer'] = array(
    '#type' => 'fieldset',
    '#title' => t('Customer settings'),
    '#summary callback' => 'summarize_form',
    '#collapsible' => FALSE,
    '#collapsed' => FALSE,
  );
  $form['customer']['uc_cust_view_order_invoices'] = array(
    '#type' => 'checkbox',
    '#title' => t('Allow customers to view order invoices from their order history.'),
    '#description' => t('Enabling this feature allows pop-up invoices to be opened when a particular order is being viewed.'),
    '#summary callback' => 'summarize_checkbox',
    '#summary arguments' => array(
      t('Customers are allowed to view order invoices from their accounts.'),
      t('Customers are not allowed to view order invoices from their accounts.'),
    ),
    '#default_value' => variable_get('uc_cust_view_order_invoices', TRUE),
  );
  $form['customer']['uc_cust_order_invoice_template'] = array(
    '#type' => 'select',
    '#title' => t('On-site invoice template'),
    '#description' => t('Select the invoice template to use when invoices are viewed on the site.<br />This is separate from the template used to e-mail invoices to customers which is configured through <a href="!url">Conditional actions</a>.', array(
      '!url' => url(CA_UI_PATH),
    )),
    '#options' => uc_order_template_options(),
    '#summary' => t('You are using the %template order invoice template.', array(
      '%template' => variable_get('uc_cust_order_invoice_template', 'customer'),
    )),
    '#default_value' => variable_get('uc_cust_order_invoice_template', 'customer'),
  );
  return system_settings_form($form);
}