r3232 - in branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main: java/org/chorem/pollen/ui/actions/poll java/org/chorem/pollen/ui/security resources/config resources/i18n webapp/WEB-INF/jsp webapp/WEB-INF/jsp/poll
Author: fdesbois Date: 2012-04-03 20:16:13 +0200 (Tue, 03 Apr 2012) New Revision: 3232 Url: http://chorem.org/repositories/revision/pollen/3232 Log: - implement ClonePoll action based on EditPoll code - manage input method for edit and clone actions Modified: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/ClonePoll.java branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/CreatePoll.java branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/EditPoll.java branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/security/AbstractPollenAuthorization.java branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/config/struts-poll.xml branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/i18n/pollen-ui-struts2_en_GB.properties branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/i18n/pollen-ui-struts2_fr_FR.properties branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/create.jsp branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/pollListHelper.jsp Modified: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/ClonePoll.java =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/ClonePoll.java 2012-04-03 18:16:07 UTC (rev 3231) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/ClonePoll.java 2012-04-03 18:16:13 UTC (rev 3232) @@ -23,36 +23,204 @@ */ package org.chorem.pollen.ui.actions.poll; -import org.chorem.pollen.services.impl.PollService; +import com.google.common.base.Function; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; +import org.chorem.pollen.bean.PollImageChoice; +import org.chorem.pollen.bean.PollUri; +import org.chorem.pollen.business.persistence.Choice; +import org.chorem.pollen.business.persistence.PersonToList; +import org.chorem.pollen.business.persistence.Poll; +import org.chorem.pollen.business.persistence.PollAccount; +import org.chorem.pollen.business.persistence.VotingList; +import org.chorem.pollen.common.ChoiceType; +import org.chorem.pollen.common.PollType; +import java.util.List; + /** * Creates a new poll by cloning an existing one. * * @author tchemit <chemit@codelutin.com> + * @author fdesbois <desbois@codelutin.com> * @since 1.2.6 */ -public class ClonePoll extends AbstractPollUriIdAction { +public class ClonePoll extends CreatePoll { private static final long serialVersionUID = 1L; - protected String redirectUrl; + private static final String PREFIX_CHOICE = "%sChoice_%d"; - public String getRedirectUrl() { - return redirectUrl; + private static final String PREFIX_VOTING_LIST = "votingList_%d"; + + private static final String PREFIX_PERSON_TO_LIST = "personToList_%d_%d"; + + protected PollUri pollUri; + + public final PollUri getUriId() { + return pollUri; } - public void setRedirectUrl(String redirectUrl) { - this.redirectUrl = redirectUrl; + public final void setUriId(PollUri pollUri) { + this.pollUri = pollUri; } + public String getPollUid() { + return pollUri.getPollId(); + } + + protected boolean keepTopiaId() { + return false; + } + @Override - public String execute() throws Exception { + public Poll getPoll() { + if (poll == null) { + poll = getPollService().getPollByPollId(getPollUid()); + + if (!keepTopiaId()) { + poll.setTopiaId(null); + + // Use a new pollId + String pollUid = serviceContext.createPollenUrlId(); + poll.setPollId(pollUid); + } + } + return poll; + } - PollService service = newService(PollService.class); + @Override + public void prepare() throws Exception { - //TODO -// service.clonePoll(pollId, getPollenUserAccount(), accountId); + // -- Choice -- + ChoiceType choiceType = getPoll().getChoiceType(); + prepareParams(getPoll().getChoice(), withChoicePrefix(choiceType)); - return SUCCESS; + // -- VotingList -- + if (getPoll().getPollType() != PollType.FREE) { + prepareParams(getPoll().getVotingList(), withVotingListPrefix()); + } + + super.prepare(); } + + private Function<Choice, String> withChoicePrefix(final ChoiceType choiceType) { + final String choiceTypeName = choiceType.name().toLowerCase(); + return new IndexedFunction<Choice, String>() { + + @Override + protected String apply(Choice input, int index) { + + String prefix = String.format(PREFIX_CHOICE, choiceTypeName, index); + if (keepTopiaId()) { + putParameter(prefix, Choice.TOPIA_ID, input.getTopiaId()); + } + putParameter(prefix, Choice.PROPERTY_NAME, input.getName()); + putParameter(prefix, Choice.PROPERTY_DESCRIPTION, input.getDescription()); + + if (choiceType == ChoiceType.IMAGE) { + putParameter(prefix, PollImageChoice.PROPERTY_LOCATION, input.getName()); + } + + return prefix; + } + }; + } + + private Function<VotingList, String> withVotingListPrefix() { + return new IndexedFunction<VotingList, String>() { + + @Override + protected String apply(VotingList input, int index) { + + String prefix = String.format(PREFIX_VOTING_LIST, index); + if (keepTopiaId()) { + putParameter(prefix, VotingList.TOPIA_ID, input.getTopiaId()); + } + putParameter(prefix, VotingList.PROPERTY_NAME, input.getName()); + putParameter(prefix, VotingList.PROPERTY_WEIGHT, String.valueOf(input.getWeight())); + + prepareParams(input.getPollAccountPersonToList(), withPersonToListPrefix(index)); + + return prefix; + } + }; + } + + private Function<PersonToList, String> withPersonToListPrefix(final int votingListIndex) { + return new IndexedFunction<PersonToList, String>() { + + @Override + protected String apply(PersonToList input, int index) { + + PollAccount pollAccount = input.getPollAccount(); + + String prefix = String.format(PREFIX_PERSON_TO_LIST, votingListIndex, index); + if (keepTopiaId()) { + putParameter(prefix, PersonToList.TOPIA_ID, input.getTopiaId()); + } + putParameter(prefix, PersonToList.PROPERTY_WEIGHT, String.valueOf(input.getWeight())); + putParameter(prefix, PollAccount.PROPERTY_ACCOUNT_ID, pollAccount.getAccountId()); + putParameter(prefix, PollAccount.PROPERTY_VOTING_ID, pollAccount.getVotingId()); + putParameter(prefix, PollAccount.PROPERTY_EMAIL, pollAccount.getEmail()); + + return prefix; + } + }; + } + + /** + * Prepare the {@code source} for parameters using the {@code function} to + * push necessary data. + * + * @param source List of elements + * @param function Function used to push element data using {@link #putParameter(String, String, String)} + * @param <T> Type of data + * @see #putParameter(String, String, String) + */ + private <T> void prepareParams(List<T> source, Function<T, String> function) { + ImmutableList.copyOf(Lists.transform(source, function)); + } + + /** + * Put some data in the {@code parameters} with name built using + * {@code prefix} and {@code property}. The {@code value} will be put for + * this parameter. + * + * @param prefix Prefix to use for the parameter name + * @param property Name of the {@code property} to push in parameters + * @param value Value of this {@code property} + */ + private void putParameter(String prefix, String property, String value) { + parameters.put(prefix + "." + property, new String[]{value}); + } + + /** + * Guava {@link Function} that keeps index on each {@link Function#apply(Object)} call. + * You just have to implement {@link #apply(Object, int)} to have the current + * index of the {@code input} value. + * + * @param <F> Type of data where function will be applied on + * @param <T> Resulting type + */ + private abstract static class IndexedFunction<F, T> implements Function<F, T> { + + private int index; + + @Override + public T apply(F input) { + T result = apply(input, index); + index++; + return result; + } + + /** + * Called during {@link #apply(Object)} method with current {@code index}. + * + * @param input current value + * @param index current index + * @return the result of the function applied on the {@code input} object + */ + protected abstract T apply(F input, int index); + } } Modified: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/CreatePoll.java =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/CreatePoll.java 2012-04-03 18:16:07 UTC (rev 3231) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/CreatePoll.java 2012-04-03 18:16:13 UTC (rev 3232) @@ -519,7 +519,7 @@ // remove all stuff from session getPollenSession().clearDynamicData(); - addActionMessage(_("pollen.info.poll.created")); + addActionMessage(_("pollen.information.poll.created")); return SUCCESS; } Modified: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/EditPoll.java =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/EditPoll.java 2012-04-03 18:16:07 UTC (rev 3231) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/EditPoll.java 2012-04-03 18:16:13 UTC (rev 3232) @@ -23,21 +23,8 @@ */ package org.chorem.pollen.ui.actions.poll; -import com.google.common.base.Function; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.Lists; -import org.chorem.pollen.bean.PollImageChoice; -import org.chorem.pollen.bean.PollUri; -import org.chorem.pollen.business.persistence.Choice; -import org.chorem.pollen.business.persistence.PersonToList; -import org.chorem.pollen.business.persistence.Poll; -import org.chorem.pollen.business.persistence.PollAccount; -import org.chorem.pollen.business.persistence.VotingList; -import org.chorem.pollen.common.ChoiceType; -import org.chorem.pollen.common.PollType; import org.chorem.pollen.ui.actions.PollUriConverter; -import java.util.List; import java.util.Map; /** @@ -47,26 +34,10 @@ * @author fdesbois <desbois@codelutin.com> * @since 1.2.6 */ -public class EditPoll extends CreatePoll { +public class EditPoll extends ClonePoll { - private static final String PREFIX_CHOICE = "%sChoice_%d"; - - private static final String PREFIX_VOTING_LIST = "votingList_%d"; - - private static final String PREFIX_PERSON_TO_LIST = "personToList_%d_%d"; - private static final long serialVersionUID = 1L; - protected PollUri pollUri; - - public final PollUri getUriId() { - return pollUri; - } - - public final void setUriId(PollUri pollUri) { - this.pollUri = pollUri; - } - protected void preparePollUri(Map<String, String[]> parameters) { if (pollUri == null) { String[] values = parameters.get("uriId"); @@ -74,39 +45,20 @@ } } - protected boolean needTopiaId() { + @Override + protected boolean keepTopiaId() { return true; } public boolean isVoteStarted() { return getPoll().sizeVote() > 0; } - + @Override - public Poll getPoll() { - if (poll == null) { - poll = getPollService().getPollByPollId(pollUri.getPollId()); - if (!needTopiaId()) { - poll.setTopiaId(null); - } - } - return poll; - } - - @Override public void prepare() throws Exception { preparePollUri(parameters); - // -- Choice -- - ChoiceType choiceType = getPoll().getChoiceType(); - prepareParams(getPoll().getChoice(), withChoicePrefix(choiceType)); - - // -- VotingList -- - if (getPoll().getPollType() != PollType.FREE) { - prepareParams(getPoll().getVotingList(), withVotingListPrefix()); - } - super.prepare(); } @@ -118,127 +70,7 @@ // remove all stuff from session getPollenSession().clearDynamicData(); - addActionMessage(_("pollen.info.poll.created")); + addActionMessage(_("pollen.information.poll.updated")); return SUCCESS; } - - private Function<Choice, String> withChoicePrefix(final ChoiceType choiceType) { - final String choiceTypeName = choiceType.name().toLowerCase(); - return new IndexedFunction<Choice, String>() { - - @Override - protected String apply(Choice input, int index) { - - String prefix = String.format(PREFIX_CHOICE, choiceTypeName, index); - if (needTopiaId()) { - putParameter(prefix, Choice.TOPIA_ID, input.getTopiaId()); - } - putParameter(prefix, Choice.PROPERTY_NAME, input.getName()); - putParameter(prefix, Choice.PROPERTY_DESCRIPTION, input.getDescription()); - - if (choiceType == ChoiceType.IMAGE) { - putParameter(prefix, PollImageChoice.PROPERTY_LOCATION, input.getName()); - } - - return prefix; - } - }; - } - - private Function<VotingList, String> withVotingListPrefix() { - return new IndexedFunction<VotingList, String>() { - - @Override - protected String apply(VotingList input, int index) { - - String prefix = String.format(PREFIX_VOTING_LIST, index); - if (needTopiaId()) { - putParameter(prefix, VotingList.TOPIA_ID, input.getTopiaId()); - } - putParameter(prefix, VotingList.PROPERTY_NAME, input.getName()); - putParameter(prefix, VotingList.PROPERTY_WEIGHT, String.valueOf(input.getWeight())); - - prepareParams(input.getPollAccountPersonToList(), withPersonToListPrefix(index)); - - return prefix; - } - }; - } - - private Function<PersonToList, String> withPersonToListPrefix(final int votingListIndex) { - return new IndexedFunction<PersonToList, String>() { - - @Override - protected String apply(PersonToList input, int index) { - - PollAccount pollAccount = input.getPollAccount(); - - String prefix = String.format(PREFIX_PERSON_TO_LIST, votingListIndex, index); - if (needTopiaId()) { - putParameter(prefix, PersonToList.TOPIA_ID, input.getTopiaId()); - } - putParameter(prefix, PersonToList.PROPERTY_WEIGHT, String.valueOf(input.getWeight())); - putParameter(prefix, PollAccount.PROPERTY_ACCOUNT_ID, pollAccount.getAccountId()); - putParameter(prefix, PollAccount.PROPERTY_VOTING_ID, pollAccount.getVotingId()); - putParameter(prefix, PollAccount.PROPERTY_EMAIL, pollAccount.getEmail()); - - return prefix; - } - }; - } - - /** - * Prepare the {@code source} for parameters using the {@code function} to - * push necessary data. - * - * @param source List of elements - * @param function Function used to push element data using {@link #putParameter(String, String, String)} - * @param <T> Type of data - * @see #putParameter(String, String, String) - */ - private <T> void prepareParams(List<T> source, Function<T, String> function) { - ImmutableList.copyOf(Lists.transform(source, function)); - } - - /** - * Put some data in the {@code parameters} with name built using - * {@code prefix} and {@code property}. The {@code value} will be put for - * this parameter. - * - * @param prefix Prefix to use for the parameter name - * @param property Name of the {@code property} to push in parameters - * @param value Value of this {@code property} - */ - private void putParameter(String prefix, String property, String value) { - parameters.put(prefix + "." + property, new String[]{value}); - } - - /** - * Guava {@link Function} that keeps index on each {@link Function#apply(Object)} call. - * You just have to implement {@link #apply(Object, int)} to have the current - * index of the {@code input} value. - * - * @param <F> Type of data where function will be applied on - * @param <T> Resulting type - */ - private abstract static class IndexedFunction<F, T> implements Function<F, T> { - - private int index; - - @Override - public T apply(F input) { - T result = apply(input, index); - index++; - return result; - } - - /** - * Called during {@link #apply(Object)} method with current {@code index}. - * - * @param input current value - * @param index current index - * @return the result of the function applied on the {@code input} object - */ - protected abstract T apply(F input, int index); - } } Modified: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/security/AbstractPollenAuthorization.java =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/security/AbstractPollenAuthorization.java 2012-04-03 18:16:07 UTC (rev 3231) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/security/AbstractPollenAuthorization.java 2012-04-03 18:16:13 UTC (rev 3232) @@ -50,7 +50,7 @@ public abstract class AbstractPollenAuthorization extends AuthorizationFilter { public static final Pattern URI_PATTERN = - Pattern.compile("/.*/(.[^/]+)/(.+)"); + Pattern.compile("/.*/(.[^/]+)/(.[^!]+)"); /** Logger. */ private static final Log log = Modified: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/config/struts-poll.xml =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/config/struts-poll.xml 2012-04-03 18:16:07 UTC (rev 3231) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/config/struts-poll.xml 2012-04-03 18:16:13 UTC (rev 3232) @@ -103,7 +103,8 @@ <action name="clone/*" class="org.chorem.pollen.ui.actions.poll.ClonePoll"> <param name="uriId">{1}</param> - <result type="redirect2"/> + <result name="input">/WEB-INF/jsp/poll/create.jsp</result> + <result>/WEB-INF/jsp/poll/resume.jsp</result> </action> <!-- export poll --> Modified: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/i18n/pollen-ui-struts2_en_GB.properties =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/i18n/pollen-ui-struts2_en_GB.properties 2012-04-03 18:16:07 UTC (rev 3231) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/i18n/pollen-ui-struts2_en_GB.properties 2012-04-03 18:16:13 UTC (rev 3232) @@ -18,6 +18,7 @@ pollen.action.deleteUser=Delete selected user pollen.action.deleteVote=Supprimer ce vote pollen.action.editFavoriteList=Edit a list +pollen.action.editPoll=Edit the poll pollen.action.editPollAccount=Edit selected member pollen.action.editUser=Edit selected user pollen.action.editVote=Modifier le vote @@ -178,8 +179,8 @@ pollen.fieldset.userInformation.toCreate=User informations to create pollen.fieldset.userInformation.toDelete=User informations to delete pollen.fieldset.userInformation.toUpdate=User informations to update -pollen.info.poll.created=Poll created -pollen.info.poll.updated=Poll modified +pollen.information.poll.created=Poll created +pollen.information.poll.updated=Poll modified pollen.information.confirmClonePoll=Confirm clone of poll\: pollen.information.confirmClosePoll=Confirm close of poll\: pollen.information.confirmDeleteChoice=Confirm delete of choice %s Modified: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/i18n/pollen-ui-struts2_fr_FR.properties =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/i18n/pollen-ui-struts2_fr_FR.properties 2012-04-03 18:16:07 UTC (rev 3231) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/resources/i18n/pollen-ui-struts2_fr_FR.properties 2012-04-03 18:16:13 UTC (rev 3232) @@ -21,6 +21,7 @@ pollen.action.deleteUser=Supprimer un utilisateur sélectionné pollen.action.deleteVote=Supprimer ce vote pollen.action.editFavoriteList=Editer une liste sélectionnée +pollen.action.editPoll=Modifier le sondage pollen.action.editPollAccount=Editer le membre sélectionné pollen.action.editUser=Editer un utilisateur sélectionné pollen.action.editVote=Modifier le vote @@ -185,8 +186,8 @@ pollen.fieldset.userInformation.toCreate=Informations de l'utilisateur à créer pollen.fieldset.userInformation.toDelete=Informations de l'utilisateur à supprimer pollen.fieldset.userInformation.toUpdate=Informations de l'utilisateur à mettre à jour -pollen.info.poll.created=Sondage créé -pollen.info.poll.updated=Sondage mise à jour +pollen.information.poll.created=Sondage créé +pollen.information.poll.updated=Sondage mise à jour pollen.information.confirmClonePoll=Confirmer le clonage du sondage \: pollen.information.confirmClosePoll=Confirmer la fermeture du sondage \: pollen.information.confirmDeleteFavoriteList=Confirmer la suppression de la liste de votants \: Modified: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/create.jsp =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/create.jsp 2012-04-03 18:16:07 UTC (rev 3231) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/create.jsp 2012-04-03 18:16:13 UTC (rev 3232) @@ -185,6 +185,8 @@ <s:form method="POST" id="registerForm" namespace="/poll" enctype="multipart/form-data"> + <s:hidden key="poll.topiaId"/> + <sj:tabbedpanel id="formTabs" selectedTab="%{selectedTab}"> <sj:tab id="tabGeneral" target="tgeneral" key="pollen.tab.poll.general"/> Modified: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/pollListHelper.jsp =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/pollListHelper.jsp 2012-04-03 18:16:07 UTC (rev 3231) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/pollListHelper.jsp 2012-04-03 18:16:13 UTC (rev 3232) @@ -40,6 +40,7 @@ <s:url id="editUrl" action="modification/" namespace="/poll"/> <s:url id='editImg' value='/img/edit.png'/> +<s:set id="editMethod" value="input"/> <s:set id='editTitle'><s:text name="pollen.action.pollEdit"/></s:set> <s:url id="closeUrl" action="confirmClosePoll/" namespace="/poll"/> @@ -50,8 +51,9 @@ <s:url id='exportImg' value='/img/export.png'/> <s:set id='exportTitle'><s:text name="pollen.action.pollExport"/></s:set> -<s:url id="cloneUrl" action="clone/" namespace="/poll" method="input"/> +<s:url id="cloneUrl" action="clone/" namespace="/poll"/> <s:url id='cloneImg' value='/img/copy.png'/> +<s:set id="cloneMethod" value="input"/> <s:set id='cloneTitle'><s:text name="pollen.action.pollClone"/></s:set> <s:url id="deleteUrl" action="confirmDeletePoll/" namespace="/poll"/> @@ -80,15 +82,15 @@ return false; } - function confirmClone(id) { - $('.ui-dialog-title').html("<s:text name="pollen.title.clone.poll"/>") - var dialog = $("#confirmDialog"); - var url = "<s:url action='confirmClonePoll/' namespace='/poll'/>"; - url += id + '?' + $.param({redirectUrl:redirectUrl}); - dialog.load(url); - dialog.dialog('open'); - return false; - } +// function confirmClone(id) { +// $('.ui-dialog-title').html("<s:text name="pollen.title.clone.poll"/>") +// var dialog = $("#confirmDialog"); +// var url = "<s:url action='confirmClonePoll/' namespace='/poll'/>"; +// url += id + '?' + $.param({redirectUrl:redirectUrl}); +// dialog.load(url); +// dialog.dialog('open'); +// return false; +// } function pollFunctions(cellvalue, options, rowObject) { @@ -108,7 +110,7 @@ result += formatLink("${resultUrl}" + id, "${resultImg}", "Result", "${resultTitle}") } if (cellvalue.indexOf('edit') > -1) { - result += formatLink("${editUrl}" + adminId, "${editImg}", "Edit", "${editTitle}") + result += formatLink("${editUrl}" + adminId + "!${editMethod}", "${editImg}", "Edit", "${editTitle}") } if (cellvalue.indexOf('close') > -1) { var script = 'return confirmClose("' + adminId + '");' @@ -118,8 +120,9 @@ result += formatLink("${exportUrl}" + id, "${exportImg}", "Export", "${exportTitle}") } if (cellvalue.indexOf('clone') > -1) { - var script = 'return confirmClone("' + adminId + '");' - result += formatLinkByScript(script, "${cloneImg}", "Clone", "${cloneTitle}") +// var script = 'return confirmClone("' + adminId + '");' +// result += formatLinkByScript(script, "${cloneImg}", "Clone", "${cloneTitle}") + result += formatLink("${cloneUrl}" + id + "!${cloneMethod}", "${cloneImg}", "Clone", "${cloneTitle}") } if (cellvalue.indexOf('delete') > -1) { var script = 'return confirmDelete("' + adminId + '");'
participants (1)
-
fdesbois@users.chorem.org