From 4561ae7db8d90f070545be8759bf5d63720752a7 Mon Sep 17 00:00:00 2001 From: Nikita Jibhkate Date: Sun, 3 Apr 2016 00:25:28 +0530 Subject: [PATCH] Status only "Available" for project model with attached projects switched to "Available" fix for issue: 0000826 --- .../dto/referential/ProjectModelStatus.java | 50 +++++++++---------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/src/main/java/org/sigmah/shared/dto/referential/ProjectModelStatus.java b/src/main/java/org/sigmah/shared/dto/referential/ProjectModelStatus.java index 4e65c353c..0163e023a 100644 --- a/src/main/java/org/sigmah/shared/dto/referential/ProjectModelStatus.java +++ b/src/main/java/org/sigmah/shared/dto/referential/ProjectModelStatus.java @@ -1,27 +1,27 @@ -package org.sigmah.shared.dto.referential; - -/* - * #%L - * Sigmah - * %% - * Copyright (C) 2010 - 2016 URD - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program. If not, see - * . - * #L% - */ - +package org.sigmah.shared.dto.referential; + +/* + * #%L + * Sigmah + * %% + * Copyright (C) 2010 - 2016 URD + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ + import org.sigmah.client.i18n.I18N; import org.sigmah.shared.command.result.Result; @@ -122,7 +122,7 @@ public static ProjectModelStatus getStatus(final String status) { */ public static Pair isValidStatusChange(final ProjectModelStatus currentStatus, final ProjectModelStatus targetStatus) { - if (currentStatus == ProjectModelStatus.DRAFT && targetStatus != ProjectModelStatus.READY) { + if (currentStatus == ProjectModelStatus.DRAFT && targetStatus != ProjectModelStatus.READY && targetStatus != ProjectModelStatus.USED) { // "DRAFT" status is only allowed to shift to "READY" status. return new Pair(false, I18N.CONSTANTS.draftModelStatusChangeError());