- }
- if (empty($prefix)) {
+ if (empty($setup['email_routing']['address_prefix'])) {
- return array(78, "Error: Please configure the email address prefix.\n");
+ return array(78, gettext("Error: Please configure the email address prefix.") . "\n");
}
- if (empty($mail_domain)) {
+ if (empty($setup['email_routing']['address_host'])) {
- return array(78, "Error: Please configure the email address domain.\n");
+ return array(78, gettext("Error: Please configure the email address domain.") . "\n");
}
+
$structure = Mime_Helper::decode($full_message, true, true);
- if (!empty($matches[1])) {
- $issue_id = $matches[1];
- } else {
-- return array(65, "Error: The routed email had no associated Eventum issue ID or had an invalid recipient address.\n");
+- return array(65, gettext("Error: The routed email had no associated Eventum issue ID or had an invalid recipient address.") . "\n");
- }
+ $issue_id = Routing::getMatchingIssueIDs($structure->headers['cc'], 'email');
+ }
+
+ if (empty($issue_id)) {
-+ return array(65, "Error: The routed email had no associated Eventum issue ID or had an invalid recipient address.\n");
++ return array(65, gettext("Error: The routed email had no associated Eventum issue ID or had an invalid recipient address.") . "\n");
}
+
if (empty($email_account_id)) {
if (empty($issue_prj_id)) {
@@ -305,30 +299,26 @@
if (@$setup['note_routing']['status'] != 'enabled') {
- return array(78, "Error: The internal note routing interface is disabled.\n");
+ return array(78, gettext("Error: The internal note routing interface is disabled.") . "\n");
}
- $prefix = $setup['note_routing']['address_prefix'];
- // escape plus signs so 'note+1@example.com' becomes a valid routing address
- $mail_domain = quotemeta($setup['note_routing']['address_host']);
- if (empty($prefix)) {
+ if (empty($setup['note_routing']['address_prefix'])) {
- return array(78, "Error: Please configure the email address prefix.\n");
+ return array(78, gettext("Error: Please configure the email address prefix.") . "\n");
}
- if (empty($mail_domain)) {
+ if (empty($setup['note_routing']['address_host'])) {
- return array(78, "Error: Please configure the email address domain.\n");
+ return array(78, gettext("Error: Please configure the email address domain.") . "\n");
}
$structure = Mime_Helper::decode($full_message, true, true);
- if (!empty($matches[1])) {
- $issue_id = $matches[1];
- } else {
-- return array(65, "Error: The routed note had no associated Eventum issue ID or had an invalid recipient address.\n");
+- return array(65, gettext("Error: The routed note had no associated Eventum issue ID or had an invalid recipient address.") . "\n");
- }
+ $issue_id = Routing::getMatchingIssueIDs($structure->headers['cc'], 'note');
+ }
+
+ if (empty($issue_id)) {
-+ return array(65, "Error: The routed note had no associated Eventum issue ID or had an invalid recipient address.\n");
++ return array(65, gettext("Error: The routed note had no associated Eventum issue ID or had an invalid recipient address.")" . "\n");
}
$prj_id = Issue::getProjectID($issue_id);
-@@ -389,6 +379,7 @@
+@@ -377,6 +377,7 @@
if ($res != -1) {
Support::extractAttachments($issue_id, $full_message, true, $res);
}
+ // FIXME! $res == -2 is not handled
- History::add($issue_id, Auth::getUserID(), History::getTypeID('note_routed'), "Note routed from " . $structure->headers['from']);
+ History::add($issue_id, Auth::getUserID(), History::getTypeID('note_routed'), ev_gettext('Note routed from %1$s', $structure->headers['from']));
return true;
@@ -433,30 +424,27 @@
if (@$setup['draft_routing']['status'] != 'enabled') {
- return array(78, "Error: The email draft interface is disabled.\n");
+ return array(78, gettext("Error: The email draft interface is disabled.") . "\n");
}
- $prefix = $setup['draft_routing']['address_prefix'];
- // escape plus signs so 'draft+1@example.com' becomes a valid address
- $mail_domain = quotemeta($setup['draft_routing']['address_host']);
- if (empty($prefix)) {
+ if (empty($setup['draft_routing']['address_prefix'])) {
- return array(78, "Error: Please configure the email address prefix.\n");
+ return array(78, gettext("Error: Please configure the email address prefix.") . "\n");
}
- if (empty($mail_domain)) {
+ if (empty($setup['draft_routing']['address_host'])) {
- return array(78, "Error: Please configure the email address domain.\n");
+ return array(78, gettext("Error: Please configure the email address domain.") . "\n");
}
+
$structure = Mime_Helper::decode($full_message, true, false);
- if (!empty($matches[1])) {
- $issue_id = $matches[1];
- } else {
-- return array(65, "Error: The routed draft had no associated Eventum issue ID or had an invalid recipient address.\n");
+- return array(65, gettext("Error: The routed draft had no associated Eventum issue ID or had an invalid recipient address.") . "\n");
- }
+ $issue_id = Routing::getMatchingIssueIDs($structure->headers['cc'], 'draft');
+ }
+
+ if (empty($issue_id)) {
-+ return array(65, "Error: The routed email had no associated Eventum issue ID or had an invalid recipient address.\n");
++ return array(65, gettext("Error: The routed email had no associated Eventum issue ID or had an invalid recipient address.") . "\n");
}
$prj_id = Issue::getProjectID($issue_id);
if (!empty($error)) {
$errors[] = $error;
}
---- ./setup/index.php 2005-04-16 05:53:27.000000000 +0300
-+++ eventum-1.5.2.patched/setup/index.php 2005-04-16 05:53:05.000000000 +0300
+--- eventum-20060918/setup/index.php~ 2006-09-19 00:15:15.216195060 +0300
++++ eventum-20060918/setup/index.php 2006-09-19 00:15:18.346265301 +0300
@@ -276,8 +276,8 @@
clearstatcache();
}
fclose($fp);
// check if we can connect
-@@ -442,22 +442,8 @@
+@@ -429,18 +429,7 @@
+ $tpl->assign('is_imap_enabled', function_exists('imap_open'));
}
-
+-
-$full_url = dirname($HTTP_SERVER_VARS['PHP_SELF']);
-$pieces = explode("/", $full_url);
-$relative_url = array();
-}
-$relative_url[] = '';
-$relative_url = implode("/", $relative_url);
--
--if (substr(@$HTTP_SERVER_VARS['DOCUMENT_ROOT'], -1) == '/') {
-- $HTTP_SERVER_VARS['DOCUMENT_ROOT'] = substr($HTTP_SERVER_VARS['DOCUMENT_ROOT'], 0, -1);
--}
--$installation_path = @$HTTP_SERVER_VARS['DOCUMENT_ROOT'] . $relative_url;
-+$installation_path = "/usr/share/eventum";
-+$relative_url = "/eventum/";
++$relative_url = '/eventum/';
$tpl->assign("phpversion", phpversion());
$tpl->assign("rel_url", $relative_url);