}
}
}
-
+ $this->fetchData($this->getID());
$this->sendNotice(false);
return true;
}
*
* @param boolean true = new document (default value)
*/
- function sendNotice ($new=true) {
+ function sendNotice($new = true) {
$BCC = $this->Group->getDocEmailAddress();
if ($this->isMonitoredBy('ALL')) {
$BCC .= $this->getMonitoredUserEmailAddress();
}
if (strlen($BCC) > 0) {
- if ($new) {
- $status = _('New document');
- } else {
- $status = _('Updated document');
+ $BCCarray = explode(',',$BCC);
+ foreach ($BCCarray as $dest_email) {
+ if ($new) {
+ $status = _('New document');
+ } else {
+ $status = _('Updated document');
+ }
+ $subject = '['.$this->Group->getPublicName().'] '.$status.' - '.$this->getName();
+ $body = _('Project:').' '.$this->Group->getPublicName()."\n";
+ $body .= _('Directory:').' '.$this->getDocGroupName()."\n";
+ $body .= _('Document title:').' '.$this->getName()."\n";
+ $body .= _('Document description:').' '.util_unconvert_htmlspecialchars($this->getDescription())."\n";
+ $body .= _('Submitter:').' '.$this->getCreatorRealName()." (".$this->getCreatorUserName().") \n";
+ $body .= "\n\n-------------------------------------------------------\n".
+ _('For more info, visit:').
+ "\n\n" . util_make_url('/docman/?group_id='.$this->Group->getID().'&view=listfile&dirid='.$this->getDocGroupID());
+
+ util_send_message($dest_email, $subject, $body, 'noreply@'.forge_get_config('web_host'), '', _('Docman'));
}
- $subject = '['.$this->Group->getPublicName().'] '.$status.' - '.$this->getName();
- $body = _('Project:').' '.$this->Group->getPublicName()."\n";
- $body .= _('Directory:').' '.$this->getDocGroupName()."\n";
- $body .= _('Document title:').' '.$this->getName()."\n";
- $body .= _('Document description:').' '.util_unconvert_htmlspecialchars($this->getDescription())."\n";
- $body .= _('Submitter:').' '.$this->getCreatorRealName()." (".$this->getCreatorUserName().") \n";
- $body .= "\n\n-------------------------------------------------------\n".
- _('For more info, visit:').
- "\n\n" . util_make_url('/docman/?group_id='.$this->Group->getID().'&view=listfile&dirid='.$this->getDocGroupID());
-
- util_send_message('', $subject, $body, '', $BCC);
}
return true;