CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Edit with Approval
Pages: [1]

Author Topic: Edit with Approval  (Read 928 times)

AlexR

  • I’m new here
  • *
  • Posts: 19
  • Karma: 0
  • CiviCRM version: 4.3.1
  • CMS version: Drupal
  • MySQL version: 5.1.69
  • PHP version: 5.3.23
Edit with Approval
May 22, 2013, 06:00:55 am
I would like to add an edit with approval feature to my database.

If someone changes a contacts phone number, last name, email address, or etc; I do not want the change reflected in the database until an administrator approves the change.

Any ideas/suggestions on a way to implement this?



Note - Logging is currently enabled

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Edit with Approval
May 22, 2013, 09:54:46 am

I dont think there is any easy way of doing this :(

one potential solution if you are using drupal is:

a. use webform + custom code (for setting defaults / validation / check civi db etc?) to collect the data and store it in webform fields

b. use webform + webform_civicrm + custom code for the approval and store in civi

the other option is to introduce the concept of "is_approved" but that might require quite a few changes across the code base (similar to is_deleted) and it works only across contact creation not contact updates

alternatively you can use logging to "roll back" changes if they are not approved

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: Edit with Approval
May 22, 2013, 02:00:25 pm
wondering it the idea of using the webform - but only letting those users 'save as draft' - then admin comes along, and submits them
can't say i can see all the steps but it has the potential to use webform as the temporary storage mechanism
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

AlexR

  • I’m new here
  • *
  • Posts: 19
  • Karma: 0
  • CiviCRM version: 4.3.1
  • CMS version: Drupal
  • MySQL version: 5.1.69
  • PHP version: 5.3.23
Re: Edit with Approval
May 24, 2013, 12:42:53 pm
A possible solution that I have come up with is to:

Add an additional column to log_tables with an integer value to indicate the tuple's version. Unfortunately since the record would be in the log_table, the data in actual database could be incorrect until it is reviewed.

0 - Previous accepted value
1 - Current accepted value
2 - Pending Review
3 - Rejected

An custom report could show all pending changes. The user would be able to select a record and determine if the change was valid. If not, the previous version is copied and in both cases, the integer value is adjusted.

I think this may be the easiest way to implement feature. Generally the data is not accessed or used frequently, so minimal up keep would be required. There are only certain times during the year in which the database undergoes heavy use and as such, would be monitored more frequently.

I thought about implementing this type of feature to the main database, but figured it would be much more of an effort due to:
   Any update would have to be treated as an insert.
   Makes log tables redundant.
   Could be issues with primary/foreign keys.
   WHERE clauses would have to distinguish between current and previous versions when displaying data.


Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Edit with Approval

This forum was archived on 2017-11-26.