16 include_once (
"FDL/Class.DocWait.php");
17 include_once (
"FDL/Class.Doc.php");
32 $wd =
new DocWait($doc->dbaccess, array(
38 $wd->localid = isset($doc->localid) ? $doc->localid : null;
39 $wd->values = serialize($doc->
getValues());
40 $wd->status = docWait::recording;
42 $wd->fromid = $doc->fromid;
43 $wd->refererid = $doc->id;
44 $wd->refererinitid = $doc->initid;
45 $wd->domain = $domainId;
47 $wd->date = date(
'Y-m-d H:i:s.u');
48 if ($extraData !== null) $wd->extradata = json_encode($extraData);
50 if ($wd->isAffected()) {
54 $ori = new_doc($doc->dbaccess, $doc->id,
true);
55 if ($ori->isAlive()) {
56 $wd->orivalues = serialize($ori->getValues());
57 $wd->status = docWait::upToDate;
62 $err = sprintf(_(
"waiting : document not set"));
78 if ($wd->isAffected()) {
92 $q->addQuery(sprintf(
"domain = %d", $domain));
93 $q->addQuery(sprintf(
"uid = %d",
$user));
94 $q->addQuery(
"localid is not null");
95 $q->addQuery(
"refererinitid < 0");
97 $res =
$q->Query(0, 0,
'TABLE');
100 foreach ($res as $k => $v) {
101 $out[$v[
'localid']] = $v[
'refererinitid'];
116 return $q->Query(0, 0,
'ITER');
126 $q->addQuery(sprintf(
"domain = %d", $domainId));
128 return $q->Query(0, 0,
'ITER');
150 $wheres[] = sprintf(
"domain = %d", $domain);
153 $wheres[] = sprintf(
"uid = %d",
$user);
155 if ($docinitid >= 0) {
156 $wheres[] = sprintf(
"refererinitid = %d", $docinitid);
159 if (count($wheres) == 0) {
static saveWaitingDoc(Doc &$doc, $domainId=null, $transaction=null, $extraData=null)
static getWaitingDocsByDomain($domainId)
getTitle($id="-1", $def="", $latest=false)
static clearWaitingDocs($domain=-1, $user=-1, $docinitid=-1)
static getWaitingDoc($id)
static getWaitingDocs($transaction)
simpleQuery($dbaccess, $query, &$result=array(), $singlecolumn=false, $singleresult=false, $useStrict=null)
if($file) if($subject==""&&$file) if($subject=="") $err
static getUnresolvedLocalLinks($domain=-1, $user=-1)