Platform  3.1
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  * @license http://creativecommons.org/licenses/by-nc-sa/2.0/fr/ Anakeen - licence CC
5  * @package FDL
6 */
7 /**
8  * Execute an action in a batch documents
9  *
10  * @author Anakeen 2005
11  * @version $Id: batchexec.php,v 1.1 2005/09/09 16:25:46 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.Dir.php");
20 /**
21  * Batch execute
22  * @param Action &$action current action
23  * @global id Http var : document identificator folder
24  * @global saction Http var : action name to execute
25  * @global sapp Http var : app name to execute
26  */
27 function batchexec(&$action)
28 {
29  // -----------------------------------
30  $docid = GetHttpVars("id");
31  $latest = GetHttpVars("latest");
32  $saction = GetHttpVars("saction");
33  $sapp = GetHttpVars("sapp");
34  $dbaccess = $action->GetParam("FREEDOM_DB");
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 }
60 ?>
← centre documentaire © anakeen - published under CC License - Dynacase