Commit 7d3a988b authored by Laurent Lecluse's avatar Laurent Lecluse
Browse files

MAJ Bootstrap 5

parent 6c5be2bc
Loading
Loading
Loading
Loading
Loading
+19 −19
Original line number Diff line number Diff line
@@ -27,9 +27,9 @@ $canMaj = $this->isAllowed(Privileges::getResourceId(Privileges::IMPORT_MAJ));

        ?>
        <div class="col-md-6">
            <div class="panel panel-default import-panel" id="<?= $table ?>">
                <div class="panel-heading"><strong><?= $tableLabel ?></strong></div>
                <table class="table table-condensed import-table" id="<?= $table ?>">
            <div class="card bg-default import-panel" id="<?= $table ?>">
                <div class="card-header"><strong><?= $tableLabel ?></strong></div>
                <table class="table table-sm import-table" id="<?= $table ?>">
                    <tr>
                        <td style="width:20%">Nouveau</td>
                        <td style="width:30%" class="action <?= Query::ACTION_INSERT ?>"></td>
@@ -45,21 +45,21 @@ $canMaj = $this->isAllowed(Privileges::getResourceId(Privileges::IMPORT_MAJ));
                        <td style="width:30%" class="action <?= Query::ACTION_UNDELETE ?>"></td>
                    </tr>
                </table>
                <div class="panel-body">
                <div class="card-body">

                </div>
                <div class="panel-footer">
                    <button type="button" class="btn btn-default btn-refresh" data-id="<?= $table ?>"><span
                                class="glyphicon glyphicon-refresh"></span> Recharger
                <div class="card-footer">
                    <button type="button" class="btn btn-default btn-refresh" data-id="<?= $table ?>">
                        <i class="fas fa-arrows-rotate"></i> Recharger
                    </button>
                    <?php if ($canMaj): ?>
                        <?php if (in_array($table, $mviews)): ?>
                            <button type="button" class="btn btn-info btn-vuemat" data-id="<?= $table ?>"><span
                                        class="glyphicon glyphicon-list"></span> MAJ vue matérialisée
                            <button type="button" class="btn btn-info btn-vuemat" data-id="<?= $table ?>">
                                <i class="fas fa-list"></i> MAJ vue matérialisée
                            </button>
                        <?php endif; ?>
                        <button type="button" class="btn btn-warning btn-actu" data-id="<?= $table ?>"><span
                                    class="glyphicon glyphicon-import"></span> Synchroniser
                        <button type="button" class="btn btn-warning btn-actu" data-id="<?= $table ?>">
                            <i class="fas fa-file-import"></i> Synchroniser
                        </button>
                    <?php endif; ?>
                </div>
