update of the content -> website -> cms:
1. can not update image 2. do not display mapKey field whan create new successful 3. do not display image and mapkey field when click on tree, all fixed git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1202024 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -164,7 +164,6 @@
|
||||
<form name="cmsform" enctype="multipart/form-data" method="post" action="<@ofbizUrl>${formAction}</@ofbizUrl>" style="margin: 0;">
|
||||
<#if (content?has_content)>
|
||||
<input type="hidden" name="dataResourceId" value="${(dataResource.dataResourceId)?if_exists}"/>
|
||||
<input type="hidden" name="mimeTypeId" value="${content.mimeTypeId?default(mimeTypeId)}"/>
|
||||
<input type="hidden" name="contentId" value="${content.contentId}"/>
|
||||
|
||||
<#list requestParameters.keySet() as paramName>
|
||||
@@ -176,11 +175,19 @@
|
||||
<input type="hidden" name="contentAssocTypeId" value="${contentAssocTypeId?default('SUBSITE')}"/>
|
||||
<input type="hidden" name="ownerContentId" value="${contentIdFrom?default(contentRoot)}"/>
|
||||
<input type="hidden" name="contentIdFrom" value="${contentIdFrom?default(contentRoot)}"/>
|
||||
</#if>
|
||||
<#if (dataResourceTypeId != 'IMAGE_OBJECT' && dataResourceTypeId != 'OTHER_OBJECT' && dataResourceTypeId != 'LOCAL_FILE' &&
|
||||
dataResourceTypeId != 'OFBIZ_FILE' && dataResourceTypeId != 'VIDEO_OBJECT' && dataResourceTypeId != 'AUDIO_OBJECT')>
|
||||
<input type="hidden" name="mimeTypeId" value="${mimeTypeId}"/>
|
||||
</#if>
|
||||
<#if (dataResourceTypeId != 'NONE')>
|
||||
<#if (dataResourceTypeId == 'IMAGE_OBJECT' || dataResourceTypeId == 'OTHER_OBJECT' || dataResourceTypeId == 'LOCAL_FILE' ||
|
||||
dataResourceTypeId == 'OFBIZ_FILE' || dataResourceTypeId == 'VIDEO_OBJECT' || dataResourceTypeId == 'AUDIO_OBJECT')>
|
||||
<input type="hidden" name="dataResourceTypeId" value="IMAGE_OBJECT"/>
|
||||
<#else>
|
||||
<input type="hidden" name="dataResourceTypeId" value="${dataResourceTypeId}"/>
|
||||
</#if>
|
||||
</#if>
|
||||
<input type="hidden" name="webSiteId" value="${webSiteId}"/>
|
||||
<input type="hidden" name="dataResourceName" value="${(dataResource.dataResourceName)?if_exists}"/>
|
||||
|
||||
@@ -331,10 +338,11 @@
|
||||
</tr>
|
||||
|
||||
<#-- this all depends on the dataResourceTypeId which was selected -->
|
||||
<#if (dataResourceTypeId == 'IMAGE_OBJECT' || dataResourceTypeId == 'OTHER_OBJECT' ||
|
||||
dataResourceTypeId == 'VIDEO_OBJECT' || dataResourceTypeId == 'AUDIO_OBJECT')>
|
||||
<#if (dataResourceTypeId == 'IMAGE_OBJECT' || dataResourceTypeId == 'OTHER_OBJECT' || dataResourceTypeId == 'LOCAL_FILE' ||
|
||||
dataResourceTypeId == 'OFBIZ_FILE' || dataResourceTypeId == 'VIDEO_OBJECT' || dataResourceTypeId == 'AUDIO_OBJECT')>
|
||||
<tr>
|
||||
<td colspan="2" align="right">
|
||||
<td class="label"></td>
|
||||
<td>
|
||||
<#if ((content.contentId)?has_content)>
|
||||
<@renderContentAsText contentId="${content.contentId}" ignoreTemplate="true"/>
|
||||
</#if>
|
||||
|
||||
@@ -46,84 +46,87 @@
|
||||
}
|
||||
|
||||
<#-- creating the JSON Data -->
|
||||
<#macro fillTreeSubsites assocList>
|
||||
<#if (assocList?has_content)>
|
||||
<#list assocList as assoc>
|
||||
<#assign content = assoc.getRelatedOne("ToContent")/>
|
||||
{
|
||||
"data": {"title" : cutNameLength("${content.contentName!assoc.contentIdTo}"), "attr": {"href": "javascript:void(0);", "onClick" : "callDocument('', '${assoc.contentIdTo}', jQuery('#${assoc.contentIdTo}'), '');"}},
|
||||
|
||||
<#assign assocChilds = content.getRelated("FromContentAssoc")?if_exists/>
|
||||
"attr": {"id" : "${assoc.contentIdTo}", "contentId" : "${assoc.contentId}", "fromDate" : "${assoc.fromDate}", "contentAssocTypeId" : "${assoc.contentAssocTypeId}"}
|
||||
<#if assocChilds?has_content>
|
||||
,"children": [
|
||||
<@fillTreeSubsites assocList = assocChilds/>
|
||||
]
|
||||
</#if>
|
||||
<#if assoc_has_next>
|
||||
},
|
||||
<#else>
|
||||
}
|
||||
</#if>
|
||||
</#list>
|
||||
</#if>
|
||||
</#macro>
|
||||
<#macro fillTreeMenus assocList>
|
||||
<#if (assocList?has_content)>
|
||||
<#list assocList as assoc>
|
||||
<#assign content = assoc.getRelatedOne("ToContent")/>
|
||||
{
|
||||
"data": {"title" : cutNameLength("${content.contentName!assoc.contentIdTo}"), "attr": {"href": "javascript:void(0);", "onClick" : "callDocument('${assoc.contentIdTo}');"}},
|
||||
<#assign assocChilds = content.getRelated("FromContentAssoc")?if_exists/>
|
||||
"attr": {"id" : "${assoc.contentIdTo}", "contentId" : "${assoc.contentId}", "fromDate" : "${assoc.fromDate}"}
|
||||
<#if assocChilds?has_content>
|
||||
,"children": [
|
||||
<@fillTreeMenus assocList = assocChilds/>
|
||||
]
|
||||
</#if>
|
||||
<#if assoc_has_next>
|
||||
},
|
||||
<#else>
|
||||
}
|
||||
</#if>
|
||||
</#list>
|
||||
</#if>
|
||||
</#macro>
|
||||
|
||||
<#macro fillTreeError assocList>
|
||||
<#if (assocList?has_content)>
|
||||
<#list assocList as assoc>
|
||||
<#assign content = assoc.getRelatedOne("ToContent")/>
|
||||
{
|
||||
"data": {"title" : cutNameLength("${content.contentName!assoc.contentIdTo}"), "attr": {"href": "javascript:void(0);", "onClick" : "callDocument('', '${assoc.contentIdTo}', '', '');"}},
|
||||
<#assign assocChilds = content.getRelated("FromContentAssoc")?if_exists/>
|
||||
"attr": {"id" : "${assoc.contentIdTo}", "contentId" : "${assoc.contentId}", "fromDate" : "${assoc.fromDate}"}
|
||||
<#if assocChilds?has_content>
|
||||
,"children": [
|
||||
<@fillTreeError assocList = assocChilds/>
|
||||
]
|
||||
</#if>
|
||||
<#if assoc_has_next>
|
||||
},
|
||||
<#else>
|
||||
}
|
||||
</#if>
|
||||
</#list>
|
||||
</#if>
|
||||
</#macro>
|
||||
|
||||
var rawdata_subsites = [
|
||||
<#if (subsites?has_content)>
|
||||
<@fillTree assocList = subsites/>
|
||||
<#macro fillTree assocList>
|
||||
<#if (assocList?has_content)>
|
||||
<#list assocList as assoc>
|
||||
<#assign content = assoc.getRelatedOne("ToContent")/>
|
||||
{
|
||||
"data": {"title" : cutNameLength("${content.contentName!assoc.contentIdTo}"), "attr": {"href": "javascript:void(0);", "onClick" : "callDocument('', '${assoc.contentIdTo}', '', '');"}},
|
||||
<#assign assocChilds = content.getRelated("FromContentAssoc")?if_exists/>
|
||||
"attr": {"id" : "${assoc.contentIdTo}", "contentId" : "${assoc.contentId}", "fromDate" : "${assoc.fromDate}"}
|
||||
<#if assocChilds?has_content>
|
||||
,"children": [
|
||||
<@fillTree assocList = assocChilds/>
|
||||
]
|
||||
</#if>
|
||||
<#if assoc_has_next>
|
||||
},
|
||||
<#else>
|
||||
}
|
||||
</#if>
|
||||
</#list>
|
||||
</#if>
|
||||
</#macro>
|
||||
<@fillTreeSubsites assocList = subsites/>
|
||||
</#if>
|
||||
];
|
||||
|
||||
var rawdata_menus = [
|
||||
<#if (menus?has_content)>
|
||||
<@fillTree assocList = menus/>
|
||||
<#macro fillTree assocList>
|
||||
<#if (assocList?has_content)>
|
||||
<#list assocList as assoc>
|
||||
<#assign content = assoc.getRelatedOne("ToContent")/>
|
||||
{
|
||||
"data": {"title" : cutNameLength("${content.contentName!assoc.contentIdTo}"), "attr": {"href": "javascript:void(0);", "onClick" : "callDocument('${assoc.contentIdTo}');"}},
|
||||
<#assign assocChilds = content.getRelated("FromContentAssoc")?if_exists/>
|
||||
"attr": {"id" : "${assoc.contentIdTo}", "contentId" : "${assoc.contentId}", "fromDate" : "${assoc.fromDate}"}
|
||||
<#if assocChilds?has_content>
|
||||
,"children": [
|
||||
<@fillTree assocList = assocChilds/>
|
||||
]
|
||||
</#if>
|
||||
<#if assoc_has_next>
|
||||
},
|
||||
<#else>
|
||||
}
|
||||
</#if>
|
||||
</#list>
|
||||
</#if>
|
||||
</#macro>
|
||||
<@fillTreeMenus assocList = menus/>
|
||||
</#if>
|
||||
];
|
||||
|
||||
var rawdata_errors = [
|
||||
<#if (errors?has_content)>
|
||||
<@fillTree assocList = errors/>
|
||||
<#macro fillTree assocList>
|
||||
<#if (assocList?has_content)>
|
||||
<#list assocList as assoc>
|
||||
<#assign content = assoc.getRelatedOne("ToContent")/>
|
||||
{
|
||||
"data": {"title" : cutNameLength("${content.contentName!assoc.contentIdTo}"), "attr": {"href": "javascript:void(0);", "onClick" : "callDocument('', '${assoc.contentIdTo}', '', '');"}},
|
||||
<#assign assocChilds = content.getRelated("FromContentAssoc")?if_exists/>
|
||||
"attr": {"id" : "${assoc.contentIdTo}", "contentId" : "${assoc.contentId}", "fromDate" : "${assoc.fromDate}"}
|
||||
<#if assocChilds?has_content>
|
||||
,"children": [
|
||||
<@fillTree assocList = assocChilds/>
|
||||
]
|
||||
</#if>
|
||||
<#if assoc_has_next>
|
||||
},
|
||||
<#else>
|
||||
}
|
||||
</#if>
|
||||
</#list>
|
||||
</#if>
|
||||
</#macro>
|
||||
<@fillTreeError assocList = errors/>
|
||||
</#if>
|
||||
];
|
||||
|
||||
@@ -343,6 +346,11 @@ var rawdata_errors = [
|
||||
if (contentId != null && contentId.length) {
|
||||
ctx['contentId'] = contentId;
|
||||
}
|
||||
if (objstr) {
|
||||
ctx['contentIdFrom'] = objstr.attr('contentid');
|
||||
ctx['fromDate'] = objstr.attr('fromdate');
|
||||
ctx['contentAssocTypeId'] = objstr.attr('contentassoctypeid');
|
||||
}
|
||||
}
|
||||
|
||||
//jQuerry Ajax Request
|
||||
|
||||
@@ -219,12 +219,16 @@ under the License.
|
||||
</entity-one>
|
||||
|
||||
<set field="parameters.fromDate" type="Timestamp" from-field="parameters.fromDate"/>
|
||||
<entity-one entity-name="ContentAssoc" value-field="assoc">
|
||||
<field-map field-name="contentId" from-field="parameters.contentIdFrom"/>
|
||||
<field-map field-name="contentIdTo" from-field="parameters.contentId"/>
|
||||
<field-map field-name="contentAssocTypeId" from-field="parameters.contentAssocTypeId"/>
|
||||
<field-map field-name="fromDate" from-field="parameters.fromDate"/>
|
||||
</entity-one>
|
||||
<entity-condition list="assocs" entity-name="ContentAssoc">
|
||||
<condition-list>
|
||||
<condition-expr field-name="contentId" from-field="parameters.contentIdFrom"/>
|
||||
<condition-expr field-name="contentIdTo" from-field="parameters.contentId"/>
|
||||
<condition-expr field-name="fromDate" from-field="parameters.fromDate" ignore-if-empty="true"/>
|
||||
<condition-expr field-name="contentAssocTypeId" from-field="parameters.contentAssocTypeId" ignore-if-empty="true"/>
|
||||
</condition-list>
|
||||
<order-by field-name="-fromDate"/>
|
||||
</entity-condition>
|
||||
<set field="assoc" value="${assocs[0]}"/>
|
||||
<entity-and entity-name="ContentPurpose" list="currentPurposes">
|
||||
<field-map field-name="contentId" from-field="contentId"/>
|
||||
</entity-and>
|
||||
|
||||
Reference in New Issue
Block a user