Implement a validation cycle : the best choice ?

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
Fido
Forum Members
Forum Members
Posts: 104
Joined: Fri Mar 31, 2006 3:10 pm

Implement a validation cycle : the best choice ?

Post by Fido »

Hi,

I'm trying to implement a validation cycle when users add new content in cmsms.
The way i think i could take is :

- develop a new module called "add validation cycle to users" that manage the cycle of validation for an user and where the administrator can define the validator and the publisher for content adding by one user

- then when this user need to add some new content, how can i implement it without coding in cmsms classes ?

thanks
ps : i've already post a topic in general discussion without coding response so sorry for the clone.
User avatar
sjg
Power Poster
Power Poster
Posts: 310
Joined: Thu Jan 27, 2005 5:11 pm
Location: Los Angeles, CA

Re: Implement a validation cycle : the best choice ?

Post by sjg »

I think it's going to be impossible to add this "the right way" without making a change to the core.

The only other way I could see to do it would be pretty kludgy. The module would have to use the ContentEditPost and ContentDeletePre API hooks, and store the content change in a new table, where the approval process could be handled.

I think this would be ugly, but it would probably work.

Good Luck!
Many modules available from the http://dev.cmsmadesimple.org
The CMS Made Simple Developer Cookbook is now available from Packt Publishers!
Fido
Forum Members
Forum Members
Posts: 104
Joined: Fri Mar 31, 2006 3:10 pm

Re: Implement a validation cycle : the best choice ?

Post by Fido »

Thanks sjg,

i'm feeling less gulty now ;-)

i'll come back to you when i 'm clear in my mind about the implementation.

If you any other suggestion ? ;-)
Fido
Forum Members
Forum Members
Posts: 104
Joined: Fri Mar 31, 2006 3:10 pm

Re: Implement a validation cycle : the best choice ?

Post by Fido »

Helllo,

turning the stuff in my mind, i can see this modifications to implement this solution :

1) add a "statut propertie" to content

every page can be :

- draft
- in submission
- in correction
- in publication
- published (active propertie)
- not published (active propertie)

so in the code side, that can be :

> add a statut field to the content table

> add a "setstatut" method in content's classe which work with the user id and the new workflow classe (see below)



2) create workflow classe

this classe provide this features :

- Add / Edit / delete a validation cycle by user

- give an API to get the content's ID who are in validation cycle , send notification to the differents actors of cycle


in the code side this classe can have this methods :

getContentIDByValidatorID -> return a list of content's ID using
- 1) the registered users who have to validate their content
with this validator
- 2) and the owner_id field of the content table

which can be decline as :
getContentIDByUserID

getContentIDByWebmasterID

getUsersIDByValidatorID -> return a list of users who have to submit their content to this validator

getValidatorIDByUserID -> return the ID of the validator of one user (one user can only have one validator)

getWebmasterIDByValidatorID -> return the webmaster's ID who have to publish the content

sendEmailNotification -> for send message to user, validator, webmaster that they content to manage

yo, that the first step , have some comments or some feedbacks ?

thank.
User avatar
fredt
Forum Members
Forum Members
Posts: 144
Joined: Mon Jun 27, 2005 10:36 am
Location: Southern France

Re: Implement a validation cycle (FOR NEWS) : the best choice ?

Post by fredt »

OK,

I think part of the problem comes from this: in your first post, you wrote about "a validation cycle when users add new content in cmsms". I think you meant "a validation cycle when users add newS content in cmsms". Should be easier this way.

The "Status property" is currently implemented as 'varchar(25)', as "draft" or "published". I think it should be a code rather than a label, so
- it can be translated
- displayed status is in the DB (we'd need a new panel in News Admin to manage this Codes & Labels table)
- it can be extended : you then could add other status, as "in correction", "in publication"... or any status depending on the user's organisation.

As different departments usually love to have different workflows, it would be wise to link these Status codes to current Category code, or to a new "Process" code (for instance Standard, Urgent...). So Human Resources can have a 7-step validation process, while The Boss has a 1 step flow.

You also have to decide whether "Status" means the current step or the way you took to come here. That's a common mistake. Today, it means "Current step" in the flow. But as validators are usually granted to refuse a News, you'll have to go back in the flow - so the guy who gets it back knows where it comes from : a News can be in "Validation 1" step because it was submitted by a Draftee OR because it was refused by Validator2.

About users : I think the best is to define who is responsible for each Process-Step (ie, Standard-Publication). This could be done through a new Admin panel, or perhaps through Groups with a given pattern structure, say "Group_News_Standard-Publ". (So when a News "comes" to this status, you'll have to give "ownership" and advise member(s) of this group.) You'd define the pattern in News Admin. I didn't play with Users and Groups module - I think there's one. Or you could LDAP query some, say, Active Directory - so users can define who is in charge.
Fido
Forum Members
Forum Members
Posts: 104
Joined: Fri Mar 31, 2006 3:10 pm

Re: Implement a validation cycle : the best choice ?

Post by Fido »

hum,

in my project i need both workflow when adding content and when adding news.

so the workflow defined for one user or one group is active for posting content and news.

that's a good idea to have different steps that can be defined in the flow by admin with his own labels

for me the status is the current step, every step can have different name but the status is for example a number that indicate where is the content in the flow and where it have to go from current user

if content's status is 2 , that means it is in validation by validator 1


about users : i've already implement a simple workflow with only 3 steps (users / validator / webmaster) where you select the user in each step so we're on a same idea.

at first i was thinking about manage with group, but it seems to be more easier to manage with users.

the goal of this project is to be able to send some "alert" message by mail and in the admin panel when for example the validator of a content is logging.

i don't understand what you write about lDAP and active Directory ??


be on the flow.... ;-)
Post Reply

Return to “Developers Discussion”