/** * show returns the protocoltext as html-string * * @param int $pid entry-id for protocol * @return string html-string with the protocoltext */ private function show($pid) { // pagecaption $this->tpl->assign('pagecaption', parent::lang('class.ProtocolView#page#caption#show')); // get protocol $protocol = new Protocol($pid); // get status $correctable = $protocol->get_correctable(false); // check rights if (Rights::check_rights($pid, 'protocol', true) && ($correctable['status'] == 2 || $_SESSION['user']->get_userinfo('name') == $protocol->get_owner())) { // smarty $sP = new JudoIntranetSmarty(); // prepare marker-array $infos = array('version' => date('dmy')); // add calendar-fields to array $protocol->addMarks($infos, false); // add tmce-css $fh = fopen('templates/protocols/tmce_' . $protocol->get_preset()->get_path() . '.css', 'r'); $css = fread($fh, filesize('templates/protocols/tmce_' . $protocol->get_preset()->get_path() . '.css')); fclose($fh); $infos['tmceStyles'] = $css; // smarty $sP->assign('p', $infos); // check marks in values foreach ($infos as $k => $v) { if (preg_match('/\\{\\$p\\..*\\}/U', $v)) { $infos[$k] = $sA->fetch('string:' . $v); } } // decision link $decisionLink = array("href" => "protocol.php?id=showdecisions&pid={$pid}", "title" => parent::lang('class.ProtocolView#show#decisionLink#title'), "text" => parent::lang('class.ProtocolView#show#decisionLink#text'), "number" => $protocol->hasDecisions()); // smarty $sP->assign('p', $infos); $div_out = $sP->fetch('templates/protocols/' . $protocol->get_preset()->get_path() . '.tpl'); // smarty $sPd = new JudoIntranetSmarty(); $sPd->assign('decisionlink', $decisionLink); $sPd->assign('page', $div_out); return $sPd->fetch('smarty.protocol.show.tpl'); } else { // error $errno = $GLOBALS['Error']->error_raised('NotAuthorized', 'entry:' . $this->get('id'), $this->get('id')); $GLOBALS['Error']->handle_error($errno); return $GLOBALS['Error']->to_html($errno); } }