changed progress bar on upload page

This commit is contained in:
Roland Gruber 2011-12-22 08:43:17 +00:00
parent b6096e05bc
commit 792cc00a1d
3 changed files with 37 additions and 8 deletions

View File

@ -205,6 +205,10 @@ tr.highlight {
white-space: nowrap; white-space: nowrap;
} }
div.ui-progressbar-value {
background-image: url(images/pbar-ani.gif);
}
/** /**
* table style for delete.php * table style for delete.php
* *

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

View File

@ -69,10 +69,17 @@ if (($_SESSION['mass_counter'] < sizeof($accounts)) || !isset($_SESSION['mass_po
echo "<div class=\"title\">\n"; echo "<div class=\"title\">\n";
echo "<h2 class=\"titleText\">" . _("LDAP upload in progress. Please wait.") . "</h2>\n"; echo "<h2 class=\"titleText\">" . _("LDAP upload in progress. Please wait.") . "</h2>\n";
echo "</div>"; echo "</div>";
echo "<table align=\"center\" width=\"80%\" style=\"border-color: grey\" border=\"2\" cellspacing=\"0\" rules=\"none\">\n"; $progress = ($_SESSION['mass_counter'] * 100) / sizeof($accounts);
echo "<tr><td bgcolor=\"blue\" width=\"" . ($_SESSION['mass_counter'] * 100) / sizeof($accounts) . "%\">&nbsp;</td>"; ?>
echo "<td bgcolor=\"grey\" width=\"" . (100 - (($_SESSION['mass_counter'] * 100) / sizeof($accounts))) . "%\">&nbsp;</td></tr>\n"; <div id="progressbarGeneral"></div>
echo "</table>"; <script type="text/javascript">
$(function() {
$( "#progressbarGeneral" ).progressbar({
value: <?php echo $progress; ?>
});
});
</script>
<?php
flush(); // send HTML to browser flush(); // send HTML to browser
// add accounts to LDAP // add accounts to LDAP
while (($_SESSION['mass_counter'] < sizeof($accounts)) && (($startTime + $maxTime) > time())) { while (($_SESSION['mass_counter'] < sizeof($accounts)) && (($startTime + $maxTime) > time())) {
@ -92,6 +99,17 @@ if (($_SESSION['mass_counter'] < sizeof($accounts)) || !isset($_SESSION['mass_po
} }
$_SESSION['mass_counter']++; $_SESSION['mass_counter']++;
} }
$progress = ($_SESSION['mass_counter'] * 100) / sizeof($accounts);
?>
<script type="text/javascript">
$(function() {
$( "#progressbarGeneral" ).progressbar({
value: <?php echo $progress; ?>
});
});
</script>
<?php
flush(); // send HTML to browser
// do post upload actions // do post upload actions
if ($_SESSION['mass_counter'] >= sizeof($accounts)) { if ($_SESSION['mass_counter'] >= sizeof($accounts)) {
$data = unserialize($_SESSION['ldap']->decrypt($_SESSION['mass_data'])); $data = unserialize($_SESSION['ldap']->decrypt($_SESSION['mass_data']));
@ -101,11 +119,18 @@ if (($_SESSION['mass_counter'] < sizeof($accounts)) || !isset($_SESSION['mass_po
} }
for ($i = 0; $i < sizeof($return['errors']); $i++) $_SESSION['mass_errors'][] = $return['errors'][$i]; for ($i = 0; $i < sizeof($return['errors']); $i++) $_SESSION['mass_errors'][] = $return['errors'][$i];
echo "<h1>" . _("Additional tasks for module:") . ' ' . getModuleAlias($return['module'], $_SESSION['mass_scope']) . "</h1>\n"; echo "<h1>" . _("Additional tasks for module:") . ' ' . getModuleAlias($return['module'], $_SESSION['mass_scope']) . "</h1>\n";
echo "<table align=\"center\" width=\"80%\" style=\"border-color: grey\" border=\"2\" cellspacing=\"0\" rules=\"none\">\n"; ?>
echo "<tr><td bgcolor=\"blue\" width=\"" . $return['progress'] . "%\">&nbsp;</td>"; <div id="progressbar<?php echo $return['module']; ?>"></div>
echo "<td bgcolor=\"grey\" width=\"" . (100 - $return['progress']) . "%\">&nbsp;</td></tr>\n"; <script type="text/javascript">
echo "</table>"; $(function() {
$( "#progressbar<?php echo $return['module']; ?>" ).progressbar({
value: <?php echo $return['progress']; ?>
});
});
</script>
<?php
flush(); flush();
die();
while (!isset($_SESSION['mass_postActions']['finished']) && (($startTime + $maxTime) > time())) { while (!isset($_SESSION['mass_postActions']['finished']) && (($startTime + $maxTime) > time())) {
$return = doUploadPostActions($_SESSION['mass_scope'], $data, $_SESSION['mass_ids'], $_SESSION['mass_failed'], $_SESSION['mass_selectedModules'], $accounts); $return = doUploadPostActions($_SESSION['mass_scope'], $data, $_SESSION['mass_ids'], $_SESSION['mass_failed'], $_SESSION['mass_selectedModules'], $accounts);
if ($return['status'] == 'finished') { if ($return['status'] == 'finished') {