/** * 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; }
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); }
/** * 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; } }
public function _createContent(&$toReturn) { $moduleName = CopixZone::getParam('moduleName'); if (($message = CopixModule::updateModule($moduleName)) === true) { $toReturn = _i18n('install.module.update') . ' ' . $moduleName . ' <img src="' . _resource('img/tools/valid.png') . '" />'; } else { $toReturn = _i18n('install.module.update') . ' ' . $moduleName . ' ' . _tag('popupinformation', array('img' => _resource('img/tools/delete.png')), $message); $toReturn .= '<div class="errorMessage">' . $message . '</div>'; } return true; }
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); }
public function _createContent(&$toReturn) { $moduleName = CopixZone::getParam('moduleName'); $arDependency = CopixModule::getDependenciesForDelete($moduleName); $tpl = new CopixTpl(); $tpl->assign('arDependency', $arDependency); $tpl->assign('arModuleToDelete', $arDependency); CopixSession::set('arModuleToDelete', $arDependency, 'copix'); $tpl->assign('id', uniqid()); $tpl->assign('arModuleToDelete', $arDependency); $toReturn = $tpl->fetch('delete.script.tpl'); return true; }
/** * 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) { $moduleName = CopixZone::getParam('moduleName'); $infos = CopixModule::getInformations($moduleName); $tpl = new CopixTpl(); if (in_array($moduleName, CopixModule::getList())) { $arModule = CopixModule::getDependenciesForDelete($moduleName); $template = 'detailmoduledelete.tpl'; $record = _dao('Copix:copixmodule')->get($moduleName); $tpl->assign('version', $record->version_cpm); } else { $arDependencies = CopixModule::getDependenciesForInstall($moduleName); $arModule = array(); $arExtension = array(); $install = true; foreach ($arDependencies as $key => $dependency) { if ($dependency->kind === 'module') { if (CopixModule::testDependency($dependency)) { $dependency->exists = true; $dependency->isInabled = CopixModule::isEnabled($dependency->name); $arModule[] = $dependency; } else { $dependency->exists = false; $install = false; $arModule[] = $dependency; } } else { if (CopixModule::testDependency($dependency)) { $dependency->exists = true; $arExtension[] = $dependency; } else { $dependency->exists = false; $install = false; $arExtension[] = $dependency; } } } $tpl->assign('arExtension', $arExtension); $tpl->assign('install', $install); $template = 'detailmoduleinstall.tpl'; } $tpl->assign('path', CopixModule::getPath($moduleName)); $tpl->assign('arModule', $arModule); $tpl->assign('info', $infos); $tpl->assign('moduleName', $moduleName); $toReturn = $tpl->fetch($template); 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) { if (CopixZone::getParam('arModule') !== null && is_array(CopixZone::getParam('arModule'))) { $arModule = CopixZone::getParam('arModule'); } else { $arModule = array(CopixZone::getParam('moduleName')); } $arModuleToInstall = array(); $arOrder = array(); foreach ($arModule as $moduleName) { $arDependency = CopixModule::getDependenciesForInstall($moduleName); foreach ($arDependency as $key => $dependency) { if ($dependency->kind === 'module') { //Gestion des modules en double avec les dependences if (!in_array($dependency->name, $arModuleToInstall)) { $arModuleToInstall[] = $dependency->name; $arOrder[] = $dependency->level; } else { //Gestion du niveau d'install des dependences $key = array_search($dependency->name, $arModuleToInstall); if ($arOrder[$key] < $dependency->level) { $arOrder[$key] = $dependency->level; } } } } } array_multisort($arOrder, SORT_ASC, $arModuleToInstall, SORT_DESC); $arModuleInfos = array(); $tpl = new CopixTpl(); $tpl->assign('arModuleToInstall', $arModuleToInstall); $tpl->assign('arModuleInfos', $arModuleInfos); CopixSession::set('arModuleToInstall', $arModuleToInstall, 'copix'); CopixSession::set('arInstalledModule', array(), 'copix'); $tpl->assign('id', uniqid()); $tpl->assign('url', CopixZone::getParam('url_return', _url('admin|install|manageModules'))); $tpl->assign('messageConfirm', CopixZone::getParam('messageConfirm', true)); $toReturn = $tpl->fetch('admin|install.script.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); }