cronapp-framework-mobile-js 2.8.8 → 2.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/crn-button-bar.components.json +1 -1
- package/components/crn-button.components.json +1 -1
- package/components/crn-chart.components.json +1 -0
- package/components/crn-checkbox.components.json +2 -1
- package/components/crn-dynamic-image.components.json +9 -0
- package/components/crn-header-button.components.json +1 -1
- package/components/crn-input-floating.components.json +4 -4
- package/components/crn-ion-footer-bar.components.json +3 -3
- package/components/crn-ion-header-bar.components.json +1 -1
- package/components/crn-ion-list.components.json +0 -31
- package/components/crn-ion-segment-item.components.json +68 -0
- package/components/crn-ion-segment.components.json +974 -0
- package/components/crn-ion-tab.components.json +1 -0
- package/components/crn-item-swipe.components.json +3 -3
- package/components/crn-list-item-icon.components.json +7 -20
- package/components/crn-list-swipe.components.json +2 -2
- package/components/crn-list.components.json +1 -1
- package/components/crn-multiselect.components.json +1 -1
- package/components/crn-navbar.components.json +1 -0
- package/components/crn-range.components.json +1 -1
- package/components/crn-signature-pad.components.json +36 -0
- package/components/crn-slider-item.components.json +104 -5
- package/components/crn-slider.components.json +6 -6
- package/components/crn-textarea.components.json +1 -1
- package/components/css/app.css +78 -0
- package/components/css/background-color.css +39 -1
- package/components/css/color-default.css +0 -28
- package/components/css/crn-ion-segment.css +786 -0
- package/components/css/icon-size.css +4 -4
- package/components/templates/advanced.list.designtime.html +0 -24
- package/components/templates/checkbox.template.html +6 -7
- package/components/templates/crn-ion-segment-item.template.html +6 -0
- package/components/templates/crn-ion-segment.template.html +27 -0
- package/components/templates/crn-signature-pad.designtime.html +31 -0
- package/components/templates/crn-signature-pad.template.html +1 -0
- package/components/templates/ion-footer-bar.template.html +11 -5
- package/components/templates/ion-header-bar.template.html +2 -2
- package/components/templates/item.slider.template.html +3 -3
- package/components/templates/item.swipe.template.html +2 -2
- package/components/templates/slider.template.html +14 -18
- package/css/app.css +124 -34
- package/css/signup.css +13 -0
- package/dist/components/css/app.css +1 -0
- package/dist/components/css/background-color.css +1 -1
- package/dist/components/css/color-default.css +1 -1
- package/dist/components/css/crn-ion-segment.css +1 -0
- package/dist/components/templates/advanced.list.designtime.html +1 -1
- package/dist/components/templates/checkbox.template.html +1 -1
- package/dist/components/templates/crn-ion-segment-item.template.html +1 -0
- package/dist/components/templates/crn-ion-segment.template.html +1 -0
- package/dist/components/templates/crn-signature-pad.designtime.html +22 -0
- package/dist/components/templates/crn-signature-pad.template.html +1 -0
- package/dist/components/templates/ion-footer-bar.template.html +1 -1
- package/dist/components/templates/ion-header-bar.template.html +1 -1
- package/dist/components/templates/item.slider.template.html +1 -1
- package/dist/components/templates/item.swipe.template.html +1 -1
- package/dist/components/templates/slider.template.html +1 -1
- package/dist/css/app.css +1 -1
- package/dist/css/signup.css +1 -0
- package/dist/i18n/locale_en_us.json +3 -1
- package/dist/i18n/locale_pt_br.json +4 -1
- package/dist/img/cron-icon/crn-signature-pad.svg +1 -0
- package/dist/img/cron-icon/crn-tabs.svg +1 -1
- package/dist/img/placehold-300x200.png +0 -0
- package/dist/js/app.authentication.js +1 -1
- package/dist/js/controllers.authentication.js +1 -1
- package/dist/js/directives.js +17 -1
- package/dist/js/reports/reports.service.js +1 -1
- package/i18n/locale_en_us.json +3 -1
- package/i18n/locale_pt_br.json +4 -1
- package/img/cron-icon/crn-signature-pad.svg +27 -0
- package/img/cron-icon/crn-tabs.svg +17 -18
- package/img/placehold-300x200.png +0 -0
- package/js/app.authentication.js +8 -1
- package/js/controllers.authentication.js +87 -4
- package/js/directives.js +216 -122
- package/js/reports/reports.service.js +6 -26
- package/lib/ionic/js/ionic.bundle.js +4 -2
- package/package.json +4 -2
- package/postupdate.json +11 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){angular.module("report.services",[]).service("ReportService",["$http","$compile","$modal","$translate","$window","$rootScope","$ionicModal","$ionicLoading",function(a,b,c,d,e,f,g,h){var
|
|
1
|
+
(function(){angular.module("report.services",[]).service("ReportService",["$http","$compile","$modal","$translate","$window","$rootScope","$ionicModal","$ionicLoading",function(a,b,c,d,e,f,g,h){function i(a){window.open(a,"_system")}var j=$("body"),k=angular.element(j.get(0)).scope(),l=["node_modules/cronapp-lib-js/dist/js/stimulsoft/stimulsoft-all.js","node_modules/cronapp-lib-js/dist/js/stimulsoft/stimulsoft-helper.js"],m=[];this.getReport=function(b){var c={url:window.hostApp+"api/rest/report",method:"POST",data:angular.toJson({reportName:b})};return a(c)},this.getPDFAsFile=function(b){var c={url:window.hostApp+"api/rest/report/pdfasfile",method:"POST",data:angular.toJson(b)};return a(c)},this.getContentAsString=function(b){var c={url:window.hostApp+"api/rest/report/contentasstring",method:"POST",data:angular.toJson(b)};return a(c)},this.getDataSourcesParams=function(b){var c={url:window.hostApp+"api/rest/report/getdatasourcesparams",method:"POST",data:angular.toJson(b)};return a(c)},this.openURLContent=function(a){i(a)},this.initializeStimulsoft=function(a){if(!Stimulsoft.Base.StiLicense.Key){stimulsoftHelper.setLanguage(a);var b=stimulsoftHelper.getLocalization();Stimulsoft.Base.Localization.StiLocalization.loadLocalization(b.xml),Stimulsoft.Base.Localization.StiLocalization.cultureName=b.cultureName,Stimulsoft.Base.StiLicense.Key=stimulsoftHelper.getKey()}},this.openStimulsoftReport=function(a,b,c,e,f){function g(a,b){try{window.resolveLocalFileSystemURL(cordova.file.externalApplicationStorageDirectory,function(c){f&&f(),c.getFile(a,{create:!0},function(c){c.createWriter(function(c){c.onwriteend=function(){cordova.plugins.fileOpener2.open(cordova.file.externalApplicationStorageDirectory+a,"application/pdf",{error:function(a){k.Notification.error(d.instant("General.ErrorNotSpecified"),a.message),console.log("Error status: "+a.status+" - Error message: "+a.message)}})},c.onerror=function(a){alert(a)};var e=new Blob([b],{type:"application/pdf"});c.write(e)},function(a){alert(a)})},function(a){alert(a)})},function(a){f&&f(),alert(a)})}catch(a){f&&f(),alert(a)}}var h=new Stimulsoft.Report.StiReport;h.load(a),c||(c=stimulsoftHelper.getDatasourcesInBand(h)),b&&b.forEach(function(a){c.datasources.forEach(function(b){for(var c=0;c<b.fieldParams.length;c++)if(b.fieldParams[c].param==a.originalName){b.fieldParams[c].value=a.value;break}})}),stimulsoftHelper.setParamsInFilter(h.dictionary.dataSources,c.datasources);var i=new Stimulsoft.Report.Export.StiPdfExportSettings,j=new Stimulsoft.Report.Export.StiPdfExportService,l=new Stimulsoft.System.IO.MemoryStream;h.renderAsync(function(){j.exportToAsync(function(){var b=l.toArray(),c=new Blob([new Uint8Array(b)],{type:"application/pdf"});window.resolveLocalFileSystemURL?g(a.ReportAlias+".pdf",c):(f&&f(),window.open(URL.createObjectURL(c)))},h,l,i)},!1)},this.showParameters=function(a){var b=a.parameters,c=[],d=0,e=function(a){return a.replace(/([.*+?^=!:()|\[\]\/\\])/g,"\\$1")},f=function(a,b,c){return a.replace(new RegExp(e(b),"g"),c)},i=function(){if(d<b.length){var e=b[d++];$.get("node_modules/cronapp-framework-mobile-js/components/reports/"+e.type+".parameter.html").done(function(a){c.push(f(a,"_field_",e.name)),i()})}else if(0<c.length){k.report=a,k.htmlParameters=c,k.getDescription=function(a){var b=a.name;return a.description&&(b=a.description,-1<b.indexOf("{{")&&-1<b.indexOf("}}")&&(b=b.replace("{{","").replace("}}",""),b=window.cronapi.i18n.translate(b,[]))),b},k.cloneElement=function(a){return angular.copy(a)},k.isVisibleParam=function(a){if("DATA_LIMIT"===a.name)return!1;return!(""!==a.value)||!(""!==a.value)};var j=a.reportName.match(/\/(.*?)(.*?)(\.jrxml|\.report)/);k.report.name=j[2];var l=this;k.onPrint=function(){k.report.reportName.endsWith(".report")&&(h.show({content:"Loading",animation:"fade-in",showBackdrop:!0,maxWidth:200,showDelay:0}),l.openStimulsoftReport(k.report.contentData,k.report.parameters,k.report.datasourcesInBand,void 0,k.onCancel))},k.onCancel=function(){k.ionicModal.remove(),h.hide()},g.fromTemplateUrl("node_modules/cronapp-framework-mobile-js/components/reports/reports.parameters.html",{scope:k,animation:"slide-in-up"}).then(function(a){a.scope.$parent.ionicModal=a,a.show(),$(".modal-backdrop-bg").css("opacity","0")})}}.bind(this);i()},this.mergeParam=function(a,b){var c=function(a,b){for(var c in Object.keys(b)){var d=Object.keys(b[c])[0];if(a==d)return Object.values(b[c])[0]}};for(var d in Object.keys(a)){var e=a[d].name,f=a[d].value,g=c(e,b);g&&(a[d].value=g)}return a},this.setVariablesBasedOnParams=function(a,b){for(var c in b){var d=Object.keys(b[c])[0],e=b[c][d];for(var f in a)if(a[f]&&a[f].Name&&a[f].Name===d){a[f].Value=e;break}}},this.hasParameterWithOutValue=function(a){for(var b in Object.keys(a))if(!a[b].value)return!0;return!1},this.getDatasourcesInBand=function(a){var b=new Stimulsoft.Report.StiReport;b.load(a);var c=stimulsoftHelper.getDatasourcesInBand(b);return c},this.loadSriptsStimulsoft=function(a){var b=!0,c=l.length,d=0;Pace.options.initialRate=.7,Pace.options.minTime=1750,Pace.options.maxProgressPerFrame=1,Pace.options.ghostTime=12e4,Pace.restart(),l.forEach(function(e){this.loadScript(e,function(e){d++,e||(b=!1),d==c&&(Pace.options.initialRate=.03,Pace.options.minTime=250,Pace.options.maxProgressPerFrame=20,Pace.options.ghostTime=10,Pace.stop(),a(b))})}.bind(this))},this.loadScript=function(a,b){if(0<=$.inArray(a,m))return void(b&&b(!0));if(-1!=a.indexOf(".css")){var c=document.createElement("link");c.rel="stylesheet",c.type="text/css",c.href=a,c.media="all",c.onload=function(){m.push(a),b&&b(!0)},c.onerror=function(){b&&b(!1)};try{document.getElementsByTagName("head")[0].appendChild(c)}catch(a){console.log(a)}}else{var d=document.createElement("script");d.type="text/javascript",d.readyState?d.onreadystatechange=function(){("loaded"==d.readyState||"complete"==d.readyState)&&(d.onreadystatechange=null,m.push(a),b&&b(!0))}:d.onload=function(){m.push(a),b&&b(!0)},d.src=a,document.getElementsByTagName("head")[0].appendChild(d)}},this.openReport=function(a,b,c){this.getReport(a).then(function(a){a&&a.data&&(a.data.reportName.endsWith(".report")?this.loadSriptsStimulsoft(function(e){e?(this.initializeStimulsoft(d.use()),this.getContentAsString(a.data).then(function(e){var f=this.getDatasourcesInBand(e.data);this.getDataSourcesParams(f).then(function(g){f=g.data,a.data.parameters=stimulsoftHelper.parseToGroupedParam(f.datasources),a.data.contentData=e.data,a.data.datasourcesInBand=f,b&&(a.data.parameters=this.mergeParam(a.data.parameters,b),a.data.contentData.Dictionary=a.data.contentData.Dictionary||{},this.setVariablesBasedOnParams(a.data.contentData.Dictionary.Variables,b)),this.hasParameterWithOutValue(a.data.parameters)&&!c?(a.data.parameters.forEach(function(a){a.name=d.instant(a.name)}),this.showParameters(JSON.parse(JSON.stringify(a.data)))):this.openStimulsoftReport(e.data,a.data.parameters,a.data.datasourcesInBand,c)}.bind(this))}.bind(this),function(a){var b=cronapi.internal.getErrorMessage(a,a.statusText);k.Notification.error(b)}.bind(this))):k.Notification.error("Error loading report script")}.bind(this)):0==a.data.parameters.length||1==a.data.parameters.length&&"DATA_LIMIT"==a.data.parameters[0].name?this.getPDFAsFile(a.data.reportName).then(function(a){this.openURLContent(a.data)}.bind(this),function(a){var b=cronapi.internal.getErrorMessage(a,a.statusText);k.Notification.error(b)}.bind(this)):(b&&(a.data.parameters=this.mergeParam(a.data.parameters,b)),this.hasParameterWithOutValue(a.data.parameters)?this.showParameters(JSON.parse(JSON.stringify(a.data))):this.getPDFAsFile(a.data).then(function(a){this.openURLContent(a.data)}.bind(this))))}.bind(this))}}])})(app);
|
package/i18n/locale_en_us.json
CHANGED
|
@@ -69,6 +69,7 @@
|
|
|
69
69
|
"Permission.view.Exclude": "Exception",
|
|
70
70
|
"General.RemoveData": "Do you whant to remove?",
|
|
71
71
|
"General.ErrorNotSpecified": "Error not specified",
|
|
72
|
+
"General.ErrorOnServerCommunication": "Error connecting to server",
|
|
72
73
|
"Login.view.invalidPassword": "Username or password invalid!",
|
|
73
74
|
"LoginViewInvalidpassword": "Username or password invalid!",
|
|
74
75
|
"Home.view.passwordChanged": "Password successfully changed!",
|
|
@@ -122,5 +123,6 @@
|
|
|
122
123
|
"Admin.server.out": "Error contacting the server",
|
|
123
124
|
"ParamForReport": "Parameter(s) for the report",
|
|
124
125
|
"template.crud.clickToAddFile": "Click to add a file",
|
|
125
|
-
"template.crud.clickToAddImage": "Click to add an image"
|
|
126
|
+
"template.crud.clickToAddImage": "Click to add an image",
|
|
127
|
+
"clear": "Clear"
|
|
126
128
|
}
|
package/i18n/locale_pt_br.json
CHANGED
|
@@ -69,6 +69,7 @@
|
|
|
69
69
|
"Permission.view.Exclude": "Exceção",
|
|
70
70
|
"General.RemoveData": "Deseja remover?",
|
|
71
71
|
"General.ErrorNotSpecified": "Erro não especificado",
|
|
72
|
+
"General.ErrorOnServerCommunication": "Erro ao conectar no servidor",
|
|
72
73
|
"Login.view.invalidPassword": "Usuário ou senha inválidos!",
|
|
73
74
|
"LoginViewInvalidpassword": "Usuário ou senha inválidos!",
|
|
74
75
|
"Home.view.passwordChanged": "Senha alterada com sucesso!",
|
|
@@ -122,5 +123,7 @@
|
|
|
122
123
|
"Admin.server.out": "Erro ao contactar o servidor",
|
|
123
124
|
"ParamForReport": "Parâmetro(s) para o relatório",
|
|
124
125
|
"template.crud.clickToAddFile": "Clique para adicionar um arquivo",
|
|
125
|
-
"template.crud.clickToAddImage": "Clique para adicionar uma imagem"
|
|
126
|
+
"template.crud.clickToAddImage": "Clique para adicionar uma imagem",
|
|
127
|
+
"clear": "Limpar"
|
|
128
|
+
|
|
126
129
|
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<!-- Generator: Adobe Illustrator 25.3.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
|
3
|
+
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
|
4
|
+
viewBox="0 0 24 24" style="enable-background:new 0 0 24 24;" xml:space="preserve">
|
|
5
|
+
<style type="text/css">
|
|
6
|
+
.st0{fill:#C9C9C9;}
|
|
7
|
+
</style>
|
|
8
|
+
<g id="Camada_1">
|
|
9
|
+
</g>
|
|
10
|
+
<g id="Camada_3">
|
|
11
|
+
</g>
|
|
12
|
+
<g id="Camada_4">
|
|
13
|
+
</g>
|
|
14
|
+
<g id="Camada_2">
|
|
15
|
+
<g>
|
|
16
|
+
<path class="st0" d="M20,0H4C1.79,0,0,1.79,0,4V20c0,2.21,1.79,4,4,4H20c2.21,0,4-1.79,4-4V4C24,1.79,22.21,0,20,0z M22,20
|
|
17
|
+
c0,1.1-0.9,2-2,2H4c-1.1,0-2-0.9-2-2V4c0-1.1,0.9-2,2-2H20c1.1,0,2,0.9,2,2V20z"/>
|
|
18
|
+
<path class="st0" d="M19.5,4H16.5C16.22,4,16,4.22,16,4.49v0.51c0,0.27,0.22,0.49,0.5,0.49h3.01c0.27,0,0.5-0.22,0.5-0.49V4.49
|
|
19
|
+
C20,4.22,19.78,4,19.5,4z"/>
|
|
20
|
+
<path class="st0" d="M19.49,6h-2.98C16.23,6,16,6.23,16,6.51v6.29c0,0.39,0.12,0.78,0.34,1.11l1.24,1.86c0.2,0.3,0.65,0.3,0.85,0
|
|
21
|
+
l1.24-1.86C19.88,13.59,20,13.2,20,12.81V6.51C20,6.23,19.77,6,19.49,6z"/>
|
|
22
|
+
<path class="st0" d="M18,18H7c-0.55,0-1-0.45-1-1c0-0.55,0.45-1,1-1h4c1.65,0,3-1.34,3-3c0-1.66-1.35-3-3-3H9c-0.55,0-1,0.45-1,1
|
|
23
|
+
s0.45,1,1,1h2c0.55,0,1,0.45,1,1c0,0.55-0.45,1-1,1H7c-1.66,0-3,1.35-3,3c0,1.65,1.34,3,3,3h11c0.55,0,1-0.45,1-1S18.55,18,18,18z
|
|
24
|
+
"/>
|
|
25
|
+
</g>
|
|
26
|
+
</g>
|
|
27
|
+
</svg>
|
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
-
<!-- Generator: Adobe Illustrator 25.3.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
|
3
|
-
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
|
4
|
-
viewBox="0 0 24 24" style="enable-background:new 0 0 24 24;" xml:space="preserve">
|
|
5
|
-
<style type="text/css">
|
|
6
|
-
.st0{fill:#C9C9C9;}
|
|
7
|
-
</style>
|
|
8
|
-
<g id="
|
|
9
|
-
<g>
|
|
10
|
-
<path class="st0" d="
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
</
|
|
18
|
-
</svg>
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<!-- Generator: Adobe Illustrator 25.3.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
|
3
|
+
<svg version="1.1" id="Camada_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
|
4
|
+
viewBox="0 0 24 24" style="enable-background:new 0 0 24 24;" xml:space="preserve">
|
|
5
|
+
<style type="text/css">
|
|
6
|
+
.st0{fill:#C9C9C9;}
|
|
7
|
+
</style>
|
|
8
|
+
<g id="Camada_1_1_">
|
|
9
|
+
<g>
|
|
10
|
+
<path class="st0" d="M4,8h16c2.2,0,4-1.8,4-4s-1.8-4-4-4H4C1.8,0,0,1.8,0,4S1.8,8,4,8z M15,2h5c1.1,0,2,0.9,2,2s-0.9,2-2,2h-5
|
|
11
|
+
c-1.1,0-2-0.9-2-2S13.9,2,15,2z M4,2h5c1.1,0,2,0.9,2,2s-0.9,2-2,2H4C2.9,6,2,5.1,2,4S2.9,2,4,2z"/>
|
|
12
|
+
<path class="st0" d="M4,24h16c2.2,0,4-1.8,4-4v-6c0-2.2-1.8-4-4-4H4c-2.2,0-4,1.8-4,4v6C0,22.2,1.8,24,4,24z"/>
|
|
13
|
+
</g>
|
|
14
|
+
</g>
|
|
15
|
+
<g id="Camada_2_1_">
|
|
16
|
+
</g>
|
|
17
|
+
</svg>
|
|
Binary file
|
package/js/app.authentication.js
CHANGED
|
@@ -176,6 +176,13 @@ var app = (function() {
|
|
|
176
176
|
templateUrl: 'node_modules/cronapp-framework-mobile-js/components/templates/publicMenu.template.html'
|
|
177
177
|
})
|
|
178
178
|
|
|
179
|
+
.state('signup', {
|
|
180
|
+
url: "/app/public/signup",
|
|
181
|
+
cache: false,
|
|
182
|
+
controller: 'SignupController',
|
|
183
|
+
templateUrl: 'views/public/signup.view.html'
|
|
184
|
+
})
|
|
185
|
+
|
|
179
186
|
.state('public.pages', {
|
|
180
187
|
url: "/{name:.*}",
|
|
181
188
|
cache: false,
|
|
@@ -402,7 +409,7 @@ app.config = {};
|
|
|
402
409
|
app.config.datasourceApiVersion = 2;
|
|
403
410
|
app.config.defaultRoute = "/app";
|
|
404
411
|
|
|
405
|
-
app.publicRoutes = ["publicRoot", "public", "public.pages", "main"];
|
|
412
|
+
app.publicRoutes = ["publicRoot", "public", "public.pages", "signup", "main"];
|
|
406
413
|
app.isPublicRoute = route => { return app.publicRoutes.includes(route.name); };
|
|
407
414
|
|
|
408
415
|
app.bindScope = function($scope, obj) {
|
|
@@ -240,6 +240,56 @@
|
|
|
240
240
|
}));
|
|
241
241
|
});
|
|
242
242
|
|
|
243
|
+
app.controller('SignupController' , [
|
|
244
|
+
'$scope',
|
|
245
|
+
'$translate',
|
|
246
|
+
'$ionicModal',
|
|
247
|
+
'$ionicLoading',
|
|
248
|
+
|
|
249
|
+
function($scope, $translate, $ionicModal, $ionicLoading) {
|
|
250
|
+
|
|
251
|
+
app.registerEventsCronapi($scope, $translate,$ionicModal,$ionicLoading);
|
|
252
|
+
$scope.Notification = Notification;
|
|
253
|
+
|
|
254
|
+
$scope.cronapi.screen.changeValueOfField('vars.signupEmail','');
|
|
255
|
+
$scope.cronapi.screen.changeValueOfField('vars.signupUsername','');
|
|
256
|
+
$scope.cronapi.screen.changeValueOfField('vars.signupPassword','');
|
|
257
|
+
$scope.cronapi.screen.changeValueOfField('vars.signupConfirmPassword','');
|
|
258
|
+
|
|
259
|
+
}]);
|
|
260
|
+
|
|
261
|
+
app.controller('SignupController' , [
|
|
262
|
+
'$scope',
|
|
263
|
+
'$stateParams',
|
|
264
|
+
'Notification',
|
|
265
|
+
'$location',
|
|
266
|
+
'$http',
|
|
267
|
+
'$rootScope',
|
|
268
|
+
'$translate',
|
|
269
|
+
'$ionicModal',
|
|
270
|
+
'$ionicLoading',
|
|
271
|
+
'$timeout',
|
|
272
|
+
'UploadService',
|
|
273
|
+
'ReportService',
|
|
274
|
+
function($scope, $stateParams, Notification, $location, $http, $rootScope, $translate, $ionicModal, $ionicLoading, $timeout, UploadService, ReportService) {
|
|
275
|
+
app.registerEventsCronapi($scope, $translate,$ionicModal,$ionicLoading);
|
|
276
|
+
$rootScope.http = $http;
|
|
277
|
+
$rootScope.Notification = Notification;
|
|
278
|
+
|
|
279
|
+
$scope.params = $stateParams;
|
|
280
|
+
$rootScope.$http = $http;
|
|
281
|
+
$rootScope.UploadService = UploadService;
|
|
282
|
+
$scope.listCanSwipe = true;
|
|
283
|
+
|
|
284
|
+
for (let x in app.userEvents)
|
|
285
|
+
$scope[x]= app.userEvents[x].bind($scope);
|
|
286
|
+
|
|
287
|
+
$scope.cronapi.screen.changeValueOfField('vars.signupEmail','');
|
|
288
|
+
$scope.cronapi.screen.changeValueOfField('vars.signupUsername','');
|
|
289
|
+
$scope.cronapi.screen.changeValueOfField('vars.signupPassword','');
|
|
290
|
+
$scope.cronapi.screen.changeValueOfField('vars.signupConfirmPassword','');
|
|
291
|
+
}]);
|
|
292
|
+
|
|
243
293
|
app.controller('MenuController', [
|
|
244
294
|
'$scope',
|
|
245
295
|
'$http',
|
|
@@ -282,12 +332,45 @@
|
|
|
282
332
|
$scope.modal.hide();
|
|
283
333
|
};
|
|
284
334
|
|
|
285
|
-
|
|
286
|
-
|
|
335
|
+
$rootScope.logout = function logout() {
|
|
336
|
+
const logoutCallback = (result) => {
|
|
337
|
+
$rootScope.session = {};
|
|
338
|
+
$cookies.remove('_u', {path: '/'});
|
|
339
|
+
|
|
340
|
+
if (typeof (Storage) !== "undefined") {
|
|
287
341
|
localStorage.removeItem("_u");
|
|
288
|
-
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
// In case a logoutUri is defined, after Cronapp logout user is redirected to the logoutUri
|
|
345
|
+
if (result && result.logoutUri) {
|
|
346
|
+
|
|
347
|
+
const ref = cordova.InAppBrowser.open(result.logoutUri, '_blank', 'location=no,footer=yes,zoom=no,enableViewportScale=yes,hidenavigationbuttons=yes,clearcache=yes');
|
|
348
|
+
|
|
349
|
+
const handlerChange = (event) => {
|
|
350
|
+
if (event.url === result.appBaseUrl) {
|
|
351
|
+
ref.removeEventListener('loadstart', handlerChange);
|
|
352
|
+
// close sso window
|
|
353
|
+
ref.close();
|
|
354
|
+
$state.go("login");
|
|
355
|
+
}
|
|
356
|
+
};
|
|
357
|
+
|
|
358
|
+
ref.addEventListener('loadstart', handlerChange);
|
|
359
|
+
|
|
360
|
+
} else {
|
|
289
361
|
$state.go("login");
|
|
290
|
-
|
|
362
|
+
}
|
|
363
|
+
};
|
|
364
|
+
|
|
365
|
+
// Realiza logout
|
|
366
|
+
$http({
|
|
367
|
+
method: 'GET',
|
|
368
|
+
url: window.hostApp + 'logout',
|
|
369
|
+
headers: {
|
|
370
|
+
'Content-Type': 'application/json'
|
|
371
|
+
}
|
|
372
|
+
}).success(logoutCallback).error(logoutCallback);
|
|
373
|
+
};
|
|
291
374
|
}
|
|
292
375
|
|
|
293
376
|
|