public function lienIndividu($individu, $label = null, $action = 'fiche', $controller = 'individus') { if (!$individu) { return null; } $acl = Zend_Registry::get('acl'); if ($acl->isAllowed(null, $individu, $action)) { $lien = $this->view->lien(array('action' => $action, 'individu' => $individu->slug, 'controller' => $controller), $label ? $label : wtk_nbsp($individu->getFullName()), true); $etape = $individu->findParentEtapes(); if ($etape) { $lien->addFlags($etape->slug); } return $lien; } else { return new Wtk_RawText($label ? $label : $individu->getFullname()); } }
function append($model, $apps, $racine) { $m = $model; $acl = Zend_Registry::get('acl'); foreach ($apps as $app) { $individu = $app->findParentIndividus(); $role = $app->findParentRoles(); $unite = $app->findParentUnites(); if ($acl->isAllowed(null, $individu, 'fiche')) { $url_fiche = $this->view->urlIndividu($individu, 'fiche', 'individus', true); } else { $url_fiche = null; } $url_unite = $this->view->url(array('controller' => 'unites', 'action' => 'effectifs', 'unite' => $unite->slug)); $etape = $individu->findParentEtapes(); $maitrise = $racine && $unite->id == $racine->id && !$unite->isTerminale(); // insertion du tuple $m->append($unite->slug, $unite->findParentTypesUnite()->slug, $maitrise ? 'Maîtrise' : $unite->getName(), $url_unite, $individu->getFullname(true, false), array($role->slug, wtk_strtoid($app->titre)), $app->getAccronyme(), $role->acl_role, $etape ? $etape->slug : null, $url_fiche, $individu->adelec, wtk_nbsp($individu->fixe), wtk_nbsp($individu->portable), wtk_nbsp($individu->portable ? $individu->portable : $individu->fixe), wtk_nbsp(preg_replace("`\r?\n`", " – ", trim($individu->adresse))), strftime('%d-%m-%Y', strtotime($individu->naissance)), $individu->getAge(), $individu->totem, $individu->numero ? $individu->numero : null, $maitrise ? 'maitrise' : null); } }