Platform  3.1
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
getfiletransstatus.php
Go to the documentation of this file.
1 <?php
2 /*
3  * @author Anakeen
4  * @license http://creativecommons.org/licenses/by-nc-sa/2.0/fr/ Anakeen - licence CC
5  * @package FDL
6 */
7 /**
8  * retrieve task status
9  *
10  * @author Anakeen 2008
11  * @version $Id: getfiletransstatus.php,v 1.1 2008/01/03 09:05:13 eric Exp $
12  * @license http://creativecommons.org/licenses/by-nc-sa/2.0/fr/ Anakeen - licence CC
13  * @package FDL
14  * @subpackage
15  */
16 /**
17  */
18 
19 include_once ("FDL/Class.Doc.php");
20 /**
21  * retrieve task status
22  * @param Action &$action current action
23  * @global tid Http var : task identificator
24  */
26 {
27  $tid = GetHttpVars("tid");
28  $dbaccess = $action->GetParam("FREEDOM_DB");
29 
30  header('Content-type: text/xml; charset=utf-8');
31  $action->lay->setEncoding("utf-8");
32 
33  $action->lay->set("CODE", "KO");
34  $tea = getParam("TE_ACTIVATE");
35  if ($tea != "yes") return;
36  if (@include_once ("WHAT/Class.TEClient.php")) {
37  global $action;
38  include_once ("FDL/Class.TaskRequest.php");
39 
40  $callback = "";
41  $ot = new TransformationEngine(getParam("TE_HOST") , getParam("TE_PORT"));
42  $err = $ot->getInfo($tid, $info);
43  if ($err == "") {
44  $action->lay->set("tid", $info["tid"]);
45  $action->lay->set("status", $info["status"]);
46  $action->lay->set("engine", $info["engine"]);
47  switch ($info["status"]) {
48  case 'P':
49  $statusmsg = _("File:: Processing");
50  break;
51 
52  case 'W':
53  $statusmsg = _("File:: Waiting");
54  break;
55 
56  case 'D':
57  $statusmsg = _("File:: converted");
58  break;
59 
60  case 'K':
61  $statusmsg = _("File:: failed");
62  break;
63 
64  default:
65  $statusmsg = $info["status"];
66  }
67 
68  $action->lay->set("statusmsg", $statusmsg);
69  $action->lay->set("message", $info["comment"]);
70  $action->lay->set("CODE", "OK");
71  }
72  } else {
73  AddWarningMsg(_("TE engine activate but TE-CLIENT not found"));
74  }
75 
76  $action->lay->set("warning", $err);
77 }
78 ?>
← centre documentaire © anakeen - published under CC License - Dynacase