Commit 6e0e94b4 authored by Stephane Bouvry's avatar Stephane Bouvry
Browse files

Indicateur visuel sur les affectations dans la liste des activités

parent 0ed36203
Loading
Loading
Loading
Loading
+13 −17
Original line number Diff line number Diff line
@@ -30,8 +30,8 @@ class Links extends AbstractHtmlElement implements ServiceLocatorAwareInterface

    public static $TLP_PROJECT = '<a href="%s" class="project"><i class="icon-cubes"></i>%s</a>';
    public static $TLP_ACTIVITY = '<a href="%s" class="activity"><i class="icon-cube"></i>%s</a>';
    public static $TLP_PERSON = '<a href="%s" class="person"><i class="%s"></i>&nbsp;%s</a>';
    public static $TLP_PERSON_UNLINK = '<strong date-href="%s" class="person"><i class="%s"></i>&nbsp;%s</strong>';
    public static $TLP_PERSON = '<a href="%s" class="person %s"><i class="%s"></i>&nbsp;%s</a>';
    public static $TLP_PERSON_UNLINK = '<strong date-href="%s" class="person %s"><i class="%s"></i>&nbsp;%s</strong>';
    public static $TLP_ORGANIZATION = '<a href="%s" class="organization %s"><i class="%s"></i>&nbsp;%s</a>';
    public static $TLP_ORGANIZATION_UNLINK = '<strong date-href="%s" class="organization link %s"><i class="%s"></i>&nbsp;%s</strong>';

@@ -48,7 +48,7 @@ class Links extends AbstractHtmlElement implements ServiceLocatorAwareInterface
    private $_memberCache = [];

    /**
     * Affiche la listes des partenaires.
     * Affiche la liste des partenaires.
     *
     * @param $mixed
     * @return string
@@ -322,13 +322,6 @@ class Links extends AbstractHtmlElement implements ServiceLocatorAwareInterface
            $css .= ' enrolled-off';
        }

//        if( !$person->isActive() || !$person->getPerson()->isActive() ){
//            $css .= ' obsolete ';
//            if( $person->isPast() ){
//                $css .= ' past ';
//            }
//        }

        $tpl = self::$TLP_MEMBER_UNLINK;
        $urlShow = '';
        $datas = '';
@@ -375,17 +368,18 @@ class Links extends AbstractHtmlElement implements ServiceLocatorAwareInterface
            return '<i class="no-data">No data</i>';
        }

        $class = 'icon-user';
        $icon = 'icon-user';

        if ($person instanceof ActivityPerson ){
            $class = ' icon-cube';
            $icon = ' icon-cube';
        }
        if ($person instanceof ProjectMember ){
            $class = ' icon-cubes';
            $icon = ' icon-cubes';
        }

        $class = "";
        if( !$person->isActive() ){
            $class .= ' role-off';
            $class .= ' enrolled-off role-off';
        }

        if( !$person->getPerson()->isActive() ){
@@ -401,14 +395,16 @@ class Links extends AbstractHtmlElement implements ServiceLocatorAwareInterface
        if (!$person instanceof Person) {
            $out = '<strong class="data-error">Invalid data</strong>';
        } else {
            $data = '';
            $tpl = self::$TLP_PERSON_UNLINK;
            if ($this->OscarUserContext()->hasPrivileges(Privileges::PERSON_SHOW) ){
                $tpl = self::$TLP_PERSON;
                $data = ' data-show="'. $this->getView()->url('person/show', ['id'=>$person->getId()]) .'"';
            }

            $out = sprintf($tpl, $this->getView()->url('person/show', ['id' => $person->getId()]), $class, $this->personName($person));
            $out = sprintf($tpl,
                $this->getView()->url('person/show', ['id' => $person->getId()]),
                $class,
                $icon,
                $this->personName($person));
        }

        return $out;