mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 15:34:12 +01:00
N°3136 - Add creation and modification of n-n objects in object details (#378)
* Rebase onto develop * Use exit condition instead of englobing condition * Add informative modals that can be called from modal toolbox * Refactor "apply_modify" and "apply_new" into own controller, handle ajax requests with a json response and handle these responses in linkset creation/edition * Fix merge issues * Remove inverted condition * Move linkset create button to a better place, still needs to fix duplicate "New" button caused by a refactor * Handle "Cancel" button in modals * Do not display relations when editing an object in a modal * More elegant way to add "New" button to relations lists * Factorize vertical highlights in alerts and modal in a single mixin * Replace button name with dict entry code * Change route name to snake case * More elegant way to add "Create in modal" button to relations lists * Replace triple if with in_array * Move listener to body * Rename variable to match boolean rules * Rename event * Rename extra param * Add phpdoc * Revert changes * Check indirect linkset rights before allowing creation in modal
This commit is contained in:
@@ -772,6 +772,11 @@ class DataTableUIBlockFactory extends AbstractUIBlockFactory
|
||||
$oDataTable->SetRowActions($aExtraParams['row_actions']);
|
||||
}
|
||||
|
||||
if (isset($aExtraParams['creation_in_modal_js_handler'])){
|
||||
$oDataTable->SetModalCreationHandler($aExtraParams['creation_in_modal_js_handler']);
|
||||
}
|
||||
|
||||
|
||||
return $oDataTable;
|
||||
}
|
||||
|
||||
@@ -1087,6 +1092,10 @@ JS;
|
||||
/**give definition of id for select checkbox*/
|
||||
'row_actions',
|
||||
/** array of blocks displayed on every row */
|
||||
'creation_in_modal_is_allowed',
|
||||
/** bool to allow a creation of a new object of this type in a modal */
|
||||
'creation_in_modal_js_handler',
|
||||
/** Handler to call when trying to create a new object in modal */
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user