Commit fd20aa6ce315cbb26e476c84b24dfd63f079912c

Authored by Rishav
1 parent 48ed0c7bb0
Exists in master

send confirmation mail code implemented and baseIco added

app/partials/viewCompany/viewCompany.controller.js
... ... @@ -202,4 +202,18 @@
202 202  
203 203 }
204 204  
  205 + $scope.sendMail = function(){
  206 + ViewCompanyService.sendMail(companyId).then(function(result) {
  207 + if(result != null && result.success){
  208 + toastr.success(''+result.success+'', {
  209 + closeButton: true
  210 + })
  211 + }else{
  212 + toastr.error(''+result.statusText+'', {
  213 + closeButton: true
  214 + })
  215 + }
  216 + })
  217 + }
  218 +
205 219 }]);
206 220 \ No newline at end of file
... ...
app/partials/viewCompany/viewCompany.html
... ... @@ -135,6 +135,8 @@
135 135 <div class="widget-header">
136 136 <i class="fa fa-building-o" aria-hidden="true"></i>
137 137 <h3>Company Details</h3>
  138 + <label>BASE ICAO</label>
  139 + <input type="tel" ng-model="companyData.baseIcao" style="line-height: 18px;width: 50px;padding: 0px 9px;" ng-blur="editData()"/>
138 140 <div class="pull-right my-toggle-switch" style="margin-top: 10px; margin-right: 10px;">
139 141 <div><input id="company-one2" checked type="checkbox" data-size="mini" data-width="55" data-toggle="toggle" data-on="Active" data-off="Dactive">
140 142 </div>
... ... @@ -210,7 +212,7 @@
210 212 <textarea name="message" ng-hide="showNoteData" style="margin-bottom: 6px;" class="form-control" ng-model="companyData.internalNote" ng-blur="editData('showNoteData')" rows="4" cols="34"></textarea>
211 213 </div>
212 214 <div class="dis">
213   - <button type="button" class="btn btn-primary">Distribute Price to Company Contacts</button>
  215 + <button type="button" data-toggle="modal" data-target="#distribute-modal-3" class="btn btn-primary">Distribute Price to Company Contacts</button>
214 216 </div>
215 217 <div><button type="button" class="btn btn-info">Setup Fuel</button></div>
216 218 </div>
... ... @@ -612,6 +614,24 @@
612 614 </div>
613 615 </div>
614 616 </form>
  617 +
  618 +<form class="modal multi-step" id="distribute-modal-3" name="aircraftForm">
  619 + <div class="modal-dialog">
  620 + <div class="modal-content">
  621 + <div class="modal-body step-2" data-step="2" style="padding: 0;">
  622 + <div>
  623 + <div class="row" style="margin: 0;">
  624 + <p>Are you sure that you want to email pricing to everyone in your contact list</p>
  625 + </div>
  626 + </div>
  627 + </div>
  628 + <div class="modal-footer" style="border-top: 0;">
  629 + <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
  630 + <button type="button" class="btn btn-primary step step-1" data-step="1" ng-click="sendMail()">Save</button>
  631 + </div>
  632 + </div>
  633 + </div>
  634 +</form>
615 635 <!-- Le javascript
616 636 ================================================== -->
617 637 <!-- Placed at the end of the document so the pages load faster -->
... ...
app/partials/viewCompany/viewCompany.service.js
... ... @@ -54,6 +54,22 @@
54 54 return deferred.promise;
55 55 }
56 56  
  57 + this.sendMail = function(id) {
  58 +
  59 + var deferred = $q.defer();
  60 + $http({
  61 + method : 'POST',
  62 + url : BASE_URL.url +'/mailPriceToContacts/'+id,
  63 + headers : {'Content-Type': 'application/json'},
  64 + })
  65 + .then(function (result){
  66 + deferred.resolve(result.data);
  67 + },function (result){
  68 + deferred.resolve(result.data);
  69 + })
  70 + return deferred.promise;
  71 + }
  72 +
57 73 this.updateContact = function(data) {
58 74  
59 75 var deferred = $q.defer();
... ...