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 73963e28de8e5952e880227c806d746295916eb2 Author: kootox <jean.couteau@gmail.com> Date: Thu Jul 2 17:47:15 2015 +0200 refs #1211 : ContactDetails and Note view --- .../crm/partials/contactDetailsListCard.html | 6 ++-- .../webapp/crm/partials/contactDetailsPanel.html | 29 ++++++++++++++++ .../src/main/webapp/crm/partials/notePanel.html | 30 ++++++++++++++++ .../main/webapp/crm/partials/notesListCard.html | 6 ++-- chorem-ui-angular/src/main/webapp/js/crm/crm.js | 12 +++++++ .../src/main/webapp/js/crm/crmControllers.js | 40 +++++++++++++++++++--- 6 files changed, 112 insertions(+), 11 deletions(-) diff --git a/chorem-ui-angular/src/main/webapp/crm/partials/contactDetailsListCard.html b/chorem-ui-angular/src/main/webapp/crm/partials/contactDetailsListCard.html index afd8778..293b644 100644 --- a/chorem-ui-angular/src/main/webapp/crm/partials/contactDetailsListCard.html +++ b/chorem-ui-angular/src/main/webapp/crm/partials/contactDetailsListCard.html @@ -2,21 +2,21 @@ <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.id}}/contactDetails/add" + <a class="btn btn-primary" href="#/crm/companies/{{company.id}}/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/{{companyId}}/contactDetails/add"> + <a class="btn btn-primary pull-right hidden-xs" href="#/crm/companies/{{companyId}}/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/{{companyId}}/contactDetails/{{contact.id}}"> + href="#/crm/companies/{{companyId}}/contactDetails/{{contact.id}}"> <label>{{contact.ContactDetails.type}} - {{contact.ContactDetails.name}}</label> <h4 class="list-group-item-heading">{{contact.ContactDetails.value}}</h4> </a> diff --git a/chorem-ui-angular/src/main/webapp/crm/partials/contactDetailsPanel.html b/chorem-ui-angular/src/main/webapp/crm/partials/contactDetailsPanel.html new file mode 100644 index 0000000..c3a44e5 --- /dev/null +++ b/chorem-ui-angular/src/main/webapp/crm/partials/contactDetailsPanel.html @@ -0,0 +1,29 @@ +<div class="panel panel-default"> + <div class="panel-heading clearfix"> + <h3 class="panel-title pull-left">Détails du contact</h3> + <div class="btn-group pull-right visible-xs"> + <a class="btn btn-primary" href="#/contactDetails/{{contactDetails.id}}/edit"> + <i class="fa fa-pencil"></i> + <span>Edit</span> + </a> + </div> + <a class="btn btn-primary pull-right hidden-xs" href="#/contactDetails/{{contactDetails.id}}/edit"> + <i class="fa fa-pencil"></i> + <span>Edit</span> + </a> + </div> + <div class="list-group"> + <div class="list-group-item"> + <label>Name</label> + <h4 class="list-group-item-heading">{{contactDetails.ContactDetails.name}}</h4> + </div> + <div class="list-group-item"> + <label>Type</label> + <h4 class="list-group-item-heading">{{contactDetails.ContactDetails.type}}</h4> + </div> + <div class="list-group-item"> + <label>Value</label> + <h4 class="list-group-item-heading">{{contactDetails.ContactDetails.value}}</h4> + </div> + </div> +</div> \ No newline at end of file diff --git a/chorem-ui-angular/src/main/webapp/crm/partials/notePanel.html b/chorem-ui-angular/src/main/webapp/crm/partials/notePanel.html new file mode 100644 index 0000000..83902a9 --- /dev/null +++ b/chorem-ui-angular/src/main/webapp/crm/partials/notePanel.html @@ -0,0 +1,30 @@ +<div class="panel panel-default"> + <div class="panel-heading clearfix"> + <h3 class="panel-title pull-left">Détails de la note</h3> + <div class="btn-group pull-right visible-xs"> + <a class="btn btn-primary" href="#/crm/note/{{note.id}}/edit"> + <i class="fa fa-pencil"></i> + <span>Edit</span> + </a> + </div> + <a class="btn btn-primary pull-right hidden-xs" href="#/crm/note/{{note.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-comment pull-left"></i> + <label>Date</label> + <h4 class="list-group-item-heading">{{note.Note.date | date : dd/MM/yyy}}</h4> + </div> + <div class="list-group-item"> + <label>Title</label> + <h4 class="list-group-item-heading">{{note.Note.title}}</h4> + </div> + <div class="list-group-item"> + <label>Content</label> + <h4 class="list-group-item-heading">{{note.Note.content}}</h4> + </div> + </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 index 865ea64..d980b3b 100644 --- a/chorem-ui-angular/src/main/webapp/crm/partials/notesListCard.html +++ b/chorem-ui-angular/src/main/webapp/crm/partials/notesListCard.html @@ -2,18 +2,18 @@ <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.id}}/notes/add"> + <a class="btn btn-primary" href="#/crm/companies/{{company.id}}/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.id}}/notes/add"> + <a class="btn btn-primary pull-right hidden-xs" href="#/crm/companies/{{company.id}}/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.id}}/notes/{{note.id}}"/> + <a class="list-group-item" ng-repeat="note in notes" href="#/crm/companies/{{company.id}}/notes/{{note.id}}"/> <h4 class="list-group-item-heading">{{note.Note.title}}</h4> <label>{{note.Note.date | date : dd/MM/yyy}}</label> </a> 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 73e2e10..488274e 100644 --- a/chorem-ui-angular/src/main/webapp/js/crm/crm.js +++ b/chorem-ui-angular/src/main/webapp/js/crm/crm.js @@ -28,6 +28,18 @@ choremCRM.config( controller: 'CompanyDetailController' }) + .state('crm.companies.viewnote', { + url: '/:companyId/notes/:noteId', + templateUrl: 'crm/partials/notePanel.html', + controller: 'NoteController' + }) + + .state('crm.companies.viewcontactDetails', { + url: '/:companyId/contactDetails/:contactDetailsId', + templateUrl: 'crm/partials/contactDetailsPanel.html', + controller: 'ContactDetailsController' + }) + .state('crm.persons', { url: '/persons', templateUrl: 'crm/partials/personsList.html', 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 f805917..e4efaa3 100644 --- a/chorem-ui-angular/src/main/webapp/js/crm/crmControllers.js +++ b/chorem-ui-angular/src/main/webapp/js/crm/crmControllers.js @@ -293,7 +293,7 @@ choremCRMControllers.controller('PersonDetailController', function ($scope, $htt //get back contact details for the person $scope.updateContactDetails=function(){ if ($scope.personId){ - $http.get('contactDetails?target='+$scope.companyId).success(function(data){ + $http.get('services/v1/ContactDetails?field=target&value='+$scope.personId).success(function(data){ $scope.contactDetails = data; }); } @@ -302,16 +302,16 @@ choremCRMControllers.controller('PersonDetailController', function ($scope, $htt //get back notes for the person $scope.updateNotes=function(){ if ($scope.personId){ - $http.get('notes?target='+$scope.personId).success(function(data){ + $http.get('services/v1/Note?field=target&value='+$scope.personId).success(function(data){ $scope.notes = data; }); } }; - //get back companies for the person + //get back employees for the person $scope.updateEmployees=function(){ - if ($scope.personyId){ - $http.get('employees?person='+$scope.personId).success(function(data){ + if ($scope.personId){ + $http.get('services/v1/Employee?field=company&value='+$scope.personId).success(function(data){ $scope.employees = data; }); } @@ -322,4 +322,34 @@ choremCRMControllers.controller('PersonDetailController', function ($scope, $htt $scope.updateNotes(); $scope.updateEmployees(); +}); + +choremCRMControllers.controller('NoteController', function ($scope, $http, $state){ + + $scope.noteId=$state.params.noteId; + + $scope.updateNote=function(){ + if ($scope.noteId){ + $http.get('services/v1/Note/'+$scope.noteId).success(function(data){ + $scope.note = data; + }); + } + }; + + $scope.updateNote(); +}); + +choremCRMControllers.controller('ContactDetailsController', function ($scope, $http, $state){ + + $scope.contactDetailsId=$state.params.contactDetailsId; + + $scope.updateContactDetails=function(){ + if ($scope.contactDetailsId){ + $http.get('services/v1/ContactDetails/'+$scope.contactDetailsId).success(function(data){ + $scope.contactDetails = data; + }); + } + }; + + $scope.updateContactDetails(); }); \ No newline at end of file -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.