function globallink_send_documents_for_translation_to_pd in GlobalLink Connect for Drupal 7.5
Same name and namespace in other branches
- 7.7 gl_ws/gl_ws_send_translations.inc \globallink_send_documents_for_translation_to_pd()
- 7.6 gl_ws/gl_ws_send_translations.inc \globallink_send_documents_for_translation_to_pd()
7 calls to globallink_send_documents_for_translation_to_pd()
- globallink_block_send_blocks_for_translations in globallink_block/
globallink_block.inc - Sends blocks for translation.
- globallink_entity_send_for_translations in globallink_entity/
globallink_entity.inc - Sends entities for translation.
- globallink_fieldable_panels_pane_send_for_translations in globallink_fieldable_panels/
globallink_fieldable_panels.inc - Sends fieldable panels for translation.
- globallink_menu_send_for_translations in globallink_menu/
globallink_menu.inc - Sends menus for translation.
- globallink_send_for_translations in ./
globallink_node.inc - Sends content to GlobalLink for translation.
File
- gl_ws/
gl_ws_send_translations.inc, line 14
Code
function globallink_send_documents_for_translation_to_pd(&$globallink_arr, $pd_obj, $project_code, $submitter) {
$username = $pd_obj->username;
$password = $pd_obj->password;
$url = $pd_obj->url;
$project_short_code = $project_code;
$session_service = new SessionService2(GL_WSDL_PATH . 'SessionService2.wsdl', array(
'location' => $url . '/services/SessionService2',
));
$project_service = new ProjectService2(GL_WSDL_PATH . 'ProjectService2.wsdl', array(
'location' => $url . '/services/ProjectService2',
));
$document_service = new DocumentService2(GL_WSDL_PATH . 'DocumentService2.wsdl', array(
'location' => $url . '/services/DocumentService2',
));
$submission_service = new SubmissionService2(GL_WSDL_PATH . 'SubmissionService2.wsdl', array(
'location' => $url . '/services/SubmissionService2',
));
$GLOBALS['g_submissionTicket'] = '';
$GLOBALS['g_document_count'] = 0;
$client_identifier = $project_short_code . REQUEST_TIME;
$token = globallink_login($session_service, $username, $password);
$project = globallink_find_project_by_short_code($project_service, $project_short_code, $token);
$submission_info = globallink_create_submission_info($project->ticket, $client_identifier, $submitter);
$count = 0;
foreach ($globallink_arr as $globallink) {
$count++;
$submission_info->name = $globallink->submissionName;
$date_requested = new Date();
$date_requested->date = $globallink->dueDate;
$date_requested->critical = FALSE;
$submission_info->dateRequested = $date_requested;
$resource_info = globallink_create_resource_info($client_identifier, $pd_obj, $globallink);
$document_info = globallink_create_document_info($project->ticket, $globallink, $client_identifier);
if (!is_null($GLOBALS['g_submissionTicket']) && $GLOBALS['g_submissionTicket'] != '') {
$document_info->submissionTicket = $GLOBALS['g_submissionTicket'];
}
globallink_submit_document_with_binary_resource($document_service, $resource_info, $document_info, $globallink, $token);
$GLOBALS['g_submissionTicket'] = $globallink->submissionTicket;
$GLOBALS['g_document_count'] = $count;
}
globallink_start_submission($submission_service, $submission_info, $token);
}