Example #1
0
function ContentForm(&$project, &$qastep, $view_history = "no")
{
    global $session;
    $have_admin = $project->qa_process->have_admin;
    $s = "";
    $s .= "<table cellspacing=\"2\" cellpadding=\"2\" width=\"100%\">\n";
    $s .= "<tr class=\"row0\">";
    // Project brief..
    $s .= "<tr class=\"row1\">";
    $s .= "<th width=\"30%\" class=\"prompt\"><b>Project:</b> </th>";
    $s .= "<td width=\"70%\">{$project->brief}</td>";
    $s .= "</tr>\n";
    // WRMS step link..
    $href = "/wr.php?request_id={$qastep->request_id}";
    $label = "[WRMS {$qastep->request_id}]";
    $title = "Go to the WRMS record for this QA step (new window)";
    $link = "<a href=\"{$href}\" title=\"{$title}\">{$label}</a>";
    // Step description..
    $s .= "<tr class=\"row1\">";
    $s .= "<th class=\"prompt\"><b>Step:</b> </th>";
    $s .= "<td>" . $qastep->qa_step_desc . "&nbsp;&nbsp;" . $link . "</td>";
    $s .= "</tr>\n";
    if ($qastep->qa_document_title != "") {
        $s .= "<tr class=\"row1\">";
        $s .= "<th class=\"prompt\"><b>Associated document:</b> </th>";
        $s .= "<td>" . $qastep->qa_document_title . "</td>";
        $s .= "</tr>\n";
        if ($qastep->qa_document_desc != "") {
            $s .= "<tr class=\"row1\">";
            $s .= "<th class=\"prompt\">&nbsp;</b> </th>";
            $s .= "<td>" . $qastep->qa_document_desc . "</td>";
            $s .= "</tr>\n";
        }
    }
    // Step notes..
    $s .= "<tr class=\"row1\">";
    $s .= "<th class=\"prompt\"><b>Notes for reviewers:</b> </th>";
    $s .= "<td>" . $qastep->qa_step_notes . "</td>";
    $s .= "</tr>\n";
    // Special notes..
    if ($qastep->special_notes != "") {
        $s .= "<tr class=\"row1\">";
        $s .= "<th class=\"prompt\"><b>Special notes:</b> </th>";
        $s .= "<td>" . $qastep->special_notes . "</td>";
        $s .= "</tr>\n";
    }
    // Assignment..
    if ($have_admin) {
        // Person selector for assignment..
        $F = "<select size=\"1\" name=\"new_assignment\">";
        $F .= "<option value=\"\">-- select a person --</option>\n";
        $extras = array($project->project_manager => $project->project_manager_fullname, $project->qa_mentor => $project->qa_mentor_fullname);
        $allocatables = $project->allocated + $extras;
        foreach ($allocatables as $user_no => $fullname) {
            $F .= "<option value=\"{$user_no}\"";
            if ($user_no == $qastep->responsible_usr) {
                $F .= " selected";
            }
            $F .= ">{$fullname}</option>\n";
        }
        $F .= "</select>\n";
        $s .= "<tr class=\"row0\">";
        $s .= "<th class=\"prompt\"><b>Assigned to:</b> </th>";
        $s .= "<td>" . $F . "</td>";
        $s .= "</tr>\n";
        $assignment = $qastep->assigned();
        if ($assignment !== false) {
            $s .= "<tr class=\"row0\">";
            $s .= "<th>&nbsp;</th>";
            $s .= "<td>" . "<b>Assigned " . datetime_to_displaydate(NICE_FULLDATETIME, $assignment["datetime"]) . "</b>" . "</td>";
            $s .= "</tr>\n";
        }
        $s .= "<tr class=\"row0\">";
        $s .= "<th>&nbsp;</th>";
        $s .= "<td style=\"padding-right:30px\">" . "<p><i>Assigning a person to " . "a QA Step makes them responsible for delivering it. QAMS will also send " . "an e-mail to them, containing all of the relevant details.</i></p>" . "</td>";
        $s .= "</tr>\n";
        // Empty text area for assignment notes..
        $F = "<textarea name=\"assignment_covernotes\" style=\"width:400px;height:150px\">";
        $F .= "</textarea>";
        $s .= "<tr class=\"row0\">";
        $s .= "<th class=\"prompt\"><b>Assignment notes:</b> </th>";
        $s .= "<td>" . $F . "</td>";
        $s .= "</tr>\n";
        $s .= "<tr class=\"row0\">";
        $s .= "<th>&nbsp;</th>";
        $s .= "<td style=\"padding-right:30px\">" . "<p><i>If you changed the above " . "assignee, any notes entered above will be e-mailed to them along with the " . "usual details.</i></p>" . "</td>";
        $s .= "</tr>\n";
    } else {
        $assigned = $qastep->responsible_fullname;
        $s .= "<tr class=\"row0\">";
        $s .= "<th class=\"prompt\"><b>Assigned to:</b> </th>";
        $s .= "<td>" . ($assigned != "" ? $assigned : "(nobody)") . "</td>";
        $s .= "</tr>\n";
    }
    // Overall status..
    $status = qa_status_coloured($qastep->overall_approval_status());
    $s .= "<tr class=\"row1\">";
    $s .= "<th class=\"prompt\"><b>Current overall status:</b> </th>";
    $s .= "<td>" . $status . "</td>";
    $s .= "</tr>\n";
    // Required approvals list..
    $s .= "<tr class=\"row1\">";
    $s .= "<th class=\"prompt\"><b>Current approval statuses:</b> </th>";
    $s .= "<td>" . $qastep->render_approval_types($have_admin) . "</td>";
    $s .= "</tr>\n";
    // Approvals being sought..
    $cnt = 0;
    $approvals = $qastep->approvals();
    $sought = array();
    foreach ($approvals as $ap_type_id => $approval) {
        if (($approval->approval_status == "p" || $approval->approval_status == "") && $approval->assigned_datetime != "") {
            $days = "<span style=\"color:orange\" title=\"Days since approval was requested\">";
            $days .= "(" . $approval->since_assignment_days() . " days)";
            $days .= "</span>";
            $seek = $approval->qa_approval_type_desc . "&nbsp;sought";
            if ($approval->assigned_fullname != "") {
                $seek .= "&nbsp;from&nbsp;" . $approval->assigned_fullname;
            }
            $seek .= "&nbsp;" . datetime_to_displaydate(NICE_FULLDATETIME, $approval->assigned_datetime);
            $seek .= "&nbsp;{$days}";
            $sought[] = $seek;
        }
    }
    if (count($sought) == 0) {
        $appseek_status = "(none)";
    } else {
        $appseek_status = implode("<br>", $sought) . "<br>";
    }
    if ($have_admin) {
        $href = "/qams-request-approval.php";
        $href .= "?project_id={$qastep->project_id}";
        $href .= "&step_id={$qastep->qa_step_id}";
        $label = "[Seek]";
        $title = "Seek an approval from someone for this QA step";
        $link = "<a href=\"{$href}\" title=\"{$title}\">{$label}</a>";
    } else {
        $link = "";
    }
    $s .= "<tr class=\"row1\">";
    $s .= "<th class=\"prompt\"><b>Approvals being sought:</b> </th>";
    $s .= "<td>" . "{$appseek_status} {$link}" . "</td>";
    $s .= "</tr>\n";
    // Approvals history..
    if ($view_history == "yes") {
        $s .= "<tr>";
        $s .= "<td colspan=\"2\" align=\"center\" style=\"text-align:center;vertical-align:bottom;height:50px\"><b>Approvals history</b></td>";
        $s .= "</tr>\n";
        $s .= "<tr class=\"row0\">";
        $s .= "<td colspan=\"2\" align=\"center\">" . $qastep->render_approvals_history() . "</td>";
        $s .= "</tr>\n";
    } else {
        $href = $REQUEST_URI;
        $href .= "?project_id={$qastep->project_id}";
        $href .= "&step_id={$qastep->qa_step_id}";
        $href .= "&view_history=yes";
        $label = "View Approvals History";
        $title = "View approvals history for this QA step";
        $link = "<a href=\"{$href}\" title=\"{$title}\">{$label}</a>";
        $s .= "<tr>";
        $s .= "<td colspan=\"2\" align=\"center\" style=\"text-align:center;vertical-align:bottom;height:50px\">";
        $s .= $link;
        $s .= "</td>";
        $s .= "</tr>\n";
    }
    // Vertical spacer
    $s .= "<tr class=\"row0\">";
    $s .= "<td colspan=\"2\" height=\"25\">&nbsp;</td>";
    $s .= "</tr>\n";
    $s .= "</table>\n";
    return $s;
}
Example #2
0
 /**
  * Render approvals history for this QA Step as an html table.
  * Approvals history is stored as an array of arrays, where the containing
  * array is by approval type ID. The history therefore comes out as grouped
  * by approval type, and in ascending datetime order within each group.
  * @return string An HTML table containing the approval history
  */
 function render_approvals_history()
 {
     global $session;
     $s = "";
     $this->get_approvals();
     if (count($this->approvals_history) > 0) {
         $s .= "<table cellspacing=\"2\" cellpadding=\"0\" width=\"100%\">\n";
         // Some headings..
         $s .= "<tr>";
         $s .= "<th width=\"25%\" class=\"cols\">Type of approval</th>";
         $s .= "<th width=\"25%\" class=\"cols\">Assigned to</th>";
         $s .= "<th width=\"34%\" class=\"cols\">Approval</th>";
         $s .= "<th width=\"16%\" class=\"cols\">Status</th>";
         $s .= "</tr>\n";
         foreach ($this->approvals_history as $approvals) {
             $appcnt = count($approvals);
             $cnt = 0;
             foreach ($approvals as $ap_type_id => $approval) {
                 $cnt += 1;
                 $status = $approval->approval_status;
                 $rowclass = $cnt == $appcnt ? "row1" : "row0";
                 $s .= "<tr class=\"{$rowclass}\">";
                 // Description..
                 $s .= "<td valign=\"top\" style=\"border-top:dotted lightgrey 1px\">";
                 $s .= $approval->qa_approval_type_desc;
                 if ($cnt == $appcnt) {
                     $s .= "<br>(current status)";
                 }
                 $s .= "</td>";
                 // Assignment..
                 if ($approval->assigned_datetime != "") {
                     $ass = $approval->assigned_fullname . "<br>";
                     $ass .= $session->FormattedDate($approval->assigned_datetime, 'timestamp');
                 } else {
                     $ass = "&nbsp;";
                 }
                 $s .= "<td valign=\"top\" style=\"border-top:dotted lightgrey 1px\">{$ass}</td>";
                 // Approval..
                 $app = "";
                 if ($approval->approval_datetime != "") {
                     if ($approval->assigned_username != $approval->approval_username) {
                         $app .= "<span style=\"color:red\" title=\"Approval by override\">";
                         $app .= $approval->approval_fullname . "</span>";
                     } else {
                         $app .= $approval->approval_fullname;
                     }
                     $app .= "<br>";
                     $app .= $session->FormattedDate($approval->approval_datetime, 'timestamp');
                     if ($approval->comment != "") {
                         $app .= "<br>{$approval->comment}";
                     }
                 } elseif ($approval->assigned_datetime != "") {
                     $app = "<span style=\"color:orange\">Awaiting approval.</span>";
                 } else {
                     $app = "&nbsp;";
                 }
                 $s .= "<td valign=\"top\" style=\"border-top:dotted lightgrey 1px\">{$app}</td>";
                 // Status..
                 $s .= "<td valign=\"top\" style=\"border-top:dotted lightgrey 1px\">" . qa_status_coloured($status) . "</td>";
                 $s .= "</tr>\n";
             }
             // foreach
         }
         // foreach
         $s .= "</table>\n";
     }
     return $s;
 }
