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) »
  • Multiple files per file field
Pages: [1]

Author Topic: Multiple files per file field  (Read 1889 times)

dalin

  • I post occasionally
  • **
  • Posts: 89
  • Karma: 8
  • CiviCRM version: many
  • CMS version: Drupal 6
  • MySQL version: 5.0
  • PHP version: 5.2
Multiple files per file field
February 06, 2008, 09:14:54 pm
We have a client (ok, its ourselves) who, if the extent of the work is not too great, are wanting to extend the capabilities of custom file fields to handle multiple files, similar to Drupal.  Looking at the schema, I'm thinking it shouldn't be too hard.  Other field types allow multiple values.  This leads me to believe that it might only require some changes to the way that the field is displayed.  I haven't really looked at the code yet.  How extensive do you think this addition would be?

Dave Hansen-Lange
Advomatic LLC
http://advomatic.com
--
Dave Hansen-Lange
Web Developer
Advomatic LLC
http://advomatic.com
Hong Kong office

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: Multiple files per file field
February 07, 2008, 04:41:55 am

in 2.x, we'd like to allow custom groups to potentially have multiple values. This will allow the below case. This is a fairly decent development cycle and as such will not be a quick hack. note that files are stored in multiple tables (civicrm_file, civicrm_entity_file) and as such the trick of  concatenating multiple values with a separator might not work very nicely here (and will be a bit too hackish, even by our standards!)

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

dalin

  • I post occasionally
  • **
  • Posts: 89
  • Karma: 8
  • CiviCRM version: many
  • CMS version: Drupal 6
  • MySQL version: 5.0
  • PHP version: 5.2
Re: Multiple files per file field
February 07, 2008, 05:10:28 pm
I'm taking a closer look now and I see what you mean.  Other multiselect fields are stored in one column, but separated by the  character.  You couldn't do this with file_ids and maintain a relationships and indexes to a foreign key.  So your proposition is to allow some fields to have multiple instances (multiple rows).  I can also see how this technique could be used to have multiple textfields on the same form.  This sounds like a fairly major rework of the custom fields system (and I'm surprised that you're wanting to get this into 2.0 being as its only an idea at this point.  The rate at which civicrm code moves is phenomenal sometimes). 

We were wanting this feature for our internal client tracking tools. However, since this is such an extensive change, I'm guessing that advomatic would not be able to invest in it without a client to pay for the development time.  If that's not the case I'll get back to you. 
--
Dave Hansen-Lange
Web Developer
Advomatic LLC
http://advomatic.com
Hong Kong office

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: Multiple files per file field
February 07, 2008, 09:03:02 pm

Its a 2.x feature (which means, we have no idea what release it will be part of, but its something we know needs to be done)

We have some thoughts on how to make multiple values a reality. With the new structure of custom values, i dont think it is a HUGE project, but yes, it is a significant enhancement

advomatic does not need to sponsort the whole feature. Would be great for advomatic to step up and sponsor a certain number of hours towards it, and maybe other firms will do the same :)

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

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Multiple files per file field

This forum was archived on 2017-11-26.