An error occurred fetching the project authors.
  1. 09 May, 2024 2 commits
  2. 28 Feb, 2024 1 commit
  3. 11 Sep, 2023 2 commits
    • Julien Muchembled's avatar
      ListBox: fix possible unexpected acquisition · 8e3d2599
      Julien Muchembled authored
      The use case is a listbox method being called for a document A
      and returning objects that:
      - aren't children of A
      - but wrapped with `.__of__(A)`
      
      By using `aq_self` instead of `aq_base`, the listbox could still
      acquire from the real parent of the returned object and wrongly access
      an attribute directly (e.g. comment) instead of using an appropriate
      method (if there's no `comment` attribute, getComment returns '').
      
      See merge request nexedi/erp5!1820
      8e3d2599
    • Julien Muchembled's avatar
      ListBox: simplify code · 5803f7b6
      Julien Muchembled authored
      5803f7b6
  4. 24 Mar, 2023 1 commit
  5. 03 Mar, 2023 1 commit
  6. 28 Sep, 2022 1 commit
  7. 18 Aug, 2022 2 commits
    • Jérome Perrin's avatar
      Listbox,SelectionTool: use make_query instead of crafting URL manually · 3cb786cc
      Jérome Perrin authored
      Using make_query makes sure that the query parameters are properly
      encoded and also change selection_index to become an int, because
      it keeps the type of parameters.
      
      As a consequence, we had to adjust a few place in the code where
      selection_index was tested for truthiness: because "0" as a string is
      true, but 0 as an int is not. For that, we changed to test the presence
      of selection_name instead of testing selection_index, as they are always
      used together.
      
      This fixes a problem that & in URL was encoded twice for listbox
      anchor links ( bug_module/1137 )
      3cb786cc
    • Jérome Perrin's avatar
      Listbox: refactor computation of "default" URL · 9ca9d73d
      Jérome Perrin authored
      "default" URL is the URL when listbox column does not use URL column
      and when the brains do not have a getListItemUrl method.
      
      Move the computation in a lazyMethod, so that it is computed only once
      per line instead of once per cell.
      
      Also remove a try/except, I don't think this code is supposed to get an
      AttributeError
      9ca9d73d
  8. 04 May, 2022 2 commits
    • Arnaud Fontaine's avatar
      py3: ListBox: Port to Python3. · ec025675
      Arnaud Fontaine authored
      ec025675
    • Arnaud Fontaine's avatar
      py2/py3: Make Products code compatible with both python2 and python3. · a17bb910
      Arnaud Fontaine authored
      Done through various 2to3 fixers (zope.fixers, modernize, future) and manual
      changes. This is a single commit so that we have a clearer picture of how code
      converted with my2to3 should look like.
      
      Except straightforward @implementer decorator 2to3 fixer, only product/ folder
      was considered as the goal was to be able to create an ERP5Site.
      
      * Use @implementer decorator introduced in zope.interface 3.6.0 (2010):
      
        The implements syntax used under Python 2.X does not work under 3.X, since it
        depends on how metaclasses are implemented and this has changed. Instead it
        now supports a decorator syntax (also under Python 2.X).
      
        Applied thanks to 2to3 `zope.fixers` package.
      
      * Use `six.moves` rather than `future` install_aliases() feature because the
        latter use unicode_literals and "wraps" module aliases so that unicode() are
        returned for text rather than str() (Python2 standard library). This notably
        breaks BusinessTemplate code which uses urllib quote() for filesystem paths...
      
      * No more unbound methods in python3 so use six.get_unbound_function().
      
      * dict.(iteritems,iterkeys,itervalues)() => six.\1(dict) thanks to `dict_six`
        2to3 fixer from `modernize`:
        $ python-modernize -w -f dict_six product/
      
      * Manually make sure that dict.{items,values,keys}() returns a real list when it
        is latter modified rather than a dict_{items,values,keys} (ensure_list()). By
        default, 2to3 blindly does list(dict.{items,values,keys}()) which is not
        acceptable from performances point of view. With my2to3, this will be possible
        to handle such case automatically.
      
      * Replace cStringIO.StringIO() by six.moves.cStringIO() (a module alias for
        cStringIO.StringIO() on py2 and io.StringIO() on py3).
      
      * Use six.text_type which maps to unicode() on py2 and str() on py3. This also
        makes a clearer difference between text and binary strings.
      
      * Replace map()/filter() with lambda function by list comprehension (this has
        the benefit to avoid casting to list for py3 as it returns iterators).
      a17bb910
  9. 24 Mar, 2022 1 commit
    • Julien Muchembled's avatar
      ERP55Form: drop a broken proxy field cache · 25ad9ece
      Julien Muchembled authored
      When rendering a proxy field, 3 different fields can come in play:
      1. the field to be rendered
      3. the template field (i.e. not a proxy field) that knows how to render
      2. possibly an intermediate proxy field that contains the value to render
      
      What's difficult when rendering a proxy field is to take the above 3 fields
      into account and this commit does it by creating a temporary field:
      1. 'field' variable in TALES
      2. the value
      3. the code
      
      Before this commit, 1 could be wrong.
      25ad9ece
  10. 11 May, 2021 1 commit
  11. 29 Apr, 2021 1 commit
  12. 17 Jan, 2020 1 commit
  13. 18 Nov, 2019 2 commits
  14. 26 Oct, 2018 1 commit
    • Georgios Dagkakis's avatar
      SelectionTool/Listbox: Fix in calculating the start of last page in selection · 405ee70e
      Georgios Dagkakis authored
      as the comment (which is removed now) said:
      
      ```
              XXX: This method is broken, since "total_size" field is not
              present in the listbox rendering any longer. It should be
              removed.
      ```
      
      Also:
      - make sure that Listbox always knows how many lines are to be displayed.
      - add testPagerWithCustomListMethod in listbox_zuite of erp5_ui_test,
      which checks that listbox jumping to previous/next/first/last works correctly
      for a list method that returns only the elements that the listbox is to render.
      
      
      /reviewed-on nexedi/erp5!776
      405ee70e
  15. 19 May, 2017 2 commits
  16. 05 Dec, 2016 1 commit
  17. 03 Nov, 2016 1 commit
    • Julien Muchembled's avatar
      listbox: sorting by CAST type (float) · de972081
      Julien Muchembled authored
      Only 'float' supported for the moment. This should cover the case of integers.
      
      Example of 'Sortable Columns' value in a ListBox:
      
        id | float
        title |
      
      Since there's a fallback to 'Searchable Columns' when 'Sortable Columns' is
      empty, the cast type can also be specified there, in order to avoid duplication.
      de972081
  18. 19 Oct, 2016 1 commit
    • Arnaud Fontaine's avatar
      ListBox: Navigation methods should not be created when rendering ListBox (#20161014-741678). · 6fd21826
      Arnaud Fontaine authored
      These methods were generated when rendering the ListBox and with the id
      of the ListBox in their name. However, a customer reported the following
      problem on Accounting Periods ListBox:
      
        1. Display Accounting Period ListBox on ZEO-1.
             => The ListBox will be rendered and 'listbox_period_list_*' methods will be generated on ZEO-1.
        2.  Click on 'Next Page' button and the user is redirect to ZEO-2 where the ListBox has never been generated.
             => The method does not exist yet and thus a 404 error is raised.
      
      Instead of having one method per ListBox ID, only one is now created (eg
      listbox_setPage() for SelectionTool.setPage()) at Zope startup and the
      ListBox ID previously defined in the method name is now defined in the
      value attributes of the buttons.
      6fd21826
  19. 05 Oct, 2016 1 commit
  20. 10 Jun, 2016 1 commit
  21. 12 May, 2016 1 commit
  22. 09 Mar, 2016 3 commits
  23. 25 Dec, 2015 1 commit
  24. 17 Sep, 2015 1 commit
  25. 04 Sep, 2015 1 commit
  26. 26 Jan, 2015 1 commit
  27. 16 Dec, 2014 3 commits
  28. 31 Oct, 2014 1 commit
  29. 16 Oct, 2014 2 commits