7 include_once (
"FDL/Class.Dir.php");
8 include_once (
"FDL/editcard.php");
17 $famid =
$usage->addRequiredParameter(
"famid", _(
"family id"));
18 $attrid =
$usage->addRequiredParameter(
"attrid", _(
"attribute id"));
19 $default =
$usage->addOptionalParameter(
"emptyValue", _(
"value for empty field"));
20 $value =
$usage->addOptionalParameter(
"value", _(
"value in field"));
21 $onChange =
$usage->addOptionalParameter(
"submitOnChange", _(
"Sending input on change?"));
22 $localSubmit =
$usage->addOptionalParameter(
"localSubmit", _(
"Adding button to submit")) ==
"yes" ?
true :
false;
23 $submitLabel =
$usage->addOptionalParameter(
"submitLabel", _(
"Label of submit button") , array() , _(
"Submit"));
29 $action->lay->eset(
"famid",
$famid);
30 $action->lay->eset(
"attrid", strtolower($attrid));
35 if (
$doc->isAlive()) {
39 $attr =
$doc->getAttribute($attrid);
41 $action->AddWarningMsg(sprintf(_(
"Attribute [%s] is not found") , $attrid));
42 $action->lay->template = htmlspecialchars(sprintf(_(
"Attribute [%s] is not found") , $attrid) , ENT_QUOTES);
43 $action->lay->noparse =
true;
46 $action->lay->eset(
"label", $attr->getLabel());
48 if ($onChange ==
"no") {
50 } elseif ($onChange ==
"yes" || (!$onChange && !$localSubmit)) {
53 $action->lay->eset(
"local_submit", $localSubmit);
54 $action->lay->eset(
"submit_label", $submitLabel);
57 if ($default !== null) {
60 $value =
$doc->getParameterRawValue($attrid,
$doc->GetValueMethod($attrid));
64 $fdoc =
$d->getFamilyDocument();
65 $d->setDefaultValues($fdoc->getParams() ,
false);
68 $action->lay->set(
"input_field", $input_field);
69 $action->lay->set(
"change", ($onChange !=
""));
71 $action->AddWarningMsg(sprintf(_(
"Family [%s] not found") ,
$famid));
72 $action->lay->template = htmlspecialchars(sprintf(_(
"Family [%s] not found") ,
$famid) , ENT_QUOTES);
73 $action->lay->noparse =
true;
77 $action->parent->addJsRef(
"FDL/Layout/editparameter.js");
editfamilyparameter(Action &$action)
getHtmlInput(&$doc, &$oattr, $value, $index="", $jsevent="", $notd=false)
Verify arguments for action function.
new_Doc($dbaccess, $id= '', $latest=false)
useOwnParamters(Doc &$doc)
editmode(Action &$action)
createTmpDoc($dbaccess, $fromid, $defaultvalue=true)