public function getSso() { $id = $this->getRequest('id', null); if (!$id) { // Récupération des infos de l'utilisateur. $userInfo = Kernel::getUserInfo(); // Création des modules inexistants. Kernel::createMissingModules($userInfo["type"], $userInfo["id"]); // Liste des modules activés. $modsList = Kernel::getModEnabled($userInfo["type"], $userInfo["id"]); foreach ($modsList as $modInfo) { if ($modInfo->module_type == "MOD_SSO" && $modInfo->module_id) { $urlReturn = CopixUrl::get('sso||getSso', array('id' => $modInfo->module_id)); return new CopixActionReturn(COPIX_AR_REDIRECT, $urlReturn); } } } if (!$id) { return CopixActionGroup::process('genericTools|Messages::getError', array('message' => 'Problème', 'back' => CopixUrl::get('||'))); } $tpl = new CopixTpl(); $tpl->assign('TITLE_PAGE', CopixI18N::get('sso.title.servext')); $dao = CopixDAOFactory::create("sso|sso_auth"); // $all = $dao->findAll(); $all = $dao->findBySso($id); $tpl->assign('MAIN', CopixZone::process('sso|SsoAuthList', array('list' => $all, 'id' => _request("id")))); return new CopixActionReturn(COPIX_AR_DISPLAY, $tpl); }
/** * Commentaires d'une procedure * * @author Christophe Beyer <*****@*****.**> * @since 2008/01/30 * @param object $rFiche Recordset de la procedure */ public function _createContent(&$toReturn) { $tpl = new CopixTpl(); $rFiche = $this->getParam('rFiche'); $mondroit = $this->getParam('mondroit'); $daoinfo =& _dao('infosupp'); $sql = 'SELECT * FROM module_teleprocedure_infosupp WHERE idinter=' . $rFiche->idinter . ''; $canCheckVisible = TeleproceduresService::canMakeInTelep('CHECK_VISIBLE', $mondroit); $canAddComment = TeleproceduresService::canMakeInTelep('ADD_COMMENT', $mondroit); if (!$canCheckVisible) { $sql .= " AND info_message!='' AND info_message IS NOT NULL"; } $sql .= " ORDER BY dateinfo ASC, idinfo ASC"; $results = _doQuery($sql); // Pour chaque message on cherche les infos de son auteur $list = array(); foreach ($results as $r) { $userInfo = Kernel::getUserInfo("ID", $r->iduser); //var_dump($userInfo); $avatar = Prefs::get('prefs', 'avatar', $r->iduser); $userInfo['avatar'] = $avatar ? CopixConfig::get('prefs|avatar_path') . $avatar : ''; $r->user = $userInfo; $list[] = $r; } //print_r($rFiche); $tpl->assign('info_message_edition', CopixZone::process('kernel|edition', array('field' => 'info_message', 'format' => $rFiche->type_format, 'content' => '', 'width' => 350, 'height' => 135, 'options' => array('toolbarSet' => 'IconitoBasic', 'enterMode' => 'br', 'toolbarStartupExpanded' => 'false')))); $tpl->assign('info_commentaire_edition', CopixZone::process('kernel|edition', array('field' => 'info_commentaire', 'format' => $rFiche->type_format, 'content' => '', 'width' => 350, 'height' => 135, 'options' => array('toolbarSet' => 'IconitoBasic', 'enterMode' => 'br', 'toolbarStartupExpanded' => 'false')))); $tpl->assign('canCheckVisible', $canCheckVisible); $tpl->assign('canAddComment', $canAddComment); $tpl->assign('list', $list); $tpl->assign('rFiche', $rFiche); $toReturn = $tpl->fetch('fiche-comms-zone.tpl'); return true; }
/** * Cette méthode permet d'afficher le détail d'une personne. * La requete doit contenir une variable idPers qui contient * l'id de la personne à afficher. **/ function afficherDetail() { $tpl =& new CopixTpl(); $tpl->assign('TITLE_PAGE', "Detail d'une personne"); $tpl->assign('MAIN', CopixZone::process('DetailPers', array('idPers' => $this->vars['idPers']))); return new CopixActionReturn(COPIX_AR_DISPLAY, $tpl); }
/** * Display an error message */ function &getConfirm() { $tpl =& new CopixTpl(); $tpl->assign('TITLE_PAGE', isset($this->vars['TITLE_PAGE']) ? $this->vars['TITLE_PAGE'] : CopixI18N::get('messages.titlePage.confirm')); $tpl->assign('MAIN', CopixZone::process('PassThrough', array('title' => $this->vars['title'], 'message' => $this->vars['message'], 'confirm' => $this->vars['confirm'], 'cancel' => $this->vars['cancel'], 'template' => 'confirm.tpl'))); return $return =& new CopixActionReturn(COPIX_AR_DISPLAY, $tpl); }
/** * Shows the login form * @return Object CopixActionReturn */ function getLoginForm() { $tpl =& new CopixTpl(); $login = isset($this->vars['login']) ? $this->vars['login'] : ''; $tpl->assign('TITLE_PAGE', CopixI18N::get('auth.titlePage.login')); $tpl->assign('MAIN', CopixZone::process('auth|loginForm', array('login' => $login, 'failed' => isset($this->vars['failed'])))); return new CopixActionReturn(COPIX_AR_DISPLAY, $tpl); }
/** * récupère la liste des capacités pour l */ function getCapabilitiesKind() { $tpl =& new CopixTpl(); $group = $this->_getSessionData(); $tpl->assign('TITLE_PAGE', CopixI18N::get('profile.title.capabilitiesKind')); $tpl->assign('MAIN', CopixZone::process('CapabilitiesKind', array('group' => $group))); return new CopixActionReturn(COPIX_AR_DISPLAY, $tpl); }
/** * Publicator will see all picture they could publish */ function performQuickAdminBrowsing($event, &$eventResponse) { if (CopixUserProfile::valueOf('site', 'siteAdmin') >= PROFILE_CCV_MODERATE) { $content = CopixZone::process('comment|CommentQuickAdmin'); if (strlen($content) > 0) { $eventResponse->add(array('caption' => CopixI18N::get('comment|comment.shortDescription'), 'module' => 'comment', 'content' => $content)); } } }
/** * Fonction qui est appellée pour afficher l'aide */ public function processDefault() { if (_request('id_sh', null) === null) { return CopixActionGroup::process('generictools|Messages::getError', array('message' => _i18n('simplehelp.error.missingParameters'), 'back' => _url('simplehelp|admin|listAide'))); } $aide = _ioDAO('simplehelp')->get(_request('id_sh', null)); $ppo = new CopixPPO(array('TITLE_PAGE' => $aide->title_sh)); $ppo->MAIN = CopixZone::process('ShowAide', array('id_sh' => CopixRequest::get('id_sh', null))); return _arDirectPPO($ppo, 'popup.tpl'); }
/** * gets the default screen. */ function getParameters() { $tpl =& new CopixTpl(); $tpl->assign('TITLE_BAR', CopixI18N::get('params.title')); $choiceModule = isset($this->vars['choiceModule']) ? $this->vars['choiceModule'] : false; $editParam = isset($this->vars['editParam']) ? $this->vars['editParam'] : false; $tpl->assign('TITLE_PAGE', CopixI18N::get('params.titlePage.admin')); $tpl->assign('MAIN', CopixZone::process('ShowParams', array('choiceModule' => $choiceModule, 'editParam' => $editParam))); return new CopixActionReturn(COPIX_AR_DISPLAY, $tpl); }
function moduleContext($step = 'open', $title_page = '', $titleContext = '') { $module = CopixRequest::get('module'); $content = CopixZone::process('kernel|moduleContext', array('STEP' => $step, 'MODULE' => $module, 'TITLE_PAGE' => $title_page, 'TITLE_CONTEXT' => $titleContext)); if (!$content) { trigger_error('Unable to process Module Context Frame', E_USER_WARNING); } else { echo $content; } }
function getSelectPage() { $tpl = new CopixTpl(); $tpl->assign('TITLE_PAGE', CopixI18N::get('htmleditor.title.pageSelect')); if (isset($this->vars['popup'])) { $tpl->assign('MAIN', CopixZone::process('htmleditor|SelectPage', array('onlyLastVersion' => 1, 'editorName' => $this->vars['editorName'], 'popup' => $this->vars['popup']))); } else { $tpl->assign('MAIN', CopixZone::process('htmleditor|SelectPage', array('onlyLastVersion' => 1, 'editorName' => $this->vars['editorName']))); } return new CopixActionReturn(COPIX_AR_DISPLAY_IN, $tpl, '|blank.tpl'); }
public function _createContent(&$toReturn) { $serviceAuth = new AgendaAuth(); $tpl = new CopixTpl(); $toEdit = $this->getParam('toEdit'); //var_dump($toEdit); ////cas où on est passé par le prepareEdit //si un évènement est répété, la case doit être cochée if ($toEdit->everyday_event == 1 || $toEdit->everyweek_event == 1 || $toEdit->everymonth_event == 1 || $toEdit->everyyear_event == 1) { $toEdit->repeat = 1; } //on met à jour la balise select if ($toEdit->everyday_event == 1) { $toEdit->repeat_event = "everyday_event"; } if ($toEdit->everyweek_event == 1) { $toEdit->repeat_event = "everyweek_event"; } if ($toEdit->everymonth_event == 1) { $toEdit->repeat_event = "everymonth_event"; } if ($toEdit->everyyear_event == 1) { $toEdit->repeat_event = "everyyear_event"; } if (isset($toEdit->endrepeat_event)) { $toEdit->endrepeat_event = $toEdit->endrepeat_event; } //gestion des erreurs if ($this->getParam('e') == 1) { $tpl->assign('showError', $this->getParam('e')); } //vérification des droits d'écriture sur les agendas $listeFiltre = $this->getParam('arTitleAgendasAffiches'); //on vérifie les droits de lecture des utilisateurs foreach ((array) $listeFiltre as $key => $title_agenda) { //on vérifie si l'utilisateur a les droits de lecture sur la liste des agendas if ($serviceAuth->getCapability($key) < $serviceAuth->getWriteAgenda()) { unset($listeFiltre[$key]); } } //print_r($listeFiltre); $id_agenda = null; foreach ($listeFiltre as $idAgenda => $title) { if ($toEdit->id_agenda == $idAgenda) { $id_agenda = $idAgenda; } } $tpl->assign('arTitleAgendasAffiches', $listeFiltre); $tpl->assign('arError', $this->getParam('errors')); $tpl->assign('toEdit', $toEdit); $tpl->assign('wikibuttons_desc', CopixZone::process('kernel|wikibuttons', array('field' => 'desc_event', 'object' => array('type' => 'MOD_AGENDA', 'id' => $id_agenda)))); $toReturn = $tpl->fetch('editevent.agenda.tpl'); return true; }
/** * Les droits dans une procedure. On considere que la verif des droits a ete faite avant * * @author Christophe Beyer <*****@*****.**> * @since 2009/03/06 * @param object $rFiche Recordset de la procedure */ public function _createContent(&$toReturn) { $tpl = new CopixTpl(); $rFiche = $this->getParam('rFiche'); $errors = $this->getParam('errors'); $tpl->assign('rFiche', $rFiche); $tpl->assign('errors', $errors); $tpl->assign('linkpopup_responsables', CopixZone::process('annuaire|linkpopup', array('field' => 'responsables', 'profil' => 'USER_VIL'))); $tpl->assign('linkpopup_lecteurs', CopixZone::process('annuaire|linkpopup', array('field' => 'lecteurs', 'profil' => 'USER_VIL'))); $toReturn = $tpl->fetch('fiche-actions-droits-zone.tpl'); return true; }
/** * Renvoie les infos sur le cache * * @author Christophe Beyer <*****@*****.**> * @since 2007/03/19 */ public function info() { if (!Admin::canAdmin()) { return CopixActionGroup::process('genericTools|Messages::getError', array('message' => CopixI18N::get('kernel|kernel.error.noRights'), 'back' => CopixUrl::get())); } $tpl = new CopixTpl(); $tpl->assign('TITLE_PAGE', CopixI18N::get('sysutils|admin.menu.cache')); $tpl->assign('MENU', Admin::getMenu('cache')); $tplCache = new CopixTpl(); $tplCache->assign('info', CopixZone::process('sysutils|cacheStatus')); $tpl->assign('MAIN', $tplCache->fetch('sysutils|cache.info.tpl')); return new CopixActionReturn(COPIX_AR_DISPLAY, $tpl); }
/** * Affiche la série de boutons permettant à l'utilisateur de mettre en forme simplement le texte qu'il saisit dans une zone de texte libre. * * @author Christophe Beyer <*****@*****.**> * @since 2007/05/22 * @param string $field Nom du champ dans le formulaire. * @param string $format Format à utiliser (html, wiki...) * @param string $content Contenu "brut" saisi * @param array $objet (option) Module dans lequel se trouve la zone d'édition, dans un tableau indexé avec TYPE et ID (exemple: type=>MOD_BLOG, id=>4). Si positionné, on va vérifier si le parent de cet objet a un album photos, et si oui on affiche le lien vers l'album photos en mode popup * @param integer $width (option) Largeur de la zone de saisie * @param integer $height (option) Hauteur de la zone de saisie * @param array $options (option) Options permettant de personnaliser la zone */ public function _createContent(&$toReturn) { $tpl = new CopixTpl(); $field = $this->getParam('field', NULL); $format = $this->getParam('format', NULL); $content = $this->getParam('content', NULL); $object = $this->getParam('object', array()); $width = $this->getParam('width', 650); $height = $this->getParam('height', 300); $class = $this->getParam('class'); $options = $this->getParam('options', array()); $html = ''; if ($field && $format) { if ('USER' === $object) { } else { $object_type = isset($object['type']) ? $object['type'] : null; $object_id = isset($object['id']) ? $object['id'] : null; $object = $object_type && $object_id ? array('type' => $object_type, 'id' => $object_id) : null; } switch ($format) { case "wiki": $tpl->assign('wikibuttons', CopixZone::process('kernel|wikibuttons', array('field' => $field, 'format' => $format, 'object' => $object))); break; case "html": $tpl->assign('wikibuttons', CopixZone::process('kernel|wikibuttons', array('field' => $field, 'format' => $format, 'object' => $object))); break; case "htmlnl2br": $tpl->assign('wikibuttons', CopixZone::process('kernel|wikibuttons', array('field' => $field, 'format' => $format, 'object' => $object))); break; case "dokuwiki": $tpl->assign('wikibuttons', CopixZone::process('kernel|wikibuttons', array('field' => $field, 'format' => $format, 'object' => $object))); break; case "fckeditor": case "ckeditor": CopixHTMLHeader::addJSLink(_resource('js/ckeditor/ckeditor.js')); CopixHTMLHeader::addJSLink(_resource('js/ckeditor/config.js')); $tpl->assign('wikibuttons', CopixZone::process('kernel|wikibuttons', array('field' => $field, 'format' => 'ckeditor', 'object' => $object))); break; } $tpl->assign('field', $field); $tpl->assign('format', $format); $tpl->assign('content', $content); $tpl->assign('width', $width); $tpl->assign('height', $height); $tpl->assign('class', $class); $tpl->assign('options', $options); } //_dump($options); $toReturn = $tpl->fetch('zone.edition.tpl'); return true; }
public function processGetZone() { $ppo = new CopixPPO(); $session = CopixAJAX::getSession(); if ($session->isNewSession()) { $ppo->MAIN = ""; CopixHTMLHeader::addJSDOMReadyCode("document.location.href = ''"); } elseif (($instanceId = _request('instanceId')) && ($zoneData = $session->pop($instanceId))) { list($zone, $params) = $zoneData; $ppo->MAIN = CopixZone::process($zone, $params); } else { throw new CopixException(_i18n('messages.ajax.zone.invalidInstanceId', array($instanceId))); } return _arDirectPPO($ppo, 'blank.tpl'); }
/** * @param $this->params['event'] string the event name */ function _createContent(&$toReturn) { //new tpl $tpl =& new CopixTpl(); //Search only for the given event. $dao =& CopixDAOFactory::create('CopixListener'); $sp = CopixDAOFactory::createSearchParams('event', '=', $this->params['event']); $sp = CopixDAOFactory::createSearchParams('kind', '=', 'zone'); $list = $dao->findBy($sp); //go through the founded listeners, asks for their processing foreach ($list as $toProcess) { $toReturn .= CopixZone::process($toProcess, $this->params); } return true; }
public function _createContent(&$toReturn) { //Getting the user. //Create Services, and DAO CopixHTMLHeader::addCSSLink(_resource("styles/module_blog_admin.css")); CopixHtmlHeader::addJSLink(CopixUrl::get() . 'js/iconito/module_blog.js'); $tpl = new CopixTpl(); $id_blog = $this->getParam('id_blog', ''); $tpl->assign('article', $this->getParam('article', null)); $tpl->assign('kind', $this->getParam('kind', null)); $tpl->assign('id_blog', $id_blog); $tpl->assign('id_bact', $this->getParam('id_bact', '')); $tpl->assign('errors', $this->getParam('errors', '')); $tpl->assign('showErrors', $this->getParam('showErrors', false)); $tpl->assign('preview', $this->getParam('preview', '0')); $tpl->assign('tabArticleCategory', $this->getParam('tabArticleCategory', null)); $tpl->assign('can_format_articles', CopixConfig::get('blog|blog.default.can_format_articles')); $tpl->assign('default_format_articles', CopixConfig::get('blog|blog.default.default_format_articles')); $formats = CopixConfig::get('blog|blog.formats_articles'); $tabFormats = explode(',', $formats); $values = $output = array(); foreach ($tabFormats as $k) { $values[] = $k; $output[] = CopixI18N::get('blog|blog.default_format_articles.' . $k); } $tpl->assign('format_bact', array('values' => $values, 'output' => $output)); $art = $this->getParam('article'); $tpl->assign('edition_sumary', CopixZone::process('kernel|edition', array('field' => 'sumary_bact', 'format' => $art->format_bact, 'content' => $art->sumary_bact, 'options' => array('toolbarSet' => 'IconitoBlog'), 'object' => array('type' => 'MOD_BLOG', 'id' => $this->getParam('id_blog')), 'height' => 160))); $tpl->assign('edition_content', CopixZone::process('kernel|edition', array('field' => 'content_bact', 'format' => $art->format_bact, 'content' => $art->content_bact, 'options' => array('toolbarSet' => 'IconitoBlog'), 'object' => array('type' => 'MOD_BLOG', 'id' => $this->getParam('id_blog')), 'height' => 290))); //cat�gorie de l'article if ($this->getParam('kind', null) == 1) { $article = $this->getParam('article', null); $idCategorie = $article->tabSelectCat[0]; foreach ($this->getParam('tabArticleCategory', null) as $key => $obj) { if ($obj->id_bacg == $idCategorie) { $categorie = $obj->name_bacg; } } $tpl->assign('categorie', $categorie); } $tpl->assign('canWriteOnline', BlogAuth::canMakeInBlog('ADMIN_ARTICLE_MAKE_ONLINE', create_blog_object($id_blog))); // retour de la fonction : $toReturn = $tpl->fetch('article.edit.tpl'); return true; }
/** * Affiche les infos d'une �cole (coordonn�es, directeur, classes...) * * @author Christophe Beyer <*****@*****.**> * @since 2006/01/18 * @param integer $rEcole Recordset de l'�cole */ public function _createContent(&$toReturn) { $tpl = new CopixTpl(); $annuaireService =& CopixClassesFactory::Create('annuaire|AnnuaireService'); $rEcole = $this->getParam('rEcole') ? $this->getParam('rEcole') : NULL; if ($rEcole) { //print_r($rEcole); $ecole = $rEcole['id']; // BOOST 2.5s if ($this->getParam('classes')) { $classes = $this->getParam('classes'); } else { $classes = $annuaireService->getClassesInEcole($ecole, array('droit' => 'VOIR')); } $matrix =& enic::get('matrixCache'); $droit = $matrix->ecole($ecole)->_right->USER_DIR->voir; if ($droit) { $rEcole['directeur'] = $annuaireService->getDirecteurInEcole($ecole); $canWrite = $matrix->ecole($ecole)->_right->USER_DIR->communiquer; $tpl->assign('canWriteUSER_DIR', $canWrite); } //$droit = $matrix->ecole($ecole)->_right->USER_ADM->voir; $droit = 1; if ($droit) { $rEcole['administratif'] = $annuaireService->getAdministratifInEcole($ecole); $canWrite = $matrix->ecole($ecole)->_right->USER_DIR->communiquer; $tpl->assign('canWriteUSER_ADM', $canWrite); } $tpl->assign('canWriteUSER_ENS', $matrix->ecole($ecole)->_right->USER_ENS->communiquer); //$rEcole['directeur'] = $annuaireService->checkVisibility( $rEcole['directeur'] ); //$rEcole['administratif'] = $annuaireService->checkVisibility( $rEcole['administratif'] ); $tpl->assign('ecole', $rEcole); $tpl->assign('classes', $classes); // BOOST 1s if (CopixConfig::exists('|can_annuaire_menu') && !CopixConfig::get('|can_annuaire_menu')) { $tpl->assign('displayComboEcoles', false); } else { $tpl->assign('displayComboEcoles', true); } $tpl->assign('comboecoles', CopixZone::process('annuaire|comboecolesinville', array('droit' => 'VOIR', 'ville' => $rEcole['ALL']->vil_id_vi, 'value' => $ecole, 'fieldName' => 'ecole', 'attribs' => 'CLASS="annu_combo_popup" ONCHANGE="if (this.value) this.form.submit();"'))); $toReturn = $tpl->fetch('infosecole.tpl'); } return true; }
/** * Actions d'une procedure * * @author Christophe Beyer <*****@*****.**> * @since 2009/01/21 * @param object $rFiche Recordset de la procedure */ public function _createContent(&$toReturn) { $tpl = new CopixTpl(); $rFiche = $this->getParam('rFiche'); $mondroit = $this->getParam('mondroit'); $canChangeStatut = TeleproceduresService::canMakeInTelep('CHANGE_STATUT', $mondroit, array('idinter' => $rFiche->idinter)); $canDelegue = TeleproceduresService::canMakeInTelep('DELEGUE', $mondroit, array('idinter' => $rFiche->idinter)); $canSendMails = TeleproceduresService::canMakeInTelep('SEND_MAILS', $mondroit, array('idinter' => $rFiche->idinter)); $daoStat =& _dao('statu'); $tpl->assign('arStat', $daoStat->findAll()); $tpl->assign('rFiche', $rFiche); $tpl->assign('canChangeStatut', $canChangeStatut); $tpl->assign('canDelegue', $canDelegue); $tpl->assign('canSendMails', $canSendMails); $tpl->assign('mailEnabled', CopixConfig::get('|mailEnabled')); $tpl->assign('linkpopup_responsables', CopixZone::process('annuaire|linkpopup', array('field' => 'responsables', 'profil' => 'USER_VIL'))); $toReturn = $tpl->fetch('fiche-actions-zone.tpl'); return true; }
/** * Affiche la liste des personnes ayant des droits spécifiques sur un blog * * @author Christophe Beyer <*****@*****.**> * @since 2007/05/31 * @param object $blog Blog (recordset) * @param integer $kind Numéro générique de la rubrique (ne pas y toucher) * @param string $attribs Attributs HTML de la liste (STYLE, ONCHANGE...) */ public function _createContent(&$toReturn) { //Getting the user. //Create Services, and DAO $tpl = new CopixTpl(); $blog = $this->getParam('blog', null); $kind = $this->getParam('kind', null); $droit = $this->getParam('droit', null); $errors = $this->getParam('errors'); $membres = $this->getParam('membres'); $droit = $this->getParam('droit'); //Kernel::deb("droit=$droit"); //print_r($blog); // On vérifie le droit d'être ici if (!BlogAuth::canMakeInBlog("ADMIN_DROITS", $blog)) { return false; } $groupeService =& CopixClassesFactory::Create('groupe|groupeService'); $childs = Kernel::getNodeChilds("MOD_BLOG", $blog->id_blog); foreach ($childs as $k => $v) { //print_r($v); $userInfo = Kernel::getUserInfo($v["type"], $v["id"]); $childs[$k]["login"] = $userInfo["login"]; $childs[$k]["nom"] = $userInfo["nom"]; $childs[$k]["prenom"] = $userInfo["prenom"]; $childs[$k]["droitnom"] = $groupeService->getRightName($v['droit']); } //print_r($childs); $tplHome = new CopixTpl(); //$tplHome->assign ('groupe', $groupe[0]); $tpl->assign('kind', $kind); $tpl->assign('droit', $droit); $tpl->assign('list', $childs); $tpl->assign('errors', $errors); $tpl->assign('membres', $membres); $tpl->assign('linkpopup', CopixZone::process('annuaire|linkpopup', array('field' => 'membres'))); $tpl->assign('droit_values', array(PROFILE_CCV_VALID => $groupeService->getRightName(PROFILE_CCV_VALID), PROFILE_CCV_MODERATE => $groupeService->getRightName(PROFILE_CCV_MODERATE))); $tpl->assign('blog', $blog); // retour de la fonction : $toReturn = $tpl->fetch('blog.show.droits.tpl'); return true; }
public function _createContent(&$toReturn) { //Getting the user. //Create Services, and DAO CopixHTMLHeader::addCSSLink(_resource("styles/module_blog_admin.css")); CopixHtmlHeader::addJSLink(CopixUrl::get() . 'js/iconito/module_blog.js'); $tpl = new CopixTpl(); $id_blog = $this->getParam('id_blog', ''); $tpl->assign('page', $this->getParam('page', null)); $tpl->assign('id_blog', $this->getParam('id_blog', '')); $tpl->assign('id_bpge', $this->getParam('id_bpge', '')); $tpl->assign('errors', $this->getParam('errors', '')); $tpl->assign('showErrors', $this->getParam('showErrors', '')); $tpl->assign('preview', $this->getParam('preview', '0')); $tpl->assign('kind', $this->getParam('kind', '0')); $tpl->assign('can_format_articles', CopixConfig::get('blog|blog.default.can_format_articles')); $tpl->assign('default_format_articles', CopixConfig::get('blog|blog.default.default_format_articles')); //$tpl->assign ('wikibuttons', CopixZone::process ('kernel|wikibuttons', array('field'=>'content_bpge', 'object'=>array('type'=>'MOD_BLOG', 'id'=>$this->getParam('id_blog'))))); $formats = CopixConfig::get('blog|blog.formats_articles'); $tabFormats = explode(',', $formats); $values = $output = array(); foreach ($tabFormats as $k) { $values[] = $k; $output[] = CopixI18N::get('blog|blog.default_format_articles.' . $k); } $tpl->assign('format_bpge', array('values' => $values, 'output' => $output)); $pag = $this->getParam('page'); //print_r($pag); if (!isset($pag->content_bpge)) { $pag->content_bpge = ''; } //$content = (isset($pag->content_bpge)) ? $pag->content_bpge : ''; //$tpl->assign ('content_bpge', CopixZone::process ('kernel|edition', array('field'=>'content_bpge', 'format'=>'wiki', 'content'=>$content, 'object'=>array('type'=>'MOD_BLOG', 'id'=>$this->getParam('id_blog')), 'height'=>290))); $tpl->assign('edition_content', CopixZone::process('kernel|edition', array('field' => 'content_bpge', 'format' => $pag->format_bpge, 'content' => $pag->content_bpge, 'object' => array('type' => 'MOD_BLOG', 'id' => $this->getParam('id_blog')), 'height' => 290))); $tpl->assign('canWriteOnline', BlogAuth::canMakeInBlog('ADMIN_ARTICLE_MAKE_ONLINE', create_blog_object($id_blog))); // retour de la fonction : $toReturn = $tpl->fetch('page.edit.tpl'); return true; }
function smarty_function_commentthis($params, &$smarty) { extract($params); if (empty($displaytype)) { $displaytype = 'list'; } if (empty($type)) { $smarty->trigger_error('commentthis: missing type parameter'); } if (empty($id)) { $smarty->trigger_error('commentthis: missing id parameter'); } if (empty($dest)) { $dest = CopixUrl::get('comment||getList', array('type' => $type, 'id' => $id, 'back' => $back)); } $dao =& CopixDAOFactory::create('comment|Comment'); $services =& CopixClassesFactory::create('comment|commentservices'); $services->enableComment($id, $type); switch ($displaytype) { case 'link': $nbComment = $dao->getNbComment($id, $type); $toReturn = '<a href=' . $dest . '>' . $nbComment . ' '; $toReturn .= $nbComment > 1 ? CopixI18N::get('comment|comment.messages.comments') : CopixI18N::get('comment|comment.messages.comment'); $toReturn .= '</a>'; break; case 'form': $back = CopixUrl::getCurrentUrl(); CopixActionGroup::process('comment|comment::doPrepareAdd', array('type' => $type, 'id' => $id, 'back' => $back)); $toEdit = CopixActionGroup::process('comment|comment::_getSessionComment'); $toReturn = CopixZone::process('comment|AddComment', array('toEdit' => $toEdit)); break; case 'list': default: $toReturn = CopixZone::process('comment|CommentList', array('type' => $type, 'id' => $id)); break; } return $toReturn; }
<!--[if IE]> <link rel="stylesheet" href="<?php echo _resource("styles/ie.css"); ?> " type="text/css"/> <![endif]--> </head> <body> <div id="allcontent"> <div id="banner"><span id="slogan">100% communautaire, 100% professionnel... 200% efficace.</span></div> <!-- end banner --> <div id="menu"> <?php if (CopixModule::isEnabled('quicksearch')) { echo CopixZone::process('quicksearch|quicksearchform'); } ?> <ul> <?php if (isset($menuItems)) { foreach ($menuItems as $menuCaption => $menuUrl) { echo '<li><a href="' . $menuUrl . '">' . $menuCaption . '</a></li>'; } } ?> </ul> </div> <div id="maincontent"> <h1 class="main"><?php echo $TITLE_PAGE;
/** * Fonction appelée lorsque l'on clique sur le lien export du menu * Récupère en session les agendas visualisables de l'utilisateur * récupère l'objet exportParams en session s'il existe, le créer sinon, puis stock en session * @since 2006/08/17 * @author Audrey Vassal <*****@*****.**> * appelle les zones agendamenu et agendaexport */ public function processGetPrepareExport() { CopixHTMLHeader::addCSSLink(_resource("styles/module_agenda.css")); CopixHTMLHeader::addJSLink(_resource("js/jquery/jquery.ui.datepicker-fr.js")); $serviceAuth = new AgendaAuth(); $serviceAgenda = new AgendaService(); //on vérifie les droits des utilisateurs sur la liste des agendas affichés $listAgendasAffiches = $serviceAgenda->getAgendaAffiches(); foreach ((array) $listAgendasAffiches as $id_agenda) { //on vérifie si l'utilisateur a les droits d'écriture sur un des agendas affiché if ($serviceAuth->getCapability($id_agenda) >= $serviceAuth->getRead()) { $ableToRead = true; } } if (!$ableToRead) { return CopixActionGroup::process('genericTools|Messages::getError', array('message' => CopixI18N::get('agenda.error.enableToWrite'), 'back' => CopixUrl::get('agenda|agenda|vueSemaine'))); } //on récupère en session la liste des agendas en cours de visualisation $arAgendasAffiches = $serviceAgenda->getAgendaAffiches(); $arTitleAgendasAffiches = $serviceAgenda->getArTitleAgendaByArIdAgenda($arAgendasAffiches); if (!($exportParams = $this->_getSessionExport())) { //initialisation de l'objet exportParams avec le premier agenda affiché de la liste $exportParams->id_agenda = current($arAgendasAffiches); $this->_setSessionExport($exportParams); } //récupération de la liste des agendas en bdd (pour l'affichage du menu) $listAgendas = $serviceAgenda->getAvailableAgenda(); //récupération de la liste des agendas affichés $listAgendasAffiches = $serviceAgenda->getAgendaAffiches(); //template pour agenda $tplAgenda = new CopixTpl(); $tplAgenda->assign('MAIN_AGENDA', CopixZone::process('agenda|agendaexport', array('arTitleAgendasAffiches' => $arTitleAgendasAffiches, 'e' => $this->getRequest('e'), 'errors' => $this->getRequest('errors'), 'exportParams' => $exportParams))); //template principal $tpl = new CopixTpl(); $tpl->assign('BODY_ON_LOAD', "setDatePicker('#datedeb_export,#datefin_export')"); $tpl->assign('TITLE_PAGE', CopixI18N::get('agenda|agenda.message.export')); $menu = $serviceAgenda->getAgendaMenu('export'); $tpl->assign('MENU', $menu); $tpl->assign('MAIN', $tplAgenda->fetch('agenda|main.agenda.tpl')); return new CopixActionReturn(COPIX_AR_DISPLAY, $tpl); }
/** * Formulaire d'�criture d'un minimail * * @author Christophe Beyer <*****@*****.**> * @since 2005/10/18 * @see doSend() * @param integer $reply Id du minimail si c'est une r�ponse � ce minimail * @param string $title Titre du minimail (si formulaire soumis) * @param string $login Logins du(des) destinataire(s) (si formulaire soumis) * @param string $dest Logins du(des) destinataire(s) (si formulaire soumis) * @param string $message Corps du minimail (si formulaire soumis) * @param integer $preview (option) Si 1, affichera la preview du message soumis, si 0 validera le formulaire * @param integer $forward Id du minimail si c'est un forward */ public function processGetNewForm() { $this->addJs('js/iconito/module_minimail.js'); $tpl = new CopixTpl(); $tpl->assign('TITLE_PAGE', CopixI18N::get('minimail.mess_write')); $menu = array(); $menu[] = array('txt' => CopixI18N::get('minimail.mess_recv'), 'url' => CopixUrl::get('minimail||getListRecv')); $menu[] = array('txt' => CopixI18N::get('minimail.mess_send'), 'url' => CopixUrl::get('minimail||getListSend')); $menu[] = array('txt' => CopixI18N::get('minimail.mess_write'), 'url' => CopixUrl::get('minimail||getNewForm'), 'current' => true); $tpl->assign('MENU', $menu); $idUser = _currentUser()->getId(); $title = _request("title") ? _request("title") : NULL; $login = _request("login") ? _request("login") : NULL; $dest = _request("dest") ? _request("dest") : $login; $message = _request("message") ? _request("message") : NULL; $format = CopixConfig::get('minimail|default_format'); $preview = _request("preview") ? _request("preview") : 0; $iAll = _request("all"); $iReply = CopixRequest::getInt('reply'); $iForward = CopixRequest::getInt('forward'); $tplForm = new CopixTpl(); if ($iReply && !$message) { // Tentative de reponse a un message $message = _ioDAO('minimail_from')->getMessage($iReply); $destin = _ioDAO('minimail_to')->selectDestFromId($iReply); $serv = CopixClassesFactory::create("MinimailService"); if ($message && $serv->canViewMessage($message, $destin, $idUser)) { $format = $message->format; $answer = $serv->constructAnswer($message, $destin, $idUser, $format, $iAll); $dest = $answer["dest"]; $title = utf8_decode($answer["title"]); $message = $answer["message"]; $tplForm->assign("reply", $iReply); } } elseif ($iForward && !$message) { // Tentative de forward $message = _ioDAO('minimail_from')->getMessage($iForward); $destin = _ioDAO('minimail_to')->selectDestFromId($iForward); $serv = CopixClassesFactory::create("MinimailService"); if ($message && $serv->canViewMessage($message, $destin, $idUser)) { $format = $message->format; $forward = $serv->constructForward($message, $format); $title = $forward["title"]; $message = $forward["message"]; $tplForm->assign("forward", $iForward); } } $tplForm->assign("dest", $dest); $tplForm->assign("title", $title); $tplForm->assign("message", $message); $tplForm->assign("format", $format); $tplForm->assign("preview", $preview); $tplForm->assign("errors", _request("errors") ? _request("errors") : ""); $tplForm->assign('message_edition', CopixZone::process('kernel|edition', array('field' => 'message', 'format' => $format, 'content' => $message, 'height' => 200, 'object' => 'USER', 'options' => array('focus' => 1)))); $tplForm->assign('linkpopup', CopixZone::process('annuaire|linkpopup', array('field' => 'dest', 'right' => 'communiquer'))); $tplForm->assign("attachment_size", CopixConfig::get('minimail|attachment_size')); $result = $tplForm->fetch("writeform.tpl"); $tpl->assign("MAIN", $result); return new CopixActionReturn(COPIX_AR_DISPLAY, $tpl); }
/** * Admins : ajouter des admins * * Propose l'ajout de personnes comme animateur * * @package Comptes * @author Frédéric Mossmann <*****@*****.**> */ public function processNew() { if (!Kernel::isAdmin()) { return new CopixActionReturn(COPIX_AR_REDIRECT, CopixUrl::get('||')); } $tpl = new CopixTpl(); $tplListe = new CopixTpl(); $tplListe->assign('linkpopup', CopixZone::process('annuaire|linkpopup', array('field' => 'new_admins'))); $main = $tplListe->fetch("admins-new.tpl"); $tpl->assign('TITLE_PAGE', CopixI18N::get('comptes.moduleDescription') . " » " . CopixI18N::get('comptes.title.admins')); $tpl->assign('MAIN', $main); $tpl->assign('MENU', $this->menu); return new CopixActionReturn(COPIX_AR_DISPLAY, $tpl); }
/** * Affichage de l'annuaire en version popup * * Affiche les discussions d'un forum et les informations sur les discussions (titre, dernier message...), avec un lien pour lire chaque discussion. * * @author Christophe Beyer <*****@*****.**> * @since 2006/01/18 */ public function getPopup() { if (!Kernel::is_connected()) { return CopixActionGroup::process('genericTools|Messages::getError', array('message' => CopixI18N::get('annuaire|annuaire.error.noLogged'), 'back' => CopixUrl::get('||'))); } CopixHTMLHeader::addJSLink(_resource("js/iconito/module_annuaire_popup.js")); CopixHTMLHeader::addJSLink(_resource("js/jquery/jquery.tablesorter.min.js")); CopixHTMLHeader::addJSLink(_resource("js/jquery/jquery.metadata.js")); CopixHTMLHeader::addCSSLink(_resource("js/jquery/css/jquery.tablesorter.css")); $grville = _request('grville') ? _request('grville') : NULL; $ville = _request('ville') ? _request('ville') : NULL; $ecole = _request('ecole') ? _request('ecole') : NULL; $classe = _request('classe') ? _request('classe') : NULL; $field = _request('field') ? _request('field') : ''; $profils = _request('profils') ? _request('profils') : array(); $profil = $this->getRequest('profil'); // Si on force sur un profil unique a afficher $ALL = CopixConfig::get('annuaire|annu_combo_all'); $annuaireService =& CopixClassesFactory::Create('annuaire|AnnuaireService'); // Annuaire par défaut, on regarde sa session if (!$classe && !$ecole && !$ville) { $home = $annuaireService->getAnnuaireHome(); //print_r($home); switch ($home['type']) { case 'BU_GRVILLE': $grville = $home['id']; $ville = $ALL; $ecole = $ALL; $classe = $ALL; break; case 'BU_VILLE': $info = Kernel::getNodeInfo($home['type'], $home['id']); if ($info) { $grville = $info['ALL']->vil_id_grville; } $ville = $home['id']; $ecole = $ALL; $classe = $ALL; break; case 'BU_ECOLE': $info = Kernel::getNodeInfo($home['type'], $home['id']); if ($info) { $grville = $info['ALL']->vil_id_grville; $ville = $info['ALL']->eco_id_ville; } $ecole = $home['id']; $classe = $ALL; break; case 'BU_CLASSE': $info = Kernel::getNodeInfo($home['type'], $home['id']); //_dump($info); if ($info) { $grville = $info['parent']['ALL']->vil_id_grville; $ville = $info['parent']['ALL']->eco_id_ville; $ecole = $info['parent']['id']; } $classe = $home['id']; //echo "grville=$grville / ville=$ville / ecole=$ecole / classe=$classe"; break; } } $comboEcoles = $comboClasses = true; // On force les valeurs des combos if ($profil) { switch ($profil) { case 'USER_VIL': $comboEcoles = $comboClasses = false; $ecole = $classe = $ALL; break; } } $matrix =& enic::get('matrixCache'); $helper =& enic::get('matrixHelpers'); $right = _request('right', 'voir'); // voir ou communiquer $iCan = 'communiquer' == $right ? 'iCanTalkToThisType' : 'iCanSeeThisType'; $tplListe = new CopixTpl(); $visib = array('USER_ELE' => $helper->{$iCan}('USER_ELE'), 'USER_ENS' => $helper->{$iCan}('USER_ENS') || $helper->{$iCan}('USER_DIR'), 'USER_RES' => $helper->{$iCan}('USER_RES'), 'USER_EXT' => $helper->{$iCan}('USER_EXT'), 'USER_ADM' => $helper->{$iCan}('USER_ADM'), 'USER_VIL' => $helper->{$iCan}('USER_VIL')); //_dump($visib); $debug = false; $start = microtime(true); $tplListe->assign('combogrvilles', CopixZone::process('annuaire|combogrvilles', array('droit' => $right, 'value' => $grville, 'fieldName' => 'grville', 'attribs' => 'class="annu_combo_popup" ONCHANGE="change_grville(this,this.form);"', 'linesSup' => array()))); if ($debug) { echo "combogrvilles " . date("H:i:s") . " " . (microtime(true) - $start) . "<br />"; } $start = microtime(true); $tplListe->assign('combovilles', CopixZone::process('annuaire|combovilles', array('droit' => $right, 'grville' => $grville, 'value' => $ville, 'fieldName' => 'ville', 'attribs' => 'class="annu_combo_popup" ONCHANGE="change_ville(this,this.form);"', 'linesSup' => array(0 => array('value' => $ALL, 'libelle' => CopixI18N::get('annuaire|annuaire.comboAllVilles')))))); if ($debug) { echo "combovilles " . date("H:i:s") . " " . (microtime(true) - $start) . "<br />"; } $start = microtime(true); if ($ville == $ALL && $comboEcoles) { $tplListe->assign('comboecoles', CopixZone::process('annuaire|comboecolesingrville', array('droit' => $right, 'grville' => $grville, 'value' => $ecole, 'fieldName' => 'ecole', 'attribs' => 'class="annu_combo_popup" ONCHANGE="change_ecole(this,this.form);"', 'linesSup' => array(0 => array('value' => $ALL, 'libelle' => CopixI18N::get('annuaire|annuaire.comboAllEcoles')))))); if ($debug) { echo "comboecolesingrville " . date("H:i:s") . " " . (microtime(true) - $start) . "<br />"; } } elseif ($comboEcoles) { $tplListe->assign('comboecoles', CopixZone::process('annuaire|comboecolesinville', array('droit' => $right, 'ville' => $ville, 'value' => $ecole, 'fieldName' => 'ecole', 'attribs' => 'class="annu_combo_popup" ONCHANGE="change_ecole(this,this.form);"', 'linesSup' => array(0 => array('value' => $ALL, 'libelle' => CopixI18N::get('annuaire|annuaire.comboAllEcoles')))))); if ($debug) { echo "comboecolesinville " . date("H:i:s") . " " . (microtime(true) - $start) . "<br />"; } } $start = microtime(true); if ($ville == $ALL && $ecole == $ALL && $comboClasses) { $tplListe->assign('comboclasses', CopixZone::process('annuaire|comboclassesingrville', array('droit' => $right, 'grville' => $grville, 'value' => $classe, 'fieldName' => 'classe', 'attribs' => 'class="annu_combo_popup" ONCHANGE="change_classe(this,this.form);"', 'linesSup' => array(0 => array('value' => $ALL, 'libelle' => CopixI18N::get('annuaire|annuaire.comboAllClasses')))))); if ($debug) { echo "comboclassesingrville " . date("H:i:s") . " " . (microtime(true) - $start) . "<br />"; } } elseif ($ecole == $ALL && $comboClasses) { $tplListe->assign('comboclasses', CopixZone::process('annuaire|comboclassesinville', array('droit' => $right, 'ville' => $ville, 'value' => $classe, 'fieldName' => 'classe', 'attribs' => 'class="annu_combo_popup" ONCHANGE="change_classe(this,this.form);"', 'linesSup' => array(0 => array('value' => $ALL, 'libelle' => CopixI18N::get('annuaire|annuaire.comboAllClasses')))))); if ($debug) { echo "comboclassesinville " . date("H:i:s") . " " . (microtime(true) - $start) . "<br />"; } } elseif ($ecole && $comboClasses) { $tplListe->assign('comboclasses', CopixZone::process('annuaire|comboclassesinecole', array('droit' => $right, 'ecole' => $ecole, 'value' => $classe, 'fieldName' => 'classe', 'attribs' => 'class="annu_combo_popup" ONCHANGE="change_classe(this,this.form);"', 'linesSup' => array(0 => array('value' => $ALL, 'libelle' => CopixI18N::get('annuaire|annuaire.comboAllClasses')))))); if ($debug) { echo "comboclassesinecole " . date("H:i:s") . " " . (microtime(true) - $start) . "<br />"; } } elseif ($comboClasses) { $tplListe->assign('comboclasses', CopixZone::process('annuaire|comboempty', array('fieldName' => 'classe', 'attribs' => 'class="annu_combo_popup" ONCHANGE="change_classe(this,this.form);"'))); if ($debug) { echo "comboempty " . date("H:i:s") . " " . (microtime(true) - $start) . "<br />"; } } if ($ville_as_array = Kernel::getKernelLimits('ville_as_array')) { // Limitation par URL, on verifie les parametres if ($ville && $ville != $ALL && !in_array($ville, $ville_as_array)) { $ville = 0; } if ($ecole && $ecole != $ALL && ($rEcole = Kernel::getNodeInfo('BU_ECOLE', $ecole, false)) && !in_array($rEcole['ALL']->vil_id_grville, $ville_as_array)) { $ecole = 0; } if ($classe && $classe != $ALL && ($rClasse = Kernel::getNodeInfo('BU_CLASSE', $classe, false)) && !in_array($rClasse['ALL']->eco_id_ville, $ville_as_array)) { $classe = 0; } } //kernel::myDebug ("grville=$grville / ville=$ville / ecole=$ecole / classe=$classe"); //kernel::myDebug ($profils); if ($classe && $classe !== $ALL) { // Une classe précise $visib['USER_ELE'] = $matrix->classe($classe)->_right->USER_ELE->{$right}; $visib['USER_ENS'] = $matrix->classe($classe)->_right->USER_ENS->{$right} || $matrix->classe($classe)->_right->USER_DIR->{$right}; $visib['USER_RES'] = $matrix->classe($classe)->_right->USER_RES->{$right}; $visib['USER_ADM'] = $matrix->classe($classe)->_right->USER_ADM->{$right}; $visib['USER_EXT'] = $matrix->classe($classe)->_right->USER_EXT->{$right}; $visib['USER_VIL'] = $matrix->classe($classe)->_right->USER_VIL->{$right}; } elseif ($ecole && $classe == $ALL && $ecole !== $ALL) { // Une école $visib['USER_ELE'] = $matrix->ecole($ecole)->_right->USER_ELE->{$right}; $visib['USER_ENS'] = $matrix->ecole($ecole)->_right->USER_ENS->{$right} || $matrix->ecole($ecole)->_right->USER_DIR->{$right}; $visib['USER_RES'] = $matrix->ecole($ecole)->_right->USER_RES->{$right}; $visib['USER_ADM'] = $matrix->ecole($ecole)->_right->USER_ADM->{$right}; $visib['USER_EXT'] = $matrix->ecole($ecole)->_right->USER_EXT->{$right}; $visib['USER_VIL'] = $matrix->ecole($ecole)->_right->USER_VIL->{$right}; } elseif ($ville && $classe == $ALL && $ecole == $ALL && $ville !== $ALL) { // Une ville $visib['USER_ELE'] = $matrix->ville($ville)->_right->USER_ELE->{$right}; $visib['USER_ENS'] = $matrix->ville($ville)->_right->USER_ENS->{$right} || $matrix->ville($ville)->_right->USER_DIR->{$right}; $visib['USER_RES'] = $matrix->ville($ville)->_right->USER_RES->{$right}; $visib['USER_ADM'] = $matrix->ville($ville)->_right->USER_ADM->{$right}; $visib['USER_EXT'] = $matrix->ville($ville)->_right->USER_EXT->{$right}; $visib['USER_VIL'] = $matrix->ville($ville)->_right->USER_VIL->{$right}; } elseif ($grville && $classe == $ALL && $ecole == $ALL && $ville == $ALL) { // Un groupe de villes $visib['USER_ELE'] = $matrix->grville($grville)->_right->USER_ELE->{$right}; $visib['USER_ENS'] = $matrix->grville($grville)->_right->USER_ENS->{$right} || $matrix->grville($grville)->_right->USER_DIR->{$right}; $visib['USER_RES'] = $matrix->grville($grville)->_right->USER_RES->{$right}; $visib['USER_ADM'] = $matrix->grville($grville)->_right->USER_ADM->{$right}; $visib['USER_EXT'] = $matrix->grville($grville)->_right->USER_EXT->{$right}; $visib['USER_VIL'] = $matrix->grville($grville)->_right->USER_VIL->{$right}; } //_dump($visib); // Si on restreint a un profil if ($profil && $visib[$profil]) { switch ($profil) { case 'USER_VIL': $profils = array(); $profils['VIL'] = 1; break; } } if (!$profils && $visib['USER_ELE']) { $profils['ELE'] = 1; } elseif (!$profils && $visib['USER_ENS']) { $profils['PEC'] = 1; } elseif (!$profils && $visib['USER_RES']) { $profils['PAR'] = 1; } elseif (!$profils && $visib['USER_EXT']) { $profils['EXT'] = 1; } elseif (!$profils && $visib['USER_ADM']) { $profils['ADM'] = 1; } elseif (!$profils && $visib['USER_VIL']) { $profils['VIL'] = 1; } //kernel::myDebug($visib); // =============== ELEVES ========================= $eleves = array(); if (isset($profils['ELE']) && $grville && $ville && $ecole && $classe && $visib['USER_ELE']) { if ($classe != $ALL) { // Une classe précise $eleves = $annuaireService->getEleves('BU_CLASSE', $classe); } elseif ($classe == $ALL && $ecole != $ALL) { // Les eleves d'une école $eleves = $annuaireService->getEleves('BU_ECOLE', $ecole); } elseif ($classe == $ALL && $ecole == $ALL && $ville != $ALL) { // Les eleves d'une ville $eleves = $annuaireService->getEleves('BU_VILLE', $ville); } elseif ($classe == $ALL && $ecole == $ALL && $ville == $ALL) { // Les eleves d'un groupe de villes $eleves = $annuaireService->getEleves('BU_GRVILLE', $grville); } } // =============== PERSONNEL ========================= $personnel = array(); if (isset($profils['PEC']) && $grville && $ville && $ecole && $classe && $visib['USER_ENS']) { if ($classe != $ALL) { // Une classe précise $personnel = $annuaireService->getPersonnel('BU_CLASSE', $classe); } elseif ($classe == $ALL && $ecole != $ALL) { // Les classes d'une école $personnel = $annuaireService->getPersonnel('BU_ECOLE', $ecole); } elseif ($classe == $ALL && $ecole == $ALL && $ville != $ALL) { // Les classes d'une ville $personnel = $annuaireService->getPersonnel('BU_VILLE', $ville); } elseif ($classe == $ALL && $ecole == $ALL && $ville == $ALL) { // Les classes d'un groupe de villes $personnel = $annuaireService->getPersonnel('BU_GRVILLE', $grville); } } // =============== PARENTS ========================= $parents = array(); if (isset($profils['PAR']) && $grville && $ville && $ecole && $classe && $visib['USER_RES']) { if ($classe != $ALL) { // Une classe précise $parents = $annuaireService->getParents('BU_CLASSE', $classe); } elseif ($classe == $ALL && $ecole != $ALL) { // Les classes d'une école $parents = $annuaireService->getParents('BU_ECOLE', $ecole); } elseif ($classe == $ALL && $ecole == $ALL && $ville != $ALL) { // Les classes d'une ville $parents = $annuaireService->getParents('BU_VILLE', $ville); } elseif ($classe == $ALL && $ecole == $ALL && $ville == $ALL) { // Les classes d'un groupe de villes $parents = $annuaireService->getParents('BU_GRVILLE', $grville); } } // =============== PERSONNEL ADMINISTRATIF ========================= $adm = array(); if (isset($profils['ADM']) && $grville && $ville && $ecole && $classe && $visib['USER_ADM']) { if (($classe != $ALL || $classe == $ALL) && $ecole != $ALL) { // Les classes d'une école $adm = $annuaireService->getPersonnelAdm('BU_ECOLE', $ecole); } elseif ($classe == $ALL && $ecole == $ALL && $ville != $ALL) { // Les classes d'une ville $adm = $annuaireService->getPersonnelAdm('BU_VILLE', $ville); } elseif ($classe == $ALL && $ecole == $ALL && $ville == $ALL) { // Les classes d'un groupe de villes $adm = $annuaireService->getPersonnelAdm('BU_GRVILLE', $grville); } } // =============== PERSONNEL EXTERIEUR ========================= $ext = array(); if (isset($profils['EXT']) && $grville && $ville && $ecole && $classe && $visib['USER_EXT']) { $ext = $annuaireService->getPersonnelExt('ROOT', 0); } // =============== PERSONNEL VILLE ========================= $vil = array(); if (isset($profils['VIL']) && $grville && $ville && $visib['USER_VIL']) { if ($ville != $ALL) { // Dans une ville $vil = $annuaireService->getPersonnelVil('BU_VILLE', $ville); } elseif ($ville == $ALL) { // Dans un groupe de villes $vil = $annuaireService->getPersonnelVil('BU_GRVILLE', $grville); } } $droits = array('checkAll' => $annuaireService->canMakeInAnnuaire('POPUP_CHECK_ALL')); $users = array(); foreach ($eleves as $user) { $users[$user->bu_type . '-' . $user->bu_id] = $user; } foreach ($parents as $user) { $users[$user->bu_type . '-' . $user->bu_id] = $user; } foreach ($personnel as $user) { $users[$user->bu_type . '-' . $user->bu_id] = $user; } foreach ($adm as $user) { $users[$user->bu_type . '-' . $user->bu_id] = $user; } foreach ($vil as $user) { $users[$user->bu_type . '-' . $user->bu_id] = $user; } foreach ($ext as $user) { $users[$user->bu_type . '-' . $user->bu_id] = $user; } //_dump($eleves); /* if ('communiquer' === $right) { foreach ($users as $k => $user) { //print_r($user); //$matrix->communiquer(); } } */ usort($users, array('ActionGroupAnnuaire', '_usortPopup')); $tplListe->assign('field', $field); $tplListe->assign('grville', $grville); $tplListe->assign('eleves', $eleves); $tplListe->assign('personnel', $personnel); $tplListe->assign('parents', $parents); $tplListe->assign('ext', $ext); $tplListe->assign('adm', $adm); $tplListe->assign('vil', $vil); $tplListe->assign('profils', $profils); $tplListe->assign('droits', $droits); $tplListe->assign('ville', $ville); $tplListe->assign('ecole', $ecole); $tplListe->assign('classe', $classe); $tplListe->assign('visib', $visib); $tplListe->assign('profil', $profil); $tplListe->assign('users', $users); $tplListe->assign('right', $right); $result = $tplListe->fetch('getpopup.tpl'); $ppo = new CopixPPO(); $ppo->result = $result; $ppo->TITLE_PAGE = CopixI18N::get('annuaire|annuaire.moduleDescription'); CopixHTMLHeader::addJSLink(_resource("js/iconito/module_annuaire.js")); return _arPPO($ppo, array('template' => 'getpopup_ppo.tpl', 'mainTemplate' => 'default|main_popup.php')); }
/** * Envoi d'une intervention a des mails exterieurs * * @author Christophe Beyer <*****@*****.**> * @since 2009/01/22 * @param integer $id Id de la procedure * @param string $mail_from Expediteur * @param string $mail_to Destinataire * @param string $mail_cc Copie a * @param string $mail_message Message d'accompagnement optionnel */ public function sendMails() { $id = $this->getRequest('id', null); $mail_from = $this->getRequest('mail_from', null); $mail_to = $this->getRequest('mail_to', null); $mail_cc = $this->getRequest('mail_cc', null); $mail_message = $this->getRequest('mail_message', null); $daoIntervention = CopixDAOFactory::create("intervention"); $criticErrors = $errors = array(); if ($id && ($rFiche = $daoIntervention->get($id))) { $title = $rFiche->objet; $mondroit = Kernel::getLevel("MOD_TELEPROCEDURES", $rFiche->type_teleprocedure); if (!TeleproceduresService::canMakeInTelep('SEND_MAILS', $mondroit, array('idinter' => $rFiche->idinter))) { $criticErrors[] = CopixI18N::get('kernel|kernel.error.noRights'); } } else { $criticErrors[] = CopixI18N::get('teleprocedures|teleprocedures.error.prob.telep'); } if (!CopixConfig::get('|mailEnabled')) { $criticErrors[] = CopixI18N::get('teleprocedures|teleprocedures.error.noMailEnabled'); } if ($criticErrors) { return CopixActionGroup::process('genericTools|Messages::getError', array('message' => implode('<br/>', $criticErrors), 'back' => CopixUrl::get('teleprocedures||'))); } $fiche = CopixZone::process('fiche', array('rFiche' => $rFiche, 'print' => 1)); $ecoleInfos = Kernel::getNodeInfo('BU_ECOLE', $rFiche->idetabliss, false); $errors = $ok = null; require_once COPIX_UTILS_PATH . 'CopixUtils.lib.php'; if (!$mail_from) { $errors = CopixI18N::get('teleprocedures|teleprocedures.error.mail_from', ''); } else { $list = preg_split("/[\\s,]+/", $mail_from); foreach ($list as $email) { if (!validateEMail($email)) { $errors .= CopixI18N::get('teleprocedures|teleprocedures.error.incorrectMail', $email) . "\n"; } } } if (!$mail_to) { $errors = CopixI18N::get('teleprocedures|teleprocedures.error.mail_to', ''); } else { $list = preg_split("/[\\s,]+/", $mail_to); foreach ($list as $email) { if (!validateEMail($email)) { $errors .= CopixI18N::get('teleprocedures|teleprocedures.error.incorrectMail', $email) . "\n"; } } } if ($mail_cc) { $list = preg_split("/[\\s,]+/", $mail_cc); foreach ($list as $email) { if (!validateEMail($email)) { $errors .= CopixI18N::get('teleprocedures|teleprocedures.error.incorrectMail', $email) . "\n"; } } } if ($errors) { return CopixActionGroup::process('teleprocedures|default::fiche', array('id' => $id, 'errors' => $errors, 'rFiche' => array('mail_from' => $mail_from, 'mail_to' => $mail_to, 'mail_cc' => $mail_cc, 'mail_message' => $mail_message))); } if (!$errors) { require_once COPIX_UTILS_PATH . 'CopixEMailer.class.php'; $from = $fromName = $mail_from; $to = $mail_to; $cc = $cci = null; if ($mail_cc) { $cc = $mail_cc; } $subject = $rFiche->objet . ' / ' . $rFiche->type_nom . ' / ' . $rFiche->ecole_nom; if ($rFiche->ecole_type) { $subject .= ' (' . $rFiche->ecole_type . ')'; } $de = _currentUser()->getExtra('prenom') . ' ' . _currentUser()->getExtra('nom'); $message = ''; $message .= "<p>L'intervention suivante vous est transmise par " . $de . ".</p>"; if ($mail_message) { $message .= '<p>' . nl2br($mail_message) . '</p><hr/>'; } $message .= $fiche; //$from = CopixConfig::get('|mailFrom'); //$fromName = CopixConfig::get('|mailFromName'); $mail = new CopixHtmlEMail($to, $cc, $cci, utf8_decode($subject), utf8_decode($message)); $send = $mail->send($from, $fromName); if (!$send) { $errors = CopixI18N::get('teleprocedures|teleprocedures.error.sendMail'); } else { $ok = CopixI18N::get('teleprocedures|teleprocedures.ok.sendMail', $mail_to); $info_commentaire = "Mail envoyé de {$from} à {$to}"; if ($cc) { $info_commentaire .= " (copie à {$cc})"; } if ($mail_message) { $info_commentaire .= " - Message d'acompagnement : " . $mail_message . ""; } $rFiche->insertInfoSupp(null, $info_commentaire); } } //var_dump($send); if ($errors) { $errors = str_replace("\n", "<br/>", trim($errors)); } if ($ok) { $ok = $ok; } return new CopixActionReturn(COPIX_AR_REDIRECT, CopixUrl::get('|fiche', array('id' => $id, 'errors' => $errors, 'ok' => $ok))); //return CopixActionGroup::process ('teleprocedures|default::fiche', array ('id'=>$id, 'errors'=>$errors)); }
/** * Affichage de la fiche d'une ecole * * @author Christophe Beyer <*****@*****.**> * @since 2008/09/03 * @param integer $id Id de l'ecole */ public function blogs() { $id = $this->getRequest('id', null); $pAnnee = $this->getRequest('annee', null); // $ecoleDAO = CopixDAOFactory::create('kernel|kernel_bu_ecole'); $ficheDAO = CopixDAOFactory::create("fiches_ecoles"); $criticErrors = array(); if (!($rEcole = $ecoleDAO->get($id))) { $criticErrors[] = CopixI18N::get('fichesecoles.error.param'); } elseif (!FichesEcolesService::canMakeInFicheEcole($id, 'VIEW')) { $criticErrors[] = CopixI18N::get('kernel|kernel.error.noRights'); } if ($criticErrors) { return CopixActionGroup::process('genericTools|Messages::getError', array('message' => implode('<br/>', $criticErrors), 'back' => CopixUrl::get('annuaire||'))); } $arClasses = AnnuaireService::getClassesInEcole($rEcole->numero, array('forceCanViewEns' => true, 'onlyWithBlog' => true, 'onlyWithBlogIsPublic' => 1, 'enseignant' => false, 'annee' => $pAnnee)); $rEcole->blog = getNodeBlog('BU_ECOLE', $rEcole->numero, array('is_public' => 1)); // Get vocabulary catalog to use $nodeVocabularyCatalogDAO = _ioDAO('kernel|kernel_i18n_node_vocabularycatalog'); $vocabularyCatalog = $nodeVocabularyCatalogDAO->getCatalogForNode('BU_ECOLE', $id); $tpl = new CopixTpl(); $tpl->assign('rEcole', $rEcole); $tpl->assign('arClasses', $arClasses); $tpl->assign('catalog', $vocabularyCatalog->id_vc); if ($anneeDebutBlogs = CopixConfig::get('fichesecoles|anneeDebutBlogs')) { $anneeFinBlogs = Kernel::getAnneeScolaireCourante()->id_as; //Kernel::deb("anneeDebutBlogs=$anneeDebutBlogs / anneeFinBlogs=$anneeFinBlogs"); if (!$pAnnee) { $pAnnee = $anneeFinBlogs; } if ($anneeFinBlogs > $anneeDebutBlogs) { $comboAnnees = CopixZone::process('kernel|combo_annees', array('name' => 'annee', 'selected' => $pAnnee, 'debut' => $anneeDebutBlogs, 'fin' => $anneeFinBlogs, 'extra2' => 'onChange="ficheViewBlogs(' . $id . ',this.options[this.selectedIndex].value);"')); $tpl->assign('comboAnnees', $comboAnnees); } } $result = $tpl->fetch('blogs.tpl'); header('Content-type: text/html; charset=utf-8'); //echo utf8_encode($result); echo $result; return new CopixActionReturn(COPIX_AR_NONE, 0); }