From b88b7a13cb0dd8c42b7250deabb5b201e0b82526 Mon Sep 17 00:00:00 2001 From: aditya-nambiar Date: Wed, 16 Jul 2014 18:29:21 +0530 Subject: [PATCH] Changed select 2 and civiplugin --- CRM/Mailing/Info.php | 24 ++++++++++++++++++++---- js/angular-crmMailingAB.js | 13 +++++-------- partials/abtesting/main.html | 4 ++-- 3 files changed, 27 insertions(+), 14 deletions(-) diff --git a/CRM/Mailing/Info.php b/CRM/Mailing/Info.php index a6dac29713..1800117e83 100644 --- a/CRM/Mailing/Info.php +++ b/CRM/Mailing/Info.php @@ -63,15 +63,31 @@ class CRM_Mailing_Info extends CRM_Core_Component_Info { 'css' => array('css/angular-crmMailingAB.css'), ); - $compMails = civicrm_api3('Mailing', 'get', array()); + + $civiMails = civicrm_api3('Mailing', 'get', array()); $campNames = civicrm_api3('Campaign', 'get', array()); - $vargroups = civicrm_api3('Group', 'get', array()); + $mailStatus = civicrm_api3('MailingJob', 'get', array()); + $groupNames = civicrm_api3('Group', 'get', array()); + $headerfooterList = civicrm_api3('MailingComponent', 'get', array()); + $emailAdd = civicrm_api3('Email', 'get', array( + 'sequential' => 1, + 'return' => "email", + 'contact_id' => 202, + )); + $mesTemplate = civicrm_api3('MessageTemplate', 'get', array( 'sequential' => 1, + 'return' => array("msg_html", "id", "msg_title"), + 'id' => array('>' => 58), + )); CRM_Core_Resources::singleton()->addSetting(array( 'crmMailing' => array( - 'compMails' => array_values($compMails['values']), + 'civiMails' => array_values($civiMails['values']), 'campNames' => array_values($campNames['values']), - 'vargroups' => array_values($vargroups['values']), + 'mailStatus' => array_values($mailStatus['values']), + 'groupNames' => array_values($groupNames['values']), + 'headerfooterList' => array_values($headerfooterList['values']), + 'mesTemplate' => array_values($mesTemplate['values']), + 'emailAdd' => array_values($emailAdd['values']), ), )); diff --git a/js/angular-crmMailingAB.js b/js/angular-crmMailingAB.js index 89860a2840..4a3d2dc511 100644 --- a/js/angular-crmMailingAB.js +++ b/js/angular-crmMailingAB.js @@ -37,9 +37,7 @@ templateUrl: partialUrl('main.html'), controller: 'TabsDemoCtrl', resolve: { - metaData: function($route, crmApi) { - return crmApi('Group', 'get', {}); - }, + mailingList: function($route, crmApi) { return crmApi('Mailing', 'get', {}); } @@ -51,10 +49,11 @@ // Add a new record by name. // Ex: - crmMailingAB.controller('TabsDemoCtrl', function($scope, crmApi, metaData, mailingList) { + crmMailingAB.controller('TabsDemoCtrl', function($scope, crmApi) { + + $scope.groups= CRM.crmMailing.groupNames; + $scope.mailList = CRM.crmMailing.civiMails; - $scope.groups = metaData.values; - $scope.mailings = mailingList.values; $scope.tab_val=0; $scope.max_tab=0; $scope.campaign_clicked= function(){ @@ -189,8 +188,6 @@ return { restrict : 'AE', link: function(scope,element, attrs){ - $(element).select2({width:"400px",placeholder: "Select the groups you wish to include"}); - $(element).select2("data",groups) function format(item) { if(!item.id) { // return `text` for optgroup diff --git a/partials/abtesting/main.html b/partials/abtesting/main.html index 0b2cbb2b31..b959244576 100644 --- a/partials/abtesting/main.html +++ b/partials/abtesting/main.html @@ -49,8 +49,8 @@



-- 2.25.1