projects
/
BackupPC.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Translated the five new strings.
[BackupPC.git]
/
lib
/
BackupPC
/
CGI
/
EditConfig.pm
diff --git
a/lib/BackupPC/CGI/EditConfig.pm
b/lib/BackupPC/CGI/EditConfig.pm
index
c0c327d
..
df38ebd
100644
(file)
--- a/
lib/BackupPC/CGI/EditConfig.pm
+++ b/
lib/BackupPC/CGI/EditConfig.pm
@@
-10,7
+10,7
@@
# Craig Barratt <cbarratt@users.sourceforge.net>
#
# COPYRIGHT
# Craig Barratt <cbarratt@users.sourceforge.net>
#
# COPYRIGHT
-# Copyright (C) 200
4
Craig Barratt
+# Copyright (C) 200
5
Craig Barratt
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@
-28,7
+28,7
@@
#
#========================================================================
#
#
#========================================================================
#
-# Version 3.0.0
alpha, released 23 Jan
2006.
+# Version 3.0.0
beta2, released 11 Nov
2006.
#
# See http://backuppc.sourceforge.net.
#
#
# See http://backuppc.sourceforge.net.
#
@@
-41,6
+41,7
@@
use BackupPC::CGI::Lib qw(:all);
use BackupPC::Config::Meta qw(:all);
use BackupPC::Storage;
use Data::Dumper;
use BackupPC::Config::Meta qw(:all);
use BackupPC::Storage;
use Data::Dumper;
+use Encode;
our %ConfigMenu = (
server => {
our %ConfigMenu = (
server => {
@@
-281,9
+282,11
@@
our %ConfigMenu = (
{name => "IncrKeepCnt"},
{name => "IncrKeepCntMin"},
{name => "IncrAgeMax"},
{name => "IncrKeepCnt"},
{name => "IncrKeepCntMin"},
{name => "IncrAgeMax"},
+ {name => "IncrLevels"},
{name => "IncrFill"},
{text => "CfgEdit_Title_Blackouts"},
{name => "IncrFill"},
{text => "CfgEdit_Title_Blackouts"},
+ {name => "BackupsDisable"},
{name => "BlackoutBadPingLimit"},
{name => "BlackoutGoodCnt"},
{name => "BlackoutPeriods"},
{name => "BlackoutBadPingLimit"},
{name => "BlackoutGoodCnt"},
{name => "BlackoutPeriods"},
@@
-320,6
+323,7
@@
our %ConfigMenu = (
{name => "RestorePostUserCmd"},
{name => "ArchivePreUserCmd"},
{name => "ArchivePostUserCmd"},
{name => "RestorePostUserCmd"},
{name => "ArchivePreUserCmd"},
{name => "ArchivePostUserCmd"},
+ {name => "UserCmdCheckStatus"},
],
},
hosts => {
],
},
hosts => {
@@
-353,14
+357,14
@@
sub action
ErrorExit(eval("qq{$Lang->{Only_privileged_users_can_edit_config_files}}"));
}
ErrorExit(eval("qq{$Lang->{Only_privileged_users_can_edit_config_files}}"));
}
- if ( defined($In{menu}) || $In{
editAction} eq $Lang->{CfgEdit_Button_Save}
) {
+ if ( defined($In{menu}) || $In{
saveAction} eq "Save"
) {
$errors = errorCheck();
if ( %$errors ) {
#
# If there are errors, then go back to the same menu
#
$errors = errorCheck();
if ( %$errors ) {
#
# If there are errors, then go back to the same menu
#
- $In{
edit
Action} = "";
- $In{newMenu} = "";
+ $In{
save
Action} = "";
+
#
$In{newMenu} = "";
}
if ( (my $var = $In{overrideUncheck}) ne "" ) {
#
}
if ( (my $var = $In{overrideUncheck}) ne "" ) {
#
@@
-397,7
+401,7
@@
sub action
$newConf = { %$mainConf, %$hostConf };
}
$newConf = { %$mainConf, %$hostConf };
}
- if ( $In{
editAction} ne $Lang->{CfgEdit_Button_Save}
&& $In{newMenu} ne ""
+ if ( $In{
saveAction} ne "Save"
&& $In{newMenu} ne ""
&& defined($ConfigMenu{$In{newMenu}}) ) {
$menu = $In{newMenu};
}
&& defined($ConfigMenu{$In{newMenu}}) ) {
$menu = $In{newMenu};
}
@@
-471,9
+475,15
@@
EOF
$content .= eval("qq($Lang->{CfgEdit_Header_Host})");
}
$content .= eval("qq($Lang->{CfgEdit_Header_Host})");
}
- my $saveDisplay = "block";
- $saveDisplay = "none" if ( !$In{modified}
- || $In{editAction} eq $Lang->{CfgEdit_Button_Save} );
+ my $saveStyle = "";
+ my $saveColor = "#ff0000";
+
+ if ( $In{modified} && $In{saveAction} ne "Save" && !%$errors ) {
+ $saveStyle = "style=\"color:$saveColor\"";
+ } else {
+ $In{modified} = 0;
+ }
+
#
# Add action and host to the URL so the nav bar link is
# highlighted
#
# Add action and host to the URL so the nav bar link is
# highlighted
@@
-484,7
+494,7
@@
EOF
<table border="0" cellpadding="2">
<tr>$groupText</tr>
<tr>
<table border="0" cellpadding="2">
<tr>$groupText</tr>
<tr>
-<form method="post" name="
form1
" action="$url">
+<form method="post" name="
editForm
" action="$url">
<input type="hidden" name="host" value="$host">
<input type="hidden" name="menu" value="$menu">
<input type="hidden" name="newMenu" value="">
<input type="hidden" name="host" value="$host">
<input type="hidden" name="menu" value="$menu">
<input type="hidden" name="newMenu" value="">
@@
-494,65
+504,78
@@
EOF
<input type="hidden" name="overrideUncheck" value="">
<input type="hidden" name="addVar" value="">
<input type="hidden" name="action" value="editConfig">
<input type="hidden" name="overrideUncheck" value="">
<input type="hidden" name="addVar" value="">
<input type="hidden" name="action" value="editConfig">
-<input type="submit" class="editSaveButton" style="display: $saveDisplay" name="editAction" value="${EscHTML($Lang->{CfgEdit_Button_Save})}">
+<input type="hidden" name="saveAction" value="">
+<input type="button" class="editSaveButton" name="editAction"
+ value="${EscHTML($Lang->{CfgEdit_Button_Save})}" $saveStyle
+ onClick="saveSubmit();">
+<p>
<script language="javascript" type="text/javascript">
<!--
<script language="javascript" type="text/javascript">
<!--
+ function saveSubmit()
+ {
+ if ( document.editForm.modified.value != 0 ) {
+ document.editForm.saveAction.value = 'Save';
+ document.editForm.submit();
+ }
+ return false;
+ }
+
function deleteSubmit(varName)
{
function deleteSubmit(varName)
{
- document.
form1
.deleteVar.value = varName;
- document.
form1
.modified.value = 1;
- document.
form1
.submit();
+ document.
editForm
.deleteVar.value = varName;
+ document.
editForm
.modified.value = 1;
+ document.
editForm
.submit();
return;
}
function insertSubmit(varName)
{
return;
}
function insertSubmit(varName)
{
- document.
form1
.insertVar.value = varName;
- document.
form1
.modified.value = 1;
- document.
form1
.submit();
+ document.
editForm
.insertVar.value = varName;
+ document.
editForm
.modified.value = 1;
+ document.
editForm
.submit();
return;
}
function addSubmit(varName, checkKey)
{
if ( checkKey
return;
}
function addSubmit(varName, checkKey)
{
if ( checkKey
- && eval("document.
form1
.addVarKey_" + varName + ".value") == "" ) {
+ && eval("document.
editForm
.addVarKey_" + varName + ".value") == "" ) {
alert("New key must be non-empty");
return;
}
alert("New key must be non-empty");
return;
}
- document.
form1
.addVar.value = varName;
- document.
form1
.modified.value = 1;
- document.
form1
.submit();
+ document.
editForm
.addVar.value = varName;
+ document.
editForm
.modified.value = 1;
+ document.
editForm
.submit();
return;
}
function menuSubmit(menuName)
{
return;
}
function menuSubmit(menuName)
{
- document.
form1
.newMenu.value = menuName;
- document.
form1
.submit();
+ document.
editForm
.newMenu.value = menuName;
+ document.
editForm
.submit();
}
function varChange(varName)
{
}
function varChange(varName)
{
- document.
form1.editAction.style.display = "block"
;
-
document.form1.modified.value = 1
;
+ document.
editForm.modified.value = 1
;
+
document.editForm.editAction.style.color = '$saveColor'
;
}
function checkboxChange(varName)
{
}
function checkboxChange(varName)
{
- document.
form1.editAction.style.display = "block"
;
-
document.form1.modified.value = 1
;
+ document.
editForm.modified.value = 1
;
+
document.editForm.editAction.style.color = '$saveColor'
;
// Do nothing if the checkbox is now set
// Do nothing if the checkbox is now set
- if ( eval("document.
form1
.override_" + varName + ".checked") ) {
+ if ( eval("document.
editForm
.override_" + varName + ".checked") ) {
return false;
}
var allVars = {};
var varRE = new RegExp("^v_z_(" + varName + ".*)");
var origRE = new RegExp("^orig_z_(" + varName + ".*)");
return false;
}
var allVars = {};
var varRE = new RegExp("^v_z_(" + varName + ".*)");
var origRE = new RegExp("^orig_z_(" + varName + ".*)");
- for ( var i = 0 ; i < document.
form1
.elements.length ; i++ ) {
- var e = document.
form1
.elements[i];
+ for ( var i = 0 ; i < document.
editForm
.elements.length ; i++ ) {
+ var e = document.
editForm
.elements[i];
var re;
if ( (re = varRE.exec(e.name)) != null ) {
if ( allVars[re[1]] == null ) {
var re;
if ( (re = varRE.exec(e.name)) != null ) {
if ( allVars[re[1]] == null ) {
@@
-577,7
+600,7
@@
EOF
} else {
// copy the original variable values
//debugMsg("setting " + v);
} else {
// copy the original variable values
//debugMsg("setting " + v);
- eval("document.
form1.v_z_" + v + ".value = document.form1
.orig_z_" + v + ".value");
+ eval("document.
editForm.v_z_" + v + ".value = document.editForm
.orig_z_" + v + ".value");
}
}
if ( sameShape ) {
}
}
if ( sameShape ) {
@@
-585,17
+608,17
@@
EOF
} else {
// need to rebuild the form since the compound variable
// has changed shape
} else {
// need to rebuild the form since the compound variable
// has changed shape
- document.
form1
.overrideUncheck.value = varName;
- document.
form1
.submit();
+ document.
editForm
.overrideUncheck.value = varName;
+ document.
editForm
.submit();
return false;
}
}
function checkboxSet(varName)
{
return false;
}
}
function checkboxSet(varName)
{
- document.
form1.editAction.style.display = "block"
;
-
document.form1.modified.value = 1
;
- eval("document.
form1
.override_" + varName + ".checked = 1;");
+ document.
editForm.modified.value = 1
;
+
document.editForm.editAction.style.color = '$saveColor'
;
+ eval("document.
editForm
.override_" + varName + ".checked = 1;");
return false;
}
return false;
}
@@
-628,6
+651,7
@@
EOF
EOF
my $doneParam = {};
EOF
my $doneParam = {};
+ my $tblContent;
#
# There is a special case of the user deleting just the field
#
# There is a special case of the user deleting just the field
@@
-647,7
+671,7
@@
EOF
my $isError = %$errors;
my $isError = %$errors;
- if ( !$isError && $In{
editAction} eq $Lang->{CfgEdit_Button_Save}
) {
+ if ( !$isError && $In{
saveAction} eq "Save"
) {
my($mesg, $err);
if ( $host ne "" ) {
$hostConf = $bpc->ConfigDataRead($host) if ( !defined($hostConf) );
my($mesg, $err);
if ( $host ne "" ) {
$hostConf = $bpc->ConfigDataRead($host) if ( !defined($hostConf) );
@@
-703,16
+727,17
@@
EOF
$newConf->{Hosts} = $hostsSave;
}
if ( defined($err) ) {
$newConf->{Hosts} = $hostsSave;
}
if ( defined($err) ) {
- $
c
ontent .= <<EOF;
+ $
tblC
ontent .= <<EOF;
<tr><td colspan="2" class="border"><span class="editError">$err</span></td></tr>
EOF
}
$bpc->ServerConnect();
if ( $mesg ne "" ) {
(my $mesgBR = $mesg) =~ s/\n/<br>\n/g;
<tr><td colspan="2" class="border"><span class="editError">$err</span></td></tr>
EOF
}
$bpc->ServerConnect();
if ( $mesg ne "" ) {
(my $mesgBR = $mesg) =~ s/\n/<br>\n/g;
- $content .= <<EOF;
-<tr><td colspan="2" class="border"><span class="editComment">$mesgBR</span></td></tr>
-EOF
+ # uncomment this if you want the changes to be displayed
+# $tblContent .= <<EOF;
+#<tr><td colspan="2" class="border"><span class="editComment">$mesgBR</span></td></tr>
+#EOF
foreach my $str ( split(/\n/, $mesg) ) {
$bpc->ServerMesg("log $str") if ( $str ne "" );
}
foreach my $str ( split(/\n/, $mesg) ) {
$bpc->ServerMesg("log $str") if ( $str ne "" );
}
@@
-739,7
+764,7
@@
EOF
if ( defined($paramInfo->{text}) ) {
my $text = eval("qq($Lang->{$paramInfo->{text}})");
if ( defined($paramInfo->{text}) ) {
my $text = eval("qq($Lang->{$paramInfo->{text}})");
- $
c
ontent .= <<EOF;
+ $
tblC
ontent .= <<EOF;
<tr><td colspan="2" class="editHeader">$text</td></tr>
EOF
next;
<tr><td colspan="2" class="editHeader">$text</td></tr>
EOF
next;
@@
-755,7
+780,7
@@
EOF
$doneParam->{$param} = 1;
$doneParam->{$param} = 1;
- $
c
ontent .= fieldEditBuild($ConfigMeta{$param},
+ $
tblC
ontent .= fieldEditBuild($ConfigMeta{$param},
$param,
$newConf->{$param},
$errors,
$param,
$newConf->{$param},
$errors,
@@
-769,23
+794,32
@@
EOF
if ( defined($paramInfo->{comment}) ) {
my $topDir = $bpc->TopDir;
my $text = eval("qq($Lang->{$paramInfo->{comment}})");
if ( defined($paramInfo->{comment}) ) {
my $topDir = $bpc->TopDir;
my $text = eval("qq($Lang->{$paramInfo->{comment}})");
- $
c
ontent .= <<EOF;
+ $
tblC
ontent .= <<EOF;
<tr><td colspan="2" class="editComment">$text</td></tr>
EOF
}
}
#
<tr><td colspan="2" class="editComment">$text</td></tr>
EOF
}
}
#
- # Emit a
ny remaining errors - should not happen
+ # Emit a
summary of all the errors
#
#
+ my $errorTxt;
+
+ if ( %$errors ) {
+ $errorTxt .= <<EOF;
+<tr><td colspan="2" class="border"><span class="editError">$Lang->{CfgEdit_Error_No_Save}</span></td></tr>
+EOF
+ }
+
foreach my $param ( sort(keys(%$errors)) ) {
foreach my $param ( sort(keys(%$errors)) ) {
- $
conten
t .= <<EOF;
+ $
errorTx
t .= <<EOF;
<tr><td colspan="2" class="border"><span class="editError">$errors->{$param}</span></td></tr>
EOF
<tr><td colspan="2" class="border"><span class="editError">$errors->{$param}</span></td></tr>
EOF
- delete($errors->{$param});
}
$content .= <<EOF;
}
$content .= <<EOF;
+$errorTxt
+$tblContent
</table>
EOF
</table>
EOF
@@
-811,9
+845,8
@@
EOF
$doneParam->{$param} = 1;
}
$doneParam->{$param} = 1;
}
- if ( defined($In{menu}) || $In{editAction} eq $Lang->{CfgEdit_Button_Save} ) {
- if ( $In{editAction} eq $Lang->{CfgEdit_Button_Save}
- && !$userHost ) {
+ if ( defined($In{menu}) || $In{saveAction} eq "Save" ) {
+ if ( $In{saveAction} eq "Save" && !$userHost ) {
#
# Emit the new settings as orig_z_ parameters
#
#
# Emit the new settings as orig_z_ parameters
#
@@
-838,8
+871,9
@@
EOF
#
foreach my $var ( keys(%In) ) {
next if ( $var !~ /^orig_z_/ );
#
foreach my $var ( keys(%In) ) {
next if ( $var !~ /^orig_z_/ );
+ my $val = decode_utf8($In{$var});
$contentHidden .= <<EOF;
$contentHidden .= <<EOF;
-<input type="hidden" name="$var" value="${EscHTML($
In{$var}
)}">
+<input type="hidden" name="$var" value="${EscHTML($
val
)}">
EOF
}
}
EOF
}
}
@@
-943,7
+977,7
@@
sub fieldEditBuild
$size = $type->{size} if ( defined($type->{size}) );
#
$size = $type->{size} if ( defined($type->{size}) );
#
- # These fragments allow inline conent to be turned on and off
+ # These fragments allow inline con
t
ent to be turned on and off
#
# <tr><td colspan="2"><span id="id_$varName" style="display: none" class="editComment">$comment</span></td></tr>
# <tr><td class="border"><a href="javascript: displayHelp('$varName')">$varName</a>
#
# <tr><td colspan="2"><span id="id_$varName" style="display: none" class="editComment">$comment</span></td></tr>
# <tr><td class="border"><a href="javascript: displayHelp('$varName')">$varName</a>
@@
-1000,6
+1034,7
@@
EOF
$In{addVar} = "";
}
$content .= "<table border=\"1\" cellspacing=\"0\">\n";
$In{addVar} = "";
}
$content .= "<table border=\"1\" cellspacing=\"0\">\n";
+ my $colspan;
if ( ref($type) eq "HASH" && ref($type->{child}) eq "HASH"
&& $type->{child}{type} eq "horizHash" ) {
if ( ref($type) eq "HASH" && ref($type->{child}) eq "HASH"
&& $type->{child}{type} eq "horizHash" ) {
@@
-1011,8
+1046,9
@@
EOF
}
$content .= "<tr><td class=\"border\"></td>\n";
for ( my $i = 0 ; $i < @order ; $i++ ) {
}
$content .= "<tr><td class=\"border\"></td>\n";
for ( my $i = 0 ; $i < @order ; $i++ ) {
- $content .= "<td>$order[$i]</td>\n";
+ $content .= "<td
class=\"tableheader\"
>$order[$i]</td>\n";
}
}
+ $colspan = @order + 1;
$content .= "</tr>\n";
for ( my $i = 0 ; $i < @$varValue ; $i++ ) {
if ( @$varValue > 1 || $type->{emptyOk} ) {
$content .= "</tr>\n";
for ( my $i = 0 ; $i < @$varValue ; $i++ ) {
if ( @$varValue > 1 || $type->{emptyOk} ) {
@@
-1049,9
+1085,10
@@
EOF
$overrideVar, $overrideSet);
$content .= "</tr>\n";
}
$overrideVar, $overrideSet);
$content .= "</tr>\n";
}
+ $colspan = 2;
}
$content .= <<EOF;
}
$content .= <<EOF;
-<tr><td class="border"><input type="button" name="add_$varName" value="${EscHTML($Lang->{CfgEdit_Button_Add})}"
+<tr><td class="border"
colspan="$colspan"
><input type="button" name="add_$varName" value="${EscHTML($Lang->{CfgEdit_Button_Add})}"
onClick="addSubmit('$varName')"></td></tr>
</table>
EOF
onClick="addSubmit('$varName')"></td></tr>
</table>
EOF
@@
-1124,7
+1161,7
@@
EOF
if ( !$type->{noKeyEdit} ) {
$content .= <<EOF;
<tr><td class="border" colspan="2">
if ( !$type->{noKeyEdit} ) {
$content .= <<EOF;
<tr><td class="border" colspan="2">
-
New key: <input type="tex
t" name="addVarKey_$varName" size="20" maxlength="256" value="">
+
$Lang->{CfgEdit_Button_New_Key}: <input type="text" class="editTextInpu
t" name="addVarKey_$varName" size="20" maxlength="256" value="">
<input type="button" name="add_$varName" value="${EscHTML($Lang->{CfgEdit_Button_Add})}" onClick="addSubmit('$varName', 1)">
</td></tr>
EOF
<input type="button" name="add_$varName" value="${EscHTML($Lang->{CfgEdit_Button_Add})}" onClick="addSubmit('$varName', 1)">
</td></tr>
EOF
@@
-1175,7
+1212,6
@@
EOF
$content .= <<EOF;
<span class="editError">$errors->{$varName}</span><br>
EOF
$content .= <<EOF;
<span class="editError">$errors->{$varName}</span><br>
EOF
- delete($errors->{$varName});
}
my $onChange;
if ( defined($overrideVar) ) {
}
my $onChange;
if ( defined($overrideVar) ) {
@@
-1184,7
+1220,7
@@
EOF
$onChange .= "varChange('$overrideVar');";
}
if ( $onchangeSubmit ) {
$onChange .= "varChange('$overrideVar');";
}
if ( $onchangeSubmit ) {
- $onChange .= "document.
form1
.submit();";
+ $onChange .= "document.
editForm
.submit();";
}
if ( $onChange ne "" ) {
$onChange = " onChange=\"$onChange\"";
}
if ( $onChange ne "" ) {
$onChange = " onChange=\"$onChange\"";
@@
-1202,7
+1238,7
@@
EOF
}
my $textType = ($varName =~ /Passwd/) ? "password" : "text";
$content .= <<EOF;
}
my $textType = ($varName =~ /Passwd/) ? "password" : "text";
$content .= <<EOF;
-<input type="$textType" name="v_z_$varName" size="$size" maxlength="256" value="${EscHTML($varValue)}"$onChange>
+<input type="$textType"
class="editTextInput"
name="v_z_$varName" size="$size" maxlength="256" value="${EscHTML($varValue)}"$onChange>
EOF
} elsif ( $type->{type} eq "boolean" ) {
# checkbox
EOF
} elsif ( $type->{type} eq "boolean" ) {
# checkbox
@@
-1224,7
+1260,7
@@
EOF
my $rowCnt = $varValue =~ tr/\n//;
$rowCnt = 1 if ( $rowCnt < 1 );
$content .= <<EOF;
my $rowCnt = $varValue =~ tr/\n//;
$rowCnt = 1 if ( $rowCnt < 1 );
$content .= <<EOF;
-<textarea name="v_z_$varName" cols="$size" rows="$rowCnt"$onChange>${EscHTML($varValue)}</textarea>
+<textarea name="v_z_$varName" c
lass="editTextArea" c
ols="$size" rows="$rowCnt"$onChange>${EscHTML($varValue)}</textarea>
EOF
}
$content .= "</td>\n";
EOF
}
$content .= "</td>\n";
@@
-1395,21
+1431,40
@@
sub fieldInputParse
return 1;
}
return 1;
}
+ my $v = $In{"v_z_$varName"};
+
if ( $type->{type} eq "integer" ) {
if ( $type->{type} eq "integer" ) {
- $$value = 0 + $In{"v_z_$varName"};
+ if ( $v =~ /^-?\d+\s*$/s || $v eq "" ) {
+ $$value = 0 + $v;
+ } else {
+ # error value - keep in string form
+ $$value = $v;
+ }
} elsif ( $type->{type} eq "float" ) {
} elsif ( $type->{type} eq "float" ) {
- $$value = 0 + $In{"v_z_$varName"};
+ if ( $v =~ /^-?\d*(\.\d*)?\s*$/s || $v eq "" ) {
+ $$value = 0 + $v;
+ } else {
+ # error value - keep in string form
+ $$value = $v;
+ }
} elsif ( $type->{type} eq "shortlist" ) {
} elsif ( $type->{type} eq "shortlist" ) {
- $$value = [split(/[,\s]+/, $In{"v_z_$varName"})];
- if ( $type->{child} eq "float"
- || $type->{child} eq "integer"
- || $type->{child} eq "boolean" ) {
+ $$value = [split(/[,\s]+/, $v)];
+ if ( $type->{child} eq "float" ) {
foreach ( @$$value ) {
foreach ( @$$value ) {
- $_ += 0;
+ if ( /^-?\d*(\.\d*)?\s*$/s || $v eq "" ) {
+ $_ += 0;
+ }
+ }
+ } elsif ( $type->{child} eq "integer"
+ || $type->{child} eq "boolean" ) {
+ foreach ( @$$value ) {
+ if ( /^-?\d+\s*$/s || $v eq "" ) {
+ $_ += 0;
+ }
}
}
} else {
}
}
} else {
- $$value =
$In{"v_z_$varName"}
;
+ $$value =
decode_utf8($In{"v_z_$varName"})
;
$$value =~ s/\r\n/\n/g;
}
$$value = undef if ( $type->{undefIfEmpty} && $$value eq "" );
$$value =~ s/\r\n/\n/g;
}
$$value = undef if ( $type->{undefIfEmpty} && $$value eq "" );
@@
-1462,12
+1517,15
@@
sub configDiffMesg
(my $valueNew2 = $valueNew) =~ s/['\n\r]//g;
(my $valueOld2 = $valueOld) =~ s/['\n\r]//g;
(my $valueNew2 = $valueNew) =~ s/['\n\r]//g;
(my $valueOld2 = $valueOld) =~ s/['\n\r]//g;
+
+ next if ( $valueOld2 eq $valueNew2 );
+
$valueNew =~ s/\n/\\n/g;
$valueOld =~ s/\n/\\n/g;
$valueNew =~ s/\r/\\r/g;
$valueOld =~ s/\r/\\r/g;
$valueNew =~ s/\n/\\n/g;
$valueOld =~ s/\n/\\n/g;
$valueNew =~ s/\r/\\r/g;
$valueOld =~ s/\r/\\r/g;
- $mesg .= eval("qq($Lang->{CfgEdit_Log_Change_param_value})")
-
if ( $valueOld2 ne $valueNew2
);
+
+
$mesg .= eval("qq($Lang->{CfgEdit_Log_Change_param_value})"
);
}
}
return $mesg;
}
}
return $mesg;