Editor separator and MJoin question

Editor separator and MJoin question

LapointeLapointe Posts: 86Questions: 16Answers: 1

hi all
First of all, thanks for your help for all questions I asked <3 .

As you know I was born last century and start dev with CPM or DOS, but ...

Is there a way (not using template forms) to draw a separator (simple line, better with thickness, dotted or not, with text or not but...) in the editor ? B)
I hope this will be possible....

Other point is :'(
I need to set access rights to n employes to n rows in table 2 but only for particular row type:
each row has an unique ID and a Type (can be 1, 2 , 3) ...

using MJoin, I can set users rights to object ID

                    Mjoin::inst( 'operations' )
                        ->link( 'prescripteurs.ID', 'prescripteurs_operations.Prescripteur' )
                        ->link( 'operations.ID', 'prescripteurs_operations.Operation' )
                        ->order( 'operations.Libelle asc' )
                        ->fields(
                            Field::inst( 'ID' )
                                ->validator( Validate::required() )
                                ->options( Options::inst()
                                    ->table( 'operations' )
                                    ->value( 'ID' )
                                    ->label( 'Libelle' )
                                ),
                            Field::inst( 'operations.Libelle' )
                                ->name('LibOp')
                                -> set(false)
                        )

**but I want to set rights to users for specific type of object (where they do have access by type) **

                    Mjoin::inst( 'operations_TYPE1 AS SELECT * FROM operations where Type=1' )
                        ->link( 'prescripteurs.ID', 'prescripteurs_operations.Prescripteur' )
                        ->link( 'operations_TYPE1.ID', 'prescripteurs_operations.Operation' )
                        ->order( 'operations_TYPE1.Libelle asc' )
// or where clause here
                        ->fields(
                            Field::inst( 'ID' )
                                ->validator( Validate::required() )
                                ->options( Options::inst()
                                    ->table( 'operations' )
                                    ->value( 'ID' )
                                    ->label( 'Libelle' )
                                ),
                            Field::inst( 'operations_TYPE1.Libelle' )
                                ->name('LibOpType1')    // displayed value
                                -> set(false)
                        ),
                    Mjoin::inst( 'operations_TYPE2 AS SELECT * FROM operations where Type=2' )
                        ->link( 'prescripteurs.ID', 'prescripteurs_operations.Prescripteur' )
                        ->link( 'operations_TYPE2 .ID', 'prescripteurs_operations.Operation' )
                        ->order( 'operations_TYPE2 .Libelle asc' )
// or where clause here
                        ->fields(
                            Field::inst( 'ID' )
                                ->validator( Validate::required() )
                                ->options( Options::inst()
                                    ->table( 'operations' )
                                    ->value( 'ID' )
                                    ->label( 'Libelle' )
                                ),
                            Field::inst( 'operations_TYPE2 .Libelle' )
                                ->name('LibOpType2')    // displayed value
                                -> set(false)
                        ),

Is there a pretty way to do that ?

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 50,881Questions: 1Answers: 7,626 Site admin

    Is there a way (not using template forms) to draw a separator (simple line, better with thickness, dotted or not, with text or not but...) in the editor ?

    I'm afraid I don't quite understand this question. Why would you draw a separator in Editor? The form will already be broken down into a multi-checkbox or a checkbox input. Could you clarify this for me please?

    **but I want to set rights to users for specific type of object (where they do have access by type) **

    Sorry - I must be having a slow start to the day. I'm not getting this one either. Could you illustrate it with an example for me please?

    Allan

  • LapointeLapointe Posts: 86Questions: 16Answers: 1

    Hi @allan

    For separators, it is just to explain what is in form section like

    For rights definition, I have a schema like

    where I want to define link from OP to USR (USR_OP_RIGHTS) but just for OP that are linked by their type (TYP_OP) to the USR (USR_TYP_OP_RIGHTS)

  • LapointeLapointe Posts: 86Questions: 16Answers: 1

    Separators could be used as form section subtitle...

  • allanallan Posts: 50,881Questions: 1Answers: 7,626 Site admin
    Answer ✓

    Ah! I understand now - thanks for the images.

    I use this plug-in for that on the Editor login and signup form.

    Allan

  • LapointeLapointe Posts: 86Questions: 16Answers: 1

    hi @allan
    Thanks a lot... There are so many classes, functions and tools in your product... Sometime I search many hours for something already existing...

    Using your sample, I add a line type as :

        _fieldTypes.title = {
            create: function ( field )      { return $('<div/>')[0]; },
            get:    function ( field )      { return ''; },
            set:    function ( field, val ) {}
        };
        _fieldTypes.line = {
            create: function ( field )      { return $('<hr/>')[0]; },
            get:    function ( field )      { return ''; },
            set:    function ( field, val ) {}
        };
    
    // call fields...
                    {'label': 'test', 'name': 'test','type': 'line'},
    //...
    

    and set css as

    div.DTE_Field.DTE_Field_Type_line hr {
      width: 100% !important;
      display: block;
      margin-top: 0.5em;
      margin-bottom: 0.5em;
      margin-left: auto;
      margin-right: auto;
      border-style: inset;
      border-width: 2px;
      }
    div.DTE_Field.DTE_Field_Type_line label {
      width: 100% !important;
      font-size: 1.2em;
      font-weight: bold;
      border-bottom: 1px solid #aaa;}
    

    but I don't understant why line appears sometime dark and othertime gray (and dark again when closing form) just by clicking refresh.

  • allanallan Posts: 50,881Questions: 1Answers: 7,626 Site admin

    I'm not sure either to be honest! Can you give me a link to your page so I can take a look please?

    Thanks,
    Allan

  • LapointeLapointe Posts: 86Questions: 16Answers: 1

    Hi @allan
    Thanks.
    I'll do ASAP...

Sign In or Register to comment.