Commit 5d51d5ba authored by Stephane Bouvry's avatar Stephane Bouvry
Browse files

- MeP (Dropdown accueil/fiche/liste)

- MeP Liste des organisations (les rôles des personnes sont regroupés)
- Mise au propres des classes CSS en cours
parent 953c7ae5
Loading
Loading
Loading
Loading
+25 −0
Original line number Diff line number Diff line
@@ -660,6 +660,31 @@ class Organization implements ResourceInterface, IConnectedObject
        return $this->persons;
    }

    public function getPersonsPackedRolesLabel():array {
        $out = [];
        /** @var OrganizationPerson $member */
        foreach ($this->getPersons() as $member) {
            $personId = $member->getPerson()->getId();
            if( !array_key_exists($personId, $out) ){
                $out[$personId] = [
                    'person' => $member->getPerson()->getDisplayName(),
                    'roles' => [],
                    'principal' => false
                ];
            }
            if( $member->isPrincipal() ){
                $out[$personId]['principal'] = true;
            }
            $out[$personId]['roles'][] = [
                'label' => $member->getRole(),
                'outOfDate' => $member->isOutOfDate(),
                'principal' => $member->isPrincipal(),
            ];

        }
        return $out;
    }

    /**
     * @param ArrayCollection $persons
     */
+61 −45
Original line number Diff line number Diff line
@@ -80,8 +80,7 @@ echo getenv('APPLICATION_ENV') ?: 'development' ?>">
<![endif]-->



<nav class="navbar navbar-expand-md fixed-top bg-primary py-0">
<nav class="oscar-main-menu navbar navbar-expand-md fixed-top bg-primary py-0">
    <div class="container-fluid">
        <a class="navbar-brand" href="#">
            <?php echo $this->appLink('<img src="/images/oscar-white.png" alt="" style="height: 24px; margin-right: 4px; position: relative; top: -3px; opacity: .5" />') ?>
@@ -89,14 +88,16 @@ echo getenv('APPLICATION_ENV') ?: 'development' ?>">
                <span class="beta-stick"><?= getenv('APPLICATION_ENV') ?></span>
            <?php endif; ?>
        </a>
        <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
        <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent"
                aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
            <span class="navbar-toggler-icon"></span>
        </button>
        <div class="collapse navbar-collapse" id="navbarSupportedContent">
            <ul class="navbar-nav me-auto mb-2 mb-lg-0">
                <?php if ($this->grant()->connected()): ?>
                    <li class="nav-item dropdown">
                        <a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">
                        <a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown"
                           aria-expanded="false">
                            <?= $this->oscarText("Accueil") ?>
                        </a>
                        <ul class="dropdown-menu">
@@ -135,7 +136,9 @@ echo getenv('APPLICATION_ENV') ?: 'development' ?>">
                                ) || $this->grant()->hasPrivilegeInOrganizations(
                                    Privileges::PROJECT_CREATE
                                )) : ?>
                                <li><hr class="dropdown-divider"></li>
                                <li>
                                    <hr class="dropdown-divider">
                                </li>
                                <?php
                                if ($this->grant()->hasPrivilegeInOrganizations(Privileges::ACTIVITY_CREATE)) : ?>
                                    <li>
@@ -158,7 +161,9 @@ echo getenv('APPLICATION_ENV') ?: 'development' ?>">


                            <?php if ($this->grant()->hasSignaturePersonalAccess()): ?>
                                <li><hr class="dropdown-divider"></li>
                                <li>
                                    <hr class="dropdown-divider">
                                </li>
                                <li>
                                    <a class="dropdown-item" href="<?= $this->url('contractdocument/my-documents') ?>">
                                        <i class="icon-edit"></i>
@@ -167,7 +172,8 @@ echo getenv('APPLICATION_ENV') ?: 'development' ?>">
                                </li>

                                <li>
                                    <a class="dropdown-item" href="<?= $this->url('contractdocument/documents-observed') ?>">
                                    <a class="dropdown-item"
                                       href="<?= $this->url('contractdocument/documents-observed') ?>">
                                        <i class="icon-eye"></i>
                                        <?= $this->oscarText('Suivi des circuits de signature') ?>
                                    </a>
