SimplePortal
SimplePortal => Site Discussion => Topic started by: α¢αηѕ on May 25, 2010, 03:42:40 AM
-
I was looking over the most boards here as well as the search feature and i cannot find a topic about the Project Tools block on the front page.
Will this block be released? or only for SP.net
-
I'm also interested in it.
-
It was posted in the Blocks and Modifications board but here is the latest code:
global $context, $settings, $project, $txt;
$block_parameters = array();
if ($return_parameters)
return $block_parameters;
loadLanguage('Project');
$project = 1;
$num_issues = 5;
$order = 'i.updated DESC';
$issues = getIssueList(0, $num_issues, $order, '1 = 1');
echo '
<table class="bordercolor issuetable" cellspacing="0">';
foreach ($issues as $issue)
{
echo '
<tr>
<td class="windowbg sp_center issue_', $issue['status']['name'], '" style="width: 24px; border-bottom: 1px solid #FFF;">
<img src="', $settings['images_url'], '/', $issue['tracker']['image'], '" alt="', $issue['tracker']['name'], '" />
</td>
<td class="info issue_', $issue['status']['name'], '" style="border-bottom: 1px solid #FFF;">
', !empty($issue['category']['link']) ? '[' . $issue['category']['link'] . '] ' : '', $issue['link'], ' ';
if ($issue['new'] && $context['user']['is_logged'])
echo '
<a href="', $issue['new_href'], '"><img src="', $settings['lang_images_url'], '/new.gif" alt="', $txt['new'], '" /></a>';
echo '
<br /><span class="smalltext">', !empty($issue['version']['link']) ? '[' . $issue['version']['link'] . '] ' : '', $txt['issue_status_' . $issue['status']['name']], $issue['is_assigned'] ? ' (' . $issue['assigned']['link'] . ')' : '', '</span>
</td>
</tr>';
}
echo '
</table>';
-
Thanks, [SiNaN]!
-
It's not working.
-
I know some people think I'm an amazing person. But still I can't figure out what the problem is only with that single unexplanatory sentence. I'm sure that is the exact code we are using here, since I directly copied from that block.
-
The code works perfectly. But you can use the following for a better view:
global $context, $settings, $project, $txt;
loadLanguage('Project');
$project = 1;
$num_issues = 5;
$order = 'i.updated DESC';
$issues = getIssueList(0, $num_issues, $order, '1 = 1');
echo '
<table class="bordercolor" style="width: 100%;" cellspacing="0">';
foreach ($issues as $issue)
{
echo '
<tr>
<td class="windowbg sp_center issue_', $issue['status']['name'], '" style="width: 24px; border-bottom: 1px solid #FFF;">
<img src="', $settings['images_url'], '/', $issue['tracker']['image'], '" alt="', $issue['tracker']['name'], '" />
</td>
<td class="info issue_', $issue['status']['name'], '" style="border-bottom: 1px solid #FFF;">
', !empty($issue['category']['link']) ? '[' . $issue['category']['link'] . '] ' : '', $issue['link'], ' ';
if ($issue['new'] && $context['user']['is_logged'])
echo '
<a href="', $issue['new_href'], '"><img src="', $settings['lang_images_url'], '/new.gif" alt="', $txt['new'], '" /></a>';
echo '
<br /><span class="smalltext">', !empty($issue['version']['link']) ? '[' . $issue['version']['link'] . '] ' : '', $txt['issue_status_' . $issue['status']['name']], $issue['is_assigned'] ? ' (' . $issue['assigned']['link'] . ')' : '', '</span>
</td>
</tr>';
}
echo '
</table>';
And copy this code to your the end of your index.css file:
.issue_new
{
background-color: #FFCCCC;
}
.issue_feedback
{
background-color: #FF50A8;
}
.issue_confirmed
{
background-color: #FFFFB0;
}
.issue_assigned
{
background-color: #C8C8FF;
}
.issue_resolved
{
background-color: #CCFFCC;
}
.issue_closed
{
background-color: #E8E8E8;
}
-
My bad. Now it's working perfectly. How can I add more than just one project?
-
Sorry, getIssueList() does not support fetching multi-projects at a time. Or you can use this:
global $context, $settings, $project, $txt;
loadLanguage('Project');
$projects = array(1, 2); // blah, blah, blah
$num_issues = 5;
$order = 'i.updated DESC';
echo '
<table class="bordercolor" style="width: 100%;" cellspacing="0">';
foreach ($projects as $project)
{
$issues = getIssueList(0, $num_issues, $order, '1 = 1');
foreach ($issues as $issue)
{
echo '
<tr>
<td class="windowbg sp_center issue_', $issue['status']['name'], '" style="width: 24px; border-bottom: 1px solid #FFF;">
<img src="', $settings['images_url'], '/', $issue['tracker']['image'], '" alt="', $issue['tracker']['name'], '" />
</td>
<td class="info issue_', $issue['status']['name'], '" style="border-bottom: 1px solid #FFF;">
', !empty($issue['category']['link']) ? '[' . $issue['category']['link'] . '] ' : '', $issue['link'], ' ';
if ($issue['new'] && $context['user']['is_logged'])
echo '
<a href="', $issue['new_href'], '"><img src="', $settings['lang_images_url'], '/new.gif" alt="', $txt['new'], '" /></a>';
echo '
<br /><span class="smalltext">', !empty($issue['version']['link']) ? '[' . $issue['version']['link'] . '] ' : '', $txt['issue_status_' . $issue['status']['name']], $issue['is_assigned'] ? ' (' . $issue['assigned']['link'] . ')' : '', '</span>
</td>
</tr>';
}
}
echo '
</table>';
-
Hi guys ;
I need your help a subject
<a href="', $issue['new_href'], '"><span><img src="', $settings['images_url'], '/', $issue['tracker']['image'], '" alt="', $issue['tracker']['name'], '" />[ ', $issue['category']['name'], ' ] - [ ', $issue['version']['name'], ' ] -', $issue['name'], '';echo'</span></a>
[ ScTr ] - [ ] -Footer
', $issue['version']['name'], '
', $issue['version']['link'], '
The version number does not seem to result ?
Sample :
[ ScTr ] - [ 2.1.9 ] -Footer
-
I've checked back after all these years... It works great!
However there's one issue, the number of issues listed is multiplied by the number of projects. Having two projects listed with 5 issues makes a total of 10 that show, 3 p x 5 i = 15, etc.
Anybody know a quick fix for this?
-
Which code are you using? You can use the code I pasted in the third post changing the $project variable to 0 make it list issues from all projects.
-
Winnah, Was using Grafitus last post.
Thank's Sinan!
-
You're welcome! ;)