Hi Ksar,
I developed this module through the module developer existing in the dolibarr itself.
The impression I have is that there is no problem in the Left Join script done in the file supervisando_list.php
Remember that this file is generated automatically by the dolibarr module developer.
Here is the snippet of code that shows the failure:
// Build and execute select
// ------------------------------------------------
$ sql = ‘SELECT’;
foreach ($ object-> fields as $ key => $ val)
{
$ sql. = ‘t.’. $ key. ‘,’;
}
// Add fields from extrafields
if (! empty ($ extrafields-> attributes [$ object-> table_element] [‘label’]))
($ object-> table_element] [‘type’] [$ object-> table_element] [‘type’] [$ object-> table_element] [‘label’] $ string = $ extrafields-> $ key]! = ‘separate’? “and” $ key. ‘as options _’. $ key. ‘,’: ‘’);
// Add fields from hooks
$ parameters = array ();
$ reshook = $ hookmanager-> executeHooks (‘printFieldListSelect’, $ parameters, $ object); // Note that $ action and $ object may have been modified by hook
$ sql. = $ hookmanager-> resPrint;
$ sql = preg_replace (’/, $ /’, ‘’, $ sql);
$ sql. = “FROM” .MAIN_DB_PREFIX. $ object-> table_element. “as t”;
if (is_array ($ extrafields-> attributes [$ object-> table_element] [‘label’]) && count ($ extrafields-> attributes [$ object-> table_element] [‘label’])) $ sql. = "LEFT JOIN “.MAIN_DB_PREFIX. $ Object-> table_element.” _ Extrafields as ef on (t.rowid = ef.fk_object) ";
if ($ object-> ismultientitymanaged == 1) $ sql. = “WHERE t.entity IN (” .getEntity ($ object-> element). “)”;
else $ sql. = “WHERE 1 = 1”;
foreach ($ search as $ key => $ val)
{
if ($ key == ‘status’ && $ search [$ key] == -1) continue;
$ mode_search = (($ object-> isInt ($ object-> fields [$ key]) || $ object-> isFloat ($ object-> fields [$ key])? 1: 0);
if ($ search [$ key]! = ‘’) $ sql = natural_search ($ key, $ search [$ key], (($ key == ‘status’)? 2: $ mode_search));
}
if ($ search_all) $ sql. = natural_search (array_keys ($ fieldstosearchall), $ search_all);
// Add where from extra fields
include DOL_DOCUMENT_ROOT. ‘/ core / tpl / extrafields_list_search_sql.tpl.php’;
// Add where from hooks
$ parameters = array ();
$ reshook = $ hookmanager-> executeHooks (‘printFieldListWhere’, $ parameters, $ object); // Note that $ action and $ object may have been modified by hook
$ sql. = $ hookmanager-> resPrint;
/ * If a group by is required
$ sql. = “GROUP BY”
foreach ($ object-> fields as $ key => $ val)
{
$ sql. = ‘t.’. $ key. ‘,’;
}
// Add fields from extrafields
if (! empty ($ extrafields-> attributes [$ object-> table_element] [‘label’])) {
($ object-> table_element] [‘type’] [$ object-> table_element] [‘type’] [$ object-> table_element] [‘label’] $ string = $ extrafields-> $ key]! = ‘separate’? “ef.”. $ key. ‘,’: ‘’);
// Add where from hooks
$ parameters = array ();
$ reshook = $ hookmanager-> executeHooks (‘printFieldListGroupBy’, $ parameters); // Note that $ action and $ object may have been modified by hook
$ sql. = $ hookmanager-> resPrint;
$ sql = preg_replace (’/, $ /’, ‘’, $ sql);
* /
$ sql. = $ db-> order ($ sortfield, $ sortorder);
// Count total nb of records
$ nbtotalofrecords = ‘’;
if (empty ($ conf-> global-> MAIN_DISABLE_FULL_SCANLIST))
{
$ resql = $ db-> query ($ sql);
$ nbtotalofrecords = $ db-> num_rows ($ resql);
if (($ page * $ limit)> $ nbtotalofrecords) // if total of record found is smaller than page * limit, goto and load page 0
{
$ page = 0;
$ offset = 0;
}
}
// if total of record found is smaller than limit, no need to paging and to restart another select with limits set.
if (is_numeric ($ nbtotalofrecords) && $ limit> $ nbtotalofrecords)
{
$ num = $ nbtotalofrecords;
}
else
{
$ sql. = $ db-> plimit ($ limit + 1, $ offset);
$ resql = $ db-> query ($ sql);
if (! $ resql)
{
dol_print_error ($ db);
exit;
}
$ num = $ db-> num_rows ($ resql);
}
// Direct jump if only one record found
if ($ num == 1 &&! empty ($ conf-> global-> MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $ search_all)
{
$ obj = $ db-> fetch_object ($ resql);
$ id = $ obj-> rowid;
header (“Location:” .DOL_URL_ROOT. ‘/ monitoring / monitoring_card.php? id =’. $ id);
exit;
}
For if I disable this snippet of code, the list loads, it is quite true that without the Label template, but it loads.
Another curiosity, when I fill out the form of this module it does not present the completed plug, a gray screen appears in the background, with nothing.
When I do query in the table monitoring the information is not there.
What should I do?
To release some permission in the bank, to change some type of parameter?
Is this a bug in the developer of dolibarr modules?
Regards,