mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
elofgren: BUGFIX: Fix bug 'Errors when Importing Recipients to Newsletter Mailing List'. Fixes gsoc trac ticket #38. Tested and importing newsletter recipients works in FF2 and IE7. Reported here: http://www.silverstripe.com/bugs/flat/1470 This fix needs GenericEmail?.ss added in r38503
(merged from branches/gsoc) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@41970 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
31921fb25b
commit
bcbdd364e0
@ -216,6 +216,7 @@ class RecipientImportField_UploadForm extends Form {
|
||||
$mailType = DataObject::get_one("NewsletterType", "ID = $id");
|
||||
if($mailType->GroupID)
|
||||
$group = DataObject::get_one("Group", "ID = $mailType->GroupID");
|
||||
// @TODO Look into seeing if $data['Set'] should be removed since it seems to be undefined
|
||||
return $this->importMembers( $id, $group, $data['ImportFileColumns'], $data['Set'] );
|
||||
}
|
||||
|
||||
@ -243,7 +244,7 @@ class RecipientImportField_UploadForm extends Form {
|
||||
|
||||
$startTime = time();
|
||||
|
||||
$importData = Session::set("ImportFile.{$id}");
|
||||
$importData = Session::get("ImportFile.{$id}");
|
||||
|
||||
$validColumns = array_keys( RecipientImportField::$column_types );
|
||||
|
||||
|
@ -309,7 +309,7 @@ class NewsletterAdmin extends LeftAndMain {
|
||||
|
||||
$actions = new FieldSet(new FormAction('save','Save'));
|
||||
|
||||
$form = new Form($this, "MailingListEditForm", $fields, $actions);
|
||||
$form = new Form($this, "EditForm", $fields, $actions);
|
||||
$form->loadDataFrom(array(
|
||||
'Title' => $mailType->Title,
|
||||
'FromEmail' => $mailType->FromEmail
|
||||
@ -328,7 +328,10 @@ class NewsletterAdmin extends LeftAndMain {
|
||||
function getrecipientslist() {
|
||||
if( $_REQUEST['ajax'] ) {
|
||||
$newsletterType = DataObject::get_by_id('NewsletterType', $this->urlParams['ID'] );
|
||||
$memberList = new MemberTableField($this, "Recipients", $newsletterType->Group() );
|
||||
$fields = new FieldSet($memberList = new MemberTableField($this, "Recipients", $newsletterType->Group() ));
|
||||
$memberList->setController($this);
|
||||
$actions = new FieldSet(new FormAction('save','Save'));
|
||||
$form = new Form($this, "EditForm", $fields, $actions);
|
||||
return $memberList->FieldHolder();
|
||||
}
|
||||
}
|
||||
|
@ -456,10 +456,14 @@ function autoSave(confirmation, callAfter) {
|
||||
function reloadRecipientsList() {
|
||||
|
||||
var id = $('Form_EditForm_ID').value;
|
||||
|
||||
var request = new Ajax.Request( 'admin/newsletter/getrecipientslist/' + id + '?ajax=1', {
|
||||
if(navigator.appName == "Microsoft Internet Explorer") {
|
||||
var url = 'admin/newsletter/getrecipientslist/';
|
||||
} else {
|
||||
var url = 'getrecipientslist/';
|
||||
}
|
||||
var request = new Ajax.Request(url + id + '?ajax=1', {
|
||||
onSuccess: function( response ) {
|
||||
$('MemberList').outerHTML = response.responseText;
|
||||
$('Root_Recipients').innerHTML = response.responseText;
|
||||
Behaviour.apply( $('MemberList') );
|
||||
},
|
||||
onFailure: function(response) {
|
||||
|
Loading…
Reference in New Issue
Block a user