19 include_once (
"FDL/modcard.php");
21 include_once (
"FDL/Class.DocFam.php");
22 include_once (
"FDL/Class.Dir.php");
31 $retedit = ($action->
getArgument(
"retedit",
"N") ==
"Y");
32 $noredirect = ($action->
getArgument(
"noredirect") ==
"1");
33 $quicksave = ($action->
getArgument(
"quicksave") ==
"1");
36 $viewext = $action->
getArgument(
"viewext") ==
"yes";
37 $autoclose = $action->
getArgument(
"autoclose") ==
"yes";
38 $recallhelper = $action->
getArgument(
"recallhelper") ==
"yes";
39 $updateAttrid = $action->
getArgument(
"updateAttrid");
42 $action->parent->addJsRef(
"GENERIC:generic_mod.js",
true);
53 $cdoc =
$doc->getFamDoc();
57 if ($fld->locked == - 1) {
58 $dirid = $fld->latestId();
61 if (method_exists($fld,
"AddFile")) {
65 $home = $fld->getHome(
false);
66 if ($home && ($home->id > 0)) {
75 if ((
$doc->doctype ==
'D') || (
$doc->doctype ==
'S')) $action->
AddActionDone(
"ADDFOLDER", $fld->initid);
81 $home = $fld->getHome(
false);
82 if ($home && ($home->id > 0)) {
92 if ((!
$err) && $updateAttrid) {
93 $action->lay->set(
"updateData", json_encode(array(
95 "title" =>
$doc->getTitle() ,
96 "attrid" => $updateAttrid,
97 "recallhelper" => $recallhelper
100 $action->lay->set(
"updateData",
"null");
103 $action->lay->set(
"autoclose", $autoclose ?
"true" :
"false");
104 $action->lay->set(
"id", $ndocid);
105 if (is_array($info)) {
106 foreach ($info as $k => $v) {
107 $info[$k][
"prefix"] = sprintf(_(
"constraint not validated for %s attribute") , $v[
"label"]);
110 $action->lay->set(
"constraintinfo", json_encode($info));
111 $action->lay->set(
"quicksave", $quicksave);
112 if ($rzone !=
"") $zone =
"&zone=$rzone";
114 if ($rvid !=
"") $zone =
"&vid=$rvid";
116 $action->lay->set(
"error", json_encode(
$err));
117 $warning = $action->parent->getWarningMsg();
118 if ($warning && count($warning) > 0) $warning = implode(
"\n", $warning);
120 $action->lay->set(
"warning", json_encode($warning));
121 if ($retedit) $action->lay->set(
"url", sprintf(
"?app=%s&action=%s$zone", getHttpVars(
"redirect_app",
"GENERIC") , getHttpVars(
"redirect_act",
"GENERIC_EDIT&id=$ndocid")));
123 if ($viewext) $action->lay->set(
"url", sprintf(
"?app=%s&action=%s$zone", getHttpVars(
"redirect_app",
"FDL") , getHttpVars(
"redirect_act",
"VIEWEXTDOC$zone&refreshfld=Y&id=$ndocid")));
124 else $action->lay->set(
"url", sprintf(
"?app=%s&action=%s$zone", getHttpVars(
"redirect_app",
"FDL") , getHttpVars(
"redirect_act",
"FDL_CARD$zone&refreshfld=Y&id=$ndocid")));
133 redirect($action,
GetHttpVars(
"redirect_app",
"GENERIC") ,
GetHttpVars(
"redirect_act",
"GENERIC_EDIT&id=$ndocid") , $action->
GetParam(
"CORE_STANDURL"));
136 if ($rzone !=
"") $zone =
"&zone=$rzone";
138 if ($rvid !=
"") $zone =
"&vid=$rvid";
140 redirect($action,
GetHttpVars(
"redirect_app",
"FDL") ,
GetHttpVars(
"redirect_act",
"FDL_CARD$zone&refreshfld=Y&id=$ndocid") , $action->
GetParam(
"CORE_STANDURL"));