Platform  3.1
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  * @license http://creativecommons.org/licenses/by-nc-sa/2.0/fr/ Anakeen - licence CC
5  * @package FDL
6 */
7 /**
8  * Interface to create new execution from batch
9  *
10  * @author Anakeen 2000
11  * @version $Id: freedom_processtoexec.php,v 1.3 2008/08/14 09:59:14 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.DocSearch.php");
20 include_once ("FDL/freedom_util.php");
21 include_once ("GENERIC/generic_util.php");
22 /**
23  * Interface to edit new process
24  * @param Action &$action current action
25  * @global id Http var : document identificator for process document
26  */
28 {
29  // -----------------------------------
30  // Get all the params
31  $docid = GetHttpVars("id"); // id doc to search
32  $action->lay->set("docid", $docid);
33 
34  $dbaccess = $action->GetParam("FREEDOM_DB");
35 
37  if ($doc->isAlive()) {
38  $la = $doc->GetActionAttributes();
39  if (count($la) == 0) $action - exitError(_("no action found for %s document") , $doc->title);
40  if (count($la) == 1) {
41  $oa = current($la);
42  $ta["exec_application"] = $oa->wapplication;
43  $ta["exec_idref"] = $doc->id;
44  $ta["exec_ref"] = $doc->title . " (" . $oa->getLabel() . ")";
45 
46  $p = explode('&', $oa->waction);
47  $ta["exec_action"] = current($p);
48  next($p);
49  if ($oa->getOption("batchfolder") == "yes") $tp = array(
50  "wshfldid" => $doc->id
51  );
52  else $tp = array(
53  "id" => $doc->id
54  );
55  while (list($k, $v) = each($p)) {
56  list($var, $value) = explode("=", $v);
57  $tp[$var] = $value;
58  }
59  $ta["exec_idvar"] = implode("\n", array_keys($tp));
60  $ta["exec_valuevar"] = implode("\n", $tp);
61 
62  $url = "";
63  foreach ($ta as $k => $v) {
64  $url.= "&$k=" . urlencode($v);
65  }
66  $action->lay->set("url", sprintf("%s&app=GENERIC&action=GENERIC_EDIT&classid=EXEC%s", $action->GetParam("CORE_STANDURL") , $url));
67  } else {
68  $action->lay->set("url", sprintf("%s&app=FREEDOM&action=FREEDOM_CHOOSEACTION&id=%s", $action->GetParam("CORE_STANDURL") , $doc->id));
69  }
70  }
71 }
72 ?>
← centre documentaire © anakeen - published under CC License - Dynacase