mirror of https://github.com/gophish/gophish
Fix resource selection during campaign copy (#2482)
Clear the selection of resource (template, page, profile) whenever the original resource is deleted and there is only one currently available resource present in the DB while copying a campaign. Without this fix, the only available resource is shown as the original resource, instead of showing [Deleted].pull/2599/head
parent
2b85a2bda5
commit
53537a221a
|
@ -257,6 +257,7 @@ function copy(idx) {
|
||||||
.success(function (campaign) {
|
.success(function (campaign) {
|
||||||
$("#name").val("Copy of " + campaign.name)
|
$("#name").val("Copy of " + campaign.name)
|
||||||
if (!campaign.template.id) {
|
if (!campaign.template.id) {
|
||||||
|
$("#template").val("").change();
|
||||||
$("#template").select2({
|
$("#template").select2({
|
||||||
placeholder: campaign.template.name
|
placeholder: campaign.template.name
|
||||||
});
|
});
|
||||||
|
@ -265,6 +266,7 @@ function copy(idx) {
|
||||||
$("#template").trigger("change.select2")
|
$("#template").trigger("change.select2")
|
||||||
}
|
}
|
||||||
if (!campaign.page.id) {
|
if (!campaign.page.id) {
|
||||||
|
$("#page").val("").change();
|
||||||
$("#page").select2({
|
$("#page").select2({
|
||||||
placeholder: campaign.page.name
|
placeholder: campaign.page.name
|
||||||
});
|
});
|
||||||
|
@ -273,6 +275,7 @@ function copy(idx) {
|
||||||
$("#page").trigger("change.select2")
|
$("#page").trigger("change.select2")
|
||||||
}
|
}
|
||||||
if (!campaign.smtp.id) {
|
if (!campaign.smtp.id) {
|
||||||
|
$("#profile").val("").change();
|
||||||
$("#profile").select2({
|
$("#profile").select2({
|
||||||
placeholder: campaign.smtp.name
|
placeholder: campaign.smtp.name
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue