branch chorem-ng updated (485ee47 -> f7df510)
This is an automated email from the git hooks/post-receive script. New change to branch chorem-ng in repository chorem. See http://git.chorem.org/chorem.git from 485ee47 add a context params to allow /webjars path from wm new 9d623fd refs #1211 : View company new ca6c4ac refs #1211 : add person and company count on home page new b2ef135 refs #1211 : Add persons list, filering and navigation new f7df510 Refs #1211 : Improve home page with billing The 4 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit f7df510bda89eae3ba5b21cabfbef82e0c8a6ca6 Author: kootox <jean.couteau@gmail.com> Date: Fri May 29 16:57:36 2015 +0200 Refs #1211 : Improve home page with billing commit b2ef1352eb9c3e8e7daa7d35d5239c36db25c70d Author: kootox <jean.couteau@gmail.com> Date: Thu Apr 16 16:35:39 2015 +0200 refs #1211 : Add persons list, filering and navigation commit ca6c4ac2d26faf407ebe08f41a99cdaac4e9d998 Author: kootox <jean.couteau@gmail.com> Date: Sat Apr 4 16:21:45 2015 +0200 refs #1211 : add person and company count on home page commit 9d623fd7a98c2dda1c45b7772f35914644f6d79e Author: kootox <jean.couteau@gmail.com> Date: Sat Apr 4 15:54:20 2015 +0200 refs #1211 : View company Summary of changes: .../main/webapp/crm/partials/companies.list.html | 8 +- .../main/webapp/crm/partials/companyInfoCard.html | 26 +++ .../src/main/webapp/crm/partials/companyPanel.html | 14 ++ .../crm/partials/contactDetailsListCard.html | 24 +++ .../webapp/crm/partials/employeesListCard.html | 20 ++ .../main/webapp/crm/partials/invoicesListCard.html | 21 ++ .../main/webapp/crm/partials/notesListCard.html | 21 ++ .../main/webapp/crm/partials/personInfoCard.html | 26 +++ .../src/main/webapp/crm/partials/personPanel.html | 11 + .../{companies.list.html => personsList.html} | 20 +- chorem-ui-angular/src/main/webapp/home.html | 76 +++++-- chorem-ui-angular/src/main/webapp/index.html | 2 +- chorem-ui-angular/src/main/webapp/js/chorem.js | 2 + .../src/main/webapp/js/choremControllers.js | 22 ++ chorem-ui-angular/src/main/webapp/js/crm/crm.js | 26 ++- .../src/main/webapp/js/crm/crmControllers.js | 230 ++++++++++++++++++++- 16 files changed, 502 insertions(+), 47 deletions(-) create mode 100644 chorem-ui-angular/src/main/webapp/crm/partials/companyInfoCard.html create mode 100644 chorem-ui-angular/src/main/webapp/crm/partials/companyPanel.html create mode 100644 chorem-ui-angular/src/main/webapp/crm/partials/contactDetailsListCard.html create mode 100644 chorem-ui-angular/src/main/webapp/crm/partials/employeesListCard.html create mode 100644 chorem-ui-angular/src/main/webapp/crm/partials/invoicesListCard.html create mode 100644 chorem-ui-angular/src/main/webapp/crm/partials/notesListCard.html create mode 100644 chorem-ui-angular/src/main/webapp/crm/partials/personInfoCard.html create mode 100644 chorem-ui-angular/src/main/webapp/crm/partials/personPanel.html copy chorem-ui-angular/src/main/webapp/crm/partials/{companies.list.html => personsList.html} (67%) -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch chorem-ng in repository chorem. See http://git.chorem.org/chorem.git commit 9d623fd7a98c2dda1c45b7772f35914644f6d79e Author: kootox <jean.couteau@gmail.com> Date: Sat Apr 4 15:54:20 2015 +0200 refs #1211 : View company --- .../main/webapp/crm/partials/companies.list.html | 6 +- .../main/webapp/crm/partials/companyInfoCard.html | 26 ++++++++ .../src/main/webapp/crm/partials/companyPanel.html | 14 ++++ .../crm/partials/contactDetailsListCard.html | 24 +++++++ .../webapp/crm/partials/employeesListCard.html | 20 ++++++ .../main/webapp/crm/partials/invoicesListCard.html | 21 ++++++ .../main/webapp/crm/partials/notesListCard.html | 21 ++++++ chorem-ui-angular/src/main/webapp/js/chorem.js | 2 + chorem-ui-angular/src/main/webapp/js/crm/crm.js | 6 ++ .../src/main/webapp/js/crm/crmControllers.js | 77 +++++++++++++++++++--- 10 files changed, 204 insertions(+), 13 deletions(-) diff --git a/chorem-ui-angular/src/main/webapp/crm/partials/companies.list.html b/chorem-ui-angular/src/main/webapp/crm/partials/companies.list.html index 0e10dd4..d66ea9b 100644 --- a/chorem-ui-angular/src/main/webapp/crm/partials/companies.list.html +++ b/chorem-ui-angular/src/main/webapp/crm/partials/companies.list.html @@ -23,13 +23,13 @@ </div> <div class="list-group"> - <a class="list-group-item" href="#/companies/{{company.wikittyId}}" + <a class="list-group-item" href="#/companies/{{company.id}}" ng-repeat="company in filteredItems" ng-class="{'active':isItemSelected(company)}" ng-click="selectItem(company)"> <i class="fa fa-3x fa-building-o pull-left"></i> - <h4 class="list-group-item-heading">{{company.name}}</h4> - <p class="list-group-item-text">{{company.type}} </p> + <h4 class="list-group-item-heading">{{company.Company.name}}</h4> + <p class="list-group-item-text">{{company.Company.type}} </p> </a> </div> diff --git a/chorem-ui-angular/src/main/webapp/crm/partials/companyInfoCard.html b/chorem-ui-angular/src/main/webapp/crm/partials/companyInfoCard.html new file mode 100644 index 0000000..f11a294 --- /dev/null +++ b/chorem-ui-angular/src/main/webapp/crm/partials/companyInfoCard.html @@ -0,0 +1,26 @@ +<div class="panel panel-default"> + <div class="panel-heading clearfix"> + <h3 class="panel-title pull-left">Détails de la société</h3> + <div class="btn-group pull-right visible-xs"> + <a class="btn btn-primary" href="#/companies/{{company.id}}/edit"> + <i class="fa fa-pencil"></i> + <span>Edit</span> + </a> + </div> + <a class="btn btn-primary pull-right hidden-xs" href="#/companies/{{company.id}}/edit"> + <i class="fa fa-pencil"></i> + <span>Edit</span> + </a> + </div> + <div class="list-group"> + <div class="list-group-item"> + <i class="fa fa-2x fa-building-o pull-left"></i> + <label>Nom</label> + <h4 class="list-group-item-heading">{{company.Company.name}}</h4> + </div> + <div class="list-group-item"> + <label>Type</label> + <h4 class="list-group-item-heading">{{company.Company.type}}</h4> + </div> + </div> +</div> \ No newline at end of file diff --git a/chorem-ui-angular/src/main/webapp/crm/partials/companyPanel.html b/chorem-ui-angular/src/main/webapp/crm/partials/companyPanel.html new file mode 100644 index 0000000..b2c5191 --- /dev/null +++ b/chorem-ui-angular/src/main/webapp/crm/partials/companyPanel.html @@ -0,0 +1,14 @@ +<!-- company info card --> +<ng-include src="'crm/partials/companyInfoCard.html'"></ng-include> + +<!-- contact details card --> +<ng-include src="'crm/partials/contactDetailsListCard.html'"></ng-include> + +<!-- notes card --> +<ng-include src="'crm/partials/notesListCard.html'"></ng-include> + +<!--employees card --> +<ng-include src="'crm/partials/employeesListCard.html'"></ng-include> + +<!--invoices card--> +<ng-include src="'crm/partials/invoicesListCard.html'"></ng-include> \ No newline at end of file diff --git a/chorem-ui-angular/src/main/webapp/crm/partials/contactDetailsListCard.html b/chorem-ui-angular/src/main/webapp/crm/partials/contactDetailsListCard.html new file mode 100644 index 0000000..7fb412a --- /dev/null +++ b/chorem-ui-angular/src/main/webapp/crm/partials/contactDetailsListCard.html @@ -0,0 +1,24 @@ +<div class="panel panel-default"> + <div class="panel-heading clearfix"> + <h3 class="panel-title pull-left">Moyens de contact</h3> + <div class="btn-group pull-right visible-xs"> + <a class="btn btn-primary" href="#/companies/{{company.wikittyId}}/contactDetails/add" + data-toggle="modal" + data-target="#editModal"> + <i class="fa fa-plus"></i> + <span>Ajouter</span> + </a> + </div> + <a class="btn btn-primary pull-right hidden-xs" href="#/companies/{{company.wikittyId}}/contactDetails/add"> + <i class="fa fa-plus"></i> + <span>Ajouter</span> + </a> + </div> + <div class="list-group"> + <a class="list-group-item" ng-repeat="contact in contactDetails" + href="#/companies/{{company.wikittyId}}/contactDetails/{{contact.wikittyId}}"> + <label>{{contact.type}} - {{contact.name}}</label> + <h4 class="list-group-item-heading">{{contact.value}}</h4> + </a> + </div> +</div> \ No newline at end of file diff --git a/chorem-ui-angular/src/main/webapp/crm/partials/employeesListCard.html b/chorem-ui-angular/src/main/webapp/crm/partials/employeesListCard.html new file mode 100644 index 0000000..4439360 --- /dev/null +++ b/chorem-ui-angular/src/main/webapp/crm/partials/employeesListCard.html @@ -0,0 +1,20 @@ +<div class="panel panel-default"> + <div class="panel-heading clearfix"> + <h3 class="panel-title pull-left">Employés</h3> + <div class="btn-group pull-right visible-xs"> + <a class="btn btn-primary" href="#/companies/{{company.wikittyId}}/employees/add"> + <i class="fa fa-plus"></i><span>Ajouter</span> + </a> + </div> + <a class="btn btn-primary pull-right hidden-xs" href="#/companies/{{company.wikittyId}}/employees/add"> + <i class="fa fa-plus"></i><span>Ajouter</span> + </a> + </div> + <div class="list-group"> + <a class="list-group-item" ng-repeat="employee in employees" + href="#/companies/{{company.wikittyId}}/employees/{{employee.wikittyId}}"> + <label>{{employee.description}}</label> + <h4 class="list-group-item-heading">{{employee.person.firstName}} {{employee.person.lastName}}</h4> + </a> + </div> +</div> \ No newline at end of file diff --git a/chorem-ui-angular/src/main/webapp/crm/partials/invoicesListCard.html b/chorem-ui-angular/src/main/webapp/crm/partials/invoicesListCard.html new file mode 100644 index 0000000..89d5ad6 --- /dev/null +++ b/chorem-ui-angular/src/main/webapp/crm/partials/invoicesListCard.html @@ -0,0 +1,21 @@ +<div class="panel panel-default"> + <div class="panel-heading clearfix"> + <h3 class="panel-title pull-left">Factures</h3> + <div class="btn-group pull-right visible-xs"> + <a class="btn btn-primary" href="#/companies/{{company.wikittyId}}/invoices/add"> + <i class="fa fa-pencil"></i> + <span>Ajouter</span> + </a> + </div> + <a class="btn btn-primary pull-right hidden-xs" href="#/companies/{{company.wikittyId}}/invoices/add"> + <i class="fa fa-plus"></i> + <span>Ajouter</span> + </a> + </div> + <div class="list-group"> + <a class="list-group-item" ng-repeat="invoice in invoices" href="#/companies/{{company.wikittyId}}/invoices/{{invoice.wikittyId}}"/> + <label>{{invoice.emittedDate | date : dd/MM/yyy}} - {{invoice.description}}</label> + <h4 class="list-group-item-heading">{{invoice.reference}} - {{invoice.amount|currency}}</h4> + </a> + </div> +</div> \ No newline at end of file diff --git a/chorem-ui-angular/src/main/webapp/crm/partials/notesListCard.html b/chorem-ui-angular/src/main/webapp/crm/partials/notesListCard.html new file mode 100644 index 0000000..81c3653 --- /dev/null +++ b/chorem-ui-angular/src/main/webapp/crm/partials/notesListCard.html @@ -0,0 +1,21 @@ +<div class="panel panel-default"> + <div class="panel-heading clearfix"> + <h3 class="panel-title pull-left">Notes</h3> + <div class="btn-group pull-right visible-xs"> + <a class="btn btn-primary" href="#/companies/{{company.wikittyId}}/notes/add"> + <i class="fa fa-pencil"></i> + <span>Ajouter</span> + </a> + </div> + <a class="btn btn-primary pull-right hidden-xs" href="#/companies/{{company.wikittyId}}/notes/add"> + <i class="fa fa-plus"></i> + <span>Ajouter</span> + </a> + </div> + <div class="list-group"> + <a class="list-group-item" ng-repeat="note in notes" href="#/companies/{{company.wikittyId}}/notes/{{note.wikittyId}}"/> + <h4 class="list-group-item-heading">{{note.title}}</h4> + <label>{{note.date | date : dd/MM/yyy}}</label> + </a> + </div> +</div> \ No newline at end of file diff --git a/chorem-ui-angular/src/main/webapp/js/chorem.js b/chorem-ui-angular/src/main/webapp/js/chorem.js index 0735cea..a9cd7ab 100644 --- a/chorem-ui-angular/src/main/webapp/js/chorem.js +++ b/chorem-ui-angular/src/main/webapp/js/chorem.js @@ -12,6 +12,8 @@ chorem.config( [ '$stateProvider', '$urlRouterProvider', function ($stateProvider, $urlRouterProvider) { + $urlRouterProvider.when('','/'); + ////////////////////////// // State Configurations // ////////////////////////// diff --git a/chorem-ui-angular/src/main/webapp/js/crm/crm.js b/chorem-ui-angular/src/main/webapp/js/crm/crm.js index 6db23de..b2e42ca 100644 --- a/chorem-ui-angular/src/main/webapp/js/crm/crm.js +++ b/chorem-ui-angular/src/main/webapp/js/crm/crm.js @@ -20,6 +20,12 @@ choremCRM.config( url: '/add', templateUrl: 'crm/partials/companyCreateCard.html', controller:'CompanyCreateController' + }) + + .state('crm.companies.view', { + url: '/:companyId', + templateUrl: 'crm/partials/companyPanel.html', + controller:'CompanyDetailController' }); }]); diff --git a/chorem-ui-angular/src/main/webapp/js/crm/crmControllers.js b/chorem-ui-angular/src/main/webapp/js/crm/crmControllers.js index c5a1381..da70e5c 100644 --- a/chorem-ui-angular/src/main/webapp/js/crm/crmControllers.js +++ b/chorem-ui-angular/src/main/webapp/js/crm/crmControllers.js @@ -18,12 +18,13 @@ choremCRMControllers.controller('CompanyListController', function ($scope, $http $scope.selectItem=function(selectedCompany){ $scope.selectedItem = selectedCompany; + $state.go('crm.companies.view', { companyId: selectedCompany.id }); }; $scope.selectItemById=function(id){ for (var index in $scope.items) { var company = $scope.items[index]; - if (company.wikittyId===id){ + if (company.id===id){ $scope.selectedItem=company; } } @@ -38,7 +39,7 @@ choremCRMControllers.controller('CompanyListController', function ($scope, $http for (var index in $scope.items) { var company = $scope.items[index]; var regexp = new RegExp($scope.searchTerm,"i"); - if (company.name.match(regexp)){ + if (company.Company.name.match(regexp)){ $scope.filteredItems.push(company); } } @@ -71,16 +72,16 @@ choremCRMControllers.controller('CompanyListController', function ($scope, $http } $scope.refresh=function(){ - $http.get('companies').success(function(data){ + $http.get('services/v1/Company').success(function(data){ $scope.items = data; - if ($state.params.companyId){ + //if ($state.params.companyId){ //company selected - $scope.selectItemById($state.params.companyId); - $state.go('crm.companies', { companyId: $state.params.companyId }); - } else { - $scope.selectedItem=$scope.items[0]; - $state.go('crm.companies', { companyId: $scope.selectedItem.wikittyId }); - } + //$scope.selectItemById($state.params.companyId); + //$state.go('crm.companies.view', { companyId: $state.params.companyId }); + //} else { + //$scope.selectedItem=$scope.items[0]; + //$state.go('crm.companies.view', { companyId: $scope.selectedItem.id }); + //} $scope.filter(); }); }; @@ -89,6 +90,62 @@ choremCRMControllers.controller('CompanyListController', function ($scope, $http }); +choremCRMControllers.controller('CompanyDetailController', function ($scope, $http, $state){ + + $scope.companyId=$state.params.companyId; + + $scope.updateCompany=function(){ + if ($scope.companyId){ + $http.get('services/v1/Company/'+$scope.companyId).success(function(data){ + $scope.company = data; + }); + } + }; + + //get back contact details for the company + $scope.updateContactDetails=function(){ + if ($scope.companyId){ + $http.get('contactDetails?target='+$scope.companyId).success(function(data){ + $scope.contactDetails = data; + }); + } + }; + + //get back notes for the company + $scope.updateNotes=function(){ + if ($scope.companyId){ + $http.get('notes?target='+$scope.companyId).success(function(data){ + $scope.notes = data; + }); + } + }; + + //get back employees for the company + $scope.updateEmployees=function(){ + if ($scope.companyId){ + $http.get('employees?company='+$scope.companyId).success(function(data){ + $scope.employees = data; + }); + } + }; + + //get back invoices for the company + $scope.updateInvoices=function(){ + if ($scope.companyId){ + $http.get('invoices?payer='+$scope.companyId).success(function(data){ + $scope.invoices = data; + }); + } + }; + + $scope.updateCompany(); + $scope.updateContactDetails(); + $scope.updateNotes(); + $scope.updateEmployees(); + $scope.updateInvoices(); + +}); + choremCRMControllers.controller('CompanyCreateController', function ($scope, $http, $window) { $scope.saveCompany = function(){ -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch chorem-ng in repository chorem. See http://git.chorem.org/chorem.git commit ca6c4ac2d26faf407ebe08f41a99cdaac4e9d998 Author: kootox <jean.couteau@gmail.com> Date: Sat Apr 4 16:21:45 2015 +0200 refs #1211 : add person and company count on home page --- chorem-ui-angular/src/main/webapp/home.html | 13 +++---------- .../src/main/webapp/js/choremControllers.js | 16 ++++++++++++++++ 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/chorem-ui-angular/src/main/webapp/home.html b/chorem-ui-angular/src/main/webapp/home.html index f6a02cf..c2790b0 100644 --- a/chorem-ui-angular/src/main/webapp/home.html +++ b/chorem-ui-angular/src/main/webapp/home.html @@ -6,7 +6,7 @@ <div class="col-sm-4"> - <div class="panel panel-default bootcards-summary"> + <div class="panel panel-default bootcards-summary" ng-controller="HomePageResumeController"> <div class="panel-heading"> <h3 class="panel-title">Résumé</h3> @@ -19,7 +19,7 @@ <i class="fa fa-3x fa-users"></i> <h4> Personnes - <span class="label label-info">40</span> + <span class="label label-info">{{personNumber}}</span> </h4> </a> </div> @@ -28,7 +28,7 @@ <i class="fa fa-3x fa-building-o"></i> <h4> Sociétés - <span class="label label-info">40</span> + <span class="label label-info">{{companiesNumber}}</span> </h4> </a> </div> @@ -109,13 +109,6 @@ </div> </div> </div> - - - - - - - </div> <div class="row"> diff --git a/chorem-ui-angular/src/main/webapp/js/choremControllers.js b/chorem-ui-angular/src/main/webapp/js/choremControllers.js index bb73609..8f0bcdd 100644 --- a/chorem-ui-angular/src/main/webapp/js/choremControllers.js +++ b/chorem-ui-angular/src/main/webapp/js/choremControllers.js @@ -1,5 +1,21 @@ var choremControllers = angular.module('chorem.controllers', ['ui.router']); +choremControllers.controller('HomePageResumeController', function ($scope, $http) { + + $scope.companiesNumber=0; + + $scope.personNumber=0; + + $http.get('services/v1/Company').success(function(data){ + $scope.companiesNumber = data.length; + }); + + $http.get('services/v1/Person').success(function(data){ + $scope.personNumber = data.length; + }); + +}); + choremControllers.controller('HomePageCalendarController', function ($scope) { $scope.date=new Date(); -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch chorem-ng in repository chorem. See http://git.chorem.org/chorem.git commit b2ef1352eb9c3e8e7daa7d35d5239c36db25c70d Author: kootox <jean.couteau@gmail.com> Date: Thu Apr 16 16:35:39 2015 +0200 refs #1211 : Add persons list, filering and navigation --- .../main/webapp/crm/partials/companies.list.html | 2 +- .../main/webapp/crm/partials/personInfoCard.html | 26 ++++ .../src/main/webapp/crm/partials/personPanel.html | 11 ++ .../{companies.list.html => personsList.html} | 20 +-- chorem-ui-angular/src/main/webapp/home.html | 2 +- chorem-ui-angular/src/main/webapp/index.html | 2 +- chorem-ui-angular/src/main/webapp/js/crm/crm.js | 22 ++- .../src/main/webapp/js/crm/crmControllers.js | 153 +++++++++++++++++++++ 8 files changed, 223 insertions(+), 15 deletions(-) diff --git a/chorem-ui-angular/src/main/webapp/crm/partials/companies.list.html b/chorem-ui-angular/src/main/webapp/crm/partials/companies.list.html index d66ea9b..c1795ad 100644 --- a/chorem-ui-angular/src/main/webapp/crm/partials/companies.list.html +++ b/chorem-ui-angular/src/main/webapp/crm/partials/companies.list.html @@ -1,5 +1,5 @@ <div class="bootcards-container"> - <div class="row" ng-controller="CompanyListController"> + <div class="row"> <div class="col-sm-6 bootcards-list" id="list"> <div class="panel panel-default"> <div class="panel-body"> diff --git a/chorem-ui-angular/src/main/webapp/crm/partials/personInfoCard.html b/chorem-ui-angular/src/main/webapp/crm/partials/personInfoCard.html new file mode 100644 index 0000000..59a6fa0 --- /dev/null +++ b/chorem-ui-angular/src/main/webapp/crm/partials/personInfoCard.html @@ -0,0 +1,26 @@ +<div class="panel panel-default"> + <div class="panel-heading clearfix"> + <h3 class="panel-title pull-left">Détails de la personne</h3> + <div class="btn-group pull-right visible-xs"> + <a class="btn btn-primary" href="#/company/{{company.id}}/edit"> + <i class="fa fa-pencil"></i> + <span>Edit</span> + </a> + </div> + <a class="btn btn-primary pull-right hidden-xs" href="#/companies/{{company.id}}/edit"> + <i class="fa fa-pencil"></i> + <span>Edit</span> + </a> + </div> + <div class="list-group"> + <div class="list-group-item"> + <i class="fa fa-2x fa-user pull-left"></i> + <label>Prénom</label> + <h4 class="list-group-item-heading">{{person.Person.firstName}}</h4> + </div> + <div class="list-group-item"> + <label>Nom</label> + <h4 class="list-group-item-heading">{{person.Person.lastName}}</h4> + </div> + </div> +</div> \ No newline at end of file diff --git a/chorem-ui-angular/src/main/webapp/crm/partials/personPanel.html b/chorem-ui-angular/src/main/webapp/crm/partials/personPanel.html new file mode 100644 index 0000000..711ab83 --- /dev/null +++ b/chorem-ui-angular/src/main/webapp/crm/partials/personPanel.html @@ -0,0 +1,11 @@ +<!-- person info card --> +<ng-include src="'crm/partials/personInfoCard.html'"></ng-include> + +<!-- contact details card --> +<ng-include src="'crm/partials/contactDetailsListCard.html'"></ng-include> + +<!-- notes card --> +<ng-include src="'crm/partials/notesListCard.html'"></ng-include> + +<!--employees card --> +<ng-include src="'crm/partials/employeesListCard.html'"></ng-include> \ No newline at end of file diff --git a/chorem-ui-angular/src/main/webapp/crm/partials/companies.list.html b/chorem-ui-angular/src/main/webapp/crm/partials/personsList.html similarity index 67% copy from chorem-ui-angular/src/main/webapp/crm/partials/companies.list.html copy to chorem-ui-angular/src/main/webapp/crm/partials/personsList.html index d66ea9b..843d349 100644 --- a/chorem-ui-angular/src/main/webapp/crm/partials/companies.list.html +++ b/chorem-ui-angular/src/main/webapp/crm/partials/personsList.html @@ -1,5 +1,5 @@ <div class="bootcards-container"> - <div class="row" ng-controller="CompanyListController"> + <div class="row"> <div class="col-sm-6 bootcards-list" id="list"> <div class="panel panel-default"> <div class="panel-body"> @@ -7,13 +7,13 @@ <div class="row"> <div class="col-xs-9"> <div class="form-group"> - <input type="text" class="form-control" placeholder="Search Companies..." + <input type="text" class="form-control" placeholder="Search Persons..." ng-model="searchTerm" ng-change="filter()"> <i class="fa fa-search"></i> </div> </div> <div class="col-xs-3"> - <a class="btn btn-primary btn-block" ui-sref="crm.companies.add"> + <a class="btn btn-primary btn-block" ui-sref="crm.persons.add"> <i class="fa fa-plus"></i> <span>Add</span> </a> @@ -23,13 +23,13 @@ </div> <div class="list-group"> - <a class="list-group-item" href="#/companies/{{company.id}}" - ng-repeat="company in filteredItems" - ng-class="{'active':isItemSelected(company)}" - ng-click="selectItem(company)"> - <i class="fa fa-3x fa-building-o pull-left"></i> - <h4 class="list-group-item-heading">{{company.Company.name}}</h4> - <p class="list-group-item-text">{{company.Company.type}} </p> + <a class="list-group-item" href="#/persons/{{company.id}}" + ng-repeat="person in filteredItems" + ng-class="{'active':isItemSelected(person)}" + ng-click="selectItem(person)"> + <i class="fa fa-3x fa-user pull-left"></i> + <h4 class="list-group-item-heading">{{person.Person.firstName}} {{person.Person.lastName}}</h4> + <p> </p> </a> </div> diff --git a/chorem-ui-angular/src/main/webapp/home.html b/chorem-ui-angular/src/main/webapp/home.html index c2790b0..ac05943 100644 --- a/chorem-ui-angular/src/main/webapp/home.html +++ b/chorem-ui-angular/src/main/webapp/home.html @@ -15,7 +15,7 @@ <div class="panel-body"> <div class="row"> <div class="col-xs-6 col-sm-4"> - <a class="bootcards-summary-item" href="#" style="padding-top:35px;"> + <a class="bootcards-summary-item" ui-sref="crm.persons" style="padding-top:35px;"> <i class="fa fa-3x fa-users"></i> <h4> Personnes diff --git a/chorem-ui-angular/src/main/webapp/index.html b/chorem-ui-angular/src/main/webapp/index.html index 7814bc3..abe885c 100644 --- a/chorem-ui-angular/src/main/webapp/index.html +++ b/chorem-ui-angular/src/main/webapp/index.html @@ -58,7 +58,7 @@ <i class="fa fa-building-o"></i> Sociétés </a></li> - <li><a href="#"> + <li><a ui-sref="crm.persons"> <i class="fa fa-users"></i> Personnes </a></li> diff --git a/chorem-ui-angular/src/main/webapp/js/crm/crm.js b/chorem-ui-angular/src/main/webapp/js/crm/crm.js index b2e42ca..73e2e10 100644 --- a/chorem-ui-angular/src/main/webapp/js/crm/crm.js +++ b/chorem-ui-angular/src/main/webapp/js/crm/crm.js @@ -25,8 +25,26 @@ choremCRM.config( .state('crm.companies.view', { url: '/:companyId', templateUrl: 'crm/partials/companyPanel.html', - controller:'CompanyDetailController' - }); + controller: 'CompanyDetailController' + }) + + .state('crm.persons', { + url: '/persons', + templateUrl: 'crm/partials/personsList.html', + controller: 'PersonListController' + }) + + .state('crm.persons.add', { + url: '/add', + templateUrl: 'crm/partials/personCreateCard.html', + controller:'PersonCreateController' + }) + + .state('crm.persons.view', { + url: '/:personId', + templateUrl: 'crm/partials/personPanel.html', + controller: 'PersonDetailController' + }) }]); diff --git a/chorem-ui-angular/src/main/webapp/js/crm/crmControllers.js b/chorem-ui-angular/src/main/webapp/js/crm/crmControllers.js index da70e5c..6382420 100644 --- a/chorem-ui-angular/src/main/webapp/js/crm/crmControllers.js +++ b/chorem-ui-angular/src/main/webapp/js/crm/crmControllers.js @@ -169,4 +169,157 @@ choremCRMControllers.controller('CompanyCreateController', function ($scope, $ht $window.history.back(); } +}); + +choremCRMControllers.controller('PersonListController', function ($scope, $http, $location, $state) { + + $scope.items = ''; + + $scope.filteredItems = $scope.items; + + $scope.searchTerm=""; + + $scope.selectedItem=$scope.items[0]; + + $scope.targetId=""; + + $scope.setTargetId=function(targetId){ + $scope.targetId=targetId; + } + + $scope.selectItem=function(selectedPerson){ + $scope.selectedItem = selectedPerson; + $state.go('crm.persons.view', { personId: selectedPerson.id }); + }; + + $scope.selectItemById=function(id){ + for (var index in $scope.items) { + var company = $scope.items[index]; + if (company.id===id){ + $scope.selectedItem=company; + } + } + } + + $scope.isItemSelected=function(selectedCompany){ + return selectedCompany===$scope.selectedItem; + }; + + $scope.filter=function(){ + $scope.filteredItems=[]; + for (var index in $scope.items) { + var company = $scope.items[index]; + var regexp = new RegExp($scope.searchTerm,"i"); + if (company.Person.firstName.match(regexp)||company.Person.lastName.match(regexp)){ + $scope.filteredItems.push(company); + } + } + }; + + $scope.updateItem = function(oldItem, newItem) { + for (var index in $scope.items) { + var company = $scope.items[index]; + if (company===oldItem){ + $scope.items[index]=newItem; + } + } + + $scope.filter(); + } + + $scope.addItem = function(newItem) { + $scope.items.push(newItem); + $scope.filter(); + } + + $scope.deleteItem = function(oldItem) { + var index = $scope.items.indexOf(oldItem); + + if (index > -1) { + $scope.items.splice(index, 1); + } + + $scope.filter(); + } + + $scope.refresh=function(){ + $http.get('services/v1/Person').success(function(data){ + $scope.items = data; + $scope.filter(); + }); + }; + + $scope.refresh(); + +}); + +choremCRMControllers.controller('PersonCreateController', function ($scope, $http, $window) { + + $scope.saveCompany = function(){ + $http({ + method : 'PUT', + url : 'companies/add', + data : $.param($scope.company), // pass in data as strings + headers : { 'Content-Type': 'application/x-www-form-urlencoded' } // set the headers so angular passing info as form data (not request payload) + }) + .success(function(data) { + + //update company and selectedItem in parent scope + $scope.addItem(data); + $scope.$parent.selectedItem=data; + + $window.history.back(); + }); + }; + + $scope.cancel = function(){ + $window.history.back(); + } + +}); + +choremCRMControllers.controller('PersonDetailController', function ($scope, $http, $state){ + + $scope.personId=$state.params.personId; + + $scope.updatePerson=function(){ + if ($scope.personId){ + $http.get('services/v1/Person/'+$scope.personId).success(function(data){ + $scope.person = data; + }); + } + }; + + //get back contact details for the person + $scope.updateContactDetails=function(){ + if ($scope.personId){ + $http.get('contactDetails?target='+$scope.companyId).success(function(data){ + $scope.contactDetails = data; + }); + } + }; + + //get back notes for the person + $scope.updateNotes=function(){ + if ($scope.personId){ + $http.get('notes?target='+$scope.personId).success(function(data){ + $scope.notes = data; + }); + } + }; + + //get back companies for the person + $scope.updateEmployees=function(){ + if ($scope.personyId){ + $http.get('employees?person='+$scope.personId).success(function(data){ + $scope.employees = data; + }); + } + }; + + $scope.updatePerson(); + $scope.updateContactDetails(); + $scope.updateNotes(); + $scope.updateEmployees(); + }); \ No newline at end of file -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch chorem-ng in repository chorem. See http://git.chorem.org/chorem.git commit f7df510bda89eae3ba5b21cabfbef82e0c8a6ca6 Author: kootox <jean.couteau@gmail.com> Date: Fri May 29 16:57:36 2015 +0200 Refs #1211 : Improve home page with billing --- chorem-ui-angular/src/main/webapp/home.html | 61 ++++++++++++++++++---- .../src/main/webapp/js/choremControllers.js | 6 +++ 2 files changed, 57 insertions(+), 10 deletions(-) diff --git a/chorem-ui-angular/src/main/webapp/home.html b/chorem-ui-angular/src/main/webapp/home.html index ac05943..f8306c2 100644 --- a/chorem-ui-angular/src/main/webapp/home.html +++ b/chorem-ui-angular/src/main/webapp/home.html @@ -1,5 +1,3 @@ -<h1>Chorem</h1> - <div class="row"> <div class="bootcards-cards"> @@ -34,10 +32,10 @@ </div> <div class="col-xs-6 col-sm-4"> <a class="bootcards-summary-item" href="#" style="padding-top:35px;"> - <i class="fa fa-3x fa-clipboard"></i> + <i class="fa fa-3x fa-eur"></i> <h4> - Notes - <span class="label label-info">40</span> + Factures + <span class="label label-info">{{invoiceNumber}}</span> </h4> </a> </div> @@ -71,15 +69,26 @@ <div class="col-sm-4"> - <div class="panel panel-default bootcards-summary"> + <div class="panel panel-default bootcards-table"> <div class="panel-heading"> - <h3 class="panel-title">Facturation</h3> + <h3 class="panel-title">Facturation client</h3> </div> - <div class="panel-body"> - TODO - </div> + <table class="table table-hover"> + + <thead> + <tr class="active"><th></th><th>Montant</th><th>Nombre</th></tr> + </thead> + + <tbody> + <tr><td>Prévu</td><td>0</td><td>0</td></tr> + <tr><td>Envoyé</td><td>0</td><td>0</td></tr> + <tr><td>En retard</td><td>0</td><td>0</td></tr> + <tr><td><strong>Total</strong></td><td><strong>0</strong></td><td><strong>0</strong></td></tr> + </tbody> + + </table> <div class="panel-footer"> </div> @@ -139,5 +148,37 @@ </div> + + + <div class="col-sm-4"> + + <div class="panel panel-default bootcards-table"> + + <div class="panel-heading"> + <h3 class="panel-title">Facturation fournisseurs</h3> + </div> + + <table class="table table-hover"> + + <thead> + <tr class="active"><th></th><th>Montant</th><th>Nombre</th></tr> + </thead> + + <tbody> + <tr><td>Prévu</td><td>0</td><td>0</td></tr> + <tr><td>Reçu</td><td>0</td><td>0</td></tr> + <tr><td>A payer</td><td>0</td><td>0</td></tr> + <tr><td><strong>Total</strong></td><td><strong>0</strong></td><td><strong>0</strong></td></tr> + </tbody> + + </table> + + <div class="panel-footer"> + </div> + + </div> + + </div> + </div> </div> diff --git a/chorem-ui-angular/src/main/webapp/js/choremControllers.js b/chorem-ui-angular/src/main/webapp/js/choremControllers.js index 8f0bcdd..5ccd5a9 100644 --- a/chorem-ui-angular/src/main/webapp/js/choremControllers.js +++ b/chorem-ui-angular/src/main/webapp/js/choremControllers.js @@ -6,6 +6,8 @@ choremControllers.controller('HomePageResumeController', function ($scope, $http $scope.personNumber=0; + $scope.invoiceNumber=0; + $http.get('services/v1/Company').success(function(data){ $scope.companiesNumber = data.length; }); @@ -14,6 +16,10 @@ choremControllers.controller('HomePageResumeController', function ($scope, $http $scope.personNumber = data.length; }); + $http.get('services/v1/Invoice').success(function(data){ + $scope.invoiceNumber = data.length; + }); + }); choremControllers.controller('HomePageCalendarController', function ($scope) { -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
participants (1)
-
chorem.org scm