Skip to content
This repository has been archived by the owner on Aug 21, 2018. It is now read-only.

Commit

Permalink
[#609] Promote request response to member (#617)
Browse files Browse the repository at this point in the history
609:RequestForManager

[#609] language_attribut channged back to its original

[#609] language_attribut channged back to its original and new language added to other language.txt

[#609] language_attribut channged back to its original and new language added to other language.txt and console.log function removed from mail view and memberform
  • Loading branch information
razu9861 authored and lmmrssa committed Feb 9, 2017
1 parent 148aa60 commit ffcede2
Show file tree
Hide file tree
Showing 10 changed files with 71 additions and 12 deletions.
3 changes: 3 additions & 0 deletions app/MyApp/app/Home-Urdu.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
}
#PromoteToManager{
margin-right:170px;
margin-top:-90px;
margin-right:17px;
}
.resourcInfoFirstCol{
colspan:4;
Expand Down Expand Up @@ -654,6 +656,7 @@ body{
}
#AddCourseMainDiv{
direction: rtl;
margin-right:17px;
}
#collectionTable{
direction: rtl;
Expand Down
5 changes: 3 additions & 2 deletions app/MyApp/app/Home.css
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ select#onDashboardLanguage {
background-color: #e1e1e1;
}
#PromoteToManager{
margin-top:-40px;
margin-left:170px;
margin-top:-90px;
margin-bottom: 25px;
margin-left:17px;
}
#manageOnCourseProgress{
margin-left:84px;
Expand Down
5 changes: 3 additions & 2 deletions app/MyApp/app/tabl.css
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,9 @@ bbf-form ul{border: 5px solid;}
color:red;
}
.signup-submit {
margin-top: -25px;
margin-left: 440px;
margin-top: -4px;
margin-left: 0px;
text-align: auto;
}
.signup-btn.btn {
background-color: #1ABC9C;
Expand Down
48 changes: 46 additions & 2 deletions app/MyApp/app/views/MailView.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ $(function() {
mmodel.fetch({
async: false
})

var username = mmodel.attributes.firstName+" "+mmodel.attributes.lastName
roles = mmodel.get('roles');
if (roles.indexOf('Manager') < 0) {
roles.push("Manager");// if promote to manager checkbox is ticked
Expand All @@ -100,12 +102,54 @@ $(function() {
return
}
});
var temp
var that = this
var currentdate = new Date();


var mailBody = App.languageDict.attributes.Hi + ',<br>' + ' <b>' + username + '</b> ' + ',<br>' + App.languageDict.attributes.Your_Request_Has_Been_Accepted;
temp = new App.Models.Mail()
temp.set("senderId", $.cookie('Member._id'))
temp.set("receiverId", mmodel.get('_id'));
temp.set("status", "0")
temp.set("subject", App.languageDict.attributes.Manager_Request + " | " + username)
temp.set("type", "manager-request")
temp.set("body", mailBody)
temp.set("sendDate", currentdate)
temp.set("entityId",mmodel.get('_id'))
temp.save()




},
"click #promote-reject": function (e) {
var body = mailView.inViewModel.get('body').replace("<br>", "||br||").replace(/<(?:.|\n)*?>/gm, '')
body = body.replace('Accept', '').replace('Reject', '').replace('&nbsp;&nbsp;', '').replace("||br||", "<br>")
mailView.updateMailBody(body)
alert(App.languageDict.attributes.Promote_Request_Rejected)
mailView.updateMailBody(body)
var mmodel = new App.Models.Member({
_id: e.currentTarget.value
})
mmodel.fetch({
async: false
})
var username = mmodel.attributes.firstName+" "+mmodel.attributes.lastName;
var temp
var that = this
var currentdate = new Date();
var mailBody = App.languageDict.attributes.Hi + ',<br>' + ' <b>' + username + '</b> ' + ',<br>' + App.languageDict.attributes.Your_Request_Has_Been_Rejected;
temp = new App.Models.Mail()
temp.set("senderId", $.cookie('Member._id'))
temp.set("receiverId", mmodel.get('_id'));
temp.set("status", "0")
temp.set("subject", App.languageDict.attributes.Manager_Request + " | " + username)
temp.set("type", "manager-request")
temp.set("body", mailBody)
temp.set("sendDate", currentdate)
temp.set("entityId", mmodel.get('_id'))
temp.save()
alert(App.languageDict.attributes.Promote_Request_Rejected)

},
"click #invite-accept": function(e) {
if (mailView.inViewModel.get('type') == "admissionRequest") {
Expand Down
2 changes: 1 addition & 1 deletion app/MyApp/app/views/MemberForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ $(function() {
} else {
buttonText = App.languageDict.attributes.Register
}
if(this.model.id == $.cookie('Member._id') && this.model.get('roles').indexOf('Manager') < 0) {
if(this.model.id != undefined && this.model.id == $.cookie('Member._id') && this.model.get('roles').indexOf('Manager') < 0) {
promoteBtn = '<a class="btn btn-success" id="formManagarRequest" style="margin-top: 10px;">'+App.languageDict.attributes.Manager_Request+'</a>';
} else {
promoteBtn = '';
Expand Down
4 changes: 3 additions & 1 deletion init_docs/Text.json
Original file line number Diff line number Diff line change
Expand Up @@ -836,5 +836,7 @@
"Confirm_Course": "Are you sure you want to delete this Course?",
"Has_Requested_Promote": "has requested to be promoted for 'Manager' access.",
"Promote_Request_Rejected": "Request to promote has been rejected.",
"Promote_Request_Accepted": "Member has been successfully promoted."
"Promote_Request_Accepted": "Member has been successfully promoted.",
"Your_Request_Has_Been_Accepted": "Your Request Has Been Accepted",
"Your_Request_Has_Been_Rejected": "Your Request Has Been Rejected"
}
4 changes: 3 additions & 1 deletion init_docs/languages/Arabic.txt
Original file line number Diff line number Diff line change
Expand Up @@ -838,5 +838,7 @@
"Prompt_MeetUp_save":"Meetup saved! Do you want to invite?",
"Has_Requested_Promote": "has requested to be promoted for 'Manager' access.",
"Promote_Request_Rejected": "Request to promote has been rejected.",
"Promote_Request_Accepted": "Member has been successfully promoted."
"Promote_Request_Accepted": "Member has been successfully promoted.",
"Your_Request_Has_Been_Accepted": "Your Request Has Been Accepted",
"Your_Request_Has_Been_Rejected": "Your Request Has Been Rejected"
}
4 changes: 3 additions & 1 deletion init_docs/languages/English.txt
Original file line number Diff line number Diff line change
Expand Up @@ -836,5 +836,7 @@
"Confirm_Course":"Are you sure you want to delete this Course?",
"Has_Requested_Promote": "has requested to be promoted for 'Manager' access.",
"Promote_Request_Rejected": "Request to promote has been rejected.",
"Promote_Request_Accepted": "Member has been successfully promoted."
"Promote_Request_Accepted": "Member has been successfully promoted.",
"Your_Request_Has_Been_Accepted": "Your Request Has Been Accepted",
"Your_Request_Has_Been_Rejected": "Your Request Has Been Rejected"
}
4 changes: 3 additions & 1 deletion init_docs/languages/Spanish.txt
Original file line number Diff line number Diff line change
Expand Up @@ -836,5 +836,7 @@
"Prompt_MeetUp_save":"Meetup saved! Do you want to invite?",
"Has_Requested_Promote": "has requested to be promoted for 'Manager' access.",
"Promote_Request_Rejected": "Request to promote has been rejected.",
"Promote_Request_Accepted": "Member has been successfully promoted."
"Promote_Request_Accepted": "Member has been successfully promoted.",
"Your_Request_Has_Been_Accepted": "Your Request Has Been Accepted",
"Your_Request_Has_Been_Rejected": "Your Request Has Been Rejected"
}
4 changes: 3 additions & 1 deletion init_docs/languages/Urdu.txt
Original file line number Diff line number Diff line change
Expand Up @@ -848,5 +848,7 @@
"Prompt_MeetUp_save":"Meetup saved! Do you want to invite?",
"Has_Requested_Promote": "has requested to be promoted for 'Manager' access.",
"Promote_Request_Rejected": "Request to promote has been rejected.",
"Promote_Request_Accepted": "Member has been successfully promoted."
"Promote_Request_Accepted": "Member has been successfully promoted.",
"Your_Request_Has_Been_Accepted": "Your Request Has Been Accepted",
"Your_Request_Has_Been_Rejected": "Your Request Has Been Rejected"
}

0 comments on commit ffcede2

Please sign in to comment.