Changeset - 9d356f993b02
[Not reviewed]
0 1 0
Brett Smith (brett) - 7 years ago 2016-10-11 15:51:08
brett@sfconservancy.org
Reimbursements: Add note about CiviCRM's Money type.
1 file changed with 4 insertions and 0 deletions:
0 comments (0 inline, 0 general)
Reimbursements/OnCiviCRM.mdwn
Show inline comments
...
 
@@ -27,12 +27,16 @@ But it seems like the mental model for Activities is closer to "things the organ
 

	
 
It might be safer to introduce a new Expense object type.  Functionally it might act very similarly to Activities, but keeping them separate in the system and UI would prevent trouble if they need to grow in different directions in the future.  In particular, if we could attach custom fields to them, that means a lot of CiviCRM's existing field building functionality would meet our needs.
 

	
 
## Saving files associated with expenses
 

	
 
Out of the box, files that are uploaded to CiviCRM (e.g., attachments) go to the framework's public files directory.  This means that anybody who knows the filename can get the file, even if they're not logged into the system.  This doesn't seem secure enough for files that might include sensitive financial information.
 

	
 
On a new install, at least, you can configure CiviCRM to save file uploads to a different directory by changing Directory Preferences→uploadDir.  It would suit our purposes if this was a non-accessible directory; then our extension could serve the files to people who were authorized to view them.
 

	
 
[CiviCRM recommends making this configuration change](https://civicrm.org/advisory/civi-sa-2014-001-risk-information-disclosure).  Given that, I think we can count on administrators to have done so, and be satisfied with the security on the uploads directory, even though it's out of our hands.
 

	
 
Note that we'll need to be careful to make sure files go to `uploadDir`, and not `imageUploadDir`, where anonymous web access still needs to be allowed.
 

	
 
## Money type
 

	
 
CiviCRM's Money type simply ensures that the input is numeric, with up to two decimal points.  See [this regexp](https://github.com/civicrm/civicrm-core/blob/4.7.12/CRM/Utils/Rule.php#L557).  It does not, out of the box, support specifying a currency.  When forms call for a money input, it will probably be implemented as two inputs: a Currency pulldown (which we can implement and install so administrators don't have to define it themselves), and a Money input for the numeric part.
0 comments (0 inline, 0 general)