mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-05 09:08:09 +01:00
Merge branch '22.0' into fix-#36475
This commit is contained in:
@@ -818,7 +818,9 @@ class FormFile
|
||||
$out .= '<input type="hidden" name="page_y" value="">';
|
||||
$out .= '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
|
||||
$out .= load_fiche_titre($titletoshow, '', '');
|
||||
if ($titletoshow) {
|
||||
$out .= load_fiche_titre($titletoshow, '', '');
|
||||
}
|
||||
$out .= '<div class="div-table-responsive-no-min">';
|
||||
$out .= '<table class="liste formdoc noborder centpercent">';
|
||||
|
||||
|
||||
@@ -1053,6 +1053,9 @@ function checkUserAccessToObject($user, array $featuresarray, $object = 0, $tabl
|
||||
if ($user->socid != $objectid) {
|
||||
return false;
|
||||
}
|
||||
} elseif (isModEnabled('societe') && !$user->hasRight('societe', 'lire') && !$user->hasRight('societe', 'client', 'voir')) {
|
||||
dol_syslog("security.lib.php::checkUserAccessToObject Deny access due: (isModEnabled('societe') && !user->hasRight('societe', 'lire') && !user->hasRight('societe', 'client', 'voir'))", LOG_DEBUG);
|
||||
return false;
|
||||
} elseif (isModEnabled("societe") && ($user->hasRight('societe', 'lire') && !$user->hasRight('societe', 'client', 'voir'))) {
|
||||
// If internal user: Check permission for internal users that are restricted on their objects
|
||||
$sql = "SELECT COUNT(sc.fk_soc) as nb";
|
||||
@@ -1237,7 +1240,7 @@ function checkUserAccessToObject($user, array $featuresarray, $object = 0, $tabl
|
||||
// the user can't view any evaluations
|
||||
return false;
|
||||
}
|
||||
// the user can only their own evaluations or their subordinates'
|
||||
// the user can only see their own evaluations or their subordinates'
|
||||
return in_array($useridtocheck, $childids);
|
||||
}
|
||||
}
|
||||
@@ -1259,12 +1262,13 @@ function checkUserAccessToObject($user, array $featuresarray, $object = 0, $tabl
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
dol_syslog("Bad forged sql in checkUserAccessToObject", LOG_WARNING);
|
||||
dol_syslog("Bad forged sql in security.lib.php::checkUserAccessToObject", LOG_WARNING);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dol_syslog("security.lib.php::checkUserAccessToObject::return True", LOG_DEBUG);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -339,18 +339,18 @@ class modEventOrganization extends DolibarrModules
|
||||
$this->export_TypeFields_array[$r]['t.fk_soc'] = 'Numeric';
|
||||
//$this->export_fields_array[$r]['t.fieldtoadd']='FieldToAdd'; $this->export_TypeFields_array[$r]['t.fieldtoadd']='Text';
|
||||
//unset($this->export_fields_array[$r]['t.fieldtoremove']);
|
||||
$keyforselect = 'conferenceorboothattendee';
|
||||
$keyforselect = 'eventorganization_conferenceorboothattendee'; // The value in column elementtype of llx_extrafields table
|
||||
$keyforaliasextra = 'extra';
|
||||
$keyforelement = 'conferenceorboothattendee';
|
||||
$keyforelement = 'conferenceorboothattendee'; // The value of key for icon and class
|
||||
include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php';
|
||||
//$this->export_dependencies_array[$r] = array('aaaline'=>array('tl.rowid','tl.ref')); // To force to activate one or several fields if we select some fields that need same (like to select a unique key if we ask a field of a child to avoid the DISTINCT to discard them, or for computed field than need several other fields)
|
||||
//$this->export_special_array[$r] = array('t.field'=>'...');
|
||||
//$this->export_examplevalues_array[$r] = array('t.field'=>'Example');
|
||||
//$this->export_help_array[$r] = array('t.field'=>'FieldDescHelp');
|
||||
$this->export_sql_start[$r] = 'SELECT DISTINCT ';
|
||||
$this->export_sql_end[$r] = ' FROM '.MAIN_DB_PREFIX.'eventorganization_conferenceorboothattendee as t, '.MAIN_DB_PREFIX.'projet as p';
|
||||
$this->export_sql_end[$r] .= ' WHERE t.fk_project = p.rowid';
|
||||
$this->export_sql_end[$r] .= ' AND p.entity IN ('.getEntity('conferenceorboothattendee').')';
|
||||
$this->export_sql_end[$r] = ' FROM '.MAIN_DB_PREFIX.'eventorganization_conferenceorboothattendee as t';
|
||||
$this->export_sql_end[$r] .= ' INNER JOIN '.MAIN_DB_PREFIX.'projet as p ON t.fk_project = p.rowid AND p.entity IN ('.getEntity('conferenceorboothattendee').')';
|
||||
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'eventorganization_conferenceorboothattendee_extrafields as extra on t.rowid = extra.fk_object';
|
||||
$r++;
|
||||
/* END MODULEBUILDER EXPORT CONFERENCEORBOOTHATTENDEES */
|
||||
|
||||
@@ -388,7 +388,7 @@ class modEventOrganization extends DolibarrModules
|
||||
$this->export_TypeFields_array[$r]['s.nom'] = 'Text';
|
||||
//$this->export_fields_array[$r]['t.fieldtoadd']='FieldToAdd'; $this->export_TypeFields_array[$r]['t.fieldtoadd']='Text';
|
||||
//unset($this->export_fields_array[$r]['t.fieldtoremove']);
|
||||
$keyforselect = 'conferenceorbooth';
|
||||
$keyforselect = 'actioncomm'; // The value in column elementtype of llx_extrafields table
|
||||
$keyforaliasextra = 'extra';
|
||||
$keyforelement = 'conferenceorbooth';
|
||||
include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php';
|
||||
@@ -396,16 +396,13 @@ class modEventOrganization extends DolibarrModules
|
||||
//$this->export_special_array[$r] = array('t.field'=>'...');
|
||||
//$this->export_examplevalues_array[$r] = array('t.field'=>'Example');
|
||||
//$this->export_help_array[$r] = array('t.field'=>'FieldDescHelp');
|
||||
$this->export_sql_start[$r] = 'SELECT DISTINCT ';
|
||||
$this->export_sql_start[$r] = "SELECT DISTINCT ";
|
||||
$this->export_sql_end[$r] = ' FROM '.MAIN_DB_PREFIX.'actioncomm as t';
|
||||
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe as s ON t.fk_soc = s.rowid,';
|
||||
$this->export_sql_end[$r] .= ' '.MAIN_DB_PREFIX.'projet as p,';
|
||||
$this->export_sql_end[$r] .= ' '.MAIN_DB_PREFIX.'c_actioncomm as ca';
|
||||
$this->export_sql_end[$r] .= ' WHERE t.fk_project = p.rowid';
|
||||
$this->export_sql_end[$r] .= ' AND ca.id = t.fk_action';
|
||||
$this->export_sql_end[$r] .= " AND t.code LIKE 'AC_EO_%'";
|
||||
$this->export_sql_end[$r] .= ' AND p.usage_organize_event = 1';
|
||||
$this->export_sql_end[$r] .= ' AND p.entity IN ('.getEntity('conferenceorboothattendee').')';
|
||||
$this->export_sql_end[$r] .= ' INNER JOIN '.MAIN_DB_PREFIX.'projet as p ON t.fk_project = p.rowid AND p.usage_organize_event = 1 AND p.entity IN ('.getEntity('conferenceorboothattendee').')';
|
||||
$this->export_sql_end[$r] .= ' INNER JOIN '.MAIN_DB_PREFIX.'c_actioncomm as ca ON ca.id = t.fk_action';
|
||||
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe as s ON t.fk_soc = s.rowid';
|
||||
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'actioncomm_extrafields as extra on t.id = extra.fk_object';
|
||||
$this->export_sql_end[$r] .= " WHERE t.code LIKE 'AC_EO_%'";
|
||||
$r++;
|
||||
/* END MODULEBUILDER EXPORT CONFERENCEORBOOTH */
|
||||
|
||||
|
||||
@@ -144,6 +144,7 @@ $entitytolang = array(
|
||||
'bomline' => 'BOMLine',
|
||||
'mrp' => 'ManufacturingOrder',
|
||||
'mrp_line' => 'ManufacturingOrderLine',
|
||||
'conferenceorbooth' => 'ConferenceOrBooth',
|
||||
'conferenceorboothattendee' => 'Attendee',
|
||||
'inventory' => 'Inventory',
|
||||
'inventory_line' => 'InventoryLine'
|
||||
@@ -1023,6 +1024,7 @@ if ($step == 4 && $datatoexport) {
|
||||
// Select request if all fields are selected
|
||||
$sqlmaxforexport = $objexport->build_sql(0, array(), array());
|
||||
|
||||
print '<br>';
|
||||
print '<div class="marginbottomonly"><span class="opacitymedium">'.$langs->trans("ChooseFieldsOrdersAndTitle").'</span></div>';
|
||||
|
||||
print '<div class="div-table-responsive-no-min">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table
|
||||
@@ -1353,15 +1355,16 @@ if ($step == 5 && $datatoexport) {
|
||||
}
|
||||
$htmltabloflibs .= '</table><br>';
|
||||
|
||||
print '<br>';
|
||||
print '<span class="opacitymedium">'.$form->textwithpicto($langs->trans("NowClickToGenerateToBuildExportFile"), $htmltabloflibs, 1, 'help', '', 0, 2, 'helphonformat').'</span>';
|
||||
//print $htmltabloflibs;
|
||||
print '<br>';
|
||||
|
||||
print '</div>';
|
||||
|
||||
|
||||
if ($sqlusedforexport && $user->admin) {
|
||||
print info_admin($langs->trans("SQLUsedForExport").':<br> '.$sqlusedforexport, 0, 0, '1', '', 'TechnicalInformation');
|
||||
print info_admin($langs->trans("SQLUsedForExport").':<br> '.$sqlusedforexport, 0, 0, '1', '', 'TechnicalInformation').'<br>';
|
||||
print '<br>';
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user