Skip to content
This repository was archived by the owner on Dec 25, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
3429fad
Impl. History based on master
JustyAnOther Dec 1, 2019
bf53793
History - treat 1 day
JustyAnOther Dec 2, 2019
af7041f
showDetailActivity für HistoryFragment/Item
JustyAnOther Dec 2, 2019
826f9ce
Detailanzeige accountitem für HistoryItem erweitert
JustyAnOther Dec 2, 2019
dae2a1c
Export/Import History via JSON implementiert
JustyAnOther Dec 9, 2019
3f6af95
Import History: Import mit merge, Insert or update Rows
JustyAnOther Dec 23, 2019
ab3813e
Columns lending und deadline Konstanten definiert.
JustyAnOther Dec 26, 2019
447e905
Verlauf nach Chronik umbenannt in de/strings.xml
JustyAnOther Dec 31, 2019
6bfb730
refactoring: Methodennamen, mediaId bei Abgleich History-/LentItem nu…
JustyAnOther Jan 6, 2020
f85c002
case history bei fixNavigationSelection und getItem ergänzt
JustyAnOther Jan 6, 2020
5a1ee33
Preference history_maintain.
JustyAnOther Jan 6, 2020
64bf162
Remove History
JustyAnOther Jan 7, 2020
6930ec7
history-Texte überarbeitet
JustyAnOther Jan 10, 2020
d2f60a1
HistoryItem aus libopac/objects nach opacapp/storage verschoben.
JustyAnOther Jan 10, 2020
b0d1d9a
Reformat code bzgl. History-Änderungen
JustyAnOther Jan 10, 2020
ed9952c
LoaderId 1 als Konstante definiert und an weiteren Stellen verwendet
JustyAnOther Jan 12, 2020
a8aef4d
menuitem nav_history disablen wenn history_maintain = false
JustyAnOther Jan 12, 2020
c0f97c8
history_header mit Anzahl und Infos zur Sortierung umgesetzt
JustyAnOther Jan 12, 2020
8610636
member-variablen bereinigt: nur context und historyProviderUri merken…
JustyAnOther Jan 12, 2020
a3edb10
item.status = null vor showDetail, da sinnlos bei HistoryItem
JustyAnOther Jan 12, 2020
64b48f8
Update History auch ohne Activity
JustyAnOther Jan 12, 2020
7b032a3
History Liste: Cover/MediaType ausblenden, falls nie gefüllt
JustyAnOther Jan 19, 2020
bb1fab3
Status HistoryFragment sichern mit Hilfe SupportFragmentManager
JustyAnOther Jan 24, 2020
41a09e3
Bugs bei Nutzung FragmentManager für historyFragment gefixt
JustyAnOther Jan 24, 2020
454ef13
HistoryFragment state ohne FragmentManager store/restore
JustyAnOther Jan 24, 2020
1016cc5
Column status aus HistoryTable entfernt, OnUpgrade 1-2 implementiert
JustyAnOther Jan 25, 2020
2fa6348
Share im HistoryMenu nach hinten verschoben
JustyAnOther Jan 28, 2020
7aaa304
Share als Kommaseparierte Liste; Sort-Status in SharedPref sichern
JustyAnOther Jan 28, 2020
770c8ae
Bugfix ProlongCount/Deadline
JustyAnOther Jan 28, 2020
add9e9b
history_last_date nur anzeigen wenn Ausleihe beendet, d.h. !isLending
JustyAnOther Jan 30, 2020
827f56c
export-history-strings statt starred-strings verwenden in history-menu
JustyAnOther May 13, 2020
f61b085
fix: prolong-count als int (nicht date) behandeln
JustyAnOther May 13, 2020
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
5 changes: 5 additions & 0 deletions opacclient/opacapp/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,11 @@
android:authorities="${applicationId}.starprovider"
android:exported="false"/>

<provider
android:name="de.geeksfactory.opacclient.storage.HistoryContentProvider"
android:authorities="${applicationId}.historyprovider"
android:exported="false"/>

