customAction : add noRedirect parameter

This commit is contained in:
Benjamin Renard 2017-03-08 16:57:44 +01:00
parent bf8044f5f8
commit 042fb21901
2 changed files with 12 additions and 2 deletions

View file

@ -17,6 +17,7 @@
'disableOnSuccessMsg' => '[booléen]', 'disableOnSuccessMsg' => '[booléen]',
'noConfirmation' => '[booléen]', 'noConfirmation' => '[booléen]',
'redirectToObjectList' => '[booléen]', 'redirectToObjectList' => '[booléen]',
'noRedirect' => '[booléen]',
'rights' => array( 'rights' => array(
'LSprofile1', 'LSprofile1',
'LSprofile2', 'LSprofile2',
@ -109,6 +110,15 @@
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry>
<term>noRedirect</term>
<listitem>
<simpara>Booléen permetant de désactiver la redirection de l'utilisateur après
l'execution de l'action. Cela permet à la fonction de définir son propre fichier
de template de retour et donc d'afficher une page personnalisable.</simpara>
</listitem>
</varlistentry>
<varlistentry> <varlistentry>
<term>rights</term> <term>rights</term>
<listitem> <listitem>

View file

@ -56,7 +56,7 @@ if(LSsession :: startLSsession()) {
if ($config['redirectToObjectList']) { if ($config['redirectToObjectList']) {
LSsession :: redirect('view.php?LSobject='.$LSobject.'&refresh'); LSsession :: redirect('view.php?LSobject='.$LSobject.'&refresh');
} }
else { else if (!isset($config['noRedirect']) || !$config['noRedirect']) {
LSsession :: redirect('view.php?LSobject='.$LSobject.'&dn='.urlencode($dn)); LSsession :: redirect('view.php?LSobject='.$LSobject.'&dn='.urlencode($dn));
} }
} }
@ -81,9 +81,9 @@ if(LSsession :: startLSsession()) {
LStemplate :: assign('question',$question); LStemplate :: assign('question',$question);
LStemplate :: assign('validation_url','custom_action.php?LSobject='.urlencode($LSobject).'&amp;dn='.urlencode($dn).'&amp;customAction='.urlencode($customAction).'&amp;valid'); LStemplate :: assign('validation_url','custom_action.php?LSobject='.urlencode($LSobject).'&amp;dn='.urlencode($dn).'&amp;customAction='.urlencode($customAction).'&amp;valid');
LStemplate :: assign('validation_label',_('Validate')); LStemplate :: assign('validation_label',_('Validate'));
}
LSsession :: setTemplate('question.tpl'); LSsession :: setTemplate('question.tpl');
} }
}
else { else {
LSerror :: addErrorCode('LSsession_13'); LSerror :: addErrorCode('LSsession_13');
} }