Example #1
0
 /**
  * Method used to get a list of emails that are associated with a given 
  * project and issue.
  *
  * @access  public
  * @param   integer $prj_id The project ID
  * @param   integer $issue_id The issue ID
  * @return  array List of emails
  */
 function getAddressBookEmails($prj_id, $issue_id)
 {
     $list = Project::getAddressBook($prj_id, $issue_id);
     $emails = array();
     foreach ($list as $address => $name) {
         $emails[] = Mail_API::getEmailAddress($address);
     }
     return $emails;
 }
Example #2
0
// | GNU General Public License for more details.                         |
// |                                                                      |
// | You should have received a copy of the GNU General Public License    |
// | along with this program; if not, write to:                           |
// |                                                                      |
// | Free Software Foundation, Inc.                                       |
// | 51 Franklin Street, Suite 330                                          |
// | Boston, MA 02110-1301, USA.                                          |
// +----------------------------------------------------------------------+
// | Authors: Dave Anderson <*****@*****.**>                        |
// +----------------------------------------------------------------------+
require_once dirname(__FILE__) . '/../init.php';
$tpl = new Template_Helper();
$tpl->setTemplate('edit_reporter.tpl.html');
Auth::checkAuthentication(APP_COOKIE, 'index.php?err=5', true);
$prj_id = Auth::getCurrentProject();
$issue_id = @$_POST['issue_id'] ? $_POST['issue_id'] : $_GET['iss_id'];
$tpl->assign('issue_id', $issue_id);
if (!Access::canChangeReporter($issue_id, Auth::getUserID())) {
    $tpl->setTemplate('permission_denied.tpl.html');
    $tpl->displayTemplate();
    exit;
}
if (@$_POST['cat'] == 'update') {
    $res = Edit_Reporter::update($issue_id, trim($_POST['email']));
    Misc::mapMessages($res, array(1 => array(ev_gettext('Thank you, the Reporter was updated successfully.'), Misc::MSG_INFO), -1 => array(ev_gettext('An error occurred while trying to update the Reporter.'), Misc::MSG_ERROR)));
    Auth::redirect(APP_RELATIVE_URL . 'view.php?id=' . $issue_id);
}
$t = Project::getAddressBook($prj_id, $issue_id);
$tpl->assign('allowed_reporters', $t);
$tpl->displayTemplate();