Core  3.2
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
batchexec.php
Go to the documentation of this file.
1 <?php
2 /*
3  * @author Anakeen
4  * @package FDL
5 */
6 /**
7  * Execute an action in a batch documents
8  *
9  * @author Anakeen
10  * @version $Id: batchexec.php,v 1.1 2005/09/09 16:25:46 eric Exp $
11  * @package FDL
12  * @subpackage
13  */
14 /**
15  */
16 
17 include_once ("FDL/Class.Dir.php");
18 /**
19  * Batch execute
20  * @param Action &$action current action
21  * @global id int Http var : document identifier folder
22  * @global saction string Http var : action name to execute
23  * @global sapp string Http var : app name to execute
24  */
26 {
27  // -----------------------------------
28  $docid = GetHttpVars("id");
29  $latest = GetHttpVars("latest");
30  $saction = GetHttpVars("saction");
31  $sapp = GetHttpVars("sapp");
32  $dbaccess = $action->dbaccess;
33  /*
34  * @var Dir $doc
35  */
37  if (!$doc->isAlive()) $action->exitError(sprintf(_("batcexec aborted\ndocument [%s] not found") , $docid));
38 
39  $l = $doc->getContent();
40 
41  $de = createDoc($dbaccess, "EXEC");
42  if (!$de) $action->exitError(sprintf(_("no privilege to create this kind (%d) of document") , "EXEC"));
43 
44  $de->setValue("exec_idref", $doc->id);
45  $de->setValue("exec_ref", $doc->title);
46  $de->setValue("exec_application", $sapp);
47  $de->setValue("exec_action", $saction);
48  $de->setValue("exec_idvar", array(
49  "wshfldid"
50  ));
51  $de->setValue("exec_valuevar", array(
52  $doc->initid
53  ));
54 
55  $err = $de->Add();
56  if ($err != "") $action->exitError($err);
57 
58  redirect($action, "FDL", "FDL_METHOD&method=bgExecute&id=" . $de->id, $action->GetParam("CORE_STANDURL"));
59 }
global $action
exitError($texterr, $exit=true, $code="")
$docid
Definition: cleanFamily.php:13
createDoc($dbaccess, $fromid, $control=true, $defaultvalues=true, $temporary=false)
new_Doc($dbaccess, $id= '', $latest=false)
$dbaccess
Definition: checkVault.php:17
if($file) if($subject==""&&$file) if($subject=="") $err
batchexec(Action &$action)
Definition: batchexec.php:25
$latest
← centre documentaire © anakeen