7 include_once (
'FDL/Class.Doc.php');
16 $famid =
$usage->addRequiredParameter(
"famid",
"family id");
17 $attrid =
$usage->addRequiredParameter(
"attrid",
"attribute id");
18 $value =
$usage->addOptionalParameter(
"value",
"value in field");
22 header(
'Content-type: text/xml; charset=utf-8');
29 "parameterid" => $attrid,
36 if (
$doc->isAlive()) {
37 $attr =
$doc->getAttribute($attrid);
39 $out[
"success"] =
false;
40 $out[
"errors"] = sprintf(_(
"Parameter [%s] not found in family [%s]") , $attrid,
$famid);
42 if ($attr->type ==
"array" &&
$value) {
56 if ($e[
"attrid"] == $key) {
57 $result[$i][
"value"][] = $e[
"value"][0];
64 foreach ($result as $v) {
66 if (!empty($v[
"value"])) {
67 $val =
$doc->arrayToRawValue($v[
"value"]);
70 $ownParams =
$doc->getOwnParams();
71 $oldValue = $ownParams[$v[
"attrid"]];
72 if ($oldValue != $val) {
75 $err =
$doc->setParam($v[
"attrid"], $val);
80 $out[
"success"] =
false;
83 $out[
"modify"] =
true;
86 $oldValue =
$doc->getParameterRawValue($attrid);
90 $out[
"success"] =
false;
94 $out[
"modify"] =
true;
100 $out[
"success"] =
false;
101 $out[
"errors"] = sprintf(_(
"Doucment [%s] not found") ,
$famid);
103 $action->lay->set(
"success",
$out[
"success"]);
104 $action->lay->set(
"warning", htmlspecialchars(
$out[
"errors"]));
105 $action->lay->set(
"count", 1);
106 $action->lay->set(
"parameterid",
$out[
"parameterid"]);
107 $action->lay->set(
"modify",
$out[
"modify"]);
118 foreach ($array as $val) {
119 if ($val[
"attrid"] == $key) {
modfamilyparameter(Action &$action)
Verify arguments for action function.
new_Doc($dbaccess, $id= '', $latest=false)
if($file) if($subject==""&&$file) if($subject=="") $err
array_attrid_exists($key, array $array)