forked from Wavyzz/dolibarr
Merge branch '19.0' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
@@ -259,7 +259,7 @@ print '<th class="liste_titre"></th>';
|
|||||||
print '<th class="liste_titre right">'.$langs->trans("PreviousPeriod").'</th>';
|
print '<th class="liste_titre right">'.$langs->trans("PreviousPeriod").'</th>';
|
||||||
print '<th class="liste_titre right">'.$langs->trans("SelectedPeriod").'</th>';
|
print '<th class="liste_titre right">'.$langs->trans("SelectedPeriod").'</th>';
|
||||||
foreach ($months as $k => $v) {
|
foreach ($months as $k => $v) {
|
||||||
if (($k + 1) >= $date_startmonth) {
|
if (($k + 1) >= $date_startmonth && $k < $date_endmonth) {
|
||||||
print '<th class="liste_titre right width50">'.$langs->trans('MonthShort'.sprintf("%02s", ($k + 1))).'</th>';
|
print '<th class="liste_titre right width50">'.$langs->trans('MonthShort'.sprintf("%02s", ($k + 1))).'</th>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -392,7 +392,7 @@ if ($modecompta == 'CREANCES-DETTES') {
|
|||||||
|
|
||||||
// Detail by month
|
// Detail by month
|
||||||
foreach ($months as $k => $v) {
|
foreach ($months as $k => $v) {
|
||||||
if (($k + 1) >= $date_startmonth) {
|
if (($k + 1) >= $date_startmonth && $k < $date_endmonth) {
|
||||||
foreach ($sommes as $code => $det) {
|
foreach ($sommes as $code => $det) {
|
||||||
$vars[$code] = empty($det['M'][$k]) ? 0 : $det['M'][$k];
|
$vars[$code] = empty($det['M'][$k]) ? 0 : $det['M'][$k];
|
||||||
}
|
}
|
||||||
@@ -591,7 +591,7 @@ if ($modecompta == 'CREANCES-DETTES') {
|
|||||||
|
|
||||||
// Each month
|
// Each month
|
||||||
foreach ($totCat['M'] as $k => $v) {
|
foreach ($totCat['M'] as $k => $v) {
|
||||||
if (($k + 1) >= $date_startmonth) {
|
if (($k + 1) >= $date_startmonth && $k < $date_endmonth) {
|
||||||
print '<td class="right nowraponall"><span class="amount">'.price($v).'</span></td>';
|
print '<td class="right nowraponall"><span class="amount">'.price($v).'</span></td>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -632,7 +632,7 @@ if ($modecompta == 'CREANCES-DETTES') {
|
|||||||
|
|
||||||
// Make one call for each month
|
// Make one call for each month
|
||||||
foreach ($months as $k => $v) {
|
foreach ($months as $k => $v) {
|
||||||
if (($k + 1) >= $date_startmonth) {
|
if (($k + 1) >= $date_startmonth && $k < $date_endmonth) {
|
||||||
if (isset($cpt['account_number'])) {
|
if (isset($cpt['account_number'])) {
|
||||||
$resultM = $totPerAccount[$cpt['account_number']]['M'][$k];
|
$resultM = $totPerAccount[$cpt['account_number']]['M'][$k];
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -2634,7 +2634,7 @@ function dol_most_recent_file($dir, $regexfilter = '', $excludefilter = array('(
|
|||||||
* @param string $original_file Relative path with filename, relative to modulepart.
|
* @param string $original_file Relative path with filename, relative to modulepart.
|
||||||
* @param string $entity Restrict onto entity (0=no restriction)
|
* @param string $entity Restrict onto entity (0=no restriction)
|
||||||
* @param User|null $fuser User object (forced)
|
* @param User|null $fuser User object (forced)
|
||||||
* @param string $refname Ref of object to check permission for external users (autodetect if not provided) or for hierarchy
|
* @param string $refname Ref of object to check permission for external users (autodetect if not provided by taking the dirname of $original_file) or for hierarchy
|
||||||
* @param string $mode Check permission for 'read' or 'write'
|
* @param string $mode Check permission for 'read' or 'write'
|
||||||
* @return mixed Array with access information : 'accessallowed' & 'sqlprotectagainstexternals' & 'original_file' (as a full path name)
|
* @return mixed Array with access information : 'accessallowed' & 'sqlprotectagainstexternals' & 'original_file' (as a full path name)
|
||||||
* @see restrictedArea()
|
* @see restrictedArea()
|
||||||
@@ -2682,7 +2682,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
|
|||||||
// Find the subdirectory name as the reference. For example original_file='10/myfile.pdf' -> refname='10'
|
// Find the subdirectory name as the reference. For example original_file='10/myfile.pdf' -> refname='10'
|
||||||
if (empty($refname)) {
|
if (empty($refname)) {
|
||||||
$refname = basename(dirname($original_file)."/");
|
$refname = basename(dirname($original_file)."/");
|
||||||
if ($refname == 'thumbs') {
|
if ($refname == 'thumbs' || $refname == 'temp') {
|
||||||
// If we get the thumbs directory, we must go one step higher. For example original_file='10/thumbs/myfile_small.jpg' -> refname='10'
|
// If we get the thumbs directory, we must go one step higher. For example original_file='10/thumbs/myfile_small.jpg' -> refname='10'
|
||||||
$refname = basename(dirname(dirname($original_file))."/");
|
$refname = basename(dirname(dirname($original_file))."/");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -415,6 +415,10 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
|
|||||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '(isModEnabled("takepos") || isModEnabled("cashdesk"))', __HANDLER__, 'left', 6100__+MAX_llx_menu__, 'bank', 'cashcontrol', 14__+MAX_llx_menu__, '/compta/cashcontrol/cashcontrol_list.php?mainmenu=bank&action=list', 'CashControl', 0, 'cashdesk', '$user->hasRight("cashdesk", "run")|| $user->hasRight("takepos", "run")', '', 2, 6, __ENTITY__);
|
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '(isModEnabled("takepos") || isModEnabled("cashdesk"))', __HANDLER__, 'left', 6100__+MAX_llx_menu__, 'bank', 'cashcontrol', 14__+MAX_llx_menu__, '/compta/cashcontrol/cashcontrol_list.php?mainmenu=bank&action=list', 'CashControl', 0, 'cashdesk', '$user->hasRight("cashdesk", "run")|| $user->hasRight("takepos", "run")', '', 2, 6, __ENTITY__);
|
||||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '(isModEnabled("takepos") || isModEnabled("cashdesk") && $leftmenu=="cashcontrol")', __HANDLER__, 'left', 6101__+MAX_llx_menu__, 'bank', 'cashcontrol', 6100__+MAX_llx_menu__, '/compta/cashcontrol/cashcontrol_card.php?mainmenu=bank&action=create', 'NewCashFence', 1, 'cashdesk', '$user->hasRight("cashdesk", "run")|| $user->hasRight("takepos", "run")', '', 2, 6, __ENTITY__);
|
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '(isModEnabled("takepos") || isModEnabled("cashdesk") && $leftmenu=="cashcontrol")', __HANDLER__, 'left', 6101__+MAX_llx_menu__, 'bank', 'cashcontrol', 6100__+MAX_llx_menu__, '/compta/cashcontrol/cashcontrol_card.php?mainmenu=bank&action=create', 'NewCashFence', 1, 'cashdesk', '$user->hasRight("cashdesk", "run")|| $user->hasRight("takepos", "run")', '', 2, 6, __ENTITY__);
|
||||||
|
|
||||||
|
-- Bank - Cash control POS
|
||||||
|
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '(isModEnabled("takepos") || isModEnabled("cashdesk"))', __HANDLER__, 'left', 6100__+MAX_llx_menu__, 'bank', 'cashcontrol', 14__+MAX_llx_menu__, '/compta/cashcontrol/cashcontrol_list.php?mainmenu=bank&action=list', 'CashControl', 0, 'cashdesk', '$user->hasRight("cashdesk", "run")|| $user->hasRight("takepos", "run")', '', 2, 6, __ENTITY__);
|
||||||
|
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '(isModEnabled("takepos") || isModEnabled("cashdesk") && $leftmenu=="cashcontrol")', __HANDLER__, 'left', 6101__+MAX_llx_menu__, 'bank', 'cashcontrol', 6100__+MAX_llx_menu__, '/compta/cashcontrol/cashcontrol_card.php?mainmenu=bank&action=create', 'NewCashFence', 1, 'cashdesk', '$user->hasRight("cashdesk", "run")|| $user->hasRight("takepos", "run")', '', 2, 6, __ENTITY__);
|
||||||
|
|
||||||
|
|
||||||
-- Project
|
-- Project
|
||||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("project")', __HANDLER__, 'left', 3600__+MAX_llx_menu__, 'project', 'projects', 7__+MAX_llx_menu__, '/projet/index.php?mainmenu=project&leftmenu=projects', 'LeadsOrProjects', 0, 'projects', '$user->hasRight("projet","lire")', '', 2, 0, __ENTITY__);
|
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("project")', __HANDLER__, 'left', 3600__+MAX_llx_menu__, 'project', 'projects', 7__+MAX_llx_menu__, '/projet/index.php?mainmenu=project&leftmenu=projects', 'LeadsOrProjects', 0, 'projects', '$user->hasRight("projet","lire")', '', 2, 0, __ENTITY__);
|
||||||
|
|||||||
@@ -209,20 +209,17 @@ $original_file = str_replace('../', '/', $original_file);
|
|||||||
$original_file = str_replace('..\\', '/', $original_file);
|
$original_file = str_replace('..\\', '/', $original_file);
|
||||||
|
|
||||||
|
|
||||||
// Find the subdirectory name as the reference
|
|
||||||
$refname = basename(dirname($original_file)."/");
|
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
if (empty($modulepart)) {
|
if (empty($modulepart)) {
|
||||||
accessforbidden('Bad value for parameter modulepart');
|
accessforbidden('Bad value for parameter modulepart');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check security and set return info with full path of file
|
// Check security and set return info with full path of file
|
||||||
$check_access = dol_check_secure_access_document($modulepart, $original_file, $entity, $user, $refname);
|
$check_access = dol_check_secure_access_document($modulepart, $original_file, $entity, $user, '');
|
||||||
$accessallowed = $check_access['accessallowed'];
|
$accessallowed = $check_access['accessallowed'];
|
||||||
$sqlprotectagainstexternals = $check_access['sqlprotectagainstexternals'];
|
$sqlprotectagainstexternals = $check_access['sqlprotectagainstexternals'];
|
||||||
$fullpath_original_file = $check_access['original_file']; // $fullpath_original_file is now a full path name
|
$fullpath_original_file = $check_access['original_file']; // $fullpath_original_file is now a full path name
|
||||||
//var_dump($fullpath_original_file.' '.$original_file.' '.$refname.' '.$accessallowed);exit;
|
//var_dump($fullpath_original_file.' '.$original_file.' '.$accessallowed);exit;
|
||||||
|
|
||||||
if (!empty($hashp)) {
|
if (!empty($hashp)) {
|
||||||
$accessallowed = 1; // When using hashp, link is public so we force $accessallowed
|
$accessallowed = 1; // When using hashp, link is public so we force $accessallowed
|
||||||
@@ -282,7 +279,7 @@ if (!file_exists($fullpath_original_file_osencoded)) {
|
|||||||
// Hooks
|
// Hooks
|
||||||
$hookmanager->initHooks(array('document'));
|
$hookmanager->initHooks(array('document'));
|
||||||
$parameters = array('ecmfile' => $ecmfile, 'modulepart' => $modulepart, 'original_file' => $original_file,
|
$parameters = array('ecmfile' => $ecmfile, 'modulepart' => $modulepart, 'original_file' => $original_file,
|
||||||
'entity' => $entity, 'refname' => $refname, 'fullpath_original_file' => $fullpath_original_file,
|
'entity' => $entity, 'fullpath_original_file' => $fullpath_original_file,
|
||||||
'filename' => $filename, 'fullpath_original_file_osencoded' => $fullpath_original_file_osencoded);
|
'filename' => $filename, 'fullpath_original_file_osencoded' => $fullpath_original_file_osencoded);
|
||||||
$object = new stdClass();
|
$object = new stdClass();
|
||||||
$reshook = $hookmanager->executeHooks('downloadDocument', $parameters, $object, $action); // Note that $action and $object may have been
|
$reshook = $hookmanager->executeHooks('downloadDocument', $parameters, $object, $action); // Note that $action and $object may have been
|
||||||
@@ -293,6 +290,7 @@ if ($reshook < 0) {
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Permissions are ok and file found, so we return it
|
// Permissions are ok and file found, so we return it
|
||||||
top_httphead($type);
|
top_httphead($type);
|
||||||
|
|
||||||
@@ -301,6 +299,7 @@ if ($encoding) {
|
|||||||
header('Content-Encoding: '.$encoding);
|
header('Content-Encoding: '.$encoding);
|
||||||
}
|
}
|
||||||
// Add MIME Content-Disposition from RFC 2183 (inline=automatically displayed, attachment=need user action to open)
|
// Add MIME Content-Disposition from RFC 2183 (inline=automatically displayed, attachment=need user action to open)
|
||||||
|
|
||||||
if ($attachment) {
|
if ($attachment) {
|
||||||
header('Content-Disposition: attachment; filename="'.$filename.'"');
|
header('Content-Disposition: attachment; filename="'.$filename.'"');
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -601,7 +601,8 @@ class Fichinter extends CommonObject
|
|||||||
$sql .= ", date_valid = '".$this->db->idate($now)."'";
|
$sql .= ", date_valid = '".$this->db->idate($now)."'";
|
||||||
$sql .= ", fk_user_valid = ".($user->id > 0 ? (int) $user->id : "null");
|
$sql .= ", fk_user_valid = ".($user->id > 0 ? (int) $user->id : "null");
|
||||||
$sql .= " WHERE rowid = ".((int) $this->id);
|
$sql .= " WHERE rowid = ".((int) $this->id);
|
||||||
$sql .= " AND entity = ".((int) $conf->entity);
|
$sql .= " AND entity = ".((int) $this->entity);
|
||||||
|
|
||||||
$sql .= " AND fk_statut = 0";
|
$sql .= " AND fk_statut = 0";
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::setValid", LOG_DEBUG);
|
dol_syslog(get_class($this)."::setValid", LOG_DEBUG);
|
||||||
@@ -629,7 +630,7 @@ class Fichinter extends CommonObject
|
|||||||
|
|
||||||
// Now we rename also files into index
|
// Now we rename also files into index
|
||||||
$sql = 'UPDATE '.MAIN_DB_PREFIX."ecm_files set filename = CONCAT('".$this->db->escape($this->newref)."', SUBSTR(filename, ".(strlen($this->ref) + 1).")), filepath = 'ficheinter/".$this->db->escape($this->newref)."'";
|
$sql = 'UPDATE '.MAIN_DB_PREFIX."ecm_files set filename = CONCAT('".$this->db->escape($this->newref)."', SUBSTR(filename, ".(strlen($this->ref) + 1).")), filepath = 'ficheinter/".$this->db->escape($this->newref)."'";
|
||||||
$sql .= " WHERE filename LIKE '".$this->db->escape($this->ref)."%' AND filepath = 'ficheinter/".$this->db->escape($this->ref)."' and entity = ".$conf->entity;
|
$sql .= " WHERE filename LIKE '".$this->db->escape($this->ref)."%' AND filepath = 'ficheinter/".$this->db->escape($this->ref)."' and entity = ".((int) $this->entity);
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if (!$resql) {
|
if (!$resql) {
|
||||||
$error++;
|
$error++;
|
||||||
|
|||||||
@@ -950,7 +950,8 @@ while ($i < ($limit ? min($num, $limit) : $num)) {
|
|||||||
print '<td class="right"><a href="replenishorders.php?search_product='.$prod->id.'">'.$ordered.'</a> '.$picto.'</td>';
|
print '<td class="right"><a href="replenishorders.php?search_product='.$prod->id.'">'.$ordered.'</a> '.$picto.'</td>';
|
||||||
|
|
||||||
// To order
|
// To order
|
||||||
print '<td class="right"><input type="text" size="4" name="tobuy'.$i.'" value="'.((getDolGlobalString('STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE') && $fk_entrepot > 0) > 0 ? $stocktobuywarehouse : $stocktobuy).'"></td>';
|
$tobuy = ((getDolGlobalString('STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE') && $fk_entrepot > 0) > 0 ? $stocktobuywarehouse : $stocktobuy);
|
||||||
|
print '<td class="right"><input type="text" size="4" name="tobuy'.$i.'" value="'.$tobuy.'"></td>';
|
||||||
|
|
||||||
// Supplier
|
// Supplier
|
||||||
print '<td class="right">';
|
print '<td class="right">';
|
||||||
@@ -958,7 +959,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) {
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
// Fields from hook
|
// Fields from hook
|
||||||
$parameters = array('objp'=>$objp);
|
$parameters = array('objp'=>$objp, 'i'=>$i, 'tobuy'=>$tobuy);
|
||||||
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook
|
||||||
print $hookmanager->resPrint;
|
print $hookmanager->resPrint;
|
||||||
|
|
||||||
|
|||||||
@@ -323,7 +323,7 @@ if (empty($reshook)) {
|
|||||||
}
|
}
|
||||||
$object->entity = (GETPOSTISSET('entity') ? GETPOST('entity', 'int') : $conf->entity);
|
$object->entity = (GETPOSTISSET('entity') ? GETPOST('entity', 'int') : $conf->entity);
|
||||||
$object->name_alias = GETPOST('name_alias', 'alphanohtml');
|
$object->name_alias = GETPOST('name_alias', 'alphanohtml');
|
||||||
$object->parent = GETPOST('parent_company_id', 'int');
|
$object->parent = GETPOSTISSET('parent_company_id') ? GETPOST('parent_company_id', 'int') : $object->parent;
|
||||||
$object->address = GETPOST('address', 'alphanohtml');
|
$object->address = GETPOST('address', 'alphanohtml');
|
||||||
$object->zip = GETPOST('zipcode', 'alphanohtml');
|
$object->zip = GETPOST('zipcode', 'alphanohtml');
|
||||||
$object->town = GETPOST('town', 'alphanohtml');
|
$object->town = GETPOST('town', 'alphanohtml');
|
||||||
|
|||||||
Reference in New Issue
Block a user