-
Notifications
You must be signed in to change notification settings - Fork 0
/
single-bug-library-bugs.php
91 lines (76 loc) · 3.63 KB
/
single-bug-library-bugs.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<?php
/**
* The Template for displaying all single posts.
*
* @package WordPress
* @subpackage Twenty_Ten
* @since Twenty Ten 1.0
*/
get_header(); ?>
<div id="container">
<div id="content" role="main">
<div id='bug-library-list'>
<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
<?php
global $post, $wpdb;
//print_r($post);
$products = wp_get_post_terms( $post->ID, "bug-library-products");
$product = $products[0];
$statuses = wp_get_post_terms( $post->ID, "bug-library-status");
$status = $statuses[0];
$types = wp_get_post_terms( $post->ID, "bug-library-types");
$type = $types[0];
$productversion = get_post_meta($post->ID, "bug-library-product-version", true);
$resolutiondate = get_post_meta($post->ID, "bug-library-resolution-date", true);
$resolutionversion = get_post_meta($post->ID, "bug-library-resolution-version", true);
$imagepath = get_post_meta($post->ID, "bug-library-image-path", true);
$dateformat = get_option("date_format");
$postdatetimestamp = $wpdb->get_var("SELECT UNIX_TIMESTAMP(post_date) from " . $wpdb->get_blog_prefix() . "posts where ID = " . $post->ID);
$genoptions = get_option('BugLibraryGeneral', "");
if ($genoptions['permalinkpageid'] != -1)
{
$parentpage = get_post($genoptions['permalinkpageid']);
//print_r($parentpage);
$parentslug = $parentpage->post_name;
}
else
{
$parentslug = "bugs";
}
?>
<div id='bug-library-breadcrumb'><a href='/<?php echo $parentslug; ?>'>All Items</a> » <a href='/<?php echo $parentslug; ?>/?bugcatid=<?php echo $products[0]->term_id; ?>'><?php echo $products[0]->name; ?></a> » Bug #<?php echo $post->ID; ?></div>
<div id='bug-library-item-table'>
<table>
<tr id="<?php if ($counter % 2 == 1) echo 'odd'; else echo 'even'; ?>">
<td id='bug-library-type'><div id='bug-library-type-<?php echo $type->slug ?>'><?php echo $type->name ?></div></td>
<td id='bug-library-title'><a href='<?php echo get_permalink($post->ID); ?>'><?php echo stripslashes($post->post_title); ?></a></td>
</tr>
<tr id="<?php if ($counter % 2 == 1) echo 'odd'; else echo 'even'; ?>">
<td id='bug-library-data' colspan='2'>ID: <a href='<?php echo get_permalink( $post->ID); ?>'><?php echo $post->ID; ?></a> Status: <?php echo $status->name; ?> Version: <?php if ($productversion != '') echo $productversion; else echo 'N/A'; ?> Report Date: <?php echo date($dateformat, $postdatetimestamp); ?> Product: <?php echo $product->name; ?><br />
<?php if ($resolutiondate != '') echo "Resolution Date: " . $resolutiondate . " Resolution Version: " . $resolutionversion; ?>
</td>
</tr>
<tr id='bug-library-filler'><td></td></tr>
<tr id='bug-library-desc'>
<td colspan ='2'><div id='bug-library-desc-title'>Description</div><br />
<?php if ($post->post_content != ''): ?>
<?php the_content(); ?>
<?php else: ?>
No Description Available
<?php endif; ?>
<?php if ($imagepath != '') {
echo "File Attachment<br /><br />";
echo "<a href='" . $imagepath . "'>Attached File</a><br />";
}
?>
</td>
</tr>
</table>
</div>
<?php comments_template( '', true ); ?>
<?php endwhile; // end of the loop. ?>
</div>
</div><!-- #content -->
</div><!-- #container -->
<?php get_sidebar(); ?>
<?php get_footer(); ?>