<meta-data
android:name="de.geeksfactory.opacclient.networking.CustomSSLGlideModule"
android:value="GlideModule"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
import de.geeksfactory.opacclient.searchfields.SearchField;
import de.geeksfactory.opacclient.searchfields.SearchQuery;
import de.geeksfactory.opacclient.storage.AccountDataSource;
import de.geeksfactory.opacclient.storage.HistoryContentProvider;
import de.geeksfactory.opacclient.storage.PreferenceDataSource;
import de.geeksfactory.opacclient.storage.StarContentProvider;
import de.geeksfactory.opacclient.utils.DebugTools;
Expand Down Expand Up @@ -98,6 +99,7 @@ public class OpacClient extends Application {
private static OpacClient instance;
public final boolean SLIDING_MENU = true;
private final Uri STAR_PROVIDER_STAR_URI = StarContentProvider.STAR_URI;
private final Uri HISTORY_PROVIDER_HIST_URI = HistoryContentProvider.HIST_URI;
protected Account account;
protected OpacApi api;
protected Library library;
Expand Down Expand Up @@ -175,6 +177,10 @@ public Uri getStarProviderStarUri() {
return STAR_PROVIDER_STAR_URI;
}

public Uri getHistoryProviderHistoryUri() {
return HISTORY_PROVIDER_HIST_URI;
}

public void addFirstAccount(Activity activity) {
Intent intent = new Intent(activity, LibraryListActivity.class);
intent.putExtra(LibraryListActivity.EXTRA_WELCOME, true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
import de.geeksfactory.opacclient.reminder.ReminderHelper;
import de.geeksfactory.opacclient.reminder.SyncAccountJobCreator;
import de.geeksfactory.opacclient.storage.AccountDataSource;
import de.geeksfactory.opacclient.storage.HistoryDataSource;
import de.geeksfactory.opacclient.storage.PreferenceDataSource;
import de.geeksfactory.opacclient.ui.AccountDividerItemDecoration;
import de.geeksfactory.opacclient.utils.ErrorReporter;
Expand Down Expand Up @@ -1474,6 +1475,31 @@ protected AccountData doInBackground(Void... voids) {
account.setPasswordKnownValid(true);
adatasource.update(account);
adatasource.storeCachedAccountData(adatasource.getAccount(data.getAccount()), data);

PreferenceDataSource prefs = null;
if (getActivity() == null && OpacClient.getEmergencyContext() != null) {
prefs = new PreferenceDataSource(OpacClient.getEmergencyContext());
} else {
prefs = new PreferenceDataSource(getActivity());
}

// Update Lent-History?
if (prefs.isHistoryMaintain()) {
HistoryDataSource historyDataSource = null;
if (getActivity() == null) {
if (OpacClient.getEmergencyContext() != null) {
historyDataSource =
new HistoryDataSource(OpacClient.getEmergencyContext(), app);
}
} else {
historyDataSource = new HistoryDataSource(getActivity());
}
if (historyDataSource != null) {
historyDataSource
.updateLending(adatasource.getAccount(data.getAccount()), data);
}
}

} finally {
new ReminderHelper(app).generateAlarms();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import de.geeksfactory.opacclient.objects.LentItem;
import de.geeksfactory.opacclient.objects.ReservedItem;
import de.geeksfactory.opacclient.objects.SearchResult;
import de.geeksfactory.opacclient.storage.HistoryItem;

public class AccountItemDetailActivity extends AppCompatActivity {
public static final String EXTRA_ITEM = "item";
Expand Down Expand Up @@ -154,6 +155,23 @@ public boolean onCreateOptionsMenu(Menu menu) {
cancel.setVisible(false);
booking.setVisible(false);
}
} else if (item instanceof HistoryItem) {
final HistoryItem i = (HistoryItem) item;
download.setVisible(false);
cancel.setVisible(false); // cancel reservation
if (i.isLending()) {
booking.setVisible(false);

prolong.setVisible(true);
// solange beo HistoryFragment nicht implementierr
prolong.setVisible(false);
} else {
prolong.setVisible(false);

booking.setVisible(true);
// solange beo HistoryFragment nicht implementierr
booking.setVisible(false);
}
}

return true;
Expand Down Expand Up @@ -197,15 +215,32 @@ public static CharSequence getBranch(AccountItem item, String format) {
} else {
return null;
}
} else {
} else if (item instanceof ReservedItem) {
return fromHtml(((ReservedItem) item).getBranch());
} else if (item instanceof HistoryItem) {
HistoryItem historyItem = (HistoryItem) item;
if (historyItem.getLendingBranch() != null && historyItem.getHomeBranch() != null) {
return fromHtml(String.format(format, historyItem.getLendingBranch(),
historyItem.getHomeBranch()));
} else if (historyItem.getLendingBranch() != null) {
return fromHtml(historyItem.getLendingBranch());
} else if (historyItem.getHomeBranch() != null) {
return fromHtml(historyItem.getHomeBranch());
} else {
return null;
}
} else {
return null;
}
}

public static boolean hasBranch(AccountItem item) {
return ((item instanceof LentItem && (((LentItem) item).getHomeBranch() != null ||
((LentItem) item).getLendingBranch() != null)) ||
(item instanceof ReservedItem && ((ReservedItem) item).getBranch() != null));
(item instanceof ReservedItem && ((ReservedItem) item).getBranch() != null) ||
(item instanceof HistoryItem && (((HistoryItem) item).getHomeBranch() != null ||
((HistoryItem) item).getLendingBranch() != null))
);
}

private static CharSequence fromHtml(@Nullable String text) {
Expand Down
Loading