Ejemplo n.º 1
0
function get_bug_summary_by_version($t_version, $stacktrace, $project_id)
{
    $info = get_stack_map($stacktrace);
    $exception = $info->exception;
    $method = "";
    $suffix = "";
    $size = count($info->stack);
    if ($size > 0) {
        require_once "ProjectAcraExt.php";
        $app_packages = get_project_package_list($project_id);
        foreach ($info->stack as $entry) {
            $func = $entry->method;
            foreach ($app_packages as $pack => $len) {
                if (strncmp($func, $pack, $len) === 0) {
                    $method = $entry->method;
                    $suffix = $entry->suffix;
                    break;
                }
            }
            if (strlen($method) > 0) {
                break;
            }
        }
    }
    if (strlen($exception) > 0) {
        $line = build_summary_text($exception, $method . $suffix);
    } else {
        $line = 'Acra report crash ' . $method . $suffix;
    }
    return $line;
}
Ejemplo n.º 2
0
            </div>
        </div>
    </div>
</div>
<script src="<?php 
echo plugin_file('chico.js');
?>
"></script>
<script>
    // Tabs
    <?php 
$t_bug_text = bug_get_text_field($id, 'description');
$t_restore_file = get_restore_file_by_version_name($t_bug->version);
$t_bug_text = restore_stacktrace_by_file($t_bug_text, $t_restore_file);
$t_bug_text = str_replace("\r", "", $t_bug_text);
$packages = get_project_package_list($t_bug->project_id);
?>
    var tabs = $(".YOUR_SELECTOR_Tabs").tabs();
    var div = document.getElementById('tab1-a');
    var packages = <?php 
echo json_encode(array_keys($packages));
?>
;
    var stacktrace = <?php 
echo json_encode($t_bug_text);
?>
;
    div.innerHTML = acra_buildStacktraceDiv(stacktrace, packages);
</script>
</body>
</html>
Ejemplo n.º 3
0
    function show_acra_detail_buttons_plugin()
    {
        require "ProjectAcraExt.php";
        $id = gpc_get_string("id", '');
        $t_bug = bug_get($id);
        $packages = get_project_package_list($t_bug->project_id);
        $t_bug_text = bug_get_text_field($id, 'description');
        $t_restore_file = get_restore_file_by_version_name($t_bug->version);
        $restore_map = get_restore_map($t_restore_file);
        $t_bug_text = restore_stacktrace_by_map($t_bug_text, $restore_map);
        $t_bug_text = str_replace("\r", "", $t_bug_text);
        $bugnotes = bugnote_get_all_bugnotes($id);
        ?>
        <link rel="stylesheet" type="text/css" href="<?php 
        echo plugin_file("chico.css");
        ?>
" />
        <link rel="stylesheet" type="text/css" href="<?php 
        echo plugin_file("acra_view_bug.css");
        ?>
" />
        <script type="text/javascript" src="<?php 
        echo plugin_file("acra_view_bug.js");
        ?>
"></script>
        <script type="text/javascript" src="<?php 
        echo plugin_file("fancyBox/fancybox.js");
        ?>
"></script>
        <link rel="stylesheet" type="text/css" href="<?php 
        echo plugin_file("fancyBox/fancybox.css");
        ?>
"
              media="screen"/>
        <style type="text/css">
            .acra_popup {
                width: 800px;
                height: 400px;
                display: none;
                padding: 0px;
            }

            .acra_frame {
                width: 100%;
                height: 100%;
            }
        </style>
        <div id="acra_dialog" style="display:none">
            <?php 
        foreach ($bugnotes as $note) {
            if (strlen($note->note_attr) > 0) {
                echo '<div class="acra_popup" id="acra_';
                echo sprintf("%06d", $note->note_attr);
                echo '" style="display: none;">';
                echo '<iframe class="acra_frame" src="index.php?acra_page=detail.php&acra_id=';
                echo sprintf("%06d", $note->note_attr);
                echo '"></iframe></div>';
                echo "\r\n";
            }
        }
        ?>
        </div>
        <script>
            //update stack trace
            var packages = <?php 
        echo json_encode(array_keys($packages));
        ?>
;
            var list = jQuery(".category");
            for (var i = 0; i < list.length; i++) {
                var e = list[i];
                var txt = e.innerText;
                if ("Description" == txt) {
                    e = e.nextSibling;
                    e.innerHTML = acra_buildStacktraceDiv(<?php 
        echo json_encode($t_bug_text);
        ?>
, packages);
                    break;
                }
            }

            //update notes
            var noteRow, noteCells, noteTextCell, restoredNoteHtml, acraDetailLink;
            <?php 
        foreach ($bugnotes as $note) {
            $t_bug_text = restore_stacktrace_by_map($note->note, $restore_map);
            $t_bug_text = json_encode($t_bug_text);
            ?>
noteRow = document.getElementById('c<?php 
            echo $note->id;
            ?>
');
                noteCells = noteRow.getElementsByClassName("bugnote-note-public");
                noteTextCell = noteCells[0];
                noteTextCell.innerHTML = acra_buildStacktraceDiv(<?php 
            echo $t_bug_text;
            ?>
, packages);

                <?php 
            if (strlen($note->note_attr)) {
                ?>
        acraDetailLink = document.createElement("div");
                acraDetailLink.innerHTML = '<a class="fancybox" href="#acra_<?php 
                echo sprintf("%06d", $note->note_attr);
                ?>
" class="button-small">Acra Detail</a>';
                noteRow.firstElementChild.lastElementChild.appendChild(acraDetailLink);
                <?php 
            }
            ?>

            <?php 
        }
        ?>

            var cells = jQuery("td");
            var reg = new RegExp(/^\s*ID\s*$/);
            var idCell = null;
            for (var i = 0; i < cells.length; i++) {
                var str = cells[i].innerText;
                if (reg.test(str)) {
                    idCell = cells[i];
                    break;
                }
            }
            if (idCell != null) {
                var shorts = idCell.parentElement.previousElementSibling.firstElementChild;
                jQuery(shorts).append('<span class="bracket-link">[&nbsp;<a href="index.php?acra_page=test.php&acra_id=<?php 
        echo gpc_get_string("id");
        ?>
">View ACRA more info</a>&nbsp;]</span>');
            }

            jQuery('.fancybox').fancybox();
        </script>
    <?php 
    }