dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #42339
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 21649: Confirmation when cancelling TEI registration
------------------------------------------------------------
revno: 21649
committer: Markus Bekken <markus.bekken@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2016-01-07 19:03:55 +0100
message:
Confirmation when cancelling TEI registration
added:
dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dataentry/modal-complete-event.html
modified:
dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/registration/registration-controller.js
dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/registration/registration.html
dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/i18n/i18n_app.properties
dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/i18n/i18n_app_ar.properties
--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== added file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dataentry/modal-complete-event.html'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dataentry/modal-complete-event.html 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dataentry/modal-complete-event.html 2016-01-07 18:03:55 +0000
@@ -0,0 +1,11 @@
+<div class="modal-header">
+ <h3>{{modalOptions.headerText | translate}}</h3>
+</div>
+<div class="modal-body">
+ <p>{{modalOptions.bodyText | translate}}</p>
+</div>
+<div class="modal-footer">
+ <button class="btn btn-default" data-ng-click="modalOptions.close()">{{modalOptions.closeButtonText | translate}}</button>
+ <button class="btn btn-primary" data-ng-click="modalOptions.ok('ok-exit')">{{modalOptions.secondActionButtonText | translate}}</button>
+ <button class="btn btn-primary" data-ng-click="modalOptions.ok();">{{modalOptions.actionButtonText | translate}}</button>
+</div>
\ No newline at end of file
=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/registration/registration-controller.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/registration/registration-controller.js 2016-01-07 10:29:04 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/registration/registration-controller.js 2016-01-07 18:03:55 +0000
@@ -20,7 +20,8 @@
SessionStorageService,
TEIGridService,
TrackerRulesFactory,
- TrackerRulesExecutionService) {
+ TrackerRulesExecutionService,
+ ModalService) {
$scope.maxOptionSize = 30;
@@ -403,5 +404,17 @@
$scope.selectedTei[selectedAttribute.id] = res.id;
}
});
- };
+ };
+ $scope.cancelRegistrationWarning = function(cancelFunction){
+
+ var modalOptions = {
+ closeButtonText: 'no',
+ actionButtonText: 'yes',
+ headerText: 'cancel',
+ bodyText: 'are_you_sure_to_cancel_registration'
+ }
+ ModalService.showModal({}, modalOptions).then(function(){
+ cancelFunction();
+ });
+ }
});
=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/registration/registration.html'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/registration/registration.html 2016-01-07 10:29:04 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/registration/registration.html 2016-01-07 18:03:55 +0000
@@ -50,19 +50,19 @@
<div ng-if="!editingDisabled && registrationMode === 'PROFILE'" class="vertical-spacing">
<button type="button" class="btn btn-primary small-horizonal-spacing" ng-click="registerEntity(null)">{{'save'| translate}}</button>
- <button type="button" class="btn btn-default small-horizonal-spacing" ng-click="cancel()">{{'cancel'| translate}}</button>
+ <button type="button" class="btn btn-default small-horizonal-spacing" ng-click="cancelRegistrationWarning(cancel)">{{'cancel'| translate}}</button>
</div>
<div class="vertical-spacing" ng-if="registrationMode === 'ENROLLMENT'">
<button type="button" class="btn btn-primary" ng-click="registerEntity(null)">{{'enroll'| translate}}</button>
- <button type="button" class="btn btn-default" ng-click="showNewEnrollment()">{{'cancel'| translate}}</button>
+ <button type="button" class="btn btn-default" ng-click="cancelRegistrationWarning(showNewEnrollment)">{{'cancel'| translate}}</button>
</div>
<div class="vertical-spacing hideInPrint" ng-if="registrationMode === 'REGISTRATION'">
<button type="button" class="btn btn-primary" ng-click="registerEntity('DASHBOARD')">{{'save_and_continue'| translate}}</button>
<button type="button" class="btn btn-success small-horizonal-spacing" ng-click="registerEntity('SELF')">{{'save_and_add_new'| translate}}</button>
<button type="button" class="btn btn-primary" onclick="javascript:window.print()">{{'print_form'| translate}}</button>
- <button type="button" class="btn btn-default small-horizonal-spacing" ng-click="showRegistration()">{{'cancel'| translate}}</button>
+ <button type="button" class="btn btn-default small-horizonal-spacing" ng-click="cancelRegistrationWarning(showRegistration)">{{'cancel'| translate}}</button>
</div>
</form>
=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/i18n/i18n_app.properties'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/i18n/i18n_app.properties 2016-01-07 10:59:31 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/i18n/i18n_app.properties 2016-01-07 18:03:55 +0000
@@ -396,3 +396,4 @@
print_form=Print form
value_must_be_email=Please enter a valid email address
complete_and_exit =Complete and exit
+are_you_sure_to_cancel_registration=Are you sure you want to cancel this registration?
=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/i18n/i18n_app_ar.properties'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/i18n/i18n_app_ar.properties 2016-01-07 10:59:31 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/i18n/i18n_app_ar.properties 2016-01-07 18:03:55 +0000
@@ -269,4 +269,5 @@
events_today_skipped = \u062a\u062e\u0637\u064a(\u062c\u0648\u062c\u0644 \u062a\u0631\u062c\u0645\u0629)
events_today_scheduled = \u0627\u0644\u0645\u0642\u0631\u0631(\u062c\u0648\u062c\u0644 \u062a\u0631\u062c\u0645\u0629)
value_must_be_email = \u064a\u062c\u0628 \u0623\u0646 \u062a\u0643\u0648\u0646 \u0642\u064a\u0645\u0629 \u0639\u0646\u0648\u0627\u0646 \u0627\u0644\u0628\u0631\u064a\u062f \u0627\u0644\u0625\u0644\u0643\u062a\u0631\u0648\u0646\u064a(\u062c\u0648\u062c\u0644 \u062a\u0631\u062c\u0645\u0629)
-complete_and_exit=\u0643\u0627\u0645\u0644\u0629 \u0648\u0627\u0644\u062e\u0631\u0648\u062c(\u062c\u0648\u062c\u0644 \u062a\u0631\u062c\u0645\u0629)
\ No newline at end of file
+complete_and_exit=\u0643\u0627\u0645\u0644\u0629 \u0648\u0627\u0644\u062e\u0631\u0648\u062c(\u062c\u0648\u062c\u0644 \u062a\u0631\u062c\u0645\u0629)
+are_you_sure_to_cancel_registration=\u0647\u0644 \u0623\u0646\u062a \u0645\u062a\u0623\u0643\u062f \u0623\u0646\u0643 \u062a\u0631\u064a\u062f \u0625\u0644\u063a\u0627\u0621 \u0647\u0630\u0627 \u0627\u0644\u062a\u0633\u062c\u064a\u0644\u061f