├── .gitignore ├── LICENSE ├── README.md ├── app ├── app-release.apk ├── build.gradle ├── lint.xml └── src │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── de │ │ └── itomig │ │ └── itopenterprise │ │ ├── AboutActivity.java │ │ ├── AddTaskActivity.java │ │ ├── AlarmReceiver.java │ │ ├── BackgroundCheck.java │ │ ├── BootReceiver.java │ │ ├── Cache.java │ │ ├── DataConnection.java │ │ ├── GetItopJSON.java │ │ ├── HelpdeskActivity.java │ │ ├── IncidentActivity.java │ │ ├── InternalTaskActivity.java │ │ ├── ItopApplication.java │ │ ├── ItopConfig.java │ │ ├── ItopEnterpriseActivity.java │ │ ├── ItopUtils.java │ │ ├── MainActivity.java │ │ ├── MyActivity.java │ │ ├── PersonAndOrgsLookup.java │ │ ├── Preferences.java │ │ ├── SearchActivity.java │ │ ├── TaskAdapter.java │ │ ├── TaskDetailActivity.java │ │ ├── TicketAdapter.java │ │ ├── TicketDetailActivity.java │ │ └── cmdb │ │ ├── CMDBObject.java │ │ ├── InternalTask.java │ │ ├── ItopTicket.java │ │ ├── ItopTicketDeserializer.java │ │ ├── Organization.java │ │ ├── Person.java │ │ ├── PublicLogEntry.java │ │ └── XmlResult.java │ └── res │ ├── drawable-hdpi │ ├── alarm_clock.png │ ├── alarm_clock_64.png │ ├── alarm_clock_64_off.png │ ├── bar_empty.png │ ├── bar_full.png │ ├── bar_nearly_empty.png │ ├── bar_nearly_full.png │ ├── barcode_128.png │ ├── btn_star_big_off.png │ ├── btn_star_big_on_selected.png │ ├── call_contact.png │ ├── call_contact_off.png │ ├── ic_btn_search_go.png │ ├── ic_info_details.png │ ├── ic_menu_barcode.png │ ├── ic_menu_info_details.png │ ├── ic_menu_preferences.png │ ├── ic_menu_query.png │ ├── ic_menu_search.png │ ├── ic_menu_tickets.png │ ├── ic_tickets.png │ ├── icon.png │ ├── incident32_grey.png │ ├── itomig_logo.png │ ├── itomig_logo_170.png │ ├── itop_icon.png │ ├── itop_logo.png │ ├── itop_logo2.png │ ├── itop_logo3.png │ ├── itop_logo4.png │ ├── logo7.png │ ├── logo7_36px.png │ ├── logo_itop_glow_72.png │ ├── logo_itop_only_36.png │ ├── logo_itop_only_72.png │ ├── nothing32.png │ ├── person_grey.png │ ├── seek_thumb_normal.png │ ├── seek_thumb_pressed.png │ ├── seek_thumb_selected.png │ ├── star3_off.png │ ├── star3_off_off_on.png │ ├── star3_off_off_on_t.png │ ├── star3_off_off_on_tr1.png │ ├── star3_off_on_on.png │ ├── star3_off_on_on_tr1.png │ ├── star3_off_tr1.png │ ├── star3_on.png │ ├── star3_on_tr1.png │ ├── star4_off.png │ ├── star4_off_off_off_on.png │ ├── star4_off_off_on_on.png │ ├── star4_off_on_on_on.png │ ├── star4_on.png │ ├── textfield_search_empty_pressed.9.png │ ├── textfield_search_empty_selected.9.png │ └── user_request_grey.png │ ├── drawable-ldpi │ └── icon.png │ ├── drawable-mdpi │ └── icon.png │ ├── drawable │ ├── alarm_clock.png │ ├── alarm_clock_64.png │ ├── alarm_clock_64_off.png │ ├── bar_empty.png │ ├── bar_full.png │ ├── bar_nearly_empty.png │ ├── bar_nearly_full.png │ ├── barcode_128.png │ ├── btn_star_big_off.png │ ├── btn_star_big_on_selected.png │ ├── call_contact.png │ ├── call_contact_off.png │ ├── ic_btn_search_go.png │ ├── ic_info_details.png │ ├── ic_menu_barcode.png │ ├── ic_menu_info_details.png │ ├── ic_menu_preferences.png │ ├── ic_menu_query.png │ ├── ic_menu_search.png │ ├── ic_menu_tickets.png │ ├── ic_tab_1.xml │ ├── ic_tab_1_grey.png │ ├── ic_tab_1_white.png │ ├── ic_tickets.png │ ├── icon.png │ ├── incident32.xml │ ├── incident32_grey.png │ ├── incident32_white.png │ ├── itomig_logo.png │ ├── itomig_logo_170.png │ ├── itop_icon.png │ ├── itop_logo.png │ ├── itop_logo2.png │ ├── itop_logo3.png │ ├── itop_logo4.png │ ├── logo7.png │ ├── logo7_36px.png │ ├── logo_itop_glow_72.png │ ├── logo_itop_only_36.png │ ├── logo_itop_only_72.png │ ├── nothing32.png │ ├── person.xml │ ├── person_grey.png │ ├── person_white.png │ ├── seek_thumb_normal.png │ ├── seek_thumb_pressed.png │ ├── seek_thumb_selected.png │ ├── star3_off.png │ ├── star3_off_off_on.png │ ├── star3_off_off_on_t.png │ ├── star3_off_off_on_tr1.png │ ├── star3_off_on_on.png │ ├── star3_off_on_on_tr1.png │ ├── star3_off_tr1.png │ ├── star3_on.png │ ├── star3_on_tr1.png │ ├── star4_off.png │ ├── star4_off_off_off_on.png │ ├── star4_off_off_on_on.png │ ├── star4_off_on_on_on.png │ ├── star4_on.png │ ├── textfield_search_empty_pressed.9.png │ ├── textfield_search_empty_selected.9.png │ ├── user_request.xml │ ├── user_request_grey.png │ └── user_request_white.png │ ├── layout │ ├── about.xml │ ├── activity_add.xml │ ├── add_task.xml │ ├── itop_task_row.xml │ ├── itop_ticket_row.xml │ ├── main.xml │ ├── my_spinner_textview.xml │ ├── search.xml │ ├── spinner_item.xml │ ├── task_details.xml │ ├── ticket.xml │ ├── ticket_details.xml │ └── toast_layout.xml │ ├── menu │ ├── add.xml │ ├── menu.xml │ └── search_menu.xml │ ├── values-cn │ ├── arrays.xml │ └── strings.xml │ ├── values-en │ ├── arrays.xml │ └── strings.xml │ ├── values-es │ ├── arrays.xml │ └── strings.xml │ ├── values-fr │ ├── arrays.xml │ └── strings.xml │ ├── values-sw600dp │ └── dimens.xml │ ├── values-sw720dp-land │ └── dimens.xml │ ├── values │ ├── arrays.xml │ ├── dimens.xml │ └── strings.xml │ └── xml │ └── preferences.xml ├── build.gradle ├── build └── intermediates │ ├── dex-cache │ └── cache.xml │ └── model_data.bin ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── local.properties └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | .gradle 3 | *.iml 4 | private-readme.txt 5 | build 6 | gitpush.sh 7 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ItopEnterprise 2 | ============== 3 | 4 | Android Application for the IT Service Management Tool iTop. 5 | 6 | The iTop Android client "ItopEnterprise" (also called iTopMobile) can search for functionalCIs 7 | and persons in the CMDB and displays the current status for open Helpdesk and Incident Tickets. 8 | 9 | iTop is a web based Open Source CMDB with Modules for the different ITIL Processes. It includes 10 | Ticketing, a Self-Service-Portal and several interfaces to 3rd-party systems. Since revision 2.10 11 | ItopEnterprise uses the itop rest/json interface. 12 | 13 | More info: www.itomig.de/itop and www.combodo.com. 14 | 15 | An apk-file can be found in the "app" folder. 16 | 17 | License: GPLv3. 18 | 19 | thanks for the translations: 20 | 21 | Fabien Garziano (French) 22 | Earlwen Hu (Chinese) 23 | Daniel Osvaldo Ferrari (Spain) 24 | 25 | 26 | (c) 2011-2015 ITOMIG GmbH and Michael Blank 27 | -------------------------------------------------------------------------------- /app/app-release.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/app-release.apk -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 19 5 | buildToolsVersion "20.0.0" 6 | 7 | defaultConfig { 8 | applicationId "de.itomig.itopenterprise" 9 | minSdkVersion 9 10 | targetSdkVersion 21 11 | } 12 | 13 | buildTypes { 14 | release { 15 | 16 | } 17 | } 18 | 19 | compileOptions { 20 | sourceCompatibility JavaVersion.VERSION_1_7 21 | targetCompatibility JavaVersion.VERSION_1_7 22 | } 23 | } 24 | 25 | dependencies { 26 | compile 'com.android.support:support-v4:21.0.0' 27 | compile 'com.google.code.gson:gson:2.2.4' 28 | } 29 | -------------------------------------------------------------------------------- /app/lint.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 18 | 19 | 23 | 26 | 27 | 28 | 29 | 30 | 31 | 34 | 35 | 36 | 37 | 38 | 41 | 42 | 43 | 44 | 45 | 48 | 49 | 50 | 51 | 52 | 55 | 56 | 57 | 58 | 59 | 62 | 63 | 64 | 65 | 66 | 69 | 70 | 71 | 72 | 73 | 76 | 77 | 78 | 79 | 80 | 83 | 84 | 85 | 86 | 87 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 99 | 100 | 101 | 102 | 103 | 104 | 108 | 109 | 110 | 111 | 112 | 113 | 116 | 117 | 118 | 119 | 120 | 124 | 125 | 126 | 127 | -------------------------------------------------------------------------------- /app/src/main/java/de/itomig/itopenterprise/AboutActivity.java: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2011-2013 ITOMIG GmbH 2 | // 3 | // This file is part of iTopEnterprise. 4 | // 5 | // iTopEnterprise is free software; you can redistribute it and/or modify 6 | // it under the terms of the GNU General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // iTopEnterprise is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU General Public License 16 | // along with iTopEnterprise. If not, see 17 | 18 | package de.itomig.itopenterprise; 19 | 20 | import android.app.Activity; 21 | import android.content.pm.PackageInfo; 22 | import android.content.pm.PackageManager; 23 | import android.content.pm.PackageManager.NameNotFoundException; 24 | import android.os.Bundle; 25 | import android.util.Log; 26 | import android.view.Window; 27 | import android.widget.TextView; 28 | 29 | import static de.itomig.itopenterprise.ItopConfig.TAG; 30 | import static de.itomig.itopenterprise.ItopConfig.debug; 31 | 32 | /** 33 | * AboutActivity for displaying some info about this application 34 | * 35 | * @author mblank 36 | */ 37 | public class AboutActivity extends Activity { 38 | 39 | @Override 40 | protected void onCreate(Bundle savedInstanceState) { 41 | super.onCreate(savedInstanceState); 42 | String vinfo = ""; 43 | TextView versTv; 44 | 45 | requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS); 46 | requestWindowFeature(Window.FEATURE_PROGRESS); 47 | 48 | setContentView(R.layout.about); 49 | versTv = (TextView) findViewById(R.id.version); 50 | int version; 51 | String vName; 52 | 53 | PackageInfo pInfo; 54 | try { 55 | pInfo = getPackageManager().getPackageInfo(getPackageName(), PackageManager.GET_META_DATA); 56 | version = pInfo.versionCode; 57 | vName = pInfo.versionName; 58 | vinfo = "Version: " + vName + " (" + version + ")"; 59 | 60 | } catch (NameNotFoundException e) { 61 | e.printStackTrace(); 62 | } 63 | 64 | if (debug) Log.i(TAG, "About screen - version " + vinfo); 65 | versTv.setText(vinfo); 66 | 67 | 68 | } 69 | 70 | } 71 | -------------------------------------------------------------------------------- /app/src/main/java/de/itomig/itopenterprise/AddTaskActivity.java: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2011-2013 ITOMIG GmbH 2 | // 3 | // This file is part of iTopEnterprise. 4 | // 5 | // iTopEnterprise is free software; you can redistribute it and/or modify 6 | // it under the terms of the GNU General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // iTopEnterprise is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU General Public License 16 | // along with iTopEnterprise. If not, see 17 | // 18 | 19 | package de.itomig.itopenterprise; 20 | 21 | import android.app.Activity; 22 | import android.content.res.Resources; 23 | import android.os.Bundle; 24 | import android.util.Log; 25 | import android.view.Menu; 26 | import android.view.View; 27 | import android.widget.ArrayAdapter; 28 | import android.widget.Button; 29 | import android.widget.EditText; 30 | import android.widget.Spinner; 31 | import android.widget.Toast; 32 | 33 | import java.util.ArrayList; 34 | import java.util.Iterator; 35 | import java.util.List; 36 | import java.util.Map.Entry; 37 | 38 | import de.itomig.itopenterprise.cmdb.Person; 39 | 40 | import static de.itomig.itopenterprise.ItopConfig.TAG; 41 | import static de.itomig.itopenterprise.ItopConfig.debug; 42 | import static de.itomig.itopenterprise.ItopConfig.organizationLookup; 43 | import static de.itomig.itopenterprise.ItopConfig.personLookup; 44 | 45 | /** 46 | * !! TODO implementation not yet finished !! 47 | * 48 | * @author mblank 49 | */ 50 | public class AddTaskActivity extends Activity { 51 | private Spinner spPerson, spOrg, spStatus, spPrio; 52 | 53 | @Override 54 | protected void onCreate(Bundle savedInstanceState) { 55 | super.onCreate(savedInstanceState); 56 | Button btnCancel, btnSave; 57 | final EditText title; 58 | //EditText desc, remark; 59 | setContentView(R.layout.activity_add); 60 | 61 | spPerson = (Spinner) findViewById(R.id.spPerson); 62 | spOrg = (Spinner) findViewById(R.id.spOrg); 63 | spStatus = (Spinner) findViewById(R.id.spStatus); 64 | spPrio = (Spinner) findViewById(R.id.spPriority); 65 | title = (EditText) findViewById(R.id.titleInput); 66 | //desc = (EditText) findViewById(R.id.descInput); 67 | //remark = (EditText) findViewById(R.id.remarkInput); 68 | 69 | btnCancel = (Button) findViewById(R.id.btnCancel); 70 | btnSave = (Button) findViewById(R.id.btnSave); 71 | 72 | addItemsOnSpinners(); 73 | 74 | btnCancel.setOnClickListener(new View.OnClickListener() { 75 | public void onClick(View v) { 76 | finish(); 77 | } 78 | }); 79 | 80 | btnSave.setOnClickListener(new View.OnClickListener() { 81 | public void onClick(View v) { 82 | String p = (String) spPerson.getSelectedItem(); 83 | String o = (String) spOrg.getSelectedItem(); 84 | String stat = (String) spStatus.getSelectedItem(); 85 | String prio = (String) spPrio.getSelectedItem(); 86 | 87 | toast("not yet implemented \ntitle" + title.getText() + "\np=" 88 | + p + "\no=" + o + "\nprio=" + prio + "\nstat=" + stat); 89 | } 90 | }); 91 | 92 | } 93 | 94 | @Override 95 | public boolean onCreateOptionsMenu(Menu menu) { 96 | // Inflate the menu; this adds items to the action bar if it is present. 97 | // getMenuInflater().inflate(R.menu.add, menu); 98 | return true; 99 | } 100 | 101 | private void addItemsOnSpinners() { 102 | List list = new ArrayList(); 103 | 104 | // organization spinner 105 | List orglist = new ArrayList(); 106 | int idItomig = 0; 107 | 108 | for (Entry pairs : organizationLookup.entrySet()) { 109 | if (debug) 110 | Log.d(TAG, 111 | "orgLookup " + pairs.getKey() + " = " 112 | + (pairs.getValue())); 113 | orglist.add(pairs.getValue()); 114 | if (pairs.getValue().toUpperCase().contains("ITOMIG")) 115 | idItomig = pairs.getKey(); 116 | } 117 | 118 | ArrayAdapter dataAdapter3 = new ArrayAdapter(this, 119 | R.layout.spinner_item, orglist); 120 | dataAdapter3 121 | .setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); 122 | spOrg.setAdapter(dataAdapter3); 123 | // make ITOMIG default 124 | int i = orglist.indexOf("ITOMIG"); 125 | spOrg.setSelection(i); 126 | 127 | // select only ITOMIG people for Tasklist 128 | Iterator> it = personLookup.entrySet() 129 | .iterator(); 130 | while (it.hasNext()) { 131 | Entry pairs = it.next(); 132 | // if (pairs.getValue().) 133 | if (idItomig != 0) { 134 | // get only ITOMIG employees 135 | if (pairs.getValue().getOrg_id() == idItomig) { 136 | if (debug) 137 | Log.d(TAG, "personLookup " + pairs.getKey() + " = " 138 | + ( pairs.getValue()).getFriendlyname()); 139 | list.add((pairs.getValue()).getFriendlyname()); 140 | } 141 | } else { 142 | // get all people if ITOMIG not found 143 | if (debug) 144 | Log.d(TAG, "personLookup " + pairs.getKey() + " = " 145 | + (pairs.getValue()).getFriendlyname()); 146 | list.add((pairs.getValue()).getFriendlyname()); 147 | } 148 | } 149 | 150 | ArrayAdapter dataAdapter = new ArrayAdapter(this, 151 | R.layout.spinner_item, list); 152 | dataAdapter 153 | .setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); 154 | spPerson.setAdapter(dataAdapter); 155 | 156 | Resources res = getResources(); 157 | String[] prios = res.getStringArray(R.array.priority); 158 | ArrayAdapter dataAdapter2 = new ArrayAdapter(this, 159 | R.layout.spinner_item, prios); 160 | dataAdapter2 161 | .setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); 162 | spPrio.setAdapter(dataAdapter2); 163 | spPrio.setSelection(1); 164 | 165 | String[] status = res.getStringArray(R.array.status); 166 | ArrayAdapter dataAdapter4 = new ArrayAdapter(this, 167 | R.layout.spinner_item, status); 168 | dataAdapter4 169 | .setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); 170 | spStatus.setAdapter(dataAdapter4); 171 | 172 | } 173 | 174 | public void toast(String string) { 175 | Toast.makeText(this, string, Toast.LENGTH_LONG).show(); 176 | } 177 | 178 | } 179 | -------------------------------------------------------------------------------- /app/src/main/java/de/itomig/itopenterprise/AlarmReceiver.java: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2011-2013 ITOMIG GmbH 2 | // 3 | // This file is part of iTopEnterprise. 4 | // 5 | // iTopEnterprise is free software; you can redistribute it and/or modify 6 | // it under the terms of the GNU General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // iTopEnterprise is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU General Public License 16 | // along with iTopEnterprise. If not, see 17 | 18 | package de.itomig.itopenterprise; 19 | 20 | import android.content.BroadcastReceiver; 21 | import android.content.Context; 22 | import android.content.Intent; 23 | import android.net.ConnectivityManager; 24 | import android.os.PowerManager; 25 | import android.util.Log; 26 | 27 | import static de.itomig.itopenterprise.ItopConfig.TAG; 28 | import static de.itomig.itopenterprise.ItopConfig.debug; 29 | 30 | /** 31 | * receives the recurring alarm which does the BackgroundCheck 32 | * every X minutes, checks for working network before actually 33 | * requesting http data 34 | * 35 | * @author Michael Blank 36 | * 37 | */ 38 | public class AlarmReceiver extends BroadcastReceiver { 39 | 40 | private static final String LOCK_TAG = "de.itomig.itopenterprise"; 41 | private static PowerManager.WakeLock wakeLock = null; 42 | 43 | public static synchronized void acquireLock(Context context) { 44 | if (wakeLock == null) { 45 | PowerManager mgr = (PowerManager) context.getSystemService(Context.POWER_SERVICE); 46 | wakeLock = mgr.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, LOCK_TAG); 47 | wakeLock.setReferenceCounted(true); 48 | } 49 | wakeLock.acquire(); 50 | if (debug) Log.i(TAG, "BG AlarmReceiver: aquired wakeLock"); 51 | } 52 | 53 | public static void releaseLock() { 54 | if ((wakeLock != null) && (wakeLock.isHeld())) { 55 | wakeLock.release(); 56 | if (debug) Log.i(TAG, "BG AlarmReceiver: released wakeLock"); 57 | } 58 | 59 | } 60 | 61 | @Override 62 | public void onReceive(Context context, Intent intent) { 63 | if (isNetworkConnected(context)) { 64 | if (debug) Log.i(TAG, "BG AlarmReceiver: onReceive, starting BackgroundCheck service"); 65 | acquireLock(context); 66 | Intent serviceIntent = new Intent(context, de.itomig.itopenterprise.BackgroundCheck.class); 67 | context.startService(serviceIntent); 68 | 69 | // update person and org info 70 | de.itomig.itopenterprise.PersonAndOrgsLookup pl = new de.itomig.itopenterprise.PersonAndOrgsLookup(); 71 | pl.update(); 72 | } else { 73 | // do nothing 74 | Log.e(TAG, "BG: no network connection."); 75 | } 76 | 77 | } 78 | 79 | 80 | private boolean isNetworkConnected(Context context) { 81 | ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); 82 | 83 | if (cm.getActiveNetworkInfo() != null && cm.getActiveNetworkInfo().isAvailable() && cm.getActiveNetworkInfo().isConnected()) { 84 | return true; 85 | } else { 86 | Log.e(TAG, "BG: no network connection."); 87 | return false; 88 | } 89 | } 90 | 91 | } 92 | -------------------------------------------------------------------------------- /app/src/main/java/de/itomig/itopenterprise/BootReceiver.java: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2011-2013 ITOMIG GmbH 2 | // 3 | // This file is part of iTopEnterprise. 4 | // 5 | // iTopEnterprise is free software; you can redistribute it and/or modify 6 | // it under the terms of the GNU General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // iTopEnterprise is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU General Public License 16 | // along with iTopEnterprise. If not, see 17 | 18 | package de.itomig.itopenterprise; 19 | 20 | import android.app.AlarmManager; 21 | import android.app.PendingIntent; 22 | import android.content.BroadcastReceiver; 23 | import android.content.Context; 24 | import android.content.Intent; 25 | import android.util.Log; 26 | 27 | import java.util.Calendar; 28 | 29 | import static de.itomig.itopenterprise.ItopConfig.BACKGROUND_INTERVAL_MIN; 30 | import static de.itomig.itopenterprise.ItopConfig.NOTIFY_NO; 31 | 32 | /** 33 | * starts backgroundCheck after boot 34 | * 35 | * @author Michael Blank 36 | * @version 1.1 37 | */ 38 | public class BootReceiver extends BroadcastReceiver { 39 | 40 | @Override 41 | public void onReceive(Context context, Intent intent) { 42 | // start only when notification is set in Preferences 43 | int notifySetting = ItopConfig.getItopNotifySetting(); 44 | Log.i("ITOP", "BG: BootReceiver - notifySetting=" + notifySetting); 45 | 46 | if (notifySetting != NOTIFY_NO) { 47 | startAlarmMgr(context); 48 | } 49 | } 50 | 51 | public void startAlarmMgr(Context context) { 52 | Log.i("ITOP", "BG: startAlarmMgr - setting alarm"); 53 | AlarmManager mgr = (AlarmManager) 54 | context.getSystemService(Context.ALARM_SERVICE); 55 | Intent i = new Intent(context, AlarmReceiver.class); 56 | PendingIntent sender = PendingIntent.getBroadcast(context, 0, i, PendingIntent.FLAG_CANCEL_CURRENT); 57 | Calendar now = Calendar.getInstance(); 58 | now.add(Calendar.MINUTE, 1); 59 | mgr.setRepeating(AlarmManager.RTC_WAKEUP, 60 | now.getTimeInMillis(), BACKGROUND_INTERVAL_MIN * 60 * 1000, sender); 61 | } 62 | } -------------------------------------------------------------------------------- /app/src/main/java/de/itomig/itopenterprise/Cache.java: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2011-2013 ITOMIG GmbH 2 | // 3 | // This file is part of iTopEnterprise. 4 | // 5 | // iTopEnterprise is free software; you can redistribute it and/or modify 6 | // it under the terms of the GNU General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // iTopEnterprise is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU General Public License 16 | // along with iTopEnterprise. If not, see 17 | 18 | // Google-GSON: Copyright 2008-2011 Google Inc. 19 | // 20 | // Licensed under the Apache License, Version 2.0 (the "License"); 21 | // you may not use this file except in compliance with the License. 22 | // You may obtain a copy of the License at 23 | // 24 | // http://www.apache.org/licenses/LICENSE-2.0 25 | package de.itomig.itopenterprise; 26 | 27 | import android.content.Context; 28 | import android.content.SharedPreferences; 29 | import android.preference.PreferenceManager; 30 | import android.text.format.DateFormat; 31 | import android.util.Log; 32 | 33 | import com.google.gson.Gson; 34 | import com.google.gson.reflect.TypeToken; 35 | 36 | import java.lang.reflect.Type; 37 | import java.util.concurrent.ConcurrentHashMap; 38 | 39 | import de.itomig.itopenterprise.cmdb.Person; 40 | 41 | import static de.itomig.itopenterprise.ItopConfig.TAG; 42 | import static de.itomig.itopenterprise.ItopConfig.debug; 43 | import static de.itomig.itopenterprise.ItopConfig.organizationLookup; 44 | import static de.itomig.itopenterprise.ItopConfig.organizationLookupTime; 45 | import static de.itomig.itopenterprise.ItopConfig.personLookup; 46 | import static de.itomig.itopenterprise.ItopConfig.personLookupTime; 47 | 48 | public class Cache { 49 | 50 | public static final long MAX_CACHE_LIFETIME = 24*3600*1000L; // 24h 51 | 52 | public static void cachePersons(Context context) { 53 | 54 | Gson gson = new Gson(); 55 | 56 | // must be used with TypeToken, gson/getClass does not work for parametrized class 57 | Type listType = new TypeToken>() { 58 | }.getType(); 59 | String json = gson.toJson(personLookup, listType); 60 | SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); 61 | prefs.edit().putString("CACHE-PERSONS", json).commit(); 62 | if (debug) Log.d(TAG, "CACHE - writing persons. datetime=" + 63 | DateFormat.format("dd.MM - HH:mm:ss", personLookupTime)); 64 | prefs.edit().putLong("CACHETIME-PERSONS", personLookupTime).commit(); 65 | 66 | } 67 | 68 | public static void cacheOrgs(Context context) { 69 | SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); 70 | Gson gson = new Gson(); 71 | // must be used with TypeToken, gson/getClass does not work for parametrized class 72 | Type listType = new TypeToken>() { 73 | }.getType(); 74 | String json = gson.toJson(organizationLookup, listType); 75 | 76 | prefs.edit().putString("CACHE-ORGS", json).commit(); 77 | if (debug) Log.d(TAG, "CACHE - writing organizations. datetime=" + 78 | DateFormat.format("dd.MM - HH:mm:ss", organizationLookupTime)); 79 | prefs.edit().putLong("CACHETIME-ORGS", organizationLookupTime).commit(); 80 | 81 | } 82 | 83 | public static boolean getCachePersons(Context context) { 84 | 85 | SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); 86 | String cachedPersonsJson = prefs.getString("CACHE-PERSONS", ""); 87 | Long ctPersons = prefs.getLong("CACHETIME-PERSONS", 0L); 88 | 89 | if ((System.currentTimeMillis() - ctPersons) < MAX_CACHE_LIFETIME) { 90 | Gson gson = new Gson(); 91 | // must be used with TypeToken, gson/getClass does not work for parametrized class 92 | Type listType = new TypeToken>() { 93 | }.getType(); 94 | personLookup = gson.fromJson( 95 | cachedPersonsJson, listType); 96 | personLookupTime = ctPersons; 97 | if (debug) 98 | Log.d(TAG, "CACHE - reading persons. " + DateFormat.format("dd.MM - HH:mm:ss", personLookupTime)); 99 | return true; 100 | } else { 101 | if (debug) 102 | Log.d(TAG, "CACHETIME-PERSONS too old: " + DateFormat.format("dd.MM - HH:mm:ss", personLookupTime)); 103 | return false; 104 | } 105 | 106 | 107 | } 108 | 109 | public static boolean getCacheOrgs(Context context) { 110 | 111 | SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); 112 | String cachedOrgsJson = prefs.getString("CACHE-ORGS", ""); 113 | Long ctOrgs = prefs.getLong("CACHETIME-ORGS", 0L); 114 | 115 | if ((System.currentTimeMillis() - ctOrgs) < MAX_CACHE_LIFETIME) { 116 | Gson gson = new Gson(); 117 | 118 | // must be used with TypeToken, gson/getClass does not work for parametrized class 119 | Type listType = new TypeToken>() { 120 | }.getType(); 121 | organizationLookup = gson.fromJson( 122 | cachedOrgsJson, listType); 123 | organizationLookupTime = ctOrgs; 124 | if (debug) 125 | Log.d(TAG, "reading orgs cache. datetime=" + DateFormat.format("dd.MM - HH:mm:ss", organizationLookupTime)); 126 | return true; 127 | } else { 128 | if (debug) 129 | Log.d(TAG, "CACHETIME-ORGS too old: " + DateFormat.format("dd.MM - HH:mm:ss", organizationLookupTime)); 130 | return false; 131 | } 132 | 133 | } 134 | 135 | public static synchronized void clearPersonsCache(Context context) { 136 | SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); 137 | 138 | prefs.edit().putString("CACHE-PERSONS", "{}").commit(); 139 | prefs.edit().putLong("CACHETIME-PERSONS", 0L).commit(); 140 | personLookup.clear(); 141 | personLookupTime = 0L; 142 | if (debug) Log.d(TAG, "persons cache cleared."); 143 | } 144 | 145 | public static synchronized void clearOrgsCache(Context context) { 146 | SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); 147 | prefs.edit().putString("CACHE-ORGS", "{}").commit(); 148 | prefs.edit().putLong("CACHETIME-ORGS", 0L).commit(); 149 | organizationLookup.clear(); 150 | organizationLookupTime = 0L; 151 | } 152 | 153 | public static synchronized void write(Context context, long timemillis, String name, Object obj, Type listType) { 154 | SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); 155 | Gson gson = new Gson(); 156 | 157 | String json = gson.toJson(obj, listType); 158 | if (debug) Log.d(TAG, "CACHE - " + name + " writing object:" + json); 159 | prefs.edit().putString("CACHE-" + name, json).commit(); 160 | 161 | if (debug) 162 | Log.d(TAG, "CACHETIME-" + name + ": " + DateFormat.format("dd.MM - hh:mm:ss", timemillis)); 163 | prefs.edit().putLong("CACHETIME-" + name, timemillis).commit(); 164 | 165 | } 166 | 167 | public static synchronized Object read(Context context, String name, Object obj, Type listType) { 168 | SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); 169 | String json = prefs.getString("CACHE-" + name, ""); 170 | Long timemillis = prefs.getLong("CACHETIME-" + name, 0L); 171 | 172 | if ((System.currentTimeMillis() - timemillis) < MAX_CACHE_LIFETIME) { 173 | if (debug) Log.d(TAG, "cache can be used. " + name + " json=" + json); 174 | Gson gson = new Gson(); 175 | obj = gson.fromJson( 176 | json, listType); 177 | if (debug) 178 | Log.d(TAG, "CACHETIME- was: " + DateFormat.format("dd.MM - hh:mm:ss", timemillis)); 179 | } else { 180 | obj = null; 181 | if (debug) 182 | Log.d(TAG, "CACHETIME- was too old: " + DateFormat.format("dd.MM - hh:mm:ss", timemillis)); 183 | } 184 | 185 | return obj; 186 | } 187 | } 188 | -------------------------------------------------------------------------------- /app/src/main/java/de/itomig/itopenterprise/DataConnection.java: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2011-2013 ITOMIG GmbH 2 | // 3 | // This file is part of iTopEnterprise. 4 | // 5 | // iTopEnterprise is free software; you can redistribute it and/or modify 6 | // it under the terms of the GNU General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // iTopEnterprise is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU General Public License 16 | // along with iTopEnterprise. If not, see 17 | 18 | package de.itomig.itopenterprise; 19 | 20 | import android.content.Context; 21 | import android.net.ConnectivityManager; 22 | 23 | public class DataConnection { 24 | 25 | public static boolean isConnected(Context context) { 26 | ConnectivityManager connec = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); 27 | android.net.NetworkInfo wifi = connec.getNetworkInfo(ConnectivityManager.TYPE_WIFI); 28 | android.net.NetworkInfo mobile = connec.getNetworkInfo(ConnectivityManager.TYPE_MOBILE); 29 | 30 | // check both for wifi and mobile network 31 | // If anyone of them is available or connected then it will return true, otherwise false; 32 | 33 | if (wifi.isConnected()) { 34 | return true; 35 | } else if (mobile.isConnected()) { 36 | return true; 37 | } 38 | return false; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /app/src/main/java/de/itomig/itopenterprise/HelpdeskActivity.java: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2011-2013 ITOMIG GmbH 2 | // 3 | // This file is part of iTopEnterprise. 4 | // 5 | // iTopEnterprise is free software; you can redistribute it and/or modify 6 | // it under the terms of the GNU General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // iTopEnterprise is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU General Public License 16 | // along with iTopEnterprise. If not, see 17 | 18 | package de.itomig.itopenterprise; 19 | 20 | 21 | import android.os.Bundle; 22 | import android.util.Log; 23 | 24 | import java.io.UnsupportedEncodingException; 25 | import java.net.URLEncoder; 26 | 27 | import static de.itomig.itopenterprise.ItopConfig.TAG; 28 | import static de.itomig.itopenterprise.ItopConfig.debug; 29 | 30 | public class HelpdeskActivity extends de.itomig.itopenterprise.MainActivity { 31 | 32 | @Override 33 | public void onCreate(Bundle savedInstanceState) { 34 | super.onCreate(savedInstanceState); 35 | 36 | if (debug) Log.i(TAG, "HelpdeskActivity - onCreate"); 37 | String getUserRequests = "SELECT UserRequest WHERE status!='closed' AND status!='resolved'"; 38 | 39 | 40 | serverExpression[0] = "core/get"; 41 | serverExpression[1] = "UserRequest"; 42 | serverExpression[2] = "SELECT UserRequest WHERE status!='closed' AND status!='resolved'"; 43 | serverExpression[3] = "ref, title, priority, start_date, tto_escalation_deadline, caller_id, agent_id, status, last_update, description, public_log"; 44 | 45 | } 46 | } -------------------------------------------------------------------------------- /app/src/main/java/de/itomig/itopenterprise/IncidentActivity.java: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2011-2013 ITOMIG GmbH 2 | // 3 | // This file is part of iTopEnterprise. 4 | // 5 | // iTopEnterprise is free software; you can redistribute it and/or modify 6 | // it under the terms of the GNU General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // iTopEnterprise is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU General Public License 16 | // along with iTopEnterprise. If not, see 17 | 18 | package de.itomig.itopenterprise; 19 | 20 | import android.os.Bundle; 21 | import android.util.Log; 22 | 23 | import java.io.UnsupportedEncodingException; 24 | import java.net.URLEncoder; 25 | 26 | import static de.itomig.itopenterprise.ItopConfig.TAG; 27 | import static de.itomig.itopenterprise.ItopConfig.debug; 28 | 29 | public class IncidentActivity extends de.itomig.itopenterprise.MainActivity { 30 | 31 | 32 | @Override 33 | public void onCreate(Bundle savedInstanceState) { 34 | super.onCreate(savedInstanceState); 35 | 36 | 37 | if (debug) Log.i(TAG, "IncidentActivity - onCreate"); 38 | 39 | serverExpression[0] = "core/get"; 40 | serverExpression[1] = "Incident"; 41 | serverExpression[2] = "SELECT Incident WHERE status!='closed' AND status!='resolved'"; 42 | serverExpression[3] = "ref, title, priority, start_date, tto_escalation_deadline, caller_id, agent_id, status, last_update, description, public_log"; 43 | } 44 | 45 | } 46 | 47 | -------------------------------------------------------------------------------- /app/src/main/java/de/itomig/itopenterprise/InternalTaskActivity.java: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2011-2013 ITOMIG GmbH 2 | // 3 | // This file is part of iTopEnterprise. 4 | // 5 | // iTopEnterprise is free software; you can redistribute it and/or modify 6 | // it under the terms of the GNU General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // iTopEnterprise is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU General Public License 16 | // along with iTopEnterprise. If not, see 17 | package de.itomig.itopenterprise; 18 | 19 | import android.os.Bundle; 20 | import android.util.Log; 21 | 22 | import java.io.UnsupportedEncodingException; 23 | import java.net.URLEncoder; 24 | 25 | import static de.itomig.itopenterprise.ItopConfig.TAG; 26 | 27 | public class InternalTaskActivity extends de.itomig.itopenterprise.MainActivity { 28 | 29 | 30 | @Override 31 | public void onCreate(Bundle savedInstanceState) { 32 | super.onCreate(savedInstanceState); 33 | 34 | String getTasks = "SELECT InternalTask WHERE status!='closed' AND status!='resolved'"; 35 | 36 | //expression = URLEncoder.encode(getTasks, "UTF-8"); 37 | serverExpression[0] = "core/get"; 38 | serverExpression[1] = "InternalTask"; 39 | serverExpression[2] = "SELECT InternalTask WHERE person_id = :current_contact_id"; 40 | serverExpression[3] = "name, priority, person_name, person_id, description, remarks, person_id_friendlyname"; 41 | 42 | } 43 | 44 | } 45 | 46 | -------------------------------------------------------------------------------- /app/src/main/java/de/itomig/itopenterprise/ItopApplication.java: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2011-2013 ITOMIG GmbH 2 | // 3 | // This file is part of iTopEnterprise. 4 | // 5 | // iTopEnterprise is free software; you can redistribute it and/or modify 6 | // it under the terms of the GNU General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // iTopEnterprise is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU General Public License 16 | // along with iTopEnterprise. If not, see 17 | 18 | package de.itomig.itopenterprise; 19 | 20 | import android.app.Application; 21 | import android.util.Log; 22 | 23 | /** 24 | * starts backgroundCheck after boot 25 | * 26 | * @author Michael Blank 27 | * @version 2.01 (34) 28 | */ 29 | public class ItopApplication extends Application { 30 | // version 34: - released to public domain 31 | 32 | // version 32: - background check service only started when network connected 33 | 34 | public static final boolean DEBUG = true; 35 | // DEBUG must be false for all versions released to android market 36 | // also remove android:debuggable="true" in the AndroidManifest.xml 37 | 38 | @Override 39 | public void onCreate() { 40 | super.onCreate(); 41 | 42 | if (DEBUG) Log.i("ITOP", "ItopApplication - onCreate"); 43 | ItopConfig.init(getApplicationContext(), ItopEnterpriseActivity.class); 44 | 45 | } 46 | 47 | 48 | } 49 | -------------------------------------------------------------------------------- /app/src/main/java/de/itomig/itopenterprise/ItopConfig.java: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2011-2013 ITOMIG GmbH 2 | // 3 | // This file is part of iTopEnterprise. 4 | // 5 | // iTopEnterprise is free software; you can redistribute it and/or modify 6 | // it under the terms of the GNU General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // iTopEnterprise is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU General Public License 16 | // along with iTopEnterprise. If not, see 17 | package de.itomig.itopenterprise; 18 | 19 | import android.annotation.SuppressLint; 20 | import android.app.Application; 21 | import android.content.Context; 22 | import android.content.SharedPreferences; 23 | import android.preference.PreferenceManager; 24 | import android.util.Log; 25 | 26 | import org.apache.http.message.BasicNameValuePair; 27 | 28 | import java.io.UnsupportedEncodingException; 29 | import java.net.URLEncoder; 30 | import java.util.ArrayList; 31 | import java.util.List; 32 | import java.util.concurrent.ConcurrentHashMap; 33 | 34 | import de.itomig.itopenterprise.cmdb.InternalTask; 35 | import de.itomig.itopenterprise.cmdb.ItopTicket; 36 | import de.itomig.itopenterprise.cmdb.Organization; 37 | import de.itomig.itopenterprise.cmdb.Person; 38 | 39 | 40 | @SuppressLint("UseSparseArrays") 41 | public class ItopConfig extends Application { 42 | // DEBUG must be false for all versions released to android market 43 | // also remove android:debuggable="true" in the AndroidManifest.xml 44 | public static boolean debug = true; 45 | 46 | // corporate version with URL check and update from itomig.de 47 | // or Android market version with update from market 48 | public static final String KEY_URL = "urlPref"; 49 | public static final String KEY_LOGIN = "loginPref"; 50 | public static final String KEY_PASSWORD = "passwordPref"; 51 | public static final String KEY_SSL = "sslPref"; 52 | public static final String KEY_ITIL_TICKETS = "itilTicketsPref"; 53 | public static final String KEY_TASKS = "taskPref"; 54 | public static final String KEY_NOTIFY = "notifyPref"; 55 | public static final String KEY_SORTBYPRIO = "sortByPrioPref"; 56 | public static final String KEY_QUERY_NOTIFY = "queryNotifyPref"; 57 | public static final String STATUS_ASSIGNED = "assigned"; // must match to iTop installation 58 | public static final String ERROR = "error"; 59 | public static final String TAG = "ITOP"; 60 | public static final int INVALID_ID = 0; // used for invalid people or ticket id. 61 | public static final int NOTIFY_NO = 0; 62 | public static final int NOTIFY_NEW = 1; 63 | public static final int NOTIFY_UPDATE = 2; 64 | public static final int NOTIFICATION_ID_INCIDENT = 1; 65 | public static final int BACKGROUND_INTERVAL_MIN = 10; 66 | public static final int DISPLAY_REFRESH_SECS = 120; 67 | 68 | 69 | public static Context itopAppContext; 70 | // default values point to DEMO server 71 | public static String DEMO_URL = "www.itomig.de/itop-demo20"; 72 | public static String DEMO_LOGIN = "admin"; 73 | public static String DEMO_PASSWORD = "1234admi"; 74 | public static boolean DEMO_SSL = true; 75 | @SuppressWarnings("rawtypes") 76 | public static Class itopmobileactivity = null; 77 | 78 | // used in TicketActivity 79 | public static ArrayList tickets = new ArrayList(); 80 | 81 | public static List tasks = new ArrayList(); 82 | 83 | public static ConcurrentHashMap personLookup = new ConcurrentHashMap(); 84 | public static ConcurrentHashMap organizationLookup = new ConcurrentHashMap(); 85 | 86 | public static long personLookupTime = 0L; 87 | public static long organizationLookupTime = 0L; 88 | 89 | public static String[] prioStrings; // language dependent, read from arrays.xml 90 | 91 | public static void init(Context context, Class itopmob) { 92 | 93 | Log.i(TAG, "ItopLib initialized - debug=" + debug); 94 | 95 | itopmobileactivity = itopmob; // used for menu in SearchActivity 96 | 97 | itopAppContext = context; // Application Context for later use in static functions. 98 | 99 | boolean result1, result2; 100 | result1 = de.itomig.itopenterprise.Cache.getCachePersons(itopAppContext); 101 | result2 = de.itomig.itopenterprise.Cache.getCacheOrgs(itopAppContext); 102 | 103 | if (!result1 || !result2) { 104 | //TODO make static and separate persons and orgs 105 | de.itomig.itopenterprise.PersonAndOrgsLookup pl = new de.itomig.itopenterprise.PersonAndOrgsLookup(); 106 | pl.update(); 107 | } 108 | } 109 | 110 | public static int getRefreshRateSeconds() { 111 | return DISPLAY_REFRESH_SECS; 112 | } 113 | 114 | public static String getItopUrl() { 115 | 116 | SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(itopAppContext); 117 | String url = (prefs.getString(KEY_URL, DEMO_URL)).trim(); 118 | if ((url.length() > 3) && (url.charAt(url.length() - 1) == '/')) { // remove trailing slash in url, if there is one 119 | url = url.substring(0, url.length() - 1); 120 | } 121 | boolean ssl_enabled = prefs.getBoolean(KEY_SSL, DEMO_SSL); 122 | 123 | if (ssl_enabled) { 124 | return "https://" + url; 125 | } else { 126 | return "http://" + url; 127 | } 128 | 129 | } 130 | 131 | public static String getItopCredentials() { 132 | 133 | SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(itopAppContext); 134 | String login = prefs.getString(KEY_LOGIN, DEMO_LOGIN).trim(); 135 | String password = null; 136 | try { 137 | password = URLEncoder.encode(prefs.getString(KEY_PASSWORD, DEMO_PASSWORD).trim(), "utf-8"); 138 | } catch (UnsupportedEncodingException e) { 139 | Log.e(TAG, e.getMessage()); 140 | } 141 | return "auth_user=" + login + "&auth_pwd=" + password; 142 | 143 | } 144 | 145 | public static BasicNameValuePair getItopUserNameValuePair() { 146 | SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(itopAppContext); 147 | String login = prefs.getString(KEY_LOGIN, DEMO_LOGIN).trim(); 148 | return new BasicNameValuePair("auth_user", login); 149 | } 150 | 151 | public static BasicNameValuePair getItopPwdNameValuePair() { 152 | SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(itopAppContext); 153 | String password = null; 154 | try { 155 | password = URLEncoder.encode(prefs.getString(KEY_PASSWORD, DEMO_PASSWORD).trim(), "utf-8"); 156 | } catch (UnsupportedEncodingException e) { 157 | Log.e(TAG, e.getMessage()); 158 | } 159 | return new BasicNameValuePair("auth_pwd", password); 160 | } 161 | 162 | public static int getItopNotifySetting() { 163 | 164 | SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(itopAppContext); 165 | return Integer.valueOf(prefs.getString(KEY_NOTIFY, "0")); 166 | 167 | } 168 | 169 | public static boolean isEnabledlITILTicket() { 170 | 171 | SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(itopAppContext); 172 | return prefs.getBoolean(KEY_ITIL_TICKETS, true); 173 | 174 | } 175 | 176 | 177 | public static int getNumericalPriority(String prio) { 178 | // the prio string is language dependent!! 179 | 180 | int numPrio = INVALID_ID; 181 | for (int i = 0; i < prioStrings.length; i++) { 182 | if (prio.equals(prioStrings[i])) { 183 | numPrio = i + 1; 184 | break; 185 | } 186 | } 187 | return numPrio; 188 | } 189 | } 190 | -------------------------------------------------------------------------------- /app/src/main/java/de/itomig/itopenterprise/ItopUtils.java: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2011-2013 ITOMIG GmbH 2 | // 3 | // This file is part of iTopEnterprise. 4 | // 5 | // iTopEnterprise is free software; you can redistribute it and/or modify 6 | // it under the terms of the GNU General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // iTopEnterprise is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU General Public License 16 | // along with iTopEnterprise. If not, see 17 | 18 | package de.itomig.itopenterprise; 19 | 20 | import android.util.Log; 21 | 22 | import java.util.ArrayList; 23 | 24 | import de.itomig.itopenterprise.cmdb.ItopTicket; 25 | 26 | import static de.itomig.itopenterprise.ItopConfig.TAG; 27 | 28 | public class ItopUtils { 29 | 30 | static ArrayList stored = new ArrayList(); 31 | 32 | /** 33 | * removes repeating ItopTickets from a list (defined by same "ref" and same 34 | * "lastUpdate" string as the last from the last call) 35 | * not persistent over restart of service ! TODO 36 | * 37 | * @param in input with arraylist of itop tickets 38 | * @return output list of itop tickets 39 | */ 40 | protected static ArrayList removeRepeatingTickets(ArrayList in) { 41 | ArrayList out = new ArrayList(); 42 | boolean foundDuplicate; 43 | 44 | if (in.isEmpty()) { 45 | // nothing to do in this case 46 | stored.clear(); 47 | return in; 48 | } 49 | 50 | if (stored.isEmpty()) { 51 | // out = in 52 | // store in ->stored for later use 53 | for (int i = 0; i < in.size(); i++) { 54 | stored.add(in.get(i)); // copy out list entries into stored list 55 | } 56 | return in; 57 | } 58 | 59 | // else: check for duplicates ( in(i)==stored(j) ) and remove them from out list 60 | for (int i = 0; i < in.size(); i++) { 61 | // check for identical entries in stored -> then remove 62 | foundDuplicate = false; 63 | for (int j = 0; j < stored.size(); j++) { 64 | if (in.get(i).getRef().equals(stored.get(j).getRef()) 65 | && in.get(i).getLast_update().equals(stored.get(j).getLast_update())) { 66 | // duplicate found, do not add to out list 67 | foundDuplicate = true; 68 | break; 69 | } 70 | } 71 | if (!foundDuplicate) { 72 | out.add(in.get(i)); 73 | } 74 | } 75 | // out -> stored 76 | for (int i = 0; i < out.size(); i++) { 77 | stored.add(out.get(i)); // copy out list entries into stored list 78 | } 79 | return out; 80 | 81 | } 82 | 83 | /** 84 | * utility method to check the JSON response from iTop server for returning an error 85 | * 86 | * @param resp 87 | * @return error message (isEmpty() => no error) 88 | */ 89 | static public String getItopError(String resp) { 90 | if (resp == null) { 91 | Log.e(TAG, "SERVER_ERROR: response = null."); 92 | return "SERVER_ERROR: response = null"; 93 | } 94 | 95 | // check for ERROR in resp String 96 | if ((resp.length() >= 12) 97 | && (resp.substring(0, 12).equals("SERVER_ERROR"))) { 98 | Log.e(TAG, resp); 99 | return resp; 100 | 101 | } 102 | 103 | // check for iTop appplication error message in JSON string 104 | String message = GetItopJSON.getMessage(resp); 105 | if (message.length() > 0) { 106 | Log.e(TAG, "SERVER_ERROR: " +message); 107 | return "SERVER_ERROR: " + message; 108 | } 109 | return ""; 110 | } 111 | } 112 | -------------------------------------------------------------------------------- /app/src/main/java/de/itomig/itopenterprise/MyActivity.java: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2011-2013 ITOMIG GmbH 2 | // 3 | // This file is part of iTopEnterprise. 4 | // 5 | // iTopEnterprise is free software; you can redistribute it and/or modify 6 | // it under the terms of the GNU General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // iTopEnterprise is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU General Public License 16 | // along with iTopEnterprise. If not, see 17 | 18 | package de.itomig.itopenterprise; 19 | 20 | import android.os.Bundle; 21 | import android.util.Log; 22 | 23 | import java.io.UnsupportedEncodingException; 24 | import java.net.URLEncoder; 25 | 26 | import static de.itomig.itopenterprise.ItopConfig.TAG; 27 | import static de.itomig.itopenterprise.ItopConfig.debug; 28 | 29 | public class MyActivity extends MainActivity { 30 | @Override 31 | public void onCreate(Bundle savedInstanceState) { 32 | super.onCreate(savedInstanceState); 33 | 34 | if (debug) Log.i(TAG, "MyActivity - onCreate"); 35 | 36 | serverExpression[0] = "core/get"; 37 | serverExpression[1] = "UserRequest"; 38 | serverExpression[2] = "SELECT UserRequest AS i WHERE i.agent_id=:current_contact_id AND i.status!='Closed' AND i.status!='Resolved'"; 39 | serverExpression[3] = "ref, title, priority, start_date, tto_escalation_deadline, caller_id, agent_id, status, last_update, description, public_log"; 40 | } 41 | } -------------------------------------------------------------------------------- /app/src/main/java/de/itomig/itopenterprise/PersonAndOrgsLookup.java: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2011-2013 ITOMIG GmbH 2 | // 3 | // This file is part of iTopEnterprise. 4 | // 5 | // iTopEnterprise is free software; you can redistribute it and/or modify 6 | // it under the terms of the GNU General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // iTopEnterprise is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU General Public License 16 | // along with iTopEnterprise. If not, see 17 | 18 | package de.itomig.itopenterprise; 19 | 20 | import android.annotation.SuppressLint; 21 | import android.os.AsyncTask; 22 | import android.util.Log; 23 | import android.widget.Toast; 24 | 25 | import com.google.gson.reflect.TypeToken; 26 | 27 | import java.lang.reflect.Type; 28 | import java.util.ArrayList; 29 | 30 | import de.itomig.itopenterprise.cmdb.Organization; 31 | import de.itomig.itopenterprise.cmdb.Person; 32 | 33 | import static de.itomig.itopenterprise.ItopConfig.TAG; 34 | import static de.itomig.itopenterprise.ItopConfig.debug; 35 | import static de.itomig.itopenterprise.ItopConfig.itopAppContext; 36 | import static de.itomig.itopenterprise.ItopConfig.organizationLookup; 37 | import static de.itomig.itopenterprise.ItopConfig.organizationLookupTime; 38 | import static de.itomig.itopenterprise.ItopConfig.personLookup; 39 | import static de.itomig.itopenterprise.ItopConfig.personLookupTime; 40 | 41 | public class PersonAndOrgsLookup { 42 | 43 | private static final long MIN = 60 * 1000L; 44 | private boolean reqRunningFlag = false; 45 | 46 | void update() { 47 | //if (debug) 48 | // Log.d(TAG, "PersonAndOrgsLookup"); 49 | 50 | if (!reqRunningFlag) { 51 | if ((System.currentTimeMillis() - personLookupTime) > 150 * MIN) { 52 | reqRunningFlag = true; 53 | RequestPersonsFromServerTask reqServer = new RequestPersonsFromServerTask(); 54 | if (debug) Log.d(TAG, "PersonAndOrgsLookup, retrieving Persons from server"); 55 | reqServer.execute(); 56 | } else if ((System.currentTimeMillis() - organizationLookupTime) > 630 * MIN) { 57 | reqRunningFlag = true; 58 | RequestOrgsFromServerTask reqServer = new RequestOrgsFromServerTask(); 59 | if (debug) Log.d(TAG, "PersonAndOrgsLookup, retrieving Organizations from server"); 60 | reqServer.execute(); 61 | } 62 | } else { 63 | Log.e(TAG, "could not start PersonAndOrgsLookup"); 64 | } 65 | } 66 | 67 | class RequestPersonsFromServerTask extends 68 | AsyncTask { 69 | 70 | @Override 71 | protected void onPreExecute() { 72 | 73 | } 74 | 75 | @Override 76 | protected String doInBackground(Void... params) { 77 | String resp=""; 78 | try { 79 | resp = GetItopJSON.postJsonToItopServer("core/get", "Person", "SELECT Person", 80 | "name, friendlyname, phone, org_id"); 81 | 82 | } catch (Exception e) { 83 | e.printStackTrace(); 84 | } 85 | return resp; 86 | } 87 | 88 | @SuppressLint("UseSparseArrays") // sparse arrays cannot be iterated. 89 | @Override 90 | protected synchronized void onPostExecute(String resp) { 91 | 92 | reqRunningFlag = false; 93 | 94 | if (!ItopUtils.getItopError(resp).isEmpty()) return; 95 | 96 | ArrayList persons; 97 | Type type = new TypeToken() { 98 | }.getType(); 99 | persons = GetItopJSON.getArrayFromJson(resp, type, null); 100 | if (debug) 101 | Log.i(TAG, 102 | "onPostExecute - RefreshPersonsFromServer"); 103 | if (persons == null) { 104 | Log.e(TAG, "empty response when req. Person List. - RefreshPersonsFromServer"); 105 | return; 106 | } 107 | 108 | 109 | for (Person p : persons) { 110 | personLookup.put(p.getId(), p); 111 | if (debug) 112 | Log.d(TAG, "PersonAndOrgsLookup - setting person id=" + p.getId() + " to name=" + p.getFriendlyname() + "org_id=" + p.getOrg_id()); 113 | } 114 | 115 | personLookupTime = System.currentTimeMillis(); 116 | Cache.cachePersons(itopAppContext); 117 | } 118 | } 119 | 120 | class RequestOrgsFromServerTask extends 121 | AsyncTask { 122 | 123 | @Override 124 | protected void onPreExecute() { 125 | 126 | } 127 | 128 | @Override 129 | protected String doInBackground(String... expr) { 130 | String resp=""; 131 | try { 132 | resp = GetItopJSON.postJsonToItopServer("core/get", "Organization", 133 | "SELECT Organization", "name, id"); 134 | } catch (Exception e) { 135 | e.printStackTrace(); 136 | } 137 | return resp; 138 | } 139 | 140 | @SuppressLint("UseSparseArrays") // sparse arrays cannot be iterated. 141 | @Override 142 | protected void onPostExecute(String resp) { 143 | 144 | reqRunningFlag = false; 145 | if (!ItopUtils.getItopError(resp).isEmpty()) return; 146 | 147 | ArrayList organizations; 148 | Type type = new TypeToken() { 149 | }.getType(); 150 | organizations = GetItopJSON.getArrayFromJson(resp, type, null); 151 | 152 | if (debug) 153 | Log.i(TAG, 154 | "onPostExecute - PersonAndOrgsLookup - Organizations - reqRunningFlag cleared"); 155 | 156 | if (organizations == null) { 157 | Log.e(TAG, "empty response when req. Person List."); 158 | return; 159 | } 160 | 161 | for (Organization o : organizations) { 162 | organizationLookup.put(o.getId(), o.getName()); 163 | if (debug) Log.d(TAG,"PersonAndOrgsLookup - setting org id="+o.getId()+" to name="+o.getName()); 164 | } 165 | organizationLookupTime = System.currentTimeMillis(); 166 | Cache.cacheOrgs(itopAppContext); 167 | } 168 | } 169 | } 170 | -------------------------------------------------------------------------------- /app/src/main/java/de/itomig/itopenterprise/Preferences.java: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2011-2013 ITOMIG GmbH 2 | // 3 | // This file is part of iTopEnterprise. 4 | // 5 | // iTopEnterprise is free software; you can redistribute it and/or modify 6 | // it under the terms of the GNU General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // iTopEnterprise is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU General Public License 16 | // along with iTopEnterprise. If not, see 17 | 18 | package de.itomig.itopenterprise; 19 | 20 | import android.content.SharedPreferences; 21 | import android.content.SharedPreferences.OnSharedPreferenceChangeListener; 22 | import android.os.Bundle; 23 | import android.preference.EditTextPreference; 24 | import android.preference.ListPreference; 25 | import android.preference.PreferenceActivity; 26 | import android.preference.PreferenceManager; 27 | import android.util.Log; 28 | 29 | import static de.itomig.itopenterprise.ItopConfig.DEMO_LOGIN; 30 | import static de.itomig.itopenterprise.ItopConfig.DEMO_SSL; 31 | import static de.itomig.itopenterprise.ItopConfig.DEMO_URL; 32 | import static de.itomig.itopenterprise.ItopConfig.KEY_LOGIN; 33 | import static de.itomig.itopenterprise.ItopConfig.KEY_NOTIFY; 34 | import static de.itomig.itopenterprise.ItopConfig.KEY_SSL; 35 | import static de.itomig.itopenterprise.ItopConfig.KEY_URL; 36 | import static de.itomig.itopenterprise.ItopConfig.TAG; 37 | import static de.itomig.itopenterprise.ItopConfig.debug; 38 | import static de.itomig.itopenterprise.ItopConfig.itopAppContext; 39 | 40 | /** 41 | * itopMobile Settings 42 | * 43 | * @author mblank 44 | */ 45 | public class Preferences extends PreferenceActivity implements OnSharedPreferenceChangeListener { 46 | 47 | private EditTextPreference urlPref, loginPref; 48 | private ListPreference notifyPref; 49 | 50 | public void onCreate(Bundle savedInstanceState) { 51 | super.onCreate(savedInstanceState); 52 | 53 | if (debug) Log.i(TAG, "Preferences - onCreate"); 54 | addPreferencesFromResource(R.xml.preferences); 55 | 56 | urlPref = (EditTextPreference) getPreferenceScreen().findPreference(KEY_URL); 57 | loginPref = (EditTextPreference) getPreferenceScreen().findPreference(KEY_LOGIN); 58 | notifyPref = (ListPreference) getPreferenceScreen().findPreference(KEY_NOTIFY); 59 | 60 | initSummaryTexts(); 61 | 62 | } 63 | 64 | @Override 65 | protected void onResume() { 66 | super.onResume(); 67 | if (debug) Log.i(TAG, "Preferences - onResume"); 68 | initSummaryTexts(); 69 | 70 | // Set up a listener whenever a key changes 71 | getPreferenceScreen().getSharedPreferences().registerOnSharedPreferenceChangeListener(this); 72 | } 73 | 74 | @Override 75 | protected void onPause() { 76 | super.onPause(); 77 | if (debug) Log.i(TAG, "Preferences - onResume"); 78 | // Unregister the listener whenever a key changes 79 | getPreferenceScreen().getSharedPreferences().unregisterOnSharedPreferenceChangeListener(this); 80 | } 81 | 82 | private void initSummaryTexts() { 83 | SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this); 84 | 85 | String login = prefs.getString(KEY_LOGIN, DEMO_LOGIN); 86 | loginPref.setSummary(login); 87 | 88 | int notifySetting = Integer.valueOf(prefs.getString(KEY_NOTIFY, "0")); 89 | if (debug) Log.i(TAG, "Pref: notify=" + notifySetting); 90 | CharSequence[] notifyEntries = notifyPref.getEntries(); 91 | notifyPref.setSummary(notifyEntries[notifySetting]); 92 | 93 | String url = (prefs.getString(KEY_URL, DEMO_URL)).trim(); 94 | boolean ssl_enabled = prefs.getBoolean(KEY_SSL, DEMO_SSL); 95 | 96 | if (ssl_enabled) { 97 | urlPref.setSummary("https://" + url); 98 | } else { 99 | urlPref.setSummary("http://" + url); 100 | } 101 | } 102 | 103 | public void onSharedPreferenceChanged(SharedPreferences prefs, 104 | String key) { 105 | if (debug) Log.i(TAG, "Preferences - sharedPrefChanged - " + key); 106 | if (key.equals(KEY_LOGIN)) { 107 | String login = prefs.getString(KEY_LOGIN, DEMO_LOGIN); 108 | loginPref.setSummary(login); 109 | } else if (key.equals(KEY_NOTIFY)) { 110 | int notifySetting = Integer.valueOf(prefs.getString(KEY_NOTIFY, "0")); 111 | if (debug) Log.i(TAG, "Pref: notify=" + notifySetting); 112 | CharSequence[] notifyEntries = notifyPref.getEntries(); 113 | notifyPref.setSummary(notifyEntries[notifySetting]); 114 | } else if (key.equals(KEY_SSL)) { 115 | String url = (prefs.getString(KEY_URL, DEMO_URL)).trim(); 116 | boolean ssl_enabled = prefs.getBoolean(KEY_SSL, DEMO_SSL); 117 | if (ssl_enabled) { 118 | urlPref.setSummary("https://" + url); 119 | } else { 120 | urlPref.setSummary("http://" + url); 121 | } 122 | } else if (key.equals(KEY_URL)) { 123 | String url = (prefs.getString(KEY_URL, DEMO_URL)).trim(); 124 | boolean ssl_enabled = prefs.getBoolean(KEY_SSL, DEMO_SSL); 125 | if (ssl_enabled) { 126 | urlPref.setSummary("https://" + url); 127 | } else { 128 | urlPref.setSummary("http://" + url); 129 | } 130 | // cache makes no sense when server has changed. 131 | de.itomig.itopenterprise.Cache.clearPersonsCache(itopAppContext); 132 | de.itomig.itopenterprise.Cache.clearOrgsCache(itopAppContext); 133 | } 134 | } 135 | } -------------------------------------------------------------------------------- /app/src/main/java/de/itomig/itopenterprise/TaskAdapter.java: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2011-2013 ITOMIG GmbH 2 | // 3 | // This file is part of iTopEnterprise. 4 | // 5 | // iTopEnterprise is free software; you can redistribute it and/or modify 6 | // it under the terms of the GNU General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // iTopEnterprise is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU General Public License 16 | // along with iTopEnterprise. If not, see 17 | 18 | package de.itomig.itopenterprise; 19 | 20 | import android.content.Context; 21 | import android.graphics.Color; 22 | import android.view.LayoutInflater; 23 | import android.view.View; 24 | import android.view.ViewGroup; 25 | import android.widget.BaseAdapter; 26 | import android.widget.ImageView; 27 | import android.widget.TextView; 28 | 29 | import java.util.List; 30 | 31 | import de.itomig.itopenterprise.cmdb.InternalTask; 32 | 33 | import static de.itomig.itopenterprise.ItopConfig.prioStrings; 34 | 35 | public class TaskAdapter extends BaseAdapter { 36 | private Context context; 37 | private List listTasks; 38 | 39 | public TaskAdapter(Context context, List listTasks) { 40 | this.context = context; 41 | this.listTasks = listTasks; 42 | } 43 | 44 | public int getCount() { 45 | return listTasks.size(); 46 | } 47 | 48 | public Object getItem(int position) { 49 | return listTasks.get(position); 50 | } 51 | 52 | public long getItemId(int position) { 53 | return position; 54 | } 55 | 56 | public View getView(int position, View convertView, ViewGroup viewGroup) { 57 | InternalTask entry = listTasks.get(position); 58 | if (convertView == null) { // (re-)using the "convertView" is important for performance 59 | LayoutInflater inflater = (LayoutInflater) context 60 | .getSystemService(Context.LAYOUT_INFLATER_SERVICE); 61 | convertView = inflater.inflate(R.layout.itop_task_row, null); 62 | } 63 | if (position % 2 == 0) { 64 | convertView.setBackgroundColor(Color.rgb(255, 255, 255)); 65 | } else { 66 | convertView.setBackgroundColor(Color.rgb(235, 235, 235)); 67 | } 68 | 69 | TextView tvName = (TextView) convertView.findViewById(R.id.tv_name); 70 | TextView tvDesc = (TextView) convertView.findViewById(R.id.tv_desc); 71 | tvName.setText(entry.name); 72 | tvDesc.setText("(" + entry.person_id_friendlyname + ") " + entry.description); 73 | 74 | ImageView prImage = (ImageView) convertView.findViewById(R.id.imagev); 75 | prImage.setImageResource(entry.prioImageResource(prioStrings)); 76 | prImage.setFocusableInTouchMode(false); 77 | prImage.setFocusable(false); 78 | 79 | return convertView; 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /app/src/main/java/de/itomig/itopenterprise/TaskDetailActivity.java: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2011-2015 ITOMIG GmbH 2 | // 3 | // This file is part of iTopEnterprise. 4 | // 5 | // iTopEnterprise is free software; you can redistribute it and/or modify 6 | // it under the terms of the GNU General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // iTopEnterprise is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU General Public License 16 | // along with iTopEnterprise. If not, see 17 | 18 | package de.itomig.itopenterprise; 19 | 20 | import android.app.Activity; 21 | import android.content.ActivityNotFoundException; 22 | import android.content.Intent; 23 | import android.net.Uri; 24 | import android.os.Bundle; 25 | import android.util.Log; 26 | import android.view.View; 27 | import android.widget.Button; 28 | import android.widget.ImageView; 29 | import android.widget.TextView; 30 | import android.widget.Toast; 31 | 32 | import de.itomig.itopenterprise.cmdb.InternalTask; 33 | import de.itomig.itopenterprise.cmdb.Person; 34 | 35 | import static de.itomig.itopenterprise.ItopConfig.TAG; 36 | import static de.itomig.itopenterprise.ItopConfig.debug; 37 | import static de.itomig.itopenterprise.ItopConfig.personLookup; 38 | import static de.itomig.itopenterprise.ItopConfig.prioStrings; 39 | 40 | public class TaskDetailActivity extends Activity { 41 | private TextView tvTitle, tvDesc, tvStatus, tvRemark; 42 | private TextView tvCaller; 43 | private ImageView priorityIcon, callCaller; 44 | private InternalTask t; 45 | private String callerPhone; 46 | 47 | @Override 48 | public void onCreate(Bundle savedInstanceState) { 49 | super.onCreate(savedInstanceState); 50 | Button btn; 51 | 52 | if (debug) 53 | Log.i(TAG, "TaskDetailActivity - onCreate"); 54 | 55 | setContentView(R.layout.task_details); 56 | 57 | btn = (Button) findViewById(R.id.button1); 58 | 59 | t = (InternalTask) getIntent().getSerializableExtra("task"); 60 | 61 | priorityIcon = (ImageView) findViewById(R.id.image); 62 | 63 | tvTitle = (TextView) findViewById(R.id.titleText); // name 64 | 65 | tvDesc = (TextView) findViewById(R.id.descText); 66 | tvRemark = (TextView) findViewById(R.id.remarkText); 67 | 68 | tvStatus = (TextView) findViewById(R.id.statusText); 69 | tvCaller = (TextView) findViewById(R.id.callerText); // responsible 70 | 71 | callCaller = (ImageView) findViewById(R.id.callCallerImage); 72 | 73 | callCaller.setOnClickListener(new View.OnClickListener() { 74 | public void onClick(View v) { 75 | // Perform action on click: call "caller" 76 | if (callerPhone != null) { 77 | call(callerPhone); 78 | } 79 | } 80 | }); 81 | 82 | btn.setOnClickListener(new View.OnClickListener() { 83 | 84 | public void onClick(View v) { 85 | toast("edit not yet implemented."); 86 | } 87 | }); 88 | } 89 | 90 | @Override 91 | protected void onResume() { 92 | super.onResume(); 93 | if (debug) 94 | Log.i(TAG, "TaskDetailActivity - onResume"); 95 | display(); 96 | 97 | } 98 | 99 | @Override 100 | protected void onPause() { 101 | super.onPause(); 102 | if (debug) 103 | Log.i(TAG, "TaskTicketActivity - onPause"); 104 | startService(new Intent(BackgroundCheck.class.getName())); 105 | } 106 | 107 | @Override 108 | public void onActivityResult(int requestCode, int resultCode, Intent data) { 109 | if (resultCode == Activity.RESULT_OK && requestCode == 0) { 110 | String result = data.toURI(); 111 | Toast.makeText(this, result, Toast.LENGTH_LONG).show(); 112 | } 113 | } 114 | 115 | private void display() { 116 | if (debug) 117 | Log.i(TAG, "TaskTicketActivity - display()"); 118 | priorityIcon.setImageResource(t.prioImageResource(prioStrings)); 119 | tvTitle.setText(t.name); 120 | tvStatus.setText("Status: " + t.status); 121 | 122 | // reset phone numbers and call icons. 123 | callerPhone = null; 124 | callCaller.setImageResource(R.drawable.nothing32); 125 | 126 | tvCaller.setText("resp.: " + t.person_id_friendlyname); 127 | 128 | Person p = personLookup.get(t.person_id); 129 | if (p != null) { 130 | if (p.getPhone().length() > 7) { 131 | callCaller.setImageResource(R.drawable.call_contact); 132 | callerPhone = p.getPhone(); 133 | } else { 134 | callerPhone = null; 135 | callCaller.setImageResource(R.drawable.call_contact_off); 136 | } 137 | } 138 | 139 | tvDesc.setText(t.description); 140 | tvRemark.setText(t.remarks); 141 | 142 | } 143 | 144 | @SuppressWarnings("SameParameterValue") 145 | private void toast(String string) { 146 | Toast.makeText(this, string, Toast.LENGTH_LONG).show(); 147 | } 148 | 149 | private void call(String num) { 150 | try { 151 | Intent callIntent = new Intent(Intent.ACTION_CALL); 152 | callIntent.setData(Uri.parse("tel:" + num)); 153 | startActivity(callIntent); 154 | 155 | } catch (ActivityNotFoundException activityException) { 156 | Log.e(TAG, "dialing - Call to " + num + " failed. ", 157 | activityException); 158 | } 159 | } 160 | 161 | } 162 | -------------------------------------------------------------------------------- /app/src/main/java/de/itomig/itopenterprise/TicketAdapter.java: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2011-2013 ITOMIG GmbH 2 | // 3 | // This file is part of iTopEnterprise. 4 | // 5 | // iTopEnterprise is free software; you can redistribute it and/or modify 6 | // it under the terms of the GNU General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // iTopEnterprise is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU General Public License 16 | // along with iTopEnterprise. If not, see 17 | 18 | package de.itomig.itopenterprise; 19 | 20 | import android.content.Context; 21 | import android.graphics.Color; 22 | import android.view.LayoutInflater; 23 | import android.view.View; 24 | import android.view.ViewGroup; 25 | import android.widget.BaseAdapter; 26 | import android.widget.ImageView; 27 | import android.widget.TextView; 28 | 29 | import java.util.List; 30 | 31 | import de.itomig.itopenterprise.cmdb.ItopTicket; 32 | 33 | public class TicketAdapter extends BaseAdapter { 34 | private Context context; 35 | private List listItopTicket; 36 | 37 | public TicketAdapter(Context context, List listItopTicket) { 38 | this.context = context; 39 | this.listItopTicket = listItopTicket; 40 | } 41 | 42 | public int getCount() { 43 | return listItopTicket.size(); 44 | } 45 | 46 | public Object getItem(int position) { 47 | return listItopTicket.get(position); 48 | } 49 | 50 | public long getItemId(int position) { 51 | return position; 52 | } 53 | 54 | public View getView(int position, View convertView, ViewGroup viewGroup) { 55 | ItopTicket entry = listItopTicket.get(position); 56 | if (convertView == null) { // (re-)using the "convertView" is important for performance 57 | LayoutInflater inflater = (LayoutInflater) context 58 | .getSystemService(Context.LAYOUT_INFLATER_SERVICE); 59 | convertView = inflater.inflate(R.layout.itop_ticket_row, null); 60 | } 61 | TextView tvRef = (TextView) convertView.findViewById(R.id.tv_ticket); 62 | tvRef.setText(entry.toShortString()); 63 | if (entry.isError()) { 64 | tvRef.setBackgroundColor(Color.argb(100, 255, 100, 100)); 65 | } else { 66 | tvRef.setBackgroundColor(Color.argb(100, 255, 255, 255)); 67 | } 68 | 69 | ImageView prImage = (ImageView) convertView.findViewById(R.id.imagev); 70 | 71 | prImage.setImageResource(entry.prioImageResource()); 72 | prImage.setFocusableInTouchMode(false); 73 | prImage.setFocusable(false); 74 | 75 | ImageView ttoImage = (ImageView) convertView.findViewById(R.id.imagev2); 76 | if (entry.isTtoEscalated()) ttoImage.setImageResource(R.drawable.alarm_clock); 77 | 78 | return convertView; 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /app/src/main/java/de/itomig/itopenterprise/cmdb/CMDBObject.java: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2011-2013 ITOMIG GmbH 2 | // 3 | // This file is part of iTopEnterprise. 4 | // 5 | // iTopEnterprise is free software; you can redistribute it and/or modify 6 | // it under the terms of the GNU General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // iTopEnterprise is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU General Public License 16 | // along with iTopEnterprise. If not, see 17 | 18 | package de.itomig.itopenterprise.cmdb; 19 | 20 | import java.io.Serializable; 21 | 22 | import static de.itomig.itopenterprise.ItopConfig.INVALID_ID; 23 | 24 | public class CMDBObject implements Serializable { 25 | // Serializable is needed to "hook it up" on an intent with 26 | private static final long serialVersionUID = -5998434779602343501L; 27 | 28 | public int id = INVALID_ID; 29 | 30 | public CMDBObject(int id) { 31 | super(); 32 | this.id = id; 33 | } 34 | 35 | 36 | } 37 | -------------------------------------------------------------------------------- /app/src/main/java/de/itomig/itopenterprise/cmdb/InternalTask.java: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2011-2013 ITOMIG GmbH 2 | // 3 | // This file is part of iTopEnterprise. 4 | // 5 | // iTopEnterprise is free software; you can redistribute it and/or modify 6 | // it under the terms of the GNU General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // iTopEnterprise is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU General Public License 16 | // along with iTopEnterprise. If not, see 17 | 18 | package de.itomig.itopenterprise.cmdb; 19 | 20 | import android.util.Log; 21 | 22 | import de.itomig.itopenterprise.R; 23 | 24 | import static de.itomig.itopenterprise.ItopConfig.INVALID_ID; 25 | import static de.itomig.itopenterprise.ItopConfig.TAG; 26 | import static de.itomig.itopenterprise.ItopConfig.debug; 27 | 28 | /** 29 | * Class for holding Itop InternalTasks 30 | */ 31 | 32 | public class InternalTask extends CMDBObject { 33 | 34 | private static final long serialVersionUID = -1645221039655675557L; 35 | 36 | public String name; 37 | public String status; // "in Arbeit", " ...." 38 | public String priority; // niedrig, mittel, hoch 39 | public int org_id; 40 | public String org_name; 41 | public int team_id; 42 | public String team_name; 43 | public int person_id; 44 | public String description; 45 | public String remarks; 46 | public String friendlyname; 47 | public String org_id_friendlyname; 48 | public String team_id_friendlyname; 49 | public String person_id_friendlyname; 50 | 51 | public InternalTask(int id) { 52 | super(id); 53 | } 54 | 55 | public String toShortString() { 56 | 57 | StringBuilder sb = new StringBuilder(); 58 | 59 | sb.append(name); 60 | if (name.length() != 0) 61 | sb.append(" - "); // avoid to display the '-' when the ticket is misused for showing errors etc. 62 | sb.append("\nResp: "); 63 | sb.append(person_id_friendlyname); 64 | sb.append("\n"); 65 | sb.append(description); 66 | return sb.toString(); 67 | } 68 | 69 | public int prioImageResource(String[] allowed_prios) { 70 | 71 | // return 1..3 star image, depending on priority 72 | int res; 73 | if (debug) Log.d(TAG, "task prio=" + priority); 74 | 75 | int numPrio = INVALID_ID; 76 | for (int i = 0; i < allowed_prios.length; i++) { 77 | if (priority.equals(allowed_prios[i])) numPrio = i + 1; // 1=high, 2=medium, 3=low 78 | } 79 | switch (numPrio) { 80 | case 1: 81 | res = R.drawable.star3_on_tr1; // highest 82 | break; 83 | case 2: 84 | res = R.drawable.star3_off_on_on_tr1; 85 | break; 86 | case 3: 87 | res = R.drawable.star3_off_off_on_tr1; 88 | break; 89 | default: 90 | if (debug) Log.d(TAG, "ItopTicket unknown prio=" + priority); 91 | res = R.drawable.star3_off; 92 | } 93 | return res; 94 | } 95 | 96 | 97 | } 98 | -------------------------------------------------------------------------------- /app/src/main/java/de/itomig/itopenterprise/cmdb/ItopTicketDeserializer.java: -------------------------------------------------------------------------------- 1 | package de.itomig.itopenterprise.cmdb; 2 | 3 | import android.util.Log; 4 | 5 | import com.google.gson.JsonArray; 6 | import com.google.gson.JsonDeserializationContext; 7 | import com.google.gson.JsonElement; 8 | import com.google.gson.JsonObject; 9 | import com.google.gson.JsonParseException; 10 | import com.google.gson.JsonDeserializer; 11 | import java.lang.reflect.Type; 12 | 13 | import static de.itomig.itopenterprise.ItopConfig.TAG; 14 | 15 | 16 | /** 17 | * Created by mblank on 23.02.15. 18 | */ 19 | public class ItopTicketDeserializer implements JsonDeserializer { 20 | 21 | @Override 22 | public ItopTicket deserialize(final JsonElement json, final Type typeOfT, final JsonDeserializationContext context) 23 | throws JsonParseException { 24 | final JsonObject jsonObject = json.getAsJsonObject(); 25 | final ItopTicket ticket = new ItopTicket("UserRequest"); 26 | //"ref, title, priority, start_date, tto_escalation_deadline, caller_id, agent_id, status, last_update, description, public_log" 27 | final String ref= jsonObject.get("ref").getAsString(); 28 | ticket.setRef(ref); 29 | 30 | final JsonElement jsonTitle = jsonObject.get("title"); 31 | final String title = jsonTitle.getAsString(); 32 | ticket.setTitle(title); 33 | 34 | final String priority = jsonObject.get("priority").getAsString(); 35 | ticket.setPriority(priority); 36 | 37 | final String status = jsonObject.get("status").getAsString(); 38 | ticket.setStatus(status); 39 | 40 | final String last_update = jsonObject.get("last_update").getAsString(); 41 | ticket.setLast_update(last_update); 42 | 43 | /* the following are just WANT and might not exist in response - just ignore */ 44 | try { 45 | final String start_date = jsonObject.get("start_date").getAsString(); 46 | ticket.setStart_date(start_date); 47 | 48 | final String tto_escalation_deadline = jsonObject.get("tto_escalation_deadline").getAsString(); 49 | ticket.setTto_escalation_deadline(tto_escalation_deadline); 50 | 51 | final String caller_id = jsonObject.get("caller_id").getAsString(); 52 | ticket.setCaller_id(caller_id); 53 | 54 | final String agent_id = jsonObject.get("agent_id").getAsString(); 55 | ticket.setAgent_id(agent_id); 56 | 57 | final String description = jsonObject.get("description").getAsString(); 58 | ticket.setDescription(description); 59 | 60 | final JsonElement jsonPublicLogObject = jsonObject.get("public_log"); 61 | 62 | final JsonArray jsonPublicLogArray = jsonPublicLogObject.getAsJsonObject().get("entries").getAsJsonArray(); 63 | for (int i = 0; i < jsonPublicLogArray.size(); i++) { 64 | final JsonElement jsonPLEntry = jsonPublicLogArray.get(i); 65 | PublicLogEntry ple = new PublicLogEntry(); 66 | ple.setDate(jsonPLEntry.getAsJsonObject().get("date").getAsString()); 67 | ple.setMessage(jsonPLEntry.getAsJsonObject().get("message").getAsString()); 68 | //ple.setUser_id(jsonPLEntry.getAsJsonObject().get("user_id").getAsInt()); is always =null 69 | ple.setUser_login(jsonPLEntry.getAsJsonObject().get("user_login").getAsString()); 70 | ticket.addPublicLogEntry(ple); 71 | 72 | } 73 | ticket.sortPublic_log(); 74 | } catch (Exception e) { 75 | Log.i(TAG,"in json deserialize:"+e.getMessage()); 76 | } 77 | return ticket; 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /app/src/main/java/de/itomig/itopenterprise/cmdb/Organization.java: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2011-2013 ITOMIG GmbH 2 | // 3 | // This file is part of iTopEnterprise. 4 | // 5 | // iTopEnterprise is free software; you can redistribute it and/or modify 6 | // it under the terms of the GNU General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // iTopEnterprise is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU General Public License 16 | // along with iTopEnterprise. If not, see 17 | 18 | package de.itomig.itopenterprise.cmdb; 19 | 20 | import java.io.Serializable; 21 | 22 | public class Organization extends CMDBObject implements Serializable { 23 | 24 | private static final long serialVersionUID = -5998999779602343501L; 25 | private String name; 26 | 27 | public Organization(int id, String name) { 28 | super(id); 29 | this.name = name; 30 | } 31 | 32 | @Override 33 | public String toString() { 34 | return "Organization [id=" + id + ", name=" + name + "]"; 35 | } 36 | 37 | public int getId() { 38 | return id; 39 | } 40 | 41 | public void setId(int id) { 42 | this.id = id; 43 | } 44 | 45 | public String getName() { 46 | return name; 47 | } 48 | 49 | public void setName(String name) { 50 | this.name = name; 51 | } 52 | 53 | 54 | } 55 | -------------------------------------------------------------------------------- /app/src/main/java/de/itomig/itopenterprise/cmdb/Person.java: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2011-2013 ITOMIG GmbH 2 | // 3 | // This file is part of iTopEnterprise. 4 | // 5 | // iTopEnterprise is free software; you can redistribute it and/or modify 6 | // it under the terms of the GNU General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // iTopEnterprise is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU General Public License 16 | // along with iTopEnterprise. If not, see 17 | 18 | package de.itomig.itopenterprise.cmdb; 19 | 20 | import java.io.Serializable; 21 | 22 | public class Person extends CMDBObject implements Serializable { 23 | private static final long serialVersionUID = -5998434777702343501L; 24 | private int org_id=1; 25 | private String friendlyname=""; 26 | private String phone=""; 27 | 28 | public Person(int id) { 29 | super(id); 30 | } 31 | public Person(int id, String friendlyname, String phone, int org_id) { 32 | super(id); 33 | 34 | this.org_id = org_id; 35 | this.friendlyname = friendlyname; 36 | this.phone = phone; 37 | } 38 | 39 | public int getId() { 40 | return id; 41 | } 42 | 43 | public void setId(int id) { 44 | this.id = id; 45 | } 46 | 47 | public int getOrg_id() { 48 | return org_id; 49 | } 50 | 51 | public void setOrg_id(int org_id) { 52 | this.org_id = org_id; 53 | } 54 | 55 | public String getFriendlyname() { 56 | 57 | if (friendlyname !=null) { 58 | return friendlyname; 59 | } else { 60 | return "?"; 61 | } 62 | } 63 | 64 | public void setFriendlyname(String friendlyname) { 65 | this.friendlyname = friendlyname; 66 | } 67 | 68 | public String getPhone() { 69 | 70 | if (phone != null) { 71 | return phone; 72 | } else { 73 | return "?"; 74 | } 75 | } 76 | 77 | public void setPhone(String phone) { 78 | this.phone = phone; 79 | } 80 | 81 | } 82 | -------------------------------------------------------------------------------- /app/src/main/java/de/itomig/itopenterprise/cmdb/PublicLogEntry.java: -------------------------------------------------------------------------------- 1 | package de.itomig.itopenterprise.cmdb; 2 | 3 | import java.io.Serializable; 4 | 5 | /** 6 | * Created by mblank on 23.02.15. 7 | */ 8 | public class PublicLogEntry implements Serializable { 9 | // Serializable is needed to "hook it up" on an intent with 10 | private static final long serialVersionUID = -5998434779602343991L; 11 | String date =""; 12 | String user_login=""; 13 | int user_id=0; 14 | String message=""; 15 | 16 | public PublicLogEntry() { 17 | } 18 | 19 | public PublicLogEntry(String s) { 20 | date=""; 21 | user_login=""; 22 | user_id = 0; 23 | message = s; 24 | } 25 | 26 | public String getDate() { 27 | return date; 28 | } 29 | 30 | public void setDate(String date) { 31 | this.date = date; 32 | } 33 | 34 | public String getUser_login() { 35 | return user_login; 36 | } 37 | 38 | public void setUser_login(String user_login) { 39 | this.user_login = user_login; 40 | } 41 | 42 | public int getUser_id() { 43 | return user_id; 44 | } 45 | 46 | public void setUser_id(int user_id) { 47 | this.user_id = user_id; 48 | } 49 | 50 | public String getMessage() { 51 | return message; 52 | } 53 | 54 | public void setMessage(String message) { 55 | this.message = message; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /app/src/main/java/de/itomig/itopenterprise/cmdb/XmlResult.java: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2011-2013 ITOMIG GmbH 2 | // 3 | // This file is part of iTopEnterprise. 4 | // 5 | // iTopEnterprise is free software; you can redistribute it and/or modify 6 | // it under the terms of the GNU General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // iTopEnterprise is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU General Public License 16 | // along with iTopEnterprise. If not, see 17 | 18 | package de.itomig.itopenterprise.cmdb; 19 | 20 | import org.w3c.dom.Document; 21 | 22 | public class XmlResult { 23 | 24 | public Document doc; 25 | public String error; 26 | 27 | public XmlResult() { 28 | this.doc = null; 29 | this.error = ""; 30 | } 31 | 32 | 33 | } 34 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/alarm_clock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable-hdpi/alarm_clock.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/alarm_clock_64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable-hdpi/alarm_clock_64.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/alarm_clock_64_off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable-hdpi/alarm_clock_64_off.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/bar_empty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable-hdpi/bar_empty.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/bar_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable-hdpi/bar_full.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/bar_nearly_empty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable-hdpi/bar_nearly_empty.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/bar_nearly_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable-hdpi/bar_nearly_full.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/barcode_128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable-hdpi/barcode_128.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/btn_star_big_off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable-hdpi/btn_star_big_off.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/btn_star_big_on_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable-hdpi/btn_star_big_on_selected.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/call_contact.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable-hdpi/call_contact.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/call_contact_off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable-hdpi/call_contact_off.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_btn_search_go.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable-hdpi/ic_btn_search_go.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_info_details.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable-hdpi/ic_info_details.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_menu_barcode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable-hdpi/ic_menu_barcode.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_menu_info_details.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable-hdpi/ic_menu_info_details.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_menu_preferences.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable-hdpi/ic_menu_preferences.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_menu_query.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable-hdpi/ic_menu_query.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_menu_search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable-hdpi/ic_menu_search.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_menu_tickets.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable-hdpi/ic_menu_tickets.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_tickets.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable-hdpi/ic_tickets.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable-hdpi/icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/incident32_grey.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable-hdpi/incident32_grey.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/itomig_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable-hdpi/itomig_logo.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/itomig_logo_170.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable-hdpi/itomig_logo_170.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/itop_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable-hdpi/itop_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/itop_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable-hdpi/itop_logo.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/itop_logo2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable-hdpi/itop_logo2.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/itop_logo3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable-hdpi/itop_logo3.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/itop_logo4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable-hdpi/itop_logo4.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/logo7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable-hdpi/logo7.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/logo7_36px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable-hdpi/logo7_36px.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/logo_itop_glow_72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable-hdpi/logo_itop_glow_72.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/logo_itop_only_36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable-hdpi/logo_itop_only_36.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/logo_itop_only_72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable-hdpi/logo_itop_only_72.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/nothing32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable-hdpi/nothing32.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/person_grey.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable-hdpi/person_grey.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/seek_thumb_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable-hdpi/seek_thumb_normal.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/seek_thumb_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable-hdpi/seek_thumb_pressed.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/seek_thumb_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable-hdpi/seek_thumb_selected.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/star3_off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable-hdpi/star3_off.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/star3_off_off_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable-hdpi/star3_off_off_on.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/star3_off_off_on_t.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable-hdpi/star3_off_off_on_t.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/star3_off_off_on_tr1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable-hdpi/star3_off_off_on_tr1.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/star3_off_on_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable-hdpi/star3_off_on_on.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/star3_off_on_on_tr1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable-hdpi/star3_off_on_on_tr1.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/star3_off_tr1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable-hdpi/star3_off_tr1.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/star3_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable-hdpi/star3_on.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/star3_on_tr1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable-hdpi/star3_on_tr1.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/star4_off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable-hdpi/star4_off.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/star4_off_off_off_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable-hdpi/star4_off_off_off_on.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/star4_off_off_on_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable-hdpi/star4_off_off_on_on.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/star4_off_on_on_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable-hdpi/star4_off_on_on_on.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/star4_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable-hdpi/star4_on.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/textfield_search_empty_pressed.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable-hdpi/textfield_search_empty_pressed.9.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/textfield_search_empty_selected.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable-hdpi/textfield_search_empty_selected.9.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/user_request_grey.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable-hdpi/user_request_grey.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-ldpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable-ldpi/icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable-mdpi/icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/alarm_clock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable/alarm_clock.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/alarm_clock_64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable/alarm_clock_64.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/alarm_clock_64_off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable/alarm_clock_64_off.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/bar_empty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable/bar_empty.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/bar_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable/bar_full.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/bar_nearly_empty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable/bar_nearly_empty.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/bar_nearly_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable/bar_nearly_full.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/barcode_128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable/barcode_128.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/btn_star_big_off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable/btn_star_big_off.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/btn_star_big_on_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable/btn_star_big_on_selected.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/call_contact.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable/call_contact.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/call_contact_off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable/call_contact_off.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_btn_search_go.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable/ic_btn_search_go.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_info_details.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable/ic_info_details.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_menu_barcode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable/ic_menu_barcode.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_menu_info_details.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable/ic_menu_info_details.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_menu_preferences.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable/ic_menu_preferences.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_menu_query.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable/ic_menu_query.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_menu_search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable/ic_menu_search.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_menu_tickets.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable/ic_menu_tickets.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_tab_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_tab_1_grey.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable/ic_tab_1_grey.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_tab_1_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable/ic_tab_1_white.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_tickets.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable/ic_tickets.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable/icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/incident32.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/incident32_grey.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable/incident32_grey.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/incident32_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable/incident32_white.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/itomig_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable/itomig_logo.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/itomig_logo_170.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable/itomig_logo_170.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/itop_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable/itop_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/itop_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable/itop_logo.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/itop_logo2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable/itop_logo2.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/itop_logo3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable/itop_logo3.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/itop_logo4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable/itop_logo4.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/logo7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable/logo7.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/logo7_36px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable/logo7_36px.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/logo_itop_glow_72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable/logo_itop_glow_72.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/logo_itop_only_36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable/logo_itop_only_36.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/logo_itop_only_72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable/logo_itop_only_72.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/nothing32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable/nothing32.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/person.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/person_grey.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable/person_grey.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/person_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable/person_white.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/seek_thumb_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable/seek_thumb_normal.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/seek_thumb_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable/seek_thumb_pressed.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/seek_thumb_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable/seek_thumb_selected.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/star3_off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable/star3_off.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/star3_off_off_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable/star3_off_off_on.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/star3_off_off_on_t.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable/star3_off_off_on_t.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/star3_off_off_on_tr1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable/star3_off_off_on_tr1.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/star3_off_on_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable/star3_off_on_on.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/star3_off_on_on_tr1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable/star3_off_on_on_tr1.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/star3_off_tr1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable/star3_off_tr1.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/star3_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable/star3_on.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/star3_on_tr1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable/star3_on_tr1.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/star4_off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable/star4_off.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/star4_off_off_off_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable/star4_off_off_off_on.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/star4_off_off_on_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable/star4_off_off_on_on.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/star4_off_on_on_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable/star4_off_on_on_on.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/star4_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable/star4_on.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/textfield_search_empty_pressed.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable/textfield_search_empty_pressed.9.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/textfield_search_empty_selected.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable/textfield_search_empty_selected.9.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/user_request.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/user_request_grey.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable/user_request_grey.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/user_request_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michael71/ItopEnterprise/41dbfa78c903c4a03843a82104cee166acedd9b9/app/src/main/res/drawable/user_request_white.png -------------------------------------------------------------------------------- /app/src/main/res/layout/about.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 14 | 15 | 19 | 20 | 26 | 27 | 36 | 37 | 38 | 49 | 50 | 61 | 62 | 73 | 74 | 78 | 79 | 87 | 88 | 95 | 96 | 97 | 109 | 121 | 122 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_add.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 22 | 23 |