@@ -175,7 +181,9 @@ echo getenv('APPLICATION_ENV') ?: 'development' ?>">
                            <?php
                            endif; ?>

                            <li><hr class="dropdown-divider"></li>
                            <li>
                                <hr class="dropdown-divider">
                            </li>
                            <li>
                                <a class="dropdown-item" href="<?= $this->url('administrativedocument') ?>">
                                    <i class="icon-book"></i>
@@ -202,7 +210,8 @@ echo getenv('APPLICATION_ENV') ?: 'development' ?>">
                ):
                    ?>
                    <li class="nav-item dropdown">
                    <a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">
                        <a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown"
                           aria-expanded="false">
                            <?= $this->oscarText("Activités") ?>
                        </a>
                        <ul class="dropdown-menu">
@@ -213,7 +222,8 @@ echo getenv('APPLICATION_ENV') ?: 'development' ?>">
                                    <?= $this->oscarText("Projets") ?>
                                </li>
                                <li>
                                <a class="dropdown-item" href="<?= $this->url('contract/advancedsearch') ?>?projectview=on">
                                    <a class="dropdown-item"
                                       href="<?= $this->url('contract/advancedsearch') ?>?projectview=on">
                                        <?= $this->oscarText("Liste des projets") ?>
                                    </a>
                                </li>
@@ -251,34 +261,35 @@ echo getenv('APPLICATION_ENV') ?: 'development' ?>">
                <?php endif; ?>

                <?php /****

                <li class="dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
                        <i class="icon-wristwatch"></i>
                        <?= $this->oscarText('Accueil') ?>
                        <span class="caret"></span>
                    </a>
                    <ul class="dropdown-menu" role="menu">


                        <?php if ($this->grant()->privilege(Privileges::ACTIVITY_REQUEST) || $this->grant()->hasPrivilegeInOrganizations(Privileges::ACTIVITY_REQUEST)): ?>
                            <li>
                                <a href="<?= $this->url('requestactivity') ?>">
                                    <i class="icon-cube"></i>
                                    <?= $this->oscarText("Demande d'activité") ?>
                                </a>
                            </li>
                        <?php
                        endif; ?>


                    </ul>
                </li>
                <?php endif; **/ ?>
                 *
                 * <li class="dropdown">
                 * <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
                 * <i class="icon-wristwatch"></i>
                 * <?= $this->oscarText('Accueil') ?>
                 * <span class="caret"></span>
                 * </a>
                 * <ul class="dropdown-menu" role="menu">
                 *
                 *
                 * <?php if ($this->grant()->privilege(Privileges::ACTIVITY_REQUEST) || $this->grant()->hasPrivilegeInOrganizations(Privileges::ACTIVITY_REQUEST)): ?>
                 * <li>
                 * <a href="<?= $this->url('requestactivity') ?>">
                 * <i class="icon-cube"></i>
                 * <?= $this->oscarText("Demande d'activité") ?>
                 * </a>
                 * </li>
                 * <?php
                 * endif; ?>
                 *
                 *
                 * </ul>
                 * </li>
                 * <?php endif; **/ ?>

                <?php if ($this->grant()->connected()): ?>
                    <li class="nav-item dropdown">
                    <a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">
                        <a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown"
                           aria-expanded="false">
                            <?= $this->oscarText("Mes projets/activités") ?>
                        </a>
                        <ul class="dropdown-menu">
@@ -290,7 +301,9 @@ echo getenv('APPLICATION_ENV') ?: 'development' ?>">
                            </li>
                            <li><a class="dropdown-item" href="#">Action</a></li>
                            <li><a class="dropdown-item" href="#">Another action</a></li>
                        <li><hr class="dropdown-divider"></li>
                            <li>
                                <hr class="dropdown-divider">
                            </li>
                            <li><a class="dropdown-item" href="#">Something else here</a></li>
                        </ul>
                    </li>
@@ -313,7 +326,8 @@ echo getenv('APPLICATION_ENV') ?: 'development' ?>">
                    ?>

                    <li class="nav-item dropdown">
                        <a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">
                        <a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown"
                           aria-expanded="false">
                            <?= $this->oscarText("Administration") ?>
                        </a>
                        <ul class="dropdown-menu" role="menu">
@@ -388,7 +402,8 @@ echo getenv('APPLICATION_ENV') ?: 'development' ?>">

                            <?php if ($this->grant()->privilege(\Oscar\Provider\Privileges::ACTIVITY_INDEX)): ?>
                                <li>
                                    <a class="dropdown-item" href="<?= $this->url('contract/advancedsearch') ?>?criteria[]=pp%3Bnull%3Bnull">
                                    <a class="dropdown-item"
                                       href="<?= $this->url('contract/advancedsearch') ?>?criteria[]=pp%3Bnull%3Bnull">
                                        <?= $this->oscarText("Activités sans projet") ?>
                                    </a>
                                </li>
@@ -471,11 +486,11 @@ echo getenv('APPLICATION_ENV') ?: 'development' ?>">
    endif; ?>
</div>

<footer class="bg-primary text-white p-3 fixed-bottom">
    <div class="row">
<footer class="bg-primary">
    <div class="container">
        <div class="row row-bordered-light">
            <div class="col-md-4">
                <a href="https://www.unicaen.fr">
                <img src="/images/logo-ucbn.png" alt="" class="footer-logo" height="20" style="display: inline"/>
                    Université de Caen Normandie &copy; 2015-<?= date('Y') ?>
                </a>
            </div>
@@ -488,11 +503,11 @@ echo getenv('APPLICATION_ENV') ?: 'development' ?>">
                <strong><?= $this->appInfos()->nom ?></strong><sup>&copy;</sup> -
                <em><?= $this->appInfos()->desc ?></em><br>
                Version : <a href="<?= $this->url('gitlog') ?>">
                <strong><?= \Oscar\OscarVersion::getBuild() ?></strong>
            </a> / Thème : <strong><?= $this->options()->theme() ?></strong>
                    <?= \Oscar\OscarVersion::getBuild() ?>
                </a>
            </div>
            <div class="col-md-4">
            <button class="btn btn-xs btn-default" id="btn-toggle-private">
                <a class="btn btn-sm btn-default" id="btn-toggle-private">
                <span class="off">
                    <i class="icon-valid"></i>
                    Mode privé <small> (activé)</small>
@@ -501,7 +516,8 @@ echo getenv('APPLICATION_ENV') ?: 'development' ?>">
                    <i class="icon-block"></i>
                    Mode privé <small> (désactivé)</small>
                </span>
            </button>
                </a>
            </div>
        </div>
    </div>
</footer>
+28 −22
Original line number Diff line number Diff line
@@ -103,7 +103,7 @@ $markText = function( $text, $search ){
        $nbrActivities = count($entity->getActivities()) ?>


        <article class="card xs organization <?= $entity->isClose() ? "closed" : "" ?> type-<?= $entity->getTypeSlug() ?> <?= $entity->getCode() ? 'interne' : '' ?>">
        <article class="card card-list-item xs organization <?= $entity->isClose() ? "closed" : "" ?> type-<?= $entity->getTypeSlug() ?> <?= $entity->getCode() ? 'interne' : '' ?>">
          <h2 class="card-title  layout-row">
              <span>
              <?php if($this->grant()->privilege(\Oscar\Provider\Privileges::MAINTENANCE_MENU_ADMIN)): ?>
@@ -146,56 +146,56 @@ $markText = function( $text, $search ){
                </span>
                  <?php endif; ?>

            <span class="label <?= ($nbrProjects + $nbrActivities) ? ' label-primary' : 'label-default' ?>">
            <span class="usage <?= ($nbrProjects + $nbrActivities) ? ' primary' : 'light' ?>">
                <?= $nbrProjects + $nbrActivities ?>
            </span>

                  <div class="dropdown" style="position: absolute; right: 8px; top: 4px">
                      <a class="dropdown-toggle"
                              data-toggle="dropdown"
                              aria-haspopup="true" aria-expanded="true">
                  <span class="dropdown">
                      <button class="dropdown-toggle btn btn-light"
                              data-bs-toggle="dropdown">
                          <span class="icon-cog"></span>
                      </a>
                      <ul class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdownMenu1">
                      </button>
                      <ul class="dropdown-menu">
                          <li>
                              <a href="<?= $this->url('organization/show', ['id' => $entity->getId()]); ?>">
                              <a class="dropdown-item" href="<?= $this->url('organization/show', ['id' => $entity->getId()]); ?>">
                                  <i class="icon-search-outline"></i>
                                  fiche
                              </a>
                          </li>
                          <li>
                              <a href="<?= $this->url('organization/show', ['id' => $entity->getId()]); ?>#persons">
                              <a class="dropdown-item" href="<?= $this->url('organization/show', ['id' => $entity->getId()]); ?>#persons">
                                  <i class="icon-group"></i>
                                  Gérer les membres
                              </a>
                          </li>
                          <li>
                              <a href="<?= $this->url('organization/edit', ['id' => $entity->getId()]); ?>">
                              <a class="dropdown-item" href="<?= $this->url('organization/edit', ['id' => $entity->getId()]); ?>">
                                  <i class="icon-pencil"></i> Modifier les informations
                              </a>
                          </li>
                          <li class="separator">
                          </li>
                          <li>
                              <a href="<?= $this->url('organization/delete', ['id' => $entity->getId()]); ?>">
                              <a class="dropdown-item" href="<?= $this->url('organization/delete', ['id' => $entity->getId()]); ?>">
                                  <i class="icon-trash"></i> Supprimer définitivement
                              </a>
                          </li>
                          <?php if( !$entity->isClose() ): ?>
                              <li>
                                  <a href="<?= $this->url('organization/close', ['id' => $entity->getId()]); ?>">
                                  <a class="dropdown-item" href="<?= $this->url('organization/close', ['id' => $entity->getId()]); ?>">
                                      <i class="icon-cancel-outline"></i> Cloturer
                                  </a>
                              </li>
                          <?php endif; ?>
                      </ul>
                  </div>
                  </span>

            </span>
          </h2>
            <div class="">
            <div class="row">
                <?php if(count($entity->getChildren())): ?>
                    <div>
                <section class="col-md-6">
                    <h5><i class="icon-building"></i>Sous structure</h5>
                    <?php
                    /** @var \Oscar\Entity\Organization $o */
                    foreach( $entity->getChildren() as $o ): ?>
@@ -211,19 +211,25 @@ $markText = function( $text, $search ){
                            </span>
                        </span>
                    <?php endforeach; ?>
                    </div>
                </section>
                <?php endif; ?>
                <?php if(count($entity->getPersons())): ?>
                    <div>
                    <?php foreach( $entity->getPersons() as $person ): ?>
                        <span class="cartouche light <?= $person->isOutOfDate() ? ' off' : '' ?>" title="<?=  $person->getRole() ?>">
                    <section class="col-md-6">
                        <h5><i class="icon-group"></i> Membres</h5>
                        <?php foreach( $entity->getPersonsPackedRolesLabel() as $pack ): ?>
                            <span class="cartouche <?= $pack['principal'] ? 'primary' : 'default' ?>">
                                <i class="icon-user"></i>
                                <?= $pack['person'] ?>
                                <span class="addon">
                                <?= $person->getPerson()->getDisplayName() ?>
                                    <?php foreach( $pack['roles'] as $role ): ?>
                                    <em class="<?= $role['principal'] ? 'principal' : 'secondary' ?> <?= $role['outOfDate'] ? 'outofdate' : '' ?>">
                                        <?= $role['label'] ?>
                                    </em>
                                    <?php endforeach; ?>
                                </span>
                            </span>
                        <?php endforeach; ?>
                    </div>
                    </section>
                <?php endif; ?>
            </div>
            <?php if ($entity->getDateEnd()): ?>
+1 −1
Original line number Diff line number Diff line
@@ -173,7 +173,7 @@ export default {
  font-size: 1em;
  position: fixed;
  z-index: 10000;
  bottom: 0;
  bottom: -1em;
  right: 0;
  padding: .3em 1em;
  border-radius: 8px 0 0 0;
+495 −0

File added.

Preview size limit exceeded, changes collapsed.

Loading