Example #3
0
function ContentForm(&$project)
{
    global $session;
    $have_admin = $project->qa_process->have_admin;
    $s = "";
    $s .= "<table cellspacing=\"2\" cellpadding=\"2\" width=\"100%\">\n";
    $s .= "<tr class=\"row0\">";
    $s .= "<td colspan=\"2\" style=\"padding-left:20px;padding-right:50px\">" . "<p>This screen provides you with a snapshot report on the current QA status of the project. " . "The main area of interest here is the 'Steps Showing Activity' section, which lists those " . "quality assurance steps which have shown some activity - ie. have been assigned, have had " . "approvals requested, or approval decisions posted.</p>" . "<p>The list is presented in ascending date-time order, so the steps at the bottom are the " . "ones showing the most recent activity. Within each step we have a summary of the activity " . "itself, including who was assigned and when, followed by a list of approvals which have " . "been active.</p>" . "<p>At the bottom, an exception report is provided. This deals with approval ordering, in " . "particular the 'serious' issue of approving items before the QA Plan is approved. The " . "others are just warnings arising from approval of items before everything in the phase " . "preceding it has been approved.</p>" . "</td>";
    $s .= "</tr>\n";
    // Vertical spacer
    $s .= "<tr class=\"row0\">";
    $s .= "<td colspan=\"2\" height=\"15\">&nbsp;</td>";
    $s .= "</tr>\n";
    // Project details: brief desc, PM, QA mentor, Current phase..
    $s .= "<tr class=\"row1\">";
    $s .= "<th width=\"30%\" class=\"prompt\"><b>Project:</b> </th>";
    $s .= "<td width=\"70%\">{$project->brief}</td>";
    $s .= "</tr>\n";
    $s .= "<tr class=\"row1\">";
    $s .= "<th width=\"30%\" class=\"prompt\"><b>Description:</b> </th>";
    $s .= "<td width=\"70%\"><p>{$project->detailed}</p></td>";
    $s .= "</tr>\n";
    if ($project->project_manager_fullname != "") {
        $pmlink = "<a href=\"/user.php?user_no={$project->project_manager}\">";
        $pmlink .= $project->project_manager_fullname;
        $pmlink .= "</a>";
        $s .= "<tr class=\"row1\">";
        $s .= "<th width=\"30%\" class=\"prompt\"><b>Project Manager:</b> </th>";
        $s .= "<td width=\"70%\">{$pmlink}</td>";
        $s .= "</tr>\n";
    }
    if ($project->qa_mentor_fullname != "") {
        $qalink = "<a href=\"/user.php?user_no={$project->qa_mentor}\">";
        $qalink .= $project->qa_mentor_fullname;
        $qalink .= "</a>";
        $s .= "<tr class=\"row1\">";
        $s .= "<th width=\"30%\" class=\"prompt\"><b>QA Mentor:</b> </th>";
        $s .= "<td width=\"70%\">{$qalink}</td>";
        $s .= "</tr>\n";
    }
    $s .= "<tr class=\"row1\">";
    $s .= "<th width=\"30%\" class=\"prompt\"><b>Last activity phase:</b> </th>";
    $s .= "<td width=\"70%\">" . ($project->qa_phase != "" ? $project->qa_phase : "Not started") . "</td>";
    $s .= "</tr>\n";
    $s .= "<tr class=\"row1\">";
    $s .= "<th width=\"30%\" class=\"prompt\"><b>QA Plan Approved:</b> </th>";
    $s .= "<td width=\"70%\">" . ($project->qa_process->QAPlanApproved() ? "Yes" : "No") . "</td>";
    $s .= "</tr>\n";
    // Vertical spacer
    $s .= "<tr class=\"row0\">";
    $s .= "<td colspan=\"2\" height=\"15\">&nbsp;</td>";
    $s .= "</tr>\n";
    // Now grab the project step details in the orderings we need..
    $steps_reportrec = array();
    $steps_active = array();
    foreach ($project->qa_process->qa_steps as $step_id => $qastep) {
        // Acquire approvals data..
        $qastep->get_approvals();
        $step_status = $qastep->overall_approval_status();
        // Initialise data arrays..
        $stepdata = array();
        $appdata = array();
        $app_inactive = array();
        // Summary info for the step..
        $stepdata["desc"] = $qastep->qa_step_desc;
        $stepdata["status"] = $step_status;
        $stepdata["responsible_fullname"] = $qastep->responsible_fullname;
        $stepdata["responsible_ts"] = strtotime($qastep->responsible_datetime);
        // More stuff for steps which are active..
        if ($step_status != "" || $qastep->responsible_fullname != "") {
            $latest_activity_ts = $stepdata["responsible_ts"];
            // These approvals should already be ordered by ascending datetime..
            foreach ($qastep->approvals as $ap_type_id => $approval) {
                // Ascertain the latest activity timestamp..
                switch ($approval->approval_status) {
                    case "y":
                        $dt = $approval->approval_datetime;
                        break;
                    default:
                        $dt = $approval->assigned_datetime;
                }
                // switch
                $ts = strtotime($dt);
                if ($ts > $latest_activity_ts) {
                    $latest_activity_ts = $ts;
                }
                // Store our approval data for report..
                $apdesc = $approval->qa_approval_type_desc;
                $appdata[$apdesc]["status"] = $approval->approval_status;
                $appdata[$apdesc]["assigned_fullname"] = $approval->assigned_fullname;
                $appdata[$apdesc]["assigned_dt"] = $approval->assigned_datetime;
                $appdata[$apdesc]["assigned_days"] = $approval->since_assignment_days();
                $appdata[$apdesc]["approval_fullname"] = $approval->approval_fullname;
                $appdata[$apdesc]["approval_dt"] = $approval->approval_datetime;
                $appdata[$apdesc]["comment"] = $approval->comment;
            }
            // foreach step approval
            // Make a note of outstanding approvals required for this step..
            foreach ($qastep->approvals_required() as $ap_type_id => $apdesc) {
                if (!isset($appdata[$apdesc])) {
                    $app_inactive[$appreqd->qa_approval_type_id] = $apdesc;
                }
            }
            // foreach
            // Active steps. Can be ordered by timestamp later..
            $steps_active[$step_id] = $latest_activity_ts;
        }
        // Store any step approvals data..
        $stepdata["approvals"] = $appdata;
        // Store list of approvals still showing no activity..
        $stepdata["approvals_inactive"] = $app_inactive;
        // Save the report record..
        $steps_reportrec[$step_id] = $stepdata;
    }
    // foreach step
    // The report goes in its own table..
    $d = "";
    $d .= "<table cellspacing=\"2\" cellpadding=\"2\" width=\"100%\">\n";
    // Display active steps summary..
    if (count($steps_active) > 0) {
        $d .= "<tr><td class=\"cols\" colspan=\"3\">Steps Showing Activity</td></tr>\n";
        $d .= "<tr>";
        $d .= "<th width=\"60%\" style=\"text-align:left\">Step</th>";
        $d .= "<th width=\"20%\" style=\"text-align:left\">Last changed</th>";
        $d .= "<th width=\"20%\" style=\"text-align:left\">Current status</th>";
        $d .= "<tr>\n";
        asort($steps_active);
        foreach ($steps_active as $step_id => $ts) {
            $stepdata = $steps_reportrec[$step_id];
            // Step detail link..
            $href = "/qams-step-detail.php";
            $href .= "?project_id={$project->request_id}";
            $href .= "&step_id={$step_id}";
            $label = "[detail]";
            $title = "Go to the detail screen for this QA step (new window)";
            $link = "<a href=\"{$href}\" title=\"{$title}\" target=\"_new\">{$label}</a>";
            $d .= "<tr>";
            $d .= "<td style=\"border-top:solid 1px grey\"><b>" . $stepdata["desc"] . "</b>&nbsp;{$link}</td>";
            $d .= "<td style=\"border-top:solid 1px grey\">" . $session->FormattedDate(date('Y-m-d H:i:s', $ts), timestamp) . "</td>";
            $d .= "<td style=\"border-top:solid 1px grey\">" . qa_status_coloured($stepdata["status"]) . "</td>";
            $d .= "<tr>\n";
            // Step assignment..
            $a = "";
            if ($stepdata["responsible_fullname"] != "") {
                $a .= $stepdata["responsible_fullname"] . " was assigned to this step on ";
                $a .= $session->FormattedDate($stepdata["responsible_ts"], 'timestamp');
                $a .= ". ";
            }
            // Approvals activity..
            $approvals = $stepdata["approvals"];
            if (count($approvals) > 0) {
                foreach ($approvals as $apdesc => $appdata) {
                    $a .= "<p>{$apdesc}: ";
                    if ($appdata["assigned_fullname"] != "") {
                        $a .= "Approval sought from " . $appdata["assigned_fullname"] . " on ";
                        $a .= $session->FormattedDate($appdata["assigned_dt"], 'timestamp') . ". ";
                    }
                    if ($appdata["approval_fullname"] != "") {
                        $a .= "The relevant approval was then posted on ";
                        $a .= $session->FormattedDate($appdata["approval_dt"], 'timestamp');
                        if ($appdata["assigned_fullname"] != $appdata["approval_fullname"]) {
                            $a .= " by " . $appdata["approval_fullname"];
                            $a .= " <span style=\"color:red\">in override mode</span>";
                        }
                        $a .= ", setting the status to " . qa_status_coloured($appdata["status"]);
                    } else {
                        $a .= "<span style=\"color:orange\" title=\"Days since approval was requested\">";
                        $a .= "(" . $appdata["assigned_days"] . " days)";
                        $a .= "</span>";
                    }
                    if ($appdata["comment"] != "") {
                        $a .= " with the following comments:&nbsp;";
                        $a .= "<i>" . $appdata["comment"] . "</i>";
                    }
                    $a .= "</p>\n";
                }
                // foreach approval
            } else {
                $a = "<p>No approvals posted yet.</p>";
            }
            // Approvals inactive status..
            $app_inactive = $stepdata["approvals_inactive"];
            if (count($app_inactive) > 0) {
                if ($have_admin) {
                    $href = "/qams-request-approval.php";
                    $href .= "?project_id={$qastep->project_id}";
                    $href .= "&step_id={$qastep->qa_step_id}";
                    $label = "[Seek]";
                    $title = "Seek an approval from someone for this QA step";
                    $link = "&nbsp;&nbsp;<a href=\"{$href}\" title=\"{$title}\">{$label}</a>";
                } else {
                    $link = "";
                }
                $a .= "<p><span style=\"color:orange\">Approvals showing no activity:</span> " . implode(", ", array_values($app_inactive)) . $link . "</p>";
            }
            // Stuff into main table..
            $d .= "<tr>";
            $d .= "<td colspan=\"3\" style=\"padding-left:50px;padding-right:30px\">" . $a . "</td>";
            $d .= "<tr>\n";
        }
    }
    // Display inactive steps summary..
    $d .= "<tr><td class=\"cols\" colspan=\"3\">Steps not yet started</td></tr>\n";
    foreach ($steps_reportrec as $step_id => $stepdata) {
        if (in_array($step_id, array_keys($steps_active))) {
            continue;
        } else {
            $d .= "<tr>";
            $d .= "<td colspan=\"3\">" . $stepdata["desc"] . "</td>";
            $d .= "<tr>\n";
        }
    }
    // Warnings - here we are looking for major approvals which have been
    // acquired out of prescribed order..
    $exceptions = array();
    $d .= "<tr><td class=\"cols\" colspan=\"3\">Exception Report</td></tr>\n";
    // CHECK #1: Check for any steps approved before QA Plan..
    $steps = array_keys($project->qa_process->qa_steps);
    $exceptions["serious"] = order_check($project, array(STEP_ID_QAPLAN), $steps);
    // CHECK #2: Out-of-Order approvals..
    $exceptions["phases"] = array();
    $steps = array();
    $presteps = array();
    $q = "SELECT *";
    $q .= "  FROM qa_step s, qa_phase p";
    $q .= " WHERE p.qa_phase_desc <> 'Concept'";
    $q .= "   AND s.qa_phase=p.qa_phase";
    $q .= " ORDER BY p.qa_phase_order, s.qa_step_order";
    $qry = new PGQuery($q);
    if ($qry->Exec("qams-project-status.php approval order check") && $qry->rows > 0) {
        while ($row = $qry->Fetch()) {
            $phase = $row->qa_phase;
            if ($phase != $last_phase) {
                if (count($presteps) > 0 && count($steps) > 0) {
                    $excepts = order_check($project, $presteps, $steps);
                    if (count($excepts) > 0) {
                        $exceptions["phases"][] = "<i>{$last_phase} Phase</i>";
                        $exceptions["phases"] = array_merge($exceptions["phases"], $excepts);
                        $exceptions["phases"][] = "&nbsp;";
                    }
                }
                // Check next phase against all steps which go before..
                $presteps = array_merge($presteps, $steps);
                $steps = array();
                $last_phase = $phase;
            }
            // Filling steps array..
            $steps[] = $row->qa_step_id;
        }
        // while
        // And do the final pair of phases..
        if (count($presteps) > 0 && count($steps) > 0) {
            $excepts = order_check($project, $presteps, $steps);
            if (count($excepts) > 0) {
                $exceptions["phases"][] = "<i>{$last_phase} Phase</i>";
                $exceptions["phases"] = array_merge($exceptions["phases"], $excepts);
                $exceptions["phases"][] = "&nbsp;";
            }
        }
    }
    // Now produce the output, if any exists..
    if (count($exceptions["serious"]) > 0) {
        $d .= "<tr><td colspan=\"3\"><b>QA Plan Exceptions:</b></td></tr>\n";
        foreach ($exceptions["serious"] as $exceptline) {
            $d .= "<tr><td colspan=\"3\"><span style=\"color:red\">{$exceptline}</span></td></tr>\n";
        }
    }
    if (count($exceptions["phases"]) > 0) {
        $d .= "<tr><td colspan=\"3\" height=\"15\">&nbsp;</td></tr>\n";
        $d .= "<tr><td colspan=\"3\"><b>Out-of-Order Approvals:</b></td></tr>\n";
        foreach ($exceptions["phases"] as $exceptline) {
            $d .= "<tr><td colspan=\"3\">{$exceptline}</td></tr>\n";
        }
    }
    $d .= "</table>\n";
    // Put report table into main table cell/row..
    $s .= "<tr class=\"row0\">";
    $s .= "<td colspan=\"2\">" . $d . "</td>\n";
    $s .= "</tr>\n";
    // Vertical spacer
    $s .= "<tr class=\"row0\">";
    $s .= "<td colspan=\"2\" height=\"25\">&nbsp;</td>";
    $s .= "</tr>\n";
    $s .= "</table>\n";
    return $s;
}
Example #4
0
function ContentForm(&$project, &$qastep)
{
    global $have_admin;
    $s = "";
    $s .= "<table cellspacing=\"2\" cellpadding=\"2\" width=\"100%\">\n";
    $s .= "<tr class=\"row0\">";
    $s .= "<td colspan=\"2\" style=\"padding-left:20px;padding-right:50px\">" . "<p>The information and fields below are to help you obtain a Quality Assurance Approval " . "from a nominated reviewer. The reviewer has to be someone 'allocated' to the project, " . "so if you don't find them on the list, you will need to add them to the project (use " . "the Edit Project link) and then return to this screen once that is done.</p>" . "<p>When you click on the 'Request Approval' button QAMS will e-mail the selected reviewer " . "with a request for approval. The e-mail will contain links to the WRMS associated with this " . "QA Step, <b><u>to which you should have attached any relevant document(s)</b></u> for " . "the review.</p>" . "</td>";
    $s .= "</tr>\n";
    // Vertical spacer
    $s .= "<tr class=\"row0\">";
    $s .= "<td colspan=\"2\" height=\"15\">&nbsp;</td>";
    $s .= "</tr>\n";
    // Project brief..
    $s .= "<tr class=\"row1\">";
    $s .= "<th width=\"30%\" class=\"prompt\"><b>Project:</b> </th>";
    $s .= "<td width=\"70%\">{$project->brief}</td>";
    $s .= "</tr>\n";
    // WRMS step link..
    $href = "/wr.php?request_id={$qastep->request_id}";
    $label = "[WRMS {$qastep->request_id}]";
    $title = "Go to the WRMS record for this QA step (new window)";
    $link = "<a href=\"{$href}\" title=\"{$title}\">{$label}</a>";
    // Step description..
    $s .= "<tr class=\"row1\">";
    $s .= "<th class=\"prompt\"><b>Step to approve:</b> </th>";
    $s .= "<td>" . $qastep->qa_step_desc . "&nbsp;&nbsp;" . $link . "</td>";
    $s .= "</tr>\n";
    // Step notes..
    $s .= "<tr class=\"row1\">";
    $s .= "<th class=\"prompt\"><b>Notes:</b> </th>";
    $s .= "<td><p>" . $qastep->qa_step_notes . "</p></td>";
    $s .= "</tr>\n";
    // Special notes..
    if ($qastep->special_notes != "") {
        $s .= "<tr class=\"row1\">";
        $s .= "<th class=\"prompt\"><b>Special notes:</b> </th>";
        $s .= "<td>" . $qastep->special_notes . "</td>";
        $s .= "</tr>\n";
    }
    // Overall status..
    $status = qa_status_coloured($qastep->overall_approval_status());
    $s .= "<tr class=\"row1\">";
    $s .= "<th class=\"prompt\"><b>Current overall status:</b> </th>";
    $s .= "<td>{$status}</td>";
    $s .= "</tr>\n";
    // Required approvals list..
    $s .= "<tr class=\"row1\">";
    $s .= "<th class=\"prompt\"><b>Current approval statuses:</b> </th>";
    $s .= "<td>" . $qastep->render_approval_types(false, true) . "</td>";
    $s .= "</tr>\n";
    // Request from person..
    $F = "<select size=\"1\" name=\"approval_from_person\">";
    $F .= "<option value=\"\">-- select a person --</option>\n";
    $extras = array();
    if (isset($project->user_no) && isset($project->fullname)) {
        $extras[$project->user_no] = $project->fullname;
    }
    $extras[$project->project_manager] = $project->project_manager_fullname;
    $extras[$project->qa_mentor] = $project->qa_mentor_fullname;
    $requestors = $extras + $project->allocated;
    foreach ($requestors as $user_no => $fullname) {
        $F .= "<option value=\"{$user_no}\">{$fullname}</option>\n";
    }
    $F .= "</select>\n";
    $s .= "<tr class=\"row1\">";
    $s .= "<th class=\"prompt\"><b>Send to this reviewer:</b> </th>";
    $s .= "<td>" . $F . "</td>";
    $s .= "</tr>\n";
    // Approval type to request..
    $F = "<select size=\"1\" name=\"approval_type\">";
    $F .= "<option value=\"\">-- select an approval type --</option>\n";
    foreach ($qastep->approvals_required() as $ap_type_id => $ap_type_desc) {
        $F .= "<option value=\"{$ap_type_id}\"";
        $F .= ">{$ap_type_desc}</option>\n";
    }
    $s .= "<tr class=\"row1\">";
    $s .= "<th class=\"prompt\"><b>Requesting this approval:</b> </th>";
    $s .= "<td>" . $F . "</td>";
    $s .= "</tr>\n";
    $F = "<textarea name=\"approval_covernotes\" style=\"width:400px;height:150px\">";
    $F .= "</textarea>";
    $s .= "<tr class=\"row1\">";
    $s .= "<th class=\"prompt\"><b>Covering notes:</b> </th>";
    $s .= "<td>" . $F . "</td>";
    $s .= "</tr>\n";
    // Vertical spacer
    $s .= "<tr class=\"row0\">";
    $s .= "<td colspan=\"2\" height=\"15\">&nbsp;</td>";
    $s .= "</tr>\n";
    $s .= "<tr class=\"row0\">";
    $s .= "<td colspan=\"2\" style=\"padding-left:20px;padding-right:50px\">" . "<p>The e-mail will also contain clickable links for the recipient to either " . "Approve or Refuse the request. If the above all looks ok, then click the " . "button below to send the e-mail off.</p>" . "</td>";
    $s .= "</tr>\n";
    // Vertical spacer
    $s .= "<tr class=\"row0\">";
    $s .= "<td colspan=\"2\" height=\"25\">&nbsp;</td>";
    $s .= "</tr>\n";
    $s .= "</table>\n";
    return $s;
}