* along with Codendi. If not, see <http://www.gnu.org/licenses/>.
*/
-require_once('Widget.class.php');
+require_once 'Widget.class.php';
//require_once('common/survey/SurveySingleton.class.php');
-require_once ('common/survey/SurveyFactory.class.php');
+require_once 'common/survey/SurveyFactory.class.php';
+
/**
* Widget_MySurveys
- *
+ *
* DEVELOPER SURVEYS
- *
+ *
* This needs to be updated manually to display any given survey
- * Default behavior: get first survey from group #1
+ * Default behavior: get first survey from group #1
*/
+
class Widget_MySurveys extends Widget {
var $content;
var $can_be_displayed;
- function Widget_MySurveys() {
+ function __construct() {
$this->Widget('mysurveys');
$no_survey = true;
}
}
$projects = $tmp ;
-
+
$html_my_surveys = '';
if (count ($projects) < 1) {
- $html_my_surveys .= _("<P>There are no surveys in your groups.<P><BR> ");
+ $html_my_surveys .= '<div class="warning">'. _("There are no surveys in your projects.") ."</div>\n";
} else {
+ global $HTML;
$request =& HTTPRequest::instance();
$html_my_surveys .= '<table style="width:100%">';
foreach ($projects as $project) {
list($hide_now,$count_diff,$hide_url) = my_hide_url('survey',$group_id,$hide_item_id,count($surveys),$hide_survey);
- $html_hdr = ($j ? '<tr class="boxitem"><td colspan="2">' : '').
- $hide_url.'<A HREF="/survey/?group_id='.$group_id.'">'.
- db_result($result,$j,'group_name').'</A> ';
+ $html_hdr = '<tr class="boxitem"><td colspan="2">'.
+ $hide_url.'<a href="/survey/?group_id='.$group_id.'">'.
+ $project->getPublicName().'</a> ';
$html = '';
$count_new = max(0, $count_diff);
foreach ($surveys as $survey) {
$i++ ;
if (!$hide_now) {
- if ($i % 2 == 0) {
- $class="bgcolor-white";
- }
- else {
- $class="bgcolor-grey";
- }
-
-
$group_survey_id= $survey->getId();
$survey_title = $survey->getTitle();
$devsurvey_is_active = $survey->isActive();
if($devsurvey_is_active == 1 ) {
$html .= '
- <TR class="'. $class .'"><TD WIDTH="99%">'.
- ' - <A HREF="/survey/survey.php?group_id='.$group_id.'&survey_id='.$group_survey_id.'">'.
- $survey_title.'</A></TD></TR>';
+ <tr '. $HTML->boxGetAltRowStyle($i) .'><td width="99%">'.
+ ' - <a href="/survey/survey.php?group_id='.$group_id.'&survey_id='.$group_survey_id.'">'.
+ $survey_title.'</a></td></tr>';
}
}
}
- $html_hdr .= '['.count($surveys).($count_new ? ", <b>".sprintf(_('%s new'), array($count_new))."</b>]" : ']').'</td></tr>';
+ $html_hdr .= '['.count($surveys).($count_new ? ", <b>".sprintf(_('%d new'), $count_new)."</b>]" : ']').'</td></tr>';
$html_my_surveys .= $html_hdr.$html;
}
$html_my_surveys .= '</table>';
return _("List the surveys you have not answered.");
}
}
-
-?>