CoreBOSBB
Title in listview - Printable Version

+- CoreBOSBB (https://discussions.corebos.org)
+-- Forum: Support (https://discussions.corebos.org/forumdisplay.php?fid=17)
+--- Forum: Administrator Support (https://discussions.corebos.org/forumdisplay.php?fid=8)
+--- Thread: Title in listview (/showthread.php?tid=1400)

Pages: 1 2


Title in listview - rslemer - 02-08-2019

Now system allows in listview all fields in related to.

Problem is, most modules has a same name for field

For example, in tasks, If I wish a subject for a task and a subject for a service contracts, user not know how subject is listed

see attached image

In this example, there are two "Subject", first is a task subject and second is a service contracts subject

( in this example, filed is "Assunto" )

In report system add in front a name of each field a name of module ...


RE: Title in listview - global.da - 08-22-2019

hi rslemer,

i want to replace the "Description" in Related Listview for Timecontrol to "Service"

default array is
Timecontrol Number Title Date Start Time Start Total Time Description Assigned To Action

i want it to be
Timecontrol Number Title Date Start Time Start Total Time Service Assigned To Action

=================
file to edit is modules/Timecontrol/Timecontrol.php

the value to edit is 'Description' => array('crmentity' => 'description'), --> this needs to replace to 'Service Name'=>array('service'=>'servicename'),

and

'Description' => 'description', --> this needs to replace to 'Service Name'=>'servicename',


Find a line which has;

/**
* Mandatory for Listing (Related listview)
*/
public $list_fields = array (
/* Format: Field Label => array(tablename => columnname) */
// tablename should not have prefix 'vtiger_'
'Timecontrol Number' => array('timecontrol' => 'timecontrolnr'),
'Title'=> array('timecontrol' => 'title'),
'Date Start' => array('timecontrol' => 'date_start'),
'Time Start' => array('timecontrol' => 'time_start'),
'Total Time' => array('timecontrol' => 'totaltime'),
'Description' => array('crmentity' => 'description'), --> this needs to replace to 'Service Name'=>array('service'=>'servicename'),
'Assigned To' => array('crmentity' => 'smownerid')
);
public $list_fields_name = array(
/* Format: Field Label => fieldname */
'Timecontrol Number' => 'timecontrolnr',
'Title'=> 'title',
'Date Start' => 'date_start',
'Time Start' => 'time_start',
'Total Time' => 'totaltime',
'Description' => 'description', --> this needs to replace to 'Service Name'=>'servicename',
'Assigned To' => 'assigned_user_id'
);

==================
is this all?

or do i have to edit HelpDesk.php as well?


cheers
Dennis
coreBOS 8.0


RE: Title in listview - joebordes - 08-22-2019

Use product_id, unless you want to access some field inside the service module
with product_id it is easy, it will "just work", if you want to access information in the service module you have to modify the query to join on the service table with the variable related_tables


RE: Title in listview - rslemer - 08-22-2019

(08-22-2019, 02:58 AM)global.da Wrote: hi rslemer,

i want to replace the "Description" in Related Listview for Timecontrol to "Service"

default array is
Timecontrol Number Title Date Start   Time Start Total Time Description Assigned To Action

i want it to be
Timecontrol Number Title Date Start   Time Start Total Time Service Assigned To Action

=================
file to edit is modules/Timecontrol/Timecontrol.php

the value to edit is 'Description' => array('crmentity' => 'description'), -->  this needs to replace to 'Service Name'=>array('service'=>'servicename'),

and

'Description' => 'description', --> this needs to replace to 'Service Name'=>'servicename',


Find a line which has;

/**
* Mandatory for Listing (Related listview)
*/
public $list_fields = array (
/* Format: Field Label => array(tablename => columnname) */
// tablename should not have prefix 'vtiger_'
'Timecontrol Number' => array('timecontrol' => 'timecontrolnr'),
'Title'=> array('timecontrol' => 'title'),
'Date Start' => array('timecontrol' => 'date_start'),
'Time Start' => array('timecontrol' => 'time_start'),
'Total Time' => array('timecontrol' => 'totaltime'),
'Description' => array('crmentity' => 'description'), -->  this needs to replace to 'Service Name'=>array('service'=>'servicename'),
'Assigned To' => array('crmentity' => 'smownerid')
);
public $list_fields_name = array(
/* Format: Field Label => fieldname */
'Timecontrol Number' => 'timecontrolnr',
'Title'=> 'title',
'Date Start' => 'date_start',
'Time Start' => 'time_start',
'Total Time' => 'totaltime',
'Description' => 'description', --> this needs to replace to 'Service Name'=>'servicename',
'Assigned To' => 'assigned_user_id'
);

==================
is this all?

or do i have to edit HelpDesk.php as well?


cheers
Dennis
coreBOS 8.0


Hi


Normally I don't change directly in code ( hardcode ) because this causes a incompatible with the standard code, principaly when needs upgraded to a new version

Look Joe's comment

But if you can maintain a original code, is better for you, trust me ...

=)



RE: Title in listview - joebordes - 08-22-2019

You can use List Columns Business map to customize these columns without modifying the code


RE: Title in listview - rslemer - 08-22-2019

I understand that variable not change anything, until user click in title to reorder, right?


RE: Title in listview - joebordes - 08-22-2019

yes, correct, it defines the order of the first click


RE: Title in listview - global.da - 08-23-2019

(08-22-2019, 01:28 PM)joebordes Wrote: You can use List Columns Business map to customize these columns without modifying the code

i tried

but i get an errorMap is not valid!


Error: Element 'field': This element is not expected. on line 14 Error: Element 'field': This element is not expected. on line 48



<map>

  <originmodule>
    <originname>Timecontrol_ListColumns</originname>
  </originmodule>
  <relatedlists>
   <relatedlist>
   <module>Helpdesk</module>
<linkfield>Description</linkfield>
<columns>
<field>
<label>Timecontrol Number</label>
<name>timecontrolnr</name>
</field>
<field>
<label>Title</label>
<name>title</name>
</field>
<field>
<label>Date Start</label>
<name>date_start</name>
</field>
<field>
<label>Time Start</label>
<name>time_start</name>
</field>
<field>
<label>Total Time</label>
<name>totaltime</name>
</field>
<field>
<label>Service Name</label>
<name>product_id</name>
</field>
<field>
<label>Assigned To</label>
<name>assigned_user_id</name>
</field>
</columns>
   </relatedlist>
  </relatedlists>
  <popup>
<linkfield>Description</linkfield>
<columns>
<field>
<label>Timecontrol Number</label>
<name>timecontrolnr</name>
</field>
<field>
<label>Title</label>
<name>title</name>
</field>
<field>
<label>Date Start</label>
<name>date_start</name>
</field>
<field>
<label>Time Start</label>
<name>time_start</name>
</field>
<field>
<label>Total Time</label>
<name>totaltime</name>
</field>
<field>
<label>Service Name</label>
<name>product_id</name>
</field>
<field>
<label>Assigned To</label>
<name>assigned_user_id</name>
</field>
</columns>
  </popup>
 </map>


RE: Title in listview - joebordes - 08-23-2019

Hi

The native validation must be incorrect, I'll have someone review that.
The error you have are all at the start:

Code:
 <originmodule>
    <originname>Timecontrol_ListColumns</originname>
  </originmodule>
  <relatedlists>
   <relatedlist>
   <module>Helpdesk</module>
<linkfield>Description</linkfield>


Should be:


Code:
 <originmodule>
    <originname>Timecontrol</originname>
  </originmodule>
  <relatedlists>
   <relatedlist>
   <module>HelpDesk</module>


Timecontrol, not Timecontrol_ListColumns: originname is the name of the module
HelpDesk, not Helpdesk
You only need linkfield if the native linkfield isn't in your list and, obviously the new link field you choose MUST be in the list of columns.


RE: Title in listview - solved - global.da - 08-27-2019

Thank you Joe,

it worked despite having error at native validation
Error: Element 'originmodule': This element is not expected. Expected is ( module ). on line 2

i used product_id and i can select either Service or Product

thank you