This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository chorem. See http://git.chorem.org/chorem.git commit 69fc48df5517f7cc0814eb5153ae59a92f7f8d43 Author: kootox <jean.couteau@gmail.com> Date: Sun Nov 9 15:24:21 2014 +0100 fixes #1134 : remove list style replace wikitty ids with real values (async) --- .../WEB-INF/jsp/salesReports/salesFunnel.jsp | 24 ++++++++-------- .../src/main/webapp/css/chorem-sales.css | 2 +- chorem-webmotion/src/main/webapp/js/salesFunnel.js | 32 ++++++++++++++++++++++ 3 files changed, 45 insertions(+), 13 deletions(-) diff --git a/chorem-webmotion/src/main/webapp/WEB-INF/jsp/salesReports/salesFunnel.jsp b/chorem-webmotion/src/main/webapp/WEB-INF/jsp/salesReports/salesFunnel.jsp index 2614a76..811ecb7 100644 --- a/chorem-webmotion/src/main/webapp/WEB-INF/jsp/salesReports/salesFunnel.jsp +++ b/chorem-webmotion/src/main/webapp/WEB-INF/jsp/salesReports/salesFunnel.jsp @@ -55,14 +55,14 @@ <li ng-repeat="lead in leads" class="salesFunnelItem"> <div class="pull-left"> <a href="../wikitty/edit/{{lead.meta.id}}"/> - <i class="icon-edit"></i> + <i class="glyphicon glyphicon-edit"></i> </a> <small> - <a href="/wikitty/Employee/view/{{lead.getField('Quotation', 'customer')}}">{{lead.getField('Quotation','customer')}}</a> + <a href="../wikitty/Employee/view/{{lead.getField('Quotation', 'customer')}}">{{dependencies[dependencies[lead.getField('Quotation','customer')].getField('Employee','company')].getField('Company','name')}}</a> </small> <p> <span class="salesFunnelItemTitle"> - <a class="name-link" href="/wikitty/Project/view/{{lead.getField('Quotation','project')}}"/>{{lead.getField('Quotation','projet')}}</a> + <a class="name-link" href="../wikitty/Project/view/{{lead.getField('Quotation','project')}}"/>{{dependencies[lead.getField('Quotation','project')].getField('Project','name')}}</a> </span> - <small>{{lead.getField('Quotation','description')}}</small> </p> </div> @@ -70,7 +70,7 @@ <a class="btn btn-warning pull-right" ng-click="cancel(lead)">Annuler</a> <div class="pull-right"> <p class="salesFunnelItemTitle">{{lead.getField('Quotation','amount')}} €</p> - <small>{{lead.getField('Quotation','category')}} - {{lead.getField('Quotation','estimatedDays')}}j - {{lead.getField('Quotation','conversionHope')}} %</small> + <small>{{dependencies[lead.getField('Quotation','category')].getField('WikittyTreeNode','name')}} - {{lead.getField('Quotation','estimatedDays')}}j - {{lead.getField('Quotation','conversionHope')}} %</small> </div> <div style="clear:both;"/> </li> @@ -83,11 +83,11 @@ <ul class="unstyled drafts"> <li ng-repeat="draft in drafts" class="salesFunnelItem"> <div class="pull-left"> - <a href="../wikitty/edit/{{draft.meta.id}}"/><i class="icon-edit"></i></a> - <small><a href="/wikitty/Employee/view/{{draft.getField('Quotation', 'customer')}}">{{draft.getField('Quotation','customer')}}</a><span ng-hide="!draft.getField('Draft','sendingDate')"> - Deadline:{{draft.getField('Draft','sendingDate') | date:'dd/MM/yyyy'}}</span></small> + <a href="../wikitty/edit/{{draft.meta.id}}"/><i class="glyphicon glyphicon-edit"></i></a> + <small><a href="../wikitty/Employee/view/{{draft.getField('Quotation', 'customer')}}">{{dependencies[dependencies[draft.getField('Quotation','customer')].getField('Employee','company')].getField('Company','name')}}</a><span ng-hide="!draft.getField('Draft','sendingDate')"> - Deadline:{{draft.getField('Draft','sendingDate') | date:'dd/MM/yyyy'}}</span></small> <p> <span class="salesFunnelItemTitle"> - <a class="name-link" href="/wikitty/Project/view/{{draft.getField('Quotation','project')}}"/>{{draft.getField('Quotation','projet')}}</a> + <a class="name-link" href="../wikitty/Project/view/{{draft.getField('Quotation','project')}}"/>{{dependencies[draft.getField('Quotation','project')].getField('Project','name')}}</a> </span> - <small>{{draft.getField('Quotation','description')}}</small> </p> </div> @@ -95,7 +95,7 @@ <a class="btn btn-warning pull-right" ng-click="cancel(draft)">Annuler</a> <div class="pull-right"> <p class="salesFunnelItemTitle">{{draft.getField('Quotation','amount')}} €</p> - <small>{{draft.getField('Quotation','category')}} - {{draft.getField('Quotation','estimatedDays')}}j - {{draft.getField('Quotation','conversionHope')}} %</small> + <small>{{dependencies[draft.getField('Quotation','category')].getField('WikittyTreeNode','name')}} - {{draft.getField('Quotation','estimatedDays')}}j - {{draft.getField('Quotation','conversionHope')}} %</small> </div> <div style="clear:both;"/> </li> @@ -108,11 +108,11 @@ <ul class="unstyled sents"> <li ng-repeat="sent in sents" class="salesFunnelItem"> <div class="pull-left"> - <a href="../wikitty/edit/{{sent.meta.id}}"/><i class="icon-edit"></i></a> - <small><a href="/wikitty/Employee/view/{{sent.getField('Quotation', 'customer')}}">{{sent.getField('Quotation','customer')}}</a><span ng-hide="!sent.getField('Sent','postedDate')"> - Répondu le:{{sent.getField('Sent','postedDate') | date:'dd/MM/yyyy'}}</span></a></small> + <a href="../wikitty/edit/{{sent.meta.id}}"/><i class="glyphicon glyphicon-edit"></i></a> + <small><a href="../wikitty/Employee/view/{{sent.getField('Quotation', 'customer')}}">{{dependencies[dependencies[sent.getField('Quotation','customer')].getField('Employee','company')].getField('Company','name')}}</a><span ng-hide="!sent.getField('Sent','postedDate')"> - Répondu le:{{sent.getField('Sent','postedDate') | date:'dd/MM/yyyy'}}</span></a></small> <p> <span> - <a class="name-link" href="/wikitty/Project/view/{{sent.getField('Quotation','project')}}"/>{{sent.getField('Quotation','projet')}}</a> + <a class="name-link" href="../wikitty/Project/view/{{sent.getField('Quotation','project')}}"/>{{dependencies[sent.getField('Quotation','project')].getField('Project','name')}}</a> </span> - <small>{{sent.getField('Quotation','description')}}</small> </p> </div> @@ -121,7 +121,7 @@ <a class="btn btn-warning pull-right" ng-click="cancel(sent)">Annuler</a> <div class="pull-right"> <p class="salesFunnelItemTitle">{{sent.getField('Quotation','amount')}} €</p> - <small>{{sent.getField('Quotation','category')}} - {{sent.getField('Quotation','estimatedDays')}}j - {{sent.getField('Quotation','conversionHope')}} %</small> + <small>{{dependencies[sent.getField('Quotation','category')].getField('WikittyTreeNode','name')}} - {{sent.getField('Quotation','estimatedDays')}}j - {{sent.getField('Quotation','conversionHope')}} %</small> </div> <div style="clear:both;"/> </li> diff --git a/chorem-webmotion/src/main/webapp/css/chorem-sales.css b/chorem-webmotion/src/main/webapp/css/chorem-sales.css index c30cea0..f672ceb 100644 --- a/chorem-webmotion/src/main/webapp/css/chorem-sales.css +++ b/chorem-webmotion/src/main/webapp/css/chorem-sales.css @@ -26,7 +26,7 @@ margin-bottom: 10px; min-height: 20px; padding: 5px; - list-style-type:none; + list-style:none; } .salesFunnelItemTitle{ diff --git a/chorem-webmotion/src/main/webapp/js/salesFunnel.js b/chorem-webmotion/src/main/webapp/js/salesFunnel.js index fbd848e..6a2ae71 100644 --- a/chorem-webmotion/src/main/webapp/js/salesFunnel.js +++ b/chorem-webmotion/src/main/webapp/js/salesFunnel.js @@ -39,6 +39,7 @@ salesFunnel.directive('datepicker', function() { }); + var salesFunnelController = ['$scope', '$modal', 'Wikitty', function ($scope, $modal, Wikitty) { $scope.wikittyId = ''; $scope.wikitty = {}; @@ -52,17 +53,48 @@ var salesFunnelController = ['$scope', '$modal', 'Wikitty', function ($scope, $m $scope.sents={}; $scope.sentsAmount=0; $scope.sentsAmountHope=0; + $scope.dependencies={}; + $scope.customerCompanyId=0; + + var getDependencies = function(w){ + for (var i in w) + { + if (i != "$promise" && i != "$resolved" && i != "length") { + var categoryId = w[i].getField('Quotation','category'); + Wikitty.get(categoryId, function(cat){ + $scope.dependencies[categoryId]=cat; + }); + + var customerId = w[i].getField('Quotation','customer'); + Wikitty.get(customerId, function(cust){ + $scope.dependencies[customerId]=cust; + var customerCompanyId = cust.getField('Employee','company'); + Wikitty.get(customerCompanyId, function(comp){ + $scope.dependencies[customerCompanyId]=comp; + }); + }); + + var projectId = w[i].getField('Quotation','project'); + Wikitty.get(projectId, function(project){ + $scope.dependencies[projectId]=project; + }); + } + } + } Wikitty.query("extension = Quotation AND extension != Draft AND extension != Cancelled", function(w) { $scope.leads= w; + getDependencies(w); }); Wikitty.query("extension = Draft AND extension != Sent AND extension != Cancelled", function(w) { $scope.drafts= w; + getDependencies(w); }); Wikitty.query("extension = Sent AND extension != Accepted AND extension != Rejected AND extension != Cancelled", function(w) { $scope.sents= w; + getDependencies(w); }); $scope.leadToDraft = function(lead){ -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.