Skip to content

Commit

Permalink
Merge pull request #1 from samilliken/master
Browse files Browse the repository at this point in the history
Update from main fork
  • Loading branch information
mullaneywt authored Sep 20, 2019
2 parents c18696e + b204a8b commit 3ea09d2
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 7 deletions.
11 changes: 11 additions & 0 deletions classes/Device.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -755,6 +755,17 @@ function UpdateDevice() {
}
}

// SUT #1179 - User somehow managed to set the position to 0 while leaving
// a height set and the way we build the rack specifically to not show
// position zero these devices won't show on the rack so shove this up above
// the rack and make them fix it
if($this->Position==0 && $this->Height==0){
$cab=new Cabinet();
$cab->CabinetID=$this->Cabinet;
$cab->GetCabinet();
$this->Position=$cab->CabinetHeight+1;
}

// Force all uppercase for labels
$this->Label=transform($this->Label);
$this->SerialNo=transform($this->SerialNo);
Expand Down
12 changes: 10 additions & 2 deletions config.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,19 @@ function UpdateConfig(){
}

$sql='update fac_Config set Value=\''.sanitize($valueStr).'\' where Parameter=\''.$key.'\'';
$dbh->query( $sql );
if(!$dbh->query($sql)){
$info=$dbh->errorInfo();
error_log("UpdateConfig::PDO Error: {$info[2]} SQL=$sql");
}
}else{
if(preg_match('/[m|w]Date/',$key)){
if($value!='now'){$value='blank';} // if someone puts a weird value in default it back to blank
}
$sql="update fac_Config set Value=\"".sanitize($value)."\" where Parameter=\"$key\";";
$dbh->query($sql);
if(!$dbh->query($sql)){
$info=$dbh->errorInfo();
error_log("UpdateConfig::PDO Error: {$info[2]} SQL=$sql");
}
}
}
return;
Expand All @@ -68,6 +74,8 @@ static function UpdateParameter($parameter,$value){
if($dbh->query($sql)){
return true;
}else{
$info=$dbh->errorInfo();
error_log("UpdateParamter::PDO Error: {$info[2]} SQL=$sql");
return false;
}
}
Expand Down
2 changes: 1 addition & 1 deletion css/inventory.php
Original file line number Diff line number Diff line change
Expand Up @@ -1069,7 +1069,7 @@
.device .table.style > div:nth-child(2n+1) > div:first-child {background-color: lightGray;border-left: 1px solid grey;}
.device .table > div > div {min-width: 100px;}
.device .caption {margin-top: 2em;}
.device .table .table .table, .right .table + .table {background-color: white;width: 100%;}
.device .table .table .table, .right .table + .table {background-color: white;width: 100%; height: 100%;}
.device .table .table .table > div > div {padding: 3px;}
.right .table + .table {margin-top: 1em;}

Expand Down
15 changes: 11 additions & 4 deletions devices.php
Original file line number Diff line number Diff line change
Expand Up @@ -954,7 +954,7 @@ function buildCustomAttributes($template, $device) {
} else if ($cvtype=="set") {
echo '<div><select name="',$inputname,'" id="',$inputname,'">';
foreach(explode(',',$dcaList[$customkey]->DefaultValue) as $dcaValue){
$selected=($customdata["value"]==$dcaValue)?' selected':'';
$selected=(trim($customdata["value"])==trim($dcaValue))?' selected':'';
print "\n\t<option value=\"$dcaValue\"$selected>$dcaValue</option>";
}
echo '</select></div>';
Expand Down Expand Up @@ -988,7 +988,7 @@ function buildCustomAttributes($template, $device) {
<link rel="stylesheet" href="css/jquery-ui.css" type="text/css">
<link rel="stylesheet" href="css/validationEngine.jquery.css" type="text/css">
<link rel="stylesheet" href="css/jquery-te-1.4.0.css" type="text/css">
<style type="text/css"></style>
<style type="text/css">#div { border: 1px solid red; margin: -1px; }</style>
<!--[if lt IE 9]>
<link rel="stylesheet" href="css/ie.css" type="text/css" />
<![endif]-->
Expand Down Expand Up @@ -2470,7 +2470,7 @@ function setPreferredLayout() {<?php if(isset($_COOKIE["layout"]) && strtolower(
print "\t\t\t</div><!-- END div.table -->\n\t\t</div>\n\t</div>\n";
}
?>
<div class="caption">
<div><div><div style="position: relative;">&nbsp;<div id="buttonbar" style="position: absolute; min-width: 400px; left: 0px; right: 0px; margin-left: auto; margin-right: auto; text-align: center;">
<?php
if($write){
if($dev->DeviceID >0){
Expand All @@ -2490,7 +2490,8 @@ function setPreferredLayout() {<?php if(isset($_COOKIE["layout"]) && strtolower(
}
?>

</div>
</div></div></div>
<div></div></div>
</div> <!-- END div.table -->
</div></div>
</div> <!-- END div.table -->
Expand Down Expand Up @@ -2673,6 +2674,12 @@ function linkifyolog(){
}
});

// Safari is garbage
// This is a hack to correct a problem with safari not rendering the table caption
// correctly. Instead I am putting a blank row at the bottom of the device connection
// table then using css to center it but it has to have the element set to the width
// of the table
$('#buttonbar').width($('#pandn').width());
});
</script>

Expand Down

0 comments on commit 3ea09d2

Please sign in to comment.