add.ctp 5.6 KB
Newer Older
1
<?php
2
    echo $this->Html->script('jquery-mask-plugin/dist/jquery.mask.min.js');
3 4
    echo $this->Html->script('responsables.js');

5 6 7
    if (isset($this->validationErrors['Responsable']) && !empty($this->validationErrors['Responsable'])) {
        ?>
        <div class="alert alert-danger" role="alert">
8
            <span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"><!----></span>
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149
            <span class="sr-only">Error:</span>
            Ces erreurs se sont produites:
            <ul>
                <?php
                foreach ($this->validationErrors as $donnees) {
                    foreach ($donnees as $champ) {
                        foreach ($champ as $error) {
                            echo '<li>' . $error . '</li>';
                        }
                    }
                }
                ?>
            </ul>
        </div>
        <?php
    }
?>

<?php
    echo $this->WebcilForm->create('Responsable',[
        'url' => 'add',
        'type' => 'file',
        'autocomplete' => 'off',
        'inputDefaults' => ['div' => false],
        'class' => 'form-horizontal',
        'novalidate' => 'novalidate'
    ]);
?>

<div class="users form">
    <h2>
        <?php
        // Texte : "Le co-responsable :"
        echo __d('responsable', 'responsable.titreResponsable');
        ?>
    </h2>

    <div class="row">
        <!-- Colonne de gauche -->
        <div class="col-md-6">
            <?php
                echo $this->WebcilForm->inputs([
                    'nomresponsable' => [
                        'id' => 'nomresponsable',
                        'required' => true
                    ],
                    'prenomresponsable' => [
                        'id' => 'prenomresponsable',
                        'required' => true
                    ],
                    'fonctionresponsable' => [
                        'id' => 'fonctionresponsable',
                        'required' => true
                    ]
                ]);
            ?>
        </div>

        <!-- Colonne de droite -->
        <div class="col-md-6">
            <?php
                echo $this->WebcilForm->inputs([
                    'emailresponsable' => [
                        'id' => 'emailresponsable',
                        'required' => true
                    ],
                    'telephoneresponsable' => [
                        'id' => 'telephoneresponsable',
                        'required' => true
                    ]
                ]);
            ?>
        </div>
    </div>
    
    <!--Information sur la structure du co-responsable -->
    <h2>
        <?php
            echo __d('responsable', 'responsable.titreStructureResponsable');
        ?>
    </h2>
    
    <div class="row">
        <!-- Colonne de gauche -->
        <div class="col-md-6">
            <?php
                echo $this->WebcilForm->inputs([
                    'raisonsocialestructure' => [
                        'id' => 'raisonsocialestructure',
                        'required' => true
                    ],
                    'siretstructure' => [
                        'id' => 'siretstructure',
                        'required' => true
                    ],
                    'apestructure' => [
                        'id' => 'apestructure', 
                        'required' => true
                    ]
                ]);
            ?>
        </div>

        <!-- Colonne de droite -->
        <div class="col-md-6">
            <?php
                echo $this->WebcilForm->inputs([
                    'telephonestructure' => [
                        'id' => 'telephonestructure'
                    ],
                    'faxstructure' => [
                        'id' => 'faxstructure'
                    ],
                    'adressestructure' => [
                        'id' => 'adressestructure',
                        'type' => 'textarea'
                    ],
                    'emailstructure' => [
                        'id' => 'emailstructure'
                    ],
                    'createdbyorganisation' => [
                        'id' => 'createdbyorganisation',
                        'value' => $this->Session->read('Organisation.id'),
                        'type' => 'hidden'
                    ]
                ]);
            ?>
        </div>
    </div>
    
    <!--Information sur la structure du co-responsable -->
    <h2>
        <?php
            echo __d('responsable', 'responsable.titreAssociationEntiteResponsable');
        ?>
    </h2>
    
    <div class="row">
        <!-- Colonne de gauche -->
        <div class="col-md-6">
            <?php
150 151 152 153 154 155
                if ($this->Autorisation->isSu() === true) {
                    $default = null;
                } else {
                    $default = $this->Session->read('Organisation.id');
                }
            
156 157 158
                echo $this->WebcilForm->input('ResponsableOrganisation.organisation_id', [
                    'class' => 'form-control usersDeroulant',
                    'options' => $mesOrganisations,
159
                    'value' => $default,
160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179
                    'empty' => true, 
                    'multiple' => true,
                    'data-placeholder' => __d('responsable','responsable.placeholderSelectOrganisation'),
                    'label' => [
                        'text' => __d('responsable','responsable.champSelectOrganisation'),
                    ]
                ]);
            ?>
        </div>
    </div>
</div>

<div style="clear: both">
    <?php
        echo $this->WebcilForm->buttons(['Cancel', 'Save']);
    ?>
</div>

<?php
    echo $this->WebcilForm->end();