Core  3.2
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
freedom_processtoexec.php
Go to the documentation of this file.
1 <?php
2 /*
3  * @author Anakeen
4  * @package FDL
5 */
6 /**
7  * Interface to create new execution from batch
8  *
9  * @author Anakeen
10  * @version $Id: freedom_processtoexec.php,v 1.3 2008/08/14 09:59:14 eric Exp $
11  * @package FDL
12  * @subpackage
13  */
14 /**
15  */
16 
17 include_once ("FDL/Class.DocSearch.php");
18 include_once ("FDL/freedom_util.php");
19 include_once ("GENERIC/generic_util.php");
20 /**
21  * Interface to edit new process
22  * @param Action &$action current action
23  * @global string $id Http var : document identifier for process document
24  */
26 {
27  // -----------------------------------
28  // Get all the params
29  $docid = GetHttpVars("id"); // id doc to search
30  $dbaccess = $action->dbaccess;
31 
33  $action->lay->set("docid", $doc->id);
34  if ($doc->isAlive()) {
35  $la = $doc->GetActionAttributes();
36  if (count($la) == 0) $action->exitError(sprintf(_("no action found for %s document") , $doc->title));
37  if (count($la) == 1) {
38  $oa = current($la);
39  $ta["exec_application"] = $oa->wapplication;
40  $ta["exec_idref"] = $doc->id;
41  $ta["exec_ref"] = $doc->title . " (" . $oa->getLabel() . ")";
42 
43  $p = explode('&', $oa->waction);
44  $ta["exec_action"] = current($p);
45  next($p);
46  if ($oa->getOption("batchfolder") == "yes") $tp = array(
47  "wshfldid" => $doc->id
48  );
49  else $tp = array(
50  "id" => $doc->id
51  );
52  foreach ($p as $k => $v) {
53  list($var, $value) = explode("=", $v);
54  $tp[$var] = $value;
55  }
56  $ta["exec_idvar"] = implode("\n", array_keys($tp));
57  $ta["exec_valuevar"] = implode("\n", $tp);
58 
59  $url = "";
60  foreach ($ta as $k => $v) {
61  $url.= "&$k=" . urlencode($v);
62  }
63  $action->lay->set("url", sprintf("%s&app=GENERIC&action=GENERIC_EDIT&classid=EXEC%s", $action->GetParam("CORE_STANDURL") , $url));
64  } else {
65  $action->lay->set("url", sprintf("%s&app=FREEDOM&action=FREEDOM_CHOOSEACTION&id=%s", $action->GetParam("CORE_STANDURL") , $doc->id));
66  }
67  }
68 }
global $action
exitError($texterr, $exit=true, $code="")
$docid
Definition: cleanFamily.php:13
new_Doc($dbaccess, $id= '', $latest=false)
$dbaccess
Definition: checkVault.php:17
freedom_processtoexec(Action &$action)
$value
← centre documentaire © anakeen