check box to confirm module deactivation

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

check box to confirm module deactivation

Stéphane Rivière
Hi all,

I'm finishing a little module with hook, triggers and extrafields.

I wonder if there is an easy way to get a check box (ajax) to confirm a
module deactivation...

I found a standart way to get a check box to confirm a module
activation, but no the opposite...

If anyone have a template or some code snippets, it could helped me a
lot (I'm not a regular PHP dev nor a Dolibarr hacker ;).

Thanks by advance...

Stef

_______________________________________________
Dolibarr-dev mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/dolibarr-dev
Reply | Threaded
Open this post in threaded view
|

Re: check box to confirm module deactivation

Laurent Destailleur (aka Eldy)
Try to add this is the descriptor of your module

$this->warnings_unactivation = array('always'=>'HeyConfirmThis');

Not sure it works. Just try.

Le lun. 25 févr. 2019 à 18:13, Stéphane Rivière <[hidden email]> a écrit :
Hi all,

I'm finishing a little module with hook, triggers and extrafields.

I wonder if there is an easy way to get a check box (ajax) to confirm a
module deactivation...

I found a standart way to get a check box to confirm a module
activation, but no the opposite...

If anyone have a template or some code snippets, it could helped me a
lot (I'm not a regular PHP dev nor a Dolibarr hacker ;).

Thanks by advance...

Stef

_______________________________________________
Dolibarr-dev mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/dolibarr-dev


--
------------------------------------------------------------------------------------
Google+: https://plus.google.com/+LaurentDestailleur-Open-Source-Expert/
Facebook: https://www.facebook.com/Destailleur.Laurent
------------------------------------------------------------------------------------
* Dolibarr (Project leader): https://www.dolibarr.org (make a donation for Dolibarr project via Paypal: [hidden email])
* AWStats (Author) : http://awstats.sourceforge.net (make a donation for AWStats project via Paypal: [hidden email])
* AWBot (Author) : http://awbot.sourceforge.net
* CVSChangeLogBuilder (Author) : http://cvschangelogb.sourceforge.net



_______________________________________________
Dolibarr-dev mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/dolibarr-dev
Reply | Threaded
Open this post in threaded view
|

Re: check box to confirm module deactivation

Stéphane Rivière
Hi Eldy,

Thanks for you answer...

> $this->warnings_unactivation = array('always'=>'HeyConfirmThis');
> Not sure it works. Just try.

I confirm it does not work nor exist in DolibarrModules.class.php

I've found in the same file a public $warnings_activation;
which works (tested)... then create public warnings_unactivation the
right place, then create $arrayofwarningsunactivate=array(); in
modules.php (and populate it in the appropriate loop) then stuck around
line 700 :

// Activate/Disable and Setup (2 columns)
         if (! empty($conf->global->$const_name))

Try to follow the logic when activate and deactivate, without success. I
saw clearly the activate process but the deactivate path is unclear to
me : lack of time and (undoubtly) skill :(

If you have some tracks/ideas to give... You're very welcome :)

Stef

_______________________________________________
Dolibarr-dev mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/dolibarr-dev