Browse Source

UI-2238: faxing almost done, need resend mechanic

4.0
Jean-Roch Maitre 10 years ago
parent
commit
aef9738ed6
3 changed files with 16 additions and 15 deletions
  1. +10
    -9
      app.js
  2. +3
    -3
      views/inbound-faxes-list.html
  3. +3
    -3
      views/outbound-faxes-list.html

+ 10
- 9
app.js View File

@ -363,19 +363,19 @@ define(function(require){
formatInboundData: function(data) {
var self = this,
formattedFaxes = self.formatFaxes(data);
formattedFaxes = self.formatFaxes(data, 'inbound');
return formattedFaxes;
},
formatOutboundData: function(data) {
var self = this,
formattedFaxes = self.formatFaxes(data);
formattedFaxes = self.formatFaxes(data, 'outbound');
return formattedFaxes;
},
formatFaxes: function(data) {
formatFaxes: function(data, type) {
var self = this;
_.each(data, function(fax) {
@ -394,16 +394,17 @@ define(function(require){
fax.formatted.sendingFaxbox = self.appFlags.faxboxes.hasOwnProperty(fax.faxbox_id) ? self.appFlags.faxboxes[fax.faxbox_id].name : '-';
fax.formatted.sendingNumber = monster.util.formatPhoneNumber(fax.from_number);
fax.formatted.pages = details.hasOwnProperty('total_pages') ? details.total_pages : self.i18n.active().fax.table.noData;
fax.formatted.uri = self.formatFaxURI(fax.id);
fax.formatted.uri = self.formatFaxURI(fax.id, type);
});
return data;
},
formatFaxURI: function(mediaId) {
var self = this;
formatFaxURI: function(mediaId, pType) {
var self = this,
type = pType === 'inbound' ? 'inbox' : 'outbox';
return self.apiUrl + 'accounts/' + self.accountId + '/faxes/' + mediaId + '/attachments?auth_token=' + self.authToken;
return self.apiUrl + 'accounts/' + self.accountId + '/faxes/'+ type +'/' + mediaId + '/attachment?auth_token=' + self.authToken;
},
getInboundFaxes: function(fromDate, toDate, callback) {
@ -465,8 +466,8 @@ define(function(require){
getFaxDetails: function(type, faxId, callback) {
var self = this,
resourceName = 'faxes.' + (type === 'inbound' ? 'getAttachmentInbound' : 'getAttachmentOutbound');
//resourceName = 'faxes.' + (type === 'inbound' ? 'getDetailsInbound' : 'getDetailsOutbound');
//resourceName = 'faxes.' + (type === 'inbound' ? 'getAttachmentInbound' : 'getAttachmentOutbound');
resourceName = 'faxes.' + (type === 'inbound' ? 'getDetailsInbound' : 'getDetailsOutbound');
self.callApi({
resource: resourceName,


+ 3
- 3
views/inbound-faxes-list.html View File

@ -26,10 +26,10 @@
<td>{{formatted.sendingNumber}}</td>
<td>{{formatted.pages}}</td>
<td class="actions">
<a class="action-item" target="_blank" href="https://www.wsop.com/2014/2014-WSOP-Rules.pdf" href2="{{formatted.uri}}">
<!-- <a class="action-item" target="_blank" href="{{formatted.uri}}">
<i class="fa fa-file-o action-item view-fax"></i>
</a>
<a class="action-item" download target="_blank" href="https://www.wsop.com/2014/2014-WSOP-Rules.pdf" href2="{{formatted.uri}}">
</a> -->
<a class="action-item" download target="_blank" href="{{formatted.uri}}">
<i class="fa fa-cloud-download download-fax"></i>
</a>
<i class="fa fa-list action-item details-fax"></i>


+ 3
- 3
views/outbound-faxes-list.html View File

@ -30,10 +30,10 @@
<td>{{formatted.receivingNumber}}</td>
<td>{{formatted.pages}}</td>
<td class="actions">
<a class="action-item" target="_blank" href="https://www.wsop.com/2014/2014-WSOP-Rules.pdf" href2="{{formatted.uri}}">
<!-- <a class="action-item" target="_blank" href="{{formatted.uri}}">
<i class="fa fa-file-o action-item view-fax"></i>
</a>
<a class="action-item" download target="_blank" href="https://www.wsop.com/2014/2014-WSOP-Rules.pdf" href2="{{formatted.uri}}">
</a> -->
<a class="action-item" download target="_blank" href="{{formatted.uri}}">
<i class="fa fa-cloud-download download-fax"></i>
</a>
<i class="fa fa-list action-item details-fax"></i>


Loading…
Cancel
Save