| | |
| | | foreach ((array)$vals as $i => $val) |
| | | $values[$i][$childcol] = $val; |
| | | } |
| | | $subtypes = get_input_value('_subtype_' . $col, RCUBE_INPUT_POST); |
| | | foreach ($subtypes as $i => $subtype) |
| | | $subtypes = isset($_REQUEST['_subtype_' . $col]) ? (array)get_input_value('_subtype_' . $col, RCUBE_INPUT_POST) : array(''); |
| | | foreach ($subtypes as $i => $subtype) { |
| | | $suffix = $subtype ? ':'.$subtype : ''; |
| | | if ($values[$i]) |
| | | $a_record[$col.':'.$subtype][] = $values[$i]; |
| | | $a_record[$col.$suffix][] = $values[$i]; |
| | | } |
| | | } |
| | | // assign values and subtypes |
| | | else if (is_array($_POST[$fname])) { |
| | |
| | | // show notice if existing contacts with same e-mail are found |
| | | $existing = false; |
| | | foreach ($CONTACTS->get_col_values('email', $a_record, true) as $email) { |
| | | if ($email && ($res = $CONTACTS->search('email', $email, false, false, true)) && $res->count) { |
| | | if ($email && ($res = $CONTACTS->search('email', $email, 1, false, true)) && $res->count) { |
| | | $OUTPUT->show_message('contactexists', 'notice', null, false); |
| | | break; |
| | | } |