|
@@ -687,7 +687,7 @@ Template.cardDetailsActionsPopup.events({
|
|
'click .js-move-card': Popup.open('moveCard'),
|
|
'click .js-move-card': Popup.open('moveCard'),
|
|
'click .js-copy-card': Popup.open('copyCard'),
|
|
'click .js-copy-card': Popup.open('copyCard'),
|
|
'click .js-convert-checklist-item-to-card': Popup.open('convertChecklistItemToCard'),
|
|
'click .js-convert-checklist-item-to-card': Popup.open('convertChecklistItemToCard'),
|
|
- 'click .js-copy-checklist-cards': Popup.open('copyChecklistToManyCards'),
|
|
|
|
|
|
+ 'click .js-copy-checklist-cards': Popup.open('copyManyCards'),
|
|
'click .js-set-card-color': Popup.open('setCardColor'),
|
|
'click .js-set-card-color': Popup.open('setCardColor'),
|
|
'click .js-move-card-to-top'(event) {
|
|
'click .js-move-card-to-top'(event) {
|
|
event.preventDefault();
|
|
event.preventDefault();
|
|
@@ -1035,18 +1035,8 @@ class DialogWithBoardSwimlaneList extends BlazeComponent {
|
|
const title = textarea.val().trim();
|
|
const title = textarea.val().trim();
|
|
|
|
|
|
if (title) {
|
|
if (title) {
|
|
- const oldTitle = card.title;
|
|
|
|
- card.title = title;
|
|
|
|
- card.coverId = '';
|
|
|
|
-
|
|
|
|
// insert new card to the top of new list
|
|
// insert new card to the top of new list
|
|
- const minOrder = card.getMinSort(listId, swimlaneId);
|
|
|
|
- card.sort = minOrder - 1;
|
|
|
|
-
|
|
|
|
- const newCardId = card.copy(boardId, swimlaneId, listId);
|
|
|
|
-
|
|
|
|
- // restore the old card title, otherwise the card title would change in the current view (only temporary)
|
|
|
|
- card.title = oldTitle;
|
|
|
|
|
|
+ const newCardId = Meteor.call('copyCard', card._id, boardId, swimlaneId, listId, true, {title: title});
|
|
|
|
|
|
// In case the filter is active we need to add the newly inserted card in
|
|
// In case the filter is active we need to add the newly inserted card in
|
|
// the list of exceptions -- cards that are not filtered. Otherwise the
|
|
// the list of exceptions -- cards that are not filtered. Otherwise the
|
|
@@ -1099,20 +1089,9 @@ Template.convertChecklistItemToCardPopup.events({
|
|
const title = textarea.val().trim();
|
|
const title = textarea.val().trim();
|
|
|
|
|
|
if (title) {
|
|
if (title) {
|
|
- const oldTitle = card.title;
|
|
|
|
-
|
|
|
|
const titleList = JSON.parse(title);
|
|
const titleList = JSON.parse(title);
|
|
- for (let i = 0; i < titleList.length; i++) {
|
|
|
|
- const obj = titleList[i];
|
|
|
|
- card.title = obj.title;
|
|
|
|
- card.description = obj.description;
|
|
|
|
- card.coverId = '';
|
|
|
|
-
|
|
|
|
- // insert new card to the top of new list
|
|
|
|
- const maxOrder = card.getMaxSort(listId, swimlaneId);
|
|
|
|
- card.sort = maxOrder + 1;
|
|
|
|
-
|
|
|
|
- const newCardId = card.copy(boardId, swimlaneId, listId);
|
|
|
|
|
|
+ for (const obj of titleList) {
|
|
|
|
+ const newCardId = Meteor.call('copyCard', card._id, boardId, swimlaneId, listId, false, {title: obj.title, description: obj.description});
|
|
|
|
|
|
// In case the filter is active we need to add the newly inserted card in
|
|
// In case the filter is active we need to add the newly inserted card in
|
|
// the list of exceptions -- cards that are not filtered. Otherwise the
|
|
// the list of exceptions -- cards that are not filtered. Otherwise the
|
|
@@ -1120,12 +1099,9 @@ Template.convertChecklistItemToCardPopup.events({
|
|
// See https://github.com/wekan/wekan/issues/80
|
|
// See https://github.com/wekan/wekan/issues/80
|
|
Filter.addException(newCardId);
|
|
Filter.addException(newCardId);
|
|
}
|
|
}
|
|
-
|
|
|
|
- // restore the old card title, otherwise the card title would change in the current view (only temporary)
|
|
|
|
- card.title = oldTitle;
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-}).register('copyChecklistToManyCardsPopup');
|
|
|
|
|
|
+}).register('copyManyCardsPopup');
|
|
|
|
|
|
BlazeComponent.extendComponent({
|
|
BlazeComponent.extendComponent({
|
|
onCreated() {
|
|
onCreated() {
|