Export inventory

This commit is contained in:
Laurent Destailleur
2024-08-29 10:46:10 +02:00
7 changed files with 20 additions and 11 deletions

View File

@@ -75,7 +75,7 @@ if (empty($action) && empty($id) && empty($ref)) {
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'.
//avoid warning on missing/undef entity
$object->entity = (GETPOSTISSET('entity') ? GETPOSTINT('entity') : $conf->entity);
$object->entity = ((GETPOSTISSET('entity') && GETPOST('entity') != '') ? GETPOSTINT('entity') : $conf->entity);
// There is several ways to check permission.
// Set $enablepermissioncheck to 1 to enable a minimum low level of checks

View File

@@ -81,7 +81,7 @@ if (empty($action) && empty($id) && empty($ref)) {
// Load object
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'.
$object->entity = (GETPOSTISSET('entity') ? GETPOSTINT('entity') : $conf->entity);
$object->entity = ((GETPOSTISSET('entity') && GETPOST('entity') != '') ? GETPOSTINT('entity') : $conf->entity);
// There is several ways to check permission.
// Set $enablepermissioncheck to 1 to enable a minimum low level of checks

View File

@@ -1193,10 +1193,6 @@ if ($resql) {
print $form->selectyesno('search_conciliated', $search_conciliated, 1, false, 1, 1, 'search_status onrightofpage width75');
print '</td>';
}
// Bordereau
if (!empty($arrayfields['b.fk_bordereau']['checked'])) {
print '<td class="liste_titre center"><input type="text" class="flat" name="search_fk_bordereau" value="'.dol_escape_htmltag($search_fk_bordereau).'" size="3"></td>';
}
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php';
// Action edit/delete and select
@@ -1866,8 +1862,20 @@ if ($resql) {
}
}
if (!empty($arrayfields['b.fk_bordereau']['checked'])) {
$bordereaustatic->fetch($objp->fk_bordereau);
print '<td class="nowraponall center">';
print $bordereaustatic->getNomUrl();
print '</td>';
if (!$i) {
$totalarray['nbfield']++;
}
}
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
// Fields from hook
$parameters = array('arrayfields' => $arrayfields, 'obj' => $objp, 'i' => $i, 'totalarray' => &$totalarray);
$parameters = array('arrayfields' => $arrayfields, 'object'=>$object, 'obj' => $objp, 'i' => $i, 'totalarray' => &$totalarray);
$reshook=$hookmanager->executeHooks('printFieldListValue', $parameters, $object, $action); // Note that $action and $objecttmpect may have been modified by hook
print $hookmanager->resPrint;

View File

@@ -144,7 +144,7 @@ if (empty($reshook)) {
$action = '';
}
// Creation utilisateur depuis contact
// Create user from contact
if ($action == 'confirm_create_user' && $confirm == 'yes' && $user->hasRight('user', 'user', 'creer')) {
// Recuperation contact actuel
$result = $object->fetch($id);
@@ -207,7 +207,7 @@ if (empty($reshook)) {
$object->canvas = $canvas;
}
$object->entity = (GETPOSTISSET('entity') ? GETPOSTINT('entity') : $conf->entity);
$object->entity = ((GETPOSTISSET('entity') && GETPOST('entity') != '') ? GETPOSTINT('entity') : $conf->entity);
$object->socid = $socid;
$object->lastname = (string) GETPOST("lastname", 'alpha');
$object->firstname = (string) GETPOST("firstname", 'alpha');

View File

@@ -1015,6 +1015,8 @@ function GETPOST($paramname, $check = 'alphanohtml', $method = 0, $filter = null
$newout = $user->fk_user;
} elseif ($reg[1] == 'ENTITY_ID' || $reg[1] == 'ENTITYID') {
$newout = $conf->entity;
} elseif ($reg[1] == 'ID') {
$newout = '__ID__'; // We keep __ID__ we find into backtopage url
} else {
$newout = ''; // Key not found, we replace with empty string
}

View File

@@ -452,7 +452,6 @@ class modStock extends DolibarrModules
$this->export_sql_end[$r] .= ' AND e.entity IN ('.getEntity('stock').')';
// Imports
//--------

View File

@@ -324,7 +324,7 @@ if (empty($reshook)) {
} else {
$object->name = GETPOST('name', 'alphanohtml');
}
$object->entity = (GETPOSTISSET('entity') ? GETPOSTINT('entity') : $conf->entity);
$object->entity = ((GETPOSTISSET('entity') && GETPOST('entity') != '') ? GETPOSTINT('entity') : $conf->entity);
$object->name_alias = GETPOST('name_alias', 'alphanohtml');
$object->parent = GETPOSTISSET('parent_company_id') ? GETPOSTINT('parent_company_id') : $object->parent;
$object->address = GETPOST('address', 'alphanohtml');