#A0000173088: Fix su lettura ul anonima.

This commit is contained in:
Giuseppe Scorrano 2019-03-07 18:22:55 +01:00
parent d0aed1ed17
commit 06a55e2a5c
5 changed files with 52 additions and 12 deletions

43
.githooks/commit-msg Normal file
View File

@ -0,0 +1,43 @@
#!/bin/sh
#
# An example hook script to check the commit log message.
# Called by "git commit" with one argument, the name of the file
# that has the commit message. The hook should exit with non-zero
# status after issuing an appropriate message if it wants to stop the
# commit. The hook is allowed to edit the commit message file.
#
# To enable this hook, rename this file to "commit-msg".
# Uncomment the below to add a Signed-off-by line to the message.
# Doing this in a hook is a bad idea in general, but the prepare-commit-msg
# hook is more suited to it.
#
# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p')
# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1"
# This example catches duplicate Signed-off-by lines.
USER_EMAIL=$(git log -1 --format=format:%ae HEAD)
USER_NAME=$(git log -1 --format=format:%an HEAD)
COMMIT_MESSAGE=$(cat $1)
if [[ $COMMIT_MESSAGE == "#"* ]];
then
ACTIVITY_ID=$(echo $COMMIT_MESSAGE | awk '{print $1;}')
ACTIVITY_ID=$(echo $ACTIVITY_ID | tr -d : | tr -d "#")
echo "Riconosciuta attivita: " $ACTIVITY_ID
curl -X POST "http://192.168.2.215:8080/ems-api/activity/createFromCommit?profileDb=INTEGRY&committerEmail=$USER_EMAIL" \
-d "commitMessage=$COMMIT_MESSAGE"
fi
#echo "TESTO: " $COMMIT_MESSAGE
#test "" = "$(grep '^Signed-off-by: ' "$1" |
# sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || {
# echo >&2 Duplicate Signed-off-by lines.
# exit 1
#}

View File

@ -40,7 +40,6 @@ public class ServerStatusChecker {
public void addCallback(RunnableArgs<Boolean> callback){
this.mCallback.add(callback);
}
public void removeCallback(RunnableArgs<Boolean> callback){

View File

@ -54,11 +54,7 @@ public class UtilityBarcode {
if(!UtilityString.isNullOrEmpty(barcode)) {
barcode = barcode.trim();
if(barcode.length() <= 7){
return Integer.parseInt(barcode.substring(3));
} else
return null;
return Integer.parseInt(barcode.substring(3));
} else
return null;
}

View File

@ -145,7 +145,13 @@ public class MainFragment extends Fragment implements ITitledFragment, IScrollab
cyclicRecover(sessionsIterator, onComplete, onFailed);
}, ex -> {
onFailed.run(ex);
if(ex.getMessage().contains("Dati collo non corretti")) {
ColliDataRecover.closeSession(recoveredMtbColtID);
} else {
onFailed.run(ex);
}
cyclicRecover(sessionsIterator, onComplete, onFailed);
});
} else {

View File

@ -27,9 +27,6 @@ public class PointMobileBarcodeReader implements BarcodeReaderInterface {
private static String TAG = PointMobileBarcodeReader.class.getName();
private int mBackupResultType = ScanConst.ResultType.DCD_RESULT_COPYPASTE;
public PointMobileBarcodeReader(Context context) {
this.mContext = context;
@ -51,8 +48,7 @@ public class PointMobileBarcodeReader implements BarcodeReaderInterface {
public void init() throws BarcodeAdapterNotFoundException {
if(isRightAdapter()){
try{
mBackupResultType = mScanManager.aDecodeGetResultType();
mScanManager.aDecodeSetTerminator(ScanConst.Terminator.DCD_TERMINATOR_NONE);
mScanManager.aDecodeSetResultType(ScanConst.ResultType.DCD_RESULT_USERMSG);
} catch (Exception ex) {
throw new BarcodeAdapterNotFoundException(getAdapterName());