18 include_once (
"FDL/Class.DocWait.php");
19 include_once (
"FDL/Class.Doc.php");
34 $wd =
new DocWait($doc->dbaccess, array(
40 $wd->localid = $doc->localid;
41 $wd->values = serialize($doc->
getValues());
42 $wd->status = docWait::recording;
44 $wd->fromid = $doc->fromid;
45 $wd->refererid = $doc->id;
46 $wd->refererinitid = $doc->initid;
47 $wd->domain = $domainId;
48 $wd->transaction = $transaction;
49 $wd->date = date(
'Y-m-d H:i:s.u');
50 if ($extraData !== null) $wd->extradata = json_encode($extraData);
52 if ($wd->isAffected()) {
56 $ori = new_doc($doc->dbaccess, $doc->id,
true);
57 if ($ori->isAlive()) {
58 $wd->orivalues = serialize($ori->getValues());
59 $wd->status = docWait::upToDate;
64 $err = sprintf(_(
"waiting : document not set"));
80 if ($wd->isAffected()) {
94 $q->addQuery(sprintf(
"domain = %d", $domain));
95 $q->addQuery(sprintf(
"uid = %d",
$user));
96 $q->addQuery(
"localid is not null");
97 $q->addQuery(
"refererinitid < 0");
99 $res =
$q->Query(0, 0,
'TABLE');
101 if (is_array($res)) {
102 foreach ($res as $k => $v) {
103 $out[$v[
'localid']] = $v[
'refererinitid'];
116 $q->addQuery(sprintf(
"transaction = %d", $transaction));
118 return $q->Query(0, 0,
'ITER');
128 $q->addQuery(sprintf(
"domain = %d", $domainId));
130 return $q->Query(0, 0,
'ITER');
152 $wheres[] = sprintf(
"domain = %d", $domain);
155 $wheres[] = sprintf(
"uid = %d",
$user);
157 if ($docinitid >= 0) {
158 $wheres[] = sprintf(
"refererinitid = %d", $docinitid);
161 if (count($wheres) == 0) {