diff --git a/.gitignore b/.gitignore index e3a475c..6b4c619 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ -.nbprocjet +.nbproject .buildpath .project +.settings/ diff --git a/admin/upbuttons_setup.php b/admin/upbuttons_setup.php index c765236..fff28fe 100644 --- a/admin/upbuttons_setup.php +++ b/admin/upbuttons_setup.php @@ -104,21 +104,21 @@ print ' '; print ''.$langs->trans("Value").''."\n"; - +/* // Example with a yes / no select $var=!$var; print ''; -print ''.$langs->trans("ParamLabel").''; +print ''.$langs->trans("UseAllButton").''; print ' '; print ''; print '
'; print ''; -print ''; -print $form->selectyesno("CONSTNAME",$conf->global->CONSTNAME,1); +print ''; +print $form->selectyesno("UPBUTTON_USE_ALL_MODE",$conf->global->UPBUTTON_USE_ALL_MODE,1); print ''; print '
'; print ''; - +*/ print ''; llxFooter(); diff --git a/core/modules/modUpbuttons.class.php b/core/modules/modUpbuttons.class.php index e056dda..c7eb928 100644 --- a/core/modules/modUpbuttons.class.php +++ b/core/modules/modUpbuttons.class.php @@ -58,7 +58,7 @@ function __construct($db) // Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module) $this->description = "Description of module Upbuttons"; // Possible values for version are: 'development', 'experimental', 'dolibarr' or version - $this->version = '1.0'; + $this->version = '1.0.1'; // Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase) $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); // Where to store the module in setup page (0=common,1=interface,2=others,3=very specific) @@ -182,6 +182,12 @@ function __construct($db) $this->rights[$r][4] = 'useit'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) $r++; + $this->rights[$r][0] = $this->numero + $r; // Permission id (must not be already used) + $this->rights[$r][1] = 'UseAllButton'; // Permission label + $this->rights[$r][3] = 0; // Permission by default for new user (0/1) + $this->rights[$r][4] = 'UseAllButton'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) + $r++; + // Main menu entries $this->menu = array(); // List of menus to add diff --git a/img/all.png b/img/all.png new file mode 100644 index 0000000..59ef9c4 Binary files /dev/null and b/img/all.png differ diff --git a/img/all.xcf b/img/all.xcf new file mode 100644 index 0000000..07cc1a3 Binary files /dev/null and b/img/all.xcf differ diff --git a/js/upbuttons.js.php b/js/upbuttons.js.php index 47c04cb..f57c34e 100644 --- a/js/upbuttons.js.php +++ b/js/upbuttons.js.php @@ -1,18 +1,29 @@ rights->upbuttons->useit)) exit; ?>$(document).ready(function() { - var $el = $('div.tabsAction'); + var $el = $('div.tabsAction').first(); + + rights->upbuttons->UseAllButton)) { + echo '$("body").append("'.addslashes('').'");'; + } + ?> + function scrollButtonsToUp() { var scrollTop = $(window).scrollTop(); + var scrollLeft = $(window).scrollLeft(); var wHeight = $( window ).height(); - - if(scrollTop + wHeight < originalElementTop ) { + var wWidth = $( window ).width(); + + if((scrollTop + wHeight < originalElementTop) || (scrollLeft + wWidth < originalElementLeft)) { //console.log("tabsAction not in screen "); $el.css({ @@ -28,11 +39,47 @@ function scrollButtonsToUp() { }); $el.addClass('upbuttonsdiv'); + + $('#justOneButton').click(function() { + + if($el.is(":visible")) { + $el.hide(); + $(this).css('bottom', 20); + + } + else { + $el.show(); + $(this).css('bottom', $el.height() + 10); + + } + }); + + + rights->upbuttons->UseAllButton)) { + ?> + $el.hide(); + $('#justOneButton').css({ + position:"fixed" + ,bottom:'20px' + ,right:'20px' + ,'margin':'0 0 0 0' + ,'opacity':0.7 + }).show(); + + } else{ //console.log("tabsAction in screen "); $el.removeAttr('style'); $el.removeClass('upbuttonsdiv'); + $el.show(); + $('#justOneButton').hide(); } } @@ -41,11 +88,20 @@ function scrollButtonsToUp() { if (editline_subtotal == -1 && ($el.length == 1 && ($el.find('.button').length>0 || $el.find('.butAction').length>0))) { - var originalElementTop = $el.offset().top; - + var originalElementTop = $el.offset().top; + var originalElementLeft = $el.offset().left; + + if(originalElementTop <= 0) { + window.setTimeout(function() { originalElementTop = $el.offset().top;originalElementLeft = $el.offset().left; scrollButtonsToUp(); },100); + } + $( window ).resize(function() { + scrollButtonsToUp(); + }); + $(window).on('scroll', function() { - scrollButtonsToUp(); + scrollButtonsToUp(); }); + scrollButtonsToUp(); } diff --git a/langs/fr_FR/upbuttons.lang b/langs/fr_FR/upbuttons.lang index e8b24cd..4ef3056 100644 --- a/langs/fr_FR/upbuttons.lang +++ b/langs/fr_FR/upbuttons.lang @@ -4,4 +4,5 @@ Module104830Desc = Module affichant en flottant les boutons d'actions d'une fich ATMAbout = Ce module a été développé par ATM Consulting
Vous pouvez retrouver la documentation sur notre wiki

Pour toute question technique ou retour, contactez-nous sur support@atm-consulting.fr

Pour toute question commerciale, contactez-nous sur contact@atm-consulting.fr ou au +33 9 77 19 50 70

Retrouvez nos autres modules sur Dolistore UpbuttonsSetup = Configuration du module Upbuttons -UpbuttonsAbout = A propos du module Upbuttons \ No newline at end of file +UpbuttonsAbout = A propos du module Upbuttons +UseAllButton=Utilise le mode un seul bouton \ No newline at end of file diff --git a/langs/it_IT/upbuttons.lang b/langs/it_IT/upbuttons.lang new file mode 100644 index 0000000..841939f --- /dev/null +++ b/langs/it_IT/upbuttons.lang @@ -0,0 +1,7 @@ +Module104830Name = Upbuttons +Module104830Desc = Mostra i bottoni d'azione senza necessità di scorrere la pagina + +ATMAbout = Questo modulo è stato sviluppato da ATM Consulting
Ulteriore documentazione disponibile nel wiki

Per domande e feedback contattateci a support@atm-consulting.fr

Per questioni commerciali contattateci acontact@atm-consulting.fr or at +33 9 77 19 50 70

Scoprite altri moduli sul Dolistore + +UpbuttonsSetup = Upbuttons impostazioni modulo +UpbuttonsAbout = A proposito Upbuttons \ No newline at end of file