Fix for #1523 - Optimization of record label computation.
Areas validated
- User CRUD (both admin and non-admin)
- Create or Update records from workflows
- CRUD from APIs
Merge request reports
Activity
Added 1 commit:
- 4d67b5fc - Fix for #1523 (closed) - Optimization of record label computation.
Added 1 commit:
- 5902e773 - Fix for #1523 (closed) - Optimization of record label computation (Generalizing data popu…
278 278 if ($module == 'Events') { 279 279 $module = 'Calendar'; 280 280 } 281 282 $entityFields = Vtiger_Functions::getEntityModuleInfo($module); 283 $entityFieldNames = explode(',', $entityFields['fieldname']); 284 switch ($module) { 285 case 'HelpDesk': $entityFieldNames = array('ticket_title'); 286 break; 287 case 'Documents': $entityFieldNames = array('notes_title'); 288 break; 289 } 290 291 $record_label = ''; 292 foreach($entityFieldNames as $entityFieldName) { 293 $record_label .= $this->column_fields[$entityFieldName]." "; @akshath This will leave a " " at the end of the label... rtrim(decode_html($record_label)) would do it.
@akshath Also, as part of this merge, shouldn't the file containing the Event Handler be removed as well? I just grepped the source tree and found that there are two files that are basically the same!!! FWIW, the one in the root of the Vtiger module directory was replaced in the event table in the 600_to_610 migration routine.
./modules/Vtiger/RecordLabelUpdater.php:12:class Vtiger_RecordLabelUpdater_Handler extends VTEventHandler { ./modules/Vtiger/handlers/RecordLabelUpdater.php:12:class Vtiger_RecordLabelUpdater_Handler extends VTEventHandler {
278 278 if ($module == 'Events') { 279 279 $module = 'Calendar'; 280 280 } 281 282 $entityFields = Vtiger_Functions::getEntityModuleInfo($module); 283 $entityFieldNames = explode(',', $entityFields['fieldname']); 284 switch ($module) { 285 case 'HelpDesk': $entityFieldNames = array('ticket_title'); 286 break; 287 case 'Documents': $entityFieldNames = array('notes_title'); 288 break; 289 } 290 291 $record_label = ''; 292 foreach($entityFieldNames as $entityFieldName) { 293 $record_label .= $this->column_fields[$entityFieldName]." "; @lord_alan this is taken care before pushing data to tables (at line 332 and 374
@lord_alan I did not notice we have modules/Vtiger/RecordLabelUpdater.php. Let remove this file as well.
278 278 if ($module == 'Events') { 279 279 $module = 'Calendar'; 280 280 } 281 282 $entityFields = Vtiger_Functions::getEntityModuleInfo($module); 283 $entityFieldNames = explode(',', $entityFields['fieldname']); 284 switch ($module) { 285 case 'HelpDesk': $entityFieldNames = array('ticket_title'); 286 break; 287 case 'Documents': $entityFieldNames = array('notes_title'); 288 break; 289 } 290 291 $record_label = ''; 292 foreach($entityFieldNames as $entityFieldName) { 293 $record_label .= $this->column_fields[$entityFieldName]." "; Added 1 commit:
- 0fe720fc - Fix for #1523 (closed) - Optimization of record label computation (Remove reference file)
281 281 282 282 $entityFields = Vtiger_Functions::getEntityModuleInfo($module); 283 283 $entityFieldNames = explode(',', $entityFields['fieldname']); 284 $label = (count($entityFieldNames) > 1) ? 284 switch ($module) { 285 case 'HelpDesk': $entityFieldNames = array('ticket_title'); @prasad @akshath Why are you hard-coding the entity fieldnames here? I have many customers who use the "Ticket No." as the entityfield as it is Unique and very easy for everyone to understand - the ticket title is often something facile like "customer bug" or "widget not working"... Similarly with Documents. The notes title is often just a cut & paste and is the same for multiple documents. It can also be a rather long string so when viewed in a related record or a list it gets truncated. Using the "Document No." is again rather common with several of my customers.