On 3/22/06, David Wright <[EMAIL PROTECTED]> wrote:

> I have a table of companies and another table of 1,600 categories of
> work that those companies carry out. Then there is a table of links
> between companies and categories, which also records whether they are a
> manufacturer, distributor or repairer.
>
> The companies can log in and see a list of the categories they are
> linked to.
>
> Now I want them to be able to let me know if they should be linked to
> more categories or if links should be amended or removed, but I don't
> want them to actually make the changes to the link table. Changes are
> first checked by one of our editors.
>
> I don't know whether to use global collections (although I'm worried
> about how they would ever be deleted), or arrays, or some other means.
>
> Is there a developer out there who has a bit of time to spare rather
> urgently, and would like a paid commission to sort this out for me?

Hi David,

We have built a system like this for a client.  It might be a bit more
complex than I think you're asking, so hopefully it will apply.

Our need was to create a site where users could look at data stored
about them and change it according to lists and parameters specified
in the database.  The changes would posted to the database where an
admin (on the 4D side) would review the changes and decide which ones
to activate.  The admin can change the submitted data and post the
updates to the database.

Our approach was to use ObjectTools and session collections.  When we
create the user site for viewing and changes, we create an object that
stores the table/field information and the data.  We present the data
to the user and allow them to change it, all done in a session.  When
they're done, we package up the session data as a parallel object (to
the original) and save both it and the original object to the
database.  The admin looks at an admin interface that displays both
the original data and the submitted data and decides what information
to post, change or delete.  The admin then posts the "record" which
updates the user info according to the approved changes.  The posting
routines spin through the object, updating the data according to the
table/field info already stored in the object.

Was the generic approach trivial to create?  Uh, no.  :)  But it works
great and the client feels like they have complete control over what
the user is submitting and what information they want to post.  Your
goal, I think.

I think you could use a "shadow" table of information, but that
requires you to bind to specific fields used in both tables.  The
ObjectTools approach is better because you can change the tables and
fields on the fly to determine what the user can change.  It is
similar approach to Michael Larue's suggestion, but uses objects
instead of individual tables/fields.  I suppose if you don't have many
table/fields to display/change, the direct approach might be better.

Either way, you'll have to create an admin interface for posting the
data and determine some procedure for locking the info from changes
while it is in "review", but this could be as simple as a flag that
disallows database changes while the info is in review.

I hope this helps your direction.

Thanks,

Michael Check
_______________________________________________
Active4D-dev mailing list
[email protected]
http://mailman.aparajitaworld.com/mailman/listinfo/active4d-dev
Archives: http://mailman.aparajitaworld.com/archive/active4d-dev/

Reply via email to