mirror of
https://github.com/openMF/community-app.git
synced 2026-02-06 14:26:51 +00:00
SMS Campaign feature implementation
This commit is contained in:
parent
8de8f346de
commit
80d67fd581
@ -158,6 +158,19 @@
|
||||
"label.heading.amountreceivedorreturned": "Amount Received/Returned",
|
||||
"label.heading.totalamountreceivedorreturned": "Total Amount Receivable/Returned",
|
||||
"label.heading.equity": "Equity",
|
||||
"label.heading.campaignname": "Campaign Name",
|
||||
"label.heading.smsProvider": "SMS Provider",
|
||||
"label.heading.templatemsg": "Template Message",
|
||||
"label.heading.campaigntype": "Campaign Type",
|
||||
"label.heading.triggertype": "Trigger Type",
|
||||
"label.heading.approvedby": "Approved By",
|
||||
"label.heading.message": "Message",
|
||||
"label.heading.preview": "Preview",
|
||||
"label.heading.messagedetails": "Message Details",
|
||||
"label.heading.businessRuleParameters": "Business Rule Parameters",
|
||||
"label.heading.templateparameters": "Available Template Parameters",
|
||||
"label.heading.businessRule":"Business Rule",
|
||||
"label.heading.campaignMessage":"Campaign Message",
|
||||
|
||||
"#Menu Links": "..",
|
||||
"label.menu.selectloanofficer": "Select Staff",
|
||||
@ -165,6 +178,10 @@
|
||||
"label.menu.constitution":"Select Constitution",
|
||||
"label.menu.mainBusinessLine":"Select Main Business Line",
|
||||
"label.menu.legalForm":"Select Legal Form",
|
||||
"label.menu.smsProvider":"Select SMS Provider",
|
||||
"label.menu.campaignType":"Select Campaign Type",
|
||||
"label.menu.triggerType":"Select Trigger Type",
|
||||
"label.menu.businessRule":"Select Business Rule",
|
||||
|
||||
"#Anchors": "..",
|
||||
"label.anchor.delete": "Delete",
|
||||
@ -231,6 +248,12 @@
|
||||
"label.input.constitution":"Constitution",
|
||||
"label.input.mainBusinessLine":"Main Business Line",
|
||||
"label.input.remarks":"Remarks",
|
||||
"label.input.campaignName":"Campaign Name",
|
||||
"label.input.campaignType":"Campaign Type",
|
||||
"label.input.triggerType":"Trigger Type",
|
||||
"label.input.businessRule":"Business Rule",
|
||||
"label.input.campaignMessage": "Campaign Message",
|
||||
|
||||
"#Buttons": "..",
|
||||
"label.button.previous": "Previous",
|
||||
"label.button.next": "Next",
|
||||
@ -285,6 +308,7 @@
|
||||
"label.button.pattern": "Pattern",
|
||||
"label.button.dividends": "Dividends",
|
||||
"label.button.postdividends": "Post Dividends",
|
||||
"label.button.proceed": "Proceed",
|
||||
|
||||
"#Misc Labels": "..",
|
||||
"label.uniquelyidentifiedwithid": "Uniquely identified with Id",
|
||||
@ -1033,6 +1057,7 @@
|
||||
"label.input.financial.activity.type":"Financial activity",
|
||||
"label.input.date.of.opening.balances":"Date of opening balances",
|
||||
"label.input.opening.balances.contra.account":"Opening balances contra",
|
||||
"label.input.smsprovider": "SMS Provider",
|
||||
|
||||
"#journalEntryType code ": ".............",
|
||||
"journalEntryType.credit": "Credit",
|
||||
@ -1359,6 +1384,7 @@
|
||||
"label.heading.isTopup" : "Is Topup Loan?",
|
||||
"label.heading.loanIdToClose" : "Loan closed with Topup",
|
||||
"label.heading.topupAmount" : "Topup closure amount",
|
||||
"label.heading.campaign": "Campaign",
|
||||
|
||||
"#Menu Links": "..",
|
||||
"label.menu.rescheduleReason": "Select Reschedule Reason",
|
||||
@ -2470,6 +2496,7 @@
|
||||
"label.view.taxconfiguration" : "Define Tax components and Tax groups",
|
||||
"label.view.taxcomponent" : "Define Tax components",
|
||||
"label.view.taxgroup" : "Define Tax Groups",
|
||||
"label.view.smscampaigns" : "Define SMS Campaigns for Organization",
|
||||
|
||||
"#Enumeration & Error Messages": "..",
|
||||
"validation.msg.currencies.currencies.cannot.be.empty": "You must select at least one currency that is 'allowed' for your organization.",
|
||||
@ -3021,6 +3048,8 @@
|
||||
"label.anchor.recurringdepositproducts":"Recurring Deposit Products",
|
||||
"label.anchor.editrecurringdepositproduct":"Edit Recurring Deposit Product",
|
||||
"label.anchor.createrecurringdepositproduct":"Create Recurring Deposit Product",
|
||||
"label.anchor.smscampaings":"SMS Campaigns",
|
||||
"label.anchor.createcampaign": "Create Campaign",
|
||||
|
||||
"#Inputs": "..",
|
||||
"label.input.selectproduct": "Select product",
|
||||
@ -3162,6 +3191,7 @@
|
||||
"label.button.createtaxcomponent": "Create Tax Component",
|
||||
"label.button.createtaxgroup": "Create Tax Group",
|
||||
"label.button.initiatedividend": "Initiate Dividend",
|
||||
"label.button.createcampaign": "Create Campaign",
|
||||
|
||||
"#Misc Labels": "..",
|
||||
"label.selectproduct": "Select Product",
|
||||
@ -3977,6 +4007,7 @@
|
||||
"label.input.end_date":"End Date",
|
||||
"label.S3.description":"S3 Amazon Service Configuration",
|
||||
"label.SMTP.description":"Email Service Configuration",
|
||||
"label.SMS.description":"SMS Service Configuration",
|
||||
"label.CreditBureau.description":"Credit Bureau Integration",
|
||||
"label.anchor.editExternalServicesConfiguration":"Edit External Service Configuration",
|
||||
"label.anchor.addnewcb":"Add New Credit Bureau",
|
||||
@ -4100,6 +4131,20 @@
|
||||
"RepaymentRescheduleType.move.to.next.working.day":"move to next working day",
|
||||
"RepaymentRescheduleType.move.to.next.repayment.meeting.day":"move to next repayment meeting day",
|
||||
"RepaymentRescheduleType.move.to.previous.working.day":"move to previous working day",
|
||||
"label.heading.loan.foreclosure": "Loan Foreclosure"
|
||||
"label.heading.loan.foreclosure": "Loan Foreclosure",
|
||||
|
||||
"label.input.scheduledate": "Schedule Date",
|
||||
"label.input.scheduletime": "Schedule Time",
|
||||
"label.anchor.editcampaign": "Edit Campaign",
|
||||
"label.menu.repeatsevery": "Repeats Every",
|
||||
"label.menu.repeats": "Repeats",
|
||||
"label.heading.activatesmscampaign": "Activate SMS Campaign",
|
||||
"label.heading.reactivatesmscampaign": "Re Activate SMS Campaign",
|
||||
"label.heading.closesmscampaign": "Close SMS Campaign",
|
||||
"label.heading.deletesmscampaign": "Delete SMS Campaign",
|
||||
"label.heading.campaign": "Campaign",
|
||||
"label.heading.mobilenumber": "Mobile No",
|
||||
|
||||
"": ""
|
||||
|
||||
}
|
||||
|
||||
@ -71,6 +71,7 @@
|
||||
scope.dateformat = 'dd MMMM yyyy';
|
||||
}
|
||||
scope.df = scope.dateformat;
|
||||
scope.dft = scope.dateformat + ' ' + 'HH:mm:ss'
|
||||
};
|
||||
|
||||
scope.updateDf = function(dateFormat){
|
||||
|
||||
@ -0,0 +1,344 @@
|
||||
(function (module) {
|
||||
mifosX.controllers = _.extend(module, {
|
||||
CreateSmsCampaignController: function (scope, WizardHandler, resourceFactory, location, http, dateFilter, API_VERSION, $upload, $rootScope, routeParams) {
|
||||
|
||||
scope.reportParams = new Array();
|
||||
scope.reportDateParams = new Array();
|
||||
scope.reqFields = new Array();
|
||||
scope.reportTextParams = new Array();
|
||||
scope.reportData = {};
|
||||
scope.reportData.columnHeaders = [];
|
||||
scope.reportData.data = [];
|
||||
scope.submissionData = {};
|
||||
|
||||
scope.offices = [];
|
||||
scope.staffs = [];
|
||||
scope.selectedObjects = {};
|
||||
scope.formData = {};
|
||||
scope.formData.client = {};
|
||||
scope.today = new Date();
|
||||
scope.isButtonDisabled = false;
|
||||
scope.triggerTypeOptions = [] ;
|
||||
scope.campaignTypeOptions = [];
|
||||
scope.providerOptions = [] ;
|
||||
scope.businessRules = [] ;
|
||||
scope.campaignData = {};
|
||||
scope.campaignData.campaignMessage = "";
|
||||
scope.previewData = {};
|
||||
scope.filteredBusinessRules = [];
|
||||
var triggeredBusinessRule = [];
|
||||
var nonTriggeredBusinessRule = [];
|
||||
scope.simpleDate = new Date();
|
||||
var simpleTime = new Date(scope.simpleDate.getTime());
|
||||
scope.campaignData.time = new Date(0, 0, 0, simpleTime.getHours(), simpleTime.getMinutes(), simpleTime.getSeconds());
|
||||
|
||||
scope.buildMessageTemplate = function (paramName) {
|
||||
scope.campaignData.campaignMessage += " " + "{{" + paramName + "}}";
|
||||
}
|
||||
|
||||
scope.reportSelected = function (reportName) {
|
||||
scope.reqFields = [] ;
|
||||
scope.reportParams = [] ;
|
||||
scope.reportDateParams = [] ;
|
||||
scope.reportTextParams = [] ;
|
||||
|
||||
resourceFactory.runReportsResource.getReport({reportSource: 'FullParameterList', parameterType: true, R_reportListing: "'" + reportName + "'"}, function (data) {
|
||||
for (var i in data.data) {
|
||||
var temp = {
|
||||
name: data.data[i].row[0],
|
||||
variable: data.data[i].row[1],
|
||||
label: data.data[i].row[2],
|
||||
displayType: data.data[i].row[3],
|
||||
formatType: data.data[i].row[4],
|
||||
defaultVal: data.data[i].row[5],
|
||||
selectOne: data.data[i].row[6],
|
||||
selectAll: data.data[i].row[7],
|
||||
parentParameterName: data.data[i].row[8],
|
||||
inputName: "R_" + data.data[i].row[1] //model name
|
||||
};
|
||||
scope.reqFields.push(temp);
|
||||
if (temp.displayType == 'select' && temp.parentParameterName == null) {
|
||||
intializeParams(temp, {});
|
||||
} else if (temp.displayType == 'date') {
|
||||
scope.reportDateParams.push(temp);
|
||||
} else if (temp.displayType == 'text') {
|
||||
scope.reportTextParams.push(temp);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
} ;
|
||||
scope.getBusinessRule = function() {
|
||||
if (!_.isUndefined(scope.campaignData.triggerType.value) && scope.campaignData.triggerType.value === 'Triggered') {
|
||||
scope.filteredBusinessRules = triggeredBusinessRule;
|
||||
} else {
|
||||
scope.filteredBusinessRules = nonTriggeredBusinessRule;
|
||||
}
|
||||
};
|
||||
|
||||
scope.filterBusinessRule = function() {
|
||||
triggeredBusinessRule = [];
|
||||
nonTriggeredBusinessRule = [];
|
||||
angular.forEach(scope.businessRuleOptions, function (businessRule) {
|
||||
if (!_.isNull(businessRule.reportSubType) && !_.isUndefined(businessRule.reportSubType) && businessRule.reportSubType === 'Triggered') {
|
||||
triggeredBusinessRule.push(businessRule);
|
||||
} else {
|
||||
nonTriggeredBusinessRule.push(businessRule);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
function intializeParams(paramData, params) {
|
||||
scope.errorStatus = undefined;
|
||||
scope.errorDetails = [];
|
||||
params.reportSource = paramData.name;
|
||||
params.parameterType = true;
|
||||
var successFunction = getSuccuessFunction(paramData);
|
||||
resourceFactory.runReportsResource.getReport(params, successFunction);
|
||||
}
|
||||
|
||||
function getSuccuessFunction(paramData) {
|
||||
var tempDataObj = new Object();
|
||||
var successFunction = function (data) {
|
||||
var selectData = [];
|
||||
var isExistedRecord = false;
|
||||
for (var i in data.data) {
|
||||
selectData.push({id: data.data[i].row[0], name: data.data[i].row[1]});
|
||||
}
|
||||
for (var j in scope.reportParams) {
|
||||
if (scope.reportParams[j].name == paramData.name) {
|
||||
scope.reportParams[j].selectOptions = selectData;
|
||||
isExistedRecord = true;
|
||||
}
|
||||
}
|
||||
if (!isExistedRecord) {
|
||||
if(paramData.selectAll == 'Y'){
|
||||
selectData.push({id: "-1", name: "All"});
|
||||
}
|
||||
paramData.selectOptions = selectData;
|
||||
scope.reportParams.push(paramData);
|
||||
}
|
||||
};
|
||||
return successFunction;
|
||||
}
|
||||
|
||||
scope.getDependencies = function (paramData) {
|
||||
for (var i = 0; i < scope.reqFields.length; i++) {
|
||||
var temp = scope.reqFields[i];
|
||||
if (temp.parentParameterName == paramData.name) {
|
||||
if (temp.displayType == 'select') {
|
||||
var parentParamValue = this.formData[paramData.inputName];
|
||||
if (parentParamValue != undefined) {
|
||||
eval("var params={};params." + paramData.inputName + "='" + parentParamValue + "';");
|
||||
intializeParams(temp, params);
|
||||
}
|
||||
} else if (temp.displayType == 'date') {
|
||||
scope.reportDateParams.push(temp);
|
||||
}
|
||||
}
|
||||
}
|
||||
resourceFactory.reportsResource.get({id: scope.campaignData.report.reportId, fields: 'reportParameters'}, function (data) {
|
||||
scope.smsReportParameters = data.reportParameters || [];
|
||||
});
|
||||
};
|
||||
|
||||
scope.getColumnHeaders = function () {
|
||||
//scope.formData = scope.reportParams;
|
||||
// if (scope.campaignData.triggerType.value != 'Triggered') {
|
||||
scope.formData.reportSource = scope.campaignData.report.reportName;
|
||||
// var inQueryParameters = buildReportParms();
|
||||
//scope.formData = inQueryParameters;
|
||||
|
||||
for (var i = 0; i < scope.reqFields.length; i++) {
|
||||
var tempForm = {} ;
|
||||
var tempParam = scope.reqFields[i];
|
||||
if (tempParam.displayType == 'none') {
|
||||
var paramName = tempParam.variable;
|
||||
scope.formData[tempParam.inputName] = -1 ;
|
||||
}
|
||||
}
|
||||
resourceFactory.runReportsResource.getReport(scope.formData, function (data) {
|
||||
// get column headers for the given report
|
||||
scope.reportData.columnHeaders = data.columnHeaders;
|
||||
});
|
||||
// }
|
||||
};
|
||||
|
||||
function buildPreviewParms() {
|
||||
var paramCount = 1;
|
||||
var reportParams = "{";
|
||||
for (var i = 0; i < scope.reqFields.length; i++) {
|
||||
var reqField = scope.reqFields[i];
|
||||
for (var j = 0; j < scope.smsReportParameters.length; j++) {
|
||||
var tempParam = scope.smsReportParameters[j];
|
||||
if (reqField.name == tempParam.parameterName) {
|
||||
var paramName = reqField.variable;
|
||||
if (paramCount > 1) reportParams += ","
|
||||
reportParams += '\"' + paramName + '\"' + ":" + scope.formData[scope.reqFields[i].inputName];
|
||||
paramCount = paramCount + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
reportParams += "}"
|
||||
return reportParams;
|
||||
};
|
||||
|
||||
scope.previewMessage = function() {
|
||||
scope.paramValues = {};
|
||||
scope.paramValues = angular.fromJson(buildPreviewParms());
|
||||
scope.paramValues.reportName = scope.formData.reportSource;
|
||||
scope.previewData = {
|
||||
message: scope.campaignData.campaignMessage,
|
||||
paramValue: scope.paramValues
|
||||
};
|
||||
resourceFactory.smsCampaignResource.preview({additionalParam: 'preview'}, scope.previewData, function (data) {
|
||||
scope.previewMessage = data.campaignMessage;
|
||||
scope.totalNumberOfMessages = data.totalNumberOfMessages;
|
||||
});
|
||||
}
|
||||
|
||||
function buildReportParms() {
|
||||
var paramCount = 1;
|
||||
var reportParams = "";
|
||||
for (var i = 0; i < scope.reqFields.length; i++) {
|
||||
var reqField = scope.reqFields[i];
|
||||
for (var j = 0; j < scope.smsReportParameters.length; j++) {
|
||||
var tempParam = scope.smsReportParameters[j];
|
||||
if (reqField.name == tempParam.parameterName) {
|
||||
if(reqField.displayType == 'none') {
|
||||
var paramName = 'R_' + tempParam.reportParameterName;
|
||||
if (paramCount > 1) reportParams += ","
|
||||
reportParams += encodeURIComponent(paramName) + ":" + encodeURIComponent("-1");
|
||||
paramCount = paramCount + 1;
|
||||
}else {
|
||||
var paramName = 'R_' + tempParam.reportParameterName;
|
||||
if (paramCount > 1) reportParams += ","
|
||||
reportParams += encodeURIComponent(paramName) + ":" + encodeURIComponent(scope.formData[scope.reqFields[i].inputName]);
|
||||
paramCount = paramCount + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/*for (var i = 0; i < scope.reqFields.length; i++) {
|
||||
var tempParam = scope.reqFields[i];
|
||||
if (tempParam.displayType == 'none') {
|
||||
reportParams += ","
|
||||
reportParams += encodeURIComponent(tempParam.inputName) + ":" + encodeURIComponent("-1");
|
||||
}
|
||||
}*/
|
||||
return reportParams;
|
||||
};
|
||||
|
||||
resourceFactory.smsCampaignTemplateResource.get(function (data) {
|
||||
scope.triggerTypeOptions = data.triggerTypeOptions ;
|
||||
scope.campaignTypeOptions = data.campaignTypeOptions;
|
||||
scope.providerOptions = data.smsProviderOptions ;
|
||||
scope.businessRuleOptions = data.businessRulesOptions ;
|
||||
scope.frequencyTypeOptions = data.frequencyTypeOptions;
|
||||
scope.weekDays = data.weekDays;
|
||||
scope.filterBusinessRule();
|
||||
//scope.months = data.months;
|
||||
//scope.periodFrequencyOptions = data.periodFrequencyOptions;
|
||||
|
||||
resourceFactory.groupResource.get({groupId: routeParams.groupId, template: true}, function (data) {
|
||||
scope.formData.client.staffId = data.staffId;
|
||||
scope.centerId = data.centerId;
|
||||
scope.staffs = data.staffOptions;
|
||||
scope.changeStaff(data.staffId);
|
||||
scope.formData.client.officeId = data.officeId;
|
||||
scope.minActivationDate = data.activationDate;
|
||||
});
|
||||
});
|
||||
|
||||
scope.changeStaff = function (staffId) {
|
||||
resourceFactory.employeeResource.get({staffInSelectedOfficeOnly:true, associations:'all', staffId: staffId}, function (data) {
|
||||
scope.linkedvillages = data.linkedVillages;
|
||||
});
|
||||
};
|
||||
|
||||
scope.selectedPeriod = function (period) {
|
||||
if (period == 1) {
|
||||
scope.repeatsEveryOptions = ["1", "2", "3"];
|
||||
scope.periodValue = "day(s)"
|
||||
}
|
||||
if (period == 2) {
|
||||
scope.repeatsEveryOptions = ["1", "2", "3"];
|
||||
scope.periodValue = "week(s)";
|
||||
scope.campaignData.repeatsOnDay = '1';
|
||||
scope.repeatsOnOptions = scope.weekDays;
|
||||
}
|
||||
if (period == 3) {
|
||||
scope.periodValue = "month(s)";
|
||||
scope.repeatsEveryOptions = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11"];
|
||||
}
|
||||
if (period == 4) {
|
||||
scope.periodValue = "year(s)";
|
||||
scope.repeatsEveryOptions = ["1", "2", "3", "4", "5"];
|
||||
}
|
||||
};
|
||||
|
||||
scope.noOfTabs = 3;
|
||||
scope.step = '-';
|
||||
|
||||
scope.submit = function () {
|
||||
//onclick Disable proceed button to avoid multiple cilent creation
|
||||
setDisableTimeout();
|
||||
|
||||
if (WizardHandler.wizard().getCurrentStep() != scope.noOfTabs) {
|
||||
WizardHandler.wizard().next();
|
||||
/*if (WizardHandler.wizard().getCurrentStep() == 2) {
|
||||
if (scope.validateFiles())
|
||||
WizardHandler.wizard().next();
|
||||
} else {
|
||||
WizardHandler.wizard().next();
|
||||
}*/
|
||||
return;
|
||||
}
|
||||
|
||||
if (scope.campaignData.triggerType.value === 'Scheduled') {
|
||||
scope.scheduledDateTime = scope.campaignData.recurrenceStartDate;
|
||||
scope.scheduledDateTime.setHours(scope.campaignData.time.getHours());
|
||||
scope.scheduledDateTime.setMinutes(scope.campaignData.time.getMinutes());
|
||||
scope.scheduledDateTime.setSeconds(scope.campaignData.time.getSeconds());
|
||||
scope.scheduledDateTime = dateFilter(scope.scheduledDateTime, scope.dft);
|
||||
}
|
||||
//dateFilter(scope.campaignData.recurrenceStartDate, scope.df) + ' ' + scope.campaignData.time.getHours() + ':' + scope.campaignData.time.getMinutes() + ':' + scope.campaignData.time.getSeconds();
|
||||
scope.submissionData = {
|
||||
providerId: scope.campaignData.smsProvider.id,
|
||||
//runReportId: scope.campaignData.report.reportId,
|
||||
triggerType: scope.campaignData.triggerType.id,
|
||||
campaignName: scope.campaignData.campaignName,
|
||||
campaignType: 1,
|
||||
message: scope.campaignData.campaignMessage,
|
||||
//paramValue: scope.paramValues,
|
||||
dateFormat: scope.df,
|
||||
locale: scope.optlang.code,
|
||||
submittedOnDate: dateFilter(new Date(), scope.df),
|
||||
recurrenceStartDate: scope.scheduledDateTime,
|
||||
dateTimeFormat: scope.dft,
|
||||
frequency: scope.campaignData.frequency,
|
||||
interval: scope.campaignData.repeatsEvery,
|
||||
repeatsOnDay: scope.campaignData.repeatsOnDay
|
||||
}
|
||||
|
||||
scope.submissionData.runReportId = scope.campaignData.report.reportId;
|
||||
scope.submissionData.paramValue = scope.paramValues;
|
||||
|
||||
resourceFactory.smsCampaignResource.save(scope.submissionData, function(data) {
|
||||
location.path('/viewsmscampaign/' + data.resourceId);
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
var setDisableTimeout = function(){
|
||||
scope.isButtonDisabled = true;
|
||||
setTimeout(function(){
|
||||
scope.isButtonDisabled = false;
|
||||
}, 5000);
|
||||
}
|
||||
}
|
||||
});
|
||||
mifosX.ng.application.controller('CreateSmsCampaignController', ['$scope', 'WizardHandler', 'ResourceFactory', '$location', '$http', 'dateFilter', 'API_VERSION', '$upload', '$rootScope', '$routeParams', mifosX.controllers.CreateSmsCampaignController]).run(function ($log) {
|
||||
$log.info("CreateSmsCampaignController initialized");
|
||||
});
|
||||
}(mifosX.controllers || {}));
|
||||
@ -0,0 +1,247 @@
|
||||
(function (module) {
|
||||
mifosX.controllers = _.extend(module, {
|
||||
EditSmsCampaignController: function (scope, WizardHandler, resourceFactory, location, http, dateFilter, API_VERSION, $upload, $rootScope, routeParams, $modal) {
|
||||
|
||||
scope.reportParams = new Array();
|
||||
scope.reportDateParams = new Array();
|
||||
scope.reqFields = new Array();
|
||||
scope.reportTextParams = new Array();
|
||||
scope.reportData = {};
|
||||
scope.reportData.columnHeaders = [];
|
||||
scope.reportData.data = [];
|
||||
|
||||
scope.offices = [];
|
||||
scope.staffs = [];
|
||||
scope.selectedObjects = {};
|
||||
scope.formData = {};
|
||||
scope.formData.client = {};
|
||||
scope.today = new Date();
|
||||
scope.isButtonDisabled = false;
|
||||
scope.triggerTypeOptions = [] ;
|
||||
scope.campaignTypeOptions = [];
|
||||
scope.providerOptions = [] ;
|
||||
scope.businessRules = [] ;
|
||||
scope.campaignData = {};
|
||||
|
||||
scope.buildMessageTemplate = function (paramName) {
|
||||
scope.campaignData.campaignMessage += " " + "{{" + paramName + "}}";
|
||||
}
|
||||
|
||||
scope.reportSelected = function (reportName) {
|
||||
scope.reqFields = [] ;
|
||||
scope.reportParams = [] ;
|
||||
scope.reportDateParams = [] ;
|
||||
scope.reportTextParams = [] ;
|
||||
|
||||
resourceFactory.runReportsResource.getReport({reportSource: 'FullParameterList', parameterType: true, R_reportListing: "'" + reportName + "'"}, function (data) {
|
||||
for (var i in data.data) {
|
||||
var temp = {
|
||||
name: data.data[i].row[0],
|
||||
variable: data.data[i].row[1],
|
||||
label: data.data[i].row[2],
|
||||
displayType: data.data[i].row[3],
|
||||
formatType: data.data[i].row[4],
|
||||
defaultVal: data.data[i].row[5],
|
||||
selectOne: data.data[i].row[6],
|
||||
selectAll: data.data[i].row[7],
|
||||
parentParameterName: data.data[i].row[8],
|
||||
inputName: "R_" + data.data[i].row[1] //model name
|
||||
};
|
||||
scope.reqFields.push(temp);
|
||||
if (temp.displayType == 'select' && temp.parentParameterName == null) {
|
||||
intializeParams(temp, {});
|
||||
} else if (temp.displayType == 'date') {
|
||||
scope.reportDateParams.push(temp);
|
||||
} else if (temp.displayType == 'text') {
|
||||
scope.reportTextParams.push(temp);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
} ;
|
||||
|
||||
resourceFactory.smsCampaignResource.get({campaignId: routeParams.campaignId}, function (data) {
|
||||
//scope.campaignData = data;
|
||||
scope.campaignData.id = data.id;
|
||||
scope.campaignData.campaignName = data.campaignName;
|
||||
scope.campaignData.campaignMessage = data.campaignMessage;
|
||||
scope.campaignData.smsProvider = data.providerId;
|
||||
scope.campaignData.triggerType = data.triggerType.id;
|
||||
scope.campaignData.campaignType = data.campaignType.id;
|
||||
scope.campaignData.report = data.runReportId;
|
||||
scope.campaignData.reportName = data.reportName;
|
||||
scope.reportSelected(scope.campaignData.reportName);
|
||||
scope.paramValues = angular.fromJson(data.paramValue);
|
||||
scope.simpleDate = new Date(data.recurrenceStartDate);
|
||||
var simpleTime = new Date(scope.simpleDate.getTime());
|
||||
scope.campaignData.recurrenceStartDate = dateFilter(scope.simpleDate, scope.df);
|
||||
scope.campaignData.time = new Date(0, 0, 0, simpleTime.getHours(), simpleTime.getMinutes(), simpleTime.getSeconds());
|
||||
prepopulateReportParams();
|
||||
});
|
||||
|
||||
function prepopulateReportParams() {
|
||||
if (!_.isUndefined(scope.paramValues)) {
|
||||
var obj = scope.paramValues;
|
||||
for (var key in obj) {
|
||||
console.log(' name=' + key + ' value=' + obj[key]);
|
||||
scope.formData["R_" + key] = String(obj[key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function intializeParams(paramData, params) {
|
||||
scope.errorStatus = undefined;
|
||||
scope.errorDetails = [];
|
||||
params.reportSource = paramData.name;
|
||||
params.parameterType = true;
|
||||
var successFunction = getSuccuessFunction(paramData);
|
||||
resourceFactory.runReportsResource.getReport(params, successFunction);
|
||||
}
|
||||
|
||||
function getSuccuessFunction(paramData) {
|
||||
var tempDataObj = new Object();
|
||||
var successFunction = function (data) {
|
||||
var selectData = [];
|
||||
var isExistedRecord = false;
|
||||
for (var i in data.data) {
|
||||
selectData.push({id: data.data[i].row[0], name: data.data[i].row[1]});
|
||||
}
|
||||
for (var j in scope.reportParams) {
|
||||
if (scope.reportParams[j].name == paramData.name) {
|
||||
scope.reportParams[j].selectOptions = selectData;
|
||||
isExistedRecord = true;
|
||||
}
|
||||
}
|
||||
if (!isExistedRecord) {
|
||||
if(paramData.selectAll == 'Y'){
|
||||
selectData.push({id: "-1", name: "All"});
|
||||
}
|
||||
paramData.selectOptions = selectData;
|
||||
scope.reportParams.push(paramData);
|
||||
}
|
||||
};
|
||||
return successFunction;
|
||||
}
|
||||
|
||||
scope.getDependencies = function (paramData) {
|
||||
for (var i = 0; i < scope.reqFields.length; i++) {
|
||||
var temp = scope.reqFields[i];
|
||||
if (temp.parentParameterName == paramData.name) {
|
||||
if (temp.displayType == 'select') {
|
||||
var parentParamValue = this.formData[paramData.inputName];
|
||||
if (parentParamValue != undefined) {
|
||||
eval("var params={};params." + paramData.inputName + "='" + parentParamValue + "';");
|
||||
intializeParams(temp, params);
|
||||
}
|
||||
} else if (temp.displayType == 'date') {
|
||||
scope.reportDateParams.push(temp);
|
||||
}
|
||||
}
|
||||
}
|
||||
resourceFactory.reportsResource.get({id: scope.campaignData.report, fields: 'reportParameters'}, function (data) {
|
||||
scope.smsReportParameters = data.reportParameters || [];
|
||||
scope.getColumnHeaders();
|
||||
});
|
||||
};
|
||||
|
||||
scope.getColumnHeaders = function () {
|
||||
//scope.formData = scope.reportParams;
|
||||
scope.formData.reportSource = scope.campaignData.reportName;
|
||||
var inQueryParameters = buildReportParms();
|
||||
//scope.formData = inQueryParameters;
|
||||
resourceFactory.runReportsResource.getReport(scope.formData, function (data) {
|
||||
// get column headers for the given report
|
||||
scope.reportData.columnHeaders = data.columnHeaders;
|
||||
});
|
||||
};
|
||||
|
||||
function buildReportParms() {
|
||||
var paramCount = 1;
|
||||
var reportParams = "";
|
||||
for (var i = 0; i < scope.reqFields.length; i++) {
|
||||
var reqField = scope.reqFields[i];
|
||||
for (var j = 0; j < scope.smsReportParameters.length; j++) {
|
||||
var tempParam = scope.smsReportParameters[j];
|
||||
if (reqField.name == tempParam.parameterName) {
|
||||
var paramName = 'R_' + tempParam.reportParameterName;
|
||||
if (paramCount > 1) reportParams += ","
|
||||
reportParams += encodeURIComponent(paramName) + ":" + encodeURIComponent(scope.formData[scope.reqFields[i].inputName]);
|
||||
paramCount = paramCount + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
return reportParams;
|
||||
};
|
||||
|
||||
resourceFactory.smsCampaignTemplateResource.get(function (data) {
|
||||
scope.triggerTypeOptions = data.triggerTypeOptions ;
|
||||
scope.campaignTypeOptions = data.campaignTypeOptions;
|
||||
scope.providerOptions = data.smsProviderOptions ;
|
||||
scope.businessRuleOptions = data.businessRulesOptions ;
|
||||
|
||||
resourceFactory.groupResource.get({groupId: routeParams.groupId, template: true}, function (data) {
|
||||
scope.formData.client.staffId = data.staffId;
|
||||
scope.centerId = data.centerId;
|
||||
scope.staffs = data.staffOptions;
|
||||
scope.changeStaff(data.staffId);
|
||||
scope.formData.client.officeId = data.officeId;
|
||||
scope.minActivationDate = data.activationDate;
|
||||
});
|
||||
});
|
||||
|
||||
scope.changeStaff = function (staffId) {
|
||||
resourceFactory.employeeResource.get({staffInSelectedOfficeOnly:true, associations:'all', staffId: staffId}, function (data) {
|
||||
scope.linkedvillages = data.linkedVillages;
|
||||
});
|
||||
};
|
||||
|
||||
scope.noOfTabs = 3;
|
||||
scope.step = '-';
|
||||
|
||||
scope.submit = function () {
|
||||
//scope.simpleDate = new Date(scope.campaignData.recurrenceStartDate);
|
||||
//var simpleTime = new Date(scope.simpleDate.getTime());
|
||||
//scope.campaignData.recurrenceStartDate = dateFilter(scope.simpleDate, scope.df);
|
||||
//scope.campaignData.time = new Date(0, 0, 0, simpleTime.getHours(), simpleTime.getMinutes(), simpleTime.getSeconds());
|
||||
if (scope.campaignData.triggerType === 2) {
|
||||
scope.scheduledDateTime = new Date(scope.campaignData.recurrenceStartDate);
|
||||
scope.scheduledDateTime.setHours(scope.campaignData.time.getHours());
|
||||
scope.scheduledDateTime.setMinutes(scope.campaignData.time.getMinutes());
|
||||
scope.scheduledDateTime.setSeconds(scope.campaignData.time.getSeconds());
|
||||
scope.scheduledDateTime = dateFilter(scope.scheduledDateTime, scope.dft);
|
||||
}
|
||||
|
||||
scope.submissionData = {
|
||||
providerId: scope.campaignData.smsProvider,
|
||||
//runReportId: scope.campaignData.report,
|
||||
triggerType: scope.campaignData.triggerType,
|
||||
campaignName: scope.campaignData.campaignName,
|
||||
campaignType: scope.campaignData.campaignType,
|
||||
message: scope.campaignData.campaignMessage,
|
||||
//paramValue: scope.paramValues,
|
||||
dateFormat: scope.df,
|
||||
locale: scope.optlang.code,
|
||||
recurrenceStartDate: scope.scheduledDateTime,
|
||||
dateTimeFormat: scope.dft,
|
||||
runReportId : scope.campaignData.report,
|
||||
paramValue : scope.paramValues
|
||||
}
|
||||
|
||||
resourceFactory.smsCampaignResource.update({campaignId: routeParams.campaignId}, scope.submissionData, function(data) {
|
||||
location.path('/viewsmscampaign/' + routeParams.campaignId);
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
var setDisableTimeout = function() {
|
||||
scope.isButtonDisabled = true;
|
||||
setTimeout(function(){
|
||||
scope.isButtonDisabled = false;
|
||||
}, 5000);
|
||||
}
|
||||
}
|
||||
});
|
||||
mifosX.ng.application.controller('EditSmsCampaignController', ['$scope', 'WizardHandler', 'ResourceFactory', '$location', '$http', 'dateFilter', 'API_VERSION', '$upload', '$rootScope', '$routeParams', '$modal', mifosX.controllers.EditSmsCampaignController]).run(function ($log) {
|
||||
$log.info("EditSmsCampaignController initialized");
|
||||
});
|
||||
}(mifosX.controllers || {}));
|
||||
@ -0,0 +1,37 @@
|
||||
(function (module) {
|
||||
mifosX.controllers = _.extend(module, {
|
||||
SmsCampaignsController: function (scope, resourceFactory, location, dateFilter, translate) {
|
||||
scope.template = [];
|
||||
scope.formData = {};
|
||||
scope.first = {};
|
||||
scope.isCollapsed = true;
|
||||
scope.showdatefield = false;
|
||||
scope.repeatEvery = false;
|
||||
scope.first.date = new Date();
|
||||
scope.translate = translate;
|
||||
scope.criterias = [];
|
||||
|
||||
scope.routeTo = function (id) {
|
||||
location.path('/viewsmscampaign/' + id);
|
||||
};
|
||||
|
||||
if (!scope.searchCriteria.criterias) {
|
||||
scope.searchCriteria.criterias = null;
|
||||
scope.saveSC();
|
||||
}
|
||||
|
||||
scope.filterText = scope.searchCriteria.criterias;
|
||||
|
||||
scope.onFilter = function () {
|
||||
scope.searchCriteria.criterias = scope.filterText;
|
||||
scope.saveSC();
|
||||
};
|
||||
resourceFactory.smsCampaignResource.getAll(function (data) {
|
||||
scope.smsCampaigns = data;
|
||||
});
|
||||
}
|
||||
});
|
||||
mifosX.ng.application.controller('SmsCampaignsController', ['$scope', 'ResourceFactory', '$location', 'dateFilter', '$translate', mifosX.controllers.SmsCampaignsController]).run(function ($log) {
|
||||
$log.info("SmsCampaignsController initialized");
|
||||
});
|
||||
}(mifosX.controllers || {}));
|
||||
@ -0,0 +1,141 @@
|
||||
(function (module) {
|
||||
mifosX.controllers = _.extend(module, {
|
||||
ViewSmsCampaignController: function (scope, routeParams, location, resourceFactory, $modal, dateFilter, route, paginatorService) {
|
||||
scope.tabsList = [{id: 'pending', name: 'Pending SMS', status: 100}, {id: 'sent', name: 'Sent SMS', status: 200}, {id: 'delivered', name: 'Delivered SMS', status: 300}, {id: 'failed', name: 'Failed SMS', status: 400}];
|
||||
scope.smsList = [];
|
||||
scope.formData = {};
|
||||
scope.smsPerPage = 14;
|
||||
resourceFactory.smsCampaignResource.get({campaignId: routeParams.campaignId}, function (data) {
|
||||
scope.campaignData = data;
|
||||
});
|
||||
|
||||
scope.resetSMSList = function() {
|
||||
scope.smsList = [];
|
||||
}
|
||||
|
||||
scope.activateSmsCampaign = function () {
|
||||
$modal.open({
|
||||
templateUrl: 'activatesmscampaign.html',
|
||||
controller: SmsCampaignActivationCtrl
|
||||
});
|
||||
};
|
||||
|
||||
var fetchFunction = function (offset, limit) {
|
||||
var params = {};
|
||||
params.status = scope.selectedStatus;
|
||||
params.offset = offset;
|
||||
params.limit = limit;
|
||||
params.locale = scope.optlang.code;
|
||||
params.dateFormat = scope.df;
|
||||
params.campaignId = routeParams.campaignId;
|
||||
|
||||
if (scope.formData.fromDate) {
|
||||
var reqFirstDate = dateFilter(scope.formData.fromDate, scope.df);
|
||||
params.fromDate = reqFirstDate;
|
||||
}
|
||||
|
||||
if (scope.formData.toDate) {
|
||||
var reqSecondDate = dateFilter(scope.formData.toDate, scope.df);
|
||||
params.toDate = reqSecondDate;
|
||||
}
|
||||
scope.formParams = params;
|
||||
|
||||
resourceFactory.smsResource.getByStatus(params, function(data) {
|
||||
scope.smsList = data.pageItems;
|
||||
scope.totalSMS = data.totalFilteredRecords;
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
scope.getResultsPage = function (pageNumber) {
|
||||
scope.formParams.offset = ((pageNumber - 1) * scope.smsPerPage);
|
||||
scope.formParams.limit = scope.smsPerPage;
|
||||
resourceFactory.smsResource.getByStatus(scope.formParams, function (data) {
|
||||
scope.smsList = data.pageItems;
|
||||
});
|
||||
}
|
||||
|
||||
scope.fetchSMSByStatus = function (status) {
|
||||
scope.selectedStatus = status;
|
||||
paginatorService.paginate(fetchFunction, scope.smsPerPage);
|
||||
};
|
||||
|
||||
var SmsCampaignActivationCtrl = function ($scope, $modalInstance) {
|
||||
//$scope.data = {activationDate: scope.activationDate};
|
||||
$scope.activate = function () {
|
||||
//$scope.activationDate = scope.activationDate;
|
||||
$scope.activationData = {activationDate: dateFilter($scope.activationDate, scope.df), dateFormat: scope.df, locale: scope.optlang.code}
|
||||
resourceFactory.smsCampaignResource.withCommand({campaignId: routeParams.campaignId, command: 'activate'}, $scope.activationData, function (data) {
|
||||
$modalInstance.close('activate');
|
||||
route.reload();
|
||||
});
|
||||
};
|
||||
$scope.cancel = function () {
|
||||
$modalInstance.dismiss('cancel');
|
||||
};
|
||||
};
|
||||
|
||||
scope.closeSmsCampaign = function () {
|
||||
$modal.open({
|
||||
templateUrl: 'closesmscampaign.html',
|
||||
controller: SmsCampaignCloseCtrl
|
||||
});
|
||||
};
|
||||
|
||||
var SmsCampaignCloseCtrl = function ($scope, $modalInstance) {
|
||||
$scope.closeSms = function () {
|
||||
$scope.closureData = {closureDate: dateFilter($scope.closureDate, scope.df), dateFormat: scope.df, locale: scope.optlang.code}
|
||||
resourceFactory.smsCampaignResource.withCommand({campaignId: routeParams.campaignId, command: 'close'}, $scope.closureData, function (data) {
|
||||
$modalInstance.close('close');
|
||||
route.reload();
|
||||
});
|
||||
};
|
||||
$scope.cancel = function () {
|
||||
$modalInstance.dismiss('cancel');
|
||||
};
|
||||
};
|
||||
|
||||
scope.reActivateSmsCampaign = function () {
|
||||
$modal.open({
|
||||
templateUrl: 'reactivatesmscampaign.html',
|
||||
controller: SmsCampaignReActivateCtrl
|
||||
});
|
||||
};
|
||||
|
||||
var SmsCampaignReActivateCtrl = function ($scope, $modalInstance) {
|
||||
$scope.reactivate = function () {
|
||||
$scope.reActivationData = {activationDate: dateFilter($scope.activationDate, scope.df), dateFormat: scope.df, locale: scope.optlang.code}
|
||||
resourceFactory.smsCampaignResource.withCommand({campaignId: routeParams.campaignId, command: 'reactivate'}, $scope.reActivationData, function (data) {
|
||||
$modalInstance.close('reactivate');
|
||||
route.reload();
|
||||
});
|
||||
};
|
||||
$scope.cancel = function () {
|
||||
$modalInstance.dismiss('cancel');
|
||||
};
|
||||
};
|
||||
|
||||
scope.deleteSmsCampaign = function () {
|
||||
$modal.open({
|
||||
templateUrl: 'deletesmscampaign.html',
|
||||
controller: SmsCampaignDeleteCtrl
|
||||
});
|
||||
};
|
||||
|
||||
var SmsCampaignDeleteCtrl = function ($scope, $modalInstance) {
|
||||
$scope.delete = function () {
|
||||
resourceFactory.smsCampaignResource.delete({campaignId: routeParams.campaignId}, function (data) {
|
||||
$modalInstance.close('delete');
|
||||
location.path('/smscampaigns');
|
||||
});
|
||||
};
|
||||
$scope.cancel = function () {
|
||||
$modalInstance.dismiss('cancel');
|
||||
};
|
||||
};
|
||||
}
|
||||
});
|
||||
mifosX.ng.application.controller('ViewSmsCampaignController', ['$scope', '$routeParams', '$location', 'ResourceFactory', '$modal', 'dateFilter', '$route', 'PaginatorService', mifosX.controllers.ViewSmsCampaignController]).run(function ($log) {
|
||||
$log.info("ViewSmsCampaignController initialized");
|
||||
});
|
||||
}(mifosX.controllers || {}));
|
||||
@ -305,6 +305,7 @@
|
||||
scope.isCollapsed = true;
|
||||
switch (scope.reportType) {
|
||||
case "Table":
|
||||
case "SMS":
|
||||
scope.hideTable = false;
|
||||
scope.hidePentahoReport = true;
|
||||
scope.hideChart = true;
|
||||
|
||||
@ -33,6 +33,7 @@
|
||||
'Q': '../bower_components/q/q.min',
|
||||
'tmh.dynamicLocale': '../bower_components/angular-dynamic-locale/tmhDynamicLocale.min',
|
||||
'webcam-directive':'../bower_components/webcam-directive/dist/1.1.0/webcam.min',
|
||||
'angular-wizard': '../scripts/modules/angular-wizard',
|
||||
'angular-utils-pagination':'../bower_components/angular-utils-pagination/dirPagination.min'
|
||||
},
|
||||
shim: {
|
||||
@ -62,6 +63,7 @@
|
||||
'Q': {deps: ['angular']},
|
||||
'tmh.dynamicLocale': {deps: ['angular']},
|
||||
'webcam-directive': {deps: ['angular']},
|
||||
'angular-wizard': {deps: ['angular', 'underscore']},
|
||||
'angular-utils-pagination': {deps: ['angular']},
|
||||
'mifosX': {
|
||||
deps: [
|
||||
@ -89,6 +91,7 @@
|
||||
'frAngular',
|
||||
'Q',
|
||||
'tmh.dynamicLocale',
|
||||
'angular-wizard',
|
||||
'webcam-directive',
|
||||
'angular-utils-pagination'
|
||||
],
|
||||
|
||||
@ -33,6 +33,7 @@
|
||||
'Q': '../bower_components/q/q',
|
||||
'tmh.dynamicLocale': '../bower_components/angular-dynamic-locale/tmhDynamicLocale.min',
|
||||
'webcam-directive':'../bower_components/webcam-directive/dist/1.1.0/webcam.min',
|
||||
'angular-wizard': '../scripts/modules/angular-wizard',
|
||||
'angular-utils-pagination':'../bower_components/angular-utils-pagination/dirPagination'
|
||||
},
|
||||
shim: {
|
||||
@ -62,6 +63,7 @@
|
||||
'Q': {deps: ['angular']},
|
||||
'tmh.dynamicLocale': {deps: ['angular']},
|
||||
'webcam-directive': {deps: ['angular']},
|
||||
'angular-wizard': {deps: ['angular', 'underscore']},
|
||||
'angular-utils-pagination': {deps: ['angular']},
|
||||
'mifosX': {
|
||||
deps: [
|
||||
@ -90,6 +92,7 @@
|
||||
'Q',
|
||||
'tmh.dynamicLocale',
|
||||
'webcam-directive',
|
||||
'angular-wizard',
|
||||
'angular-utils-pagination'
|
||||
],
|
||||
exports: 'mifosX'
|
||||
|
||||
@ -2,7 +2,7 @@ var mifosX = (function (module) {
|
||||
module.ng = {
|
||||
config: angular.module('config_params', ['configurations']),
|
||||
services: angular.module('MifosX_Services', ['ngResource']),
|
||||
application: angular.module('MifosX_Application', ['MifosX_Services', 'config_params', 'webStorageModule', 'ui.bootstrap' , 'pascalprecht.translate', 'nvd3ChartDirectives', 'notificationWidget', 'angularFileUpload', 'modified.datepicker', 'ngRoute', 'ngSanitize', 'LocalStorageModule', 'ngIdle', 'ngCsv', 'frAngular', 'tmh.dynamicLocale', 'webcam', 'angularUtils.directives.dirPagination'])
|
||||
application: angular.module('MifosX_Application', ['MifosX_Services', 'config_params', 'webStorageModule', 'ui.bootstrap' , 'pascalprecht.translate', 'nvd3ChartDirectives', 'notificationWidget', 'angularFileUpload', 'modified.datepicker', 'ngRoute', 'ngSanitize', 'LocalStorageModule', 'ngIdle', 'ngCsv', 'frAngular', 'tmh.dynamicLocale', 'mgo-angular-wizard', 'webcam', 'angularUtils.directives.dirPagination'])
|
||||
};
|
||||
return module;
|
||||
}(mifosX || {}));
|
||||
|
||||
@ -282,7 +282,11 @@ define(['Q', 'underscore', 'mifosX'], function (Q) {
|
||||
'product/tax/EditTaxGroupController',
|
||||
'product/tax/TaxGroupController',
|
||||
'configurations/EditAddressController',
|
||||
'configurations/AddressFormController'
|
||||
'configurations/AddressFormController',
|
||||
'organization/smscampaigns/SmsCampaignsController',
|
||||
'organization/smscampaigns/CreateSmsCampaignController',
|
||||
'organization/smscampaigns/ViewSmsCampaignController',
|
||||
'organization/smscampaigns/EditSmsCampaignController'
|
||||
],
|
||||
filters: [
|
||||
'StatusLookup',
|
||||
|
||||
@ -8,6 +8,7 @@ define(['underscore'], function () {
|
||||
'app.css',
|
||||
'nv.d3.css',
|
||||
'style.css',
|
||||
'angular-wizard.css',
|
||||
'chosen.min.css'
|
||||
]
|
||||
};
|
||||
|
||||
@ -8,6 +8,7 @@ define(['underscore'], function () {
|
||||
'app',
|
||||
'nv.d3',
|
||||
'style',
|
||||
'angular-wizard.css',
|
||||
'chosen.min'
|
||||
]
|
||||
};
|
||||
|
||||
239
app/scripts/modules/angular-wizard.js
vendored
Normal file
239
app/scripts/modules/angular-wizard.js
vendored
Normal file
@ -0,0 +1,239 @@
|
||||
/**
|
||||
* Easy to use Wizard library for AngularJS
|
||||
* @version v0.4.0 - 2014-04-25 * @link https://github.com/mgonto/angular-wizard
|
||||
* @author Martin Gontovnikas <martin@gon.to>
|
||||
* @license MIT License, http://www.opensource.org/licenses/MIT
|
||||
*/
|
||||
angular.module('templates-angularwizard', ['step.html', 'wizard.html']);
|
||||
|
||||
angular.module("step.html", []).run(["$templateCache", function($templateCache) {
|
||||
$templateCache.put("step.html",
|
||||
"<div ng-show=\"selected\" ng-class=\"{current: selected, done: completed}\" class=\"step\" ng-transclude>\n" +
|
||||
"</div>");
|
||||
}]);
|
||||
|
||||
|
||||
angular.module("wizard.html", []).run(["$templateCache", function($templateCache) {
|
||||
$templateCache.put("wizard.html",
|
||||
"<div class = \"wiz-container\">\n" +
|
||||
" <div class = \"row \">\n" +
|
||||
" <div class = \"col-md-12 \">\n" +
|
||||
" <div class = \"helper-set-block\">\n" +
|
||||
" <div class = \"arrow-wrapper steps-indicator\">\n" +
|
||||
// " <div class=\"steps-indicator\" ng-if=\"!hideIndicators\">\n" +
|
||||
// " <div ng-repeat=\"step in steps\" ng-class=\"{'active':step.title == selectedStep.title, default: !step.completed && !step.selected, 'current': step.selected && !step.completed, 'done': step.completed && !step.selected, 'editing': step.selected && step.completed}\">\n" +
|
||||
" <a ng-repeat=\"step in steps\" ng-click=\"goTo(step)\" ng-class=\"{'active':step.title == selectedStep.title, default: " +
|
||||
"!step.completed && !step.selected, 'current': step.selected && !step.completed, " +
|
||||
"'done': step.completed && !step.selected, 'editing': step.selected && step.completed," +
|
||||
"'current icon-arrow-right': step.selected && !step.completed, 'done icon-check': step.completed && !step.selected, " +
|
||||
"'editing icon-repeat': step.selected && step.completed}\">\n" +
|
||||
"<span class=\"fa-stack\">" +
|
||||
"<span class=\"fa fa-circle-thin fa-stack-2x\"></span>" +
|
||||
"<span class=\"fa fa-check fa-stack-1x\" ng-show=\"step.completed\"></span>" +
|
||||
"</span>"+
|
||||
// " <span class=\"{{step.icon}}\"></span> " +
|
||||
" {{step.title || step.wzTitle}}\n" +
|
||||
" </a>\n" +
|
||||
// " </div>\n" +
|
||||
//" </div>\n" +
|
||||
" </div>\n" +
|
||||
" </div>\n" +
|
||||
" </div>\n" +
|
||||
" </div>\n" +
|
||||
" <div class = \"row \">\n" +
|
||||
" <div class=\"steps col-md-12\" ng-transclude></div>\n" +
|
||||
" </div>\n" +
|
||||
"</div>\n" +
|
||||
"");
|
||||
}]);
|
||||
angular.module('mgo-angular-wizard', ['templates-angularwizard']);
|
||||
|
||||
angular.module('mgo-angular-wizard').directive('wzStep', function() {
|
||||
return {
|
||||
restrict: 'EA',
|
||||
replace: true,
|
||||
transclude: true,
|
||||
scope: {
|
||||
wzTitle: '@',
|
||||
title: '@',
|
||||
icon: '@'
|
||||
},
|
||||
require: '^wizard',
|
||||
templateUrl: function(element, attributes) {
|
||||
return attributes.template || "step.html";
|
||||
},
|
||||
link: function($scope, $element, $attrs, wizard) {
|
||||
$scope.title = $scope.title || $scope.wzTitle;
|
||||
wizard.addStep($scope);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
angular.module('mgo-angular-wizard').directive('wizard', function() {
|
||||
return {
|
||||
restrict: 'EA',
|
||||
replace: true,
|
||||
transclude: true,
|
||||
scope: {
|
||||
currentStep: '=',
|
||||
onFinish: '&',
|
||||
hideIndicators: '=',
|
||||
editMode: '=',
|
||||
name: '@'
|
||||
},
|
||||
templateUrl: function(element, attributes) {
|
||||
return attributes.template || "wizard.html";
|
||||
},
|
||||
controller: ['$scope', '$element', 'WizardHandler', function($scope, $element, WizardHandler) {
|
||||
|
||||
WizardHandler.addWizard($scope.name || WizardHandler.defaultName, this);
|
||||
$scope.$on('$destroy', function() {
|
||||
WizardHandler.removeWizard($scope.name || WizardHandler.defaultName);
|
||||
});
|
||||
|
||||
$scope.steps = [];
|
||||
|
||||
$scope.$watch('currentStep', function(step) {
|
||||
if (!step) return;
|
||||
var stepTitle = $scope.selectedStep.title || $scope.selectedStep.wzTitle;
|
||||
if ($scope.selectedStep && stepTitle !== $scope.currentStep) {
|
||||
$scope.goTo(_.findWhere($scope.steps, {title: $scope.currentStep}));
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
$scope.$watch('[editMode, steps.length]', function() {
|
||||
var editMode = $scope.editMode;
|
||||
if (_.isUndefined(editMode) || _.isNull(editMode)) return;
|
||||
|
||||
if (editMode) {
|
||||
_.each($scope.steps, function(step) {
|
||||
step.completed = true;
|
||||
});
|
||||
}
|
||||
}, true);
|
||||
|
||||
this.addStep = function(step) {
|
||||
$scope.steps.push(step);
|
||||
if ($scope.steps.length === 1) {
|
||||
$scope.goTo($scope.steps[0]);
|
||||
}
|
||||
};
|
||||
|
||||
$scope.goTo = function(step) {
|
||||
unselectAll();
|
||||
$scope.selectedStep = step;
|
||||
if (!_.isUndefined($scope.currentStep)) {
|
||||
$scope.currentStep = step.title || step.wzTitle;
|
||||
}
|
||||
step.selected = true;
|
||||
$scope.$emit('wizard:stepChanged', {step: step, index: _.indexOf($scope.steps , step)});
|
||||
};
|
||||
|
||||
$scope.currentStepNumber = function() {
|
||||
return _.indexOf($scope.steps , $scope.selectedStep) + 1;
|
||||
}
|
||||
|
||||
this.getCurrentStep = function() {
|
||||
return $scope.currentStepNumber();
|
||||
}
|
||||
|
||||
function unselectAll() {
|
||||
_.each($scope.steps, function (step) {
|
||||
step.selected = false;
|
||||
});
|
||||
$scope.selectedStep = null;
|
||||
}
|
||||
|
||||
this.next = function(draft) {
|
||||
var index = _.indexOf($scope.steps , $scope.selectedStep);
|
||||
if (!draft) {
|
||||
$scope.selectedStep.completed = true;
|
||||
}
|
||||
if (index === $scope.steps.length - 1) {
|
||||
this.finish();
|
||||
} else {
|
||||
$scope.goTo($scope.steps[index + 1]);
|
||||
}
|
||||
};
|
||||
|
||||
this.goTo = function(step) {
|
||||
var stepTo;
|
||||
if (_.isNumber(step)) {
|
||||
stepTo = $scope.steps[step];
|
||||
} else {
|
||||
stepTo = _.findWhere($scope.steps, {title: step});
|
||||
}
|
||||
$scope.goTo(stepTo);
|
||||
};
|
||||
|
||||
this.finish = function() {
|
||||
if ($scope.onFinish) {
|
||||
$scope.onFinish();
|
||||
}
|
||||
};
|
||||
|
||||
this.cancel = this.previous = function() {
|
||||
var index = _.indexOf($scope.steps , $scope.selectedStep);
|
||||
if (index === 0) {
|
||||
throw new Error("Can't go back. It's already in step 0");
|
||||
} else {
|
||||
$scope.goTo($scope.steps[index - 1]);
|
||||
}
|
||||
};
|
||||
}]
|
||||
};
|
||||
});
|
||||
|
||||
function wizardButtonDirective(action) {
|
||||
angular.module('mgo-angular-wizard')
|
||||
.directive(action, function() {
|
||||
return {
|
||||
restrict: 'A',
|
||||
replace: false,
|
||||
require: '^wizard',
|
||||
link: function($scope, $element, $attrs, wizard) {
|
||||
|
||||
$element.on("click", function(e) {
|
||||
e.preventDefault();
|
||||
$scope.$apply(function() {
|
||||
$scope.$eval($attrs[action]);
|
||||
wizard[action.replace("wz", "").toLowerCase()]();
|
||||
});
|
||||
});
|
||||
}
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
wizardButtonDirective('wzNext');
|
||||
wizardButtonDirective('wzPrevious');
|
||||
wizardButtonDirective('wzFinish');
|
||||
wizardButtonDirective('wzCancel');
|
||||
|
||||
angular.module('mgo-angular-wizard').factory('WizardHandler', function() {
|
||||
var service = {};
|
||||
|
||||
var wizards = {};
|
||||
|
||||
service.defaultName = "defaultWizard";
|
||||
|
||||
service.addWizard = function(name, wizard) {
|
||||
wizards[name] = wizard;
|
||||
};
|
||||
|
||||
service.removeWizard = function(name) {
|
||||
delete wizards[name];
|
||||
};
|
||||
|
||||
service.wizard = function(name) {
|
||||
var nameToUse = name;
|
||||
if (!name) {
|
||||
nameToUse = service.defaultName;
|
||||
}
|
||||
|
||||
return wizards[nameToUse];
|
||||
};
|
||||
|
||||
return service;
|
||||
});
|
||||
@ -890,9 +890,21 @@
|
||||
.when('/address/:id', {
|
||||
templateUrl: 'views/administration/AddressForm.html'
|
||||
})
|
||||
.when('/editAddress/:addrType/:addrId/:clientId',{
|
||||
.when('/editAddress/:addrType/:addrId/:clientId', {
|
||||
templateUrl: 'views/administration/EditAddress.html'
|
||||
})
|
||||
.when('/smscampaigns', {
|
||||
templateUrl: 'views/organization/smscampaigns/smscampaigns.html'
|
||||
})
|
||||
.when('/createsmscampaign', {
|
||||
templateUrl: 'views/organization/smscampaigns/createsmscampaign.html'
|
||||
})
|
||||
.when('/viewsmscampaign/:campaignId', {
|
||||
templateUrl: 'views/organization/smscampaigns/viewsmscampaign.html'
|
||||
})
|
||||
.when('/editsmscampaign/:campaignId', {
|
||||
templateUrl: 'views/organization/smscampaigns/editsmscampaign.html'
|
||||
})
|
||||
;
|
||||
$locationProvider.html5Mode(false);
|
||||
};
|
||||
|
||||
@ -616,6 +616,24 @@
|
||||
post: {method: 'POST', params:{}},
|
||||
put: {method: 'PUT', params:{}},
|
||||
approve: {method: 'PUT', params:{command: 'approve'}}
|
||||
}),
|
||||
|
||||
smsCampaignTemplateResource: defineResource(apiVer + "/smscampaigns/template", {}, {
|
||||
get: {method: 'GET', params: {}}
|
||||
}),
|
||||
|
||||
smsCampaignResource: defineResource(apiVer + "/smscampaigns/:campaignId/:additionalParam", {campaignId: '@campaignId', additionalParam: '@additionalParam'}, {
|
||||
getAll: {method: 'GET', params: {}, isArray: true},
|
||||
get: {method: 'GET', params: {}},
|
||||
save: {method: 'POST', params: {}},
|
||||
update: {method: 'PUT', params: {}},
|
||||
preview: {method: 'POST', params: {}},
|
||||
withCommand: {method: 'POST', params: {}},
|
||||
delete: {method: 'DELETE', params: {}}
|
||||
}),
|
||||
|
||||
smsResource: defineResource(apiVer + "/sms/:campaignId/messageByStatus", {campaignId: '@campaignId', additionalParam: '@additionalParam'}, {
|
||||
getByStatus: {method: 'GET', params:{}}
|
||||
})
|
||||
};
|
||||
}];
|
||||
|
||||
@ -34,4 +34,18 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row paddedleft paddedtop">
|
||||
<div class="col-sm-6 col-md-6">
|
||||
<div class="list-group">
|
||||
<a class="list-group-item" has-permission="READ_CONFIGURATION" href="#/externalservices/SMS">
|
||||
<h4 class="list-group-item-heading"><i class="icon-large icon-envelope"></i> {{'label.anchor.externalServices'
|
||||
| translate}}</h4>
|
||||
|
||||
<p class="list-group-item-text">{{'label.SMS.description' | translate}}</p>
|
||||
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@ -88,10 +88,14 @@
|
||||
<a class="list-group-item" href="#/viewpaymenttype" has-permission='READ_PAYMENTTYPE'>
|
||||
<h4 class="list-group-item-heading"><i class="icon-dollar icon-large"></i>
|
||||
{{'label.anchor.paymentTypes' | translate}}</h4>
|
||||
|
||||
<p class="list-group-item-text">{{'label.view.paymentTypes' |
|
||||
translate}}</p>
|
||||
</a>
|
||||
<a class="list-group-item" href="#/smscampaigns" has-permission='VIEW_SMSCAMPAIGNS'>
|
||||
<h4 class="list-group-item-heading"><i class="icon-envelope icon-large"></i>
|
||||
{{'label.anchor.smscampaings' | translate}}</h4>
|
||||
<p class="list-group-item-text">{{'label.view.smscampaigns' | translate}}</p>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
336
app/views/organization/smscampaigns/createsmscampaign.html
Normal file
336
app/views/organization/smscampaigns/createsmscampaign.html
Normal file
@ -0,0 +1,336 @@
|
||||
<div class="col-md-12" ng-controller="CreateSmsCampaignController">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="#/organization">{{'label.anchor.organization' | translate}}</a></li>
|
||||
<li><a href="#/smscampaigns">{{'label.anchor.smscampaings' | translate}}</a></li>
|
||||
<li class="active">{{'label.anchor.createcampaign' | translate}}</li>
|
||||
</ul>
|
||||
<BR>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<HR>
|
||||
<wizard current-step="step">
|
||||
<div class="card">
|
||||
<wz-step icon="fa fa-circle-o" title="{{'label.heading.campaign' | translate}}">
|
||||
<div class="card-header">
|
||||
<div class="card-badge animated flipInX"><span class="icon fa fa-th"></span></div>
|
||||
<div class="card-actions"></div>
|
||||
</div>
|
||||
<div class="card-content">
|
||||
<form name="createsmsform" novalidate="" class="form-horizontal "
|
||||
rc-submit="submit()">
|
||||
<api-validate></api-validate>
|
||||
<fieldset>
|
||||
<h3>{{'label.heading.messagedetails' | translate}}</h3>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-2">{{'label.input.campaignName' |
|
||||
translate}}<span class="required">*</span></label>
|
||||
<div class="col-sm-3">
|
||||
<input type="text" id="campaignName" name="campaignName"
|
||||
ng-model="campaignData.campaignName" class="form-control"
|
||||
required/>
|
||||
</div>
|
||||
<div class="col-sm-3">
|
||||
<form-validate valattributeform="createsmsform" valattribute="campaignName"/>
|
||||
</div>
|
||||
</div>
|
||||
<!--<div class="form-group">
|
||||
<label class="control-label col-sm-2">{{'label.input.campaignType' |
|
||||
translate}} <span class="required">*</span> </label>
|
||||
|
||||
<div class="col-sm-3">
|
||||
<select id="campaigntype"
|
||||
name="campaigntype"
|
||||
chosen="campaignTypeOptions"
|
||||
ng-model="campaignData.campaignType"
|
||||
class="form-control" required
|
||||
ng-options="campaignTypeOption as campaignTypeOption.value for campaignTypeOption in campaignTypeOptions"
|
||||
value="{{campaignTypeOption}}"
|
||||
data-placeholder="{{'label.menu.campaignType' | translate}}">
|
||||
<option value=""></option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-sm-3">
|
||||
<form-validate valattributeform="createsmsform" valattribute="campaigntype"/>
|
||||
</div>
|
||||
</div>-->
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-2">{{'label.input.smsprovider' |
|
||||
translate}} <span class="required">*</span> </label>
|
||||
|
||||
<div class="col-sm-3">
|
||||
<select id="smsProvider"
|
||||
name="smsProvider"
|
||||
chosen="providerOptions"
|
||||
ng-model="campaignData.smsProvider"
|
||||
class="form-control" required
|
||||
ng-options="smsProviderOption as smsProviderOption.providerName for smsProviderOption in providerOptions"
|
||||
value="{{smsProviderOption}}"
|
||||
data-placeholder="{{'label.menu.smsProvider' | translate}}">
|
||||
<option value=""></option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-sm-3">
|
||||
<form-validate valattributeform="createsmsform" valattribute="smsProvider"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-2">{{'label.input.triggerType' |
|
||||
translate}} <span class="required">*</span> </label>
|
||||
<div class="col-sm-3">
|
||||
<select id="triggerType"
|
||||
name="triggerType"
|
||||
chosen="triggerTypeOptions"
|
||||
ng-model="campaignData.triggerType"
|
||||
class="form-control" required
|
||||
ng-options="triggerTypeOption as triggerTypeOption.value for triggerTypeOption in triggerTypeOptions"
|
||||
value="{{triggerTypeOption.id}}"
|
||||
data-placeholder="{{'label.menu.triggerType' | translate}}" ng-change="getBusinessRule()">
|
||||
<option value=""></option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-sm-3">
|
||||
<form-validate valattributeform="createsmsform" valattribute="triggerType"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group" ng-if="campaignData.triggerType.value === 'Scheduled'">
|
||||
<label class="control-label col-sm-2">{{'label.input.scheduledate' | translate}}<span
|
||||
class="required">*</span></label>
|
||||
<div class="col-sm-3">
|
||||
<input id="scheduleDate" name="scheduleDate" type="text" datepicker-pop="dd MMMM yyyy" ng-model="campaignData.recurrenceStartDate"
|
||||
is-open="opened" min="'2000-01-01'" max="'2050-01-01'" class="form-control" ng-required="campaignData.triggerType.value === 'Scheduled'"/>
|
||||
</div>
|
||||
<div class="col-sm-3">
|
||||
<form-validate valattributeform="createsmsform" valattribute="scheduleDate"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group" ng-if="campaignData.triggerType.value === 'Scheduled'">
|
||||
<label class="control-label col-sm-2">{{'label.input.scheduletime' | translate}}<span
|
||||
class="required">*</span></label>
|
||||
<div class="col-sm-3">
|
||||
<timepicker id="scheduleTime" name="scheduleTime" ng-model="campaignData.time"></timepicker>
|
||||
</div>{{campaignData.time}}
|
||||
</div>
|
||||
|
||||
<div class="form-group" ng-if="campaignData.triggerType.value === 'Scheduled'">
|
||||
<label class="control-label col-sm-2">{{'label.input.repeats' | translate}}<span
|
||||
class="required">*</span></label>
|
||||
<div class="col-sm-3">
|
||||
<select id="repeats"
|
||||
name="repeats"
|
||||
chosen="frequencyTypeOptions"
|
||||
ng-model="campaignData.frequency"
|
||||
class="form-control" required
|
||||
ng-options="frequencyTypeOption.id as frequencyTypeOption.value for frequencyTypeOption in frequencyTypeOptions"
|
||||
value="{{frequencyTypeOption}}" ng-change="selectedPeriod(campaignData.frequency)"
|
||||
data-placeholder="{{'label.menu.repeats' | translate}}">
|
||||
<option value=""></option>
|
||||
</select>
|
||||
</div>
|
||||
<!--</div>-->
|
||||
<!--<div class="form-group" ng-if="campaignData.triggerType.value === 'Scheduled'">-->
|
||||
<label class="control-label col-sm-2">{{'label.input.repeatsevery' | translate}}<span
|
||||
class="required">*</span></label>
|
||||
<div class="col-sm-3">
|
||||
<select id="repeatsevery"
|
||||
name="repeatsevery"
|
||||
chosen="repeatsEveryOptions"
|
||||
ng-model="campaignData.repeatsEvery"
|
||||
class="form-control" required
|
||||
ng-options="repeatsEveryOption for repeatsEveryOption in repeatsEveryOptions"
|
||||
value="{{repeatsEveryOption}}"
|
||||
data-placeholder="{{'label.menu.selectone' | translate}}">
|
||||
<option value=""></option>
|
||||
</select>
|
||||
</div>
|
||||
<label class="control-label">{{periodValue}}</label>
|
||||
</div>
|
||||
<div class="form-group" ng-if="campaignData.triggerType.value === 'Scheduled' && campaignData.frequency === 2">
|
||||
<label class="control-label col-sm-2"></label>
|
||||
<div class="col-sm-1" ng-repeat="repeatsOnOption in repeatsOnOptions">
|
||||
<input type="radio" ng-model="campaignData.repeatsOnDay" value="{{repeatsOnOption.id}}">
|
||||
{{repeatsOnOption.value}} <br/>
|
||||
</div>
|
||||
</div>
|
||||
<br/>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-2">{{'label.input.businessRule' |
|
||||
translate}} <span class="required">*</span> </label>
|
||||
<div class="col-sm-3">
|
||||
<select id="businessRule"
|
||||
name="businessRule"
|
||||
chosen="filteredBusinessRules"
|
||||
ng-model="campaignData.report"
|
||||
class="form-control"
|
||||
ng-options="businessRuleOption as businessRuleOption.reportName for businessRuleOption in filteredBusinessRules"
|
||||
value="{{businessRuleOption}}" ng-change="reportSelected(campaignData.report.reportName)"
|
||||
data-placeholder="{{'label.menu.businessRule' | translate}}">
|
||||
<option value=""></option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-sm-3">
|
||||
<form-validate valattributeform="createsmsform" valattribute="businessRule"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h3>{{'label.heading.businessRuleParameters' | translate}}</h3>
|
||||
|
||||
<div class="alert-block form-horizontal">
|
||||
<br>
|
||||
|
||||
<div class="form-group info" ng-repeat="reportParam in reportParams">
|
||||
<label class="control-label col-sm-2" for="{{reportParam.variable}}">{{ reportParam.label | translate}}
|
||||
<span class="required">*</span></label>
|
||||
|
||||
<div class="col-sm-3">
|
||||
<select chosen="reportParam.selectOptions" id="{{reportParam.inputName}}" ng-model="formData[reportParam.inputName]"
|
||||
ng-options="selectOption.id as selectOption.name for selectOption in reportParam.selectOptions"
|
||||
value="{{selectOption.id}}"
|
||||
class="form-control input-xlarge" ng-change="getDependencies(reportParam)">
|
||||
<option value="">--{{"label.menu.selectone" | translate}}--</option>
|
||||
</select>
|
||||
</div>
|
||||
<form-validate valattributeform="createsmsform"
|
||||
valattribute="{{reportParam.inputName}}"/>
|
||||
</div>
|
||||
<div class="form-group info" ng-repeat="reportTextParam in reportTextParams">
|
||||
<label class="control-label col-sm-2" for="{{reportTextParam.variable}}">{{ reportTextParam.label |
|
||||
translate}} <span class="required">*</span></label>
|
||||
<div class="col-sm-3">
|
||||
<input id="{{reportTextParam.inputName}}" type="text" ng-model="formData[reportTextParam.inputName]" class="form-control"/>
|
||||
</div>
|
||||
<form-validate valattributeform="createsmsform"
|
||||
valattribute="{{reportParam.inputName}}"/>
|
||||
</div>
|
||||
<div class="form-group info" ng-repeat="reportDateParam in reportDateParams">
|
||||
<label class="control-label col-sm-2" for="{{reportDateParam.variable}}">{{ reportDateParam.label |
|
||||
translate}} <span class="required">*</span></label>
|
||||
|
||||
<div class="col-sm-3">
|
||||
<input id="{{reportDateParam.inputName}}" type="text" datepicker-pop="yyyy-MM-dd"
|
||||
ng-model="formData[reportDateParam.inputName]" is-open="'opened'+$index" min="minDate"
|
||||
max="'2020-06-22'" date-disabled="disabled(date, mode)" class="form-control"/>
|
||||
</div>
|
||||
<form-validate valattributeform="createsmsform"
|
||||
valattribute="{{reportParam.inputName}}"/>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="pull-right">
|
||||
<button id="save1" type="submit" class="btn btn-primary" ng-click="getColumnHeaders()">
|
||||
{{'label.button.proceed' | translate}}
|
||||
</button>
|
||||
</div>
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
</wz-step>
|
||||
<wz-step icon="fa fa-circle-o" title="{{'label.heading.message' | translate}}">
|
||||
<div class="card-header">
|
||||
<div class="card-badge animated flipInX"><span class="icon fa fa-th"></span></div>
|
||||
<h2>{{'label.heading.message' | translate}}</h2>
|
||||
<div class="card-actions"></div>
|
||||
</div>
|
||||
<div class="card-content">
|
||||
<form name="documentdetailsform" novalidate="" class="form-horizontal "
|
||||
rc-submit="submit()">
|
||||
<api-validate></api-validate>
|
||||
<fieldset>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-2">{{'label.input.campaignMessage' |
|
||||
translate}} <span class="required">*</span> </label>
|
||||
<div class="col-sm-8">
|
||||
<textarea placeholder="Type message here maximum length is 480"
|
||||
maxLength="480" rows="5"
|
||||
name="campaignMessage" id="campaignMessage"
|
||||
ng-model="campaignData.campaignMessage"
|
||||
class="form-control" ng-init="campaignData.campaignMessage = ''"> </textarea>
|
||||
<span class="error"
|
||||
ng-show="createsmsform.campaignName.$error.pattern">Must be alphabetic</span>
|
||||
<form-validate valattributeform="createsmsform"
|
||||
valattribute="campaignMessage"/>
|
||||
</div>
|
||||
</div>
|
||||
<h3>{{'label.heading.templateparameters' | translate}}</h3>
|
||||
|
||||
<span ng-repeat="columnHeader in reportData.columnHeaders">
|
||||
<strong>
|
||||
<a class="reportColumns" style="cursor:pointer" ng-click="buildMessageTemplate(columnHeader.columnName)">{{columnHeader.columnName}}</a>
|
||||
<a class="reportColumns" ng-if="!$last">, </a>
|
||||
</strong>
|
||||
</span>
|
||||
<br/>
|
||||
<hr>
|
||||
<div class="pull-right">
|
||||
<button id="save2" type="submit" class="btn btn-primary" ng-click="previewMessage()">{{'label.button.proceed' |
|
||||
translate}}
|
||||
</button>
|
||||
</div>
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
</wz-step>
|
||||
<wz-step icon="fa fa-circle-o" title="{{'label.heading.preview' | translate}}">
|
||||
<div class="card-header">
|
||||
<div class="card-badge animated flipInX"><span class="icon fa fa-th"></span></div>
|
||||
<h2>{{'label.heading.preview' | translate}}</h2>
|
||||
<div class="card-actions"></div>
|
||||
</div>
|
||||
<div class="card-content">
|
||||
<form name="confirmationform" novalidate="" class="form-horizontal "
|
||||
rc-submit="submit()">
|
||||
<api-validate></api-validate>
|
||||
<fieldset>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered card-table">
|
||||
<tr>
|
||||
<td colspan="4">
|
||||
<strong>{{'label.heading.details' | translate}}</strong>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{'label.heading.campaignname' | translate}}</td>
|
||||
<td>{{campaignData.campaignName}}</td>
|
||||
</tr>
|
||||
<!-- <tr>
|
||||
<td>{{ 'label.heading.campaigntype' | translate }}</td>
|
||||
<td>{{campaignData.campaignType.value | translate}}</td>
|
||||
</tr>-->
|
||||
<tr>
|
||||
<td>{{'label.heading.smsProvider' | translate}}</td>
|
||||
|
||||
<td colspan="3">{{campaignData.smsProvider.providerName}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{'label.heading.businessRule' | translate}}</td>
|
||||
<td colspan="3">{{campaignData.report.reportName}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{'label.heading.campaignMessage' | translate}}</td>
|
||||
<td colspan="3">{{previewMessage}}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="pull-right">
|
||||
<button id="save3" type="submit" name="createCampaign"
|
||||
class="btn btn-primary">
|
||||
{{'label.button.proceed' | translate}}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
</wz-step>
|
||||
</div>
|
||||
</wizard>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
200
app/views/organization/smscampaigns/editsmscampaign.html
Normal file
200
app/views/organization/smscampaigns/editsmscampaign.html
Normal file
@ -0,0 +1,200 @@
|
||||
<div class="col-md-12" ng-controller="EditSmsCampaignController">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="#/organization">{{'label.anchor.organization' | translate}}</a></li>
|
||||
<li><a href="#/smscampaigns">{{'label.anchor.smscampaings' | translate}}</a></li>
|
||||
<li><a href="#/viewsmscampaign/{{campaignData.id}}">{{campaignData.campaignName}}</a></li>
|
||||
<li class="active">{{'label.anchor.editcampaign' | translate}}</li>
|
||||
</ul>
|
||||
<div class="card-content">
|
||||
<form name="editsmsform" novalidate="" class="form-horizontal " rc-submit="submit()">
|
||||
<api-validate></api-validate>
|
||||
<fieldset>
|
||||
<h3>{{'label.heading.messagedetails' | translate}}</h3>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-2">{{'label.input.campaignName' |
|
||||
translate}}<span class="required">*</span></label>
|
||||
<div class="col-sm-3">
|
||||
<input type="text" id="campaignName" name="campaignName"
|
||||
ng-model="campaignData.campaignName" class="form-control"
|
||||
ng-disabled="true"/>
|
||||
</div>
|
||||
<div class="col-sm-3">
|
||||
<form-validate valattributeform="editsmsform" valattribute="campaignName"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-2">{{'label.input.campaignType' |
|
||||
translate}} <span class="required">*</span> </label>
|
||||
|
||||
<div class="col-sm-3">
|
||||
<select id="campaigntype"
|
||||
name="campaigntype"
|
||||
chosen="campaignTypeOptions"
|
||||
ng-model="campaignData.campaignType"
|
||||
class="form-control"
|
||||
ng-options="campaignTypeOption.id as campaignTypeOption.value for campaignTypeOption in campaignTypeOptions"
|
||||
value="{{campaignTypeOption.id}}"
|
||||
data-placeholder="{{'label.menu.campaignType' | translate}}" ng-disabled="true">
|
||||
<option value=""></option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-sm-3">
|
||||
<form-validate valattributeform="editsmsform" valattribute="campaigntype"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-2">{{'label.input.smsprovider' |
|
||||
translate}} <span class="required">*</span> </label>
|
||||
|
||||
<div class="col-sm-3">
|
||||
<select id="smsProvider"
|
||||
name="smsProvider"
|
||||
chosen="providerOptions"
|
||||
ng-model="campaignData.smsProvider"
|
||||
class="form-control"
|
||||
ng-options="smsProviderOption.id as smsProviderOption.providerName for smsProviderOption in providerOptions"
|
||||
value="{{smsProviderOption.id}}"
|
||||
data-placeholder="{{'label.menu.smsProvider' | translate}}" ng-disabled="true">
|
||||
<option value=""></option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-sm-3">
|
||||
<form-validate valattributeform="editsmsform" valattribute="smsProvider"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-2">{{'label.input.triggerType' |
|
||||
translate}} <span class="required">*</span> </label>
|
||||
<div class="col-sm-3">
|
||||
<select id="triggerType"
|
||||
name="triggerType"
|
||||
chosen="triggerTypeOptions"
|
||||
ng-model="campaignData.triggerType"
|
||||
class="form-control"
|
||||
ng-options="triggerTypeOption.id as triggerTypeOption.value for triggerTypeOption in triggerTypeOptions"
|
||||
value="{{triggerTypeOption.id}}"
|
||||
data-placeholder="{{'label.menu.triggerType' | translate}}" ng-disabled="true">
|
||||
<option value=""></option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-sm-3">
|
||||
<form-validate valattributeform="editsmsform" valattribute="triggerType"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group" ng-if="campaignData.triggerType === 2">
|
||||
<label class="control-label col-sm-2">{{'label.input.scheduledate' | translate}}<span
|
||||
class="required">*</span></label>
|
||||
<div class="col-sm-3">
|
||||
<input id="scheduleDate" name="scheduleDate" type="text" datepicker-pop="dd MMMM yyyy" ng-model="campaignData.recurrenceStartDate"
|
||||
is-open="opened" min="'2000-01-01'" max="'2050-01-01'" class="form-control" ng-disabled="true"/>
|
||||
</div>
|
||||
<div class="col-sm-3">
|
||||
<form-validate valattributeform="editsmsform" valattribute="scheduleDate"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" ng-if="campaignData.triggerType === 2">
|
||||
<label class="control-label col-sm-2">{{'label.input.scheduletime' | translate}}<span
|
||||
class="required">*</span></label>
|
||||
<div class="col-sm-3">
|
||||
<timepicker id="scheduleTime" name="scheduleTime" ng-model="campaignData.time" ng-disabled="true"></timepicker>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-2">{{'label.input.businessRule' |
|
||||
translate}} <span class="required">*</span> </label>
|
||||
<div class="col-sm-3">
|
||||
<select id="businessRule"
|
||||
name="businessRule"
|
||||
chosen="businessRuleOptions"
|
||||
ng-model="campaignData.report"
|
||||
class="form-control"
|
||||
ng-options="businessRuleOption.reportId as businessRuleOption.reportName for businessRuleOption in businessRuleOptions"
|
||||
value="{{businessRuleOption}}" data-placeholder="{{'label.menu.businessRule' | translate}}" ng-disabled="true">
|
||||
<option value=""></option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-sm-3">
|
||||
<form-validate valattributeform="editsmsform" valattribute="businessRule"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--<h3>{{'label.heading.businessRuleParameters' | translate}}</h3>-->
|
||||
|
||||
<div class="alert-block form-horizontal">
|
||||
<br>
|
||||
|
||||
<div class="form-group info" ng-repeat="reportParam in reportParams">
|
||||
<label class="control-label col-sm-2" for="{{reportParam.variable}}">{{ reportParam.label | translate}}
|
||||
<span class="required">*</span></label>
|
||||
|
||||
<div class="col-sm-3">
|
||||
<select chosen="reportParam.selectOptions" id="{{reportParam.inputName}}" ng-model="formData[reportParam.inputName]"
|
||||
ng-options="selectOption.id as selectOption.name for selectOption in reportParam.selectOptions"
|
||||
value="{{selectOption.id}}"
|
||||
class="form-control input-xlarge" ng-init="getDependencies(reportParam)" disabled>
|
||||
<option value="">--{{"label.menu.selectone" | translate}}--</option>
|
||||
</select>
|
||||
</div>
|
||||
<form-validate valattributeform="editsmsform"
|
||||
valattribute="{{reportParam.inputName}}"/>
|
||||
</div>
|
||||
<div class="form-group info" ng-repeat="reportTextParam in reportTextParams">
|
||||
<label class="control-label col-sm-2" for="{{reportTextParam.variable}}">{{ reportTextParam.label |
|
||||
translate}} <span class="required">*</span></label>
|
||||
<div class="col-sm-3">
|
||||
<input id="{{reportTextParam.inputName}}" type="text" ng-model="formData[reportTextParam.inputName]" class="form-control" ng-disabled="true"/>
|
||||
</div>
|
||||
<form-validate valattributeform="editsmsform"
|
||||
valattribute="{{reportParam.inputName}}"/>
|
||||
</div>
|
||||
<div class="form-group info" ng-repeat="reportDateParam in reportDateParams">
|
||||
<label class="control-label col-sm-2" for="{{reportDateParam.variable}}">{{ reportDateParam.label |
|
||||
translate}} <span class="required">*</span></label>
|
||||
|
||||
<div class="col-sm-3">
|
||||
<input id="{{reportDateParam.inputName}}" type="text" datepicker-pop="yyyy-MM-dd"
|
||||
ng-model="formData[reportDateParam.inputName]" is-open="'opened'+$index" min="minDate"
|
||||
max="'2020-06-22'" date-disabled="disabled(date, mode)" class="form-control" ng-disabled="true"/>
|
||||
</div>
|
||||
<form-validate valattributeform="editsmsform"
|
||||
valattribute="{{reportParam.inputName}}"/>
|
||||
</div>
|
||||
<hr>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-2">{{'label.input.campaignMessage' |
|
||||
translate}} <span class="required">*</span> </label>
|
||||
<div class="col-sm-8">
|
||||
<textarea placeholder="Type message here maximum length is 480"
|
||||
maxLength="480" rows="5"
|
||||
name="campaignMessage" id="campaignMessage"
|
||||
ng-model="campaignData.campaignMessage"
|
||||
class="form-control"> </textarea>
|
||||
<span class="error"
|
||||
ng-show="editsmsform.campaignName.$error.pattern">Must be alphabetic</span>
|
||||
<form-validate valattributeform="editsmsform"
|
||||
valattribute="campaignMessage"/>
|
||||
</div>
|
||||
</div>
|
||||
<h3>{{'label.heading.templateparameters' | translate}}</h3>
|
||||
<span ng-repeat="columnHeader in reportData.columnHeaders">
|
||||
<strong>
|
||||
<a class="reportColumns" style="cursor:pointer" ng-click="buildMessageTemplate(columnHeader.columnName)">{{columnHeader.columnName}}</a>
|
||||
<a class="reportColumns" ng-if="!$last">, </a>
|
||||
</strong>
|
||||
</span>
|
||||
<br/>
|
||||
<hr>
|
||||
<div class="">
|
||||
<button id="save2" type="submit" class="btn btn-primary">{{'label.button.proceed' |
|
||||
translate}}
|
||||
</button>
|
||||
</div>
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
32
app/views/organization/smscampaigns/smscampaigns.html
Normal file
32
app/views/organization/smscampaigns/smscampaigns.html
Normal file
@ -0,0 +1,32 @@
|
||||
<div class="col-md-12" ng-controller="SmsCampaignsController">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="#/organization">{{'label.anchor.organization' | translate}}</a></li>
|
||||
<li class="active">{{'label.anchor.smscampaings' | translate}}</li>
|
||||
</ul>
|
||||
|
||||
<input ng-model="filterText" type="text" class="form-control" ng-keyup="onFilter()" placeholder="{{'label.input.filterbyname' | translate}}">
|
||||
<a href="#/createsmscampaign" class="btn btn-primary pull-right" has-permission='CREATE_SMSCAMPAIGN'><i class="icon-plus icon-white"></i>{{'label.button.createcampaign' | translate}}</a>
|
||||
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr class="graybg">
|
||||
<th>{{'label.heading.campaignname' | translate}}</th>
|
||||
<th>{{'label.heading.templatemsg' | translate}}</th>
|
||||
<th>{{'label.heading.campaigntype' | translate}}</th>
|
||||
<th>{{'label.heading.triggertype' | translate}}</th>
|
||||
<th>{{'label.heading.status' | translate}}</th>
|
||||
<th>{{'label.heading.approvedby' | translate}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="pointer-main" ng-repeat="smsCampaign in smsCampaigns |orderBy:'criteriaName' | filter:filterText">
|
||||
<td class="pointer" data-ng-click="routeTo(smsCampaign.id)">{{smsCampaign.campaignName}}</td>
|
||||
<td class="pointer" data-ng-click="routeTo(smsCampaign.id)">{{smsCampaign.campaignMessage}}</td>
|
||||
<td class="pointer" data-ng-click="routeTo(smsCampaign.id)">{{smsCampaign.campaignType.value}}</td>
|
||||
<td class="pointer" data-ng-click="routeTo(smsCampaign.id)">{{smsCampaign.triggerType.value}}</td>
|
||||
<td class="pointer" data-ng-click="routeTo(smsCampaign.id)">{{smsCampaign.campaignStatus.value}}</td>
|
||||
<td class="pointer" data-ng-click="routeTo(smsCampaign.id)">{{smsCampaign.smsCampaignTimeLine.submittedByUsername}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
236
app/views/organization/smscampaigns/viewsmscampaign.html
Normal file
236
app/views/organization/smscampaigns/viewsmscampaign.html
Normal file
@ -0,0 +1,236 @@
|
||||
<div ng-controller="ViewSmsCampaignController" class="col-md-12">
|
||||
<div>
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="#/organization">{{'label.anchor.organization' | translate}}</a></li>
|
||||
<li><a href="#/smscampaigns">{{'label.anchor.smscampaings' | translate}}</a></li>
|
||||
<li class="active">{{campaignData.campaignName}}</li>
|
||||
</ul>
|
||||
</div>
|
||||
<api-validate></api-validate>
|
||||
<tabset class="paddedtop paddedbottom10" tabset-name="smsCampaignTabset">
|
||||
<tab heading="{{'label.heading.campaign' | translate}}">
|
||||
<div class="col-md-12 well">
|
||||
<h3 class="bolder">{{campaignData.campaignName}}
|
||||
<div class="pull-right">
|
||||
<div class="btn-group">
|
||||
<a href="#/editsmscampaign/{{campaignData.id}}" class="btn btn-primary" has-permission='UPDATE_SMSCAMPAIGN' ng-show="campaignData.campaignStatus.value != 'active'"><i class="icon-edit icon-white"></i>{{'label.button.edit' | translate}}</a>
|
||||
<a data-ng-click="activateSmsCampaign()" class="btn btn-primary" has-permission='ACTIVATE_SMSCAMPAIGN' ng-show="campaignData.campaignStatus.value === 'Pending'"><i
|
||||
class="icon-ok-sign icon-white"></i>{{'label.button.activate' | translate}}</a>
|
||||
<a data-ng-click="closeSmsCampaign()" class="btn btn-primary" has-permission='CLOSE_SMSCAMPAIGN' ng-show="campaignData.campaignStatus.value != 'closed'"><i
|
||||
class="icon-remove-circle icon-white"></i>{{'label.button.close' | translate}}</a>
|
||||
<a data-ng-click="reActivateSmsCampaign()" class="btn btn-primary" has-permission='REACTIVATE_SMSCAMPAIGN' ng-show="campaignData.campaignStatus.value != 'Pending' && campaignData.campaignStatus.value != 'active'"><i
|
||||
class="icon-repeat icon-white"></i>{{'label.button.reactivate' | translate}}</a>
|
||||
<a data-ng-click="deleteSmsCampaign()" class="btn btn-danger" has-permission='DELETE_SMSCAMPAIGN' ng-show="campaignData.campaignStatus.value === 'closed'"><i
|
||||
class="icon-trash icon-white"></i>{{'label.button.delete' | translate}}</a>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
</h3>
|
||||
<div class="col-md-12">
|
||||
<table class="table table-bordered table-striped">
|
||||
<tr>
|
||||
<td><strong>{{ 'label.heading.campaignname' | translate }}</strong></td>
|
||||
<td>{{campaignData.campaignName}}</td>
|
||||
</tr>
|
||||
<!--<tr>
|
||||
<td><strong>{{ 'label.heading.campaigntype' | translate }}</strong></td>
|
||||
<td>{{campaignData.campaignType.value | translate}}</td>
|
||||
</tr>-->
|
||||
<tr>
|
||||
<td><strong>{{ 'label.heading.reportname' | translate }}</strong></td>
|
||||
<td>{{campaignData.reportName}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>{{ 'label.heading.status' | translate }}</strong></td>
|
||||
<td>{{campaignData.campaignStatus.value}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>{{ 'label.heading.triggertype' | translate }}</strong></td>
|
||||
<td>{{campaignData.triggerType.value | translate}}</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><strong>{{ 'label.heading.templatemsg' | translate }}</strong></td>
|
||||
<td>{{campaignData.campaignMessage}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>{{ 'label.heading.submittedondate' | translate }}</strong></td>
|
||||
<td>{{campaignData.smsCampaignTimeLine.submittedOnDate | DateFormat}}</td>
|
||||
</tr>
|
||||
<tr ng-if="campaignData.recurrence">
|
||||
<td><strong>{{ 'label.heading.recurrence' | translate }}</strong></td>
|
||||
<td>{{campaignData.recurrence}}</td>
|
||||
</tr>
|
||||
<tr ng-if="campaignData.triggerEntityType">
|
||||
<td><strong>{{ 'label.heading.entity' | translate }}</strong></td>
|
||||
<td>{{campaignData.triggerEntityType.value}}</td>
|
||||
</tr>
|
||||
<tr ng-if="campaignData.triggerActionType">
|
||||
<td><strong>{{ 'label.heading.action' | translate }}</strong></td>
|
||||
<td>{{campaignData.triggerActionType.value}}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</tab>
|
||||
|
||||
<tab heading="{{tabObj.name}}" ng-repeat="tabObj in tabsList" select="resetSMSList()" has-permission='READ_SMS' name="{{tabObj.status}}" ng-if="campaignData.campaignStatus.value != 'Pending'">
|
||||
<div class="col-md-12 well">
|
||||
<h4 class="control-label ng-binding">{{'label.heading.daterange' | translate}}</h4>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-1" for="fromDate">{{'label.input.fromdate' | translate}}</label>
|
||||
|
||||
<div class="col-sm-3">
|
||||
<input class="form-control" id="fromDate" name="fromDate" type="text" datepicker-pop="dd MMMM yyyy" ng-model="formData.fromDate" is-open="opened" min="minDate" max="'2020-06-22'" placeholder="{{ 'label.input.fromdate' | translate }}"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-1" for="toDate">{{'label.input.todate' | translate}}</label>
|
||||
|
||||
<div class="col-sm-3">
|
||||
<input class="form-control" id="toDate" name="toDate" type="text" datepicker-pop="dd MMMM yyyy" ng-model="formData.toDate" is-open="opened1" min="minDate" max="'2020-06-22'" placeholder="{{ 'label.input.todate' | translate }}"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-2">
|
||||
<a ng-click="fetchSMSByStatus(tabObj.status)" class="btn btn-sm btn-primary" has-permission='READ_SMS'>Search
|
||||
<i class="icon-search icon-white"></i></a>
|
||||
</div>
|
||||
<div ng-if="smsList.length == 0">
|
||||
<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
|
||||
</div>
|
||||
|
||||
<div class="" ng-show="smsList">
|
||||
<br/><br/>
|
||||
<table class="table table-bordered table-striped">
|
||||
<thead>
|
||||
<th>{{ 'label.heading.message' | translate }}</th>
|
||||
<th>{{ 'label.heading.status' | translate }}</th>
|
||||
<th>{{ 'label.heading.mobilenumber' | translate }}</th>
|
||||
<th>{{ 'label.heading.campaignname' | translate }}</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr dir-paginate="sms in smsList | itemsPerPage: smsPerPage" total-items="totalSMS" pagination-id="tabObj.id">
|
||||
<td>{{sms.message}}</td>
|
||||
<td>{{sms.status.value}}</td>
|
||||
<td>{{sms.mobileNo}}</td>
|
||||
<td>{{sms.campaignName}}</td>{{sms}}
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<dir-pagination-controls pagination-id="tabObj.id" boundary-links="true" template-url="bower_components/angular-utils-pagination/dirPagination.tpl.html" on-page-change="getResultsPage(newPageNumber)"></dir-pagination-controls>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</tab>
|
||||
</tabset>
|
||||
|
||||
<script type="text/ng-template" id="activatesmscampaign.html">
|
||||
<form name="activatesmsform" novalidate="">
|
||||
<api-validate></api-validate>
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-header silver">
|
||||
<h3 class="bolder">{{'label.heading.activatesmscampaign' | translate}}</h3>
|
||||
</div>
|
||||
<br/>
|
||||
<div>
|
||||
<label class="control-label col-sm-3">{{'label.input.activationdate' | translate}}<span
|
||||
class="required">*</span></label>
|
||||
<div class="col-sm-4">
|
||||
<input id="activationDate" name="activationDate" type="text" datepicker-pop="dd MMMM yyyy" ng-model="$parent.activationDate"
|
||||
is-open="opened" min="'2000-01-01'" max="'2050-01-01'" class="form-control" required/>
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<form-validate valattributeform="activatesmsform" valattribute="activationDate"/>
|
||||
</div>
|
||||
<br/>
|
||||
<br/>
|
||||
<br/>
|
||||
<div class="col-md-offset-4">
|
||||
<button class="btn btn-warning" ng-click="cancel()">{{'label.button.cancel' | translate}}</button>
|
||||
<button class="btn btn-primary" ng-click="activate()">{{'label.button.confirm' | translate}}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</script>
|
||||
|
||||
<script type="text/ng-template" id="closesmscampaign.html">
|
||||
<form name="closesmsform" novalidate="">
|
||||
<api-validate></api-validate>
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-header silver">
|
||||
<h3 class="bolder">{{'label.heading.closesmscampaign' | translate}}</h3>
|
||||
</div>
|
||||
<br/>
|
||||
<div>
|
||||
<label class="control-label col-sm-3">{{'label.input.closuredate' | translate}}<span
|
||||
class="required">*</span></label>
|
||||
<div class="col-sm-4">
|
||||
<input id="closureDate" name="closureDate" type="text" datepicker-pop="dd MMMM yyyy" ng-model="$parent.closureDate"
|
||||
is-open="opened" min="'2000-01-01'" max="'2050-01-01'" class="form-control" required/>
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<form-validate valattributeform="closesmsform" valattribute="closureDate"/>
|
||||
</div>
|
||||
<br/>
|
||||
<br/>
|
||||
<br/>
|
||||
<div class="col-md-offset-4">
|
||||
<button class="btn btn-warning" ng-click="cancel()">{{'label.button.cancel' | translate}}</button>
|
||||
<button class="btn btn-primary" ng-click="closeSms()">{{'label.button.confirm' | translate}}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</script>
|
||||
|
||||
<script type="text/ng-template" id="reactivatesmscampaign.html">
|
||||
<form name="reactivatesmsform" novalidate="">
|
||||
<api-validate></api-validate>
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-header silver">
|
||||
<h3 class="bolder">{{'label.heading.reactivatesmscampaign' | translate}}</h3>
|
||||
</div>
|
||||
<br/>
|
||||
<div>
|
||||
<label class="control-label col-sm-3">{{'label.input.reactivationdate' | translate}}<span
|
||||
class="required">*</span></label>
|
||||
<div class="col-sm-4">
|
||||
<input id="reActivationDate" name="reActivationDate" type="text" datepicker-pop="dd MMMM yyyy" ng-model="$parent.activationDate"
|
||||
is-open="opened" min="'2000-01-01'" max="'2050-01-01'" class="form-control" required/>
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<form-validate valattributeform="reactivatesmsform" valattribute="reActivationDate"/>
|
||||
</div>
|
||||
<br/>
|
||||
<br/>
|
||||
<br/>
|
||||
<div class="col-md-offset-4">
|
||||
<button class="btn btn-warning" ng-click="cancel()">{{'label.button.cancel' | translate}}</button>
|
||||
<button class="btn btn-primary" ng-click="reactivate()">{{'label.button.confirm' | translate}}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</script>
|
||||
|
||||
<script type="text/ng-template" id="deletesmscampaign.html">
|
||||
<form name="deletesmsform" novalidate="">
|
||||
<api-validate></api-validate>
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-header silver">
|
||||
<h3 class="bolder">{{'label.heading.deletesmscampaign' | translate}}</h3>
|
||||
</div>
|
||||
<br/>
|
||||
<br/>
|
||||
<div class="col-md-offset-4">
|
||||
<button class="btn btn-warning" ng-click="cancel()">{{'label.button.cancel' | translate}}</button>
|
||||
<button class="btn btn-primary" ng-click="delete()">{{'label.button.confirm' | translate}}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</script>
|
||||
</div>
|
||||
Loading…
Reference in New Issue
Block a user