// Close bugs.
function svnProjectTools($data, $id_member)
{
global $smcFunc, $sourcedir, $context, $user_profile, $issue, $project;
$project = 2;
if (empty($data->log))
return;
$entries = explode("\n", $data->log);
$bugs = array();
foreach ($entries as $entry)
{
$bug_data = array();
preg_match('~\[[Bug|Feature]+\s+([\d,]+)\]~i', $entry, $matches);
// Nothing to log?
if (empty($matches[1]))
continue;
$temp = array_unique(array_map('intval', explode(',', $matches[1])));;
foreach ($temp as $id)
$bugs[$id][] = str_replace($matches[0], 'Revision: ' . $data->revision, $entry);
}
// Now loop our bugs.
foreach ($bugs as $id => $bug)
$bugs[$id] = implode("\n", array_unique($bug));
// Still nothing?
if (empty($bugs))
return;
require_once($sourcedir . '/Subs-Post.php');
require_once($sourcedir . '/Subs-Issue.php');
require_once($sourcedir . '/Subs-Project.php');
require_once($sourcedir . '/IssueReport.php');
require_once($sourcedir . '/IssueComment.php');
// Get their data.
loadMemberData($id_member);
// Prep the changes.
$posterOptions = array(
'id' => $id_member,
'ip' => $user_profile[$id_member]['member_ip'],
'name' => $data->author,
'email' => $user_profile[$id_member]['email_address'],
);
$issueOptions = array(
'mark_read' => true,
'assignee' => $id_member,
'status' => 5, // Resolved.
);
$commentOptions = array('body' => '');
loadProjectTools();
// Lets do some loops.
foreach ($bugs as $bug => $message)
{
$issue = $bug;
loadIssue();
// Update our body message
$commentOptions['body'] = $smcFunc['htmlspecialchars']($message, ENT_QUOTES);
// Update the info like assigned and status.
$event_data = updateIssue($bug, $issueOptions, $posterOptions, true);
// Fix a Project tracker bug...
if ($event_data === true)
$event_data = array();
// Create a comment.
$id_comment = createComment($project, $bug, $commentOptions, $posterOptions);
$commentOptions['id'] = $id_comment;
// Spam people.
sendIssueNotification(array('id' => $bug, 'project' => $project), $commentOptions, $event_data, 'new_comment', $id_member);
}
}
function svnProjectTools($data, $id_member)
{
global $smcFunc, $sourcedir, $context, $user_profile, $issue, $project;
$project = 2;
if (empty($data->log))
return;
$entries = explode("\n", $data->log);
$bugs = array();
foreach ($entries as $entry)
{
$bug_data = array();
preg_match('~\[[Bug|Feature]+\s+([\d,]+)\]~i', $entry, $matches);
// Nothing to log?
if (empty($matches[1]))
continue;
$temp = array_unique(array_map('intval', explode(',', $matches[1])));;
foreach ($temp as $id)
$bugs[$id][] = str_replace($matches[0], 'Revision: ' . $data->revision, $entry);
}
// Now loop our bugs.
foreach ($bugs as $id => $bug)
$bugs[$id] = implode("\n", array_unique($bug));
// Still nothing?
if (empty($bugs))
return;
require_once($sourcedir . '/Subs-Post.php');
require_once($sourcedir . '/Subs-Issue.php');
require_once($sourcedir . '/Subs-Project.php');
require_once($sourcedir . '/IssueReport.php');
require_once($sourcedir . '/IssueComment.php');
// Get their data.
loadMemberData($id_member);
// Prep the changes.
$posterOptions = array(
'id' => $id_member,
'ip' => $user_profile[$id_member]['member_ip'],
'name' => $data->author,
'email' => $user_profile[$id_member]['email_address'],
);
$issueOptions = array(
'mark_read' => true,
'assignee' => $id_member,
'status' => 5, // Resolved.
);
$commentOptions = array('body' => '');
loadProjectTools();
// Lets do some loops.
foreach ($bugs as $bug => $message)
{
$issue = $bug;
loadIssue();
// Update our body message
$commentOptions['body'] = $smcFunc['htmlspecialchars']($message, ENT_QUOTES);
// Update the info like assigned and status.
$event_data = updateIssue($bug, $issueOptions, $posterOptions, true);
// Fix a Project tracker bug...
if ($event_data === true)
$event_data = array();
// Create a comment.
$id_comment = createComment($project, $bug, $commentOptions, $posterOptions);
$commentOptions['id'] = $id_comment;
// Spam people.
sendIssueNotification(array('id' => $bug, 'project' => $project), $commentOptions, $event_data, 'new_comment', $id_member);
}
}