diff --git a/doc/conf/LSobject/customActions.docbook b/doc/conf/LSobject/customActions.docbook index 06a9537b..43baa4ed 100644 --- a/doc/conf/LSobject/customActions.docbook +++ b/doc/conf/LSobject/customActions.docbook @@ -13,6 +13,7 @@ 'question_format' => '[LSformat de la question de confirmation]', 'onSuccessMsgFormat' => '[LSformat du message à afficher en cas de succès de l'action]', 'disableOnSuccessMsg' => '[booléen]', + 'noConfirmation' => '[booléen]', 'rights' => array( 'LSprofile1', 'LSprofile2', @@ -75,6 +76,14 @@ + + noConfirmation + + Booléen permetant de désactiver la confirmation de l'exécution de + l'action. + + + rights diff --git a/public_html/custom_action.php b/public_html/custom_action.php index f1e3dc30..20f82346 100644 --- a/public_html/custom_action.php +++ b/public_html/custom_action.php @@ -38,7 +38,7 @@ if(LSsession :: startLSsession()) { else { $title=__($_GET['customAction']); } - if (isset($_GET['valid'])) { + if (isset($_GET['valid']) || $config['noConfirmation']) { $objectname=$object -> getDisplayName(); $GLOBALS['Smarty'] -> assign('pagetitle',$title.' : '.$objectname); if ($config['function']($object)) { diff --git a/public_html/includes/js/LSview.js b/public_html/includes/js/LSview.js index 2b850a3b..bb7eb7e5 100644 --- a/public_html/includes/js/LSview.js +++ b/public_html/includes/js/LSview.js @@ -101,6 +101,9 @@ var LSview = new Class({ }, onCustomActionBtnClick: function(event,a) { + if (a.hasClass('LScustomActions_noConfirmation')) { + return true; + } Event(event).stop(); if (!this._confirmBoxOpen) { this._confirmBoxOpen = 1; diff --git a/public_html/view.php b/public_html/view.php index b5be65a2..ce68a81f 100644 --- a/public_html/view.php +++ b/public_html/view.php @@ -71,7 +71,7 @@ if(LSsession :: startLSsession()) { 'label' => ((isset($config['label']))?__($config['label']):__($name)), 'url' => 'custom_action.php?LSobject='.$LSobject.'&dn='.$dn.'&customAction='.$name, 'action' => ((isset($config['icon']))?$config['icon']:'generate'), - 'class' => 'LScustomActions' + 'class' => 'LScustomActions'.(($config['noConfirmation'])?' LScustomActions_noConfirmation':'') ); } }