Commit e0af23f0 by Takatoshi Miura

Merge branch 'hotfix/1.4.401' into features/1.4.410_miura

# Conflicts:
#	gradle.properties
parents 5e286b2b 69ee90cf
......@@ -65,6 +65,10 @@ public class OperationListJSON extends AcmsCommonJSON {
public static final String PermitCodeRequiredFlg = "permitCodeRequiredFlg";
public static final String DisplayPermissionFlg = "displayPermissionFlg";
public static final String NewReportFlg = "newReportFlg";
public static final String ProcessList = "processList";
public static final String WarningReportList = "warningReportList";
public List<OperationDto> operationList;
public OperationListJSON(String jsonString) throws AcmsException {
......@@ -180,6 +184,14 @@ public class OperationListJSON extends AcmsCommonJSON {
dto.operationGroupMasterRelationDtoList.add(operationGroupMasterRelationDto);
}
}
// check pickup tab
dto.newReportFlg = operationJson.has(NewReportFlg) ? operationJson.getInt(NewReportFlg) : 0;
if (operationJson.has(ProcessList)) {
dto.processJsonArray = operationJson.getJSONArray(ProcessList);
}
if (operationJson.has(WarningReportList)) {
dto.warningReportJsonArray = operationJson.getJSONArray(WarningReportList);
}
operationList.add(dto);
}
}
......
......@@ -893,4 +893,12 @@ public class ABVEnvironment {
public String getMasterFilePath() {
return String.format(ApertureMasterDataDirFormat, rootDirectory);
}
//pickup processList, warningReport
public String getPickupProcessListOperationFilePath(long operationId) {
return getOperationDirFile(operationId) + "/pickupProcessList.json";
}
public String getPickupWarningReportListOperationFilePath(long operationId) {
return getOperationDirFile(operationId) + "/pickupWarningReportList.json";
}
}
......@@ -30,6 +30,7 @@ public class ABookKeys {
public static final String PERMIT_CODE_REQUIRED_FLG = "permitCodeRequiredFlg";
public static final String PERMIT_CODE = "permitCode";
public static final String DISPLAY_PERMISSION_FLG = "displayPermissionFlg";
public static final String NEW_REPORT_FLG = "newReportFlg";
public static final String OPERATION_GROUPMASTER_LIST = "operationGroupMasterList";
public static final String OPERATION_GROUPMASTER_ID = "operationGroupMasterId";
......@@ -52,6 +53,9 @@ public class ABookKeys {
public static final String OPERATION_PUSHMESSAGE = "pushMessage";
public static final String OPERATION_READINGFLG = "readingFlg";
public static final String OPERATION_PROCESS_LIST = "processList";
public static final String OPERATION_WARNING_REPORT_LIST = "warningReportList";
// ABOOKCHECK SCHEME
public static final String ABOOK_CHECK_API = "abookcheck-api";
public static final String CMD_MOVE_HOT_SPOT = "moveHotspot";
......@@ -101,6 +105,11 @@ public class ABookKeys {
public static final String REFRESH_CONTENT = "refreshContent";
public static final String RESET_SEARCH = "resetSearch";
public static final String CHANGE_OPERATION_GROUP_MASTER = "changeOperationGroupMaster";
public static final String SAVE_JSON = "saveJson";
public static final String GO_SEND_MESSAGE = "goSendMessage";
public static final String GO_DISTANCE_SUPPORT = "goDistanceSupport";
public static final String GO_CHAT = "goChat";
public static final String ACTION_PUSH_MESSAGE = "actionPushMessage";
}
......@@ -236,4 +245,17 @@ public class ABookKeys {
public static final String CMD_GET_DEVICE_INFO = "getDeviceInfo"; // CMSのインターフェースのパラメータ:cmd
public static final String TASK_DEVICE_TYPE = "deviceType"; // CMSのインターフェースのパラメータ:devicetype
public static final String TASK_QUESTION_ID = "qid"; // CMSのインターフェースのパラメータ:qid
public static final String JSON_NAME = "jsonName";
public static final String JSON_DATA = "jsonData";
public static final String PUSH_MESSAGE_ID = "pushMessageId";
public static final String PUSH_MESSAGE_ACTION = "pushMessageAction";
public static class GO_OPERATION_KEY {
public static final String DIRECT_PAGE = "directPage";
public static final String BACK_PAGE = "backPage";
public static final String DIRECT_TASK_KEY = "directTaskKey";
public static final String DIRECT_PHASE_NO = "directPhaseNo";
}
}
......@@ -19,7 +19,7 @@ import jp.agentec.abook.abv.bl.common.db.SQLiteDatabase;
public class DBConnector {
private static volatile DBConnector dbConnector = null;
public static final String DatabaseName = "ABVJE";
public static final int DatabaseVersion = DatabaseVersions.Ver1_4_0;
public static final int DatabaseVersion = DatabaseVersions.Ver1_4_4;
protected SQLiteDatabase db = null;
......
......@@ -7,6 +7,7 @@ public class DatabaseVersions {
public static final int Ver1_2_0 = 21;
public static final int Ver1_2_3 = 22;
public static final int Ver1_4_0 = 42;
public static final int Ver1_4_4 = 43;//dashboard,pickup
//連続作業機能追加
public static final int Ver1_2_360 = 23;
//チャット機能追加(1.2.360障害対応。)
......
......@@ -135,6 +135,11 @@ public class OperationDao extends AbstractDao {
dto.displayPermissionFlg = cursor.getInt(column);
}
column = cursor.getColumnIndex("new_report_flg");
if (column != -1) {
dto.newReportFlg = cursor.getInt(column);
}
return dto;
}
......@@ -213,9 +218,10 @@ public class OperationDao extends AbstractDao {
+ "quick_report,"
+ "permit_code,"
+ "permit_code_required_flg, "
+ "display_permission_flg) "
+ "display_permission_flg, "
+ "new_report_flg) "
+ "values "
+ "(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)",
+ "(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)",
dto.getInsertValues());
}
......@@ -240,7 +246,8 @@ public class OperationDao extends AbstractDao {
+ "quick_report=?, "
+ "permit_code=?, "
+ "permit_code_required_flg=?, "
+ "display_permission_flg=? "
+ "display_permission_flg=?, "
+ "new_report_flg=? "
+ "WHERE operation_id=?",
dto.getUpdateValues());
return count > 0;
......@@ -338,6 +345,7 @@ public class OperationDao extends AbstractDao {
sql.append(" top.enable_add_report, ");
sql.append(" top.permit_code, ");
sql.append(" top.permit_code_required_flg, ");
sql.append(" top.new_report_flg, ");
sql.append(" CASE ");
sql.append(" WHEN report_type = 1 THEN ( ");
sql.append(" SELECT strftime('%Y/%m/%d %H:%M', datetime(ttr.report_start_date, 'localtime')) || ' ~ ' || strftime('%Y/%m/%d %H:%M', datetime(ttr.report_end_date, 'localtime')) ");
......
......@@ -43,6 +43,7 @@ public class TOperation extends SQLiteTableScript {
sql.append(" , permit_code TEXT ");
sql.append(" , display_permission_flg SMALLINT");
sql.append(" , permit_code_required_flg SMALLINT");
sql.append(" , new_report_flg SMALLINT");
sql.append(" , PRIMARY KEY (operation_id) ");
sql.append(" ) ");
ddl.add(sql.toString());
......@@ -66,6 +67,9 @@ public class TOperation extends SQLiteTableScript {
ddl.add("ALTER TABLE t_operation ADD COLUMN permit_code_required_flg SMALLINT ");
ddl.add("ALTER TABLE t_operation ADD COLUMN display_permission_flg SMALLINT ");
}
if (oldVersion < DatabaseVersions.Ver1_4_4) {
ddl.add("ALTER TABLE t_operation ADD COLUMN new_report_flg SMALLINT ");
}
return ddl;
}
......
package jp.agentec.abook.abv.bl.dto;
import org.json.adf.JSONArray;
import java.util.Date;
import java.util.List;
......@@ -42,6 +44,11 @@ public class OperationDto extends AbstractDto {
// 作業担当グループリスト
public List<TaskWorkerGroupDto> taskWorkerGroupDtoList;
//pickup
public int newReportFlg;
public JSONArray processJsonArray;
public JSONArray warningReportJsonArray;
public boolean equalsLastEdit(OperationDto dto) {
if (dto != null) {
if (operationId.equals(dto.operationId) && lastEditDate.equals(dto.lastEditDate)) {
......@@ -53,12 +60,12 @@ public class OperationDto extends AbstractDto {
@Override
public Object[] getInsertValues() {
return new Object[] { operationId, operationName, operationDescriptions, operationStartDate, operationEndDate, operationType, reportType, lastEditDate, contentCreatingFlg, editLockFlg, needSyncFlg, reportCycle, enableReportUpdate, enableReportHistory, enableReportEdit, enableAddReport, quickReport, permitCode, permitCodeRequiredFlg, displayPermissionFlg};
return new Object[] { operationId, operationName, operationDescriptions, operationStartDate, operationEndDate, operationType, reportType, lastEditDate, contentCreatingFlg, editLockFlg, needSyncFlg, reportCycle, enableReportUpdate, enableReportHistory, enableReportEdit, enableAddReport, quickReport, permitCode, permitCodeRequiredFlg, displayPermissionFlg, newReportFlg};
}
@Override
public Object[] getUpdateValues() {
return new Object[] { operationName, operationDescriptions, operationStartDate, operationEndDate, operationType, reportType, lastEditDate, contentCreatingFlg, editLockFlg, needSyncFlg, reportCycle, enableReportUpdate, enableReportHistory, enableReportEdit, enableAddReport, quickReport, permitCode, permitCodeRequiredFlg, displayPermissionFlg, operationId };
return new Object[] { operationName, operationDescriptions, operationStartDate, operationEndDate, operationType, reportType, lastEditDate, contentCreatingFlg, editLockFlg, needSyncFlg, reportCycle, enableReportUpdate, enableReportHistory, enableReportEdit, enableAddReport, quickReport, permitCode, permitCodeRequiredFlg, displayPermissionFlg, newReportFlg, operationId };
}
@Override
......
......@@ -110,7 +110,7 @@ public class OperationLogic extends AbstractLogic {
* @throws AcmsException
* @throws NetworkDisconnectedException
*/
public void initializeOperations() throws AcmsException, NetworkDisconnectedException {
public void initializeOperations() throws AcmsException, NetworkDisconnectedException, IOException {
// 作業グループリスト取得
setWorkingGroupList();
// 作業一覧取得し、登録・更新・削除する
......@@ -131,7 +131,7 @@ public class OperationLogic extends AbstractLogic {
* @throws AcmsException
* @throws NetworkDisconnectedException
*/
private void retrieveServerOperation() throws AcmsException, NetworkDisconnectedException {
private void retrieveServerOperation() throws AcmsException, NetworkDisconnectedException, IOException {
List<OperationDto> localOperations = mOperationDao.getAllOperation();
AcmsParameters param = new AcmsParameters(cache.getMemberInfo().sid);
OperationListJSON json = AcmsClient.getInstance(cache.getUrlPath(), networkAdapter).getOperationList(param);
......@@ -256,6 +256,18 @@ public class OperationLogic extends AbstractLogic {
for (PushMessageDto dto : serverOperationDto.pushMessageList) {
mPushMessageDao.insert(dto);
}
//save processList, warningReport json file
String processListJsonPath = ABVEnvironment.getInstance().getPickupProcessListOperationFilePath(serverOperationDto.operationId);
FileUtil.delete(processListJsonPath);
if (serverOperationDto.processJsonArray != null && serverOperationDto.processJsonArray.length() > 0) {
FileUtil.createFile(processListJsonPath, serverOperationDto.processJsonArray.toString());
}
String warningReportJsonPath = ABVEnvironment.getInstance().getPickupWarningReportListOperationFilePath(serverOperationDto.operationId);
FileUtil.delete(warningReportJsonPath);
if (serverOperationDto.warningReportJsonArray != null && serverOperationDto.warningReportJsonArray.length() > 0) {
FileUtil.createFile(warningReportJsonPath, serverOperationDto.warningReportJsonArray.toString());
}
}
List<OperationDto> deleteListDtoArray = new ArrayList<OperationDto>();
......@@ -2294,6 +2306,19 @@ public class OperationLogic extends AbstractLogic {
operationJson.put(ABookKeys.OPERATION_OPEN_DATE, DateTimeUtil.toString(operationList.get(i).operationOpenDate, DateTimeFormat.yyyyMMddHHmmss_hyphen));
operationJson.put(ABookKeys.DISPLAY_PERMISSION_FLG, operationList.get(i).displayPermissionFlg);
operationJson.put(ABookKeys.CONTENT_ID, operationList.get(i).contentId);
//pickup newReportFlg, load processList and warning json file
operationJson.put(ABookKeys.NEW_REPORT_FLG, operationList.get(i).newReportFlg);
String processListJsonPath = ABVEnvironment.getInstance().getPickupProcessListOperationFilePath(operationList.get(i).operationId);
String processListString = FileUtil.readTextFile(processListJsonPath);
if (!StringUtil.isNullOrEmpty(processListString)) {
operationJson.put(ABookKeys.OPERATION_PROCESS_LIST, new JSONArray(processListString));
}
String warningReportJsonPath = ABVEnvironment.getInstance().getPickupWarningReportListOperationFilePath(operationList.get(i).operationId);
String warningReportString = FileUtil.readTextFile(warningReportJsonPath);
if (!StringUtil.isNullOrEmpty(warningReportString)) {
operationJson.put(ABookKeys.OPERATION_WARNING_REPORT_LIST, new JSONArray(warningReportString));
}
operationJsonArray.put(operationJson);
}
operationListJsonObject.put(ABookKeys.OPERATION_LIST, operationJsonArray);
......
Subproject commit 23a816fbded72bb2495c4eb25e6413a28e4f900e
Subproject commit 3afcff19b2b133882e03a98e5f6e060731439b01
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
<item
android:state_enabled="false"
android:drawable="@drawable/dashboard_icon_off"/>
<item
android:drawable="@drawable/dashboard_icon_off"/>
</selector>
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
<item
android:state_enabled="false"
android:drawable="@drawable/operation_icon_off"/>
<item
android:drawable="@drawable/operation_icon_off"/>
</selector>
......@@ -1505,6 +1505,8 @@
<string name="msg_fail_collaboration_join_error">協業に参加することができませんでした。</string>
<string name="msg_fail_collaboration_pip_change_host">PIP状態ではホスト変更できません。PIPを解除してください。</string>
<string name="btn_home">ホーム</string>
<string name="btn_dashboard">ダッシュボード</string>
<string name="btn_operations_list">作業一覧</string>
<string name="btn_content">関連資料</string>
<string name="btn_communication">コミュニケーション</string>
<string name="btn_setting">設定</string>
......
......@@ -1510,6 +1510,8 @@
<string name="msg_fail_collaboration_join_error">협업에 참여하실수 없습니다.</string>
<string name="msg_fail_collaboration_pip_change_host">PIP 상태에서는 호스트 변경이 불가능합니다. PIP 모드를 해제해 주세요.</string>
<string name="btn_home"></string>
<string name="btn_dashboard">대시보드</string>
<string name="btn_operations_list">작업일람</string>
<string name="btn_content">관련자료</string>
<string name="btn_communication">커뮤니케이션</string>
<string name="btn_setting">설정</string>
......
......@@ -1506,6 +1506,8 @@
<string name="msg_fail_collaboration_join_error">Could not connect to the collaboration.</string>
<string name="msg_fail_collaboration_pip_change_host">Host change is not possible in PIP state. Please turn off picture-in-picture mode.</string>
<string name="btn_home">Home</string>
<string name="btn_dashboard">Dashboard</string>
<string name="btn_operations_list">Operations List</string>
<string name="btn_content">Related Content</string>
<string name="btn_communication">Communication</string>
<string name="btn_setting">Setting</string>
......
......@@ -101,6 +101,32 @@
android:layout_marginRight="30dp">
<LinearLayout
android:id="@+id/dashboard_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical"
android:gravity="center">
<ImageButton
android:id="@+id/btn_dashboard_home"
style="@style/ToolBarIcon"
android:layout_width="25dp"
android:layout_height="25dp"
android:scaleType="fitCenter"
android:src="@drawable/btn_dashboard_home" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="11sp"
android:text="@string/btn_dashboard"
android:gravity="center"/>
</LinearLayout>
<LinearLayout
android:id="@+id/operation_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
......@@ -113,13 +139,13 @@
android:layout_width="25dp"
android:layout_height="25dp"
android:scaleType="fitCenter"
android:src="@drawable/btn_operation_home" />
android:src="@drawable/btn_operation_list_home" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="11sp"
android:text="@string/btn_home"
android:text="@string/btn_operations_list"
android:gravity="center"/>
</LinearLayout>
......@@ -151,6 +177,7 @@
<LinearLayout
android:id="@+id/communication_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
......
......@@ -86,6 +86,33 @@
android:visibility="visible">
<LinearLayout
android:id="@+id/dashboard_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:orientation="vertical"
android:gravity="center">
<ImageButton
android:id="@+id/btn_dashboard_home"
android:layout_width="25dp"
android:layout_height="25dp"
android:background="@drawable/btn_dashboard_home"
/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="11sp"
android:text="@string/btn_dashboard"
android:gravity="center"/>
</LinearLayout>
<LinearLayout
android:id="@+id/operation_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
......@@ -97,14 +124,14 @@
android:id="@+id/btn_operation_home"
android:layout_width="25dp"
android:layout_height="25dp"
android:background="@drawable/btn_operation_home"
android:background="@drawable/btn_operation_list_home"
/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="11sp"
android:text="@string/btn_home"
android:text="@string/btn_operations_list"
android:gravity="center"/>
......@@ -136,6 +163,7 @@
<LinearLayout
android:id="@+id/communication_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
......
......@@ -15,7 +15,6 @@ import android.os.Environment;
import android.os.StatFs;
import android.provider.Settings;
import android.provider.Settings.Secure;
import android.text.TextUtils;
import android.util.Base64;
import android.view.Display;
import android.view.WindowManager;
......@@ -31,6 +30,7 @@ import jp.agentec.abook.abv.bl.common.exception.ABVExceptionCode;
import jp.agentec.abook.abv.bl.common.exception.NetworkDisconnectedException;
import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.bl.common.util.SecurityUtil;
import jp.agentec.abook.abv.cl.util.LocationManagerUtil;
import jp.agentec.abook.abv.cl.util.PreferenceUtil;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType.UserPrefKey;
import jp.agentec.adf.util.StringUtil;
......@@ -273,7 +273,6 @@ public class DeviceInfo {
*/
public static boolean isDeviceLocationEnabled(Context context) {
int locationMode = 0;
String locationProviders;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT){
try {
......@@ -287,8 +286,7 @@ public class DeviceInfo {
return locationMode != Settings.Secure.LOCATION_MODE_OFF;
}else{
locationProviders = Settings.Secure.getString(context.getContentResolver(), Settings.Secure.LOCATION_PROVIDERS_ALLOWED);
return !TextUtils.isEmpty(locationProviders);
return LocationManagerUtil.isLocationGpsEnabled(context);
}
}
}
......@@ -19,6 +19,8 @@ import android.location.LocationListener;
import android.location.LocationManager;
import android.os.Bundle;
import android.os.Handler;
import android.os.Build;
import android.provider.Settings;
public class LocationManagerUtil {
private final String TAG = "LocationManagerUtil";
......@@ -64,8 +66,8 @@ public class LocationManagerUtil {
return;
}
final boolean gps = locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER);
final boolean network = locationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER);
final boolean gps = isLocationGpsEnabled();
final boolean network = isLocationNetWorkEnabled();
if (!gps && !network) {
// この時点で位置情報サービスが有効でない場合は何もしない。
......@@ -232,8 +234,8 @@ public class LocationManagerUtil {
public void showLoactionServiceAlert() {
locationManager = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);
if (locationManager != null) {
final boolean gps = locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER);
final boolean network = locationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER);
final boolean gps = isLocationGpsEnabled();
final boolean network = isLocationNetWorkEnabled();
if (!gps && !network) {
ABVUIDataCache appDataCache = ABVApplication.getABVUIDataCache(context);
if (appDataCache.checkLocationServiceFlg) {
......@@ -294,4 +296,78 @@ public class LocationManagerUtil {
listener.onGetLocationFailed();
}
}
/**
* GPSが有効かチェックする
* @return 有効の場合true
*/
public boolean isLocationGpsEnabled() {
locationManager = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);
if (locationManager == null) {
return false;
}
boolean gps = locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER);
boolean secureLocationGpsEnabled;
if (Build.VERSION.SDK_INT < 31) {
// GPSの状態を取得(getSystemtServiceからのGPS ON/OFF取得が取れない場合があるため、secureで取得したgpsも判定するため)
secureLocationGpsEnabled = android.provider.Settings.Secure.getString(context.getContentResolver(), Settings.Secure.LOCATION_PROVIDERS_ALLOWED).contains("gps");
} else {
secureLocationGpsEnabled = gps;
}
if (!gps || !secureLocationGpsEnabled) {
return false;
}
return true;
}
/**
* GPSが有効かチェックする
* @param context アプリのcontext
* @return 有効の場合はtrue
*/
public static boolean isLocationGpsEnabled(Context context) {
LocationManager locationManager = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);
if (locationManager == null) {
return false;
}
boolean gpsEnabled = locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER);
boolean secureLocationGpsEnabled;
if (Build.VERSION.SDK_INT < 31) {
// GPSの状態を取得(getSystemtServiceからのGPS ON/OFF取得が取れない場合があるため、secureで取得したgpsも判定するため)
secureLocationGpsEnabled = android.provider.Settings.Secure.getString(context.getContentResolver(), Settings.Secure.LOCATION_PROVIDERS_ALLOWED).contains("gps");
} else {
secureLocationGpsEnabled = gpsEnabled;
}
if (!(gpsEnabled || secureLocationGpsEnabled)) {
return false;
}
return true;
}
/**
* NetWorkによる位置測定が有効かチェックする
* @return 有効の場合true
*/
public boolean isLocationNetWorkEnabled() {
locationManager = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);
if (locationManager == null) {
return false;
}
boolean network = locationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER);
boolean secureLocationNetWorkEnabled;
if (Build.VERSION.SDK_INT < 31) {
// GPSの状態を取得(getSystemtServiceからのGPS ON/OFF取得が取れない場合があるため、secureで取得したgpsも判定するため)
secureLocationNetWorkEnabled = android.provider.Settings.Secure.getString(context.getContentResolver(), Settings.Secure.LOCATION_PROVIDERS_ALLOWED).contains("network");
} else {
secureLocationNetWorkEnabled = network;
}
if (!network || !secureLocationNetWorkEnabled) {
return false;
}
return true;
}
}
......@@ -947,7 +947,7 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
}
}
private void showOperationSelectDialog() {
protected void showOperationSelectDialog() {
OperationDao operationDao = AbstractDao.getDao(OperationDao.class);
mOperationSelectDialog = new Dialog(this);
mOperationSelectDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
......
......@@ -29,6 +29,7 @@ import jp.agentec.abook.abv.bl.common.Constant.DeviceType;
import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.bl.dto.BluetoothPairingDeviceInfoDto;
import jp.agentec.abook.abv.cl.util.BleManagerUtil;
import jp.agentec.abook.abv.cl.util.LocationManagerUtil;
import jp.agentec.abook.abv.launcher.android.R;
import jp.agentec.abook.abv.ui.common.activity.ABVUIActivity;
import jp.agentec.abook.abv.ui.home.adapter.BleListAdapter;
......@@ -217,19 +218,8 @@ public class BlePairingSettingActivity extends ABVUIActivity {
//BlueTooth許可チェック
if (!requestBluetoothFeature()) return;
LocationManager lm = (LocationManager) this.getSystemService(this.LOCATION_SERVICE);
boolean gpsEnabled = false;
if (lm != null) {
gpsEnabled = lm.isProviderEnabled(LocationManager.GPS_PROVIDER);
} else {
Logger.w(TAG, "LocationManager is null");
}
// GPSの状態を取得(getSystemtServiceからのGPS ON/OFF取得が取れない場合があるため、secureで取得したgpsも判定するため)
final boolean secureLocationGpsEnabled = android.provider.Settings.Secure.getString(getContentResolver(), Settings.Secure.LOCATION_PROVIDERS_ALLOWED).contains("gps");
//端末側の位置情報許可チェック
if (!(gpsEnabled || secureLocationGpsEnabled)) {
if (!LocationManagerUtil.isLocationGpsEnabled(this)) {
showSimpleAlertDialog(R.string.alcohol_checker, R.string.msg_location_device_no_allow);
return;
}
......
......@@ -62,6 +62,7 @@ import jp.agentec.abook.abv.ui.common.constant.ErrorMessage;
import jp.agentec.abook.abv.ui.common.dialog.ABookAlertDialog;
import jp.agentec.abook.abv.ui.common.helper.ABVViewUnbindHelper;
import jp.agentec.abook.abv.ui.common.util.AlertDialogUtil;
import jp.agentec.adf.util.FileUtil;
import jp.agentec.adf.util.StringUtil;
/**
......@@ -733,6 +734,7 @@ public class LoginActivity extends ABVLoginActivity {
// ユーザ変更があった場合、チャットのルーム情報をクリアする
clearChatLastRoom();
abookCommClear();
clearUserSettings();
//ユーザ変更があった場合、FetchDateをクリアする
AcmsDao dao = AbstractDao.getDao(AcmsDao.class);
......@@ -826,4 +828,9 @@ public class LoginActivity extends ABVLoginActivity {
deleteSharedPreferences(ABookCommConstants.TAG);
communicationLogic.clearAllData();
}
private void clearUserSettings() {
String dashboardSettingFilePath = getCacheDir().getAbsoluteFile() + "/" + "dashboardSetting.json";
FileUtil.delete(dashboardSettingFilePath);
}
}
......@@ -16,6 +16,7 @@ import android.view.Window;
import android.webkit.JavascriptInterface;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.AbsListView;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
......@@ -156,6 +157,12 @@ public class OperationListActivity extends ABVUIActivity {
private Integer mScanType;
//redirect page
private String directPage;
private String backPage;
private String directTaskKey;
private String directPhaseNo;
@Override
protected void onCreate(Bundle savedInstanceState) {
......@@ -168,6 +175,17 @@ public class OperationListActivity extends ABVUIActivity {
mCheckWebView.setOverScrollMode(View.OVER_SCROLL_NEVER); //オーバースクロールしない。
mCheckWebView.setVerticalScrollBarEnabled(false); //スクロールバーを消す。
mCheckWebView.addJavascriptInterface(jsInf, "android");
mCheckWebView.setWebViewClient(new WebViewClient() {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
//fix FileUriExposedException error when webview load url with file://
// if (Uri.parse(url).getScheme().equals("file")) {
// view.loadUrl(url);
// return true;
// }
return super.shouldOverrideUrlLoading(view, url);
}
});
if (Logger.isDebugEnabled()) {
mCheckWebView.setWebContentsDebuggingEnabled(true);
}
......@@ -193,6 +211,7 @@ public class OperationListActivity extends ABVUIActivity {
paramList.add("mobile_flg=" + (isNormalSize() ? "1" : "0"));
paramList.add("isRFIDBarcodeScan=" + (ABVDataCache.getInstance().serviceOption.isUsableRFIDBarcodeScan() ? "1" : "0"));
paramList.add("isOperationGroupMaster=" + (ABVDataCache.getInstance().serviceOption.isOperationGroupMaster() ? "1" : "0"));
paramList.add("isChat=" + (ABVDataCache.getInstance().serviceOption.isChat() ? "1" : "0"));
mCheckWebView.postUrl(OPERATION_LIST_PAGE + StringUtil.join("&", paramList), null);
mListHelper = getListHelper();
updateNeedSyncRoutineOperation();
......@@ -312,6 +331,26 @@ public class OperationListActivity extends ABVUIActivity {
if (jsonParam.has(ABookKeys.SCAN_TYPE)) {
mScanType = jsonParam.getInt(ABookKeys.SCAN_TYPE);
}
directPage = null;
if (jsonParam.has(ABookKeys.GO_OPERATION_KEY.DIRECT_PAGE)
&& !jsonParam.isNull(ABookKeys.GO_OPERATION_KEY.DIRECT_PAGE)) {
directPage = jsonParam.getString(ABookKeys.GO_OPERATION_KEY.DIRECT_PAGE);
}
backPage = null;
if (jsonParam.has(ABookKeys.GO_OPERATION_KEY.BACK_PAGE)
&& !jsonParam.isNull(ABookKeys.GO_OPERATION_KEY.BACK_PAGE)) {
backPage = jsonParam.getString(ABookKeys.GO_OPERATION_KEY.BACK_PAGE);
}
directTaskKey = null;
if (jsonParam.has(ABookKeys.GO_OPERATION_KEY.DIRECT_TASK_KEY)
&& !jsonParam.isNull(ABookKeys.GO_OPERATION_KEY.DIRECT_TASK_KEY)) {
directTaskKey = jsonParam.getString(ABookKeys.GO_OPERATION_KEY.DIRECT_TASK_KEY);
}
directPhaseNo = null;
if (jsonParam.has(ABookKeys.GO_OPERATION_KEY.DIRECT_PHASE_NO)
&& !jsonParam.isNull(ABookKeys.GO_OPERATION_KEY.DIRECT_PHASE_NO)) {
directPhaseNo = jsonParam.getString(ABookKeys.GO_OPERATION_KEY.DIRECT_PHASE_NO);
}
final OperationDto tempOperationDto = mOperationDao.getOperationJoinContent(jsonParam.getInt(ABookKeys.OPERATION_ID));
if (tempOperationDto.operationType == Constant.operationType.CONTENT360
&& tempOperationDto.contentId == null) {
......@@ -391,6 +430,25 @@ public class OperationListActivity extends ABVUIActivity {
}
});
break;
case ABookKeys.CMD_KEY.SAVE_JSON:
if (jsonParam.has(ABookKeys.JSON_NAME)) {
saveJson(jsonParam.getString(ABookKeys.JSON_NAME), jsonParam.getString(ABookKeys.JSON_DATA));
}
break;
case ABookKeys.CMD_KEY.GO_SEND_MESSAGE:
showSendMessage();
break;
case ABookKeys.CMD_KEY.GO_DISTANCE_SUPPORT:
showDistanceSupport();
break;
case ABookKeys.CMD_KEY.GO_CHAT:
showChat();
break;
case ABookKeys.CMD_KEY.ACTION_PUSH_MESSAGE:
if (jsonParam.has(ABookKeys.PUSH_MESSAGE_ID)) {
actionPushMessage(jsonParam.getString(ABookKeys.PUSH_MESSAGE_ACTION), jsonParam.getInt(ABookKeys.PUSH_MESSAGE_ID));
}
break;
}
}
}
......@@ -639,6 +697,29 @@ public class OperationListActivity extends ABVUIActivity {
activityResultFlg = false;
}
@Override
protected void onNewIntent(Intent intent) {
super.onNewIntent(intent);
String activeTab = intent.getStringExtra("activeTab");
if (mCheckWebView != null && activeTab != null) {
String jsUrl = null;
if (activeTab.contentEquals("dashboard")) {
jsUrl = "javascript:CHK_Footer.goDashboard();";
} else if (activeTab.contentEquals("operationList")) {
jsUrl = "javascript:CHK_Footer.goOperationList();";
}
if (jsUrl != null) {
final String url = jsUrl;
runOnUiThread(new Runnable() {
@Override
public void run() {
mCheckWebView.loadUrl(url);
}
});
}
}
}
// 検索ダイアログ表示
private void showSearchDialog() {
contentRefresher.stopRefresh();
......@@ -853,6 +934,18 @@ public class OperationListActivity extends ABVUIActivity {
path.append("&sid=" + ABVDataCache.getInstance().getMemberInfo().sid);
path.append("&quickReport=" + operationDto.quickReport);
path.append("&shopName=" + ABVDataCache.getInstance().getUrlPath());
if (directPage != null && directPage.length() > 0) {
path.append("&autoDirectPage=" + directPage);
}
if (backPage != null && backPage.length() > 0) {
path.append("&backPage=" + backPage);
}
if (directTaskKey != null && directTaskKey.length() > 0) {
path.append("&directTaskKey=" + directTaskKey);
}
if (directPhaseNo != null && directPhaseNo.length() > 0) {
path.append("&directPhaseNo=" + directPhaseNo);
}
path.append("&acmsAddress=" + ABVEnvironment.getInstance().acmsAddress);
if (mScanType != null) {
String scanTypeKey = null;
......@@ -1731,4 +1824,36 @@ public class OperationListActivity extends ABVUIActivity {
});
}
}
private void saveJson(String jsonName, String jsonData) {
if (StringUtil.isNullOrEmpty(jsonName)) {
Logger.d(TAG,"saveJson:jsonName is null or empty");
return;
}
String filePath = getCacheDir().getAbsolutePath() + "/" + jsonName;
try {
FileUtil.createFile(filePath, jsonData);
} catch (IOException e) {
};
}
private void showSendMessage() {
showOperationSelectDialog();
}
private void showDistanceSupport() {
ActivityHandlingHelper.getInstance().startMeetingActivity();
}
private void showChat() {
ActivityHandlingHelper.getInstance().startChatWebViewActivity(new Long(0),"", ChatWebViewActivity.class.getName(), OperationListActivity.class.getName());
}
private void actionPushMessage(String action, int pushMessageId) {
if (action.equals("read")) {
pushMessageLogic.updateReadingFlg(pushMessageId);
pushMessageLogic.createOperationPushMessageListJson(getCacheDir().getAbsolutePath());
}
}
}
......@@ -58,6 +58,9 @@ public class OperationRelatedContentActivity extends ABVUIActivity {
private OperationRelatedContentSectionAdapter mOperationRelatedContentSectionAdapter;
private LinearLayout dashboardLayout;
private ImageButton mDashboardHomeButton;
private LinearLayout operationLayout;
private ImageButton mOperationHomeButton; // ホームボタン
private ImageButton mOperationRelatedContentButton; //
private ImageButton mQuickReportPrintButton; // 簡易帳票印刷ボタン
......@@ -80,7 +83,10 @@ public class OperationRelatedContentActivity extends ABVUIActivity {
updateCollaborationInfo();
setContentView(R.layout.ac_operation_related_content);
dashboardLayout = findViewById(R.id.dashboard_layout);
mDashboardHomeButton = (ImageButton) findViewById(R.id.btn_dashboard_home);
// ホームボタン(作業一覧へ遷移ボタン)
operationLayout = findViewById(R.id.operation_layout);
mOperationHomeButton = (ImageButton) findViewById(R.id.btn_operation_home);
// 共通資料ボタン
mOperationRelatedContentButton = (ImageButton) findViewById(R.id.btn_common_content);
......@@ -107,6 +113,7 @@ public class OperationRelatedContentActivity extends ABVUIActivity {
// 下辺のツールバー設定
private void settingBottomToolbar() {
mDashboardHomeButton.setEnabled(true);
// ホームボタン活性化
mOperationHomeButton.setEnabled(true);
// 共通資料ボタンの非活性化
......@@ -120,6 +127,9 @@ public class OperationRelatedContentActivity extends ABVUIActivity {
showCommunicationMenuDialog();
}
});
if (findViewById(R.id.communication_layout) != null) {
findViewById(R.id.communication_layout).setVisibility(View.GONE);
}
if (findViewById(R.id.print_layout) != null) {
findViewById(R.id.print_layout).setVisibility(View.GONE);
}
......@@ -324,11 +334,19 @@ public class OperationRelatedContentActivity extends ABVUIActivity {
* ボタンイベント設定
*/
private void setOnButtonEvent() {
mDashboardHomeButton.setClickable(false);
dashboardLayout.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
backToHome("dashboard");
}
});
// 作業のホーム画面へ
mOperationHomeButton.setOnClickListener(new View.OnClickListener() {
mOperationHomeButton.setClickable(false);
operationLayout.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
backToHome();
backToHome("operationList");
}
});
......@@ -404,11 +422,14 @@ public class OperationRelatedContentActivity extends ABVUIActivity {
/**
* 作業一覧へ戻る
*/
private void backToHome() {
private void backToHome(String activeTab) {
Intent intent = new Intent();
intent.setClass(OperationRelatedContentActivity.this, OperationListActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
intent.putExtra(AppDefType.ChatPushMessageKey.baseActivityName, OperationRelatedContentActivity.class.getName());
if (activeTab != null && activeTab.length() > 0) {
intent.putExtra("activeTab", activeTab);
}
// 左へ移動しながら戻る
startActivity(intent, NaviConsts.Left);
}
......@@ -478,7 +499,7 @@ public class OperationRelatedContentActivity extends ABVUIActivity {
if (isCollaboration) {
return true;
}
backToHome();
backToHome("");
return true;
}
return super.onKeyUp(keyCode, event);
......
......@@ -5415,7 +5415,9 @@ public class ContentViewActivity extends ABVContentViewActivity {
JSONObject hotspot = null;
if (checkParam.get(ABookKeys.HOT_SPOT) != null) {
hotspot = new JSONObject(checkParam.get(ABookKeys.HOT_SPOT));
taskCode = hotspot.getString(ABookKeys.TASK_CODE);
if (hotspot.has(ABookKeys.TASK_CODE)) {
taskCode = hotspot.getString(ABookKeys.TASK_CODE);
}
}
OperationDto operation = mOperationDao.getOperation(mOperationId);
String jsonPath = "";
......@@ -5426,8 +5428,10 @@ public class ContentViewActivity extends ABVContentViewActivity {
for (TaskDto task : taskList) {
if (task.phaseNo == 1) {
operationTaskLayout.setIconStatus(taskKey, true);
operationTaskLayout.currentTaskDto.taskKey = task.taskKey;
operationTaskLayout.currentTaskDto.taskCode = task.taskCode;
if (operationTaskLayout.currentTaskDto != null) {
operationTaskLayout.currentTaskDto.taskKey = task.taskKey;
operationTaskLayout.currentTaskDto.taskCode = task.taskCode;
}
jsonPath = mContentPath.replaceAll(ABookKeys.PANO_IMAGE,ABookKeys.PROCESS_LIST).replaceAll(ABookKeys.TASK_PDF, ABookKeys.PROCESS_LIST) + "/" + ABookKeys.PHASE_INFO_JSON;
JSONObject phaseInfo = null;
int lastPhase = 0;
......@@ -5451,30 +5455,36 @@ public class ContentViewActivity extends ABVContentViewActivity {
lastTask = compareTask;
}
}
if (lastTask != null) {
operationTaskLayout.currentTaskDto.isFinished = (lastTask.taskStatus == FINISHED_STATUS);
} else {
operationTaskLayout.currentTaskDto.isFinished = false;
if (operationTaskLayout.currentTaskDto != null) {
if (lastTask != null) {
operationTaskLayout.currentTaskDto.isFinished = (lastTask.taskStatus == FINISHED_STATUS);
} else {
operationTaskLayout.currentTaskDto.isFinished = false;
}
operationTaskLayout.currentTaskDto.processKey = task.processKey;
operationTaskLayout.currentTaskDto.processStatus = task.processStatus;
operationTaskLayout.addOperationTaskIcon(operationTaskLayout.currentLayout, operationTaskLayout.currentTaskDto);
}
operationTaskLayout.currentTaskDto.processKey = task.processKey;
operationTaskLayout.currentTaskDto.processStatus = task.processStatus;
operationTaskLayout.addOperationTaskIcon(operationTaskLayout.currentLayout, operationTaskLayout.currentTaskDto);
}
}
} else {
operationTaskLayout.setIconStatus(taskKey, true);
if (operationTaskLayout.currentTaskDto != null) {
operationTaskLayout.currentTaskDto.taskKey = taskKey;
operationTaskLayout.currentTaskDto.taskCode = taskCode;
operationTaskLayout.currentTaskDto.isFinished = operationTaskLayout.isTaskFinished(taskKey);
operationTaskLayout.addOperationTaskIcon(operationTaskLayout.currentLayout, operationTaskLayout.currentTaskDto);
}
}
} else {
operationTaskLayout.setIconStatus(taskKey, true);
if (operationTaskLayout.currentTaskDto != null) {
operationTaskLayout.currentTaskDto.taskKey = taskKey;
operationTaskLayout.currentTaskDto.taskCode = taskCode;
operationTaskLayout.currentTaskDto.isFinished = operationTaskLayout.isTaskFinished(taskKey);
operationTaskLayout.addOperationTaskIcon(operationTaskLayout.currentLayout, operationTaskLayout.currentTaskDto);
}
} else {
operationTaskLayout.setIconStatus(taskKey, true);
operationTaskLayout.currentTaskDto.taskKey = taskKey;
operationTaskLayout.currentTaskDto.taskCode = taskCode;
operationTaskLayout.currentTaskDto.isFinished = operationTaskLayout.isTaskFinished(taskKey);
operationTaskLayout.addOperationTaskIcon(operationTaskLayout.currentLayout, operationTaskLayout.currentTaskDto);
}
//hideOperationTaskLayout();
......
......@@ -86,8 +86,8 @@ is_check_invalid_passward_limit=true
repeat_default=true
#Setting Info(設定画面のABookについての設定情報)
version_name=1.4.310
release_date=2022/08/26
version_name=1.4.401
release_date=2022/10/17
copy_right=2016 AGENTEC Co.,Ltd. All rights reserved.
hope_page=http://www.agentec.jp
contact_email=abook-appsupport@agentec.jp
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment