Commit e050d5fe authored by Stephane Bouvry's avatar Stephane Bouvry
Browse files

Export

parent 9ba8f8f1
Loading
Loading
Loading
Loading
+12 −4
Original line number Diff line number Diff line
@@ -2756,8 +2756,6 @@ class ProjectGrantController extends AbstractOscarController implements UseNotif

    public function searchMineAction(): array|ViewModel
    {
        $projectMode = $this->params()->fromQuery('project') == '1' ?? '0';

        return $this->advancedSearch2Action('mine', [
            'titleActivity' => $this->oscarText('Mes activités'),
            'titleProject' => $this->oscarText('Mes projets'),
@@ -2805,8 +2803,6 @@ class ProjectGrantController extends AbstractOscarController implements UseNotif

    public function searchGlobalAction(): array|ViewModel
    {
        $projectMode = $this->params()->fromQuery('project') == '1' ?? '0';

        return $this->advancedSearch2Action('global', [
            'titleActivity' => $this->oscarText('Activités'),
            'titleProject' => $this->oscarText('Projets'),
@@ -2906,7 +2902,19 @@ class ProjectGrantController extends AbstractOscarController implements UseNotif
                'exportable' => $viewOptions['exportable'] === true,
            ];

            $exportUrl = "";
            if( $params['exportable'] ){
                if($projectMode == '1'){
                    $exportUrl = $this->url()->fromRoute('project/export-many');
                } else {
                    $exportUrl = $this->url()->fromRoute('contract/csv');
                }
            }

            $datas = $this->getProjectGrantService()->search2($params);
            $datas['export_url'] = $exportUrl;


            $response = new JsonModel($datas);
            return $response;
        }
+40 −112
Original line number Diff line number Diff line
@@ -7,82 +7,6 @@

/** @var \Oscar\Entity\Person $entity */
?>
<style>
    .card.disabled {
        border-left-color: #ccc;
        opacity: .5;
    }
    .columns {
        columns: 1
    }

    .columns .card {
        page-break-inside: avoid;
        break-inside: avoid-column;
        display: table;
    }
    .columns .card > * {
        page-break-inside: avoid;
        break-inside: avoid-column;
    }

    .affectations .card.apply {
        border: solid thin green;
        border-left-width: 4px;
        opacity: 1;
    }
    .affectations .card.applyable {
        cursor: pointer;
    }
    .affectations .card.applyable:hover {
        transform: scale(1.01);
    }

    .steps-bar {
        display: flex;
        text-shadow: -1px 1px 1px rgba(0,0,0,.3);
        background: #ccc;
        border-radius: .5em;
    }

    .step-content {
        border: thin solid #aaa;
        border-top: none;
        padding: 1em;
    }

    .step {
        flex: 1;
        padding: 1em;
        text-align: center;
        border: thin solid #aaa;
    }

    .step:first-child {
        border-radius: .5em 0 0 0;
    }
    .step:last-child {
        border-radius: 0 .5em 0 0;
    }

    .step.current {
        color: #333;
        font-weight: bold;
        background: white;
        border-bottom-color: white;
    }
    .step.futur {
        color: #777;
        text-shadow: 1px -1px 1px rgba(255,255,255,.3);
        font-weight: 100;
    }
    .step.done {
        background: green;
        color: #dddddd;
    }

    .fiche.menu > div, .fiche.menu > div .replace-strengthen-person { display: inline }
</style>
<section class="container">
    <div class="row">

@@ -96,15 +20,25 @@
            </h1>
        </header>

        <nav class="fiche menu align-left">

            <small class="intitule">
                <i class="icon-cog"></i>
                Actions :
            </small>
        <nav>
            <?php if( $this->grant(\Oscar\Provider\Privileges::ACTIVITY_INDEX)): ?>
            <a href="<?= $this->url('contract/search-global') ?>?&project=1&f[]=ap%3B3879%3B%3B"
               class="btn btn-light">
                Voir les projets
            </a>
            <a href="<?= $this->url('contract/search-global') ?>?&project=0&f[]=ap%3B3879%3B%3B"
               class="btn btn-light">
                Voir les activités
            </a>
            <?php endif; ?>

            <?php if( $this->grant(\Oscar\Provider\Privileges::PERSON_EDIT)): ?>
                <div id="replacer"></div>
                <a class="btn btn-primary" href="<?= $this->url('person/edit', ['id'=>$entity->getId()]) ?>">
                    <i class="icon-pencil"></i>
                    Éditer les informations
                </a>

                <span id="replacer"></span>
                <script>
                    require(['vue', 'vue-resource', 'replacestrengthenperson'], function(Vue, VueResource, ReplaceStengthenPerson){
                        Vue.use(VueResource);
@@ -123,40 +57,34 @@

                    });
                </script>


                <form class="form-inline" action="<?= $this->url('person/delete', ['id' => $entity->getId()]) ?>" method="post">
                    <button type="submit" class="btn btn-danger">
                        <i class="icon-trash"></i>
                        Supprimer
                    </button>
                </form>

            <?php endif ?>

            <?php if($this->grant()->privilege(\Oscar\Provider\Privileges::DROIT_PRIVILEGE_VISUALISATION)): ?>
                <a href="<?= $this->url('person/access', ['id' => $entity->getId()]) ?>" class="btn btn-default btn-lg">
                <a href="<?= $this->url('person/access', ['id' => $entity->getId()]) ?>" class="btn btn-light">
                    <i class="icon-lock"></i>
                    Voir les privilèges
                </a>
            <?php endif; ?>

            <?php if($this->grant()->privilege(\Oscar\Provider\Privileges::PERSON_EDIT)): ?>
                <form class="form-inline" action="<?= $this->url('person/delete', ['id' => $entity->getId()]) ?>" method="post">
                    <button type="submit" class="btn btn-danger btn-lg">
                        <i class="icon-lock"></i>
                        Supprimer
                    </button>
                </form>
            <?php endif; ?>

            <?php if( $allowTimesheet ): ?>
                <a href="<?= $this->url('timesheet/declarant') ?>?person=<?= $entity->getId() ?>" class="btn btn-default btn-lg">
                <a href="<?= $this->url('timesheet/declarant') ?>?person=<?= $entity->getId() ?>" class="btn btn-light">
                    <i class="icon-calendar"></i>
                    Compléter la feuille de temps
                </a>
            <?php endif; ?>

            <?php if( $this->grant()->privilege(\Oscar\Provider\Privileges::PERSON_EDIT) ): ?>
                <a class="btn btn-default" href="<?= $this->url('person/edit', ['id'=>$entity->getId()]) ?>">
                    <i class="icon-pencil"></i>
                    Éditer les informations
                </a>
            <?php endif; ?>

            <?php if( $this->grant()->privilege(\Oscar\Provider\Privileges::MAINTENANCE_NOTIFICATION_PERSON) ): ?>
                <a class="btn btn-default" href="<?= $this->url('person/notification', ['id'=>$entity->getId()]) ?>">
                <a class="btn btn-light" href="<?= $this->url('person/notification', ['id'=>$entity->getId()]) ?>">
                    <i class="icon-bell"></i>
                    Voir les notifications
                </a>
@@ -173,18 +101,18 @@
        </p>


        <div class="cols two">
            <section class="col">
        <div class="row">
            <section class="col-md-6">
                <h2>
                    <span><i class="icon-help-circled"></i> Informations générales</span>
                </h2>
                <div class="cols">
                    <div class="col col-1">
                <div class="row">
                    <div class="col-md-2">
                        <img src="//www.gravatar.com/avatar/<?= md5($entity->getEmail()) ?>?s=250"
                             style="border-radius: 20px; width: 100%"
                             alt="" />
                    </div>
                    <div class="col col-2">
                    <div class="col-md-10">
                        <div class="data-list">
                            <div class="data-row">
                                <div class="data-label">Validité du compte</div>
@@ -263,7 +191,7 @@
                                    <div class="data-value">
                                        <?php if( count($entity->getWorkPackages()) ): ?>
                                            <a href="<?= $this->url('timesheet/resume') ?>?person_id=<?= $entity->getId() ?>"
                                                class="btn <?=  $hasTimesheets ? 'btn-primary' : 'btn-default disabled' ?>">
                                                class="btn <?=  $hasTimesheets ? 'btn-primary' : 'btn-light disabled' ?>">
                                                <i class="icon-calendar"></i>
                                                Voir les feuilles de temps de <strong><?= $entity ?></strong>
                                                <?php if(!$hasTimesheets): ?>
@@ -281,7 +209,7 @@
                </div>
            </section>

            <section class="col">
            <section class="col-md-6">
                <h2><i class="icon-sitemap"></i> Hiérarchie</h2>
                <p>Les informations hiérarchiques sont utilisées par Oscar pour déterminer les personnes en charge lors de la procédure de <strong>validation des feuilles de temps</strong>.</p>
                <?php /* <hr>
@@ -472,7 +400,7 @@
                                <input type="hidden" value="addusurpation" name="action">
                                <select name="person_id" class="selectPerson"></select>
                                <button type="submit" class="btn btn-xs btn-primary">Enregistrer</button>
                                <button type="button" class="btn btn-xs btn-default" onclick="$('#usurpationEditor').hide(); $('#editUsurpation').show();">Annuler</button>
                                <button type="button" class="btn btn-xs btn-light" onclick="$('#usurpationEditor').hide(); $('#editUsurpation').show();">Annuler</button>
                            </form>

                            <script>
@@ -610,9 +538,9 @@
                </div>
            </section>
        </div>
        <div class="cols two">
        <div class="row">

            <section class="col">
            <section class="col-md-6">

                <?php if($this->grant()->privilege(\Oscar\Provider\Privileges::PERSON_MANAGE_SCHEDULE)): ?>
                <h2><i class="icon-clock"></i> Horaires</h2>
@@ -660,7 +588,7 @@
                <?php endif; ?>
            </section>

            <section class="col">
            <section class="col-md-6">
                <?php if($this->grant()->privilege(\Oscar\Provider\Privileges::PERSON_SYNC_LDAP)): ?>
                <h2><i class="icon-cog"></i> Donnèes techniques</h2>
                <p class="text-highlight text-small">
+38 −28
Original line number Diff line number Diff line
@@ -7,11 +7,12 @@
/** @var Person $person */
$person = $enroll->getPerson();
?>
<article class="card card-list-item person-card" style="<?= $enroll->isOutOfDate() ? 'opacity: .5' : '' ?>">
    <h5 class="car-title">
<article class="card">
    <h3 class="card-title">
        <?php if($person->getEmail()): ?>
            <img class="portrait"
                 src="//www.gravatar.com/avatar/<?= md5($person->getEmail()) ?>?s=75"
                 style="width: 42px; "
                 src="//www.gravatar.com/avatar/<?= md5($person->getEmail()) ?>?s=42"
                 alt="">
        <?php endif; ?>
        <span class="fullname">
@@ -22,7 +23,20 @@ $person = $enroll->getPerson();
            <span class="firstname"><?= $person->getFirstname() ?></span>
            <span class="lastname"><?= $person->getLastname() ?></span>
            <!-- <span class="affectation">(<?= $person->getLdapAffectation() ?>)</span> -->
        </span>
        <nav class="onright">

            <?php if( $enroll->getOrigin() ): ?>

                <span class="cartouche primary" style="cursor: help" title="Ce rôle est issue de la synchronisation">
                    <i class="icon-plug"></i>
                    <?= $enroll->getOrigin() ?></span>

            <?php endif; ?>

        </nav>
    </h3>
    <h4 class="card-subtitle">
        <?php if( $enroll->getDateEnd() ): ?>
            <div class="role">
                <?= $enroll->getRole() ?>
@@ -32,27 +46,23 @@ $person = $enroll->getPerson();
            <div class="role"><?= $enroll->getRole() ?></div>
        <?php endif; ?>


    </h4>
    <div class="card-content">
        <?php if( $enroll->getDateStart() ): ?>
            <small>Depuis le <?= $this->moment($enroll->getDateStart()) ?></small>
        <?php endif; ?>
        </span>
    </h5>    
    <span class="email"><?= $person->getEmail() ?></span>
    <nav>
        <a href="<?= $this->url('person/show', ['id' => $person->getId()]) ?>" class="link-show"><i class="icon-zoom-in-outline"></i> Fiche</a>

        <?php if( $enroll->getOrigin() ): ?>
            <span class="cartouche primary" style="cursor: help" title="Ce rôle est issue de la synchronisation">
                <i class="icon-plug"></i>
                <?= $enroll->getOrigin() ?></span>
        <?php else: ?>
        <?php if( !$enroll->getOrigin() ): ?>
            <?php if( isset($urlDelete) ): ?>
            <a href="<?= $urlDelete ?>" class="link-show"><i class="icon-trash"></i> Supprimer ce rôle</a>
                <a href="<?= $urlDelete ?>" class="btn btn-xs btn-danger"><i class="icon-trash"></i> Supprimer ce rôle</a>
            <?php endif; ?>
            <?php if( isset($urlClose) ):?>
                <button data-enrollid="<?= $enroll->getId() ?>">Résilier</button>
                <button data-enrollid="<?= $enroll->getId() ?>" class="btn btn-xs btn-light">Résilier</button>
            <?php endif; ?>
        <?php endif; ?>

    </nav>
        <a href="<?= $this->url('person/show', ['id' => $person->getId()]) ?>" class="btn btn-xs btn-primary"><i class="icon-zoom-in-outline"></i> Fiche</a>

    </div>

</article>
+32 −0
Original line number Diff line number Diff line
@@ -806,6 +806,38 @@ a.cartouche {
  }
}

.data-list {
  color: $colorGreyDark;
  .data-row {
    display: flex;
    border-bottom: thin $colorGreyUltraLight solid;
    .data-label { font-weight: 100; flex: 0 0 30%; white-space: nowrap }
    .data-value {
      font-weight: bold;
      color: $brand-primary;
      flex: 1 1 auto;
      ul {
        margin: 0;
        padding: 0;
      }

      .ldap-groups {
        font-size: .75em;
        list-style: none;
        .no-role {
          display: none;
        }
        &.show-off .no-role {
          display: block;
        }
      }
      .no-role {
        font-weight: 100;
        color: $colorGreyMedium;
      }
    }
  }
}


//////////////////////////////////////////////////////////////////////////////
+10 −12
Original line number Diff line number Diff line
@@ -200,17 +200,17 @@
      {{ ids_export_warning }}
    </span>
    <div v-if="ids_export_values">
      <form action="/activites-de-recherche/csv" method="POST">
      <form :action="export_url" method="POST">
        <input type="hidden" name="ids" :value="ids_export_values.join(',')" />
        <input type="hidden" :value="selectedFields" name="fields">
        <div class="overlay" v-show="configureExport">
          <div class="overlay-content">
            <h3>Configuration des exportations</h3>

            <select name="" id="" class="form-control">
              <option value="xls">XLS (Excel)</option>
              <option value="csv">CSV (Comma Separated Value)</option>
            </select>
        <div class="overlay" v-if="configureExport">
          <div class="overlay-content">
            <h3>Configuration des exportations</h3>
            
            <section>
              <h3 @click="selectSection(fieldsUI.core)"><i class="icon-cube"></i>Champs de base</h3>
@@ -267,7 +267,7 @@
                  <small v-else>Déselectionner tous les champs</small>
                </a>
                <button class="btn btn-default" type="button" @click="configureExport = false">Fermer</button>
                <button class="btn btn-primary" type="submit" @click="configureExport = false">Exporter</button>
                <button class="btn btn-primary" type="submit">Exporter</button>
              </nav>
            </section>
          </div>
@@ -276,9 +276,6 @@
          <i class="icon-cog"></i>
          CONFIGURER
        </button>
        <button class="btn btn-primary" type="submit">
          EXPORTER les RESULTATS
        </button>
      </form>
    </div>
  </section>
@@ -312,7 +309,6 @@
      />
    </section>
  </div>
  <pre>{{ query }}</pre>
</template>
<script>

@@ -405,6 +401,7 @@ export default {
      ids_export_enabled: false,
      ids_export_values: null,
      ids_export_warning: "",
      export_url: "",

      // Résultats
      results: [],
@@ -583,6 +580,7 @@ export default {
        this.ids_export_enabled = ok.data.ids_export_enabled;
        this.ids_export_values = ok.data.ids_export_values;
        this.ids_export_warning = ok.data.ids_export_warning;
        this.export_url = ok.data.export_url;
        this.filters = ok.data.filters;
        this.error = ok.data.error;
        if( this.modeProject ){