Sickleave CR updates & changes

dev_v3.13.6
haroon amjad 2 days ago
parent 073cb9f7e8
commit 605f02afe2

@ -1872,8 +1872,13 @@ const Map localizedValues = {
"insuranceClassName": {"en": "Insurance Class", "ar": "فئة التأمين"},
"insuranceRequestSubmit": {"en": "Your insurance update request has been submitted successfully.", "ar": "تم تقديم طلب تحديث التأمين الخاص بك بنجاح."},
"NFCNotSupported": {"en": "Your device does not support NFC. Please visit reception to Check-In", "ar": "جهازك لا يدعم NFC. يرجى زيارة مكتب الاستقبال لتسجيل الوصول"},
"enter-workplace-name": {"en": "Please enter your workplace name:", "ar": "رجاء إدخال مكان العمل:"},
"workplaceName": {"en": "Workplace name:", "ar": "مكان العمل:"},
"enter-workplace-name": {"en": "Please enter your workplace details:", "ar": "الرجاء إدخال تفاصيل مكان عملك:"},
"workplaceName": {"en": "Workplace name English:", "ar": "مكان العمل انجليزي:"},
"workplaceNameAr": {"en": "Workplace name Arabic:", "ar": "مكان العمل عربي:"},
"occupationNameEn": {"en": "Occupation name English:", "ar": "مكان العمل انجليزي:"},
"occupationNameAr": {"en": "Occupation name Arabic:", "ar": "مكان العمل عربي:"},
"callLiveCareSupport": {"en": "Call LiveCare Support", "ar": "اتصل بدعم اللايف كير"},
"needApproval": {
"en": "Your sick leave is under process in medical administration, you will be notified once approved.",

@ -124,12 +124,14 @@ class LabsService extends BaseService {
return Future.value(localRes);
}
Future updateWorkplaceName(String workplaceName, String workplaceNameAR, int requestNumber, String setupID, int projectID) async {
Future updateWorkplaceName(String workplaceName, String workplaceNameAR, String occupation, String occupationAR, int requestNumber, String setupID, int projectID) async {
hasError = false;
Map<String, dynamic> body = Map();
body['Placeofwork'] = workplaceName;
body['Placeofworkar'] = workplaceNameAR;
body['Occupation'] = occupation;
body['Occupationar'] = occupationAR;
body['Req_ID'] = requestNumber;
body['TargetSetupID'] = setupID;
body['ProjectID'] = projectID;

@ -25,6 +25,10 @@ class WorkplaceUpdatePage extends StatefulWidget {
class _WorkplaceUpdatePageState extends State<WorkplaceUpdatePage> {
TextEditingController workplaceName = new TextEditingController();
TextEditingController workplaceNameAr = new TextEditingController();
TextEditingController occupationNameEn = new TextEditingController();
TextEditingController occupationNameAr = new TextEditingController();
bool? _isButtonDisabled;
ProjectViewModel? projectViewModel;
@ -66,7 +70,13 @@ class _WorkplaceUpdatePageState extends State<WorkplaceUpdatePage> {
),
),
mHeight(8),
inputWidget(TranslationBase.of(context).workplaceName, "", workplaceName),
inputWidget(TranslationBase.of(context).workplaceName, "", workplaceName, FilteringTextInputFormatter.allow(RegExp("[a-zA-Z ]"))),
mHeight(8),
inputWidget(TranslationBase.of(context).workplaceNameAr, "", workplaceNameAr, FilteringTextInputFormatter.allow(RegExp("[ء-ي ]"))),
mHeight(8),
inputWidget(TranslationBase.of(context).occupationNameEn, "", occupationNameEn, FilteringTextInputFormatter.allow(RegExp("[a-zA-Z ]"))),
mHeight(8),
inputWidget(TranslationBase.of(context).occupationNameAr, "", occupationNameAr, FilteringTextInputFormatter.allow(RegExp("[ء-ي ]"))),
],
),
),
@ -83,7 +93,7 @@ class _WorkplaceUpdatePageState extends State<WorkplaceUpdatePage> {
height: 50,
elevation: 0,
color: CustomColors.accentColor,
disabledColor:Colors.grey.withOpacity(0.25),
disabledColor: Colors.grey.withOpacity(0.25),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
child: Text(
TranslationBase.of(context).submit,
@ -94,10 +104,11 @@ class _WorkplaceUpdatePageState extends State<WorkplaceUpdatePage> {
),
),
onPressed: () {
if (_isButtonDisabled == false)
// if (_isButtonDisabled == false)
if (workplaceName.text.isNotEmpty && workplaceNameAr.text.isNotEmpty && occupationNameEn.text.isNotEmpty && occupationNameAr.text.isNotEmpty)
updateWorkplaceNameDialog();
else
AppToast.showErrorToast(message: TranslationBase.of(context).enterWorkplaceName);
AppToast.showErrorToast(message: TranslationBase.of(context).enterDetailBelow);
},
),
),
@ -109,7 +120,7 @@ class _WorkplaceUpdatePageState extends State<WorkplaceUpdatePage> {
);
}
Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, {String? prefix, bool isEnable = true, bool hasSelection = false}) {
Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, TextInputFormatter inputFormatter, {String? prefix, bool isEnable = true, bool hasSelection = false}) {
return Container(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
alignment: Alignment.center,
@ -145,7 +156,8 @@ class _WorkplaceUpdatePageState extends State<WorkplaceUpdatePage> {
keyboardType: TextInputType.name,
controller: _controller,
inputFormatters: [
projectViewModel!.isArabic ? FilteringTextInputFormatter.allow(RegExp("[ء-ي ]")) : FilteringTextInputFormatter.allow(RegExp("[a-zA-Z ]")),
// projectViewModel!.isArabic ? FilteringTextInputFormatter.allow(RegExp("[ء-ي ]")) : FilteringTextInputFormatter.allow(RegExp("[a-zA-Z ]")),
inputFormatter
],
onChanged: (value) => {_onPassportTextChanged(value)},
style: TextStyle(
@ -226,9 +238,7 @@ class _WorkplaceUpdatePageState extends State<WorkplaceUpdatePage> {
LabsService service = new LabsService();
GifLoaderDialogUtils.showMyDialog(context);
service
.updateWorkplaceName(projectViewModel!.isArabic ? "-" : workplaceName.text, projectViewModel!.isArabic ? workplaceName.text : "-", widget.requestNumber, widget.setupID, widget.projectID)
.then((res) {
service.updateWorkplaceName(workplaceName.text, workplaceNameAr.text, occupationNameEn.text, occupationNameAr.text, widget.requestNumber, widget.setupID, widget.projectID).then((res) {
GifLoaderDialogUtils.hideDialog(context);
Navigator.of(context).pop(true);
}).catchError((err) {

@ -2978,14 +2978,16 @@ class TranslationBase {
String get searchClinic => localizedValues["searchClinic"][locale.languageCode];
String get selectBranch => localizedValues["selectBranch"][locale.languageCode];
String get searchByBranch => localizedValues["searchByBranch"][locale.languageCode];
String get existingPackage => localizedValues["existingPackage"][locale.languageCode];
String get continueOrbookNew => localizedValues["continueOrbookNew"][locale.languageCode];
String get newAppointment => localizedValues["newAppointment"][locale.languageCode];
String get proceedPackage => localizedValues["proceedPackage"][locale.languageCode];
String get hospitalNavigationTitle => localizedValues["hospitalNavigationTitle"][locale.languageCode];
String get hospitalNavigationSubtitle => localizedValues["hospitalNavigationSubtitle"][locale.languageCode];
String get workplaceNameAr => localizedValues["workplaceNameAr"][locale.languageCode];
String get occupationNameEn => localizedValues["occupationNameEn"][locale.languageCode];
String get occupationNameAr => localizedValues["occupationNameAr"][locale.languageCode];
}
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

Loading…
Cancel
Save