Skip to content

Commit

Permalink
minor html and css corrections (as shown by browser validation and ph…
Browse files Browse the repository at this point in the history
…pstorm inspections)
  • Loading branch information
torvista committed Jul 7, 2018
1 parent 5944c16 commit 65e4252
Show file tree
Hide file tree
Showing 11 changed files with 159 additions and 165 deletions.
70 changes: 38 additions & 32 deletions htdocs/install/check.php
Expand Up @@ -40,7 +40,7 @@

$langs->load("install");

// Now we load forced value from install.forced.php file.
// Now we load forced/pre-set values from install.forced.php file.
$useforcedwizard=false;
$forcedfile="./install.forced.php";
if ($conffile == "/etc/dolibarr/conf.php") $forcedfile="/etc/dolibarr/install.forced.php";
Expand All @@ -49,14 +49,14 @@
include_once $forcedfile;
}

dolibarr_install_syslog("--- check: Dolibarr install/upgrade process started");
dolibarr_install_syslog("- check: Dolibarr install/upgrade process started");


/*
* View
*/

pHeader('',''); // No next step for navigation buttons. Next step is defined by clik on links.
pHeader('',''); // No next step for navigation buttons. Next step is defined by click on links.


//print "<br>\n";
Expand Down Expand Up @@ -233,13 +233,13 @@
else dolibarr_install_syslog("check: failed to create a new file " . $conffile . " into current dir " . getcwd() . ". Please check permissions.", LOG_ERR);
}

// First install, we can't upgrade
// First install: no upgrade necessary/required
$allowupgrade=false;
}



// File is missng and can't be created
// File is missing and cannot be created
if (! file_exists($conffile))
{
print '<img src="../theme/eldy/img/error.png" alt="Error"> '.$langs->trans("ConfFileDoesNotExistsAndCouldNotBeCreated",$conffiletoshow);
Expand All @@ -258,7 +258,7 @@

$allowinstall=0;
}
// File exists but can't be modified
// File exists but cannot be modified
elseif (!is_writable($conffile))
{
if ($confexists)
Expand Down Expand Up @@ -294,7 +294,7 @@
}
print "<br>\n";

// Requirements ok, we display the next step button
// Requirements met/all ok: display the next step button
if ($checksok)
{
$ok=0;
Expand All @@ -307,7 +307,7 @@
{
if (! file_exists($dolibarr_main_document_root."/core/lib/admin.lib.php"))
{
print '<font class="error">A '.$conffiletoshow.' file exists with a dolibarr_main_document_root to '.$dolibarr_main_document_root.' that seems wrong. Try to fix or remove the '.$conffiletoshow.' file.</font><br>'."\n";
print '<span class="error">A '.$conffiletoshow.' file exists with a dolibarr_main_document_root to '.$dolibarr_main_document_root.' that seems wrong. Try to fix or remove the '.$conffiletoshow.' file.</span><br>'."\n";
dol_syslog("A '" . $conffiletoshow . "' file exists with a dolibarr_main_document_root to " . $dolibarr_main_document_root . " that seems wrong. Try to fix or remove the '" . $conffiletoshow . "' file.", LOG_WARNING);
}
else
Expand All @@ -326,7 +326,7 @@
else $dolibarr_main_db_pass = dol_decode($dolibarr_main_db_encrypted_pass);
}

// $conf is already instancied inside inc.php
// $conf already created in inc.php
$conf->db->type = $dolibarr_main_db_type;
$conf->db->host = $dolibarr_main_db_host;
$conf->db->port = $dolibarr_main_db_port;
Expand All @@ -342,7 +342,7 @@
}
}

// If a database access is available, we set more variable
// If database access is available, we set more variables
if ($ok)
{
if (empty($dolibarr_main_db_encryption)) $dolibarr_main_db_encryption=0;
Expand All @@ -364,8 +364,8 @@
// Show title
if (! empty($conf->global->MAIN_VERSION_LAST_UPGRADE) || ! empty($conf->global->MAIN_VERSION_LAST_INSTALL))
{
print $langs->trans("VersionLastUpgrade").': <b><font class="ok">'.(empty($conf->global->MAIN_VERSION_LAST_UPGRADE)?$conf->global->MAIN_VERSION_LAST_INSTALL:$conf->global->MAIN_VERSION_LAST_UPGRADE).'</font></b><br>';
print $langs->trans("VersionProgram").': <b><font class="ok">'.DOL_VERSION.'</font></b>';
print $langs->trans("VersionLastUpgrade").': <b><span class="ok">'.(empty($conf->global->MAIN_VERSION_LAST_UPGRADE)?$conf->global->MAIN_VERSION_LAST_INSTALL:$conf->global->MAIN_VERSION_LAST_UPGRADE).'</span></b><br>';
print $langs->trans("VersionProgram").': <b><span class="ok">'.DOL_VERSION.'</span></b>';
//print ' '.img_warning($langs->trans("RunningUpdateProcessMayBeRequired"));
print '<br>';
print '<br>';
Expand All @@ -375,17 +375,17 @@
print $langs->trans("InstallEasy")." ";
print $langs->trans("ChooseYourSetupMode");

print '<br><br>';
print '<br>';

$foundrecommandedchoice=0;

$available_choices = array();
$notavailable_choices = array();

// Show first install line
$choice = '<tr class="listofchoices"><td class="listofchoices nowrap" align="center"><b>'.$langs->trans("FreshInstall").'</b>';
$choice = "\n".'<tr><td class="nowrap center"><b>'.$langs->trans("FreshInstall").'</b>';
$choice .= '</td>';
$choice .= '<td class="listofchoices listofchoicesdesc">';
$choice .= '<td class="listofchoicesdesc">';
$choice .= $langs->trans("FreshInstallDesc");
if (empty($dolibarr_main_db_host)) // This means install process was not run
{
Expand All @@ -397,7 +397,7 @@
}

$choice .= '</td>';
$choice .= '<td class="listofchoices" align="center">';
$choice .= '<td class="center">';
if ($allowinstall)
{
$choice .= '<a class="button" href="fileconf.php?selectlang='.$setuplang.'">'.$langs->trans("Start").'</a>';
Expand Down Expand Up @@ -465,7 +465,7 @@

if ($ok)
{
if (count($dolibarrlastupgradeversionarray) >= 2) // If a database access is available and last upgrade version is known
if (count($dolibarrlastupgradeversionarray) >= 2) // If database access is available and last upgrade version is known
{
// Now we check if this is the first qualified choice
if ($allowupgrade && empty($foundrecommandedchoice) &&
Expand All @@ -477,30 +477,31 @@
}
}
else {
// We can not recommand a choice.
// We cannot recommend a choice.
// A version of install may be known, but we need last upgrade.
}
}

$choice .= '<tr class="listofchoices '.($recommended_choice ? 'choiceselected' : '').'">';
$choice .= '<td class="listofchoices nowrap" align="center"><b>'.$langs->trans("Upgrade").'<br>'.$newversionfrom.$newversionfrombis.' -> '.$newversionto.'</b></td>';
$choice .= '<td class="listofchoices listofchoicesdesc">';
$choice .= "\n".'<tr'.($recommended_choice ? ' class="choiceselected"' : '').'>';
$choice .= '<td class="nowrap center"><b>'.$langs->trans("Upgrade").'<br>'.$newversionfrom.$newversionfrombis.' -> '.$newversionto.'</b></td>';
$choice .= '<td class="listofchoicesdesc">';
$choice .= $langs->trans("UpgradeDesc");

if ($recommended_choice)
{
$choice .= '<br>';
//print $langs->trans("InstallChoiceRecommanded",DOL_VERSION,$conf->global->MAIN_VERSION_LAST_UPGRADE);
$choice .= '<div class="center"><div class="ok">'.$langs->trans("InstallChoiceSuggested").'</div>';
if ($count < count($migarray)) // There is other choices after
$choice .= '<div class="center">';
$choice .= '<div class="ok">'.$langs->trans("InstallChoiceSuggested").'</div>';
if ($count < count($migarray)) // There are other choices after
{
print $langs->trans("MigrateIsDoneStepByStep",DOL_VERSION);
}
$choice .= '</div>';
}

$choice .= '</td>';
$choice .= '<td class="listofchoices" align="center">';
$choice .= '<td class="center">';
if ($allowupgrade)
{
$disabled=false;
Expand All @@ -512,8 +513,14 @@
{
$foundrecommandedchoice = 2;
}
if ($disabled) $choice .= '<span class="buttonDisable runupgrade"'.($disabled?' disabled="disabled"':'').' href="#">'.$langs->trans("NotAvailable").'</span>';
else $choice .= '<a class="button runupgrade"'.($disabled?' disabled="disabled"':'').' href="upgrade.php?action=upgrade'.($count<count($migrationscript)?'_'.$versionto:'').'&amp;selectlang='.$setuplang.'&amp;versionfrom='.$versionfrom.'&amp;versionto='.$versionto.'">'.$langs->trans("Start").'</a>';
if ($disabled)
{
$choice .= '<span class="button">'.$langs->trans("NotAvailable").'</span>';
}
else
{
$choice .= '<a class="button runupgrade" href="upgrade.php?action=upgrade'.($count<count($migrationscript)?'_'.$versionto:'').'&amp;selectlang='.$setuplang.'&amp;versionfrom='.$versionfrom.'&amp;versionto='.$versionto.'">'.$langs->trans("Start").'</a>';
}
}
else
{
Expand All @@ -537,28 +544,28 @@
}

// Array of install choices
print"\n";
print '<table width="100%" class="listofchoices">';
foreach ($available_choices as $choice) {
print $choice;
}

print '</table>';
print '</table>'."\n";

if (count($notavailable_choices)) {

print '<br>';
print '<div id="AShowChoices">';
print '<img src="../theme/eldy/img/1downarrow.png"> <a href="#">'.$langs->trans('ShowNotAvailableOptions').'</a>';
print '</div>';

print '<div id="navail_choices" style="display:none">';
print '<br>';
print "<br>\n";
print '<table width="100%" class="listofchoices">';
foreach ($notavailable_choices as $choice) {
print $choice;
}

print '</table>';
print '</table>'."\n";
print '</div>';
}

Expand Down Expand Up @@ -590,6 +597,5 @@
</script>';

dolibarr_install_syslog("--- check: end");
dolibarr_install_syslog("- check: end");
pFooter(1); // Never display next button

11 changes: 4 additions & 7 deletions htdocs/install/default.css
Expand Up @@ -199,17 +199,14 @@ input:-webkit-autofill {
-webkit-box-shadow: 0 0 0 50px #FBFFEA inset;
}

table.listofchoices, tr.listofchoices, td.listofchoices {
table.listofchoices, table.listofchoices tr, table.listofchoices td {
border-collapse: collapse;
padding: 4px;
color: #000000;
border: 1px solid #ccc !important;
line-height: 18px;
}

tr.listofchoices {
height: 42px;
}
.listofchoicesdesc {
color: #999 !important;
}
Expand All @@ -230,15 +227,15 @@ tr.listofchoices {
div.ok {
color: #114466;
}
font.ok {
span.ok {
color: #114466;
}

/* Warning */
div.warning {
color: #777711;
}
font.warning {
span.warning {
color: #777711;
}

Expand All @@ -249,7 +246,7 @@ div.error {
padding: 0.2em 0.2em 0.2em 0;
margin: 0.5em 0 0.5em 0;
}
font.error {
span.error {
color: #550000;
font-weight: bold;
}
Expand Down

0 comments on commit 65e4252

Please sign in to comment.