| | |
| | | | | |
| | | | This file is part of the Roundcube Webmail client | |
| | | | Copyright (C) 2005-2011, The Roundcube Dev Team | |
| | | | Licensed under the GNU GPL | |
| | | | | |
| | | | Licensed under the GNU General Public License version 3 or | |
| | | | any later version with exceptions for skins & plugins. | |
| | | | See the README file for a full license statement. | |
| | | | | |
| | | | PURPOSE: | |
| | | | Save a contact entry or to add a new one | |
| | |
| | | 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])) { |
| | |
| | | |
| | | // do input checks (delegated to $CONTACTS instance) |
| | | if (!$CONTACTS->validate($a_record)) { |
| | | $err = (array)$CONTACTS->get_error() + array('message' => 'formincomplete', 'type' => 'warning'); |
| | | $OUTPUT->show_message($err['message'], $err['type']); |
| | | $err = (array)$CONTACTS->get_error(); |
| | | $OUTPUT->show_message($err['message'] ? $err['message'] : 'formincomplete', 'warning'); |
| | | $GLOBALS['EDIT_RECORD'] = $a_record; // store submitted data to be used in edit form |
| | | rcmail_overwrite_action($return_action); |
| | | return; |