17 include_once (
"FDL/Class.Dir.php");
25 if (
$doc->isConfidential()) redirect($action,
"FDL",
"FDL_CONFIDENTIAL&id=" .
$doc->id);
27 $cdoc =
$doc->getFamilyDocument();
29 $err = $cdoc->control(
'create');
30 if (
$err !=
"") $action->
exitError(sprintf(_(
"no privilege to create this kind (%d) of document") ,
$doc->fromid));
32 $values =
$doc->getValues();
33 if (!is_array($values)) $action->
exitError(_(
"this kind of document cannot be duplicate"));
35 $copy =
$doc->duplicate($temporary);
36 if (!is_object($copy)) $action->
exitError($copy);
42 $err = $copy->modify();
45 $copy->title = _(
"duplication of") .
" " .
$doc->title;
46 $copy->modify(
true, array(
50 if ((
$dirid == 0) && ($copy->id > 0)) {
54 if ((
$dirid > 0) && ($copy->id > 0)) {
59 if ($fld->isAlive()) {
60 $err = $fld->insertDocument($copy->id);
65 $action->AddActionDone(
"ADDFILE", $fld->initid);
70 $action->AddLogMsg(sprintf(_(
"new duplicate document is named : %s") , $copy->title));
exitError($texterr, $exit=true, $code="")
new_Doc($dbaccess, $id= '', $latest=false)
duplicate(Action &$action, $dirid, $docid, $temporary=false)
if($file) if($subject==""&&$file) if($subject=="") $err