- add active authors and contributors
- check redundant authors and contributors
This commit is contained in:
parent
8f040c2770
commit
68add9025f
|
@ -335,6 +335,8 @@ class IndexController extends Controller
|
|||
$dataset->persons()->attach($person['id'], $pivot_data);
|
||||
} else {
|
||||
$dataPerson = new Person($person);
|
||||
$dataPerson->status = true;
|
||||
$dataPerson->name_type = "Organizational";
|
||||
$dataset->persons()->save($dataPerson, $pivot_data);
|
||||
}
|
||||
}
|
||||
|
@ -360,6 +362,8 @@ class IndexController extends Controller
|
|||
$dataset->persons()->attach($contributor['id'], $pivot_data);
|
||||
} else {
|
||||
$dataContributor = new Person($contributor);
|
||||
$dataContributor->status = true;
|
||||
$dataContributor->name_type = "Organizational";
|
||||
$dataset->persons()->save($dataContributor, $pivot_data);
|
||||
}
|
||||
}
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -500,10 +500,15 @@ const app = new Vue({
|
|||
onAddAuthor(person) {
|
||||
//if person is not in person array
|
||||
//if (this.persons.includes(person) == false) {
|
||||
if (this.dataset.persons.filter(e => e.id === person.id).length == 0) {
|
||||
if (this.dataset.persons.filter(e => e.id === person.id).length > 0) {
|
||||
this.$toast.error("person is already defined as author");
|
||||
} else if (this.dataset.contributors.filter(e => e.id === person.id).length > 0) {
|
||||
this.$toast.error("person is already defined as contributor");
|
||||
} else {
|
||||
//person.sort_order = this.dataset.persons.length;
|
||||
this.dataset.persons.push(person);
|
||||
this.dataset.checkedAuthors.push(person.id);
|
||||
this.$toast.success("person has been successfully added as author");
|
||||
}
|
||||
},
|
||||
addNewContributor() {
|
||||
|
@ -513,9 +518,14 @@ const app = new Vue({
|
|||
onAddContributor(person) {
|
||||
//if person is not in contributors array
|
||||
//if (this.contributors.includes(person) == false) {
|
||||
if (this.dataset.contributors.filter(e => e.id === person.id).length == 0) {
|
||||
if (this.dataset.contributors.filter(e => e.id === person.id).length > 0) {
|
||||
this.$toast.error("person is already defined as contributor");
|
||||
} else if (this.dataset.persons.filter(e => e.id === person.id).length > 0) {
|
||||
this.$toast.error("person is already defined as author");
|
||||
} else {
|
||||
this.dataset.contributors.push(person);
|
||||
this.dataset.checkedContributors.push(person.id);
|
||||
this.$toast.success("person has been successfully added as contributor");
|
||||
}
|
||||
},
|
||||
// onAddSubmitter(person) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user