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]', 'question_format' => '[LSformat de la question de confirmation]',
'onSuccessMsgFormat' => '[LSformat du message à afficher en cas de succès de l'action]', 'onSuccessMsgFormat' => '[LSformat du message à afficher en cas de succès de l'action]',
'disableOnSuccessMsg' => '[booléen]', 'disableOnSuccessMsg' => '[booléen]',
'noConfirmation' => '[booléen]',
'rights' => array( 'rights' => array(
'LSprofile1', 'LSprofile1',
'LSprofile2', 'LSprofile2',
@ -75,6 +76,14 @@
</listitem> </listitem>
</varlistentry> </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> <varlistentry>
<term>rights</term> <term>rights</term>
<listitem> <listitem>

View file

@ -38,7 +38,7 @@ if(LSsession :: startLSsession()) {
else { else {
$title=__($_GET['customAction']); $title=__($_GET['customAction']);
} }
if (isset($_GET['valid'])) { if (isset($_GET['valid']) || $config['noConfirmation']) {
$objectname=$object -> getDisplayName(); $objectname=$object -> getDisplayName();
$GLOBALS['Smarty'] -> assign('pagetitle',$title.' : '.$objectname); $GLOBALS['Smarty'] -> assign('pagetitle',$title.' : '.$objectname);
if ($config['function']($object)) { if ($config['function']($object)) {

View file

@ -101,6 +101,9 @@ var LSview = new Class({
}, },
onCustomActionBtnClick: function(event,a) { onCustomActionBtnClick: function(event,a) {
if (a.hasClass('LScustomActions_noConfirmation')) {
return true;
}
Event(event).stop(); Event(event).stop();
if (!this._confirmBoxOpen) { if (!this._confirmBoxOpen) {
this._confirmBoxOpen = 1; this._confirmBoxOpen = 1;

View file

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