Skip to content
  • joubu's avatar
    Bug 17981: Add a preview mode for notice templates · a236b684
    joubu authored
    
    
    This patch is a first step to provide a preview mode for notice
    templates.
    
    CHECKIN, CHECKOUT and HOLD_SLIP are supported so far.
    Maybe more, but I have not tested yet and the interface will not allow
    you to generate the preview.
    
    The idea is to provide an idea of how will render the messages generated
    from a notice template.
    
    A new "Preview" button is added close to each textarea on the editing
    notice templates view.
    For each notice template code (letter_code), we will need some input
    data to produce the preview.
    
    For instance, for CHECKIN we need an barcode. From the barcode we
    can guess all the other data.
    For CHECKOUT we will need the borrowernumber and the barcode.
    Note that the way to enter the data for the preview is not really
    user-friendly, for CHECKOUT you will have to fill
    'borrowernumber|barcode', but the placeholder will help you to know how
    and what to fill.
    In the modal window, you will see 4 blocks:
    1/ the content of the letter (with the placeholds << >>)
    2/ the generated message (with the data filled)
    3/ if the letter contained historical syntax markers, the screen will
    try to generate a notice template using the TT syntax
    4/ the generated message from this TT syntax
    => You will be able to compare the 2 generated messages.
    
    What is the goal of this first patchset:
    - Show this first POC and get feedback from other developpers
    - Add a way to easily visualise the differences between the 2 syntaxes
    - Confort users with the TT syntax and the migration step from the
    historical syntax.
    
    I'd like to get opinions before going further.
    
    The possibilities:
    - Mock data to get fully working generated messages for any notice
    templates. For instance, for CHECKIN and CHECKOUT, the item is not
    checked in/out yet. So we cannot access the issue's information.
    (I have no idea how to do that)
    - Browse the data to get the ones we want to use for the preview (big).
    
    Signed-off-by: default avatarKyle M Hall <kyle@bywatersolutions.com>
    
    Signed-off-by: default avatarJosef Moravec <josef.moravec@gmail.com>
    
    Signed-off-by: default avatarJonathan Druart <jonathan.druart@bugs.koha-community.org>
    a236b684