Skip to content
Snippets Groups Projects
Commit 777daf366a2f authored by oscarf's avatar oscarf
Browse files

(eudc-default-return-attributes): Modified custom

widgets to allow the selection of `all' as a symbol.
(eudc-query): Take `eudc-default-return-attributes' into account
(eudc-filter-partial-records): New function
parent d1c90c889e54
No related branches found
No related tags found
No related merge requests found
......@@ -93,7 +93,10 @@
"*A list of the default attributes to extract from directory entries.
If set to the symbol `all' return all attributes.
nil means return the default attributes as configured in the server."
:type '(repeat (symbol :tag "Field name"))
:type '(choice :menu-tag "Return Attributes"
(const :menu-tag "Server Defaults (nil)" nil)
(const :menu-tag "All" all)
(repeat :menu-tag "Edit List" (symbol :tag "Field name")))
:group 'eudc)
(defcustom eudc-multiple-match-handling-method 'select
......@@ -398,6 +401,8 @@
(unless eudc-query-function
(error "Don't know how to perform the query"))
(if no-translation
(funcall eudc-query-function query return-attributes)
(funcall eudc-query-function query (or return-attributes
eudc-default-return-attributes))
(funcall eudc-query-function
(eudc-translate-query query)
......@@ -402,6 +407,7 @@
(funcall eudc-query-function
(eudc-translate-query query)
(eudc-translate-attribute-list return-attributes))))
(eudc-translate-attribute-list (or return-attributes
eudc-default-return-attributes)))))
(defun eudc-display-records (records &optional raw-attr-names)
......@@ -557,6 +563,21 @@
duplicates)
result)))
(defun eudc-filter-partial-records (records attrs)
"Eliminate records that do not caontain all ATTRS from RECORDS."
(delq nil
(mapcar
(function
(lambda (rec)
(if (eval (cons 'and
(mapcar
(function
(lambda (attr)
(consp (assq attr rec))))
attrs)))
rec)))
records)))
(defun eudc-add-field-to-records (field records)
"Add FIELD to each individual record in RECORDS and return the resulting list."
(mapcar (function
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment