SimplePortal > Site Discussion

Project Tools Block

<< < (2/3) > >>

[SiNaN]:
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.

grafitus:
The code works perfectly. But you can use the following for a better view:

--- Code: --- 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>';
--- End code ---

And copy this code to your the end of your index.css file:

--- Code: ---.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;
}
--- End code ---

Masterd:
My bad. Now it's working perfectly. How can I add more than just one project?

grafitus:
Sorry, getIssueList() does not support fetching multi-projects at a time. Or you can use this:

--- Code: --- 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>';
--- End code ---

Alpay:
Hi guys ;

I need your help a subject


--- Code: ---<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>
--- End code ---

[ ScTr ] - [ ] -Footer

 ', $issue['version']['name'], '
 ', $issue['version']['link'], '


The version number does not seem to result ?

Sample :
[ ScTr ] - [ 2.1.9 ] -Footer

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version