10 include_once (
"FDL/Class.Doc.php");
23 ) as $p => $isRequired) {
24 $parms[$p] = GetHttpVars($p,
'');
25 if (
$parms[$p] ==
'' && $isRequired) {
26 $res[
'error'] = sprintf(
"Missing or empty parameter '%s'.", $p);
35 if (
$parms[
'famid'] && (!$fam->isAlive())) {
36 $res[
'error'] = sprintf(
"Could not get family with id '%s'.",
$parms[
'famid']);
43 $res[
'error'] = sprintf(
"Could not create temporary document from family '%s'.", $fam->name);
48 $attrId =
$parms[
'attrid'];
52 $attr = $fam->getAttribute(
$parms[
'attrid']);
53 if (!is_object($attr)) {
54 $res[
'error'] = sprintf(
"Could not get attribute '%s' from family '%s'.",
$parms[
'attrid'], $fam->name);
58 $attrType = $attr->type;
59 if ($attr->format !=
'') {
61 $attrType = sprintf(
'%s("%s")', $attrType, $attr->format);
65 $methods = $tmpDoc->getSearchMethods($attrId, $attrType);
66 $res[
'data'] = $methods;
73 if (headers_sent(
$file, $line)) {
74 error_log(__METHOD__ .
" " . sprintf(
"Oops... someone (%s:%s) already sent the headers!",
$file, $line));
77 header(
'Content-Type: application/json');
78 $action->lay->template = json_encode($response);
sendResponse($action, $response)
getsearchmethods(Action &$action)
new_Doc($dbaccess, $id= '', $latest=false)
createTmpDoc($dbaccess, $fromid, $defaultvalue=true)