Core  3.2
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  * @package FDL
5 */
6 /**
7  * retrieve task status
8  */
9 
10 include_once ("FDL/Class.Doc.php");
11 /**
12  * retrieve task status
13  * @param Action &$action current action
14  * @throws Dcp\Db\Exception
15  * @global string $tid Http var : task identifier
16  */
18 {
19  $tid = GetHttpVars("tid");
20 
21  header('Content-type: text/xml; charset=utf-8');
22 
23  $action->lay->set("CODE", "KO");
24  $tea = getParam("TE_ACTIVATE");
25  if ($tea != "yes") return;
26 
27  global $action;
28  include_once ("FDL/Class.TaskRequest.php");
29 
30  $ot = new \Dcp\TransformationEngine\Client(getParam("TE_HOST") , getParam("TE_PORT"));
31  $err = $ot->getInfo($tid, $info);
32  if ($err == "") {
33  $action->lay->set("tid", $info["tid"]);
34  $action->lay->set("status", $info["status"]);
35  $action->lay->set("engine", $info["engine"]);
36  switch ($info["status"]) {
37  case 'P':
38  $statusmsg = _("File:: Processing");
39  break;
40 
41  case 'W':
42  $statusmsg = _("File:: Waiting");
43  break;
44 
45  case 'D':
46  $statusmsg = _("File:: converted");
47  break;
48 
49  case 'K':
50  $statusmsg = _("File:: failed");
51  break;
52 
53  default:
54  $statusmsg = $info["status"];
55  }
56 
57  $action->lay->set("statusmsg", $statusmsg);
58  $action->lay->set("message", $info["comment"]);
59  $action->lay->set("CODE", "OK");
60  }
61 
62  $action->lay->set("warning", $err);
63 }
global $action
getParam($name, $def="")
must be in core or global type
Definition: Lib.Common.php:193
getfiletransstatus(Action &$action)
$info
Definition: geticon.php:30
if($file) if($subject==""&&$file) if($subject=="") $err
← centre documentaire © anakeen