+
+ if((cur->field->type == FIELD_EMAILS) ||
+ (cur->field->type == FIELD_LIST)) {
+ abook_list *emails, *e;
+
+ find_field_number(cur->field->key, &nb);
+ emails = csv_to_abook_list(db_fget_byid(item, nb));
+
+ for(e = emails; e; e = e->next) {
+ getyx(editw, y, x);
+ mvwaddnstr(editw, y + 1, TAB_COLON_POS + 2,
+ e->data,
+ bytes2width(e->data,
+ FIELD_MAX_WIDTH));
+ mvwaddch(editw, y + 1, TAB_COLON_POS,
+ UI_VLINE_CHAR);
+ }
+ if(emails) {
+ mvwaddch(editw, y + 2, TAB_COLON_POS,
+ UI_LLCORNER_CHAR);
+ mvwhline(editw, y + 2, TAB_COLON_POS + 1,
+ UI_HLINE_CHAR,
+ EDITW_COLS - TAB_COLON_POS - 2);
+ }
+ abook_list_free(&emails);
+ } else if(cur->field->type == FIELD_DATE) {
+ int day, month, year;
+ char buf[12];
+
+ find_field_number(cur->field->key, &nb);
+ if((str = db_fget_byid(item, nb)) != NULL)
+ strncpy(buf, str, sizeof(buf));
+
+ if(str && parse_date_string(buf, &day, &month, &year)) {
+ if(year)
+ str = strdup_printf("%04d-%02d-%02d",
+ year, month, day);
+ else
+ str = strdup_printf("--%02d-%02d",
+ month, day);
+ mvwaddnstr(editw, y, TAB_COLON_POS + 2, str,
+ bytes2width(str, FIELD_MAX_WIDTH));
+ free(str);
+ }
+ } else {
+ find_field_number(cur->field->key, &nb);
+ str = safe_str(db_fget_byid(item, nb));
+ mvwaddnstr(editw, y, TAB_COLON_POS + 2, str,
+ bytes2width(str, FIELD_MAX_WIDTH));
+ }