Big Picture questions

A place for users and developers of the Xataface to discuss and receive support.

Big Picture questions

Postby Dataguru » Mon Feb 20, 2012 12:22 pm

I'm new to Xataface and am quite impressed so far.
I've build asp apps using vbs and am just learning php.

I'm working on using Xataface to build a monthly reporting app for some grant-funded programs.

The big picture is I will need to determine what users see and can do based on their login (haven't gotten to that point yet) and since it's a multi-year project will need need to selectively display info based on the fiscal year as well as selected reporting month and year.

I'm just now to the point of defining tables using the fields, valuelists, and relationships inis.

I need to set the default report month and year which I plan to do using current month and year. and display that as a select list with the default being current month and year. I have a look up table set up with year, month and fiscal year. I'll need that selection to be a global value that i can use in multiple places to help decide. What's the best way to go about doing that?

Also, I'm having trouble with relationships. I have a main Programs table and multiple other tables (one to many) e.g. program staff, goals, objectives, etc that contain ProgramID as the foreign key.
I tried this,
/tables/Programs/relationships.ini
[Programs]
ProgStaff.ProgramID = "$ProgramID"
ProgGoals.ProgramID = "$ProgramID"
ProgObj.ProgramID = "$ProgramID"
RptProgData.ProgramID = "$ProgramID"
etc

but it appears to only work with one relationship at a time and hoses with all of them listed. What am I screwing up?
I haven't tried this year, but am I on the right track that each has to be named?
[Programs_Staff]
ProgStaff.ProgramID = "$ProgramID"
[Programs_Goals]
ProgGoals.ProgramID = "$ProgramID"

Thanks,
Betty
Dataguru
 
Posts: 27
Joined: Mon Feb 20, 2012 8:12 am

Re: Big Picture questions

Postby shannah » Mon Feb 20, 2012 1:16 pm

Yes. You need to set them up as separate relationships. Each section in the relationships.ini file represents a single relationship. If you have multiple you need multiple sections. E.g.
Code: Select all
[goals]
    ProgramGoals.ProgramID="$ProgramID"

[staff]
    ProgramStaff.ProgramID="$ProgramID"

etc...


As for the report, there's a lot of ways you could go. Probably you'll get the most flexibility from writing a custom action. You would then (i'm guessing) be generating a form where the user selects the parameters for the report, and would then see the report upon submitting the form. But there are many ways to achieve what you want.

-Steve
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: Big Picture questions

Postby Dataguru » Mon Feb 20, 2012 1:35 pm

Thanks Steve! I appreciate your help!
Dataguru
 
Posts: 27
Joined: Mon Feb 20, 2012 8:12 am

Re: Big Picture questions

Postby Dataguru » Mon Feb 20, 2012 7:31 pm

I've been adding/removing/changing various field in the db this afternoon trying to get everything just the way I want it.

When I navigate to ProgGoals table in Xataface, and then click on a record to edit, it throws this error
Field name is not a string.PEAR_Error[pear_error: message="2" code=0 mode=return level=notice prefix="" info="Call to getTableField with invalid address: 'ProgObj.FYear'. Column FYear does not exists in table ProgObj."]

That would mean that when it tries to put together the edit record screen for selected ProgGoals record it can't find ProgObj.FYear' (which is correct, I deleted that field earlier), but that doesn't make sense cuz ProgObj.FYear' isn't referenced anywhere in the ProgGoals table ini files. Any ideas what else could be causing it?

tables/ProgGoals/relationships.ini
Code: Select all
[Objectives Report Data]
ProgObj.ProgGoalsID="$ProgGoalsID"


tables/ProgGoals/valuelists.ini
Code: Select all
[ProgramLkp]
__sql__ = "SELECT ProgramID, ProgramName FROM Programs ORDER BY ProgramName"

[DomainLkp]
__sql__ = "SELECT DomainA, CONCAT(DomainA, ': ', Domain) as lbl FROM Domains ORDER BY Srt"


tables/ProgGoals/fields.ini
Code: Select all
[ObjID]
widget:label = "Objective ID"
widget:type = hidden

[ProgramID]
widget:label = "Program"
widget:type = select
vocabulary = ProgramLkp

[ProgGoalsID]
widget:label = "Goal"
widget:type = select
vocabulary = GoalLkp

[ObjectiveNo]
widget:label = "Objective #"
widget:atts: size=2
validators:numeric = true
validators:numeric:message = "Numbers Only"

[Objective]
widget:type = textarea

[ObjEndDate]
widget:label = "Due Date"

[ObjCompleteDate]
widget:label = "Completed Date"

[NoReachedP]
widget:label = "# to Reach"
widget:atts: size=10
validators:numeric = true
validators:numeric:message = "Numbers Only"

[NoReachedA]
widget:label = "# Reached"
widget:atts: size=10
validators:numeric = true
validators:numeric:message = "Numbers Only"

[DateAdded]
widget:label = "Date Added"

[DateModified]
widget:label = "Date Last Modified"
widget:type = hidden
Dataguru
 
Posts: 27
Joined: Mon Feb 20, 2012 8:12 am

Re: Big Picture questions

Postby Jean » Tue Feb 21, 2012 2:42 am

Hello
Just a suggestion, delete your cache in templates_c and drop the table views created by Xataface.
Hope it helps.
Jean
Jean
 
Posts: 259
Joined: Wed Nov 07, 2007 1:30 am
Location: Pau, France

Re: Big Picture questions

Postby Dataguru » Tue Feb 21, 2012 9:19 am

Jean wrote:Hello
Just a suggestion, delete your cache in templates_c and drop the table views created by Xataface.
Hope it helps.
Jean


I assume the cache would be in templates_c/dataface

Where bouts are the table views?
Dataguru
 
Posts: 27
Joined: Mon Feb 20, 2012 8:12 am

Re: Big Picture questions

Postby Jean » Tue Feb 21, 2012 10:02 am

these are dataface_... tables in your database
Jean
Jean
 
Posts: 259
Joined: Wed Nov 07, 2007 1:30 am
Location: Pau, France

Re: Big Picture questions

Postby Dataguru » Wed Feb 22, 2012 8:21 am

I only have 4 dataface tables in my db and non looks like it holds table views. tho mtimes does contain some table names.
failed_logins
mtimes
preferences
version
Dataguru
 
Posts: 27
Joined: Mon Feb 20, 2012 8:12 am


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 10 guests

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved