function globallink_beans_dashboard_form_submit in GlobalLink Connect for Drupal 7.6
Same name and namespace in other branches
- 7.7 globallink_beans/globallink_beans_send.inc \globallink_beans_dashboard_form_submit()
Handles beans form submission.
File
- globallink_beans/
globallink_beans_send.inc, line 579
Code
function globallink_beans_dashboard_form_submit($form, &$form_state) {
$op = isset($form_state['values']['op']) ? $form_state['values']['op'] : '';
$submission_details = array();
if ($op != t('Send for Translation')) {
return;
}
try {
$pd4 = globallink_get_project_director_details();
$bids = array_filter($form_state['values']['table']);
$submission_name = $form_state['values']['submission_name'];
$source_locale = $form_state['values']['submission_source_locale'];
$target_locale_arr = $form_state['values']['submission_target_locale'];
$submission_details['instructions'] = $form_state['values']['submission_instructions'];
$submission_details['submitter'] = $form_state['values']['submission_submitter'];
$submission_priority = $form_state['values']['submission_pd_priority'];
foreach ($target_locale_arr as $key => $target) {
if ($target == FALSE) {
unset($target_locale_arr[$key]);
}
}
$due_date = globallink_convert_date_to_timestamp($form_state['values']['submission_due_date']);
$project_code = $form_state['values']['submission_pd_project'];
$updated_globalLink_arr = globallink_beans_send_for_translations($bids, $pd4, $submission_name, $due_date, $project_code, $source_locale, $target_locale_arr, $submission_details, $submission_priority);
if (count($updated_globalLink_arr) > 0) {
globallink_beans_update_ticket_id($updated_globalLink_arr, $project_code);
drupal_set_message(t('Content has been successfully sent for translations.'));
}
} catch (Exception $ex) {
form_set_error('', t('Error: @message', array(
'@message' => $ex
->getMessage(),
)));
}
}