CCM NG/ccm-cms: Localized texts which were not localized yet in AssignedTaskTable
git-svn-id: https://svn.libreccm.org/ccm/ccm_ng@4819 8810af33-2d31-482b-a856-94f89814c4df
parent
eb57263b24
commit
cc7094653a
|
|
@ -29,7 +29,6 @@ import com.arsdigita.bebop.event.TableActionEvent;
|
||||||
import com.arsdigita.bebop.table.DefaultTableCellRenderer;
|
import com.arsdigita.bebop.table.DefaultTableCellRenderer;
|
||||||
import com.arsdigita.bebop.table.TableCellRenderer;
|
import com.arsdigita.bebop.table.TableCellRenderer;
|
||||||
|
|
||||||
|
|
||||||
import com.arsdigita.globalization.GlobalizedMessage;
|
import com.arsdigita.globalization.GlobalizedMessage;
|
||||||
|
|
||||||
import org.libreccm.cdi.utils.CdiUtil;
|
import org.libreccm.cdi.utils.CdiUtil;
|
||||||
|
|
@ -41,6 +40,8 @@ import org.libreccm.workflow.AssignableTaskRepository;
|
||||||
import org.libreccm.workflow.WorkflowManager;
|
import org.libreccm.workflow.WorkflowManager;
|
||||||
import org.librecms.CmsConstants;
|
import org.librecms.CmsConstants;
|
||||||
|
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
public final class AssignedTaskTable extends Table {
|
public final class AssignedTaskTable extends Table {
|
||||||
|
|
||||||
public AssignedTaskTable(final WorkflowRequestLocal workflow) {
|
public AssignedTaskTable(final WorkflowRequestLocal workflow) {
|
||||||
|
|
@ -65,22 +66,20 @@ public final class AssignedTaskTable extends Table {
|
||||||
final int column = event.getColumn();
|
final int column = event.getColumn();
|
||||||
|
|
||||||
final CdiUtil cdiUtil = CdiUtil.createCdiUtil();
|
final CdiUtil cdiUtil = CdiUtil.createCdiUtil();
|
||||||
final AssignableTaskRepository userTaskRepo = cdiUtil.findBean(
|
final AssignableTaskRepository userTaskRepo = cdiUtil
|
||||||
AssignableTaskRepository.class);
|
.findBean(AssignableTaskRepository.class);
|
||||||
final WorkflowManager workflowManager = cdiUtil.findBean(
|
final AssignableTaskManager taskManager = cdiUtil
|
||||||
WorkflowManager.class);
|
.findBean(AssignableTaskManager.class);
|
||||||
final AssignableTaskManager taskManager = cdiUtil.findBean(
|
|
||||||
AssignableTaskManager.class);
|
|
||||||
final Shiro shiro = cdiUtil.findBean(Shiro.class);
|
final Shiro shiro = cdiUtil.findBean(Shiro.class);
|
||||||
|
|
||||||
if (column == 1) {
|
if (column == 1) {
|
||||||
final AssignableTask task = userTaskRepo.findById((Long) event
|
final AssignableTask task = userTaskRepo.findById((Long) event
|
||||||
.getRowKey()).get();
|
.getRowKey()).get();
|
||||||
final User currentUser = shiro.getUser().get();
|
final User currentUser = shiro.getUser().get();
|
||||||
final User lockingUser = task.getLockingUser();
|
final User lockingUser = task.getLockingUser();
|
||||||
if (task.isLocked()
|
if (task.isLocked()
|
||||||
&& lockingUser != null
|
&& lockingUser != null
|
||||||
&& lockingUser.equals(currentUser)) {
|
&& lockingUser.equals(currentUser)) {
|
||||||
taskManager.unlockTask(task);
|
taskManager.unlockTask(task);
|
||||||
} else {
|
} else {
|
||||||
taskManager.lockTask(task);
|
taskManager.lockTask(task);
|
||||||
|
|
@ -104,23 +103,49 @@ public final class AssignedTaskTable extends Table {
|
||||||
final BoxPanel panel = new BoxPanel();
|
final BoxPanel panel = new BoxPanel();
|
||||||
final String lockingUserName = (String) value;
|
final String lockingUserName = (String) value;
|
||||||
if (lockingUserName != null) {
|
if (lockingUserName != null) {
|
||||||
final StringBuilder sb = new StringBuilder("Locked by <br />");
|
|
||||||
final CdiUtil cdiUtil = CdiUtil.createCdiUtil();
|
final CdiUtil cdiUtil = CdiUtil.createCdiUtil();
|
||||||
final Shiro shiro = cdiUtil.findBean(Shiro.class);
|
final Shiro shiro = cdiUtil.findBean(Shiro.class);
|
||||||
if (shiro.getUser().isPresent()
|
|
||||||
&& lockingUserName.equals(shiro.getUser().get().getName())) {
|
final Optional<User> currentUser = shiro.getUser();
|
||||||
sb.append("you");
|
if (currentUser.isPresent()
|
||||||
|
&& currentUser.get().getName().equals(lockingUserName)) {
|
||||||
panel.add(new ControlLink(new Label(
|
panel.add(new ControlLink(new Label(
|
||||||
gz("cms.ui.workflow.task.unlock"))));
|
new GlobalizedMessage("cms.ui.workflow.task.unlock",
|
||||||
|
CmsConstants.CMS_BUNDLE))));
|
||||||
|
panel.add(new Label(
|
||||||
|
new GlobalizedMessage(
|
||||||
|
"cms.ui.workflow.task.locked_by_you",
|
||||||
|
CmsConstants.CMS_BUNDLE)));
|
||||||
} else {
|
} else {
|
||||||
sb.append(lockingUserName);
|
|
||||||
panel.add(new ControlLink(new Label(
|
panel.add(new ControlLink(new Label(
|
||||||
gz("cms.ui.workflow.task.takeover"))));
|
new GlobalizedMessage("cms.ui.workflow.task.takeover",
|
||||||
|
CmsConstants.CMS_BUNDLE))));
|
||||||
|
panel.add(new Label(
|
||||||
|
new GlobalizedMessage(
|
||||||
|
"cms.ui.workflow.task.locked_by",
|
||||||
|
CmsConstants.CMS_BUNDLE,
|
||||||
|
new String[]{lockingUserName})));
|
||||||
}
|
}
|
||||||
panel.add(new Label(sb.toString(), false));
|
|
||||||
|
// final StringBuilder sb = new StringBuilder("Locked by <br />");
|
||||||
|
// final CdiUtil cdiUtil = CdiUtil.createCdiUtil();
|
||||||
|
// final Shiro shiro = cdiUtil.findBean(Shiro.class);
|
||||||
|
// if (shiro.getUser().isPresent()
|
||||||
|
// && lockingUserName.equals(shiro.getUser().get()
|
||||||
|
// .getName())) {
|
||||||
|
// sb.append("you");
|
||||||
|
// panel.add(new ControlLink(new Label(
|
||||||
|
// gz("cms.ui.workflow.task.unlock"))));
|
||||||
|
// } else {
|
||||||
|
// sb.append(lockingUserName);
|
||||||
|
// panel.add(new ControlLink(new Label(
|
||||||
|
// gz("cms.ui.workflow.task.takeover"))));
|
||||||
|
// }
|
||||||
|
// panel.add(new Label(sb.toString(), false));
|
||||||
} else {
|
} else {
|
||||||
panel.add(new ControlLink(
|
panel.add(new ControlLink(
|
||||||
new Label(gz("cms.ui.workflow.task.lock"))));
|
new Label(gz("cms.ui.workflow.task.lock"))));
|
||||||
}
|
}
|
||||||
return panel;
|
return panel;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -327,3 +327,5 @@ cms.ui.workflow.task.reject=Reject
|
||||||
cms.ui.workflow.task.takeover=Take over
|
cms.ui.workflow.task.takeover=Take over
|
||||||
cms.ui.workflow.task.unlock=Unlock task
|
cms.ui.workflow.task.unlock=Unlock task
|
||||||
cms.ui.workflow.task.user.add=Assign user
|
cms.ui.workflow.task.user.add=Assign user
|
||||||
|
cms.ui.workflow.task.locked_by=Locked by {0}
|
||||||
|
cms.ui.workflow.task.locked_by_you=Locked by you
|
||||||
|
|
|
||||||
|
|
@ -324,3 +324,5 @@ cms.ui.workflow.task.reject=Zur\u00fcckweisen
|
||||||
cms.ui.workflow.task.takeover=\u00dcbernehmen
|
cms.ui.workflow.task.takeover=\u00dcbernehmen
|
||||||
cms.ui.workflow.task.unlock=Aufgabe freigeben
|
cms.ui.workflow.task.unlock=Aufgabe freigeben
|
||||||
cms.ui.workflow.task.user.add=Benutzer zuordnen
|
cms.ui.workflow.task.user.add=Benutzer zuordnen
|
||||||
|
cms.ui.workflow.task.locked_by=Reserviert durch {0}
|
||||||
|
cms.ui.workflow.task.locked_by_you=Von Ihnen reserviert
|
||||||
|
|
|
||||||
|
|
@ -283,3 +283,5 @@ cms.ui.workflow.task.reject=Reject
|
||||||
cms.ui.workflow.task.takeover=Take over
|
cms.ui.workflow.task.takeover=Take over
|
||||||
cms.ui.workflow.task.unlock=Unlock task
|
cms.ui.workflow.task.unlock=Unlock task
|
||||||
cms.ui.workflow.task.user.add=Assign user
|
cms.ui.workflow.task.user.add=Assign user
|
||||||
|
cms.ui.workflow.task.locked_by=Locked by {0}
|
||||||
|
cms.ui.workflow.task.locked_by_you=Locked by you
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue