Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 8473 | Rev 8522 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 8473 Rev 8478
Línea 182... Línea 182...
182
        e.preventDefault();
182
        e.preventDefault();
Línea 183... Línea 183...
183
        
183
        
184
        $("#extended-box").modal('hide');
184
        $("#extended-box").modal('hide');
185
        return false;
185
        return false;
186
    });
-
 
187
 
-
 
188
	var validatorIndustry = $('#form-industry').validate({
-
 
189
        debug: true,
-
 
190
        onclick: false,
-
 
191
        onkeyup: false,
-
 
192
        onfocusout: false,
-
 
193
        ignore: [],
-
 
194
        rules: {
-
 
195
            'industry_id': {
-
 
196
                required: true,
-
 
197
            },
-
 
198
        },
-
 
199
 
-
 
200
        submitHandler: function(form)
-
 
201
        {
-
 
202
            NProgress.start();
-
 
203
            $.ajax({
-
 
204
                'dataType'  : 'json',
-
 
205
                'accept'    : 'application/json',
-
 
206
                'method'    : 'post',
-
 
207
                'url'       :  $('#form-industry').attr('action'),
-
 
208
                'data'      :  $('#form-industry').serialize()
-
 
209
            }).done(function(response) {
-
 
210
                if(response['success']) {
-
 
211
 
-
 
212
                    $('#overview-industry').html(response['data']);
-
 
213
                    $("#industry-box").modal('hide');
-
 
214
                } else {
-
 
215
                    validatorIndustry.resetForm();
-
 
216
                    if(jQuery.type(response['data']) == 'string') {
-
 
217
                        $.fn.showError(response['data']);
-
 
218
                    } else  {
-
 
219
                        $.each(response['data'], function( fieldname, errors ) {
-
 
220
                            $.fn.showFormErrorValidator('#form-industry #' + fieldname, errors);
-
 
221
                        });
-
 
222
                    }
-
 
223
                }
-
 
224
            }).fail(function( jqXHR, textStatus, errorThrown) {
-
 
225
                $.fn.showError(textStatus);
-
 
226
            }).always(function() {
-
 
227
                NProgress.done();
-
 
228
            });
-
 
229
            return false;
-
 
230
        },
-
 
231
        invalidHandler: function(form, validator) {
-
 
232
        
-
 
233
        }
-
 
234
    });
-
 
235
 
-
 
236
 
-
 
237
    $('.btn-industry-edit').on("click", function(e){
-
 
238
        e.preventDefault();
-
 
239
 
-
 
240
        NProgress.start();
-
 
241
        $.ajax({
-
 
242
            'dataType'  : 'json',
-
 
243
            'accept'    : 'application/json',
-
 
244
            'method'    : 'get',
-
 
245
            'url'       : '$routeIndustry',
-
 
246
        }).done(function(response) {
-
 
247
           if(response['success']) {
-
 
248
				$('#form-industry #industry_id').val(response['data']['industry_id']).trigger('change');
-
 
249
           
-
 
250
                validatorIndustry.resetForm();
-
 
251
 
-
 
252
                $("#industry-box").modal('show');
-
 
253
            } else {
-
 
254
                $.fn.showError(response['data']);
-
 
255
            }
-
 
256
        }).fail(function( jqXHR, textStatus, errorThrown) {
-
 
257
            $.fn.showError(textStatus);
-
 
258
        }).always(function() {
-
 
259
            NProgress.done();
-
 
260
        });
-
 
261
        return false;
-
 
262
 
-
 
263
    });
-
 
264
    
-
 
265
    $('.btn-industry-close').on("click", function(e){
-
 
266
        e.preventDefault();
-
 
267
        
-
 
268
        $("#industry-box").modal('hide');
-
 
269
        return false;
-
 
Línea 270... Línea 186...
270
    });    
186
    });
Línea 271... Línea 187...
271
    
187
    
Línea 371... Línea 287...
371
            </div>
287
            </div>
372
            <?php echo $this->form()->closeTag($form); ?>
288
            <?php echo $this->form()->closeTag($form); ?>
373
        </div>
289
        </div>
374
    </div>
290
    </div>
375
</div>
291
</div>
376
<div class="modal" tabindex="-1" role="dialog" id="industry-box">
-
 
377
    <div class="modal-dialog" role="document">
-
 
378
        <?php
-
 
379
        $form = $this->formIndustry;
-
 
380
        $form->setAttributes([
-
 
381
            'method' => 'post',
-
 
382
            'action' => $routeIndustry,
-
 
383
            'name' => 'form-industry',
-
 
384
            'id' => 'form-industry'
-
 
385
        ]);
-
 
386
        $form->prepare();
-
 
387
        echo $this->form()->openTag($form);
-
 
388
        ?>
-
 
389
        <div class="modal-content">
-
 
390
            <div class="modal-header">
-
 
391
                <h3 class="modal-title">LABEL_CHANGE</h3>
-
 
392
            </div>
-
 
393
            <div class="modal-body">
-
 
394
                <div class="form-group">
-
 
395
                    <?php
-
 
396
                    $element = $form->get('industry_id');
-
 
397
                    $element->setAttributes(['class' => 'form-control']);
-
 
398
                    $element->setOptions(['label' => 'LABEL_INDUSTRY']);
-
 
399
                    echo $this->formLabel($element);
-
 
400
                    echo $this->formSelect($element);
-
 
401
                    ?>
-
 
402
                </div>
-
 
403
            </div>
-
 
404
            <div class="modal-footer">
-
 
405
                <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
-
 
406
                <button type="button" class="btn btn-default btn-industry-close">LABEL_CANCEL</button>
-
 
407
            </div>
-
 
408
            <?php echo $this->form()->closeTag($form); ?>
-
 
409
        </div>
-
 
410
    </div>
-
 
411
</div>
-
 
412
<div class="modal" tabindex="-1" role="dialog" id="company-size-box">
292
<div class="modal" tabindex="-1" role="dialog" id="company-size-box">
413
    <div class="modal-dialog" role="document">
293
    <div class="modal-dialog" role="document">
414
        <?php
294
        <?php
415
        $form = $this->formCompanySize;
295
        $form = $this->formCompanySize;
416
        $form->setAttributes([
296
        $form->setAttributes([