Modification of entry by bidder


This page should only be used if script asks you to manually migrate skin.20240730.FORMS.FormSubmitterEdit

The user who submitted the form can now modify his or her submission via the "My submissions" dashboard (if the lifecycle allows it).

Following this, some changes are to be made to your skins:

For the "My submissions" service (pages/services/form-dashboard)

La structure du template common-service-body-nonempty-content-content a changé. La div <div data-ametys-dashboard-role="results"> est obligatoire !

<xsl:template name="common-service-body-nonempty-content-content">
        <div data-dashboard="{$uniqueId}">
            <div data-ametys-dashboard-role="results">
                <!-- Here will be form's dashbord in JS -->
            </div>
            <xsl:call-template name="loading-indicator"/>
        </div>
</xsl:template>

Now if you have overloaded the common-service-head-css and common-service-head-js templates to add your own css or js, they need to make a single call to a dasboard template ( dashboard-css and dashboard-js respectively).

<xsl:template name="common-service-head-css">
      <xsl:call-template name="dashboard-css"/>
<!-- Vos propres css -->
</xsl:template>
<xsl:template name="common-service-head-js">
      <xsl:call-template name="dashboard-js"/>
<!-- Vos propres JS -->
</xsl:template>

The structure of the dashboard-css and dashboard-js templates has been modified and it is not recommended to overload them!

<xsl:template name="dashboard-css">
<xsl:call-template name="select2-css" />
</xsl:template>
<xsl:template name="dashboard-js">
        <xsl:call-template name="select2-js"/>
        <xsl:call-template name="dashboard-helper-js" />
        <xsl:call-template name="dashboard-dialog-js" />
        <xsl:call-template name="dashboard-initialize-js"/>
</xsl:template>

The dashboard-initialize-js template is the one that calls DashboardHelper.initialize. It is now inadvisable to overload it, just respect the JS method names in the event of overloading.

<xsl:template name="dashboard-initialize-js">
        <script type="text/javascript">
        $j().ready(function() {
            DashboardHelper.initialize("<xsl:value-of select="$uniqueId" />", {
                siteName: "<xsl:value-of select="$site"/>",
                lang: "<xsl:value-of select="$lang"/>",
                contextPath: "<xsl:value-of select="$site-uri-prefix"/>",
                entryUrl: "<xsl:value-of select="$get-entry-fields-url"/>",
                onShowDashboard: onShowDashboard_<xsl:value-of select="$uniqueId"/>,
                onShowEntry: onShowEntry_<xsl:value-of select="$uniqueId" />,
                onShowHistory: onShowHistory_<xsl:value-of select="$uniqueId" />,
                onShowError: onShowError_<xsl:value-of select="$uniqueId" />,
                onShowActionDialog: onShowActionDialog_<xsl:value-of select="$uniqueId" />,
                onHideActionDialog: onHideActionDialog_<xsl:value-of select="$uniqueId" />,
                dashboardView: "<xsl:value-of select="$dashboard-view"/>",
                zoneItemId: "<xsl:value-of select="ametys:zoneItemId()" />"
            });
        });
        </script>
</xsl:template>

Any overloading of dialog boxes during actions (history, view entries, workflow actions, ...) must be in a "dashboard-dialog-js" template.

You also need to move all the JS methods for actions from the admin-dashboard-js template to the "dashboard-dialog-js" template in pages/services/common/dashboard.
In effect, the methods become common.

In case of doubt, please refer to the JIRA https://issues issue.ametys.org/browse/FORMS-655 and in particular to the commit associated with the intranet charter.

For the "Dashboard" service (pages/services/form-admin-dashboard)

if you have overloaded the common-service-head-css and common-service-head-js templates to add your own css or js, they need to make a single call to a dasboard template ( admin-dashboard-css and admin-dashboard-js respectively).

<xsl:template name="common-service-head-css">
  <xsl:call-template name="admin-dashboard-css"/>
<!-- Vos propres CSS -->
</xsl:template>
<xsl:template name="common-service-head-js">
  <xsl:call-template name="admin-dashboard-js"/>
   <!-- Vos propres JS -->
</xsl:template>

The structure of the admin-dashboard-css and admin-dashboard-js templates has been modified, and we advise against overloading them!

<xsl:template name="admin-dashboard-css">
        <xsl:call-template name="select2-css" />
</xsl:template>
<xsl:template name="admin-dashboard-js">
        <xsl:call-template name="select2-js" />
        <xsl:call-template name="dashboard-helper-js" />
        <xsl:call-template name="dashboard-dialog-js" />
        <xsl:call-template name="admin-dashboard-initialize-js" />
</xsl:template>

The admin-dashboard-initialize-js template is the one that calls DashboardHelper.initializeAdmin. It is not recommended to overload it, just respect the JS method names in the event of overloading.

<xsl:template name="admin-dashboard-initialize-js">
        <script type="text/javascript">
    
        $j().ready(function() {
            DashboardHelper.initializeAdmin("<xsl:value-of select="$uniqueId" />", {
                siteName: "<xsl:value-of select="$site"/>",
                lang: "<xsl:value-of select="$lang"/>",
                contextPath: "<xsl:value-of select="$site-uri-prefix"/>",
                entryUrl: "<xsl:value-of select="$get-entry-fields-url"/>",
                onShowDashboard: onShowDashboard_<xsl:value-of select="$uniqueId"/>,
                onShowEntry: onShowEntry_<xsl:value-of select="$uniqueId" />,
                onShowHistory: onShowHistory_<xsl:value-of select="$uniqueId" />,
                onShowError: onShowError_<xsl:value-of select="$uniqueId" />,
                onShowActionDialog: onShowActionDialog_<xsl:value-of select="$uniqueId" />,
                onHideActionDialog: onHideActionDialog_<xsl:value-of select="$uniqueId" />,
                dashboardView: "<xsl:value-of select="$dashboard-view"/>",
                nbEntriesByPage: "<xsl:value-of select='$nb-entries-by-page' />",
                entriesSortOrder: "<xsl:value-of select='$entries-sort-order' />",
                zoneItemId: "<xsl:value-of select="ametys:zoneItemId()" />"
            });
        });
        
        </script>
</xsl:template>

Any overloading of dialog boxes during actions (history, view entries, workflow actions, ...) must be in a "dashboard-dialog-js" template, normally already migrated in the previous chapter.

In case of doubt, please refer to the JIRA https://issues issue.ametys.org/browse/FORMS-655 and in particular to the commit associated with the intranet charter.

Back to top