Commit b14efd35 authored by Nastuzzi Samy's avatar Nastuzzi Samy

Merge branch 'release/v0.12.2' into develop

parents a224c32c 1f348dcc
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="fr.utc.simde.jessy"
android:versionCode="44"
android:versionName="0.12.1">
android:versionCode="45"
android:versionName="0.12.2">
<uses-permission android:name="android.permission.NFC" />
<uses-permission android:name="android.permission.INTERNET" />
......
......@@ -134,6 +134,8 @@ public class APIActivity extends BaseActivity implements ZXingScannerView.Result
return;
}
dialog.startLoading(APIActivity.this, getString(R.string.badge_read), getString(R.string.user_ginger_info_collecting));
new Thread() {
@Override
public void run() {
......@@ -277,8 +279,8 @@ public class APIActivity extends BaseActivity implements ZXingScannerView.Result
final AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(APIActivity.this);
alertDialogBuilder
.setTitle(getString(R.string.reservation_number) + finalApiResponse.getId())
.setMessage(getString(R.string.ticket_validated) + " (" + DateUtils.formatDateTime(APIActivity.this, finalApiResponse.getExpirationDate() * 1000, DateUtils.FORMAT_SHOW_DATE | DateUtils.FORMAT_NUMERIC_DATE | DateUtils.FORMAT_SHOW_TIME) + ")")
.setTitle(finalApiResponse.getId().isEmpty() ? getString(R.string.reservation_number) : (getString(R.string.reservation_number) + finalApiResponse.getId()))
.setMessage(getString(R.string.ticket_validated) + (finalApiResponse.getExpirationDate() == null ? "" : " (" + DateUtils.formatDateTime(APIActivity.this, finalApiResponse.getExpirationDate() * 1000, DateUtils.FORMAT_SHOW_DATE | DateUtils.FORMAT_NUMERIC_DATE | DateUtils.FORMAT_SHOW_TIME) + ")"))
.setCancelable(false)
.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
@Override
......@@ -339,7 +341,7 @@ public class APIActivity extends BaseActivity implements ZXingScannerView.Result
public void run() {
final AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(APIActivity.this);
alertDialogBuilder
.setTitle(getString(R.string.reservation_number) + apiResponse.getId())
.setTitle(apiResponse.getId().isEmpty() ? getString(R.string.reservation) : (getString(R.string.reservation_number) + apiResponse.getId()))
.setMessage(getString(R.string.ticket_maybe_falsified) + "\n" +
"QRCode:\n" +
" id: " + qrCodeResponse.getId() + "\n" +
......@@ -623,7 +625,7 @@ public class APIActivity extends BaseActivity implements ZXingScannerView.Result
public void run() {
final AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(APIActivity.this);
alertDialogBuilder
.setTitle(getString(R.string.reservation_number) + apiResponse.getId())
.setTitle(apiResponse.getId().isEmpty() ? getString(R.string.reservation) : (getString(R.string.reservation_number) + apiResponse.getId()))
.setMessage(getString(R.string.ticket_not_created_yet) + " (" + DateUtils.formatDateTime(APIActivity.this, apiResponse.getCreationDate() * 1000, DateUtils.FORMAT_SHOW_DATE | DateUtils.FORMAT_NUMERIC_DATE | DateUtils.FORMAT_SHOW_TIME) + ")")
.setCancelable(false)
.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
......@@ -653,7 +655,7 @@ public class APIActivity extends BaseActivity implements ZXingScannerView.Result
public void run() {
final AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(APIActivity.this);
alertDialogBuilder
.setTitle(getString(R.string.reservation_number) + apiResponse.getId())
.setTitle(apiResponse.getId().isEmpty() ? getString(R.string.reservation) : (getString(R.string.reservation_number) + apiResponse.getId()))
.setMessage(getString(R.string.ticket_expired) + " (" + DateUtils.formatDateTime(APIActivity.this, apiResponse.getExpirationDate() * 1000, DateUtils.FORMAT_SHOW_DATE | DateUtils.FORMAT_NUMERIC_DATE | DateUtils.FORMAT_SHOW_TIME) + ")")
.setCancelable(false)
.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
......@@ -692,7 +694,7 @@ public class APIActivity extends BaseActivity implements ZXingScannerView.Result
@Override
public void run() {
final AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(APIActivity.this);
alertDialogBuilder.setTitle(getString(R.string.reservation_number) + apiResponse.getId()).setCancelable(false);
alertDialogBuilder.setTitle(apiResponse.getId().isEmpty() ? getString(R.string.reservation) : (getString(R.string.reservation_number) + apiResponse.getId())).setCancelable(false);
Map<String, Map<String, String>> data = apiResponse.getData();
List<ArticleResponse> articleResponseList = null;
List<List<Integer>> articleIdList = apiResponse.getArticleList();
......@@ -812,7 +814,7 @@ public class APIActivity extends BaseActivity implements ZXingScannerView.Result
runOnUiThread(new Runnable() {
@Override
public void run() {
dialog.errorDialog(APIActivity.this, getString(R.string.reservation_number) + apiResponse.getId(), getString(R.string.api_no_data), new DialogInterface.OnClickListener() {
dialog.errorDialog(APIActivity.this, apiResponse.getId().isEmpty() ? getString(R.string.reservation) : (getString(R.string.reservation_number) + apiResponse.getId()), getString(R.string.api_no_data), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
resumeReading();
......@@ -877,7 +879,7 @@ public class APIActivity extends BaseActivity implements ZXingScannerView.Result
});
}
if (!(apiResponse.getArticleList().isEmpty() || apiResponse.getFoundationId() == null) || (apiResponse.getNegativeCommand() != null && apiResponse.getNegativeCommand().getCommand() != null))
if (!(apiResponse.getArticleList().isEmpty() || apiResponse.getFoundationId() == null) || (apiResponse.getNegativeCommand() != null && apiResponse.getNegativeCommand() != null))
alertDialogBuilder.setNegativeButton(apiResponse.getNegativeCommand() == null || apiResponse.getNegativeCommand().getName() == null ? getString(R.string.cancel) : apiResponse.getNegativeCommand().getName(), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
......@@ -1000,7 +1002,7 @@ public class APIActivity extends BaseActivity implements ZXingScannerView.Result
return;
}
dialog.startLoading(APIActivity.this, getString(R.string.reservation_number) + id, apiCommand == null || apiCommand.getDescription() == null ? getString(R.string.api_execution) : apiCommand.getDescription());
dialog.startLoading(APIActivity.this, id.isEmpty() ? getString(R.string.reservation) : (getString(R.string.reservation_number) + id), apiCommand == null || apiCommand.getDescription() == null ? getString(R.string.api_execution) : apiCommand.getDescription());
new Thread() {
@Override
......@@ -1042,7 +1044,7 @@ public class APIActivity extends BaseActivity implements ZXingScannerView.Result
Log.e(LOG_TAG, "error: " + message);
dialog.errorDialog(APIActivity.this, getString(R.string.reservation_number) + id, message, new DialogInterface.OnClickListener() {
dialog.errorDialog(APIActivity.this, id.isEmpty() ? getString(R.string.reservation) : (getString(R.string.reservation_number) + id), message, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
resumeReading();
......
......@@ -78,6 +78,13 @@ public class FoundationsOptionsActivity extends BaseActivity {
}
}
@Override
public void onResume() {
super.onResume();
config.setFoundation(-1, "");
}
@Override
protected void onIdentification(final String badgeId) {}
......
......@@ -53,7 +53,7 @@ public class API {
public int interact(final String id, final String command) throws Exception {
return request(
id + "/" + command
id + (command == null || command.isEmpty() ? "" : ("/" + command))
);
}
public int interact(final String id, final String command, Map<String, Object> postArgs) throws Exception {
......
......@@ -122,7 +122,7 @@
<string name="api_not_recognized">API non reconnue</string>
<string name="api_no_data">L\'API n\'a envoyé aucune information</string>
<string name="api_execution">Exécution de la commande API</string>
<string name="api_pay_caution">Attention, la commande "%s" fera payer la personne des articles affichés</string>
<string name="api_pay_caution">Attention, la commande \"%s\" fera payer la personne des articles affichés</string>
<string name="key">Clé d\'application</string>
<string name="key_registration">Enregistrement d\'une clé</string>
<string name="key_explication">Pour pouvoir fonctionner, l\'application a besoin d\'être enregistrée sous un nom précis et daté (date automatiquement ajoutée si non détectée). Ceci permettra par la suite de donner des droits à cet appareil</string>
......@@ -210,6 +210,7 @@
<string name="not_understood">Non compris</string>
<string name="getting_informations_from">Récupérations des informations depuis</string>
<string name="already_validated">Ce ticket a déjà été validé</string>
<string name="reservation">Réservation</string>
<string name="reservation_number">Réservation n°</string>
<string name="category_name">Nom de la catégorie</string>
<string name="category_add">Ajouter une nouvelle catégorie</string>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment