} if (isset($_REQUEST['isDuplicate']) && $_REQUEST['isDuplicate'] == 'true') { $GLOBALS['log']->debug("isDuplicate found - duplicating record of id: " . $focus->id); $focus->id = ""; } $GLOBALS['log']->info("InboundEmail Edit View"); /* End standard EditView setup logic */ /* Start custom setup logic */ // status drop down $status = get_select_options_with_id_separate_key($app_list_strings['user_status_dom'], $app_list_strings['user_status_dom'], $focus->status); // Groups $selectGroups = '<option value="new">' . $mod_strings['LBL_CREATE_NEW_GROUP'] . '</option>'; // handle if this I-E is personal or group $isPersonal = false; if (!empty($focus->id)) { $isPersonal = $focus->handleIsPersonal(); } if ($selects = $focus->getGroupsWithSelectOptions()) { $selectGroups .= $selects; } if ($isPersonal) { // stomp out standard $selectGroups = '<option value="' . $focus->group_id . '">' . $focus->getUserNameFromGroupId() . '</option>'; } // default MAILBOX value if (empty($focus->mailbox)) { $mailbox = 'INBOX'; } else { $mailbox = $focus->mailbox; } // service options breakdown
} else { $xtpl->assign('TRASH_SENT_FOLDER_STYLE', "display:''"); } // else $possibleAction = "pick"; if (!isset($app_list_strings['dom_mailbox_type'][$focus->mailbox_type])) { $possibleAction = $app_list_strings['dom_mailbox_type']['pick']; } else { $possibleAction = $app_list_strings['dom_mailbox_type'][$focus->mailbox_type]; } $xtpl->assign('GROUP_NAME', $groupName); $xtpl->assign('MAILBOX_TYPE', $possibleAction); $xtpl->assign('EMAIL_TEMPLATE', $emailTemplate); $xtpl->assign('FROM_NAME', $from_name); $xtpl->assign('FROM_ADDR', $from_addr); $xtpl->assign('DEFAULT_FROM_NAME', $default_from_name); $xtpl->assign('DEFAULT_FROM_ADDR', $default_from_addr); $xtpl->assign('REPLY_TO_NAME', $reply_to_name); $xtpl->assign('REPLY_TO_ADDR', $reply_to_addr); $xtpl->assign('ONLY_SINCE', $onlySince); $xtpl->assign('FILTER_DOMAIN', $filterDomain); if (!empty($focus->port)) { $xtpl->assign('PORT', $focus->port); } if ($focus->handleIsPersonal()) { $xtpl->assign('LBL_GROUP_QUEUE', $mod_strings['LBL_ASSIGN_TO_USER']); } else { $xtpl->assign('LBL_GROUP_QUEUE', $mod_strings['LBL_GROUP_QUEUE']); } $xtpl->parse('main'); $xtpl->out('main');
public function handleIsPersonal($id) { $inboundEmail = new InboundEmail(); //test with a invalid group_id $inboundEmail->group_id = 2; $result = $inboundEmail->handleIsPersonal(); $this->assertEquals(false, $result); //test with a valid group_id $inboundEmail->retrieve($id); $result = $inboundEmail->handleIsPersonal(); $this->assertEquals(true, $result); }