Skip to content
Browse files

Add support for people fields

  • Loading branch information...
1 parent dc54dec commit 0cc44f0561024200d299ad8ea0e29db3d15ff291 @LegNeato LegNeato committed May 15, 2012
View
4 templates/fields/assigned_to.tpl
@@ -0,0 +1,4 @@
+<?php
+ // Wrapper
+ require(dirname(__FILE__) . '/people.tpl');
+?>
View
4 templates/fields/cc.tpl
@@ -0,0 +1,4 @@
+<?php
+ // Wrapper
+ require(dirname(__FILE__) . '/people.tpl');
+?>
View
4 templates/fields/creator.tpl
@@ -0,0 +1,4 @@
+<?php
+ // Wrapper
+ require(dirname(__FILE__) . '/people.tpl');
+?>
View
33 templates/fields/people.tpl
@@ -0,0 +1,33 @@
+<?php
+
+ $out = '';
+ $rn = '';
+ $n = '';
+
+ if( is_array($data) ) {
+
+ if( isset($data['real_name']) && !empty($data['real_name']) ) {
+ $rn = '<span class="bugzilla-field-' . $field .'-real_name">';
+ $rn .= htmlspecialchars($bug[$field]['real_name']);
+ $rn .= '</span>';
+ }
+
+ if( isset($data['name']) && !empty($data['name']) ) {
+ $n = '<span class="bugzilla-field-' . $field .'-name">';
+ $n .= htmlspecialchars($bug[$field]['name']);
+ $n .= '</span>';
+ }
+
+ $out = ( empty($n) ) ? $rn : "$rn ($n)";
+
+ // Special case for "nobody"
+ if( isset($data['name']) && (empty($data['name']) || $data['name'] == 'nobody') ) {
+ $out = '';
+ }
+
+ }else {
+ $out = htmlspecialchars($data);
+ }
+
+ echo $out;
+?>
View
4 templates/fields/qa_contact.tpl
@@ -0,0 +1,4 @@
+<?php
+ // Wrapper
+ require(dirname(__FILE__) . '/people.tpl');
+?>

0 comments on commit 0cc44f0

Please sign in to comment.
Something went wrong with that request. Please try again.