25 include_once (
"FDL/Lib.Attr.php");
26 include_once (
"FDL/Class.DocFam.php");
29 'autonext-color' =>
'#006400',
30 'arrow-label-font-color' =>
'#555555',
31 'arrow-color' =>
'#00008b',
32 'condition-color' =>
'#ffff00',
33 'action-color' =>
'#ffa500',
34 'mail-color' =>
'#a264d2',
35 'timer-color' =>
'#64a2d2',
36 'start-color' =>
'#0000ff',
42 print
"Database not found : param FREEDOM_DB";
60 $size =
"size=\"7.6,11!\";";
63 if (preg_match(
"/([0-9\.]+),([0-9\.]+)/",
$isize, $reg)) {
65 $fontsize = intval(min($reg[1], $reg[2]) / 2);
66 $size = sprintf(
"size=\"%.2f,%.2f!\";", floatval($reg[1]) / 2.55, floatval($reg[2]) / 2.55);
69 $size =
"size=\"$isize,$isize!\";";
82 foreach (
$doc->cycle as $k => $v) {
84 if (isset(
$doc->autonext[$v[
"e1"]]) && (
$doc->autonext[$v[
"e1"]] == $v[
"e2"])) {
85 $tmain = sprintf(
'color="%s",style="setlinewidth(3)",arrowsize=1.0',
$style[
'autonext-color']);
91 $act =
$doc->getActivity($v[
"e1"]);
92 if ($act && (
$tact[$v[
"e1"]] ==
"")) {
93 $tact[$v[
"e1"]] =
'act' . $k;
94 $line[] =
'"' . str_replace(
" ",
"\\n",
'act' . $k) .
'" [ label="' . $act .
'", fixedsize=false,shape=box,color="' .
$doc->getColor($v[
"e1"]) .
'" ];';
96 $line[] = sprintf(
'"%s" -> "%s" [labelfontcolor="%s",decorate=false, color="%s", labelfontname=sans, label="%s"];', str_replace(
" ",
"\\n", $e1) , str_replace(
" ",
"\\n",
'act' . $k) ,
$style[
'arrow-label-font-color'],
$style[
'arrow-color'],
"");
98 } elseif (
$tact[$v[
"e1"]] !=
"") {
99 $e1 =
$tact[$v[
"e1"]];
102 $m1 =
$doc->transitions[$v[
"t"]][
"m1"];
103 $m2 =
$doc->transitions[$v[
"t"]][
"m2"];
106 $tm =
$doc->getValue(
$doc->attrPrefix .
"_TRANS_TMID" . $v[
"t"]);
107 if ($tm) $ttrans[] = $tm;
108 $ttrans = array_merge($ttrans,
$doc->getTValue(
$doc->attrPrefix .
"_TRANS_PA_TMID" . $v[
"t"]));
109 $mtrans =
$doc->getTValue(
$doc->attrPrefix .
"_TRANS_MTID" . $v[
"t"]);
114 $line[] =
'"' . str_replace(
" ",
"\\n", $m1 . $k) .
'" [ label="' . $m1 .
'", fixedsize=false,shape=diamond,color="' .
$style[
'condition-color'] .
'" ];';
116 $line[] = sprintf(
'"%s" -> "%s" [labelfontcolor="%s",decorate=false, color="%s", labelfontname=sans, label="%s"];', str_replace(
" ",
"\\n", $e1) , str_replace(
" ",
"\\n", $m1 . $k) ,
$style[
'arrow-label-font-color'],
$style[
'arrow-color'], _($v[
"t"]));
120 $line[] =
'"' . str_replace(
" ",
"\\n", $m2 . $k) .
'" [ label="' . $m2 .
'",fixedsize=false,shape=box,color="' .
$style[
'action-color'] .
'"];';
121 $line[] = sprintf(
'"%s" -> "%s" [labelfontcolor="%s",decorate=false, color="%s", labelfontname=sans];', str_replace(
" ",
"\\n", $e1) , str_replace(
" ",
"\\n", $m2 . $k) ,
$style[
'arrow-label-font-color'],
$style[
'arrow-color']);
125 if (count($mtrans) > 0) {
129 $tmlabel = str_replace(array(
132 ) ,
"\\n",
$doc->getHtmlValue(
$doc->getAttribute(
$doc->attrPrefix .
"_TRANS_MTID" . $v[
"t"]) ,
$doc->_array2val($mtrans) ,
'_self',
false));
134 $line[] =
'"' . str_replace(
" ",
"\\n", $ex) .
'" [ label="' . $tmlabel .
'",fixedsize=false,style=bold,shape=house,color="' .
$style[
'mail-color'] .
'"' . $timgt .
' ];';
135 $line[] = sprintf(
'"%s" -> "%s" [labelfontcolor="%s",decorate=false, color="%s",labelfontname=sans];', str_replace(
" ",
"\\n", $e1) , str_replace(
" ",
"\\n", $ex) ,
$style[
'arrow-label-font-color'],
$style[
'arrow-color']);
139 $aid = strtolower(
$doc->attrPrefix .
"_MTID" . $v[
"e2"]);
140 $mt =
$doc->getTValue($aid);
141 if (count($mt) > 0) {
144 $tmlabel = str_replace(array(
147 ) ,
"\\n",
$doc->getHtmlValue(
$doc->getAttribute(
$doc->attrPrefix .
"_MTID" . $v[
"e2"]) ,
$doc->_array2val($mt) ,
'_self',
false));
149 $line[] =
'"' . str_replace(
" ",
"\\n", $ex) .
'" [ label="' . $tmlabel .
'",fixedsize=false,style=bold,shape=house,color="' .
$style[
'mail-color'] .
'"' . $timgt .
' ];';
150 $line[] = sprintf(
'"%s" -> "%s" [labelfontcolor="%s",decorate=false, color="%s", labelfontname=sans];', str_replace(
" ",
"\\n", $e1) , str_replace(
" ",
"\\n", $ex) ,
$style[
'arrow-label-font-color'],
$style[
'arrow-color']);
154 $aid = strtolower(
$doc->attrPrefix .
"_TMID" . $v[
"e2"]);
155 $mt =
$doc->getTValue($aid);
156 if (count($mt) > 0) {
158 $tmlabel = str_replace(array(
161 ) ,
"\\n",
$doc->getHtmlValue(
$doc->getAttribute(
$doc->attrPrefix .
"_TMID" . $v[
"e2"]) ,
$doc->_array2val($mt) ,
'_self',
false));
163 $line[] =
'"' . str_replace(
" ",
"\\n", $ex) .
'" [ label="' . $tmlabel .
'",fixedsize=false,style=bold,shape=octagon,color="' .
$style[
'timer-color'] .
'"' . $timgt .
' ];';
164 $line[] = sprintf(
'"%s" -> "%s" [labelfontcolor="%s",decorate=false, color="%s",labelfontname=sans];', str_replace(
" ",
"\\n", $e1) , str_replace(
" ",
"\\n", $ex) ,
$style[
'arrow-label-font-color'],
$style[
'arrow-color']);
167 if (count($ttrans) > 0) {
170 $tmlabel = str_replace(array(
173 ) ,
"\\n",
$doc->getHtmlValue(
$doc->getAttribute(
$doc->attrPrefix .
"_TRANS_MTID" . $v[
"t"]) ,
$doc->_array2val($ttrans) ,
'_self',
false));
175 $line[] =
'"' . str_replace(
" ",
"\\n", $ex) .
'" [ label="' . $tmlabel .
'",fixedsize=false,style=bold,shape=octagon,color="' .
$style[
'timer-color'] .
'"' . $timgt .
' ];';
176 $line[] = sprintf(
'"%s" -> "%s" [labelfontcolor="%s",decorate=false, color="%s",labelfontname=sans];', str_replace(
" ",
"\\n", $e1) , str_replace(
" ",
"\\n", $ex) ,
$style[
'arrow-label-font-color'],
$style[
'arrow-color']);
180 $line[] = sprintf(
'"%s" -> "%s" [labelfontcolor="%s",decorate=false, color="%s", labelfontname=sans,label="%s" %s];', str_replace(
" ",
"\\n", $e1) , str_replace(
" ",
"\\n", $e2) ,
$style[
'arrow-label-font-color'],
$style[
'arrow-color'], _($v[
"t"]) , $tmain);
184 $act =
$doc->getActivity($v[
"e1"]);
185 if (
$type ==
"activity") {
186 if ($act && (
$tact[$v[
"e1"]] ==
"")) {
187 $tact[$v[
"e1"]] =
'act' . $k;
188 $line[] =
'"' . str_replace(
" ",
"\\n",
'act' . $k) .
'" [ label="' . $act .
'", fixedsize=false,shape=box,color="' .
$doc->getColor($v[
"e1"]) .
'" ];';
190 $line[] = sprintf(
'"%s" -> "%s" [labelfontcolor="%s",decorate=false, color="%s", labelfontname=sans, label="%s"];', str_replace(
" ",
"\\n", $e1) , str_replace(
" ",
"\\n",
'act' . $k) ,
$style[
'arrow-label-font-color'],
$style[
'arrow-color'],
"");
192 } elseif (
$tact[$v[
"e1"]] !=
"") {
193 $e1 =
$tact[$v[
"e1"]];
196 $line[] = sprintf(
'"%s" -> "%s" [labelfontsize=6,color="%s" %s,labelfontname=sans, label="%s"];', str_replace(
" ",
"\\n", $e1) , str_replace(
" ",
"\\n", $e2) ,
$style[
'arrow-color'], $tmain, (
$type ==
"activity") ? _($v[
"t"]) :
"");
199 $line[] =
'"' . str_replace(
" ",
"\\n", _(
$doc->firstState)) .
'" [shape = doublecircle,style=filled, width=1.5, fixedsize=true,fontname=sans];';
202 $aid = strtolower(
$doc->attrPrefix .
"_TMID" .
$doc->firstState);
203 $tm =
$doc->getTValue($aid);
204 $aid = strtolower(
$doc->attrPrefix .
"_MTID" .
$doc->firstState);
205 $mt =
$doc->getTValue($aid);
207 if ((count($tm) > 0) || (count($mt) > 0)) {
208 $line[] =
'"' . str_replace(
" ",
"\\n", $e1) .
'" [shape = point,style=filled, width=0.3, fixedsize=true,fontname=sans,color="' .
$style[
'start-color'] .
'"];';;
211 if (count($tm) > 0) {
214 $tmlabel = str_replace(array(
217 ) ,
"\\n",
$doc->getHtmlValue(
$doc->getAttribute(
$doc->attrPrefix .
"_TMID" .
$doc->firstState) ,
$doc->_array2val($tm) ,
'_self',
false));
219 $line[] =
'"' . str_replace(
" ",
"\\n", $e2) .
'" [ label="' . $tmlabel .
'",fixedsize=false,style=bold,shape=octagon,color="' .
$style[
'timer-color'] .
'", fontsize=' .
$conditionfontsize . $timgt .
' ];';
220 $line[] = sprintf(
'"%s" -> "%s" [labelfontcolor="%s",decorate=false, color="%s", labelfontname=sans];', str_replace(
" ",
"\\n", $e1) , str_replace(
" ",
"\\n", $e2) ,
$style[
'arrow-label-font-color'],
$style[
'arrow-color']);
223 if (count($mt) > 0) {
225 $tmlabel = str_replace(array(
228 ) ,
"\\n",
$doc->getHtmlValue(
$doc->getAttribute(
$doc->attrPrefix .
"_MTID" .
$doc->firstState) ,
$doc->_array2val($mt) ,
'_self',
false));
230 $line[] =
'"' . str_replace(
" ",
"\\n", $e2) .
'" [ label="' . $tmlabel .
'",fixedsize=false,style=bold,shape=house,color="' .
$style[
'mail-color'] .
'", fontsize=' .
$conditionfontsize . $timgt .
' ];';
231 $line[] = sprintf(
'"%s" -> "%s" [labelfontcolor="%s",decorate=false, color="%s", labelfontname=sans];', str_replace(
" ",
"\\n", $e1) , str_replace(
" ",
"\\n", $e2) ,
$style[
'arrow-label-font-color'],
$style[
'arrow-color']);
237 $e2 = _(
$doc->firstState);
238 $line[] = sprintf(
'"%s" -> "%s" [labelfontcolor="%s",decorate=false, color="%s", labelfontname=sans];', str_replace(
" ",
"\\n", $e1) , str_replace(
" ",
"\\n", $e2) ,
$style[
'arrow-label-font-color'],
$style[
'arrow-color']);
242 foreach (
$states as $k => $v) {
243 $color =
$doc->getColor($v);
244 $saction =
$doc->getActivity($v);
245 if ($saction) $tt =
', tooltip="' . $saction .
'"';
248 if ($color)
$line[] =
'"' . str_replace(
" ",
"\\n", _($v)) .
'" [fillcolor="' . $color .
'"' . $tt .
' ];';
250 if ($tt) $tt = substr($tt, 2);
251 $line[] =
'"' . str_replace(
" ",
"\\n", _($v)) .
'" [' . $tt .
'];';
255 $ft = str_replace(
" ",
'\n', _(
$doc->firstState));
261 bgcolor=\"transparent\";
264 node [shape = circle, style=filled, fixedsize=true,width=1.5, fontname=sans];\n";