public function testis_used_by_email_marketing() { $emailTemplate = new EmailTemplate(); //test without id attribute $this->assertEquals(false, $emailTemplate->is_used_by_email_marketing()); //test with id attribute $emailTemplate->id = 1; $this->assertEquals(false, $emailTemplate->is_used_by_email_marketing()); }
* "Powered by SugarCRM". ********************************************************************************/ /********************************************************************************* * Description: TODO: To be written. * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc. * All Rights Reserved. * Contributor(s): ______________________________________.. ********************************************************************************/ require_once 'modules/EmailTemplates/EmailTemplate.php'; $focus = new EmailTemplate(); if ($_REQUEST['from'] == 'DetailView') { if (!isset($_REQUEST['record'])) { sugar_die("A record number must be specified to delete the template."); } $focus->retrieve($_REQUEST['record']); if ($focus->is_used_by_email_marketing()) { echo 'true'; return; } echo 'false'; } else { if ($_REQUEST['from'] == 'ListView') { $returnString = ''; $idArray = explode(',', $_REQUEST['records']); foreach ($idArray as $key => $value) { if ($focus->retrieve($value)) { if ($focus->is_used_by_email_marketing()) { $returnString .= $focus->name . ','; } } }