This commit is contained in:
resicovenba 2017-12-09 17:18:39 +05:30
commit c179dcf8c3
8 changed files with 335 additions and 28 deletions

View File

@ -160,6 +160,7 @@ class Calltracking_model extends CI_Model {
$this->db->join(PICK_LIST_DETAILS.' as PLD', 'PLD.ListCode = AVS.StatusName');
$this->db->where('AVS.ActivityID',$activityID);
$this->db->where('AVS.IsActive','1');
$this->db->where('PLD.IsActive','1');
$status = $this->db->get();
return $status->result();
}

View File

@ -209,6 +209,7 @@ class University_model extends CI_Model
$this->db->select('StatusName');
$this->db->where('StatusName',$urow);
$this->db->where('ActivityID',$arrayDetails['ActivityID']);
if($this->db->get(ACTIVITY_STATUS)->first_row()){
$existStatusUpdate['IsActive']=true;
$existStatusUpdate['UpdatedBy']=$arrayDetails['UpdatedBy'];

View File

@ -121,6 +121,7 @@ app.controller("activityCtrl", ["$scope", "toaster", "$filter", "API_POINTS", "$
$scope.loader = '';
$scope.emptyData = '';
$scope.init = function () {
var getActivity = {
method: 'POST',
url: apiPoint.url + 'getActivityDetails/',
@ -133,6 +134,7 @@ app.controller("activityCtrl", ["$scope", "toaster", "$filter", "API_POINTS", "$
};
$http(getActivity).then(function (response) {
if (response.data.status == 200 && response.data.activityStatus) {
$scope.statusList = [];
$scope.emptyData = true;
$scope.loader = true;
$scope.activityInfo = response.data.details;
@ -208,8 +210,9 @@ app.controller("activityCtrl", ["$scope", "toaster", "$filter", "API_POINTS", "$
$scope.ldloading3[loading.replace('-', '_')] = false;
swal("Success!", response.data.message, "success");
$scope.editId = -1;
$scope.init();
$scope.editId = -1;
} else {
$scope.ldloading3[loading.replace('-', '_')] = false;

View File

@ -31,7 +31,7 @@ app.controller('callTrackingCtrl', ["$scope","$rootScope","toaster", "$filter",
$scope.myModel.date=$scope.currentDate;
$scope.search=$scope.currentDate;
$scope.myModel.searchDate=$scope.currentDate;
$scope.myModel.mobile="";
$scope.checkDate = function (value) {
if(value==null || value==undefined){
$scope.search='';
@ -48,8 +48,16 @@ app.controller('callTrackingCtrl', ["$scope","$rootScope","toaster", "$filter",
* edit branch details
* created by kms
* */
$scope.setEditId = function (p,model) {
console.log(model);
$scope.setEditId = function (p,search1,search2,search3,search4,search5) {
$scope.searchData = {
"searchDate": search1,
"searchName": search2,
'serachActivity': search3,
'searchAssignTo': search4,
'searchStatus': search5
}
localStorage.setItem('searchObj', JSON.stringify($scope.searchData));
localStorage.setItem('trackID', p.TrackingID);
localStorage.setItem('count', 0);
$rootScope.followupDetails=p;
@ -222,6 +230,7 @@ app.controller('callTrackingCtrl', ["$scope","$rootScope","toaster", "$filter",
$scope.sort = function(keyname){
$scope.sortKey = keyname; //set the sortKey to the param passed
$scope.reverse = !$scope.reverse; //if true make it false and vice versa
}
@ -296,48 +305,323 @@ app.controller('callTrackingCtrl2', ["$scope","$rootScope","toaster", "$filter",
};
$rootScope.loadFollowupDetails(localStorage.getItem('trackID'));
};
/*
* used to get tracking list
* */
$rootScope.next = function(trackID){
$scope.ListOfTracks=JSON.parse(localStorage.getItem('trackingList'));
$scope.searchedData=JSON.parse(localStorage.getItem('searchObj'));
angular.forEach($scope.ListOfTracks,function (value,key) {
// search date in array list
if(value.TrackingID==trackID){
$scope.nextTrack=$scope.ListOfTracks[key+1];
if($scope.nextTrack!='' && $scope.nextTrack!=undefined){
$rootScope.loadFollowupDetails($scope.nextTrack.TrackingID);
$scope.searchedTrackingList=[];
}
else{
$rootScope.loadFollowupDetails($scope.ListOfTracks[0].TrackingID);
}
if($scope.searchedData.searchDate!='' && $scope.searchedData.searchDate!=null && $scope.searchedData.searchDate!=undefined){
angular.forEach($scope.ListOfTracks,function (value,key) {
if((value.followupDetails)==$scope.searchedData.searchDate){
$scope.searchedTrackingList.push(value);
}
});
}
else{
angular.forEach($scope.ListOfTracks,function (value,key) {
$scope.searchedTrackingList.push(value);
});
}
// search name/mobile in array list
$scope.searchedTrackingList_Name=[];
if($scope.searchedData.searchName!='' && $scope.searchedData.searchName!=null && $scope.searchedData.searchName!=undefined){
$scope.regInteger = /^\d+$/;
if($scope.regInteger.test($scope.searchedData.searchName)){
$scope.searchText = $scope.searchedData.searchName;
angular.forEach($scope.searchedTrackingList, function(item) {
if( item.MobileNumber.indexOf($scope.searchText) >= 0 ){
$scope.searchedTrackingList_Name.push(item);
}
});
}
else{
$scope.searchText = $scope.searchedData.searchName.toLowerCase();
angular.forEach($scope.searchedTrackingList, function(item) {
if( item.LeadName.toLowerCase().indexOf($scope.searchText) >= 0 ){
$scope.searchedTrackingList_Name.push(item);
}
});
}
}
else{
angular.forEach($scope.searchedTrackingList,function (value,key) {
$scope.searchedTrackingList_Name.push(value);
});
}
// serach activity in array list
$scope.searchedTrackingList_Activity=[];
if($scope.searchedData.serachActivity!='' && $scope.searchedData.serachActivity!=null && $scope.searchedData.serachActivity!=undefined){
$scope.searchText_activity = $scope.searchedData.serachActivity.toLowerCase();
angular.forEach($scope.searchedTrackingList_Name, function(item) {
if( item.ActivityName.toLowerCase().indexOf($scope.searchText_activity) >= 0 ){
$scope.searchedTrackingList_Activity.push(item);
}
});
}
else{
angular.forEach($scope.searchedTrackingList_Name,function (value,key) {
$scope.searchedTrackingList_Activity.push(value);
});
}
// serach assigned to in array list
$scope.searchedTrackingList_AssignedTo=[];
if($scope.searchedData.searchAssignTo!='' && $scope.searchedData.searchAssignTo!=null && $scope.searchedData.searchAssignTo!=undefined){
$scope.searchText_assignedTo = $scope.searchedData.searchAssignTo.toLowerCase();
angular.forEach($scope.searchedTrackingList_Activity, function(item) {
if( item.AssignedTo.toLowerCase().indexOf($scope.searchText_assignedTo) >= 0 ){
$scope.searchedTrackingList_AssignedTo.push(item);
}
});
}
else{
angular.forEach($scope.searchedTrackingList_Activity,function (value,key) {
$scope.searchedTrackingList_AssignedTo.push(value);
});
}
// search status in array list
$scope.searchedTrackingList_Status=[];
if($scope.searchedData.searchStatus!='' && $scope.searchedData.searchStatus!=null && $scope.searchedData.searchStatus!=undefined){
$scope.searchText_status = $scope.searchedData.searchStatus.toLowerCase();
angular.forEach($scope.searchedTrackingList_AssignedTo, function(item) {
if( item.statusName.toLowerCase().indexOf($scope.searchText_status) >= 0 ){
$scope.searchedTrackingList_Status.push(item);
}
});
}
else{
angular.forEach($scope.searchedTrackingList_AssignedTo,function (value,key) {
$scope.searchedTrackingList_Status.push(value);
});
}
/*
* used to move next track list in searched array list
* */
angular.forEach($scope.searchedTrackingList_Status,function (value,key) {
if(value.TrackingID==trackID){
$scope.nextTrack=$scope.searchedTrackingList_Status[key+1];
if($scope.nextTrack!='' && $scope.nextTrack!=undefined){
$rootScope.loadFollowupDetails($scope.nextTrack.TrackingID);
}
/* else{
$rootScope.loadFollowupDetails($scope.ListOfTracks[0].TrackingID);
}*/
}
}
});
}
/*
* get previous tracking id
* get previous track list in searched array list
* */
$rootScope.previous = function(trackID){
$scope.ListOfTracksForPre=JSON.parse(localStorage.getItem('trackingList'));
angular.forEach($scope.ListOfTracksForPre,function (value,key) {
$scope.prevListOfTracks=JSON.parse(localStorage.getItem('trackingList'));
$scope.prevsearchedData=JSON.parse(localStorage.getItem('searchObj'));
// search date in array list
$scope.prevsearchedTrackingList=[];
if($scope.prevsearchedData.searchDate!='' && $scope.prevsearchedData.searchDate!=null && $scope.prevsearchedData.searchDate!=undefined){
angular.forEach($scope.prevListOfTracks,function (value,key) {
if((value.followupDetails)==$scope.prevsearchedData.searchDate){
$scope.prevsearchedTrackingList.push(value);
}
});
}
else{
angular.forEach($scope.prevListOfTracks,function (value,key) {
$scope.prevsearchedTrackingList.push(value);
});
}
// search name/mobile in array list
$scope.prevsearchedTrackingList_Name=[];
if($scope.prevsearchedData.searchName!='' && $scope.prevsearchedData.searchName!=null && $scope.prevsearchedData.searchName!=undefined){
$scope.prevregInteger = /^\d+$/;
if($scope.prevregInteger.test($scope.prevsearchedData.searchName)){
$scope.prevsearchText = $scope.prevsearchedData.searchName;
angular.forEach($scope.prevsearchedTrackingList, function(item) {
if( item.MobileNumber.indexOf($scope.prevsearchText) >= 0 ){
$scope.prevsearchedTrackingList_Name.push(item);
}
});
}
else{
$scope.prevsearchText = $scope.prevsearchedData.searchName.toLowerCase();
angular.forEach($scope.prevsearchedTrackingList, function(item) {
if( item.LeadName.toLowerCase().indexOf($scope.prevsearchText) >= 0 ){
$scope.prevsearchedTrackingList_Name.push(item);
}
});
}
}
else{
angular.forEach($scope.prevsearchedTrackingList,function (value,key) {
$scope.prevsearchedTrackingList_Name.push(value);
});
}
// serach activity in array list
$scope.prevsearchedTrackingList_Activity=[];
if($scope.prevsearchedData.serachActivity!='' && $scope.prevsearchedData.serachActivity!=null && $scope.prevsearchedData.serachActivity!=undefined){
$scope.prevsearchText_activity = $scope.prevsearchedData.serachActivity.toLowerCase();
angular.forEach($scope.prevsearchedTrackingList_Name, function(item) {
if( item.ActivityName.toLowerCase().indexOf($scope.prevsearchText_activity) >= 0 ){
$scope.prevsearchedTrackingList_Activity.push(item);
}
});
}
else{
angular.forEach($scope.prevsearchedTrackingList_Name,function (value,key) {
$scope.prevsearchedTrackingList_Activity.push(value);
});
}
// serach assigned to in array list
$scope.prevsearchedTrackingList_AssignedTo=[];
if($scope.prevsearchedData.searchAssignTo!='' && $scope.prevsearchedData.searchAssignTo!=null && $scope.prevsearchedData.searchAssignTo!=undefined){
$scope.prevsearchText_assignedTo = $scope.prevsearchedData.searchAssignTo.toLowerCase();
angular.forEach($scope.prevsearchedTrackingList_Activity, function(item) {
if( item.AssignedTo.toLowerCase().indexOf($scope.prevsearchText_assignedTo) >= 0 ){
$scope.prevsearchedTrackingList_AssignedTo.push(item);
}
});
}
else{
angular.forEach($scope.prevsearchedTrackingList_Activity,function (value,key) {
$scope.prevsearchedTrackingList_AssignedTo.push(value);
});
}
// search status in array list
$scope.prevsearchedTrackingList_Status=[];
if($scope.prevsearchedData.searchStatus!='' && $scope.prevsearchedData.searchStatus!=null && $scope.prevsearchedData.searchStatus!=undefined){
$scope.prevsearchText_status = $scope.prevsearchedData.searchStatus.toLowerCase();
angular.forEach($scope.prevsearchedTrackingList_AssignedTo, function(item) {
if( item.statusName.toLowerCase().indexOf($scope.prevsearchText_status) >= 0 ){
$scope.prevsearchedTrackingList_Status.push(item);
}
});
}
else{
angular.forEach($scope.prevsearchedTrackingList_AssignedTo,function (value,key) {
$scope.prevsearchedTrackingList_Status.push(value);
});
}
/*
* final previous
* result
* */
angular.forEach($scope.prevsearchedTrackingList_Status,function (value,key) {
if(value.TrackingID==trackID){
$scope.prevTrack=$scope.ListOfTracksForPre[key-1];
$scope.prevTrack=$scope.prevsearchedTrackingList_Status[key-1];
if($scope.prevTrack!='' && $scope.prevTrack!=undefined){
$rootScope.loadFollowupDetails($scope.prevTrack.TrackingID);
}
else{
/* else{
console.log($scope.ListOfTracksForPre.length);
$rootScope.loadFollowupDetails($scope.ListOfTracksForPre[$scope.ListOfTracksForPre.length-1].TrackingID);
}
}*/
}

View File

@ -19,4 +19,22 @@ app.directive('compareTo', function () {
});
}
};
});
app.directive('capitalize', function() {
return {
require: 'ngModel',
link: function(scope, element, attrs, modelCtrl) {
var capitalize = function(inputValue) {
if (inputValue == undefined) inputValue = '';
var capitalized = inputValue.toUpperCase();
if (capitalized !== inputValue) {
modelCtrl.$setViewValue(capitalized);
modelCtrl.$render();
}
return capitalized;
}
modelCtrl.$parsers.push(capitalize);
capitalize(scope[attrs.ngModel]); // capitalize initial value
}
};
});

View File

@ -89,19 +89,19 @@
</div>
<div class="col-md-2">
<input class="form-control" type="text" ng-model="myModel.mobile" id="search2" autofocus tabindex="2" placeholder="Search Mobile/Name" />
<input class="form-control" type="text" ng-model="search2" id="search2" autofocus tabindex="2" placeholder="Search Mobile/Name" />
</div>
<!-- Search By Activity-->
<div class="col-md-2 col-md-offset-2">
<input class="form-control" type="text" ng-model="myModel.currentActivity" id="search3" autofocus tabindex="3" placeholder="Search Activity" />
<input class="form-control" type="text" ng-model="search3" id="search3" autofocus tabindex="3" placeholder="Search Activity" />
</div>
<!-- Search By Assign To-->
<div class="col-md-2">
<input class="form-control" type="text" ng-model="myModel.employee" id="search4" autofocus tabindex="4" placeholder="Search Assigned To" />
<input class="form-control" type="text" ng-model="search4" id="search4" autofocus tabindex="4" placeholder="Search Assigned To" />
</div>
<!-- Search By Status-->
<div class="col-md-2">
<input class="form-control" type="text" ng-model="myModel.trackStatus" id="search5" autofocus tabindex="5" placeholder="Search Status" />
<input class="form-control" type="text" ng-model="search5" id="search5" autofocus tabindex="5" placeholder="Search Status" />
</div>
<br><br>
</div>
@ -140,8 +140,8 @@
</tr>
</thead>
<tbody dir-paginate="p in data|orderBy:sortKey:reverse|filter:search:strict|filter:search2:strict| filter:search3:strict| filter:search4:strict| filter:search5:strict|itemsPerPage:10">
<tr ng-click="setEditId(p,myModel);" title="Click to view tracking details">
<td><a class="text-orange" ng-click="setEditId(p,myModel);">{{p.TrackingID}}</a></td>
<tr ng-click="setEditId(p,search,search2,search3,search4,search5);" title="Click to view tracking details">
<td><a class="text-orange" ng-click="setEditId(p,search,search2,search3,search4,search5);">{{p.TrackingID}}</a></td>
<td>{{p.followupDetails }}</td>
<td>{{p.LeadName}}</td>
<td>{{p.MobileNumber}}</td>

2
Apollo/assets/views/editStatusDetails.html Normal file → Executable file
View File

@ -25,7 +25,7 @@
Status Name <span class="symbol required"></span>
</label>
<input type="text" placeholder="Enter Status Name" tabindex="1" class="form-control" name="StatusName" ng-model="p.ListName"
<input type="text" placeholder="Enter Status Name" tabindex="1" class="form-control" name="StatusName" ng-model="p.ListName" capitalize
required/>
<span class="error text-small block" ng-if="Form.ListName.$dirty && Form.ListName.$error.required">status Name is required</span>
<span class="error text-small block" ng-if="Form.ListName.$dirty && Form.ListName.$error.pattern">Invalid status Name </span>

2
Apollo/assets/views/status.html Normal file → Executable file
View File

@ -44,7 +44,7 @@
<input type="text" placeholder="Enter Status Name"
tabindex="1" class="form-control" name="StatusName"
ng-model="myModel.StatusName" ng-pattern="/^[a-zA-Z0-9.\s]*$/" required/>
ng-model="myModel.StatusName" ng-pattern="/^[a-zA-Z0-9.\s]*$/" capitalize required/>
<span class="error text-small block"
ng-if="Form.StatusName.$dirty && Form.StatusName.$error.required">Status name is required</span>
<span class="error text-small block"