Well it's also when i just use the original edit.cfm, but will post my
modified one as it's not unusable i missed something:
<cfsetting enablecfoutputonly="true" />
<cfimport taglib="/farcry/core/tags/formtools" prefix="ft" />
<cfimport taglib="/farcry/core/tags/extjs" prefix="extjs" />
<cfimport taglib="/farcry/core/tags/webskin" prefix="skin" />
<!--- get the polling data stats --->
<cfset obj = createObject
('component',application.stcoapi.pollingvotes.typePath) />
<!--- set default answer_sum so calculate can be done --->
<cfset answers_sum = 0>
<cfloop index="i" from="1" to="#listLen(stobj.answers)#">
<cfset props = {} />
<cfif listGetAt(stobj.answers, #i#) GT 0>
<cfset props.conditions.answer=#i# />
</cfif>
<cfset props.conditions.pollingobjectid=stobj.objectid />
<cfset variables['answersum' & i] = obj.getMultipleByQuery
(argumentCollection=props) />
<cfif variables['answersum' & i].recordcount GT 0>
<cfset variables['ansum' & i] = variables['answersum' &
i].recordcount>
<!--- get the total votes of all answers that exists --->
<cfset answers_sum = answers_sum + variables['ansum' & i]>
</cfif>
</cfloop>
<ft:processForm action="Save">
<ft:processFormObjects typename="polling" />
</ft:processForm>
<!--- if the form was submitted by the Excel button, save data to
Excel --->
<ft:processform action="xls">
<!--- Import the POI tag library. --->
<cfimport taglib="/farcry/plugins/wsoFarcryPolling/packages/custom/
poi/" prefix="poi" />
<!---
Create an excel document and store binary data into
REQUEST variable.
--->
<poi:document
name="REQUEST.ExcelData"
file="#ExpandPath( './polling_statistics.xls' )#"
style="font-family: verdana ; font-size: 10pt ; color: black ; white-
space: nowrap ;">
<!--- Define style classes. --->
<poi:classes>
<poi:class
name="header"
style="font-family: verdana ; font-size: 10pt ; color:
black ;
background-color: GREY_25_PERCENT ; border-bottom: solid 3px
GREY_40_PERCENT ;"
/>
</poi:classes>
<!--- Define Sheets. --->
<poi:sheets>
<poi:sheet
name="polling_statistics"
freezerow="2"
orientation="landscape"
zoom="100%">
<!--- Define global column styles. --->
<poi:columns>
<poi:column style="width: 150px ; text-align: center ;" />
<poi:column style="width: 150px ; text-align: center ;" />
<poi:column style="width: 150px ; text-align: center ;" />
<poi:column style="width: 150px ; text-align: center ;" />
<poi:column style="width: 150px ; text-align: center ;" />
<poi:column style="width: 150px ; text-align: center ;" />
<poi:column style="width: 150px ; text-align: center ;" />
</poi:columns>
<!--- Header row. --->
<poi:row class="header">
<poi:cell value="Date / Time created" />
<poi:cell value="Question" />
<cfloop index="i" from="1" to="#listLen(stobj.answers)#">
<cfif listGetAt(stobj.answers, #i#) GTE 0>
<cfset answer = listGetAt(stobj.answers, i)>
<poi:cell value="#answer#" />
</cfif>
</cfloop>
<poi:cell value="total" />
</poi:row>
<!--- Output the polling data --->
<poi:row>
<poi:cell type="date" value="#stobj.datetimecreated#" />
<poi:cell value="#stobj.question#" />
<cfloop index="i" from="1" to="#listLen(stobj.answers)#">
<cfif variables['answersum' & i].recordcount GT 0>
<poi:cell type="numeric" value="#variables['ansum' & i]
#" />
<cfelse>
<poi:cell type="numeric" value="0" />
</cfif>
</cfloop>
<poi:cell type="numeric" value="#answers_sum#" />
</poi:row>
<!--- Header row. --->
<poi:row class="header">
<poi:cell value="Date / Time created" />
<poi:cell value="Question" />
<cfloop index="i" from="1" to="#listLen(stobj.answers)#">
<cfif listGetAt(stobj.answers, #i#) GTE 0>
<cfset answer = listGetAt(stobj.answers, i)>
<poi:cell value="#answer#" />
</cfif>
</cfloop>
<poi:cell value="IP" />
</poi:row>
<!--- get all the pollingvotes to list in Excel --->
<cfset stprops_votes = {} />
<cfset stprops_votes.conditions = {} />
<cfset votes = obj.getMultipleByQuery
(argumentCollection=stprops_votes) />
<!--- get the pollingvotes data for current polling --->
<cfloop query="votes" startrow="1"
endrow="#votes.recordcount#">
<poi:row>
<poi:cell type="date" value="#votes.datetimecreated#" />
<poi:cell value="#stobj.question#" />
<cfloop index="i" from="1" to="#listLen(stobj.answers)#">
<cfif #votes.answer[currentrow]# EQ #i#>
<cfset VARIABLES['ipanswer' & i] = 1>
<cfelse>
<cfset VARIABLES['ipanswer' & i] = 0>
</cfif>
<poi:cell type="numeric" value="#VARIABLES['ipanswer' &
i]#" />
</cfloop>
<poi:cell value="#votes.userip#" />
</poi:row>
</cfloop>
</poi:sheet>
</poi:sheets>
</poi:document>
<!--- Tell the browser to expect an Excel file attachment. --->
<cfheader
name="content-disposition"
value="attachment; filename=polling_statistics.xls"
/>
<!---
Tell browser the length of the byte array output stream.
This will help the browser provide download duration to
the user.
--->
<cfheader
name="content-length"
value="#REQUEST.ExcelData.Size()#"
/>
<!--- Stream the binary data to the user. --->
<cfcontent
type="application/excel"
variable="#REQUEST.ExcelData.ToByteArray()#"
/>
</ft:processform>
<ft:processForm action="Save,Cancel" exit="true" />
<ft:form>
<ft:object typename="polling" objectid="#stobj.objectid#"
lFields="title,description,aTaskDefs,lTypenames" r_stPrefix="prefix"
legend="General Details" />
<!--- if data exists show cfchart --->
<cfif #answers_sum# GT 0>
<!--- show the polling results in cfchart --->
<cfchart format="png"
chartwidth="300" chartheight="300" showlegend="yes" show3d="yes">
<cfchartseries type="pie">
<cfloop index="i" from="1" to="#listLen(stobj.answers)#">
<cfif variables['answersum' & i].recordcount GT 0>
<cfset answer = listGetAt(stobj.answers, #i#) />
<cfchartdata item="#answer# (#variables['ansum' & i]#)"
value="#variables['ansum' & i]#">
<cfelse>
<cfset answer = listGetAt(stobj.answers, #i#) />
<cfchartdata item="#answer# (0)" value="0">
</cfif>
</cfloop>
<cfchartdata item="Total votes (#answers_sum#)"
value="#answers_sum#">
</cfchartseries>
</cfchart>
</cfif>
<extjs:onReady> <cfoutput> Ext.get("#prefix#lTypenames").on
('change', this.onClick, this, {
buffer: 500,
fn: function() {
renderWorkflowDefWebskins('#stobj.objectid#', Ext.get
('#prefix#lTypenames').dom.value);
}
});
function renderWorkflowDefWebskins(workflowDefID,lTypenames) {
var el = Ext.get("editWebskins");
if (workflowDefID != '') {
el.slideOut('t', {
easing: 'easeOut',
duration: .5,
remove: false,
useDisplay: true,
callback: function() {
el.load({
url: "#application.url.webtop#/facade/workflowFacade.cfc?
method=renderWorkflowDefWebskins",
scripts: true,
autoAbort:true,
callback: function() {
el.slideIn('t', {
easing: 'easeIn',
duration: .5,
remove: false,
useDisplay: true
})
},
params: {
workflowDefID: workflowDefID,
lTypenames: lTypenames
}
});
}
})
}
} </cfoutput> </extjs:onReady>
<ft:farcryButtonPanel>
<ft:farcryButton value="Save" />
<ft:farcryButton value="Cancel" />
<!--- if data exists show xls export button --->
<cfif #answers_sum# GT 0>
<ft:farcryButton value="xls" />
</cfif>
</ft:farcryButtonPanel>
</ft:form>
<cfsetting enablecfoutputonly="false" />
On Nov 26, 11:27 pm, "Blair McKenzie" <[EMAIL PROTECTED]> wrote:
> Perhaps you should just post the edit.cfm file so we can have a look?
>
> On Thu, Nov 27, 2008 at 7:46 AM, Marco van den Oever <
>
> [EMAIL PROTECTED]> wrote:
>
> > Still this problem, when i copy the
>
> > "farcry/core/webskin/farWorkflowDef/edit.cfm"
>
> > to
>
> > "plugin/webskin/typename/edit.cfm"
>
> > I have the problem that when i add an item and then cancel, the
> > validation is playing up.
>
> > This is also when i just place an unedited version, so anyone knows
> > how to solve this?
>
> > Thanks
>
> > On Nov 25, 12:21 am, Marco van den Oever <[EMAIL PROTECTED]>
> > wrote:
> > > With my appreciation!
>
> > > On Nov 24, 10:58 pm, "Tomek Kott" <[EMAIL PROTECTED]> wrote:
>
> > > > oh, ok. Just checking. :)
>
> > > > Tomek
>
> > > > On Mon, Nov 24, 2008 at 9:36 AM, Marco van den Oever <
>
> > > > [EMAIL PROTECTED]> wrote:
>
> > > > > Hi Tomek, i used the farcry/core/webskin/farWorkflowDef/edit.cfm as a
> > > > > template and placed it in plugin/webskin/typename/edit.cfm
>
> > > > > Problem is indeed that when the file gets updated in core, then the
> > > > > file is not updated in the above path.
>
> > > > > But as i understand this is the only way to customize the edit page.
>
> > > > > Maybe there is a way that can extend the farcry/core/webskin/
> > > > > farWorkflowDef/edit.cfm and then add my own code?
>
> > > > > That would be the ideal solution... :)
>
> > > > > On Nov 24, 3:13 pm, "Tomek Kott" <[EMAIL PROTECTED]> wrote:
> > > > > > Marco,
> > > > > > I don't know about the validation issue, but I would recommend
> > against
> > > > > > changing farcry/core/webskin/farWorkflowDef/edit.cfm. In fact I
> > would not
> > > > > > change anything in /core/ unless it's a bug you need to fix before
> > the
> > > > > next
> > > > > > "official" version. This is because some/most files get updated
> > when you
> > > > > > install a new version, so you would lose those changes. Or you
> > would have
> > > > > to
> > > > > > keep track of all the changes you have made to any files in core.
> > That
> > > > > said,
> > > > > > I am pretty sure that putting an edit.cfm in your typename folder
> > will do
> > > > > > the trick, and that way is completely specific to the typename
> > rather
> > > > > than
> > > > > > all of your types.
>
> > > > > > Sorry if I misunderstood what you were doing!
>
> > > > > > Tomek
>
> > > > > > On Sat, Nov 22, 2008 at 10:02 PM, Marco van den Oever <
>
> > > > > > [EMAIL PROTECTED]> wrote:
>
> > > > > > > Only problem is when i add a item that uses the custom edit code,
> > and
> > > > > > > press cancel, then the validation plays up which results in not
> > going
> > > > > > > back to the admin console of the specific content type.
>
> > > > > > > Is that a bug?
>
> > > > > > > On Nov 23, 12:08 am, Marco van den Oever <
> > [EMAIL PROTECTED]>
> > > > > > > wrote:
> > > > > > > > Awesome, for this you need farcry\core\webskin\farWorkflowDef
> > > > > > > > \edit.cfm, set the right typenames and enjoy :)
>
> > > > > > > > On Nov 22, 8:56 pm, Marco van den Oever <
> > [EMAIL PROTECTED]>
> > > > > > > > wrote:
>
> > > > > > > > > Ah thanks! That will work :)
>
> > > > > > > > > On Nov 22, 5:05 pm, "Tomek Kott" <[EMAIL PROTECTED]>
> > wrote:
>
> > > > > > > > > > Yes, you have to create your own "edit.cfm" page under
> > > > > > > > > > /plugins/(pluginname)/banner/edit.cfm. By default this is
> > just a
> > > > > > > > > > "objectadmin" tag I believe. If you write your own, you can
> > add
> > > > > > > information
> > > > > > > > > > about another object.
>
> > > > > > > > > > This might help you get started:
>
> > > > > > > > > >http://docs.farcrycms.org/display/FCDEV40/Form+Tool+Wizard
>
> > > > > > > > > > Tomek
>
> > > > > > > > > > On Fri, Nov 21, 2008 at 8:27 PM, Marco van den Oever <
>
> > > > > > > > > > [EMAIL PROTECTED]> wrote:
>
> > > > > > > > > > > Ok i am checking the extra statistics page i have made
> > for the
> > > > > > > banner
> > > > > > > > > > > plugin and again wondering if it's not possible to ad
> > that
> > > > > output
> > > > > > > to
> > > > > > > > > > > the content type itself, this would be way less work and
> > also
> > > > > less
> > > > > > > > > > > confusing for users as everything is in one place.
>
> > > > > > > > > > > For instance when i edit a banner i just want to see
> > those
> > > > > > > statistics
> > > > > > > > > > > somewhere.
>
> > > > > > > > > > > Is this possible? And any guidelines?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"farcry-dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/farcry-dev?hl=en
-~----------~----~----~----~------~----~------~--~---