Exemplo n.º 1
0
<?php

require_once 'include/dbconfig.inc.php';
require_once 'include/common.php';
$user_details = check_user($_SESSION['user_identifier']);
if (!$user_details) {
    exit;
}
$sql = 'INSERT INTO task SET Story_AID="' . $_GET['AID'] . '", task.User_ID="' . $_GET['user'] . '", task.Rank="30000' . '", task.Desc="' . mysqli_real_escape_string($DBConn, $_GET['desc']) . '",  Done="0' . '", Expected_Hours="' . $_GET['exph'] . '", Actual_Hours="' . $_GET['acth'] . '";';
mysqli_query($DBConn, $sql);
auditit($_GET['PID'], $_GET['AID'], $_SESSION['Email'], 'Added task', $_GET['desc'] . ' Assign to:' . Get_User($_GET['user']) . ' Expect. h:' . $_GET['exph'] . ' Act. h:' . $_GET['acth']);
Exemplo n.º 2
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
}
Exemplo n.º 3
0
    echo $story_Row['AID'];
    ?>
" src="images/duplicate.png">&nbsp;
			<img title="Duplicate this Story and all its tasks (Owner, Status and Actual hours are reset )" class="dupestory hidden" id="dut<?php 
    echo $story_Row['AID'];
    ?>
" src="images/duplicateandtasks.png"></td>
		<td>
<?php 
    if ($Num_Children != 0) {
        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=' . $_REQUEST['PID'] . '&IID=' . $_REQUEST['IID'] . '">';
        echo '<img src="images/tree.png"></a>&nbsp; &nbsp;';
    }
    echo '#' . $story_Row['ID'] . '&nbsp; &nbsp;';
    echo 'created by: ' . Get_User($story_Row['Created_By_ID'], 0) . '&nbsp;on&nbsp;' . $story_Row['Created_Date'];
    if ($Num_Children == 0) {
        echo '<span class="hint">';
        echo 'Release: ';
        echo print_Release_Dropdown($story_Row['Release_ID']);
        echo '</span>';
    }
    ?>
		</td>
	</tr>
	<tr>
		<td>Summary:</td>
		<td>
			<input type="text" name="Summary" class="w100" value="<?php 
    echo $story_Row['Summary'];
    ?>
if ($Row = mysqli_fetch_assoc($Res)) {
    do {
        $Toggle = ($Toggle + 1) % 2;
        if ($Toggle == 1) {
            echo '<div id="container">';
        } else {
            echo '<div id="containerr">';
        }
        //############################
        echo '<div class="left">' . '<a title="Edit Story" href="story_Edit.php?AID=' . $Row['AID'] . '&PID=' . $Row['Project_ID'] . '&IID=' . $Row['Iteration_ID'] . '">' . $Row['Type'] . ': #' . $Row['ID'] . '</A>';
        $istring = Get_Iteration_Name($Row['Iteration_ID'], False);
        if ($istring != 'Backlog') {
            echo ' - ' . $istring;
        }
        if ($Row['Owner_ID'] != 0) {
            echo ' (' . Get_User($Row['Owner_ID'], 0) . ')';
        }
        echo '</div>';
        echo '<div class="right">' . $Row['Size'] . ' pts.' . '</div>';
        echo '<div id="summary">' . ' ' . $Row['Summary'] . ' ' . '</div>';
        echo '<div id="detail">';
        if (strlen($Row['As_A']) > 0) {
            echo '<b>As a:</b> ' . html_entity_decode($Row['As_A'], ENT_QUOTES) . '<br>';
        }
        echo '<b>' . $Project['Desc_1'] . '</b>' . html_entity_decode($Row['Col_1'], ENT_QUOTES) . '<br>';
        if (strlen($Row['Col_2']) > 0) {
            echo '<b>' . $Project['Desc_2'] . '</b> ' . html_entity_decode($Row['Col_2'], ENT_QUOTES) . '<br>';
        }
        if (strlen($Row['Acceptance']) > 0) {
            echo '<b>Acceptance Criteria:</b> ' . html_entity_decode($Row['Acceptance'], ENT_QUOTES) . '<br>';
        }
Exemplo n.º 5
0
if ($_REQUEST['Type'] == 'board') {
    $colcount == 0;
    echo '<br>';
    echo '<span id="' . $_REQUEST['PID'] . '">';
    $sql = 'SELECT * FROM story_status where story_status.Project_ID=' . $_REQUEST['PID'] . ' and LENGTH(story_status.Desc)>0 order by story_status.Order';
    $status_Res = mysqli_query($DBConn, $sql);
    if ($status_Row = mysqli_fetch_assoc($status_Res)) {
        do {
            $colcount = $colcount + 1;
            echo '<ul name= "' . $_REQUEST['IID'] . '" id="status' . $status_Row['Order'] . '" class="connectedSortable">';
            echo '<li class="scrumtitle" style="background: #' . $status_Row['RGB'] . ';">' . $status_Row['Desc'] . '</li>';
            $sqls = 'SELECT * FROM story where story.Project_ID=' . $_REQUEST['PID'] . ' and story.Iteration_ID=' . $_REQUEST['IID'] . ' and  0=(select count(Parent_Story_ID) from story as p where p.Parent_Story_ID = story.AID)' . ' and story.Status="' . $status_Row['Desc'] . '" order by story.Iteration_Rank';
            $story_Res = mysqli_query($DBConn, $sqls);
            if ($story_Row = mysqli_fetch_assoc($story_Res)) {
                do {
                    echo '<li class="scrumdetail" id="' . $story_Row['AID'] . '">' . '<a href="story_Edit.php?AID=' . $story_Row['AID'] . '&PID=' . $_REQUEST['PID'] . '&IID=' . $story_Row['Iteration_ID'] . '" title="Edit Story">#' . $story_Row['ID'] . '</a>' . ' - ' . substr($story_Row['Summary'], 0, 120) . '<br>' . html_entity_decode($story_Row['Col_1'], ENT_QUOTES) . '&nbsp;' . '<br>' . $story_Row['Type'] . '&nbsp;' . '&nbsp;[' . $story_Row['Size'] . ']&nbsp;' . '&nbsp;' . Get_User($story_Row['Owner_ID'], 1) . '&nbsp;' . '&nbsp;';
                    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, 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=' . $_REQUEST['PID'] . '&IID=' . $_REQUEST['IID'] . '">';
                                        echo ' #' . $parent_row['ID'] . '(' . $parent_row['Size'] . ')</a>, &nbsp;';
                                    }
                                }
                            } while ($parents_row = mysqli_fetch_assoc($parents_Res));