?> </th> <th><?php echo lang('errors'); ?> </th> </tr> </thead> <tbody> <?php foreach ($versions as $version) { ?> <tr> <td><?php echo date_from_timestamp($version->version_date_applied); ?> </td> <td><?php echo $version->version_file; ?> </td> <td><?php echo $version->version_sql_errors; ?> </td> </tr> <?php } ?> </tbody>
function print_component_row($component, $rev, $old_rev) { global $DB; $uc_name = ucfirst($component); $log_title = $uc_name; $log_file = "{$component}.log"; print "<tr>"; print "<td>" . maybe_link($rev, $old_rev, $log_file, $log_title) . "</td>"; $data = $DB->query("\n\t\t\t\tSELECT\ttime_taken, test_date, revision_used, failed, redo\n\t\t\t\tFROM\t\tcomponents\n\t\t\t\tWHERE\t\trevision == {$rev}\n\t\t\t\tAND\t\tcomponent == '{$component}'\n\t\t\t\t")->fetchAll(PDO::FETCH_ASSOC); if (isset($data[0])) { foreach ($data[0] as $key => $value) { if ($key == "test_date") { $value = date_from_timestamp($value); } else { if ($key == "time_taken") { $value = minutes_from_seconds($value); } } print "<td>{$value}</td>"; } } print "\n</tr>"; }
function affiche_toutes_notices_privees_groupe($id_groupe) { $retour = ""; $tab_champs = array('classes'); $current_group = get_group($id_groupe, $tab_champs); $info_groupe = $current_group['name'] . " (<em>" . $current_group['description'] . "</em>) en " . $current_group['classlist_string']; $sql = "SELECT * FROM ct_private_entry WHERE id_groupe='{$id_groupe}' AND contenu != ''\n\t\t\t\tAND date_ct != ''\n\t\t\t\tORDER BY date_ct;"; //echo "$sql<br />\n"; $res = mysqli_query($GLOBALS["mysqli"], $sql); if (mysqli_num_rows($res) > 0) { $id_ct_np_prec = ""; while ($lig = mysqli_fetch_object($res)) { $notice_privee = CahierTexteNoticePriveePeer::retrieveByPK($lig->id_ct); //$retour.="<div style='border: 1px solid black; margin: 0.5em; background-color:".$couleur_cellule['p']."'>\n"; $retour .= "<a name='liste_NP_notice_privee_" . $lig->id_ct . "'></a>\n"; $retour .= "<div style='border: 1px solid black; margin: 0.5em; margin-left:25px; background-color: #f6f3a8'>\n"; $retour .= "<div style='float: right; width: 4em; margin-right: 2em;'>" . date_from_timestamp($lig->date_ct) . "</div>\n"; if (my_strtoupper($lig->id_login) == my_strtoupper($_SESSION['login'])) { $retour .= '<div style="margin: 0px; float: left;">'; $retour .= "<a href=\"#\" onclick=\"javascript:\n\t\t\t\t\t\tid_groupe = '" . $lig->id_groupe . "';\n\t\t\t\t\t\tgetWinEditionNotice().setAjaxContent('ajax_edition_notice_privee.php?id_ct=" . $lig->id_ct . "',{ onComplete: function() {\tinitWysiwyg();}});\n\t\t\t\t\t\tupdateCalendarWithUnixDate(" . $lig->date_ct . ");\n\t\t\t\t\t\tgetWinListeNotices();\n\t\t\t\t\t\tnew Ajax.Updater('affichage_liste_notice', './ajax_affichages_liste_notices.php?id_groupe=" . $lig->id_groupe . "',{ onComplete:function() {updateDivModification();}});\n\t\t\t\t\t\tobject_en_cours_edition = 'notice_privee';\n\t\t\t\t\t"; $retour .= "\">"; $retour .= "<img style=\"border: 0px;\" src=\"../images/edit16.png\" alt=\"modifier\" title=\"modifier\" /></a>\n"; $retour .= " "; if ($notice_privee != null) { $retour .= "<a href=\"#\" onclick=\"javascript:\n\t\t\t\t\t\t\tcontenu_a_copier = '" . addslashes(htmlspecialchars($lig->contenu)) . "';\n\t\t\t\t\t\t\tct_a_importer_class='" . get_class($notice_privee) . "';\n\t\t\t\t\t\t\tid_ct_a_importer='" . $lig->id_ct . "';\n\t\t\t\t\t\t\tnew Ajax.Updater('affichage_liste_notice', './ajax_affichages_liste_notices.php?id_groupe=" . $lig->id_groupe . "&ct_a_importer_class=" . get_class($notice_privee) . "&id_ct_a_importer=" . $lig->id_ct . "',{ onComplete:function() {updateDivModification();} });\n\t\t\t\t\t\t\tgetWinListeNoticesPrivees().setAjaxContent('./ajax_liste_notices_privees.php?id_groupe=" . $lig->id_groupe . "&today=all#liste_NP_notice_privee_" . $id_ct_np_prec . "');\n\t\t\t\t\t\t\t\"><img style=\"border: 0px;\" src=\""; if (isset($_SESSION['ct_a_importer']) && $_SESSION['ct_a_importer'] == $notice_privee) { $retour .= "../images/icons/copy-16-gold.png"; } else { $retour .= "../images/icons/copy-16.png"; } $retour .= "\" alt=\"Copier\" title=\"Copier\" /></a>\n"; } $retour .= " "; $retour .= "<a href=\"#\" onclick=\"javascript:\n\t\t\t\t\tsuppressionNoticePrivee('" . strftime("%A %d %B %Y", $lig->date_ct) . "','" . $lig->id_ct . "', '" . $lig->id_groupe . "','" . add_token_in_js_func() . "');\n\t\t\t\t\tnew Ajax.Updater('affichage_derniere_notice', 'ajax_affichage_dernieres_notices.php', {onComplete : function () {updateDivModification();}});\n\t\t\t\t\tgetWinListeNoticesPrivees().setAjaxContent('./ajax_liste_notices_privees.php?id_groupe=" . $lig->id_groupe . "&today=all#liste_NP_notice_privee_" . $id_ct_np_prec . "');\n\t\t\t\t\treturn false;\n\t\t\t\t\t\"><img style=\"border: 0px;\" src=\"../images/delete16.png\" alt=\"supprimer\" title=\"supprimer\" /></a>\n"; $retour .= '</div>'; } $retour .= $lig->contenu; $retour .= "</div>\n"; $id_ct_np_prec = $lig->id_ct; } } else { $retour .= "Aucune Notice Privée pour cet enseignement (" . $info_groupe . ")."; } return $retour; }
function affiche_toutes_notices_privees_groupe($id_groupe) { $retour = ""; $tab_champs = array('classes'); $current_group = get_group($id_groupe, $tab_champs); $info_groupe = $current_group['name'] . " (<em>" . $current_group['description'] . "</em>) en " . $current_group['classlist_string']; $sql = "SELECT * FROM ct_private_entry WHERE id_groupe='{$id_groupe}' AND contenu != ''\n\t\t\t\tAND date_ct != ''\n\t\t\t\tORDER BY date_ct;"; //echo "$sql<br />\n"; $res = mysqli_query($GLOBALS["mysqli"], $sql); if (mysqli_num_rows($res) > 0) { while ($lig = mysqli_fetch_object($res)) { // //$retour.="<div style='border: 1px solid black; margin: 0.5em; background-color:".$couleur_cellule['p']."'>\n"; $retour .= "<div style='border: 1px solid black; margin: 0.5em; margin-left:25px; background-color: #f6f3a8'>\n"; $retour .= "<div style='float: right; width: 4em; margin-right: 1.5em;'>" . date_from_timestamp($lig->date_ct) . "</div>\n"; $retour .= $lig->contenu; $retour .= "</div>\n"; } } else { $retour .= "Aucune Notice Privée pour cet enseignement (" . $info_groupe . ")."; } return $retour; }
function run_main() { global $DB; $order = array("revision", "branch", "author", "pass", "fail", "skip", "timeout", "benchmark", "time_taken", "test_date", "revision_used", "failed", "redo"); foreach ($order as $header) { $headers[$header] = ucfirst(str_replace("_", " ", $header)); } $headers["revision"] = "Rev"; $headers["revision_used"] = "Test rev"; $headers["time_taken"] = "Time"; $headers["benchmark"] = "Bench"; $headers["timeout"] = "T/O"; print "<table class=info>\n"; print "<tr>\n"; foreach (array_values($headers) as $header) { print "<th>{$header}</th>\n"; } // Completed tests $query = $DB->query("\n\t\t\t\tSELECT\trevision, branch, author\n\t\t\t\tFROM\t\tcomplete\n\t\t\t\t"); $completes = $query->fetchAll(PDO::FETCH_ASSOC); // Test results $query = $DB->query("\n\t\t\t\tSELECT\trevision, pass, fail, skip, timeout\n\t\t\t\tFROM\t\ttests\n\t\t\t\tWHERE\t\ttestname == 'Total'\n\t\t\t\t"); $tests = $query->fetchAll(PDO::FETCH_ASSOC); // Benchmark results $query = $DB->query("\n\t\t\t\tSELECT\trevision, result as benchmark\n\t\t\t\tFROM\t\tbenchmarks\n\t\t\t\tWHERE\t\tmetric = 'All'\n\t\t\t\t"); $benchmarks = $query->fetchAll(PDO::FETCH_ASSOC); // Compile meta-results $query = $DB->query("\n\t\t\t\tSELECT\trevision, component, time_taken, test_date, revision_used, failed, redo\n\t\t\t\tFROM\t\tcomponents\n\t\t\t\tWHERE\t\tcomponent == 'compile'\n\t\t\t\t"); $compile_meta = $query->fetchAll(PDO::FETCH_ASSOC); // Test meta-results $query = $DB->query("\n\t\t\t\tSELECT\trevision, component, time_taken, test_date, revision_used, failed, redo\n\t\t\t\tFROM\t\tcomponents\n\t\t\t\tWHERE\t\tcomponent == 'test'\n\t\t\t\t"); $test_meta = $query->fetchAll(PDO::FETCH_ASSOC); // Bench meta-results $query = $DB->query("\n\t\t\t\tSELECT\trevision, component, time_taken, test_date, revision_used, failed, redo\n\t\t\t\tFROM\t\tcomponents\n\t\t\t\tWHERE\t\tcomponent == 'benchmark'\n\t\t\t\t"); $bench_meta = $query->fetchAll(PDO::FETCH_ASSOC); $query = $DB->query("SELECT revision FROM running"); $running = $query->fetchAll(PDO::FETCH_ASSOC); $running = $running[0]["revision"]; $revisions = array_reduce(array($completes, $tests, $benchmarks, $compile_meta, $test_meta, $bench_meta), "merge_results"); ksort($revisions); # process data foreach ($revisions as $rev => &$data) { // Always use the correct branch for relative data $branch = $data["branch"]; $data["difference"] = add_difference("pass", $data, $revisions[$prev[$branch]]); add_difference("fail", $data, $revisions[$prev[$branch]]); $prev[$branch] = $rev; } $revisions = array_reverse($revisions, true); # print out rows foreach ($revisions as $rev => $data) { print "<tr>\n"; # pick a color $color = ""; if ($data["difference"] > 0) { $color = get_good_color(); } elseif ($data["difference"] < 0) { $color = get_bad_color(); } unset($data["difference"]); if ($rev == $running) { $color = get_running_color(); } # add a link to revision $data["revision"] = "<a href=\"details.php?rev={$rev}\">{$rev}</a>"; if (isset($data["test_date"])) { $data["test_date"] = date_from_timestamp($data["test_date"]); } if (isset($data["time_taken"])) { $data["time_taken"] = minutes_from_seconds($data["time_taken"]); } foreach ($order as $header) { $value = $data[$header]; print "<td {$color}>{$value}</td>\n"; } print "<a/></tr>\n"; } }