Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mininam solution to edit telephone number without automatical additio… #380

Open
wants to merge 1 commit into
base: WollMux_18.2
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
import de.muenchen.allg.itd51.wollmux.document.VisibilityElement;
import de.muenchen.allg.itd51.wollmux.slv.PrintBlockCommand;
import de.muenchen.allg.itd51.wollmux.util.L;
import de.muenchen.allg.itd51.wollmux.WollMuxFiles;

/**
* A document command with its properties like visibility, execution state and groups.
Expand Down Expand Up @@ -1162,12 +1163,19 @@ public InsertValue(ConfigThingy wmCmd, Bookmark bookmark) throws InvalidCommandE
currentSep = sep;
}

try
if(dbSpalte.compareToIgnoreCase("Telefon")==0 && isTelefonManually())
{
trafo = wmCmd.get("WM").get("TRAFO").toString();
} catch (NodeNotFoundException e)

}
else
{
// TRAFO is optional
try
{
trafo = wmCmd.get("WM").get("TRAFO").toString();
} catch (NodeNotFoundException e)
{
// TRAFO is optional
}
}
}

Expand Down Expand Up @@ -1203,6 +1211,39 @@ protected boolean insertsTextContent()
{
return true;
}
/**
* Check if Telephone number can be set manually, e.g by a mobile number.
*
* @return True if Telephone number can be set manually.
*/
protected boolean isTelefonManually()
{
ConfigThingy wmConf = WollMuxFiles.getWollmuxConf();
if (wmConf == null || wmConf.count() == 0)
{
return false;
}

ConfigThingy log = wmConf.query("SetTelefonManually");
if (log.count() > 0)
{
try
{
String mode = log.getLastChild().toString();

if (mode.compareToIgnoreCase("true") == 0 )
{
return true;
}
} catch (NodeNotFoundException x)
{
LOGGER.error("", x);
}
}

return false;
}

}

/**
Expand Down