Git Repository Public Repository

namibia

URLs

Copy to Clipboard
 
6abb4229a12dfab10e8a3fcb64d3f905585bf972
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
var template_transunionupload = function (static)
{
	this.static = static;
	this.elements = {
		csvFile: new App.TemplateElement.FieldComponent('csvFile')
	};
	this.ti = null;
	this.init = function (ti) {
		this.ti = ti;
		App.DataStore.loadSelectListData('groups', true, 'Company', 'Group.SelectList');
		App.API.getTask(
			'TransUnionUpload', 'Stock', 'Import.Upload',
			null, {}, function () {}, _w.taskContractError
		);
		this.ti.hydrate({
			'csvFile': {
				type: 'document',
				id: 'csvFile',
				title: 'TransUnion CSV file'
			}
		});
	};
	this.construct = function () {
		$('#frmTransUnionUpload').validate({
			rules: {
				csvFile: {required: true}
			},
			messages: {
				csvFile: {
					required: "CSV file required."
				}
			},
			submitHandler: function (form) {
				var data = {Upload: _t['transunionupload'].harvest()};
				if ('' == data.Upload.csvFile)
				{
					alert('Please select a file to import.');
					return false;
				}
				App.API.execTask(
					'TransUnionUpload', data, {},
					function (response)
					{
						alert('Import Complete! Please note that this page will refresh when you click "OK."');
						window.location.reload(false);
					},
					function (response)
					{
						alert(response.StatusReason);
					}
				);
			}
		});
		$('#btnSubmitFile').prop('disabled', false);
	};
	this.destruct = function () {};
};

Commits for namibia/public/templates/page/transunionupload.js

Diff revisions: vs.
Revision Author Commited Message
df0489 ... Mark Fri 14 Oct, 2016 10:01:00 +0000

initial commit