17 include_once (
"FDL/Class.Doc.php");
18 include_once (
"FDL/Class.Dir.php");
19 include_once (
"FDL/Class.DocAttr.php");
20 include_once (
"FDL/freedom_util.php");
25 $docid = GetHttpVars(
"targetid");
26 $famid = GetHttpVars(
"famid");
27 $attrid = GetHttpVars(
"attrid");
28 $redirid = GetHttpVars(
"redirid");
30 if (
$docid == 0) $action->
exitError(_(
"the document is not referenced: cannot apply profile access modification"));
35 if ($attrid !=
"cprofid") {
36 $oa =
$doc->getAttribute($attrid);
37 if (!$oa) $action->
exitError(sprintf(_(
"attribut %s not found for document %s [%d]") , $attrid,
$doc->getTitle() ,
$doc->id));
41 if (
$err !=
"") $action->ExitError(
$err);
45 switch ($tmpdoc->defDoctype) {
59 $action->
exitError(_(
"Automatic profil creation not possible for this kind of family"));
63 if (!$pdoc) $action->
exitError(
"not allowed to create profil");
65 $pdoc->setValue(
"ba_title", sprintf(_(
"For %s of %s") , $oa ? $oa->getLabel() : _(
"document creation") ,
$doc->title));
69 $err = $pdoc->setControl($pdoc->id);
74 if ($oa)
$doc->setValue($attrid, $pdoc->id);
75 else $doc->$attrid = $pdoc->id;
77 if (
$err ==
"")
$doc->addHistoryEntry(sprintf(_(
"add new profil %s") , $pdoc->getTitle()));
82 if (!$redirid) $redirid =
$docid;
83 redirect($action,
"FDL",
"FDL_CARD&props=Y&id=$redirid", $action->GetParam(
"CORE_STANDURL"));
exitError($texterr, $exit=true, $code="")
createDoc($dbaccess, $fromid, $control=true, $defaultvalues=true, $temporary=false)
createprof(Action &$action)
new_Doc($dbaccess, $id= '', $latest=false)
createTmpDoc($dbaccess, $fromid, $defaultvalue=true)
if($file) if($subject==""&&$file) if($subject=="") $err