namibia
df0489e1eeeeab5a9bd44e1d84fce49924fe1bac
namibia / public / js / app / portal-workspace / disputeview.js
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 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
;(function(){ window._w.disputeview = { itemId : null, itemData : null, formMeta : null, ti : null, onViewTemplateReady : function( template, event, eventData ) { _w.disputeview.ti = _t[template]; _w.disputeview.itemData = null; _w.disputeview.setDisputeViewFormMeta(); _w.disputeview.ti.hydrate(_w.disputeview.formMeta); // Retrieve initial view data. _w.disputeview.itemId = App.Util.getUrlParam('id'); App.API.getTask( 'viewDispute:' + _w.disputeview.itemId, 'Dispute', 'Dispute.View', _w.disputeview.itemId, {'id':_w.disputeview.itemId}, _w.disputeview._onDisputeViewDataReceived, _w.taskContractError ); }, setDisputeViewFormMeta : function( data ) { if (!data) { data = {}; } _w.disputeview.formMeta = { 'jobState' : { title : 'Status', value : data.jobState }, 'created' : { title : 'Created', value : data.created ? ((data.created).split(' '))[0] : '' }, 'vehicle' : { title : 'Vehicle', value : data.auction ? data.auction.stock.type.model.make.name + ', ' + data.auction.stock.type.model.name + ', ' + data.auction.stock.type.name + ' (' + data.auction.stock.vehicleYear.name + ')' : '' }, 'complaint' : { title : 'Complaint', value : data.complaint }, 'resolution' : { title : 'Resolution', value : data.resolution }, 'plaintive' : { title : 'Plaintiff', value : data.fromCompany ? data.fromCompany.name : '' }, 'contact' : { title : 'Contact person', value : data.fromCompany ? data.fromCompany.contact.firstName + ' ' + data.fromCompany.contact.familyName : '' }, 'office' : { title : 'Office', value : data.fromCompany ? data.fromCompany.contact.office : '' }, 'mobile' : { title : 'Mobile', value : data.fromCompany ? data.fromCompany.contact.mobile : '' }, 'email' : { title : 'Email', value : data.fromCompany ? data.fromCompany.contact.email : '' } }; }, _onDisputeViewDataReceived : function( response ) { _w.disputeview.itemId = response.Data.id; _w.disputeview.itemData = response.Data; console.log(response.Data); _w.disputeview.setDisputeViewFormMeta(response.Data); _w.disputeview.ti.hydrate(_w.disputeview.formMeta); } }; })(); |
Commits for namibiapublic/js/app/portal-workspace/disputeview.js
Revision | Author | Commited | Message |
---|---|---|---|
df0489 ... | Mark | Fri 14 Oct, 2016 10:01:00 +0000 | initial commit |