|
|
@ -28,7 +28,7 @@ if ($CONTACTS->readonly)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// check input
|
|
|
|
// check input
|
|
|
|
if ((!get_input_value('_name', RCUBE_INPUT_POST) || !get_input_value('_email', RCUBE_INPUT_POST)) && $OUTPUT->action)
|
|
|
|
if ((!get_input_value('_name', RCUBE_INPUT_POST) || !get_input_value('_email', RCUBE_INPUT_POST)))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$OUTPUT->show_message('formincomplete', 'warning');
|
|
|
|
$OUTPUT->show_message('formincomplete', 'warning');
|
|
|
|
rcmail_overwrite_action(empty($_POST['_cid']) ? 'add' : 'show');
|
|
|
|
rcmail_overwrite_action(empty($_POST['_cid']) ? 'add' : 'show');
|
|
|
@ -53,8 +53,6 @@ foreach ($a_save_cols as $col)
|
|
|
|
if (!empty($cid))
|
|
|
|
if (!empty($cid))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if ($CONTACTS->update($cid, $a_record))
|
|
|
|
if ($CONTACTS->update($cid, $a_record))
|
|
|
|
{
|
|
|
|
|
|
|
|
if ($OUTPUT->action)
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// define list of cols to be displayed
|
|
|
|
// define list of cols to be displayed
|
|
|
|
$a_js_cols = array();
|
|
|
|
$a_js_cols = array();
|
|
|
@ -65,7 +63,6 @@ if (!empty($cid))
|
|
|
|
|
|
|
|
|
|
|
|
// update the changed col in list
|
|
|
|
// update the changed col in list
|
|
|
|
$OUTPUT->command('parent.update_contact_row', $cid, $a_js_cols);
|
|
|
|
$OUTPUT->command('parent.update_contact_row', $cid, $a_js_cols);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// show confirmation
|
|
|
|
// show confirmation
|
|
|
|
$OUTPUT->show_message('successfullysaved', 'confirmation');
|
|
|
|
$OUTPUT->show_message('successfullysaved', 'confirmation');
|
|
|
@ -95,8 +92,6 @@ else
|
|
|
|
|
|
|
|
|
|
|
|
// insert record and send response
|
|
|
|
// insert record and send response
|
|
|
|
if ($insert_id = $CONTACTS->insert($a_record))
|
|
|
|
if ($insert_id = $CONTACTS->insert($a_record))
|
|
|
|
{
|
|
|
|
|
|
|
|
if ($OUTPUT->action)
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// add contact row or jump to the page where it should appear
|
|
|
|
// add contact row or jump to the page where it should appear
|
|
|
|
$CONTACTS->reset();
|
|
|
|
$CONTACTS->reset();
|
|
|
@ -108,7 +103,6 @@ else
|
|
|
|
// update record count display
|
|
|
|
// update record count display
|
|
|
|
$CONTACTS->reset();
|
|
|
|
$CONTACTS->reset();
|
|
|
|
$OUTPUT->command('parent.set_rowcount', rcmail_get_rowcount_text());
|
|
|
|
$OUTPUT->command('parent.set_rowcount', rcmail_get_rowcount_text());
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// show confirmation
|
|
|
|
// show confirmation
|
|
|
|
$OUTPUT->show_message('successfullysaved', 'confirmation');
|
|
|
|
$OUTPUT->show_message('successfullysaved', 'confirmation');
|
|
|
|