示例#1
0
function PrintStory($story_Row)
{
    global $statuscolour;
    global $Project;
    global $Sizecount;
    global $OSizecount;
    global $Toggle;
    global $Iterationcount;
    global $OIterationcount;
    global $DBConn;
    global $LockedIteration;
    // only for the backlog
    if ($Project['Backlog_ID'] == $story_Row['Iteration_ID']) {
        // update predictions
        // use average card size or current velocity is ave > velocity for unsized cards.
        if ($story_Row[Size] == "?") {
            if ($Project['Velocity'] > $Project['Average_Size']) {
                $Add_This = $Project['Average_Size'];
            } else {
                $Add_This = $Project['Velocity'];
            }
        } else {
            $Add_This = $story_Row[Size];
        }
        // add the next story even if it overflows (Best Case)
        $OSizecount += $Add_This;
        if ($OSizecount >= $Project['Velocity']) {
            $OSizecount = 0;
            $OIterationcount += 1;
        }
        // only use complete stories that fit (Worst Case)
        if ($Sizecount + $Add_This > $Project['Velocity']) {
            $Iterationcount += 1;
            $Sizecount = $Add_This;
            // toggle the colour bands in the iteration for current velocity
            $Toggle = ($Toggle + 1) % 3;
        } else {
            $Sizecount += $Add_This;
        }
    }
    $Num_Children = Num_Children($story_Row['AID']);
    $class = 'storybox-div ';
    if ($_REQUEST['Type'] != 'tree') {
        $class .= ' alternate' . $Toggle . ' ';
    } else {
        $class .= ' smaller ';
    }
    if ($story_Row['Blocked'] != 0) {
        $class .= ' blocked';
    }
    // special handling for releases as they cover multiple projects
    if ($_REQUEST['Root'] == 'iteration' || $_REQUEST['Root'] == 'release') {
        if (!empty($_REQUEST['IID'])) {
            if ($story_Row['Iteration_ID'] == $_REQUEST['IID']) {
                $class .= 'thisiteration';
            }
        }
    }
    echo '<div class="' . $class . '" id="storybox' . $story_Row['AID'] . '">';
    echo '<div class="right-box">';
    if ($_REQUEST['Type'] != 'tree') {
        echo '<div class="minimenu-div" id="menu_div_' . $story_Row['AID'] . '">' . '<a href="story_Preview.php?id=' . $story_Row['AID'] . '&PID=' . $story_Row['Project_ID'] . '&IID=' . $story_Row['Iteration_ID'] . '" target="_blank" title="Print preview a story (Opens in new tab)"><img src="images/preview.png"></a> &nbsp;' . '<a class="quickview" id="quickview' . $story_Row['ID'] . '" href="" onclick="javascript: return false;" title="Show more/less detail"><img src="images/more.png"></a> &nbsp;' . '<a class="statuspopup" href="" onclick="javascript: return false;" title="Change Story Status"><img src="images/status.png"></a> &nbsp;' . '<a class="iterationpopup" href="" onclick="javascript: return false;" title="Move to different Iteration"><img src="images/move.png"></a> &nbsp;' . '<a href="story_Edit.php?AID=' . $story_Row['AID'] . '&PID=' . $story_Row['Project_ID'] . '&IID=' . $story_Row['Iteration_ID'] . '" title="Edit Story"><img src="images/edit.png"></a> &nbsp;';
        if ($LockedIteration == 0) {
            echo '<a href="story_Delete.php?id=' . $story_Row['AID'] . '&PID=' . $story_Row['Project_ID'] . '&IID=' . $story_Row['Iteration_ID'] . '" title="Delete Story"><img src="images/delete.png"></a>';
        }
        echo '</div>';
    }
    echo '<div class="type-div">' . $story_Row['Type'] . '</div>';
    echo '<div class="size-div" title="Story Size">&nbsp;';
    echo $story_Row['Size'] . '&nbsp;';
    // print probable iteration based on current velocity if on backlog
    if (empty($_REQUEST['Type'])) {
        if ($Project['Backlog_ID'] == $story_Row['Iteration_ID']) {
            echo '<div class="predicted-div" title="Predicted last/first iteration after last \'loaded\' iteration">(+' . $Iterationcount . '/' . $OIterationcount . ')&nbsp;</div>';
        }
    }
    echo '</div>';
    // size-div
    echo '</div>';
    //right-box
    // set background of drag and drop handle to that of the status (for stories that can be worked on.)
    if ($Num_Children == 0) {
        echo '<div title="' . $statuspolicy[$story_Row['Status']] . '" class="storystatus" style="background: #' . $statuscolour[$story_Row['Status']] . '" id="span_div' . $story_Row['AID'] . '"></div>';
    } else {
        echo '<div class="parentstorystatus" id="span_div' . $story_Row['AID'] . '"></div>';
    }
    echo '<div class="storybody">';
    echo '<div class="line-1-div">';
    //display status of any child stories along with the sum of points for that status
    echo '<div class="childrenstatus-div"> ';
    if ($Num_Children != 0) {
        $astatus = explode(",", $story_Row['Children_Status']);
        for ($i = 0; $i < count($astatus); $i++) {
            $SSize = Get_Status_Points($story_Row['AID'], $astatus[$i], 0);
            if ($SSize != 0) {
                if ($statuscolour[$astatus[$i]] == '') {
                    echo '<div title="' . $SSize . ' ' . $astatus[$i] . ' points" style=" display: inline-block;background-color:#bfbfbf;">&nbsp;' . $SSize . '&nbsp</div>&nbsp';
                } else {
                    echo '<div title="' . $SSize . ' ' . $astatus[$i] . ' points" style=" display: inline-block;background-color:#' . $statuscolour[$astatus[$i]] . ';">&nbsp;' . $SSize . '&nbsp</div>&nbsp';
                }
            }
        }
        // let me get to a small tree
        echo '<a  title="Show my children (#' . $story_Row['ID'] . ') as the root of the tree)"';
        echo ' href="story_List.php?Type=tree&Root=' . $story_Row['ID'] . '&PID=' . $story_Row['Project_ID'] . '&IID=' . $story_Row['Iteration_ID'] . '">';
        echo '<img src="images/tree-small.png"></a>';
    }
    echo '</div>';
    echo '<a href="story_Edit.php?AID=' . $story_Row['AID'] . '&PID=' . $story_Row['Project_ID'] . '&IID=' . $story_Row['Iteration_ID'] . '" title="Edit Story">#' . $story_Row['ID'] . '</a> &nbsp;' . ' - ' . substr($story_Row['Summary'], 0, 150);
    echo '</div>';
    // line 1 div
    echo '<div class="line-2-div" id="line-2-div' . $story_Row['ID'] . '">';
    echo '<b>' . $Project['Desc_1'] . '</b>&nbsp;' . html_entity_decode($story_Row['Col_1'], ENT_QUOTES);
    if ($Project['As_A']) {
        echo '<div><b>As A: </b>' . html_entity_decode($story_Row['As_A'], ENT_QUOTES) . '</div>';
    }
    if ($Project['Col_2']) {
        echo '<div><b>' . $Project['Desc_2'] . '</b>&nbsp;' . html_entity_decode($story_Row['Col_2'], ENT_QUOTES) . '</div>';
    }
    if ($Project['Acceptance']) {
        echo '<div><b>Acceptance: </b>' . html_entity_decode($story_Row['Acceptance'], ENT_QUOTES) . '</div>';
    }
    echo '</div>';
    // line-2-div
    echo '<div class="line-3-div" id="line-3-div' . $story_Row['ID'] . '">';
    if ($Num_Children == 0) {
        echo '<div class="status-div statuspopup" title="Change Story Status" style="background: #' . $statuscolour[$story_Row['Status']] . '" id="status_div' . $story_Row['AID'] . '">' . $story_Row['Status'] . '</div>';
    }
    echo '<div class="iteration-div" id="status_div' . $story_Row['AID'] . '"> ';
    echo '<a href="story_List.php?&PID=' . $story_Row['Project_ID'] . '&IID=' . $story_Row['Iteration_ID'] . '#' . $story_Row['AID'] . '" title="Goto Iteration">';
    echo Get_Iteration_Name($story_Row['Iteration_ID'], False) . '</a></div>';
    // print the micromenu
    printMicromenu($story_Row['AID']);
    echo '<div class="owner-div">| ' . Get_User($story_Row['Owner_ID'], 0) . '</div>';
    // If I am a child show all my parents
    echo '<div class="parents-div"> | ';
    if ($story_Row['Parent_Story_ID'] != 0) {
        $parentssql = 'SELECT @id :=(SELECT Parent_Story_ID FROM story WHERE AID = @id and Parent_Story_ID <> 0 ) AS parent FROM (SELECT @id :=' . $story_Row['AID'] . ') vars STRAIGHT_JOIN story  WHERE @id is not NULL';
        $parents_Res = mysqli_query($DBConn, $parentssql);
        if ($parents_row = mysqli_fetch_assoc($parents_Res)) {
            do {
                if ($parents_row['parent'] != NULL) {
                    $parentsql = 'select ID, AID, Summary, Size from story where AID=' . $parents_row['parent'] . ' and AID<>0';
                    $parent_Res = mysqli_query($DBConn, $parentsql);
                    if ($parent_row = mysqli_fetch_assoc($parent_Res)) {
                        echo '<a  title="' . $parent_row['Summary'] . '"';
                        echo ' href="story_List.php?Type=tree&Root=' . $parent_row['ID'] . '&PID=' . $story_Row['Project_ID'] . '&IID=' . $story_Row['Iteration_ID'] . '">';
                        echo ' #' . $parent_row['ID'] . ' (' . $parent_row['Size'] . ' pts)</a>&nbsp;';
                    }
                }
            } while ($parents_row = mysqli_fetch_assoc($parents_Res));
        }
    }
    echo '</div>';
    //Parents
    echo '|<div class="tags-div">';
    if (strlen($story_Row['Tags']) != 0) {
        $aTags = explode(",", $story_Row['Tags']);
        foreach ($aTags as $Tag) {
            echo '<a class="tags-each ui-corner-all" title="Search for tag:' . $Tag . '" href="story_List.php?PID=' . $story_Row['Project_ID'] . '&searchstring=tag:' . $Tag . '&Type=search">' . $Tag . '</a>';
        }
    }
    echo '</div>';
    //tags-div
    echo '<div class="inline right-box" >';
    echo getReleaseName($story_Row['Release_ID']);
    echo '</div>';
    echo '<div class="hidden" id="alltasks_' . $story_Row['AID'] . '"></div>';
    echo '<div class="hidden" id="commentspops_' . $story_Row['AID'] . '"></div> ';
    echo '<div class="hidden" id="allupload_' . $story_Row['AID'] . '"></div> ';
    echo '<div class="auditdialog hidden" id="allaudits_' . $story_Row['AID'] . '"></div> ';
    echo '</div>';
    //line-3-div
    echo '</div>';
    // storybody divline-3-div
    echo '</div>';
    // storybox-div
}
示例#2
0
		<td class="smaller nopadding">
			<input type="text" id="singleFieldTags" name="Tags" size=100% value="<?php 
    echo $story_Row['Tags'];
    ?>
