- // docs inherited from interface
- protected $keyword = 'mailing';
-
-
- // docs inherited from interface
- /**
- * @return array
- */
- public function getInfo() {
- return array(
- 'name' => 'CiviMail',
- 'translatedName' => ts('CiviMail'),
- 'title' => 'CiviCRM Mailing Engine',
- 'search' => 1,
- 'showActivitiesInCore' => 1,
- );
- }
-
- public function getAngularModules() {
- $result = array();
- $result['crmMailing'] = array(
- 'ext' => 'civicrm',
- 'js' => array('js/angular-Mailing.js' , 'js/angularsanitize.js' , 'packages/ckeditor/ckeditor.js'),
- );
- $session = CRM_Core_Session::singleton();
- $contactID = $session->get('userID');
- $civiMails = civicrm_api3('Mailing', 'get', array());
- $campNames = civicrm_api3('Campaign', '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' => $contactID,
- ));
- $mesTemplate = civicrm_api3('MessageTemplate', 'get', array( 'sequential' => 1,
- 'return' => array("msg_html", "id", "msg_title", "msg_subject"),
- 'workflow_id' => array('IS NULL' => ""),
- ));
- $mailGrp = civicrm_api3('MailingGroup','get', array());
- $mailTokens = civicrm_api3('Mailing', 'get_token', array( 'usage' => 'Mailing'));
+ /**
+ * @inheritDoc
+ */
+ protected $keyword = 'mailing';
+
+
+ /**
+ * @inheritDoc
+ * @return array
+ */
+ public function getInfo() {
+ return array(
+ 'name' => 'CiviMail',
+ 'translatedName' => ts('CiviMail'),
+ 'title' => 'CiviCRM Mailing Engine',
+ 'search' => 1,
+ 'showActivitiesInCore' => 1,
+ );
+ }
+
+ public function getAngularModules() {
+ $result = array();
+ $result['crmMailing'] = array(
+ 'ext' => 'civicrm',
+ 'js' => array(
+ 'js/angular-crmMailing.js',
+ 'js/angular-crmMailing/*.js',
+ ),
+ 'css' => array('css/angular-crmMailing.css'),
+ 'partials' => array('partials/crmMailing'),
+ );
+ $result['crmMailingAB'] = array(
+ 'ext' => 'civicrm',
+ 'js' => array(
+ 'js/angular-crmMailingAB.js',
+ 'js/angular-crmMailingAB/*.js',
+ ),
+ 'css' => array('css/angular-crmMailingAB.css'),
+ 'partials' => array('partials/crmMailingAB'),
+ );
+ $result['crmD3'] = array(
+ 'ext' => 'civicrm',
+ 'js' => array(
+ 'js/angular-crmD3.js',
+ 'bower_components/d3/d3.min.js',
+ ),
+ );
+
+ $config = CRM_Core_Config::singleton();
+ $session = CRM_Core_Session::singleton();
+ $contactID = $session->get('userID');
+ $civiMails = civicrm_api3('Mailing', 'get', array());
+ $campNames = civicrm_api3('Campaign', 'get', array());
+ $mailingabNames = civicrm_api3('MailingAB', 'get', array());
+ $mailStatus = civicrm_api3('MailingJob', 'get', array());
+ $groupNames = civicrm_api3('Group', 'get', array());
+ $headerfooterList = civicrm_api3('MailingComponent', 'get', array());
+
+ // FIXME: The following two items differ between GSOC CiviMail and ABTest branches
+ if (FALSE) {
+ // AB Test
+ $emailAdd = civicrm_api3('Email', 'get', array());
+ $mesTemplate = civicrm_api3('MessageTemplate', 'get', array(
+ 'sequential' => 1,
+ 'return' => array("msg_html", "id", "msg_title", "msg_subject"),
+ 'id' => array('>' => 58),
+ ));
+ }
+ else {
+ // CiviMail UI
+ $emailAdd = civicrm_api3('Email', 'get', array(
+ 'sequential' => 1,
+ 'return' => "email",
+ 'contact_id' => $contactID,
+ ));
+ $mesTemplate = civicrm_api3('MessageTemplate', 'get', array(
+ 'sequential' => 1,
+ 'return' => array("msg_html", "id", "msg_title", "msg_subject", "msg_text"),
+ 'workflow_id' => array('IS NULL' => ""),
+ ));
+ }
+ $mailGrp = civicrm_api3('MailingGroup', 'get', array());
+ $mailTokens = civicrm_api3('Mailing', 'get_token', array('usage' => 'Mailing'));