コード例 #1
0
 /**
  *	sendNotice - contains the logic for sending email/jabber updates.
  *
  *	@return	boolean	success.
  */
 function sendNotice($first = false)
 {
     global $send_task_email;
     if ($send_task_email === false) {
         return true;
     }
     $ids =& $this->getAssignedTo();
     //
     //	See if there is anyone to send messages to
     //
     if (count($ids) < 1 && !$this->ProjectGroup->getSendAllPostsTo()) {
         return true;
     }
     $body = "Task #" . $this->getID() . " has been updated. " . "\n\nProject: " . $this->ProjectGroup->Group->getPublicName() . "\nSubproject: " . $this->ProjectGroup->getName() . "\nSummary: " . util_unconvert_htmlspecialchars($this->getSummary()) . "\nComplete: " . $this->getPercentComplete() . "%" . "\nStatus: " . $this->getStatusName() . "\n\nDescription: " . util_unconvert_htmlspecialchars($this->getDetails());
     /*
     	Now get the followups to this task
     */
     $result2 = $this->getMessages();
     $rows = db_numrows($result2);
     if ($result2 && $rows > 0) {
         $body .= "\n\nFollow-Ups:";
         for ($i = 0; $i < $rows; $i++) {
             $body .= "\n\n-------------------------------------------------------";
             $body .= "\nDate: " . date(_('Y-m-d H:i'), db_result($result2, $i, 'postdate'));
             $body .= "\nBy: " . db_result($result2, $i, 'user_name');
             $body .= "\n\nComment:\n" . util_unconvert_htmlspecialchars(db_result($result2, $i, 'body'));
         }
     }
     $body .= "\n\n-------------------------------------------------------" . "\nFor more info, visit:" . "\n\n" . util_make_url('/pm/task.php?func=detailtask&project_task_id=' . $this->getID() . "&group_id=" . $this->ProjectGroup->Group->getID() . "&group_project_id=" . $this->ProjectGroup->getID());
     $subject = sprintf(_('[%1$s - %2$s] [Task #%3$d] '), $this->ProjectGroup->Group->getUnixName(), $this->ProjectGroup->getName(), $this->getID()) . util_unconvert_htmlspecialchars($this->getSummary());
     util_handle_message(array_unique($ids), $subject, $body, $this->ProjectGroup->getSendAllPostsTo());
     return true;
 }
コード例 #2
0
    /**
     *  sendNotice - the logic to send an email/jabber notice for a release.
     *
     *  @return	boolean	success.
     */
    function sendNotice()
    {
        $arr =& $this->FRSPackage->getMonitorIDs();
        $date = date('Y-m-d H:i', time());
        $subject = sprintf(_('[%1$s Release] %2$s'), $this->FRSPackage->Group->getUnixName(), $this->FRSPackage->getName());
        $text = stripcslashes(sprintf(_('Project %1$s (%2$s) has released a new version of package "%3$s".
You can download it by following this link:

%4$s

You receive this email because you requested to be notified when new
versions of this package were released. If you don\'t wish to be
notified in the future, please login to %5$s and click this link:

%6$s'), $this->FRSPackage->Group->getPublicName(), $this->FRSPackage->Group->getUnixName(), $this->FRSPackage->getName(), util_make_url("/frs/?group_id=" . $this->FRSPackage->Group->getID() . "&release_id=" . $this->getID()), $GLOBALS['sys_name'], util_make_url("/frs/monitor.php?filemodule_id=" . $this->FRSPackage->getID() . "&group_id=" . $this->FRSPackage->Group->getID() . "&stop=1")));
        $text = util_line_wrap($text);
        if (count($arr)) {
            util_handle_message(array_unique($arr), $subject, $text);
        }
    }