">
		</td>
	</tr>
	<tr>

	<td>&nbsp;</td>
	<td class="nopadding">

<?php 
    // can only add comments and tasks if we know what story to attach them to
    if (!empty($_REQUEST['AID'])) {
        printMicromenu($story_Row['AID']);
        echo '<div class="hidden inline" id="alltasks_' . $story_Row['AID'] . '"></div>';
        echo '<div class="hidden" id="commentspops_' . $story_Row['AID'] . '"></div> ';
        echo '<div class="hidden" id="allupload_' . $story_Row['AID'] . '"></div> ';
        echo '<div class="auditdialog hidden" id="allaudits_' . $story_Row['AID'] . '"></div> ';
    }
    echo '<td></tr></table>';
    echo '	<input type="hidden" name="PID" value="' . $_REQUEST['PID'] . '">';
    echo '	<input type="hidden" name="IID" value="' . $_REQUEST['IID'] . '">';
    echo '	<input type="hidden" name="AID" value="' . $story_Row['AID'] . '">';
    if (empty($_REQUEST['gobackto'])) {
        echo '	<input type="hidden" name="gobackto" value="' . substr($_SERVER["HTTP_REFERER"], strrpos($_SERVER["HTTP_REFERER"], "/") + 1) . '">';
    } else {
        echo '	<input type="hidden" name="gobackto" value="' . $_REQUEST['gobackto'] . '">';
    }
    if (!$isReadonly) {