Skip to content
Snippets Groups Projects
Select Git revision
  • 0b43a0869c300ccd88c143f893b1adc755db712f
  • master default protected
  • ll-workflow
  • alc-scindage-donnees-pj
  • b24
  • FJ_LL_Tbl_Contrat
  • alc-docker-node
  • ll-apiplatform
  • php84
  • ll-rgpd
  • b23
  • alc-filtre-type-intervenant
  • ll-sans-mdb5
  • formules-ancienne-infra
  • ll-formules
  • alc-intervenant-dmep
  • ll-suppr-v_vol-s
  • b20
  • ll-postgresql
  • b23.0.1
  • b22
  • 24.8
  • 24.7
  • 24.6
  • 24.5
  • 24.4
  • 24.3
  • 24.2
  • 24.1
  • 24.0
  • 23.15
  • 24.0-beta19
  • 24.0-beta18
  • 24.0-beta17
  • 24.0-beta16
  • 24.0-beta15
  • 24.0-beta14
  • 24.0-beta13
  • 23.14
  • 24.0-beta12
  • 24.0-beta11
41 results

FormAwareTrait.php

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    service.js 17.27 KiB
    /***************************************************************************************************************************************************
     Propre à l'affichage des services
     /***************************************************************************************************************************************************/
    
    $.widget("ose.serviceListe", {
        totaux: {},
        total: 0,
    
        showHideTypesIntervention: function () {
            var count = 0;
            for (var i in this.totaux) {
                if (this.totaux[i] != 0) {
                    count++;
                    this.element.find("table.service tr th." + i).show(); // entête
                    this.element.find("table.service tr.service-ligne td.type-intervention." + i).show();
                    this.element.find("table.service tfoot tr td." + i).show(); // total
                } else {
                    this.element.find("table.service tr th." + i).hide(); // entête
                    this.element.find("table.service tr.service-ligne td.type-intervention." + i).hide();
                    this.element.find("table.service tfoot tr td." + i).hide(); // total
                }
            }
            this.element.find("table.service #total-general").attr('colspan', count);
            if (count == 0) {
                this.element.find("table.service tfoot").hide();
            } else {
                this.element.find("table.service tfoot").show();
            }
        },
    
    
        calculTotaux: function () {
            var that = this;
            this.totaux = {};
            this.total = 0;
    
            this.element.find("table.service tr.service-ligne td.type-intervention").each(function () {
                var typeInterventionCode = $(this).data('type-intervention-code');
                var value = $(this).data('value');
    
                if (that.totaux[typeInterventionCode] == undefined) that.totaux[typeInterventionCode] = 0;
    
                that.totaux[typeInterventionCode] += value;
                that.total += value;
            });
    
            // on met à jour aussi les entêtes et les totaux
            for (var ti in this.totaux) {
                var heures = this.totaux[ti];
                this.element.find("table.service tfoot tr td." + ti).html(Util.formattedHeures(heures));
            }
            this.element.find("table.service #total-general").html(Util.formattedHeures(this.total));
        },
    
    
        showHideDetails: function (serviceId, action) {
            var tr = this.element.find("#service-" + serviceId + "-volume-horaire-tr");
            var button = this.element.find("#service-" + serviceId + "-ligne td.actions .service-details-button");
            if (undefined === action) {
                if (tr.css('display') === 'none') {
                    action = 'show';
                } else {
                    action = 'hide';
                }
            }
            if (action === 'show') {
                button.html('<i class="fas fa-chevron-up"></i>');
                tr.show(200);
            } else {
                button.html('<i class="fas fa-chevron-down"></i>');