Prevent from deleting the last slot
- Also fix the corresponding translation when a problem arise.
This commit is contained in:
parent
64b79965c6
commit
fa111ab04e
@ -331,7 +331,7 @@ if (!empty($_GET['delete_column'])) {
|
|||||||
if ($result) {
|
if ($result) {
|
||||||
$message = new Message('success', __('adminstuds', 'Column removed'));
|
$message = new Message('success', __('adminstuds', 'Column removed'));
|
||||||
} else {
|
} else {
|
||||||
$message = new Message('danger', __('Error', 'Failed to delete the column'));
|
$message = new Message('danger', __('Error', 'Failed to delete column'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -117,6 +117,10 @@ class AdminPollService {
|
|||||||
|
|
||||||
$slots = $this->pollService->allSlotsByPollId($poll_id);
|
$slots = $this->pollService->allSlotsByPollId($poll_id);
|
||||||
|
|
||||||
|
if (count($slots) === 1) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
$index = 0;
|
$index = 0;
|
||||||
$indexToDelete = -1;
|
$indexToDelete = -1;
|
||||||
$newMoments = [];
|
$newMoments = [];
|
||||||
@ -155,6 +159,10 @@ class AdminPollService {
|
|||||||
|
|
||||||
$slots = $this->pollService->allSlotsByPollId($poll_id);
|
$slots = $this->pollService->allSlotsByPollId($poll_id);
|
||||||
|
|
||||||
|
if (count($slots) === 1) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
$index = 0;
|
$index = 0;
|
||||||
$indexToDelete = -1;
|
$indexToDelete = -1;
|
||||||
|
|
||||||
|
@ -326,6 +326,7 @@
|
|||||||
"Update vote failed": "Update vote failed",
|
"Update vote failed": "Update vote failed",
|
||||||
"Adding vote failed": "Adding vote failed",
|
"Adding vote failed": "Adding vote failed",
|
||||||
"Comment failed": "Kommentar gescheitert",
|
"Comment failed": "Kommentar gescheitert",
|
||||||
"You can't create a poll with hidden results with the following edition option:": "Sie können nicht eine Umfrage erstellen mit versteckten Ergebnisse mit der folgenden Ausgabe-Option:"
|
"You can't create a poll with hidden results with the following edition option:": "Sie können nicht eine Umfrage erstellen mit versteckten Ergebnisse mit der folgenden Ausgabe-Option:",
|
||||||
|
"Failed to delete column": "Fehler beim Spalte löschen"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -326,6 +326,7 @@
|
|||||||
"Update vote failed": "Update vote failed",
|
"Update vote failed": "Update vote failed",
|
||||||
"Adding vote failed": "Adding vote failed",
|
"Adding vote failed": "Adding vote failed",
|
||||||
"Comment failed": "Comment failed",
|
"Comment failed": "Comment failed",
|
||||||
"You can't create a poll with hidden results with the following edition option:": "You can't create a poll with hidden results with the following edition option: "
|
"You can't create a poll with hidden results with the following edition option:": "You can't create a poll with hidden results with the following edition option: ",
|
||||||
|
"Failed to delete column": "Failed to delete column"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -326,6 +326,7 @@
|
|||||||
"Update vote failed": "ES_Mise à jour du vote échoué",
|
"Update vote failed": "ES_Mise à jour du vote échoué",
|
||||||
"Adding vote failed": "ES_Ajout d'un vote échoué",
|
"Adding vote failed": "ES_Ajout d'un vote échoué",
|
||||||
"Comment failed": "ES_Commentaire échoué",
|
"Comment failed": "ES_Commentaire échoué",
|
||||||
"You can't create a poll with hidden results with the following edition option:": "ES_Vous ne pouvez pas créer de sondage avec résulats cachés avec les options d'éditions suivantes : "
|
"You can't create a poll with hidden results with the following edition option:": "ES_Vous ne pouvez pas créer de sondage avec résulats cachés avec les options d'éditions suivantes : ",
|
||||||
|
"Failed to delete column": "Error al eliminar la columna"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -326,6 +326,7 @@
|
|||||||
"Update vote failed": "Mise à jour du vote échoué",
|
"Update vote failed": "Mise à jour du vote échoué",
|
||||||
"Adding vote failed": "Ajout d'un vote échoué",
|
"Adding vote failed": "Ajout d'un vote échoué",
|
||||||
"Comment failed": "Commentaire échoué",
|
"Comment failed": "Commentaire échoué",
|
||||||
"You can't create a poll with hidden results with the following edition option:": "Vous ne pouvez pas créer de sondage avec résulats cachés avec les options d'éditions suivantes : "
|
"You can't create a poll with hidden results with the following edition option:": "Vous ne pouvez pas créer de sondage avec résulats cachés avec les options d'éditions suivantes : ",
|
||||||
|
"Failed to delete column": "Échec de la suppression de colonne"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -326,6 +326,7 @@
|
|||||||
"Update vote failed": "IT_Mise à jour du vote échoué",
|
"Update vote failed": "IT_Mise à jour du vote échoué",
|
||||||
"Adding vote failed": "IT_Ajout d'un vote échoué",
|
"Adding vote failed": "IT_Ajout d'un vote échoué",
|
||||||
"Comment failed": "IT_Commentaire échoué",
|
"Comment failed": "IT_Commentaire échoué",
|
||||||
"You can't create a poll with hidden results with the following edition option:": "IT_Vous ne pouvez pas créer de sondage avec résulats cachés avec les options d'éditions suivantes : "
|
"You can't create a poll with hidden results with the following edition option:": "IT_Vous ne pouvez pas créer de sondage avec résulats cachés avec les options d'éditions suivantes : ",
|
||||||
|
"Failed to delete column": "Impossibile eliminare colonna"
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user