function uc_reports_products_custom_form in Ubercart 5
Same name and namespace in other branches
- 6.2 uc_reports/uc_reports.admin.inc \uc_reports_products_custom_form()
- 7.3 uc_reports/uc_reports.admin.inc \uc_reports_products_custom_form()
1 string reference to 'uc_reports_products_custom_form'
- uc_reports_products_custom in uc_reports/
uc_reports.module - Display the product reports
File
- uc_reports/
uc_reports.module, line 639 - Displays reports on sales, customers, and products to store admin
Code
function uc_reports_products_custom_form($values, $statuses) {
$form['search'] = array(
'#type' => 'fieldset',
'#title' => t('Customize product report parameters'),
'#description' => t('Adjust these values and update the report to build your custom product report. Once submitted, the report may be bookmarked for easy reference in the future.'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
);
$form['search']['start_date'] = array(
'#type' => 'date',
'#title' => t('Start date'),
'#default_value' => array(
'month' => format_date($values['start_date'], 'custom', 'n'),
'day' => format_date($values['start_date'], 'custom', 'j'),
'year' => format_date($values['start_date'], 'custom', 'Y'),
),
);
$form['search']['end_date'] = array(
'#type' => 'date',
'#title' => t('End date'),
'#default_value' => array(
'month' => format_date($values['end_date'], 'custom', 'n'),
'day' => format_date($values['end_date'], 'custom', 'j'),
'year' => format_date($values['end_date'], 'custom', 'Y'),
),
);
$options = array();
foreach (uc_order_status_list() as $status) {
$options[$status['id']] = $status['title'];
}
if ($statuses === FALSE) {
$statuses = variable_get('uc_reports_reported_statuses', array(
'completed',
));
}
$form['search']['status'] = array(
'#type' => 'select',
'#title' => t('Order statuses'),
'#description' => t('Only orders with selected statuses will be included in the report.') . '<br />' . t('Hold Ctrl + click to select multiple statuses.'),
'#options' => $options,
'#default_value' => $statuses,
'#multiple' => TRUE,
'#size' => 5,
);
$form['search']['submit'] = array(
'#type' => 'submit',
'#value' => t('Update report'),
);
return $form;
}