mirror of
				https://gitlab.com/Chill-Projet/chill-bundles.git
				synced 2025-10-31 01:08:26 +00:00 
			
		
		
		
	export raw string (no html conversion) and replace " by "" - refs #401
This commit is contained in:
		| @@ -3,12 +3,13 @@ | ||||
| /* | ||||
|  * Chill is a software for social workers | ||||
|  * | ||||
|  * Copyright (C) 2014, Champs Libres Cooperative SCRLFS, <http://www.champs-libres.coop> | ||||
|  * Copyright (C) 2014-2015, Champs Libres Cooperative SCRLFS,  | ||||
|  * <http://www.champs-libres.coop>, <info@champs-libres.coop> | ||||
|  * | ||||
|  * This program is free software: you can redistribute it and/or modify | ||||
|  *  it under the terms of the GNU Affero General Public License as | ||||
|  * it under the terms of the GNU Affero General Public License as | ||||
|  * published by the Free Software Foundation, either version 3 of the | ||||
|  *  License, or (at your option) any later version. | ||||
|  * License, or (at your option) any later version. | ||||
|  * | ||||
|  * This program is distributed in the hope that it will be useful, | ||||
|  * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
| @@ -92,8 +93,13 @@ class CustomFieldText implements CustomFieldInterface | ||||
|  | ||||
|     public function render($value, CustomField $customField,  $documentType = 'html') | ||||
|     { | ||||
|         $template = 'ChillCustomFieldsBundle:CustomFieldsRendering:text.html.twig'; | ||||
|         if($documentType == 'csv') { | ||||
|             $template = 'ChillCustomFieldsBundle:CustomFieldsRendering:text.csv.twig'; | ||||
|         } | ||||
|  | ||||
|         return $this->templating | ||||
|             ->render('ChillCustomFieldsBundle:CustomFieldsRendering:text.html.twig', array('text' => $value)); | ||||
|             ->render($template, array('text' => $value)); | ||||
|     } | ||||
|  | ||||
|     public function serialize($value, CustomField $customField) | ||||
|   | ||||
| @@ -2,9 +2,9 @@ | ||||
| {%- for choice in choices -%} | ||||
|     {% if choice['slug'] in selected %} | ||||
|         {%- if choice['slug'] is not same as('_other') -%} | ||||
|             {{ choice['name']|localize_translatable_string }} | ||||
|             {{ choice['name']|localize_translatable_string|replace({'"':'""'})|raw }} | ||||
|         {%- else -%} | ||||
|             {{ choice['name'] }} | ||||
|             {{ choice['name']|replace({'"':'""'})|raw }} | ||||
|         {%- endif -%} | ||||
|     {% endif %} | ||||
| {%- endfor -%} | ||||
|   | ||||
							
								
								
									
										1
									
								
								Resources/views/CustomFieldsRendering/text.csv.twig
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								Resources/views/CustomFieldsRendering/text.csv.twig
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1 @@ | ||||
| {% if text is not empty %}{{ text|replace({'"':'""'})|raw }}{% else %}{{ 'None'|trans }}{% endif %} | ||||
		Reference in New Issue
	
	Block a user