LSobject / customAction : Added noConfirmation parameter

This commit is contained in:
Benjamin Renard 2011-07-06 15:53:51 +02:00
parent 55d8d5ec98
commit 33b21ad860
4 changed files with 14 additions and 2 deletions

View file

@ -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 @@
</listitem>
</varlistentry>
<varlistentry>
<term>noConfirmation</term>
<listitem>
<simpara>Booléen permetant de désactiver la confirmation de l'exécution de
l'action.</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>rights</term>
<listitem>

View file

@ -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)) {

View file

@ -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;

View file

@ -71,7 +71,7 @@ if(LSsession :: startLSsession()) {
'label' => ((isset($config['label']))?__($config['label']):__($name)),
'url' => 'custom_action.php?LSobject='.$LSobject.'&amp;dn='.$dn.'&amp;customAction='.$name,
'action' => ((isset($config['icon']))?$config['icon']:'generate'),
'class' => 'LScustomActions'
'class' => 'LScustomActions'.(($config['noConfirmation'])?' LScustomActions_noConfirmation':'')
);
}
}