Skip to content

Commit

Permalink
Merge branch 'master' of github.com:web2project/web2project
Browse files Browse the repository at this point in the history
  • Loading branch information
caseysoftware committed Apr 3, 2013
2 parents 9b27795 + b23b2ad commit 33ef019
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 12 deletions.
13 changes: 6 additions & 7 deletions classes/w2p/Output/EmailManager.class.php
Expand Up @@ -171,11 +171,8 @@ public function getFileNotifyContacts(CFile $file)
return $this->getFileNotify($file);
}

public function getTaskNotify(CTask $task, $user)
public function getTaskNotify(CTask $task, $user, $projname)
{
$project = new CProject();
$projname = $project->load($task->task_project)->project_name;

$body = $this->_AppUI->_('Project', UI_OUTPUT_RAW) . ":\t" . $projname . "\n";
$body .= $this->_AppUI->_('Task', UI_OUTPUT_RAW) . ":\t\t" . $task->task_name . "\n";
//TODO: Priority not working for some reason, will wait till later
Expand Down Expand Up @@ -284,16 +281,18 @@ public function getProjectNotifyOwner(CProject $project, $isNotNew)

$status = (intval($isNotNew)) ? 'Updated' : 'Created';

$body = $this->_AppUI->_('Project') . ": $project->project_name Has Been $status Via Project Manager. You can view the Project by clicking: ";
$body = $this->_AppUI->_('Project') . ': ' . $project->project_name . ' ' . $this->_AppUI->_('has been') . ' ' . $this->_AppUI->_($status);
$body .= "\n" . $this->_AppUI->_('You can view the Project by clicking'). ':';
$body .= "\n" . $this->_AppUI->_('URL') . ': ' . w2PgetConfig('base_url') . '/index.php?m=projects&a=view&project_id=' . $project->project_id;
$body .= "\n\n(You are receiving this message because you are the owner of this Project)";
$body .= "\n\n(" . $this->_AppUI->_('You are receiving this message because you are the owner of this Project') . ")";
$body .= "\n\n" . $this->_AppUI->_('Description') . ':' . "\n $project->project_description \n\n";

$body .= (intval($isNotNew)) ? $this->_AppUI->_('Updater') : $this->_AppUI->_('Creator');
$body .= ': ' . $this->_AppUI->user_display_name;

if ($project->_message == 'deleted') {
$body .= "\n\nProject " . $project->project_name . ' was ' . $project->_message . ' by ' . $this->_AppUI->user_display_name;
$body .= "\n\n" . $this->_AppUI->_('Project') . $project->project_name . $this->_AppUI->_('was deleted') . '.';
$body .= "\n" . $this->_AppUI->_('deleted by') . ': ' . $this->_AppUI->user_display_name;
}

return $body;
Expand Down
2 changes: 1 addition & 1 deletion lib/PEAR/Date/Calc.php
Expand Up @@ -1542,7 +1542,7 @@ function getWeekdayAbbrname($day="",$month="",$year="",$length=3)
$month = Date_Calc::dateNow("%m");
if(empty($day))
$day = Date_Calc::dateNow("%d");
return substr(Date_Calc::getWeekdayFullname($day,$month,$year),0,$length);
return mb_substr(Date_Calc::getWeekdayFullname($day,$month,$year),0,$length);
} // end func getWeekdayFullname

/**
Expand Down
2 changes: 1 addition & 1 deletion lib/PHPMailer/class.phpmailer.php
Expand Up @@ -56,7 +56,7 @@ class PHPMailer {
* Sets the CharSet of the message.
* @var string
*/
public $CharSet = 'iso-8859-1';
public $CharSet = 'utf-8';

/**
* Sets the Content-type of the message.
Expand Down
2 changes: 1 addition & 1 deletion modules/projects/projects.class.php
Expand Up @@ -551,7 +551,7 @@ public function notifyOwner($isNotNew)

$mail = new w2p_Utilities_Mail;

$subject = (intval($isNotNew)) ? "Project Updated: $this->project_name " : "Project Submitted: $this->project_name ";
$subject = (intval($isNotNew)) ? $this->_AppUI->_('Project updated') . ': ' . $this->project_name : $this->_AppUI->_('Project submitted') . ': ' . $this->project_name;

$user = new CUser();
$user->overrideDatabase($this->_query);
Expand Down
2 changes: 1 addition & 1 deletion modules/tasks/ae_desc.php
Expand Up @@ -42,7 +42,7 @@
<?php echo $AppUI->_('Task Type'); ?><br />
<?php
$task_types = w2PgetSysVal('TaskType');
echo arraySelect($task_types, 'task_type', 'class="text"', $task->task_type, false);
echo arraySelect($task_types, 'task_type', 'class="text"', $task->task_type, true);
?>
<br /><br />
<?php
Expand Down
5 changes: 4 additions & 1 deletion modules/tasks/tasks.class.php
Expand Up @@ -1211,6 +1211,9 @@ public function notify($comment = '')

$mail = new w2p_Utilities_Mail();

$project = new CProject();
$projname = $project->load($this->task_project)->project_name;

$mail->Subject($projname . '::' . $this->task_name . ' ' . $this->_AppUI->_($this->_action, UI_OUTPUT_RAW), $locale_char_set);

// c = creator
Expand Down Expand Up @@ -1248,7 +1251,7 @@ public function notify($comment = '')
if ($mail->ValidEmail($row['assignee_email'])) {

$emailManager = new w2p_Output_EmailManager($this->_AppUI);
$body = $emailManager->getTaskNotify($this, $row);
$body = $emailManager->getTaskNotify($this, $row, $projname);

$mail->Body($body, (isset($GLOBALS['locale_char_set']) ? $GLOBALS['locale_char_set'] : ''));

Expand Down

0 comments on commit 33ef019

Please sign in to comment.