You are here

function globallink_cancel_select_documents in GlobalLink Connect for Drupal 7.6

Same name and namespace in other branches
  1. 7.5 gl_ws/gl_ws_common.inc \globallink_cancel_select_documents()
9 calls to globallink_cancel_select_documents()
globallink_beans_cancel_records in globallink_beans/globallink_beans.inc
Cancels beans records.
globallink_block_cancel_records in globallink_block/globallink_block.inc
Cancels block records.
globallink_cancel_select_records in ./globallink_node.inc
Cancels select records.
globallink_entity_cancel_select_records in globallink_entity/globallink_entity.inc
Cancels entity records.
globallink_fieldable_panels_cancel_records in globallink_fieldable_panels/globallink_fieldable_panels.inc
Cancels fieldable panels records.

... See full list

File

gl_ws/gl_ws_common.inc, line 147

Code

function globallink_cancel_select_documents($pd_obj, &$globallink_arr) {
  $username = $pd_obj->username;
  $password = $pd_obj->password;
  $url = $pd_obj->url;
  $session_service = new SessionService2(GL_WSDL_PATH . 'SessionService2.wsdl', array(
    'location' => $url . '/services/SessionService2',
  ));
  $target_service = new TargetService2(GL_WSDL_PATH . 'TargetService2.wsdl', array(
    'location' => $url . '/services/TargetService2',
  ));
  $token = globallink_login($session_service, $username, $password);
  foreach ($globallink_arr as $globallink) {
    $cancel_target_submission = new cancelTargetByDocumentId();
    $document_ticket = new DocumentTicket();
    $document_ticket->submissionTicket = $globallink->submissionTicket;
    $document_ticket->ticketId = $globallink->documentTicket;
    $cancel_target_submission->documentId = $document_ticket;
    $cancel_target_submission->targetLocale = $globallink->targetLocale;
    $cancel_target_submission->userId = $token;
    $target_service
      ->cancelTargetByDocumentId($cancel_target_submission);
    $globallink->cancelled = TRUE;
  }
}