Merge pull request #20830 from atm-quentin/FIX_missing_hook_for_row_ordering
Fix missing hook for row ordering
This commit is contained in:
commit
1c2e29fac8
@ -48,7 +48,7 @@ if (!defined('NOREQUIRETRAN')) {
|
||||
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/genericobject.class.php';
|
||||
|
||||
$hookmanager->initHooks(array('rowinterface'));
|
||||
// Security check
|
||||
// This is done later into view.
|
||||
|
||||
@ -116,7 +116,15 @@ if (GETPOST('roworder', 'alpha', 3) && GETPOST('table_element_line', 'aZ09', 3)
|
||||
$perm = 1;
|
||||
}
|
||||
}
|
||||
|
||||
$parameters = array('roworder'=> &$roworder, 'table_element_line' => &$table_element_line, 'fk_element' => &$fk_element, 'element_id' => &$element_id, 'perm' => &$perm);
|
||||
$row = new GenericObject($db);
|
||||
$row->table_element_line = $table_element_line;
|
||||
$row->fk_element = $fk_element;
|
||||
$row->id = $element_id;
|
||||
$reshook = $hookmanager->executeHooks('checkRowPerms', $parameters, $row, $action);
|
||||
if ($reshook > 0) {
|
||||
$perm = $hookmanager->resArray['perm'];
|
||||
}
|
||||
if (! $perm) {
|
||||
// We should not be here. If we are not allowed to reorder rows, feature should not be visible on script.
|
||||
// If we are here, it is a hack attempt, so we report a warning.
|
||||
@ -133,10 +141,7 @@ if (GETPOST('roworder', 'alpha', 3) && GETPOST('table_element_line', 'aZ09', 3)
|
||||
}
|
||||
}
|
||||
|
||||
$row = new GenericObject($db);
|
||||
$row->table_element_line = $table_element_line;
|
||||
$row->fk_element = $fk_element;
|
||||
$row->id = $element_id;
|
||||
|
||||
|
||||
$row->line_ajaxorder($newrowordertab); // This update field rank or position in table row->table_element_line
|
||||
|
||||
|
||||
@ -43,7 +43,6 @@ $forcereloadpage = empty($conf->global->MAIN_FORCE_RELOAD_PAGE) ? 0 : 1;
|
||||
$tagidfortablednd = (empty($tagidfortablednd) ? 'tablelines' : $tagidfortablednd);
|
||||
$filepath = (empty($filepath) ? '' : $filepath);
|
||||
|
||||
|
||||
if (GETPOST('action', 'aZ09') != 'editline' && $nboflines > 1 && $conf->browser->layout != 'phone') { ?>
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
|
||||
Loading…
Reference in New Issue
Block a user