diff --git a/module/my/control.php b/module/my/control.php index caf065d40b..cfb96ceb73 100644 --- a/module/my/control.php +++ b/module/my/control.php @@ -1001,13 +1001,24 @@ EOF; { if($_POST) { - $data = fixer::input('post')->get(); + $data = fixer::input('post') + ->setDefault('users', array()) + ->get(); if($data->mode == 'new') { + if(empty($data->newList)) + { + dao::$errors['newList'] = sprintf($this->lang->error->notempty, $this->lang->user->contacts->listName); + $response['result'] = 'fail'; + $response['message'] = dao::getError(); + return $this->send($response); + } $listID = $this->user->createContactList($data->newList, $data->users); $this->user->setGlobalContacts($listID, isset($data->share)); + if(isonlybody()) return print(js::closeModal('parent.parent', '', ' function(){parent.parent.ajaxGetContacts(\'#mailto\')}')); - return print(js::locate(inlink('manageContacts', "listID=$listID"), 'parent')); + return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('manageContacts', "listID=$listID"))); + return print(js::locate(inlink('manageContacts', "listID=$listID"))); } elseif($data->mode == 'edit') { diff --git a/module/my/view/managecontacts.html.php b/module/my/view/managecontacts.html.php index 5f1c438fea..38f38dafd9 100644 --- a/module/my/view/managecontacts.html.php +++ b/module/my/view/managecontacts.html.php @@ -36,8 +36,8 @@ -