@@ -72,7 +72,7 @@ $canMaj = $this->isAllowed(Privileges::getResourceId(Privileges::IMPORT_MAJ));
</div>
<style>

    .differentiel .import-panel .panel-body {
    .differentiel .import-panel .card-body {
        max-height: 12.5em;
        overflow: auto;
    }
@@ -122,9 +122,9 @@ $canMaj = $this->isAllowed(Privileges::getResourceId(Privileges::IMPORT_MAJ));
                    if (action == undefined || action == 'all' || action == 'vue-materialisee' || action == actions[i]) {
                        var chiffre = data.chiffres[actions[i]];
                        if (chiffre > 0) {
                            chiffre += ' <button class="btn btn-xs btn-primary btn-details" title="Voir le détail" data-action="' + actions[i] + '"><span class="glyphicon glyphicon-search"></span></button>';
                            chiffre += ' <button class="btn btn-xs btn-primary btn-details" title="Voir le détail" data-action="' + actions[i] + '"><i class="fas fa-magnifying-glass"></i></button>';
                            if (that.element.data('can-maj')) {
                                chiffre += ' <button class="btn btn-xs btn-warning btn-sync-action" title="Synchroniser" data-action="' + actions[i] + '"><span class="glyphicon glyphicon-import"></span></button>';
                                chiffre += ' <button class="btn btn-xs btn-warning btn-sync-action" title="Synchroniser" data-action="' + actions[i] + '"><i class="fas fa-file-import"></i></button>';
                            }
                        }
                        that.element.find(sel + actions[i]).html(chiffre);
@@ -162,7 +162,7 @@ $canMaj = $this->isAllowed(Privileges::getResourceId(Privileges::IMPORT_MAJ));
        {
            if (text == '') return;

            var div = this.element.find('.import-panel#' + table + ' .panel-body');
            var div = this.element.find('.import-panel#' + table + ' .card-body');

            div.show();
            div.append('<div class="alert alert-' + type + ' alert-dismissible" role="alert"><button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>' + text + '</div>');
@@ -172,11 +172,11 @@ $canMaj = $this->isAllowed(Privileges::getResourceId(Privileges::IMPORT_MAJ));
        {
            var div;
            if (table) {
                div = this.element.find('.import-panel#' + table + ' .panel-body');
                div = this.element.find('.import-panel#' + table + ' .card-body');
                div.html('');
                div.hide();
            } else {
                div = this.element.find('.import-panel .panel-body');
                div = this.element.find('.import-panel .card-body');
                div.html('');
                div.hide();
            }
@@ -191,7 +191,7 @@ $canMaj = $this->isAllowed(Privileges::getResourceId(Privileges::IMPORT_MAJ));
            var params = {
                action: action
            };
            var div = this.element.find('.import-panel#' + table + ' .panel-body');
            var div = this.element.find('.import-panel#' + table + ' .card-body');

            div.show();
            div.html('Chargement en cours... <div class="loading"></div>');
+69 −44
Original line number Diff line number Diff line
@@ -10,58 +10,84 @@ $pages = [
        'label'   => 'Sources de données',
        'visible' => $this->isAllowed(Privileges::getResourceId(Privileges::IMPORT_SOURCES_VISUALISATION)),
        'popover' => false,
        'icon'    => 'glyphicon glyphicon-briefcase',
        'icon'    => 'fas fa-briefcase',
    ],
    'tables'       => [
        'url'     => $this->url('import/tables'),
        'label'   => 'Tables',
        'visible' => $this->isAllowed(Privileges::getResourceId(Privileges::IMPORT_TABLES_VISUALISATION)),
        'popover' => false,
        'icon'    => 'glyphicon glyphicon-list-alt',
        'icon'    => 'fas fa-rectangle-list',
    ],
    'tableau-bord' => [
        'url'     => $this->url('import/tableau-bord'),
        'label'   => 'Branchement',
        'visible' => $this->isAllowed(Privileges::getResourceId(Privileges::IMPORT_TBL)),
        'popover' => false,
        'icon'    => 'glyphicon glyphicon-list',
        'icon'    => 'fas fa-list',
    ],
    'differentiel' => [
        'url'     => $this->url('import/differentiel'),
        'label'   => 'Différentiel',
        'visible' => $this->isAllowed(Privileges::getResourceId(Privileges::IMPORT_ECARTS)),
        'popover' => false,
        'icon'    => 'glyphicon glyphicon-import',
        'icon'    => 'fas fa-plus-minus',
    ],
];

?>
<nav class="navbar navbar-default">
    <div class="container-fluid">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse"
                    data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                <span class="sr-only">Menu Import</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="#">Import</a>
        </div>
<style>
    /* CSS présente dans OSE initialement... */
    .nav-local {
        background-color: #f8f8f8;
        border: 1px #e7e7e7 solid;
        border-radius: 0.3em;
        box-shadow: rgba(0, 0, 0, 0.35) 0px 4px 9px -4px;
        margin-bottom: 1em;
    }

    .nav-local .navbar-brand {
        float: left;
        padding-left: 10px;
    }

    .nav-local ul {
        list-style: none;
        padding-left: 0px;
    }

    .nav-local li.nav-item {
        float: left;
        width: auto;
    }

    .nav-local li.nav-item.active {
        background-color: #e0e0e0;
    }

    .nav-local li a {
        padding-top: 10px;
        padding-bottom: 10px;
        color: gray;
    }

        <!-- Collect the nav links, forms, and other content for toggling -->
        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
            <ul class="nav navbar-nav">
</style>
<div class="nav-local">
    <a class="navbar-brand" href="#">Import</a>
    <ul>
        <?php foreach ($pages as $page => $params) {
            if ($params['visible']) {
                        $lip = [];
                $lip = [
                        'class' => 'nav-item'
                ];
                $ap  = [
                    'href'           => $params['url'],
                    'data-placement' => 'bottom',
                    'class' => 'nav-link'
                ];

                if ($page == $active) {
                            $lip['class'] = 'active';
                    $lip['class'] .= ' active';
                }

                if ($params['popover']) {
@@ -73,6 +99,5 @@ $pages = [
            }
        } ?>
    </ul>
        </div><!-- /.navbar-collapse -->
    </div><!-- /.container-fluid -->
</nav>
 No newline at end of file
    <div style="clear:both"></div>
</div>
 No newline at end of file
+7 −7
Original line number Diff line number Diff line
@@ -3,9 +3,9 @@
<?= $this->partial('unicaen-import/import/menu', ['active' => 'tableau-bord']); ?>

<?php foreach ($data as $tname => $columns): ?>
    <div class="panel panel-default">
        <div class="panel-heading"><strong><?= $tname ?></strong></div>
        <table class="table table-striped table-bordered table-hover table-condensed">
    <div class="card bg-default">
        <div class="card-header"><strong><?= $tname ?></strong></div>
        <table class="table table-striped table-bordered table-hover table-sm">
            <tr>
                <th>Clé</th>
                <th>Colonne</th>
@@ -23,15 +23,15 @@
                    echo 'danger';
                } elseif (!$column->importActif) echo 'warning';
                ?>">
                    <th><?php if ($column->isCompleteKey()): ?><span class="glyphicon glyphicon-wrench"></span><?php endif; ?></th>
                    <th><?php if ($column->isCompleteKey()): ?><i class="fas fa-wrench"></i><?php endif; ?></th>
                    <th><?= $cname ?></th>
                    <td><?= $column->dataType ?></td>
                    <td style="text-align:center"><?= $column->length ?></td>
                    <td style="text-align:center"><?= $column->nullable ? '<span class="glyphicon glyphicon-ok"></span>' : '' ?></td>
                    <td style="text-align:center"><?= $column->hasDefault ? '<span class="glyphicon glyphicon-ok"></span>' : '' ?></td>
                    <td style="text-align:center"><?= $column->nullable ? '<i class="fas fa-check"></i>' : '' ?></td>
                    <td style="text-align:center"><?= $column->hasDefault ? '<i class="fas fa-check"></i>' : '' ?></td>
                    <td><?= $column->refTableName ?></td>
                    <td><?= $column->refColumnName ?></td>
                    <td style="text-align:center"><?= $column->importActif ? '<span class="glyphicon glyphicon-ok"></span>' : '' ?></td>
                    <td style="text-align:center"><?= $column->importActif ? '<i class="fas fa-check"></i>' : '' ?></td>
                </tr>
            <?php endforeach; ?>
        </table>
+5 −5
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@ $canEdit = $this->isAllowed(Privileges::getResourceId(Privileges::IMPORT_SOURCES

<?= $this->partial('unicaen-import/import/menu', ['active'=> 'sources'] ); ?>

<table class="table table-condensed table-bordered table-sort">
<table class="table table-sm table-bordered table-sort">
    <thead>
    <tr>
        <th>Libellé</th>
@@ -33,7 +33,7 @@ $canEdit = $this->isAllowed(Privileges::getResourceId(Privileges::IMPORT_SOURCES
        <td><?= $source->getLibelle() ?></td>
        <td><?= $source->getCode() ?></td>
        <td style="text-align:center"><?php if ($source->getImportable()): ?>
            <span class="glyphicon glyphicon-ok"></span>
            <i class="fas fa-check"></i>
        <?php endif; ?></td>
        <?php if ($canEdit): ?>
            <td style="text-align:center">
@@ -43,7 +43,7 @@ $canEdit = $this->isAllowed(Privileges::getResourceId(Privileges::IMPORT_SOURCES
                        data-event="import-source-modification"
                        title="Modification de la source de données"
                >
                <span class="glyphicon glyphicon-edit"></span>
                <i class="fas fa-pen-to-square"></i>
                </a>
                <a
                        class="pop-ajax"
@@ -55,7 +55,7 @@ $canEdit = $this->isAllowed(Privileges::getResourceId(Privileges::IMPORT_SOURCES
                        data-cancel-button="Non"
                        data-submit-reload="true"
                >
                    <span class="glyphicon glyphicon-trash"></span>
                    <i class="fas fa-trash"></i>
                </a>
            </td>
        <?php endif; ?>
@@ -70,7 +70,7 @@ $canEdit = $this->isAllowed(Privileges::getResourceId(Privileges::IMPORT_SOURCES
            data-event="import-source-modification"
            href="<?= $this->url('import/sources/edition') ?>"
    >
        <span class="glyphicon glyphicon-plus"></span>
        <i class="fas fa-plus"></i>
        Ajouter une source de données
    </a>
<?php endif; ?>
+12 −14
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@ echo $this->partial('unicaen-import/import/menu', ['active' => 'tables']);
    <?php if (empty($tables)): ?>
        Aucune table n'est renseignée
    <?php else: ?>
        <table class="table table-bordered table-condensed">
        <table class="table table-bordered table-sm">
            <thead>
            <tr>
                <th>Table</th>
@@ -43,8 +43,8 @@ echo $this->partial('unicaen-import/import/menu', ['active' => 'tables']);
                    <td style="text-align: center;"><?php
                        if (in_array($table->getName(), $views)) {

                            $class = $table->isSyncEnabled() ? 'glyphicon-ok text-success' : 'glyphicon-remove text-danger refuse';
                            $icon  = $this->tag('span', ['class' => 'glyphicon glyph-switch ' . $class, 'style' => 'font-size: 14pt']);
                            $class = $table->isSyncEnabled() ? 'fas fa-check text-success' : 'fas fa-xmark text-danger refuse';
                            $icon  = $this->tag('i', ['class' => 'fas fa-check ' . $class, 'style' => 'font-size: 14pt']);

                            if ($canEdit) {
                                echo $this->tag('a', [
@@ -65,14 +65,14 @@ echo $this->partial('unicaen-import/import/menu', ['active' => 'tables']);
                    <td title="<?= $table->getSyncHookAfter() ?>"><?= $table->getSyncHookAfter() ? substr($table->getSyncHookAfter(), 0, 15) . ' ...' : '' ?></td>
                    <?php if ($canEdit): ?>
                        <td>
                    <span class="glyphicon glyphicon-move"
                          title="Vous pouvez trier les tables en déplaçant les lignes du tableau"></span>&nbsp;
                    <i class="fas fa-up-down"
                          title="Vous pouvez trier les tables en déplaçant les lignes du tableau"></i>&nbsp;

                            <a class="ajax-modal"
                               data-event="table-modifier"
                               href="<?= $this->url('import/tables/modifier', ['table' => $table->getName()]) ?>"
                               title="Modifier le paramétrage de la table"
                            ><span class="glyphicon glyphicon-edit"></span></a>
                            ><i class="fas fa-pen-to-square"></i></a>
                        </td>
                    <?php endif; ?>
                </tr>
@@ -83,8 +83,6 @@ echo $this->partial('unicaen-import/import/menu', ['active' => 'tables']);

    <?php if ($hasNonReferenced): ?>
        <div class="alert alert-warning alert-dismissible" role="alert">
            <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span
                        aria-hidden="true">&times;</span></button>
            <p>Des tables synchronisables ne sont pas référencées dans la liste ci-dessus.</p>
            <?php if ($canEdit): ?>
                <button class="btn btn-warning add-non-referenced">Ajouter ces tables pour les rendre synchronisables</button>
@@ -98,7 +96,7 @@ echo $this->partial('unicaen-import/import/menu', ['active' => 'tables']);
            'class'              => 'btn btn-info pop-ajax',
            'data-submit-reload' => "true",
            'href'               => $this->url('import/maj-vues-fonctions'),
        ])->html('<span class="glyphicon glyphicon-wrench"></span> Mise à jour des vues et procédures d\'import');
        ])->html('<i class="fas fa-wrench"></i> Mise à jour des vues et procédures d\'import');
    }

    //    'maj-vues-fonctions' => [
@@ -138,15 +136,15 @@ echo $this->partial('unicaen-import/import/menu', ['active' => 'tables']);
                var glyphSwitch = that.element.find("tr.table-ligne[data-table='" + table + "'] .glyph-switch");

                glyphSwitch.addClass('loading');
                glyphSwitch.removeClass('glyphicon-ok text-success');
                glyphSwitch.removeClass('glyphicon-remove text-danger refuse');
                glyphSwitch.removeClass('fa-check text-success');
                glyphSwitch.removeClass('fa-trash text-danger refuse');
                $.post("<?= $this->url('import/tables/synchro-switch') ?>", {table: table}, function (data)
                {
                    glyphSwitch.removeClass('loading');
                    if (data.result) {
                        glyphSwitch.addClass('glyphicon-ok text-success');
                        glyphSwitch.addClass('fa-check text-success');
                    } else {
                        glyphSwitch.addClass('glyphicon-remove text-danger refuse');
                        glyphSwitch.addClass('fa-trash text-danger refuse');
                    }
                }).fail(function (jqXHR)
                {
@@ -172,7 +170,7 @@ echo $this->partial('unicaen-import/import/menu', ['active' => 'tables']);
                });

                that.element.find('table tbody').sortable({
                    handle: '.glyphicon-move',
                    handle: '.fa-up-down',
                    axis: 'y',
                    update: function (event, ui) {
                        var tables = [];