function sf_queue_admin_form in Salesforce Suite 7.2
Same name and namespace in other branches
- 6.2 sf_queue/sf_queue.admin.inc \sf_queue_admin_form()
@todo Please document this function.
See also
1 string reference to 'sf_queue_admin_form'
- sf_queue_menu in sf_queue/
sf_queue.module - @file sf_queue.module Implements export queue and administrativa for Salesforce API
File
- sf_queue/
sf_queue.admin.inc, line 12 - Admin interface for the Salesforce Export Queue module.
Code
function sf_queue_admin_form() {
$sf_queue_count = db_query("SELECT count(created) FROM {salesforce_export_queue}")
->fetchField();
$mapinfo = _sf_queue_admin_mapinfo();
$header = array(
t('Manage'),
t('Operation'),
t('Queue ID'),
t('#Attempts'),
t('Created'),
t('Drupal Type'),
t('SF Type'),
t('Fieldmap'),
);
$rows = array();
$sf_queue_items = db_query("SELECT * FROM {salesforce_export_queue} ORDER BY created");
foreach ($sf_queue_items as $sf_queue_item) {
if (isset($mapinfo[$sf_queue_item->fieldmap_name])) {
$fieldmap = $mapinfo[$sf_queue_item->fieldmap_name];
}
else {
$fieldmap = $sf_queue_item->fieldmap_name;
}
$rows[] = array(
'data' => array(
l(t('View'), "admin/reports/sf_queue/view/" . $sf_queue_item->id) . ' ' . l(t('Delete'), "admin/reports/sf_queue/delete/" . $sf_queue_item->id),
$sf_queue_item->sf_op,
$sf_queue_item->id,
$sf_queue_item->attempts,
date("r", $sf_queue_item->created),
$sf_queue_item->drupal_type,
$sf_queue_item->sf_type,
$fieldmap,
),
);
}
$output = theme('table', array(
'header' => $header,
'rows' => $rows,
));
if ($sf_queue_count > 0) {
if ($sf_queue_count == 1) {
$output .= "There is 1 item in the queue.";
}
else {
$output .= "There are " . count($rows) . " items in the export queue.";
}
$output .= "<br />" . l(t('Process queued items now'), "admin/reports/sf_queue/processqueue");
}
else {
$output .= "There are no items in the export queue.";
}
return $output;
}