36 AddWarningMsg(sprintf(_(
"Error : need edit privilege to execute")));
38 if (ini_get(
"max_execution_time") < 3600) ini_set(
"max_execution_time", 3600);
40 $cmd.=
" --api=fdl_execute";
43 $cmd.=
" --userid=" . $this->userid;
45 system(
$cmd, $status);
46 if ($status == 0)
AddWarningMsg(sprintf(_(
"Process %s [%d] executed") , $this->title, $this->
id));
47 else AddWarningMsg(sprintf(_(
"Error : Process %s [%d]: status %d") , $this->title, $this->
id, $status));
54 $this->deleteValue(
"exec_status");
55 $this->deleteValue(
"exec_statusdate");
62 if ($this->getvalue(
"exec_status") ==
"progressing")
return MENU_ACTIVE;
75 $bgapp = $this->
getValue(
"exec_application");
76 $bgact = $this->
getValue(
"exec_action");
77 $bgapi = $this->
getValue(
"exec_api");
83 $fuid = $this->
getValue(
"exec_iduser");
84 $fu =
getTDoc($this->dbaccess, $fuid);
85 $wuid = $fu[
"us_whatid"];
86 $this->execuserid = $fuid;
88 $wuid = $this->userid;
91 $cmd.=
" --userid=$wuid";
92 if (!$bgapi)
$cmd.= sprintf(
" --app=%s --action=%s", escapeshellarg($bgapp) , escapeshellarg($bgact));
93 else $cmd.= sprintf(
" --api=%s", escapeshellarg($bgapi));
95 foreach ($tp as $k => $v) {
96 $b = sprintf(
" --%s=%s", escapeshellarg($v[
"exec_idvar"]) , escapeshellarg($v[
"exec_valuevar"]));
107 return $this->execuserid;
115 $ndh = $this->
getValue(
"exec_handnextdate");
117 $nday = $this->
getValue(
"exec_periodday", 0);
118 $nhour = $this->
getValue(
"exec_periodhour", 0);
119 $nmin = $this->
getValue(
"exec_periodmin", 0);
120 if (($nday + $nhour + $nmin) > 0) {
121 $ndh = $this->
getDate($nday, $nhour, $nmin);
133 $td =
getTDoc($this->dbaccess, $pid);
134 $ndh =
getv($td,
"exec_date");
149 $err = $this->control(
'edit');