19 include_once (
"FDL/Class.Doc.php");
20 include_once (
"FDL/Class.DocAttr.php");
21 include_once (
"FDL/Lib.Attr.php");
22 include_once (
"FDL/Class.DocFam.php");
23 include_once (
"FDL/freedom_util.php");
55 $doc->title = _(
"new familly document");
64 $doc->profid = $cdoc->cprofid;
84 $oattr0->docid =
$doc->initid;
87 while (list($k, $v) = each($orders)) {
89 if ($names[$k] !=
"") {
90 if ($attrids[$k] ==
"") {
92 $oattr->isset =
false;
93 $oattr->id = $nattrids[$k];
97 strtolower($attrids[$k])
101 ':' . strtolower($attrids[$k])
105 if ($oattr->id ==
"") print
"Error line $k";
107 $oattr->labeltext = stripslashes($names[$k]);
108 $oattr->title = isset($titles[$k]) ? $titles[$k] :
"N";
109 $oattr->abstract = isset($abstracts[$k]) ? $abstracts[$k] :
"N";
110 $oattr->needed = isset($needed[$k]) ? $needed[$k] :
"N";
111 $oattr->type = stripslashes($types[$k]);
112 $oattr->frameid = isset($frameids[$k]) ? $frameids[$k] :
"0";
113 $oattr->ordered = isset($orders[$k]) ? $orders[$k] :
"999";
114 $oattr->visibility = $visibilities[$k];
115 $oattr->link = stripslashes($links[$k]);
116 $oattr->phpfile = $phpfiles[$k];
117 $oattr->phpfunc = stripslashes($phpfuncs[$k]);
118 $oattr->elink = stripslashes($elinks[$k]);
119 $oattr->phpconstraint = stripslashes($phpconstraint[$k]);
120 $oattr->options = stripslashes($options[$k]);
121 $oattr->usefor =
'N';
122 if (!$oattr->isAffected()) {
124 if (isset($nattrids[$k]) && ($nattrids[$k] !=
"")) $oattr->id = $nattrids[$k];
125 $err = $oattr->Add();
126 if (
$err ==
"") $tadd[] = $oattr->id;
131 $err = $oattr->Modify();
132 if (
$err ==
"") $tmod[] = $oattr->id;
137 if (count($tmod) > 0)
$doc->AddComment(_(
"Modify Attributes") ,
HISTO_INFO,
"MODATTR");
138 if (count($tadd) > 0)
$doc->AddComment(sprintf(_(
"Add Attributes : %s") , implode(
", ", $tadd)) ,
HISTO_INFO,
"MODATTR");
140 $cmd = $wsh .
"--userid={$action->user->id} --api=fdl_adoc --docid=" .
$doc->initid;
147 redirect(
$action,
"FDL",
"FDL_CARD&id=" .
$doc->id,
$action->GetParam(
"CORE_STANDURL"));