function globallink_dashboard_active_submit in GlobalLink Connect for Drupal 7.5
Same name and namespace in other branches
- 7.7 globallink_workbench_all_submissions.inc \globallink_dashboard_active_submit()
- 7.6 globallink_active_submissions.inc \globallink_dashboard_active_submit()
Handles submission of active GlobalLink form.
File
- ./
globallink_active_submissions.inc, line 348
Code
function globallink_dashboard_active_submit($form, &$form_state) {
$op = isset($form_state['values']['op']) ? $form_state['values']['op'] : '';
$pd4 = globallink_get_project_director_details();
switch ($op) {
case t('Cancel Selected Documents'):
try {
$rids_arr = array_filter($form_state['values']['table']);
$rids = globallink_check_status($rids_arr);
if (count($rids) == 0) {
drupal_set_message(t('No document(s) cancelled.'), 'warning', NULL);
return;
}
$_SESSION['globallink_selected_submission'] = '';
globallink_cancel_select_records($rids, $pd4);
$_SESSION['globallink_globalLink_arr'] = array();
drupal_set_message(t('Selected document(s) has been cancelled successfully.'));
} catch (SoapFault $se) {
$_SESSION['globallink_selected_submission'] = '';
watchdog('GlobalLink', 'SOAP Exception - %function - Code[%faultcode], Message[%faultstring]', array(
'%function' => __FUNCTION__,
'%faultcode' => $se->faultcode,
'%faultstring' => $se->faultstring,
), WATCHDOG_ERROR);
form_set_error('', t('Web Services Error: @faultcode - @faultstring', array(
'@faultcode' => $se->faultcode,
'@faultstring' => $se->faultstring,
)));
} catch (Exception $e) {
$_SESSION['globallink_selected_submission'] = '';
watchdog('GlobalLink', 'Exception - %function - File[%file], Line[%line], Code[%code], Message[%message]', array(
'%function' => __FUNCTION__,
'%file' => $e
->getFile(),
'%line' => $e
->getLine(),
'%code' => $e
->getCode(),
'%message' => $e
->getMessage(),
), WATCHDOG_ERROR);
form_set_error('', t('Error: @message', array(
'@message' => $e
->getMessage(),
)));
}
break;
case t('Clear Cancelled Documents'):
try {
$count = globallink_clear_cancelled_documents();
$_SESSION['globallink_selected_submission'] = '';
$_SESSION['globallink_globalLink_arr'] = array();
if ($count > 0) {
drupal_set_message(t('Cancelled document(s) has been cleared successfully.'));
}
else {
drupal_set_message(t('No document(s) to clear.'), 'warning', NULL);
}
} catch (Exception $e) {
watchdog('GlobalLink', 'Exception - %function - File[%file], Line[%line], Code[%code], Message[%message]', array(
'%function' => __FUNCTION__,
'%file' => $e
->getFile(),
'%line' => $e
->getLine(),
'%code' => $e
->getCode(),
'%message' => $e
->getMessage(),
), WATCHDOG_ERROR);
form_set_error('', t('Error: @message', array(
'@message' => $e
->getMessage(),
)));
}
break;
}
}