17 include_once (
"FDL/Class.Dir.php");
26 $docid1 = GetHttpVars(
"id1");
27 $docid2 = GetHttpVars(
"id2");
28 if (intval($docid1) > intval($docid2)) {
29 $docid2 = GetHttpVars(
"id1");
30 $docid1 = GetHttpVars(
"id2");
34 if (!
$d1->isAffected()) {
35 $action->exitError(sprintf(_(
"Document %s not found") , $docid1));
40 if (!
$d2->isAffected()) {
41 $action->exitError(sprintf(_(
"Document %s not found") , $docid2));
46 if (
$d1->fromid !=
$d2->fromid)
$action->exitError(sprintf(_(
"cannot compare two document which comes from two different family")));
48 $la =
$d1->GetNormalAttributes();
51 foreach (
$la as $k =>
$a) {
53 if (
$a->type ==
"array") {
54 $v1 =
$d1->getArrayRawValues(
$a->id);
55 $v2 =
$d2->getArrayRawValues(
$a->id);
56 if ($v1 == $v2) $cdiff =
"eq";
59 $v1 =
$d1->getRawValue(
$a->id);
60 $v2 =
$d2->getRawValue(
$a->id);
61 if ($v1 == $v2) $cdiff =
"eq";
65 if (
$a->visibility ==
"H") $vdiff =
"hi";
72 $tattr[
$a->id] = array(
73 "attname" => htmlspecialchars(
$a->getLabel() , ENT_QUOTES) ,
74 "v1" => sprintf(
"<img src=\"%s\">",
$d1->getHtmlValue(
$a, $v1)) ,
75 "v2" => sprintf(
"<img src=\"%s\">",
$d2->getHtmlValue(
$a, $v2)) ,
76 "cdiff" => htmlspecialchars($cdiff, ENT_QUOTES) ,
77 "vdiff" => htmlspecialchars($vdiff, ENT_QUOTES) ,
78 "EQ" => ($cdiff ==
"eq")
83 $tattr[
$a->id] = array(
84 "attname" => htmlspecialchars(
$a->getLabel() , ENT_QUOTES) ,
85 "v1" =>
$d1->getHtmlValue(
$a, $v1) ,
86 "v2" =>
$d2->getHtmlValue(
$a, $v2) ,
87 "cdiff" => htmlspecialchars($cdiff, ENT_QUOTES) ,
88 "vdiff" => htmlspecialchars($vdiff, ENT_QUOTES) ,
89 "EQ" => ($cdiff ==
"eq")
95 $action->parent->AddJsRef(
$action->GetParam(
"CORE_JSURL") .
"/subwindow.js");
96 $action->parent->AddJsRef(
$action->GetParam(
"CORE_PUBURL") .
"/FDL/Layout/common.js");
99 $action->lay->eSet(
"date1", strftime(
"%a %d %b %Y %H:%M",
$d1->revdate));
101 $action->lay->eSet(
"revision1",
$d1->revision);
105 $action->lay->eSet(
"date2", strftime(
"%a %d %b %Y %H:%M",
$d2->revdate));
107 $action->lay->eSet(
"revision2",
$d2->revision);
109 $action->lay->rSet(
"title", sprintf(_(
"comparison between<br>%s (rev %d) and %s (rev %d)") ,
$d1->getHTMLTitle() , htmlspecialchars(
$d1->revision, ENT_QUOTES) ,
$d2->getHTMLTitle() , htmlspecialchars(
$d2->revision, ENT_QUOTES)));
111 $action->lay->setBlockData(
"ATTRS", $tattr);
print< H1 > Check Database< i > $dbaccess</i ></H1 > $a
if($file) if($subject==""&&$file) if($subject=="") $err