show git branch + commit. +link to preview git changes (#2186)

* show git branch + commit.  +link to preview git changes

new feature
- bottom of upgrade screen shows git branch + commit you are on
- provides a link to github showing changes since then on your current branch

More eyes reviewing the code is always a plus.  The github link helps make it easier.

* Update index.php

Add translations and pretty it up a little.
This commit is contained in:
jebsolutions
2016-11-26 02:21:31 -05:00
committed by FusionPBX
parent d1717a7754
commit 8761304449

View File

@@ -65,10 +65,10 @@
$update_failed = false;
}
if (substr_count($response_line, "error") > 0) {
if (substr_count($response_line, "error") > 0) {
$update_failed = true;
break;
}
}
}
}
if ($update_failed) {
@@ -144,7 +144,23 @@
echo " ".$text['label-upgrade_source'];
echo " </td>\n";
echo " <td width='70%' class='vtable' style='height: 50px;'>\n";
echo " <input type='checkbox' name='do[source]' id='do_source' value='1'> &nbsp;".$text['description-upgrade_source']."\n";
echo " <input type='checkbox' name='do[source]' id='do_source' value='1'> &nbsp;".$text['description-upgrade_source']."<br />\n";
// show current git version info
chdir($_SERVER["PROJECT_ROOT"]);
exec("git rev-parse --abbrev-ref HEAD 2>&1", $git_current_branch, $branch_return_value);
$git_current_branch = $git_current_branch[0];
exec("git log --pretty=format:'%H' -n 1 2>&1", $git_current_commit, $commit_return_value);
$git_current_commit = $git_current_commit[0];
if (($branch_return_value == 0) && ($commit_return_value == 0)) {
echo $text['label-git_branch'].' '.$git_current_branch." \n";
//echo $text['label-git_commit'].' '." ";
echo "<a href='https://github.com/fusionpbx/fusionpbx/compare/";
echo $git_current_commit . "..." . "$git_current_branch' target='_blank'> \n";
echo $git_current_commit . "</a><br />\n";
echo "</a>";
}
echo " </td>\n";
echo "</tr>\n";
echo "</table>\n";
@@ -251,6 +267,7 @@
echo $_SESSION["schema"]["response"];
unset($_SESSION["schema"]["response"]);
}
echo "<br><br>";
//include the footer
require_once "resources/footer.php";