Beispiel #1
0
 /** init data for form, INTERNAL
  * this methods init the data for the form, for example topics
  *
  * @author CommSy Development Topic
  */
 function _initForm()
 {
     // headline
     if (isset($_GET['iid'])) {
         $label_manager = $this->_environment->getLabelManager();
         $topic_item = $label_manager->getItem($_GET['iid']);
         $this->_headline = $this->_translator->getMessage('EMAIL_TO_TOPIC_TITLE', $topic_item->getTitle());
     } else {
         $this->_headline = $this->_translator->getMessage('EMAIL_TO_TOPIC_TITLE');
     }
     // context name
     $context = $this->_environment->getCurrentContextItem();
     $this->_context_name = $context->getTitle();
     // topics
     $label_manager = $this->_environment->getLabelManager();
     $label_manager->resetLimits();
     $label_manager->setContextLimit($this->_environment->getCurrentContextID());
     $label_manager->setTypeLimit('topic');
     $label_manager->select();
     $label_list = $label_manager->get();
     $label_array = array();
     if ($label_list->getCount() > 0) {
         $label_item = $label_list->getFirst();
         while ($label_item) {
             $temp_array['text'] = chunkText($label_item->getName(), '50');
             $temp_array['value'] = $label_item->getItemID();
             $label_array[] = $temp_array;
             $label_item = $label_list->getNext();
         }
     }
     $this->_topic_array = $label_array;
 }
 /** constructor
  * the only available constructor, initial values for internal variables
  *
  * @param array params parameters in an array of this class
  */
 function cs_home_informationbox_view($params)
 {
     $this->cs_home_view($params);
     $current_context = $this->_environment->getCurrentContextItem();
     $id = $current_context->getInformationBoxEntryID();
     $manager = $this->_environment->getItemManager();
     $item = $manager->getItem($id);
     $entry_manager = $this->_environment->getManager($item->getItemType());
     $entry = $entry_manager->getItem($id);
     $this->setViewTitle($this->_text_as_html_long(chunkText($entry->getTitle(), 50)));
     $this->_view_name = $this->_translator->getMessage('COMMON_INFORMATION_INDEX');
 }
Beispiel #3
0
 function getAdditionalRestrictionTextAsHTML()
 {
     $html = '';
     $params = $this->_environment->getCurrentParameterArray();
     if (isset($params['selstatus']) and !empty($params['selstatus']) and $params['selstatus'] == 3) {
         $this->_additional_selects = true;
         $html_text = '<div class="restriction">';
         $module = $this->_environment->getCurrentModule();
         $html_text .= '<span class="infocolor">' . $this->_translator->getMessage('COMMON_STATUS') . ':</span> ';
         if ($params['selstatus'] == 3) {
             $status_text = $this->_translator->getMessage('USER_MODERATORS');
         } else {
             $status_text = $this->_translator->getMessage('COMMON_USERS');
         }
         $html_text .= '<span><a title="' . $status_text . '">' . chunkText($status_text, 15) . '</a></span>';
         $picture = '<img src="images/delete_restriction.gif" alt="x" border="0"/>';
         $new_params = $params;
         unset($new_params['selstatus']);
         $html_text .= '&nbsp;' . ahref_curl($this->_environment->getCurrentContextID(), $this->_environment->getCurrentModule(), 'index', $new_params, $picture, $this->_translator->getMessage('COMMON_DELETE_RESTRICTIONS')) . LF;
         $html_text .= '</div>';
         $html .= $html_text;
     }
     return $html;
 }
 private function buildTreeArray($discussionArticlesList, $root)
 {
     $disc_manager = $this->_environment->getDiscManager();
     $converter = $this->_environment->getTextConverter();
     $tree = array();
     // creator
     $creator = $root->getCreatorItem();
     $creator_fullname = '';
     $modificator_image = '';
     $image = '';
     // TODO: implement over general detail_controller.php
     if (isset($creator)) {
         $current_user_item = $this->_environment->getCurrentUserItem();
         if ($current_user_item->isGuest() && $creator->isVisibleForLoggedIn()) {
             $creator_fullname = $translator->getMessage('COMMON_USER_NOT_VISIBLE');
         } else {
             $creator_fullname = $creator->getFullName();
             $modificator_item = $root->getModificatorItem();
             $image = $modificator_item->getPicture();
             if (!empty($image)) {
                 if ($disc_manager->existsFile($image)) {
                     $modificator_image = $image;
                 }
             }
         }
     }
     // parse position string
     $position = $root->getPosition();
     $numberArray = explode(".", $position);
     $number = "";
     foreach ($numberArray as $num) {
         if (empty($number)) {
             $number = "1";
         } else {
             $len = mb_strlen($num);
             $tmpNum = mb_substr($num, 1, $len);
             $first = mb_substr($tmpNum, 0, 1);
             while ($first == "0") {
                 $tmpNum = mb_substr($tmpNum, 1, mb_strlen($tmpNum));
                 $first = mb_substr($tmpNum, 0, 1);
             }
             $number .= "." . $tmpNum;
         }
     }
     $position = $number;
     // description
     $description = $root->getDescription();
     //$converter->setFileArray($this->getItemFileList());
     //$description = $converter->showImages($description, $root, true);
     // files
     $files = $root->getFileList();
     $file_string = '';
     if (!$files->isEmpty()) {
         $file_string = '';
         $file = $files->getFirst();
         while ($file) {
             $file_string .= '<a rel="lightbox-gallery' . $root->getItemID() . '" href="' . $file->getUrl() . '" target="blank">';
             //$name = $file->getDisplayName();
             //$name = $converter->compareWithSearchText($name);
             //$name = $converter->text_as_html_short($name);
             $file_string .= $file->getFileIcon() . '</a>';
             $file = $files->getNext();
         }
     }
     $articleLevelWidth = 350 - (sizeof(explode('.', $root->getPosition())) - 1) * 20;
     $chunkt_length = 45 - (sizeof(explode('.', $root->getPosition())) - 1) * 4;
     if ($chunkt_length < 10) {
         $chunkt_length = 10;
     }
     if ($articleLevelWidth < 150) {
         $chunkt_length = 150;
     }
     $label = '';
     $label .= "<span style=\" display:inline-block; width:" . $articleLevelWidth . "px;\">" . chunkText($root->getSubject(), $chunkt_length) . ' ' . $file_string . "</span>";
     $label .= "<span style=\" display:inline-block; width:180px;\">" . chunkText($creator_fullname, 20) . "</span>";
     $label .= "<span style=\"width:" . $articleLevelWidth . "px;text-align:right;\">" . getDateTimeInLang($root->getModificationDate(), false) . "</span>";
     $tree = array('item_id' => $root->getItemID(), 'position' => $position, 'subject' => $label, 'description' => $description, 'creator' => $creator_fullname, 'modification_date' => getDateTimeInLang($root->getModificationDate(), false));
     $potentialChildList = clone $discussionArticlesList;
     $potentialChildList->removeElement($root);
     $rootPosition = $root->getPosition();
     if (empty($rootPosition)) {
         $rootPosition = "1";
     }
     $rootLevel = sizeof(explode('.', $rootPosition)) - 1;
     // iterate list - get children
     $article = $potentialChildList->getFirst();
     while ($article) {
         $articlePosition = $article->getPosition();
         $articleLevel = sizeof(explode('.', $articlePosition)) - 1;
         // skip if item is not a direct child of root
         if ($articleLevel === $rootLevel + 1 && $rootPosition === mb_substr($articlePosition, 0, sizeof($articlePosition) - 6)) {
             $tree["children"][] = $this->buildTreeArray($potentialChildList, $article);
         }
         $article = $potentialChildList->getNext();
     }
     return $tree;
 }
Beispiel #5
0
 /** get the single entry of the list view as HTML
  * this method returns the single entry in HTML-Code
  *
  * @returns string $item as HMTL
  *
  * @param object item     the single list entry
  * @author CommSy Development Group
  */
 function _getItemAsHTML($item)
 {
     $html = LF . '<!-- BEGIN OF TODO ITEM DETAIL -->' . LF;
     $user = $this->_environment->getCurrentUser();
     $context = $this->_environment->getCurrentContextItem();
     $formal_data = array();
     $original_date = $item->getDate();
     $date = getDateTimeInLang($original_date);
     $status = $item->getStatus();
     $actual_date = date("Y-m-d H:i:s");
     if ($status != $this->_translator->getMessage('TODO_DONE') and $original_date < $actual_date) {
         $date = '<span class="required">' . $date . '</span>';
     }
     if ($original_date == '9999-00-00 00:00:00') {
         $date = $this->_translator->getMessage('TODO_NO_END_DATE_LONG');
     }
     // Members
     $member_html = '';
     $members = $item->getProcessorItemList();
     if ($members->isEmpty()) {
         $member_html .= '   ' . $this->_translator->getMessage('TODO_NO_PROCESSOR') . LF;
     } else {
         $member = $members->getFirst();
         $count = $members->getCount();
         $counter = 0;
         while ($member) {
             $counter++;
             if ($member->isUser()) {
                 $linktext = $this->_text_as_html_short($this->_compareWithSearchText($member->getFullname()));
                 if ($member->maySee($user)) {
                     $params = array();
                     $params['iid'] = $member->getItemID();
                     $param_zip = $this->_environment->getValueOfParameter('download');
                     if (empty($param_zip) or $param_zip != 'zip') {
                         $member_html .= ahref_curl($this->_environment->getCurrentContextID(), 'user', 'detail', $params, $linktext);
                     } else {
                         $member_html .= $linktext;
                     }
                     unset($params);
                 } else {
                     $member_html .= '<span class="disabled">' . $linktext . '</span>' . LF;
                 }
                 if ($counter != $count) {
                     $member_html .= ', ';
                 }
             } else {
                 $link_title = $this->_text_as_html_short($this->_compareWithSearchText(chunkText($member->getFullName(), 35)));
                 $param_zip = $this->_environment->getValueOfParameter('download');
                 if (empty($param_zip) or $param_zip != 'zip') {
                     $member_html .= ahref_curl($this->_environment->getCurrentContextID(), $this->_environment->getCurrentModule(), $this->_environment->getCurrentFunction(), array(), $link_title, $this->_translator->getMessage('USER_STATUS_REJECTED'), '_self', '', '', '', '', 'class="disabled"', '', '', true);
                 } else {
                     $member_html .= $link_title;
                 }
                 if ($counter != $count) {
                     $member_html .= ', ';
                 }
             }
             $member = $members->getNext();
         }
     }
     $temp_array[0] = $this->_translator->getMessage('TODO_VALIDITY_DATE');
     $temp_array[1] = $date;
     $formal_data[] = $temp_array;
     $temp_array[0] = $this->_translator->getMessage('TODO_STATUS');
     $temp_array[1] = $item->getStatus();
     $formal_data[] = $temp_array;
     if ($context->withTodoManagement()) {
         $step_html = '';
         $step_minutes = 0;
         $step_item_list = $item->getStepItemList();
         if ($step_item_list->isEmpty()) {
             $step_html .= '   ' . $this->_translator->getMessage('TODO_NO_STEPS') . LF;
         } else {
             $step = $step_item_list->getFirst();
             $count = $step_item_list->getCount();
             $counter = 0;
             while ($step) {
                 $counter++;
                 $step_minutes = $step_minutes + $step->getMinutes();
                 $fileicons = $this->_getItemFiles($step, true);
                 if (!empty($fileicons)) {
                     $fileicons = '&nbsp;' . $fileicons;
                 }
                 $params = array();
                 $params['iid'] = $item->getItemID();
                 $hover = str_replace('"', '&quot;', $this->_text_as_html_short($step->getTitle()));
                 $param_zip = $this->_environment->getValueOfParameter('download');
                 if (empty($param_zip) or $param_zip != 'zip') {
                     $title = ahref_curl($this->_environment->getCurrentContextID(), CS_TODO_TYPE, 'detail', $params, $this->_text_as_html_short($this->_compareWithSearchText($step->getTitle())), $hover, '', 'anchor' . $step->getItemID());
                 } else {
                     $title = $this->_text_as_html_short($this->_compareWithSearchText($step->getTitle()));
                 }
                 $step_html .= $counter . '. ' . $title . $fileicons;
                 $step_html .= $this->_getItemChangeStatus($step) . ' ' . '<br/>';
                 $step = $step_item_list->getNext();
             }
         }
         $done_time = '';
         $done_percentage = 100;
         if ($item->getPlannedTime() > 0) {
             $done_percentage = $step_minutes / $item->getPlannedTime() * 100;
         }
         $time_type = $item->getTimeType();
         $tmp_message = $this->_translator->getMessage('COMMON_MINUTES');
         $step_minutes_text = $step_minutes;
         switch ($time_type) {
             case 2:
                 $step_minutes_text = '';
                 $exact_minutes = $step_minutes / 60;
                 #               $step_minutes = round($exact_minutes);
                 $step_minutes = round($exact_minutes, 1);
                 if ($step_minutes != $exact_minutes) {
                     $step_minutes_text .= 'ca. ';
                 }
                 if ($this->_translator->getSelectedLanguage() == 'de') {
                     $step_minutes = str_replace('.', ',', $step_minutes);
                 }
                 $step_minutes_text .= $step_minutes;
                 $tmp_message = $this->_translator->getMessage('COMMON_HOURS');
                 if ($step_minutes == 1) {
                     $tmp_message = $this->_translator->getMessage('COMMON_HOUR');
                 }
                 break;
             case 3:
                 $exact_minutes = $step_minutes / 60 / 8;
                 #               $step_minutes = round($exact_minutes);
                 $step_minutes = round($exact_minutes, 1);
                 $step_minutes_text = '';
                 if ($step_minutes != $exact_minutes) {
                     $step_minutes_text .= 'ca. ';
                 }
                 if ($this->_translator->getSelectedLanguage() == 'de') {
                     $step_minutes = str_replace('.', ',', $step_minutes);
                 }
                 $step_minutes_text .= $step_minutes;
                 $tmp_message = $this->_translator->getMessage('COMMON_DAYS');
                 if ($step_minutes == 1) {
                     $tmp_message = $this->_translator->getMessage('COMMON_DAY');
                 }
                 break;
             default:
                 $step_minutes = round($step_minutes, 1);
                 if ($this->_translator->getSelectedLanguage() == 'de') {
                     $step_minutes = str_replace('.', ',', $step_minutes);
                 }
                 break;
         }
         if ($done_percentage <= 100) {
             $style = ' height: 16px; background-color: #75ab05; ';
             $done_time .= '      <div style="border: 1px solid #444;  margin-left: 0px; height: 16px; width: 300px;">' . LF;
             if ($done_percentage >= 30) {
                 $done_time .= '         <div style="font-size: 10pt; ' . $style . 'width:' . $done_percentage . '%; color:#000000;">' . $step_minutes_text . ' ' . $tmp_message . '</div>' . LF;
             } else {
                 $done_time .= '<div style="float:right; font-size: 10pt;">' . $step_minutes_text . ' ' . $tmp_message . '</div>';
                 $done_time .= '         <div style="font-size: 10pt; ' . $style . 'width:' . $done_percentage . '%; color:#000000;">&nbsp;</div>' . LF;
             }
             $done_time .= '      </div>' . LF;
         } elseif ($done_percentage <= 120) {
             $done_percentage = 100 / $done_percentage * 100;
             $style = ' height: 16px; border: 1px solid #444; background-color: #f2f030; ';
             $done_time .= '         <div style="width: 300px; font-size: 10pt; ' . $style . ' color:#000000;">' . LF;
             $done_time .= '      <div style="border-right: 1px solid #444; padding-top:0px; margin-left: 0px; height:16px;  background-color:none; width:' . $done_percentage . '%;">' . LF;
             $done_time .= '&nbsp;' . $step_minutes_text . ' ' . $tmp_message;
             $done_time .= '      </div>' . LF;
             $done_time .= '</div>' . LF;
         } else {
             $done_percentage = 100 / $done_percentage * 100;
             $style = ' height: 16px; border: 1px solid #444; background-color: #f23030; ';
             $done_time .= '         <div style="width: 300px; font-size: 10pt; ' . $style . ' color:#000000;">' . LF;
             $done_time .= '      <div style="border-right: 1px solid #444; margin-left: 0px; height:16px;  background-color:none; width:' . $done_percentage . '%;">' . LF;
             $done_time .= '&nbsp;' . $step_minutes_text . ' ' . $tmp_message;
             $done_time .= '      </div>' . LF;
             $done_time .= '</div>' . LF;
         }
         if ($item->getPlannedTime() > 0) {
             $minutes = $item->getPlannedTime();
             $time_type = $item->getTimeType();
             $tmp_message = $this->_translator->getMessage('COMMON_MINUTES');
             switch ($time_type) {
                 case 2:
                     $minutes = $minutes / 60;
                     $tmp_message = $this->_translator->getMessage('COMMON_HOURS');
                     if ($minutes == 1) {
                         $tmp_message = $this->_translator->getMessage('COMMON_HOUR');
                     }
                     break;
                 case 3:
                     $minutes = $minutes / 60 / 8;
                     $tmp_message = $this->_translator->getMessage('COMMON_DAYS');
                     if ($minutes == 1) {
                         $tmp_message = $this->_translator->getMessage('COMMON_DAY');
                     }
                     break;
             }
             if ($this->_translator->getSelectedLanguage() == 'de') {
                 $minutes = str_replace('.', ',', $minutes);
             }
             $temp_array[0] = $this->_translator->getMessage('TODO_MINUTES');
             $temp_array[1] = $minutes . ' ' . $tmp_message;
             $formal_data[] = $temp_array;
         } elseif ($item->getPlannedTime() == 0 and $done_percentage > 0) {
             $tmp_message = $this->_translator->getMessage('COMMON_MINUTES');
             $done_time = $step_minutes;
             if ($step_minutes / 60 > 1 and $step_minutes / 60 <= 8) {
                 $step_minutes_text = '';
                 $exact_minutes = $step_minutes / 60;
                 $step_minutes = round($exact_minutes, 1);
                 $done_time = '';
                 if ($step_minutes != $exact_minutes) {
                     $done_time .= 'ca. ';
                 }
                 if ($this->_translator->getSelectedLanguage() == 'de') {
                     $step_minutes = str_replace('.', ',', $step_minutes);
                 }
                 $done_time .= $step_minutes;
                 $tmp_message = $this->_translator->getMessage('COMMON_HOURS');
                 if ($step_minutes == 1) {
                     $tmp_message = $this->_translator->getMessage('COMMON_HOUR');
                 }
             } elseif ($step_minutes / 60 > 8) {
                 $exact_minutes = $step_minutes / 60 / 8;
                 $step_minutes = round($exact_minutes, 1);
                 $done_time = '';
                 if ($step_minutes != $exact_minutes) {
                     $done_time .= 'ca. ';
                 }
                 $tmp_message = $this->_translator->getMessage('COMMON_DAYS');
                 if ($step_minutes == 1) {
                     $tmp_message = $this->_translator->getMessage('COMMON_DAY');
                 }
                 if ($this->_translator->getSelectedLanguage() == 'de') {
                     $step_minutes = str_replace('.', ',', $step_minutes);
                 }
                 $done_time .= $step_minutes;
             } else {
                 $step_minutes = round($step_minutes, 1);
                 if ($this->_translator->getSelectedLanguage() == 'de') {
                     $step_minutes = str_replace('.', ',', $step_minutes);
                 }
             }
             $done_time .= ' ' . $tmp_message;
         }
         if ($done_percentage > 0 or $item->getPlannedTime() > 0) {
             $temp_array[0] = $this->_translator->getMessage('TODO_DONE_MINUTES');
             $temp_array[1] = $done_time;
             $formal_data[] = $temp_array;
         }
     }
     $temp_array[0] = $this->_translator->getMessage('TODO_PROCESSORS');
     $temp_array[1] = $member_html;
     $formal_data[] = $temp_array;
     // Files
     $files = $this->_getFilesForFormalData($item);
     if (!empty($files)) {
         $temp_array = array();
         $temp_array[] = $this->_translator->getMessage('MATERIAL_FILES');
         $temp_array[] = implode(BRLF, $files);
         $formal_data[] = $temp_array;
     }
     if (!empty($formal_data)) {
         $html .= $this->_getFormalDataAsHTML($formal_data);
     }
     if ($context->withTodoManagement()) {
         $temp_array = array();
         $formal_data = array();
         $temp_array[0] = $this->_translator->getMessage('TODO_STEPS');
         $temp_array[1] = $step_html;
         $formal_data[] = $temp_array;
         if (!empty($formal_data)) {
             $html .= $this->_getFormalDataAsHTML($formal_data);
             $html .= BRLF;
         }
     }
     // Description
     $desc = $item->getDescription();
     if (!empty($desc)) {
         $desc = $this->_text_as_html_long($this->_compareWithSearchText($this->_cleanDataFromTextArea($desc)));
         $desc = $this->_show_images($desc, $item, true);
         $html .= $this->getScrollableContent($desc, $item, '', true) . LF;
     }
     // creator, modificator and reference number for printing
     if (isset($_GET['mode']) and $_GET['mode'] == 'print') {
         $modificator = $item->getModificatorItem();
         $creator = $item->getCreatorItem();
         if (isset($modificator) and !$modificator->isDeleted()) {
             $current_user_item = $this->_environment->getCurrentUserItem();
             if ($current_user_item->isGuest()) {
                 $temp_modificator = $this->_translator->getMessage('COMMON_USER_NOT_VISIBLE');
             } else {
                 $temp_modificator = $modificator->getFullname();
             }
             unset($current_user_item);
         } else {
             $temp_modificator = $this->_translator->getMessage('COMMON_DELETED_USER');
         }
         if (isset($creator) and !$creator->isDeleted()) {
             $current_user_item = $this->_environment->getCurrentUserItem();
             if ($current_user_item->isGuest()) {
                 $temp_creator = $this->_translator->getMessage('COMMON_USER_NOT_VISIBLE');
             } else {
                 $temp_creator = $creator->getFullname();
             }
             unset($current_user_item);
         } else {
             $temp_creator = $this->_translator->getMessage('COMMON_DELETED_USER');
         }
         $html .= '<table class="creator_info" summary="Layout" style="padding-top:20px">' . LF;
         // Modificator information
         $html .= '   <tr>' . LF;
         $html .= '      <td></td>' . LF;
         $html .= '      <td class="key"  style="padding-left:8px;">' . LF;
         $html .= '         ' . $this->_translator->getMessage('COMMON_LAST_MODIFIED_BY') . ':&nbsp;' . LF;
         $html .= '      </td>' . LF;
         $html .= '      <td class="value">' . LF;
         $html .= '         ' . $temp_modificator . ', ' . $this->_translator->getDateTimeInLang($item->getModificationDate()) . LF;
         $html .= '      </td>' . LF;
         $html .= '   </tr>' . LF;
         // Creator information
         $html .= '   <tr>' . LF;
         $html .= '      <td></td>' . LF;
         $html .= '      <td class="key"  style="padding-left:8px;">' . LF;
         $html .= '         ' . $this->_translator->getMessage('COMMON_CREATED_BY') . ':&nbsp;' . LF;
         $html .= '      </td>' . LF;
         $html .= '      <td class="value">' . LF;
         $html .= '         ' . $temp_creator . ', ' . $this->_translator->getDateTimeInLang($item->getCreationDate()) . LF;
         $html .= '      </td>' . LF;
         $html .= '   </tr>' . LF;
         // Reference number
         $html .= '   <tr>' . LF;
         $html .= '      <td></td>' . LF;
         $html .= '      <td class="key"  style="padding-left:8px;">' . LF;
         $html .= '         ' . $this->_translator->getMessage('COMMON_REFNUMBER') . ':&nbsp;' . LF;
         $html .= '      </td>' . LF;
         $html .= '      <td class="value">' . LF;
         $html .= '         ' . $item->getItemID();
         $html .= '      </td>' . LF;
         $html .= '   </tr>' . LF;
         $html .= '</table>' . LF;
     }
     $html .= '<!-- END OF TODO ITEM DETAIL -->' . LF . LF;
     return $html;
 }
 public function initPopup($item)
 {
     $translator = $this->_environment->getTranslationObject();
     $labelManager = $this->_environment->getLabelManager();
     // headline
     $headline = $translator->getMessage("GROUPS_EMAIL_TO_GROUP_TITLE");
     if (isset($item)) {
         $headline .= ' "' . $item->getTitle() . '"';
     }
     $this->_popup_controller->assign("popup", "headline", $headline);
     // groups
     $labelManager->resetLimits();
     $labelManager->setContextLimit($this->_environment->getCurrentContextID());
     $labelManager->setTypeLimit("group");
     $labelManager->select();
     $labelList = $labelManager->get();
     $labelArray = array();
     if ($labelList->getCount() > 0) {
         $labelItem = $labelList->getFirst();
         while ($labelItem) {
             $labelArray[] = array("text" => chunkText($labelItem->getName(), 50), "value" => $labelItem->getItemID(), "checked" => $item->getItemID() === $labelItem->getItemID());
             $labelItem = $labelList->getNext();
         }
     }
     $this->_popup_controller->assign("popup", "groups", $labelArray);
 }
Beispiel #7
0
 /** get checkbox as HTML - internal, do not use
  * this method returns a string contains an checkbox in HMTL-Code
  *
  * @param array value form element: checkbox, see class cs_form
  *
  * @return string checkbox as HMTL
  */
 function _getCheckboxAsHTML($form_element, $font_size = 8)
 {
     $html = '';
     if (!empty($form_element['counter'])) {
         if ($form_element['counter'] < 10) {
             $html .= '0';
         }
         $html .= $form_element['counter'] . '.';
     }
     $html .= '<input type="checkbox" name="' . $form_element['name'] . '" value="' . $this->_text_as_form($form_element['value']) . '"';
     if ($form_element['ischecked']) {
         $html .= ' checked';
     }
     if (isset($form_element['is_disabled']) and $form_element['is_disabled']) {
         $html .= ' disabled="disabled"';
     }
     $html .= ' tabindex="' . $this->_count_form_elements . '"';
     $this->_count_form_elements++;
     if (isset($form_element['extention']) and !empty($form_element['extention'])) {
         $html .= ' ' . $form_element['extention'];
     }
     $html .= '/>&nbsp;';
     $text = $form_element['text'];
     if (!empty($form_element['chunk_text']) and $form_element['chunk_text'] > 1) {
         include_once 'functions/text_functions.php';
         $text = chunkText($text, $form_element['chunk_text']);
     }
     if (!empty($form_element['no_html_decode']) and $form_element['no_html_decode']) {
         $html .= $text;
     } else {
         $html .= '<span style="font-size:' . $font_size . 'pt;">' . $this->_text_as_html_short_coding_format($text) . '</span>';
     }
     return $html;
 }
 function _getRestrictionTextAsHTML()
 {
     $ref_user = $this->getRefUser();
     $ref_iid = $this->getRefIID();
     $html = '';
     $params = $this->_environment->getCurrentParameterArray();
     if (isset($params['search']) and !empty($params['search'])) {
         $html_text .= '<div class="restriction">';
         $html_text .= '<span class="infocolor">' . $this->_translator->getMessage('COMMON_SEARCH_RESTRICTION') . ':</span> ';
         $html_text .= '<span><a title="' . urldecode($params['search']) . '">' . chunkText(urldecode($params['search']), 13) . '</a></span>';
         $picture = '<img src="images/delete_restriction.gif" alt="x" border="0"/>';
         $new_params = $params;
         unset($new_params['search']);
         $html_text .= '&nbsp;' . ahref_curl($this->_environment->getCurrentContextID(), $this->_environment->getCurrentModule(), $this->_environment->getCurrentFunction(), $new_params, $picture, $this->_translator->getMessage('COMMON_DELETE_RESTRICTIONS')) . LF;
         $html_text .= '</div>';
         $html .= $html_text;
     }
     #         $html .= $this->getAdditionalRestrictionTextAsHTML();
     return $html;
 }
Beispiel #9
0
 function _getLinkedItemsAsHTML($item, $link_items, $connection, $is_perspective = false, $always = false, $attach_link = false)
 {
     $current_context = $this->_environment->getCurrentContextItem();
     $user = $this->_environment->getCurrentUserItem();
     $mod = $this->_with_modifying_actions;
     $module = Type2Module($connection);
     $html = '<div>' . LF;
     $html .= '<ul style="list-style-type: circle; font-size:8pt;">  ' . LF;
     if (isset($link_items) and $link_items->isEmpty()) {
         $html .= '   <li><a><span class="disabled">' . $this->_translator->getMessage('COMMON_NONE') . '</span></a></li>' . LF;
     } else {
         $count = $link_items->getCount();
         if (!$is_perspective and $count > 10) {
             // Only show up to five items
             $limit = 9;
             $count_shown = 1;
         } else {
             $limit = 0;
             $count_shown = 0;
         }
         $link_item = $link_items->getFirst();
         while ($link_item and $count_shown <= $limit) {
             // Get link creator
             $link_creator = $link_item->getCreatorItem();
             if (isset($link_creator) and !$link_creator->isDeleted()) {
                 $fullname = $link_creator->getFullname();
             } else {
                 $fullname = $this->_translator->getMessage('COMMON_DELETED_USER');
             }
             $link_created = $this->_translator->getDateInLang($link_item->getCreationDate());
             $link_creator_text = $this->_translator->getMessage('COMMON_LINK_CREATOR') . ' ' . $fullname . ', ' . $link_created;
             // Create the list entry
             $linked_item = $link_item->getLinkedItem($item);
             // Get the linked item
             if (isset($linked_item)) {
                 $fragment = '';
                 // there is no anchor defined by default
                 switch ($connection) {
                     case CS_DISCARTICLE_TYPE:
                         $linked_iid = $linked_item->getDiscussionID();
                         $fragment = $linked_item->getItemID();
                         $discussion_manager = $this->_environment->getDiscussionManager();
                         $linked_item = $discussion_manager->getItem($linked_iid);
                         break;
                     case CS_SECTION_TYPE:
                         $linked_iid = $linked_item->getLinkedItemID();
                         $fragment = $linked_item->getItemID();
                         $material_manager = $this->_environment->getMaterialManager();
                         $linked_item = $material_manager->getItem($linked_iid);
                         break;
                     default:
                         $linked_iid = $linked_item->getItemID();
                 }
                 $html .= '   <li>';
                 $params = array();
                 $params['iid'] = $linked_iid;
                 $user = $this->_environment->getCurrentUser();
                 if ($linked_item->isNotActivated() and !($linked_item->getCreatorID() == $user->getItemID() or $user->isModerator())) {
                     $activating_date = $linked_item->getActivatingDate();
                     if (strstr($activating_date, '9999-00-00')) {
                         $link_creator_text .= ' (' . $this->_translator->getMessage('COMMON_NOT_ACTIVATED') . ')';
                     } else {
                         $link_creator_text .= ' (' . $this->_translator->getMessage('COMMON_ACTIVATING_DATE') . ' ' . getDateInLang($linked_item->getActivatingDate()) . ')';
                     }
                     $html .= ahref_curl($this->_environment->getCurrentContextID(), $module, 'detail', $params, chunkText($linked_item->getTitle(), 27), $link_creator_text, '_self', $fragment, '', '', '', 'class="disabled"', '', '', true);
                     unset($params);
                 } else {
                     $html .= ahref_curl($this->_environment->getCurrentContextID(), $module, 'detail', $params, chunkText($linked_item->getTitle(), 27), $link_creator_text, '_self', $fragment);
                     unset($params);
                 }
                 $html .= '</li>' . LF;
             }
             // Show all linked perspectives
             if ($limit > 0) {
                 $count_shown++;
             }
             $link_item = $link_items->getNext();
         }
         if ($limit > 0) {
             $html .= '   <li>';
             $params = array();
             $params['ref_iid'] = $item->getItemID();
             $params['mode'] = 'attached';
             $html .= ahref_curl($this->_environment->getCurrentContextID(), $module, 'index', $params, $this->_translator->getMessage('RUBRIC_ALL_ATTACHMENTS', $link_items->getCount()));
             unset($params);
             $html .= '</li>' . LF;
         }
     }
     $html .= '</ul> ';
     $html .= '				<div style="text-align:right; border-top:0px solid black; padding-bottom:5px; font-size:8pt; padding-right: 3px; font-size:8pt;">' . LF;
     if ($attach_link) {
         if ($user->isUser() and $mod) {
             $params = array();
             $params['ref_iid'] = $item->getItemID();
             $params['mode'] = 'detailattach';
             $html .= ahref_curl($this->_environment->getCurrentContextID(), $module, 'index', $params, $this->_translator->getMessage('COMMON_ATTACH_LINK')) . LF;
             unset($params);
         } else {
             $html .= $this->_translator->getMessage('COMMON_ATTACH_LINK') . LF;
         }
     }
     $html .= '				</div>' . LF;
     $html .= ' </div>';
     return $html;
 }
Beispiel #10
0
 /** get the single entry of the list view as HTML
  * this method returns the single entry in HTML-Code
  *
  * @returns string $item as HMTL
  *
  * @param object item     the single list entry
  */
 function _getItemAsHTML($item)
 {
     $html = LF . '<!-- BEGIN OF DATE ITEM DETAIL -->' . LF;
     // DATE AND TIME //
     $formal_data = array();
     // set up style of days and times
     $parse_time_start = convertTimeFromInput($item->getStartingTime());
     $conforms = $parse_time_start['conforms'];
     if ($conforms == TRUE) {
         $start_time_print = getTimeLanguage($parse_time_start['datetime']);
     } else {
         $start_time_print = $this->_text_as_html_short($this->_compareWithSearchText($item->getStartingTime()));
     }
     $parse_time_end = convertTimeFromInput($item->getEndingTime());
     $conforms = $parse_time_end['conforms'];
     if ($conforms == TRUE) {
         $end_time_print = getTimeLanguage($parse_time_end['datetime']);
     } else {
         $end_time_print = $this->_text_as_html_short($this->_compareWithSearchText($item->getEndingTime()));
     }
     $parse_day_start = convertDateFromInput($item->getStartingDay(), $this->_environment->getSelectedLanguage());
     $conforms = $parse_day_start['conforms'];
     if ($conforms == TRUE) {
         $start_day_print = $item->getStartingDayName() . ', ' . $this->_translator->getDateInLang($parse_day_start['datetime']);
     } else {
         $start_day_print = $this->_text_as_html_short($this->_compareWithSearchText($item->getStartingDay()));
     }
     $parse_day_end = convertDateFromInput($item->getEndingDay(), $this->_environment->getSelectedLanguage());
     $conforms = $parse_day_end['conforms'];
     if ($conforms == TRUE) {
         $end_day_print = $item->getEndingDayName() . ', ' . $this->_translator->getDateInLang($parse_day_end['datetime']);
     } else {
         $end_day_print = $this->_text_as_html_short($this->_compareWithSearchText($item->getEndingDay()));
     }
     //formating dates and times for displaying
     $date_print = "";
     $time_print = "";
     if ($end_day_print != "") {
         //with ending day
         $date_print = $this->_translator->getMessage('DATES_AS_OF') . ' ' . $start_day_print . ' ' . $this->_translator->getMessage('DATES_TILL') . ' ' . $end_day_print;
         if ($parse_day_start['conforms'] and $parse_day_end['conforms']) {
             //start and end are dates, not strings
             $date_print .= ' (' . getDifference($parse_day_start['timestamp'], $parse_day_end['timestamp']) . ' ' . $this->_translator->getMessage('DATES_DAYS') . ')';
         }
         if ($start_time_print != "" and $end_time_print == "") {
             //starting time given
             $time_print = $this->_translator->getMessage('DATES_AS_OF_LOWER') . ' ' . $start_time_print;
             if ($parse_time_start['conforms'] == true) {
                 $time_print .= ' ' . $this->_translator->getMessage('DATES_OCLOCK');
             }
         } elseif ($start_time_print == "" and $end_time_print != "") {
             //endtime given
             $time_print = $this->_translator->getMessage('DATES_TILL') . ' ' . $end_time_print;
             if ($parse_time_end['conforms'] == true) {
                 $time_print .= ' ' . $this->_translator->getMessage('DATES_OCLOCK');
             }
         } elseif ($start_time_print != "" and $end_time_print != "") {
             //all times given
             if ($parse_time_end['conforms'] == true) {
                 $end_time_print .= ' ' . $this->_translator->getMessage('DATES_OCLOCK');
             }
             if ($parse_time_start['conforms'] == true) {
                 $start_time_print .= ' ' . $this->_translator->getMessage('DATES_OCLOCK');
             }
             $date_print = $this->_translator->getMessage('DATES_AS_OF') . ' ' . $start_day_print . ', ' . $start_time_print . '<br />' . $this->_translator->getMessage('DATES_TILL') . ' ' . $end_day_print . ', ' . $end_time_print;
             if ($parse_day_start['conforms'] and $parse_day_end['conforms']) {
                 $date_print .= ' (' . getDifference($parse_day_start['timestamp'], $parse_day_end['timestamp']) . ' ' . $this->_translator->getMessage('DATES_DAYS') . ')';
             }
         }
     } else {
         //without ending day
         $date_print = $this->_translator->getMessage('DATES_ON_DAY') . ' ' . $start_day_print;
         if ($start_time_print != "" and $end_time_print == "") {
             //starting time given
             $time_print = $this->_translator->getMessage('DATES_AS_OF_LOWER') . ' ' . $start_time_print;
             if ($parse_time_start['conforms'] == true) {
                 $time_print .= ' ' . $this->_translator->getMessage('DATES_OCLOCK');
             }
         } elseif ($start_time_print == "" and $end_time_print != "") {
             //endtime given
             $time_print = $this->_translator->getMessage('DATES_TILL') . ' ' . $end_time_print;
             if ($parse_time_end['conforms'] == true) {
                 $time_print .= ' ' . $this->_translator->getMessage('DATES_OCLOCK');
             }
         } elseif ($start_time_print != "" and $end_time_print != "") {
             //all times given
             if ($parse_time_end['conforms'] == true) {
                 $end_time_print .= ' ' . $this->_translator->getMessage('DATES_OCLOCK');
             }
             if ($parse_time_start['conforms'] == true) {
                 $start_time_print .= ' ' . $this->_translator->getMessage('DATES_OCLOCK');
             }
             $time_print = $this->_translator->getMessage('DATES_FROM_TIME_LOWER') . ' ' . $start_time_print . ' ' . $this->_translator->getMessage('DATES_TILL') . ' ' . $end_time_print;
         }
     }
     if ($parse_day_start['timestamp'] == $parse_day_end['timestamp'] and $parse_day_start['conforms'] and $parse_day_end['conforms']) {
         $date_print = $this->_translator->getMessage('DATES_ON_DAY') . ' ' . $start_day_print;
         if ($start_time_print != "" and $end_time_print == "") {
             //starting time given
             $time_print = $this->_translator->getMessage('DATES_AS_OF_LOWER') . ' ' . $start_time_print;
         } elseif ($start_time_print == "" and $end_time_print != "") {
             //endtime given
             $time_print = $this->_translator->getMessage('DATES_TILL') . ' ' . $end_time_print;
         } elseif ($start_time_print != "" and $end_time_print != "") {
             //all times given
             $time_print = $this->_translator->getMessage('DATES_FROM_TIME_LOWER') . ' ' . $start_time_print . ' ' . $this->_translator->getMessage('DATES_TILL') . ' ' . $end_time_print;
         }
     }
     // Date and time
     $temp_array = array();
     $temp_array[] = $this->_translator->getMessage('DATES_DATETIME');
     if ($time_print != '') {
         $temp_array[] = $date_print . BRLF . $time_print;
     } else {
         $temp_array[] = $date_print;
     }
     $formal_data[] = $temp_array;
     // Place
     $place = $item->getPlace();
     if (!empty($place)) {
         $place = $this->_compareWithSearchText($place);
         $temp_array = array();
         $temp_array[] = $this->_translator->getMessage('DATES_PLACE');
         $temp_array[] = $this->_text_as_html_short($place);
         $formal_data[] = $temp_array;
     }
     // Color
     $color = $item->getColor();
     if (!empty($color)) {
         $temp_array = array();
         $temp_array[] = $this->_translator->getMessage('DATES_COLOR');
         $temp_array[] = '<img src="images/spacer.gif" style="height:10px; width:10px; background-color:' . $this->_text_as_html_short($color) . '; border:1px solid #cccccc;"/>';
         $formal_data[] = $temp_array;
     }
     // Files
     $files = $this->_getFilesForFormalData($item);
     if (!empty($files)) {
         $temp_array = array();
         $temp_array[] = $this->_translator->getMessage('MATERIAL_FILES');
         $temp_array[] = implode(BRLF, $files);
         $formal_data[] = $temp_array;
     }
     if (!empty($formal_data)) {
         $html .= $this->_getFormalDataAsHTML($formal_data);
         $html .= BRLF;
     }
     // Members
     $user = $this->_environment->getCurrentUser();
     $member_html = '';
     $members = $item->getParticipantsItemList();
     if ($members->isEmpty()) {
         $member_html .= '   ' . $this->_translator->getMessage('TODO_NO_PROCESSOR') . LF;
     } else {
         $member = $members->getFirst();
         $count = $members->getCount();
         $counter = 0;
         while ($member) {
             $counter++;
             if ($member->isUser()) {
                 $linktext = $member->getFullname();
                 $linktext = $this->_compareWithSearchText($linktext);
                 $linktext = $this->_text_converter->text_as_html_short($linktext);
                 if ($member->maySee($user)) {
                     $params = array();
                     $params['iid'] = $member->getItemID();
                     $param_zip = $this->_environment->getValueOfParameter('download');
                     if (empty($param_zip) or $param_zip != 'zip') {
                         $member_html .= ahref_curl($this->_environment->getCurrentContextID(), 'user', 'detail', $params, $linktext);
                     } else {
                         $member_html .= $linktext;
                     }
                     unset($params);
                 } else {
                     $member_html .= '<span class="disabled">' . $linktext . '</span>' . LF;
                 }
                 if ($counter != $count) {
                     $member_html .= ', ';
                 }
             } else {
                 $link_title = chunkText($member->getFullName(), 35);
                 $link_title = $this->_compareWithSearchText($link_title);
                 $link_title = $this->_text_converter->text_as_html_short($link_title);
                 $param_zip = $this->_environment->getValueOfParameter('download');
                 if (empty($param_zip) or $param_zip != 'zip') {
                     $member_html .= ahref_curl($this->_environment->getCurrentContextID(), $this->_environment->getCurrentModule(), $this->_environment->getCurrentFunction(), array(), $link_title, $this->_translator->getMessage('USER_STATUS_REJECTED'), '_self', '', '', '', '', 'class="disabled"', '', '', true);
                 } else {
                     $member_html .= $link_title;
                 }
                 if ($counter != $count) {
                     $member_html .= ', ';
                 }
             }
             $member = $members->getNext();
         }
     }
     $temp_array[0] = $this->_translator->getMessage('DATE_PARTICIPANTS');
     $temp_array[1] = $member_html;
     $formal_data = array();
     $formal_data[] = $temp_array;
     if (!empty($formal_data)) {
         $html .= $this->_getFormalDataAsHTML($formal_data);
         $html .= BRLF;
     }
     // Description
     $desc = $item->getDescription();
     if (!empty($desc)) {
         $desc = $this->_text_as_html_long($this->_compareWithSearchText($this->_cleanDataFromTextArea($desc)));
         $desc = $this->_show_images($desc, $item, true);
         $html .= $this->getScrollableContent($desc, $item, '', true) . LF;
     }
     $html .= '<!-- END OF DATE ITEM DETAIL -->' . "\n\n";
     return $html;
 }
Beispiel #11
0
 /** Retrieves all labels of a type in the current context
  *   @param $type: typ of label, e.g. 'topic', 'group' or 'institution'
  *   @return list of names and id's of desired labels
  */
 function _getAllLabelsByType($type)
 {
     $label_manager = $this->_environment->getLabelManager();
     $label_manager->resetLimits();
     $label_manager->setContextLimit($this->_environment->getCurrentContextID());
     $label_manager->setTypeLimit($type);
     $label_manager->select();
     $label_list = $label_manager->get();
     $label_array = array();
     if ($label_list->getCount() > 0) {
         $label_item = $label_list->getFirst();
         while ($label_item) {
             $temp_array['text'] = chunkText($label_item->getName(), '50');
             $temp_array['value'] = $label_item->getItemID();
             $label_array[] = $temp_array;
             $label_item = $label_list->getNext();
         }
     }
     return $label_array;
 }
Beispiel #12
0
 function _getPathItemsAsHTML($topic_item, $item_id, $path_item_list)
 {
     $html = '<div>' . LF;
     $html .= '<ol style="list-style-type: decimal; list-style-position:inside; font-size:8pt; margin:0px; padding:0px;">  ' . LF;
     $path_item_list = $topic_item->getPathItemList();
     $path_item = $path_item_list->getFirst();
     while ($path_item) {
         $path_item_id = $path_item->getItemID();
         $path_item_type = $path_item->getItemType();
         if ($path_item_id == $item_id) {
             $html .= '<li style="padding-left:7px;"  class="detail_list_entry">' . LF;
             $html .= '<a title="' . $path_item->getTitle() . '">' . chunkText($path_item->getTitle(), 35) . '</a>';
         } else {
             $html .= '<li style="padding-left:7px;">' . LF;
             $params = array();
             $params['iid'] = $path_item_id;
             $params['path'] = $topic_item->getItemID();
             $user = $this->_environment->getCurrentUser();
             if ($path_item->isNotActivated() and !($path_item->getCreatorID() == $user->getItemID() or $user->isModerator())) {
                 $activating_date = $path_item->getActivatingDate();
                 if (strstr($activating_date, '9999-00-00')) {
                     $link_creator_text = $path_item->getTitle() . ' (' . $this->_translator->getMessage('COMMON_NOT_ACTIVATED') . ')';
                 } else {
                     $link_creator_text = $path_item->getTitle() . ' (' . $this->_translator->getMessage('COMMON_ACTIVATING_DATE') . ' ' . getDateInLang($path_item->getActivatingDate()) . ')';
                 }
                 $html .= ahref_curl($this->_environment->getCurrentContextID(), type2Module($path_item_type), 'detail', $params, chunkText($path_item->getTitle(), 35), $link_creator_text);
                 unset($params);
             } else {
                 $html .= ahref_curl($this->_environment->getCurrentContextID(), type2Module($path_item_type), 'detail', $params, chunkText($path_item->getTitle(), 35), $path_item->getTitle());
                 unset($params);
             }
         }
         $html .= '</li>' . LF;
         $path_item = $path_item_list->getNext();
     }
     $html .= '</ol>' . LF;
     $html .= ' </div>' . LF;
     return $html;
 }
Beispiel #13
0
 function _Name2SelectOption($name)
 {
     $length = 70;
     if (mb_strlen($name) > $length) {
         $name = chunkText($name, $length);
     }
     return $name;
 }
 private function getFormalData()
 {
     $return = array();
     $user = $this->_environment->getCurrentUser();
     $context = $this->_environment->getCurrentContextItem();
     $translator = $this->_environment->getTranslationObject();
     $converter = $this->_environment->getTextConverter();
     $formal_data = array();
     if ($this->_item->isNotActivated()) {
         $activating_date = $this->_item->getActivatingDate();
         $text = '';
         if (strstr($activating_date, '9999-00-00')) {
             $activating_text = $this->_environment->getTranslationObject()->getMessage('COMMON_NOT_ACTIVATED');
         } else {
             $activating_text = $this->_environment->getTranslationObject()->getMessage('COMMON_ACTIVATING_DATE') . ' ' . getDateInLang($this->_item->getActivatingDate());
         }
         $temp_array = array();
         $return['access'] = $activating_text;
     }
     // date
     $original_date = $this->_item->getDate();
     $date = getDateTimeInLang($original_date);
     $status = $this->_item->getStatus();
     $actual_date = date("Y-m-d H:i:s");
     if ($status !== $translator->getMessage('TODO_DONE') && $original_date < $actual_date) {
         // in progress
         // TODO:
         //$date = '<span class="required">'.$date.'</span>';
     }
     if ($original_date === '9999-00-00 00:00:00') {
         // no end date
         $date = 'no_end';
     }
     $return['date'] = $date;
     // status
     $return['status'] = $this->_item->getStatus();
     // todo management
     if ($context->withTodoManagement()) {
         $step_html = '';
         $step_minutes = 0;
         $step_item_list = $this->_item->getStepItemList();
         if ($step_item_list->isEmpty()) {
             $step_html .= '';
         } else {
             $step = $step_item_list->getFirst();
             $count = $step_item_list->getCount();
             $counter = 0;
             while ($step) {
                 $counter++;
                 $step_minutes = $step_minutes + $step->getMinutes();
                 $step = $step_item_list->getNext();
             }
         }
         $done_time = '';
         $done_percentage = 100;
         if ($this->_item->getPlannedTime() > 0) {
             $done_percentage = $step_minutes / $this->_item->getPlannedTime() * 100;
         }
         $time_type = $this->_item->getTimeType();
         $tmp_message = $translator->getMessage('COMMON_MINUTES');
         $step_minutes_text = $step_minutes;
         switch ($time_type) {
             case 2:
                 $step_minutes_text = '';
                 $exact_minutes = $step_minutes / 60;
                 $step_minutes = round($exact_minutes, 1);
                 if ($step_minutes !== $exact_minutes) {
                     $step_minutes_text .= 'ca. ';
                 }
                 if ($translator->getSelectedLanguage() === 'de') {
                     $step_minutes = str_replace('.', ',', $step_minutes);
                 }
                 $step_minutes_text .= $step_minutes;
                 $tmp_message = $translator->getMessage('COMMON_HOURS');
                 if ($step_minutes === 1) {
                     $tmp_message = $translator->getMessage('COMMON_HOUR');
                 }
                 break;
             case 3:
                 $exact_minutes = $step_minutes / 60 / 8;
                 $step_minutes = round($exact_minutes, 1);
                 $step_minutes_text = '';
                 if ($step_minutes !== $exact_minutes) {
                     $step_minutes_text .= 'ca. ';
                 }
                 if ($translator->getSelectedLanguage() === 'de') {
                     $step_minutes = str_replace('.', ',', $step_minutes);
                 }
                 $step_minutes_text .= $step_minutes;
                 $tmp_message = $translator->getMessage('COMMON_DAYS');
                 if ($step_minutes === 1) {
                     $tmp_message = $translator->getMessage('COMMON_DAY');
                 }
                 break;
             default:
                 $step_minutes = round($step_minutes, 1);
                 if ($translator->getSelectedLanguage() === 'de') {
                     $step_minutes = str_replace('.', ',', $step_minutes);
                 }
                 break;
         }
         /**/
         if ($done_percentage <= 100) {
             $style = ' height: 16px; background-color: #75ab05; ';
             $done_time .= '      <div style="border: 1px solid #444;  margin-left: 0px; height: 16px; width: 300px;">' . LF;
             if ($done_percentage >= 30) {
                 $done_time .= '         <div style="font-size: 10pt; ' . $style . 'width:' . $done_percentage . '%; color:#000000;">' . $step_minutes_text . ' ' . $tmp_message . '</div>' . LF;
             } else {
                 $done_time .= '<div style="float:right; font-size: 10pt;">' . $step_minutes_text . ' ' . $tmp_message . '</div>';
                 $done_time .= '         <div style="font-size: 10pt; ' . $style . 'width:' . $done_percentage . '%; color:#000000;">&nbsp;</div>' . LF;
             }
             $done_time .= '      </div>' . LF;
         } elseif ($done_percentage <= 120) {
             $done_percentage = 100 / $done_percentage * 100;
             $style = ' height: 16px; border: 1px solid #444; background-color: #f2f030; ';
             $done_time .= '         <div style="width: 300px; font-size: 10pt; ' . $style . ' color:#000000;">' . LF;
             $done_time .= '      <div style="border-right: 1px solid #444; padding-top:0px; margin-left: 0px; height:16px;  background-color:none; width:' . $done_percentage . '%;">' . LF;
             $done_time .= '&nbsp;' . $step_minutes_text . ' ' . $tmp_message;
             $done_time .= '      </div>' . LF;
             $done_time .= '</div>' . LF;
         } else {
             $done_percentage = 100 / $done_percentage * 100;
             $style = ' height: 16px; border: 1px solid #444; background-color: #f23030; ';
             $done_time .= '         <div style="width: 300px; font-size: 10pt; ' . $style . ' color:#000000;">' . LF;
             $done_time .= '      <div style="border-right: 1px solid #444; margin-left: 0px; height:16px;  background-color:none; width:' . $done_percentage . '%;">' . LF;
             $done_time .= '&nbsp;' . $step_minutes_text . ' ' . $tmp_message;
             $done_time .= '      </div>' . LF;
             $done_time .= '</div>' . LF;
         }
         //needed in print-view:
         $this->assign('detail', 'done_time', $step_minutes_text . ' ' . $tmp_message);
         /**/
         if ($this->_item->getPlannedTime() > 0) {
             $minutes = $this->_item->getPlannedTime();
             $time_type = $this->_item->getTimeType();
             $tmp_message = $translator->getMessage('COMMON_MINUTES');
             switch ($time_type) {
                 case 2:
                     $minutes = $minutes / 60;
                     $tmp_message = $translator->getMessage('COMMON_HOURS');
                     if ($minutes === 1) {
                         $tmp_message = $translator->getMessage('COMMON_HOUR');
                     }
                     break;
                 case 3:
                     $minutes = $minutes / 60 / 9;
                     $tmp_message = $translator->getMessage('COMMON_DAYS');
                     if ($minutes === 1) {
                         $tmp_message = $translator->getMessage('COMMON_DAY');
                     }
                     break;
             }
             if ($translator->getSelectedLanguage() === 'de') {
                 $minutes = str_replace('.', ',', $minutes);
             }
             $return['management'][0] = round($minutes, 0) . ' ' . $tmp_message;
         } elseif ($this->_item->getPlannedTime() === 0 && $done_percentage > 0) {
             $tmp_message = $translator->getMessage('COMMON_MINUTES');
             $done_time = $step_minutes;
             if ($step_minutes / 60 > 1 && $step_minutes / 60 <= 8) {
                 $step_minutes_text = '';
                 $exact_minutes = $step_minutes / 60;
                 $step_minutes = round($exact_minutes, 1);
                 $done_time = '';
                 if ($step_minutes !== $exact_minutes) {
                     $done_time .= 'ca. ';
                     if ($translator->getSelectedLanguage() === 'de') {
                         $step_minutes = str_replace('.', ',', $step_minutes);
                     }
                     $done_time .= $step_minutes;
                     $tmp_message = $translator->getMessage('COMMON_HOURS');
                     if ($step_minutes === 1) {
                         $tmp_message = $translator->getMessage('COMMON_HOUR');
                     }
                 }
             } elseif ($step_minutes / 60 > 8) {
                 $exact_minutes = $step_minutes / 60 / 8;
                 $step_minutes = round($exact_minutes, 1);
                 $done_time = '';
                 if ($step_minutes != $exact_minutes) {
                     $done_time .= 'ca. ';
                 }
                 $tmp_message = $translator->getMessage('COMMON_DAYS');
                 if ($step_minutes === 1) {
                     $tmp_message = $translator->getMessage('COMMON_DAY');
                 }
                 if ($translator->getSelectedLanguage() === 'de') {
                     $step_minutes = str_replace('.', ',', $step_minutes);
                 }
                 $done_time .= $step_minutes;
             } else {
                 $step_minutes = round($step_minutes, 1);
                 if ($translator->getSelectedLanguage() === 'de') {
                     $step_minutes = str_replace('.', ',', $step_minutes);
                 }
             }
             $done_time .= ' ' . $tmp_message;
         }
         if ($done_percentage > 0 || $this->_item->getPlannedTime() > 0) {
             $return['management'][1] = $done_time;
         }
     }
     // members
     $members = $this->_item->getProcessorItemList();
     if (!$members->isEmpty()) {
         $member = $members->getFirst();
         $count = $members->getCount();
         $counter = 0;
         while ($member) {
             $counter++;
             if ($member->isUser()) {
                 $linktext = $member->getFullname();
                 //TODO:
                 //$linktext = $converter->compareWithSearchText($linktext);
                 $linktext = $converter->text_as_html_short($linktext);
                 if ($member->maySee($user)) {
                     $params = array();
                     $params['iid'] = $member->getItemID();
                     $param_zip = $this->_environment->getValueOfParameter('download');
                     if (empty($param_zip) || $param_zip != 'zip') {
                         $member_html .= ahref_curl($this->_environment->getCurrentContextID(), 'user', 'detail', $params, $linktext);
                     } else {
                         $member_html .= $linktext;
                     }
                     unset($params);
                 } else {
                     $member_html .= '<span class="disabled">' . $linktext . '</span>' . LF;
                 }
                 if ($counter != $count) {
                     $member_html .= ', ';
                 }
             } else {
                 $linktext = chunkText($member->getFullname(), 35);
                 //TODO:
                 //$linktext = $converter->compareWithSearchText($linktext);
                 $linktext = $converter->text_as_html_short($linktext);
                 $param_zip = $this->_environment->getValueOfParameter('download');
                 if (empty($param_zip) || $param_zip != 'zip') {
                     $member_html .= ahref_curl($this->_environment->getCurrentContextID(), $this->_environment->getCurrentModule(), $this->_environment->getCurrentFunction(), array(), $link_text, $translator->getMessage('USER_STATUS_REJECTED'), '_self', '', '', '', '', 'class="disabled"', '', '', true);
                 } else {
                     $member_html .= $link_title;
                 }
                 if ($counter !== $count) {
                     $member_html .= ', ';
                 }
             }
             $member = $members->getNext();
         }
         $return['members'] = $member_html;
     }
     // files
     $files = $this->getFileContent();
     if (!empty($files)) {
         $return['files'] = implode(BRLF, $files);
     }
     // steps
     if ($context->withTodoManagement()) {
         $return['steps'] = $step_html;
     }
     return $return;
 }
 private function getFormalData()
 {
     $return = array();
     $translator = $this->_environment->getTranslationObject();
     $converter = $this->_environment->getTextConverter();
     $context_item = $this->_environment->getCurrentContextItem();
     $current_user = $this->_environment->getCurrentUserItem();
     $portal_item = $this->_environment->getCurrentPortalItem();
     if ($this->_item->isNotActivated()) {
         $activating_date = $this->_item->getActivatingDate();
         $text = '';
         if (strstr($activating_date, '9999-00-00')) {
             $activating_text = $translator->getMessage('COMMON_NOT_ACTIVATED');
         } else {
             $activating_text = $translator->getMessage('COMMON_ACTIVATING_DATE') . ' ' . getDateInLang($this->_item->getActivatingDate());
         }
         $temp_array = array();
         $temp_array[] = $translator->getMessage('COMMON_RIGHTS');
         $temp_array[] = $activating_text;
         $return[] = $temp_array;
     }
     // bibliography
     $bib_kind = $this->_item->getBibKind() ? $this->_item->getBibKind() : 'none';
     $biblio = '';
     // author, year
     $temp_array = array();
     if ($bib_kind === 'common') {
         $author = $this->_item->getAuthor();
         if (!empty($author)) {
             $temp_array[0] = $translator->getMessage('MATERIAL_AUTHORS');
             $temp_array[1] = $converter->text_as_html_short($this->_item->getAuthor());
             $return[] = $temp_array;
         }
         $pub_date = $this->_item->getPublishingDate();
         if (!empty($pub_date)) {
             $temp_array[0] = $translator->getMessage('MATERIAL_PUBLISHING_DATE');
             $temp_array[1] = $converter->text_as_html_short($this->_item->getPublishingDate());
             $return[] = $temp_array;
         }
         /*
         if(!empty($return)) {
         	$html .= $this->_getFormalDataAsHTML($return);
         		            if ( isset($html_script) and !empty($html_script) ) {
         		               $html .= $html_script;
         		            }
         }
         */
         //$return = array();
         $temp_array = array();
         $biblio = $this->_item->getBibliographicValues();
     } elseif ($bib_kind === 'website') {
         $biblio = $this->_item->getAuthor() . ',';
     } elseif ($bib_kind === 'document') {
         $biblio = '';
     } else {
         $biblio = $this->_item->getAuthor() . ' (' . $this->_item->getPublishingDate() . '). ';
     }
     if ($bib_kind !== 'common') {
         // bibliographic
         switch ($bib_kind) {
             case 'book':
             case 'collection':
                 $biblio .= $this->_item->getAddress() . ': ' . $this->_item->getPublisher();
                 if ($this->_item->getEdition()) {
                     $biblio .= ', ' . $translator->getMessage('MATERIAL_BIB_EDITION', $this->_item->getEdition());
                 }
                 if ($this->_item->getSeries()) {
                     $biblio .= ', ' . $translator->getMessage('MATERIAL_BIB_SERIES', $this->_item->getSeries());
                 }
                 if ($this->_item->getVolume()) {
                     $biblio .= ', ' . $translator->getMessage('MATERIAL_BIB_VOLUME', $this->_item->getVolume());
                 }
                 if ($this->_item->getISBN()) {
                     $biblio .= ', ' . $translator->getMessage('MATERIAL_BIB_ISBN', $this->_item->getISBN());
                 }
                 $biblio .= '.';
                 if ($this->_item->getURL()) {
                     $biblio .= ' ' . $translator->getMessage('MATERIAL_BIB_URL', $this->_item->getURL());
                 }
                 if ($this->_item->getURLDate()) {
                     $biblio .= ' (' . $translator->getMessage('MATERIAL_BIB_URL_DATE', $this->_item->getURLDate()) . ')';
                     $biblio .= '.';
                 }
                 break;
             case 'incollection':
                 $editor = $this->_item->getEditor();
                 if (!empty($editor)) {
                     $biblio .= $translator->getMessage('MATERIAL_BIB_IN') . ': ';
                     $biblio .= $translator->getMessage('MATERIAL_BIB_EDITOR', $this->_item->getEditor()) . ': ';
                 }
                 $biblio .= $this->_item->getBooktitle() . '. ';
                 $biblio .= $this->_item->getAddress() . ': ' . $this->_item->getPublisher();
                 if ($this->_item->getEdition()) {
                     $biblio .= ', ' . $translator->getMessage('MATERIAL_BIB_EDITION', $this->_item->getEdition());
                 }
                 if ($this->_item->getSeries()) {
                     $biblio .= ', ' . $translator->getMessage('MATERIAL_BIB_SERIES', $this->_item->getSeries());
                 }
                 if ($this->_item->getVolume()) {
                     $biblio .= ', ' . $translator->getMessage('MATERIAL_BIB_VOLUME', $this->_item->getVolume());
                 }
                 if ($this->_item->getISBN()) {
                     $biblio .= ', ' . $translator->getMessage('MATERIAL_BIB_ISBN', $this->_item->getISBN());
                 }
                 $biblio .= ', ' . $translator->getMessage('MATERIAL_BIB_PAGES', $this->_item->getPages()) . '.';
                 if ($this->_item->getURL()) {
                     $biblio .= ' ' . $translator->getMessage('MATERIAL_BIB_URL', $this->_item->getURL());
                 }
                 if ($this->_item->getURLDate()) {
                     $biblio .= ' (' . $translator->getMessage('MATERIAL_BIB_URL_DATE', $this->_item->getURLDate()) . ')';
                     $biblio .= '.';
                 }
                 break;
             case 'article':
                 $biblio .= $translator->getMessage('MATERIAL_BIB_IN') . ': ' . $this->_item->getJournal();
                 if ($this->_item->getVolume()) {
                     $biblio .= ', ' . $this->_item->getVolume();
                     if ($this->_item->getIssue()) {
                         $biblio .= ' (' . $this->_item->getIssue() . ')';
                     }
                 } elseif ($this->_item->getIssue()) {
                     $biblio .= ', ' . $this->_item->getIssue();
                 }
                 $biblio .= ', ' . $translator->getMessage('MATERIAL_BIB_PAGES', $this->_item->getPages()) . '. ';
                 $bib2 = '';
                 if ($this->_item->getAddress()) {
                     $bib2 .= $this->_item->getAddress();
                 }
                 if ($this->_item->getPublisher()) {
                     $bib2 .= $bib2 ? ', ' : '';
                     $bib2 .= $this->_item->getPublisher();
                 }
                 if ($this->_item->getISSN()) {
                     $bib2 .= $bib2 ? ', ' : '';
                     $bib2 .= $this->_item->getISSN();
                 }
                 $bib2 .= $bib2 ? '. ' : '';
                 $biblio .= $bib2 ? $bib2 : '';
                 if ($this->_item->getURL()) {
                     $biblio .= ' ' . $translator->getMessage('MATERIAL_BIB_URL', $this->_item->getURL());
                 }
                 if ($this->_item->getURLDate()) {
                     $biblio .= ' (' . $translator->getMessage('MATERIAL_BIB_URL_DATE', $this->_item->getURLDate()) . ')';
                     $biblio .= '.';
                 }
                 break;
             case 'inpaper':
                 $biblio .= $translator->getMessage('MATERIAL_BIB_IN') . ': ' . $this->_item->getJournal();
                 if ($this->_item->getIssue()) {
                     $biblio .= ', ' . $this->_item->getIssue();
                 }
                 $biblio .= ', ' . $translator->getMessage('MATERIAL_BIB_PAGES', $this->_item->getPages()) . '. ';
                 $bib2 = '';
                 if ($this->_item->getAddress()) {
                     $bib2 .= $this->_item->getAddress();
                 }
                 if ($this->_item->getPublisher()) {
                     $bib2 .= $bib2 ? ', ' : '';
                     $bib2 .= $this->_item->getPublisher();
                 }
                 $bib2 .= $bib2 ? '. ' : '';
                 $biblio .= $bib2 ? $bib2 : '';
                 if ($this->_item->getURL()) {
                     $biblio .= ' ' . $translator->getMessage('MATERIAL_BIB_URL', $this->_item->getURL());
                     if ($this->_item->getURLDate()) {
                         $biblio .= ' (' . $translator->getMessage('MATERIAL_BIB_URL_DATE', $this->_item->getURLDate()) . ')';
                     }
                     $biblio .= '.';
                 }
                 break;
             case 'thesis':
                 $temp_Thesis_Kind = mb_strtoupper($this->_item->getThesisKind(), 'UTF-8');
                 switch ($temp_Thesis_Kind) {
                     case 'BACHELOR':
                         $biblio .= $translator->getMessage('MATERIAL_THESIS_BACHELOR') . '. ';
                         break;
                     case 'DIPLOMA':
                         $biblio .= $translator->getMessage('MATERIAL_THESIS_DIPLOMA') . '. ';
                         break;
                     case 'DISSERTATION':
                         $biblio .= $translator->getMessage('MATERIAL_THESIS_DISSERTATION') . '. ';
                         break;
                     case 'EXAM':
                         $biblio .= $translator->getMessage('MATERIAL_THESIS_EXAM') . '. ';
                         break;
                     case 'KIND':
                         $biblio .= $translator->getMessage('MATERIAL_THESIS_KIND') . '. ';
                         break;
                     case 'KIND_DESC':
                         $biblio .= $translator->getMessage('MATERIAL_THESIS_KIND_DESC') . '. ';
                         break;
                     case 'MASTER':
                         $biblio .= $translator->getMessage('MATERIAL_THESIS_MASTER') . '. ';
                         break;
                     case 'OTHER':
                         $biblio .= $translator->getMessage('MATERIAL_THESIS_OTHER') . '. ';
                         break;
                     case 'POSTDOC':
                         $biblio .= $translator->getMessage('MATERIAL_THESIS_POSTDOC') . '. ';
                         break;
                     case 'TERM':
                         $biblio .= $translator->getMessage('MATERIAL_THESIS_TERM') . '. ';
                         break;
                     default:
                         $biblio .= $translator->getMessage('COMMON_MESSAGETAG_ERROR') . ' cs_material_detail_view(446) ';
                         break;
                 }
                 $biblio .= $this->_item->getAddress() . ': ' . $this->_item->getUniversity();
                 if ($this->_item->getFaculty()) {
                     $biblio .= ', ' . $this->_item->getFaculty();
                 }
                 $biblio .= '.';
                 if ($this->_item->getURL()) {
                     $biblio .= ' ' . $translator->getMessage('MATERIAL_BIB_URL', $this->_item->getURL());
                     if ($this->_item->getURLDate()) {
                         $biblio .= ' (' . $translator->getMessage('MATERIAL_BIB_URL_DATE', $this->_item->getURLDate()) . ')';
                     }
                     $biblio .= '.';
                 }
                 break;
             case 'website':
                 $biblio .= ' ' . $translator->getMessage('MATERIAL_BIB_URL', $converter->textFullHTMLFormatting($this->_item->getURL()));
                 if ($this->_item->getURLDate()) {
                     $biblio .= ' (' . $translator->getMessage('MATERIAL_BIB_URL_DATE', $this->_item->getURLDate()) . ')';
                 }
                 $biblio .= '.';
                 break;
             case 'manuscript':
                 $biblio .= $this->_item->getBibliographicValues();
                 if ($this->_item->getAddress()) {
                     $biblio .= ' ' . $this->_item->getAddress();
                     $biblio .= '.';
                 }
                 if ($this->_item->getURL()) {
                     $biblio .= ' ' . $translator->getMessage('MATERIAL_BIB_URL', $this->_item->getURL());
                     if ($this->_item->getURLDate()) {
                         $biblio .= ' (' . $translator->getMessage('MATERIAL_BIB_URL_DATE', $this->_item->getURLDate()) . ')';
                     }
                     $biblio .= '.';
                 }
                 break;
             case 'document':
                 $formal_data_bib = array();
                 $html .= $translator->getMessage('MATERIAL_BIB_DOCUMENT_ADMINISTRATION_INFO');
                 if ($this->_item->getDocumentEditor()) {
                     $temp_array = array();
                     $temp_array[] = $translator->getMessage('MATERIAL_BIB_DOCUMENT_EDITOR');
                     $temp_array[] = $this->_item->getDocumentEditor();
                     $return[] = $temp_array;
                 }
                 if ($this->_item->getDocumentMaintainer()) {
                     $temp_array = array();
                     $temp_array[] = $translator->getMessage('MATERIAL_BIB_DOCUMENT_MAINTAINER');
                     $temp_array[] = $this->_item->getDocumentMaintainer();
                     $return[] = $temp_array;
                 }
                 if ($this->_item->getDocumentReleaseNumber()) {
                     $temp_array = array();
                     $temp_array[] = $translator->getMessage('MATERIAL_BIB_DOCUMENT_RELEASE_NUMBER');
                     $temp_array[] = $this->_item->getDocumentReleaseNumber();
                     $return[] = $temp_array;
                 }
                 if ($this->_item->getDocumentReleaseDate()) {
                     $temp_array = array();
                     $temp_array[] = $translator->getMessage('MATERIAL_BIB_DOCUMENT_RELEASE_DATE');
                     $temp_array[] = $this->_item->getDocumentReleaseDate();
                     $return[] = $temp_array;
                 }
                 break;
             case 'foto':
                 $formal_data_bib = array();
                 if ($this->_item->getFotoCopyright()) {
                     $temp_array = array();
                     $temp_array[] = $translator->getMessage('MATERIAL_BIB_FOTO_COPYRIGHT');
                     $temp_array[] = $this->_item->getFotoCopyright();
                     $return[] = $temp_array;
                 }
                 if ($this->_item->getFotoReason()) {
                     $temp_array = array();
                     $temp_array[] = $translator->getMessage('MATERIAL_BIB_FOTO_REASON');
                     $temp_array[] = $this->_item->getFotoReason();
                     $return[] = $temp_array;
                 }
                 if ($this->_item->getFotoDate()) {
                     $temp_array = array();
                     $temp_array[] = $translator->getMessage('MATERIAL_BIB_FOTO_DATE');
                     $temp_array[] = $this->_item->getFotoDate();
                     $return[] = $temp_array;
                 }
                 break;
             case 'none':
             default:
                 $biblio .= $this->_item->getBibliographicValues();
         }
     }
     $biblio_pur = strip_tags($biblio);
     $biblio_pur = str_ireplace('&nbsp;', '', $biblio_pur);
     $biblio_pur = trim($biblio_pur);
     if ($bib_kind !== 'none' && !empty($biblio_pur)) {
         $temp_array = array();
         $temp_array[] = $translator->getMessage('MATERIAL_BIBLIOGRAPHIC');
         if (!empty($biblio)) {
             $converter->setFileArray($this->getItemFileList());
             $temp_array[] = $biblio;
             //$converter->text_as_html_long($converter->cleanDataFromTextArea($biblio));
         } else {
             $temp_array[] = '<span class="disabled"> ' . $translator->getMessage('COMON_NONE') . '</span>';
         }
         $return[] = $temp_array;
     }
     if ($this->_item->issetBibTOC()) {
         $temp_array = array();
         $temp_array[] = $translator->getMessage('COMMON_TABLE_OF_CONTENT');
         $temp_array[] = '<a href"' . $this->_item->getBibTOC() . '" target="blank">' . chunkText($this->_item->getBibTOC(), 60) . '</a>';
         $return[] = $temp_array;
     }
     if ($this->_item->issetBibURL()) {
         $temp_array = array();
         $temp_array[] = $translator->getMessage('BELUGA_LINK');
         $temp_array[] = '<a href="' . $this->_item->getBibURL() . '" target="balnk">' . chunkText($this->_item->getBibURL(), 60) . '</a>';
         $return[] = $temp_array;
     }
     if ($this->_item->issetBibAvailibility()) {
         $temp_array = array();
         $temp_array[] = $translator->getMessage('BELUGA_AVAILABILITY');
         $link = $this->_item->getBibAvailibility();
         $temp_array[] = $link;
         $return[] = $temp_array;
     }
     global $c_pmwiki;
     if ($c_pmwiki and $context_item->isWikiActive()) {
         if ($this->_item->isExportToWiki()) {
             $temp_array = array();
             $temp_array[] = $translator->getMessage('MATERIAL_EXPORT_TO_WIKI_LINK');
             $temp_array[] = $this->_item->getExportToWikiLink();
             $return[] = $temp_array;
         }
     }
     #global $c_wordpress;
     if ($portal_item->getWordpressPortalActive() and $context_item->isWordpressActive()) {
         if ($this->_item->isExporttoWordpress()) {
             $temp_array = array();
             $temp_array[] = $translator->getMessage('MATERIAL_EXPORT_TO_WORDPRESS_LINK');
             $temp_array[] = $this->_item->getExportToWordpressLink();
             $return[] = $temp_array;
         }
     }
     // files
     $files = array();
     $file_list = $this->_item->getFileList();
     if (!$file_list->isEmpty()) {
         $file = $file_list->getFirst();
         while ($file) {
             // truncate
             if (strlen($file->getDisplayName()) > 70) {
                 $file_name = $converter->filenameFormatting(substr($file->getDisplayName(), 0, 70)) . '...';
             } else {
                 $file_name = $converter->filenameFormatting($file->getDisplayName());
             }
             if (!(isset($_GET['mode']) && $_GET['mode'] === 'print') || isset($_GET['download']) && $_GET['download'] === 'zip') {
                 if ((!isset($_GET['download']) || $_GET['download'] !== 'zip') && in_array($file->getExtension(), array('png', 'jpg', 'jpeg', 'gif'))) {
                     //$this->_with_slimbox = true;
                     #$file_string = '<a href="' . $file->getUrl() . '" class="lightbox_' . $this->_item->getItemID() . '">' . $file->getFileIcon() . ' ' . ($converter->text_as_html_short($file->getDisplayName())) . '</a> (' . $file->getFileSize() . ' KB)';
                     $file_string = '<a href="' . $file->getUrl() . '" class="lightbox_' . $this->_item->getItemID() . '">' . $file->getFileIcon() . ' ' . $converter->filenameFormatting(substr($file->getDisplayName(), 0, 100)) . '</a> (' . $file->getFileSize() . ' KB)';
                 } else {
                     #$file_string = '<a href="' . $file->getUrl() . '" target="blank">' . $file->getFileIcon() . ' ' . ($converter->text_as_html_short($file->getDisplayName())) . '</a> (' . $file->getFileSize() . ' KB)';
                     $file_string = '<a href="' . $file->getUrl() . '" target="blank">' . $file->getFileIcon() . ' ' . $file_name . '</a> (' . $file->getFileSize() . ' KB)';
                 }
             } else {
                 $file_string = $file->getFileIcon() . ' ' . $converter->text_as_html_short($file->getDisplayName());
             }
             $files[] = $file_string;
             $file = $file_list->getNext();
         }
         $temp_array = array();
         $temp_array[] = $translator->getMessage('MATERIAL_FILES');
         $temp_array[] = implode(BRLF, $files);
         $return[] = $temp_array;
     }
     // world-public status
     if ($context_item->isCommunityRoom() && $context_item->isOpenForGuests()) {
         $temp_array = array();
         $wrold_public = $this->_item->getWorldPublic();
         if ($world_public === 0) {
             $public_info = $translator->getMessage('MATERIAL_WORLD_PUBLISH_STATUS_0');
         } elseif ($world_public === 1) {
             $public_info = $translator->getMessage('MATERIAL_WORLD_PUBLISH_STATUS_1');
         } elseif ($world_public === 2) {
             $public_info = $translator->getMessage('MATERIAL_WORLD_PUBLISH_STATUS_2');
         }
         $temp_array[] = $translator->getMessage('MATERIAL_WORLD_PUBLISH');
         $temp_array[] = $public_info;
         $return[] = $temp_array;
     }
     $version_mode = 'long';
     $iid = 0;
     $params = $this->_environment->getCurrentParameterArray();
     if (isset($params['iid'])) {
         $iid = $params['iid'];
     }
     $show_version = 'false';
     if (isset($params[$iid . 'version_mode']) && $params[$iid . 'version_mode'] === 'long') {
         $sho_versions = 'true';
     }
     $params[$iid . 'version_mode'] = 'long';
     // versions
     /*$versions = array();
     			if(!$this->_version_list->isEmpty()) {
     				$version = $this->_version_list->getFirst();
     
     				if($version->getVersionID() === $this->_item->getVersionID()) {
     					$title = '&nbsp;&nbsp;'.$translator->getMessage('MATERIAL_CURRENT_VERSION_DATE').' '.getDateTimeInLang($version->getModificationDate());
     				} else {
     					// TODO:
     					 $params = array();
                $params[$iid.'version_mode'] = 'long';
                $params['iid'] = $version->getItemID();
                $title = '&nbsp;&nbsp;'.ahref_curl($this->_environment->getCurrentContextID(), 'material', 'detail', $params,$this->_translator->getMessage('MATERIAL_CURRENT_VERSION_DATE').' '.getDateTimeInLang($version->getModificationDate()));
                unset($params);
     				}
     
     				$version = $this->_version_list->getNext();
     				$is_user = $current_user->isUser();
     
     				while($version) {*/
     /*
     *
     if ( !$with_links
                      or ( !$is_user
                           and $this->_environment->inCommunityRoom()
                           and !$version->isWorldPublic()
                         )
                      or $item->getVersionID() == $version->getVersionID()
                    ) {
                    $versions[] = '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'.$this->_translator->getMessage('MATERIAL_VERSION_DATE').' '.getDateTimeInLang($version->getModificationDate());
                 } else {
                    $params = array();
                    $params[$iid.'version_mode'] = 'long';
                    $params['iid'] = $version->getItemID();
                    $params['version_id'] = $version->getVersionID();
                    $versions[] = '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'.ahref_curl($this->_environment->getCurrentContextID(), 'material', 'detail', $params,$this->_translator->getMessage('MATERIAL_VERSION_DATE').' '.getDateTimeInLang($version->getModificationDate()));
                    unset($params);
                 }
     *
     */
     /*		$version = $this->_version_list->getNext();
     				}
     				$count = $this->_version_list->getCount();
     
     				if(!empty($version) && $count > 1) {
     					$temp_array = array();
     					$temp_array[] = $this->_translator->getMessage('MATERIAL_VERSION');
     					// TODO:
     			            $html_string ='&nbsp;<img id="toggle'.$item->getItemID().$item->getVersionID().'" src="images/more.gif"/>';
     			            $html_string .= $title;
     			            $html_string .= '<div id="creator_information'.$item->getItemID().$item->getVersionID().'">'.LF;
     			            $html_string .= '<div class="creator_information_panel">     '.LF;
     			            $html_string .= '<div>'.LF;
     			            if ($show_versions == 'true'){
     			               $html_script ='<script type="text/javascript">initCreatorInformations("'.$item->getItemID().$item->getVersionID().'",true)</script>';
     			            }else{
     			               $html_script ='<script type="text/javascript">initCreatorInformations("'.$item->getItemID().$item->getVersionID().'",false)</script>';
     			            }
     			            if($with_links) {
     			               $html_string .= implode(BRLF, $versions);
     			            } else {
     			               $version_count = count ($versions);
     			               $html_string .= "$version_count. ".$versions[0];
     			            }
     			            $html_string .= '</div>'.LF;
     			            $html_string .= '</div>'.LF;
     			            $html_string .= '</div>'.LF;
     			            $temp_array[] = $html_string;
     			            $formal_data1[] = $temp_array;
     				}
     			}*/
     $material_manager = $this->_environment->getMaterialManager();
     $material_version_list = $material_manager->getVersionList($this->_item->getItemID());
     if ($material_version_list->getCount() > 1) {
         $translator = $this->_environment->getTranslationObject();
         $material_versions_array = array();
         $temp_material_item = $material_version_list->getFirst();
         if ($temp_material_item->getVersionID() == $this->_item->getVersionID()) {
             $material_versions_array[] = $translator->getMessage('MATERIAL_CURRENT_VERSION_DATE') . ' ' . getDateTimeInLang($temp_material_item->getModificationDate());
         } else {
             $params = array();
             $params[$iid . 'version_mode'] = 'long';
             $params['iid'] = $temp_material_item->getItemID();
             $material_versions_array[] = ahref_curl($this->_environment->getCurrentContextID(), 'material', 'detail', $params, $translator->getMessage('MATERIAL_CURRENT_VERSION_DATE') . ' ' . getDateTimeInLang($temp_material_item->getModificationDate()));
             unset($params);
         }
         $temp_material_item = $material_version_list->getNext();
         $current_user = $this->_environment->getCurrentUserItem();
         $is_user = $current_user->isUser();
         while ($temp_material_item) {
             if ($this->_item->getVersionID() == $temp_material_item->getVersionID()) {
                 $material_versions_array[] = $translator->getMessage('MATERIAL_VERSION_DATE') . ' ' . getDateTimeInLang($temp_material_item->getModificationDate());
             } else {
                 $params = array();
                 $params[$iid . 'version_mode'] = 'long';
                 $params['iid'] = $temp_material_item->getItemID();
                 $params['version_id'] = $temp_material_item->getVersionID();
                 $material_versions_array[] = ahref_curl($this->_environment->getCurrentContextID(), 'material', 'detail', $params, $translator->getMessage('MATERIAL_VERSION_DATE') . ' ' . getDateTimeInLang($temp_material_item->getModificationDate()));
                 unset($params);
             }
             $temp_material_item = $material_version_list->getNext();
         }
         $this->assign('detail', 'versions', $material_version_list->getCount());
         $this->assign('detail', 'versions_array', $material_versions_array);
         if (isset($_GET['version_id'])) {
             $this->assign('detail', 'is_versions_bar_visible', true);
         }
         $latest_material_item = $material_version_list->getFirst();
         if ($latest_material_item->getVersionID() != $this->_item->getVersionID()) {
             $this->assign('detail', 'not_latest_version', true);
         }
     }
     // TODO:
     /*
     if(!empty($formal_data1)) {
     		$html .= $this->_getFormalDataAsHTML($formal_data1);
     		         if ( isset($html_script) and !empty($html_script) ) {
     		            $html .= $html_script;
     		         }
     }
     */
     // wordpress export
     #global $c_wordpress;
     if ($portal_item->getWordpressPortalActive() and $context_item->isWordpressActive() and !isset($_GET['version_id'])) {
         $wordpress_manager = $this->_environment->getWordpressManager();
         if ($this->_item->mayEdit($current_user)) {
             $this->assign('detail', 'export_to_wordpress', true);
         } else {
             if ($context_item->isWordpressActive()) {
                 $this->assign('detail', 'export_to_wordpress_not_allowed', true);
             }
         }
     }
     // wiki export
     global $c_pmwiki;
     if ($c_pmwiki and $context_item->isWikiActive() and !isset($_GET['version_id'])) {
         $this->assign('detail', 'export_to_wiki', true);
     }
     return $return;
 }
Beispiel #16
0
 function _setCheckboxesForConnectedRubric($type)
 {
     $user = $this->_environment->getCurrentUserItem();
     $item = $this->_item;
     if (empty($item) and !empty($this->_form_post['iid']) and $this->_form_post['iid'] != 'NEW') {
         $item_manager = $this->_environment->getItemManager();
         $item = $item_manager->getItem($this->_form_post['iid']);
         $item_type = $item->getItemType();
         if ($item_type == 'item' and !empty($this->_form_post['type'])) {
             $item_type = $this->_form_post['type'];
         }
         $manager = $this->_environment->getManager($item_type);
         $item = $manager->getItem($this->_form_post['iid']);
     }
     $item_array = array();
     // Get all possibly linked items in this room
     // (Only works with label managers)
     $perspective_manager = $this->_environment->getManager($type);
     $perspective_manager->resetLimits();
     $perspective_manager->setContextLimit($this->_environment->getCurrentContextID());
     $perspective_manager->setTypeLimit($type);
     $perspective_manager->select();
     $perspective_item_list = $perspective_manager->get();
     // If count of perspective items is less than some limit
     // show all with checkboxes, else show buttonlist as with
     // non-perspectives
     if ($perspective_item_list->getCount() < 10) {
         $link_manager = $this->_environment->getLinkItemManager();
         $linked_item = $perspective_item_list->getFirst();
         while ($linked_item) {
             $temp_array = array();
             $link_manager->resetLimits();
             $link_manager->setLinkedItemLimit($item);
             $link_manager->setSecondLinkedItemLimit($linked_item);
             $link_manager->select();
             $link_item_list = $link_manager->get();
             if (!empty($link_item_list) and !$link_item_list->isEmpty()) {
                 $link_item = $link_item_list->getFirst();
             } else {
                 $link_item = NULL;
             }
             if ($linked_item->getItemType() == CS_GROUP_TYPE and $linked_item->isSystemLabel() and isset($item) and $item->isA(CS_USER_TYPE)) {
                 $temp_array['is_disabled'] = true;
             }
             $temp_array['value'] = $linked_item->getItemID();
             if ($type == CS_USER_TYPE) {
                 $temp_array['text'] = chunkText($linked_item->getFullname(), 50);
             } else {
                 $temp_array['text'] = chunkText($linked_item->getTitle(), 50);
             }
             if (isset($link_item) and $user->getItemID() != $link_item->getCreatorID()) {
                 $link_creator = $link_item->getCreatorItem();
                 //uses tags only used by "_text_as_html_short_coding_format" function...
                 $temp_array['text'] .= '<BR><SPACE><SPACE><SPACE><SPACE><SPACE><DISABLED>(' . $this->_translator->getMessage('COMMON_LINK_CREATOR') . ': ' . $link_creator->getFullname() . ')</DISABLED>';
             }
             $item_array[] = $temp_array;
             unset($temp_array);
             $linked_item = $perspective_item_list->getNext();
         }
         $this->_form->addNetNavigationContent($type, $item_array, '', '', false, false, false, $type);
     } else {
         $this->_setLinkListForConnectedRubric($type);
     }
 }
Beispiel #17
0
 /** get the description of the item
  * this method returns the item description in the right formatted style
  *
  * @return string title
  *
  * @author CommSy Development Group
  */
 function _getDescription($item, $module)
 {
     $len = 40;
     $description = $item->getDescription();
     if (empty($description)) {
         $description = '&nbsp;';
     } elseif (mb_strlen($description) > $len) {
         $description = chunkText($this->_cleanDataFromTextArea($description), $len) . ' ... ';
         $params = array();
         $params['iid'] = $item->getItemID();
         $description .= '(' . ahref_curl($this->_environment->getCurrentContextID(), $module, 'detail', $params, $this->_translator->getMessage('COMMON_MORE')) . ')';
         unset($params);
     } else {
         $description = $this->_cleanDataFromTextArea($item->getDescription());
     }
     return $this->_text_as_html_short($description);
 }
 /** get the single entry of the list view as HTML
  * this method returns the single entry in HTML-Code
  *
  * @returns string $item as HMTL
  *
  * @param cs_material_item material     the single list entry
  */
 function _getItemAsHTML($item, $version_id = NULL, $with_links = TRUE)
 {
     $context_item = $this->_environment->getCurrentContextItem();
     $html = LF . '<!-- BEGIN OF MATERIAL ITEM DETAIL -->' . LF;
     $html .= $this->_getPluginInfosForMaterialDetailAsHTML();
     $formal_data1 = array();
     $bib_kind = $item->getBibKind() ? $item->getBibKind() : 'none';
     $biblio = '';
     // Author, Year
     $temp_array = array();
     /*      $author = $item->getAuthor();
           if ($bib_kind =='none' and !empty($author)){
              $temp_array[0]  = $this->_translator->getMessage('MATERIAL_AUTHORS');
              $temp_array[1]  = $this->_text_as_html_short($item->getAuthor());
              $formal_data1[] = $temp_array;
              $temp_array = array();
              $old_bibtext = $item->getBibliographicValues();
              if( !empty($old_bibtext) ){
                 $temp_array[0]  = $this->_translator->getMessage('MATERIAL_PUBLISHING_DATE');
                 $temp_array[1]  = $this->_text_as_html_long($item->getPublishingDate());
                 $formal_data1[] = $temp_array;
                 $temp_array = array();
                 $temp_array[0]  = $this->_translator->getMessage('MATERIAL_BIBLIOGRAPHIC');
                 $temp_array[1]  = $this->_text_as_html_long($item->getBibliographicValues());
                 $formal_data1[] = $temp_array;
                 $temp_array = array();
              }
           }else
           */
     if ($bib_kind == 'common') {
         $author = $item->getAuthor();
         $formal_data1 = array();
         if (!empty($author)) {
             $temp_array[0] = $this->_translator->getMessage('MATERIAL_AUTHORS');
             $temp_array[1] = $this->_text_as_html_short($this->_compareWithSearchText($item->getAuthor()));
             $formal_data1[] = $temp_array;
         }
         $pub_date = $item->getPublishingDate();
         if (!empty($pub_date)) {
             $temp_array[0] = $this->_translator->getMessage('MATERIAL_PUBLISHING_DATE');
             $temp_array[1] = $this->_text_as_html_short($this->_compareWithSearchText($item->getPublishingDate()));
             $formal_data1[] = $temp_array;
         }
         if (!empty($formal_data1)) {
             $html .= $this->_getFormalDataAsHTML($formal_data1);
             if (isset($html_script) and !empty($html_script)) {
                 $html .= $html_script;
             }
         }
         $formal_data1 = array();
         $temp_array = array();
         $biblio = $item->getBibliographicValues();
     } elseif ($bib_kind == 'website') {
         $biblio = $item->getAuthor() . ',';
     } elseif ($bib_kind == 'document') {
         $biblio = '';
     } else {
         $biblio = $item->getAuthor() . ' (' . $item->getPublishingDate() . '). ';
     }
     if ($bib_kind != 'common') {
         // Bibliographic
         switch ($bib_kind) {
             case 'book':
             case 'collection':
                 $biblio .= $item->getAddress() . ': ' . $item->getPublisher();
                 if ($item->getEdition()) {
                     $biblio .= ', ' . $this->_translator->getMessage('MATERIAL_BIB_EDITION', $item->getEdition());
                 }
                 if ($item->getSeries()) {
                     $biblio .= ', ' . $this->_translator->getMessage('MATERIAL_BIB_SERIES', $item->getSeries());
                 }
                 if ($item->getVolume()) {
                     $biblio .= ', ' . $this->_translator->getMessage('MATERIAL_BIB_VOLUME', $item->getVolume());
                 }
                 if ($item->getISBN()) {
                     $biblio .= ', ' . $this->_translator->getMessage('MATERIAL_BIB_ISBN', $item->getISBN());
                 }
                 $biblio .= '.';
                 if ($item->getURL()) {
                     $biblio .= ' ' . $this->_translator->getMessage('MATERIAL_BIB_URL', $item->getURL());
                     if ($item->getURLDate()) {
                         $biblio .= ' (' . $this->_translator->getMessage('MATERIAL_BIB_URL_DATE', $item->getURLDate()) . ')';
                     }
                     $biblio .= '.';
                 }
                 break;
             case 'incollection':
                 $editor = $item->getEditor();
                 if (!empty($editor)) {
                     $biblio .= $this->_translator->getMessage('MATERIAL_BIB_IN') . ': ';
                     $biblio .= $this->_translator->getMessage('MATERIAL_BIB_EDITOR', $item->getEditor()) . ': ';
                 }
                 $biblio .= $item->getBooktitle() . '. ';
                 $biblio .= $item->getAddress() . ': ' . $item->getPublisher();
                 if ($item->getEdition()) {
                     $biblio .= ', ' . $this->_translator->getMessage('MATERIAL_BIB_EDITION', $item->getEdition());
                 }
                 if ($item->getSeries()) {
                     $biblio .= ', ' . $this->_translator->getMessage('MATERIAL_BIB_SERIES', $item->getSeries());
                 }
                 if ($item->getVolume()) {
                     $biblio .= ', ' . $this->_translator->getMessage('MATERIAL_BIB_VOLUME', $item->getVolume());
                 }
                 if ($item->getISBN()) {
                     $biblio .= ', ' . $this->_translator->getMessage('MATERIAL_BIB_ISBN', $item->getISBN());
                 }
                 $biblio .= ', ' . $this->_translator->getMessage('MATERIAL_BIB_PAGES', $item->getPages()) . '.';
                 if ($item->getURL()) {
                     $biblio .= ' ' . $this->_translator->getMessage('MATERIAL_BIB_URL', $item->getURL());
                     if ($item->getURLDate()) {
                         $biblio .= ' (' . $this->_translator->getMessage('MATERIAL_BIB_URL_DATE', $item->getURLDate()) . ')';
                     }
                     $biblio .= '.';
                 }
                 break;
             case 'article':
                 $biblio .= $this->_translator->getMessage('MATERIAL_BIB_IN') . ': ' . $item->getJournal();
                 if ($item->getVolume()) {
                     $biblio .= ', ' . $item->getVolume();
                     if ($item->getIssue()) {
                         $biblio .= ' (' . $item->getIssue() . ')';
                     }
                 } elseif ($item->getIssue()) {
                     $biblio .= ', ' . $item->getIssue();
                 }
                 $biblio .= ', ' . $this->_translator->getMessage('MATERIAL_BIB_PAGES', $item->getPages()) . '. ';
                 $bib2 = '';
                 if ($item->getAddress()) {
                     $bib2 .= $item->getAddress();
                 }
                 if ($item->getPublisher()) {
                     $bib2 .= $bib2 ? ', ' : '';
                     $bib2 .= $item->getPublisher();
                 }
                 if ($item->getISSN()) {
                     $bib2 .= $bib2 ? ', ' : '';
                     $bib2 .= $item->getISSN();
                 }
                 $bib2 .= $bib2 ? '. ' : '';
                 $biblio .= $bib2 ? $bib2 : '';
                 if ($item->getURL()) {
                     $biblio .= ' ' . $this->_translator->getMessage('MATERIAL_BIB_URL', $item->getURL());
                     if ($item->getURLDate()) {
                         $biblio .= ' (' . $this->_translator->getMessage('MATERIAL_BIB_URL_DATE', $item->getURLDate()) . ')';
                     }
                     $biblio .= '.';
                 }
                 break;
             case 'inpaper':
                 $biblio .= $this->_translator->getMessage('MATERIAL_BIB_IN') . ': ' . $item->getJournal();
                 if ($item->getIssue()) {
                     $biblio .= ', ' . $item->getIssue();
                 }
                 $biblio .= ', ' . $this->_translator->getMessage('MATERIAL_BIB_PAGES', $item->getPages()) . '. ';
                 $bib2 = '';
                 if ($item->getAddress()) {
                     $bib2 .= $item->getAddress();
                 }
                 if ($item->getPublisher()) {
                     $bib2 .= $bib2 ? ', ' : '';
                     $bib2 .= $item->getPublisher();
                 }
                 $bib2 .= $bib2 ? '. ' : '';
                 $biblio .= $bib2 ? $bib2 : '';
                 if ($item->getURL()) {
                     $biblio .= ' ' . $this->_translator->getMessage('MATERIAL_BIB_URL', $item->getURL());
                     if ($item->getURLDate()) {
                         $biblio .= ' (' . $this->_translator->getMessage('MATERIAL_BIB_URL_DATE', $item->getURLDate()) . ')';
                     }
                     $biblio .= '.';
                 }
                 break;
             case 'thesis':
                 $temp_Thesis_Kind = mb_strtoupper($item->getThesisKind(), 'UTF-8');
                 switch ($temp_Thesis_Kind) {
                     case 'BACHELOR':
                         $biblio .= $this->_translator->getMessage('MATERIAL_THESIS_BACHELOR') . '. ';
                         break;
                     case 'DIPLOMA':
                         $biblio .= $this->_translator->getMessage('MATERIAL_THESIS_DIPLOMA') . '. ';
                         break;
                     case 'DISSERTATION':
                         $biblio .= $this->_translator->getMessage('MATERIAL_THESIS_DISSERTATION') . '. ';
                         break;
                     case 'EXAM':
                         $biblio .= $this->_translator->getMessage('MATERIAL_THESIS_EXAM') . '. ';
                         break;
                     case 'KIND':
                         $biblio .= $this->_translator->getMessage('MATERIAL_THESIS_KIND') . '. ';
                         break;
                     case 'KIND_DESC':
                         $biblio .= $this->_translator->getMessage('MATERIAL_THESIS_KIND_DESC') . '. ';
                         break;
                     case 'MASTER':
                         $biblio .= $this->_translator->getMessage('MATERIAL_THESIS_MASTER') . '. ';
                         break;
                     case 'OTHER':
                         $biblio .= $this->_translator->getMessage('MATERIAL_THESIS_OTHER') . '. ';
                         break;
                     case 'POSTDOC':
                         $biblio .= $this->_translator->getMessage('MATERIAL_THESIS_POSTDOC') . '. ';
                         break;
                     case 'TERM':
                         $biblio .= $this->_translator->getMessage('MATERIAL_THESIS_TERM') . '. ';
                         break;
                     default:
                         $biblio .= $this->_translator->getMessage('COMMON_MESSAGETAG_ERROR') . ' cs_material_detail_view(446) ';
                         break;
                 }
                 $biblio .= $item->getAddress() . ': ' . $item->getUniversity();
                 if ($item->getFaculty()) {
                     $biblio .= ', ' . $item->getFaculty();
                 }
                 $biblio .= '.';
                 if ($item->getURL()) {
                     $biblio .= ' ' . $this->_translator->getMessage('MATERIAL_BIB_URL', $item->getURL());
                     if ($item->getURLDate()) {
                         $biblio .= ' (' . $this->_translator->getMessage('MATERIAL_BIB_URL_DATE', $item->getURLDate()) . ')';
                     }
                     $biblio .= '.';
                 }
                 break;
             case 'website':
                 $biblio .= ' ' . $this->_translator->getMessage('MATERIAL_BIB_URL', $item->getURL());
                 if ($item->getURLDate()) {
                     $biblio .= ' (' . $this->_translator->getMessage('MATERIAL_BIB_URL_DATE', $item->getURLDate()) . ')';
                 }
                 $biblio .= '.';
                 break;
             case 'manuscript':
                 $biblio .= $item->getBibliographicValues();
                 if ($item->getAddress()) {
                     $biblio .= ' ' . $item->getAddress();
                     $biblio .= '.';
                 }
                 if ($item->getURL()) {
                     $biblio .= ' ' . $this->_translator->getMessage('MATERIAL_BIB_URL', $item->getURL());
                     if ($item->getURLDate()) {
                         $biblio .= ' (' . $this->_translator->getMessage('MATERIAL_BIB_URL_DATE', $item->getURLDate()) . ')';
                     }
                     $biblio .= '.';
                 }
                 break;
                 /** Start Dokumentenverwaltung **/
             /** Start Dokumentenverwaltung **/
             case 'document':
                 $formal_data_bib = array();
                 $html .= $this->_translator->getMessage('MATERIAL_BIB_DOCUMENT_ADMINISTRATION_INFO');
                 if ($item->getDocumentEditor()) {
                     $temp_array = array();
                     $temp_array[] = $this->_translator->getMessage('MATERIAL_BIB_DOCUMENT_EDITOR');
                     $temp_array[] = $item->getDocumentEditor();
                     $formal_data_bib[] = $temp_array;
                 }
                 if ($item->getDocumentMaintainer()) {
                     $temp_array = array();
                     $temp_array[] = $this->_translator->getMessage('MATERIAL_BIB_DOCUMENT_MAINTAINER');
                     $temp_array[] = $item->getDocumentMaintainer();
                     $formal_data_bib[] = $temp_array;
                 }
                 if ($item->getDocumentReleaseNumber()) {
                     $temp_array = array();
                     $temp_array[] = $this->_translator->getMessage('MATERIAL_BIB_DOCUMENT_RELEASE_NUMBER');
                     $temp_array[] = $item->getDocumentReleaseNumber();
                     $formal_data_bib[] = $temp_array;
                 }
                 if ($item->getDocumentReleaseDate()) {
                     $temp_array = array();
                     $temp_array[] = $this->_translator->getMessage('MATERIAL_BIB_DOCUMENT_RELEASE_DATE');
                     $temp_array[] = $item->getDocumentReleaseDate();
                     $formal_data_bib[] = $temp_array;
                 }
                 if (!empty($formal_data_bib)) {
                     $html .= $this->_getFormalDataAsHTML($formal_data_bib);
                 }
                 break;
                 /** Ende Dokumentenverwaltung **/
             /** Ende Dokumentenverwaltung **/
             case 'none':
             default:
                 $biblio .= $item->getBibliographicValues();
         }
     }
     $biblio_pur = strip_tags($biblio);
     $biblio_pur = str_ireplace('&nbsp;', '', $biblio_pur);
     $biblio_pur = trim($biblio_pur);
     if ($bib_kind != 'none' and !empty($biblio_pur)) {
         $temp_array = array();
         $temp_array[] = $this->_translator->getMessage('MATERIAL_BIBLIOGRAPHIC');
         if (!empty($biblio)) {
             $temp_array[] = $this->_text_as_html_long($this->_compareWithSearchText($this->_cleanDataFromTextArea($biblio)));
         } else {
             $temp_array[] = '<span class="disabled">' . $this->_translator->getMessage('COMMON_NONE') . '</span>';
         }
         $formal_data1[] = $temp_array;
     }
     if ($item->issetBibTOC()) {
         $temp_array = array();
         $temp_array[] = $this->_translator->getMessage('COMMON_TABLE_OF_CONTENT');
         $temp_array[] = '<a href="' . $item->getBibTOC() . '" target="blank">' . chunkText($item->getBibTOC(), 60) . '</a>';
         $formal_data1[] = $temp_array;
     }
     if ($item->issetBibURL()) {
         $temp_array = array();
         $temp_array[] = $this->_translator->getMessage('BELUGA_LINK');
         $temp_array[] = '<a href="' . $item->getBibURL() . '" target="blank">' . chunkText($item->getBibURL(), 60) . '</a>';
         $formal_data1[] = $temp_array;
     }
     if ($item->issetBibAvailibility()) {
         $temp_array = array();
         $temp_array[] = $this->_translator->getMessage('BELUGA_AVAILABILITY');
         $link = $item->getBibAvailibility();
         $temp_array[] = $link;
         $formal_data1[] = $temp_array;
     }
     if ($context_item->isWikiActive()) {
         if ($item->isExportToWiki()) {
             $temp_array = array();
             $temp_array[] = $this->_translator->getMessage('MATERIAL_EXPORT_TO_WIKI_LINK');
             $temp_array[] = $item->getExportToWikiLink();
             $formal_data1[] = $temp_array;
         }
     }
     if ($context_item->isWordpressActive()) {
         if ($item->isExportToWordpress()) {
             $temp_array = array();
             $temp_array[] = $this->_translator->getMessage('MATERIAL_EXPORT_TO_WORDPRESS_LINK');
             $temp_array[] = $item->getExportToWordpressLink();
             $formal_data1[] = $temp_array;
         }
     }
     // Sections
     $this->_section_list = $item->getSectionList();
     if (!$this->_section_list->isEmpty()) {
         $temp_array = array();
         $temp_array[] = $this->_translator->getMessage('MATERIAL_ABSTRACT');
         $description = $item->getDescription();
         if (!empty($description)) {
             $temp_string = $this->_text_as_html_long($this->_cleanDataFromTextArea($this->_compareWithSearchText($description)));
             $temp_array[] = '<div class="handle_width">' . $this->_show_images($temp_string, $this->_item, $with_links) . '</div>' . '<br/><br/>';
         } else {
             $temp_array[] = '<span class="disabled">' . $this->_translator->getMessage('COMMON_NONE') . '</span>';
         }
         $formal_data1[] = $temp_array;
         $sections = array();
         $i = 1;
         $section = $this->_section_list->getFirst();
         while ($section) {
             // files
             $fileicons = $this->_getItemFiles($section, true);
             if (!empty($fileicons)) {
                 $fileicons = '&nbsp;' . $fileicons;
             }
             $section_title = $this->_text_as_html_short($this->_compareWithSearchText($section->getTitle()));
             if ($with_links and !(isset($_GET['mode']) and $_GET['mode'] == 'print')) {
                 $section_title = '<a href="#anchor' . $section->getItemID() . '">' . $section_title . '</a>' . $fileicons . LF;
             }
             $sections[] = $section_title;
             $section = $this->_section_list->getNext();
             $i++;
         }
         $temp_array = array();
         $temp_array[] = $this->_translator->getMessage('MATERIAL_SECTIONS');
         $temp_array[] = implode(BRLF, $sections) . '<br/><br/>';
         $formal_data1[] = $temp_array;
     }
     // Files
     $files = $this->_getFilesForFormalData($item);
     if (!empty($files)) {
         $temp_array = array();
         $temp_array[] = $this->_translator->getMessage('MATERIAL_FILES');
         $temp_array[] = implode(BRLF, $files);
         $formal_data1[] = $temp_array;
     }
     // World-public status
     $current_context = $this->_environment->getCurrentContextItem();
     if ($current_context->isCommunityRoom() and $current_context->isOpenForGuests()) {
         $temp_array = array();
         $world_public = $item->getWorldPublic();
         if ($world_public == 0) {
             $public_info = $this->_translator->getMessage('MATERIAL_WORLD_PUBLISH_STATUS_0');
         } elseif ($world_public == 1) {
             $public_info = $this->_translator->getMessage('MATERIAL_WORLD_PUBLISH_STATUS_1');
         } elseif ($world_public == 2) {
             $public_info = $this->_translator->getMessage('MATERIAL_WORLD_PUBLISH_STATUS_2');
         }
         $temp_array[0] = $this->_translator->getMessage('MATERIAL_WORLD_PUBLISH');
         $temp_array[1] = $public_info;
         $formal_data1[] = $temp_array;
     }
     $version_mode = 'long';
     $iid = 0;
     $params = $this->_environment->getCurrentParameterArray();
     if (isset($params['iid'])) {
         $iid = $params['iid'];
     }
     $params = array();
     $params = array();
     $params = $this->_environment->getCurrentParameterArray();
     $show_versions = 'false';
     if (isset($params[$iid . 'version_mode']) and $params[$iid . 'version_mode'] == 'long') {
         $show_versions = 'true';
     }
     $params[$iid . 'version_mode'] = 'long';
     // Versions
     $versions = array();
     if (!$this->_version_list->isEmpty()) {
         $version = $this->_version_list->getFirst();
         if ($version->getVersionID() == $this->_item->getVersionID()) {
             $title = '&nbsp;&nbsp;' . $this->_translator->getMessage('MATERIAL_CURRENT_VERSION_DATE') . ' ' . getDateTimeInLang($version->getModificationDate());
         } else {
             $params = array();
             $params[$iid . 'version_mode'] = 'long';
             $params['iid'] = $version->getItemID();
             $title = '&nbsp;&nbsp;' . ahref_curl($this->_environment->getCurrentContextID(), 'material', 'detail', $params, $this->_translator->getMessage('MATERIAL_CURRENT_VERSION_DATE') . ' ' . getDateTimeInLang($version->getModificationDate()));
             unset($params);
         }
         $version = $this->_version_list->getNext();
         $current_user = $this->_environment->getCurrentUserItem();
         $is_user = $current_user->isUser();
         while ($version) {
             if (!$with_links or !$is_user and $this->_environment->inCommunityRoom() and !$version->isWorldPublic() or $item->getVersionID() == $version->getVersionID()) {
                 $versions[] = '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . $this->_translator->getMessage('MATERIAL_VERSION_DATE') . ' ' . getDateTimeInLang($version->getModificationDate());
             } else {
                 $params = array();
                 $params[$iid . 'version_mode'] = 'long';
                 $params['iid'] = $version->getItemID();
                 $params['version_id'] = $version->getVersionID();
                 $versions[] = '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . ahref_curl($this->_environment->getCurrentContextID(), 'material', 'detail', $params, $this->_translator->getMessage('MATERIAL_VERSION_DATE') . ' ' . getDateTimeInLang($version->getModificationDate()));
                 unset($params);
             }
             $version = $this->_version_list->getNext();
         }
         $count = $this->_version_list->getCount();
         if (!empty($versions) and $count > 1) {
             $temp_array = array();
             $temp_array[] = $this->_translator->getMessage('MATERIAL_VERSION');
             $html_string = '&nbsp;<img id="toggle' . $item->getItemID() . $item->getVersionID() . '" src="images/more.gif"/>';
             $html_string .= $title;
             $html_string .= '<div id="creator_information' . $item->getItemID() . $item->getVersionID() . '">' . LF;
             $html_string .= '<div class="creator_information_panel">     ' . LF;
             $html_string .= '<div>' . LF;
             if ($show_versions == 'true') {
                 $html_script = '<script type="text/javascript">initCreatorInformations("' . $item->getItemID() . $item->getVersionID() . '",true)</script>';
             } else {
                 $html_script = '<script type="text/javascript">initCreatorInformations("' . $item->getItemID() . $item->getVersionID() . '",false)</script>';
             }
             if ($with_links) {
                 $html_string .= implode(BRLF, $versions);
             } else {
                 $version_count = count($versions);
                 $html_string .= "{$version_count}. " . $versions[0];
             }
             $html_string .= '</div>' . LF;
             $html_string .= '</div>' . LF;
             $html_string .= '</div>' . LF;
             $temp_array[] = $html_string;
             $formal_data1[] = $temp_array;
         }
     }
     if (!empty($formal_data1)) {
         $html .= $this->_getFormalDataAsHTML($formal_data1);
         if (isset($html_script) and !empty($html_script)) {
             $html .= $html_script;
         }
     }
     if ($this->_section_list->isEmpty()) {
         // Description
         $desc = $item->getDescription();
         if (!empty($desc)) {
             $temp_string = $this->_text_as_html_long($this->_compareWithSearchText($this->_cleanDataFromTextArea($desc)));
             $html .= $this->getScrollableContent($temp_string, $item, '', $with_links);
         }
     }
     $html .= '<!-- END OF material ITEM DETAIL -->' . LF . LF;
     return $html;
 }
Beispiel #19
0
/** returns an URL that is x characters at the most
 *  special needed for _activate_urls in cs_view.php
 *  in a preg_replace_callback - function
 *
 * @param array from preg_replace_function
 *
 * @return text for replacement in preg_replace_function
 */
function spezial_chunkURL($text)
{
    // ------------------
    // --->UTF8 - OK<----
    // ------------------
    $text = $text[1];
    $text = chunkText($text, 45);
    return '">' . $text . '</a>';
}
Beispiel #20
0
 /** get the email of the item
  * this method returns the item email in the right formatted style
  *
  * @return string email
  */
 function _getItemEmail($item)
 {
     $email = $item->getEmail();
     $email_text = $this->_compareWithSearchText($email);
     if (!$this->isPrintableView()) {
         $email = curl_mailto($item->getEmail(), $this->_text_as_html_short(chunkText($email_text, 40)));
     }
     return $email;
 }
Beispiel #21
0
 function _getLogoAsHTML()
 {
     $html = '';
     $logo_filename = '';
     $context_item = $this->_environment->getCurrentContextItem();
     $current_user = $this->_environment->getCurrentUserItem();
     $html .= '<table summary="layout" style="padding:0px; border-collapse:collapse;">' . LF;
     $html .= '<tr>' . LF;
     if ($this->_environment->inCommunityRoom() or $this->_environment->inProjectRoom() or $this->_environment->inPrivateRoom() or $this->_environment->inGroupRoom()) {
         $logo_filename = $context_item->getLogoFilename();
         if (!empty($logo_filename)) {
             $params = array();
             $params['picture'] = $context_item->getLogoFilename();
             $curl = curl($this->_environment->getCurrentContextID(), 'picture', 'getfile', $params, '');
             unset($params);
             $html .= '<td style="padding:0px; height:55px; width:10%;">' . LF;
             $html .= '<div class="logo" style="vertical-align:top; padding:5px 5px 0px 0px; margin:0px;">' . LF;
             $html .= '     <img style="height:45px; padding: 0px; margin:0px;" src="' . $curl . '" alt="' . $this->_translator->getMessage('COMMON_LOGO') . '" border="0"/>' . LF;
             $html .= '</div>' . LF;
             $html .= '</td>' . LF;
             $html .= '<td style="vertical-align:middle; padding: 5px 0px 0px 0px;">' . LF;
         } else {
             $html .= '<td colspan="2" style="height:55px; vertical-align:middle; padding:0px;">' . LF;
         }
     } else {
         $html .= '<td colspan="2" style="height:55px; border:1px solid green; vertical-align:bottom; padding:5px 0px 0px 0px;">' . LF;
     }
     $length = mb_strlen($context_item->getTitle());
     $title = $context_item->getTitle();
     if ($length < 25) {
         $size = 'style="font-size:24pt; vertical-align:bottom; padding:5px 0px 0px 0px; margin:0px;"';
     } elseif ($length < 30) {
         $size = 'style="font-size:20pt;"';
     } elseif ($length < 35) {
         $size = 'style=" font-size:18pt;"';
     } elseif ($length < 40) {
         $size = 'style="font-size:16pt;"';
     } elseif ($length < 50) {
         $size = 'style="font-size:12pt;"';
     } else {
         $size = 'style="font-size:12pt;"';
         $title = chunkText($title, 50);
     }
     if ($context_item->showTitle()) {
         $html .= '<h1 ' . $size . '>' . $this->_text_as_html_short($title) . '</h1>' . LF;
     } else {
         $html .= '<h1 ' . $size . '>' . '&nbsp;' . '</h1>' . LF;
     }
     $html .= '</td>' . LF;
     $html .= '</tr>' . LF;
     $authentication = $this->_environment->getAuthenticationObject();
     $external_view = false;
     if (isset($_GET['iid'])) {
         $current_user = $this->_environment->getCurrentUserItem();
         $external_view = $authentication->_isExternalUserAllowedToSee($current_user->getUserID(), $_GET['iid']);
     }
     if (!isset($this->_with_navigation_links) or $this->_with_navigation_links or $external_view) {
         $html .= '<tr class="header_room_path">' . LF;
         $html .= '<td colspan="2" style="padding:0px; margin:0px; vertical-align:bottom;">' . LF;
         $breadcrump = '';
         $params = array();
         if ($current_user->isRoot()) {
             $server_item = $this->_environment->getServerItem();
             $breadcrump .= ahref_curl($server_item->getItemID(), 'home', 'index', $params, $this->_text_as_html_short($server_item->getTitle()), '', '', '', '', '', '', 'style="color:#800000"');
             $breadcrump .= ' &gt; ';
         }
         $portal_item = $this->_environment->getCurrentPortalItem();
         if ($this->_environment->inProjectRoom() or $this->_environment->inCommunityRoom()) {
             $params['room_id'] = $context_item->getItemID();
         }
         $breadcrump .= ahref_curl($portal_item->getItemID(), 'home', 'index', $params, $this->_text_as_html_short($portal_item->getTitle()), '', '', '', '', '', '', 'style="color:#800000"');
         if ($this->_environment->inProjectRoom()) {
             $community_list = $context_item->getCommunityList();
             $community_item = $community_list->getFirst();
             if (!empty($community_item)) {
                 $breadcrump .= ' &gt; ' . ahref_curl($community_item->getItemID(), 'home', 'index', '', $this->_text_as_html_short($community_item->getTitle()), '', '', '', '', '', '', 'style="color:#800000"');
             }
             $breadcrump .= ' &gt; ' . chunkText($this->_text_as_html_short($context_item->getTitle()), 50);
         } elseif ($this->_environment->inGroupRoom()) {
             $project_item = $context_item->getLinkedProjectItem();
             $community_list = $project_item->getCommunityList();
             $community_item = $community_list->getFirst();
             if (!empty($community_item)) {
                 $breadcrump .= ' &gt; ' . ahref_curl($community_item->getItemID(), 'home', 'index', '', $this->_text_as_html_short($community_item->getTitle()), '', '', '', '', '', '', 'style="color:#800000"');
             }
             $breadcrump .= ' &gt; ' . ahref_curl($project_item->getItemID(), 'home', 'index', '', $this->_text_as_html_short($project_item->getTitle()), '', '', '', '', '', '', 'style="color:#800000"');
             $breadcrump .= ' &gt; ' . chunkText($this->_text_as_html_short($context_item->getTitle()), 50);
         } elseif ($this->_environment->inCommunityRoom() or $this->_environment->inPrivateRoom()) {
             $breadcrump .= ' &gt; ' . chunkText($this->_text_as_html_short($context_item->getTitle()), 50);
         }
         $html .= '<span style="height: 20px;font-size:8pt; font-weight:normal;">' . $breadcrump . '</span>' . BRLF;
         $html .= '</td>' . LF;
         $html .= '</tr>' . LF;
     }
     $html .= '</table>' . LF;
     return $html;
 }
 private function _getDateSelectionsAsHTML()
 {
     $html = LF;
     $assignment = $this->getSelectedAssignment(CS_DATE_TYPE);
     $status = $this->getSelectedStatus(CS_DATE_TYPE);
     $room = $this->getSelectedRoom(CS_DATE_TYPE);
     $color = $this->getSelectedColor(CS_DATE_TYPE);
     $search = $this->getSearchText(CS_DATE_TYPE);
     if (!empty($assignment) and $assignment != 2 or !empty($status) and $status != 2 or !empty($room) and $room != 2 or !empty($color) and $color != 2 or !empty($search) and $search != $this->_translator->getMessage('COMMON_SEARCH_IN_ROOM') and $search != $this->_translator->getMessage('COMMON_SEARCH_IN_ENTRIES')) {
         $html .= '<div id="contentbox" class="portlet-content">' . LF;
         $html .= '<table class="description-background" style="width:100%;">' . LF;
         //         $html .= '<tr>'.LF;
         //         $html .= '<td style="vertical-align:top;">'.LF;
         //         $html .= $this->_translator->getMessage('COMMON_PAGETITLE_CONFIGURATION').': '.LF;
         //         $html .= '</td>'.LF;
         //         $html .= '</tr>'.LF;
         //         $current_context = $this->_environment->getCurrentContextItem();
         //         $mycalendar_conf = $current_context->getMyCalendarDisplayConfig();
         //         $room_manager = $this->_environment->getRoomManager();
         //         foreach($mycalendar_conf as $entry) {
         //            $exp_entry = explode('_', $entry);
         //            if(sizeof($exp_entry) == 2) {
         //               if($exp_entry[1] == 'dates') {
         //                  $room_id = $exp_entry[0];
         //                  $conf_room = $room_manager->getItem($room_id);
         //
         //                  $html .= '<tr>'.LF;
         //                  $html .= '<td style="text-align:right;">'.LF;
         //                  $html .= $conf_room->getTitle() . LF;
         //                  $html .= '</td>' . LF;
         //                  $html .= '</tr>' . LF;
         //               }
         //            }
         //         }
         //         unset($room_manager);
         $html .= '<tr>' . LF;
         $html .= '<td style="vertical-align:top;">' . LF;
         $html .= $this->_translator->getMessage('COMMON_RESTRICTIONS_SHORT') . ': ' . LF;
         $html .= '</td>' . LF;
         $html .= '</tr>' . LF;
         if (!empty($assignment) and $assignment != 2) {
             $html .= '<tr>' . LF;
             $html .= '<td style="text-align:right;">' . LF;
             if ($assignment == 3) {
                 $html .= $this->_translator->getMessage('PRIVATEROOM_ASSIGNED_TO_ME');
                 $new_aparams = $this->_environment->getCurrentParameterArray();
                 $new_aparams['selassignment'] = 2;
                 $image = '<img src="images/delete_restriction.gif" style="padding-top:3px;" alt="' . $this->_translator->getMessage('ENTRY_DELETE_RESTRICTION') . '"/>' . LF;
                 $html .= ' ' . ahref_curl($this->_environment->getCurrentContextID(), CS_DATE_TYPE, 'index', $new_aparams, $image, $this->_translator->getMessage('ENTRY_DELETE_RESTRICTION')) . LF;
             }
             $html .= '</td>' . LF;
             $html .= '</tr>' . LF;
         }
         if (!empty($room) and $room != 2) {
             $html .= '<tr>' . LF;
             $html .= '<td style="text-align:right;">' . LF;
             if ($this->_environment->getCurrentContextID() == $room) {
                 $html .= $this->_translator->getMessage('COMMON_FOREIGN_ROOM');
             } else {
                 $room_manager = $this->_environment->getRoomManager();
                 $room_item = $room_manager->getItem($room);
                 if (!empty($room_item)) {
                     $html .= encode(AS_HTML_SHORT, chunkText($room_item->getTitle(), 20));
                     unset($room_item);
                 }
                 unset($room_manager);
             }
             $new_aparams = $this->_environment->getCurrentParameterArray();
             $new_aparams['selroom'] = 2;
             $image = '<img src="images/delete_restriction.gif" style="padding-top:3px;" alt="' . $this->_translator->getMessage('ENTRY_DELETE_RESTRICTION') . '"/>' . LF;
             $html .= ' ' . ahref_curl($this->_environment->getCurrentContextID(), CS_DATE_TYPE, 'index', $new_aparams, $image, $this->_translator->getMessage('ENTRY_DELETE_RESTRICTION')) . LF;
             $html .= '</td>' . LF;
             $html .= '</tr>' . LF;
         }
         if (!empty($color) and $color != 2) {
             $html .= '<tr>' . LF;
             $html .= '<td style="text-align:right;">' . LF;
             $html .= $this->_translator->getMessage('COMMON_DATE_COLOR');
             $color_text = '';
             switch ('#' . $color) {
                 case '#999999':
                     $color_text = getMessage('DATE_COLOR_GREY');
                     break;
                 case '#CC0000':
                     $color_text = getMessage('DATE_COLOR_RED');
                     break;
                 case '#FF6600':
                     $color_text = getMessage('DATE_COLOR_ORANGE');
                     break;
                 case '#FFCC00':
                     $color_text = getMessage('DATE_COLOR_DEFAULT_YELLOW');
                     break;
                 case '#FFFF66':
                     $color_text = getMessage('DATE_COLOR_LIGHT_YELLOW');
                     break;
                 case '#33CC00':
                     $color_text = getMessage('DATE_COLOR_GREEN');
                     break;
                 case '#00CCCC':
                     $color_text = getMessage('DATE_COLOR_TURQUOISE');
                     break;
                 case '#3366FF':
                     $color_text = getMessage('DATE_COLOR_BLUE');
                     break;
                 case '#6633FF':
                     $color_text = getMessage('DATE_COLOR_DARK_BLUE');
                     break;
                 case '#CC33CC':
                     $color_text = getMessage('DATE_COLOR_PURPLE');
                     break;
                 default:
                     $color_text = getMessage('DATE_COLOR_UNKNOWN');
             }
             $html .= ' ' . $color_text . LF;
             $new_aparams = $this->_environment->getCurrentParameterArray();
             $new_aparams['selcolor'] = 2;
             $image = '<img src="images/delete_restriction.gif" style="padding-top:3px;" alt="' . $this->_translator->getMessage('ENTRY_DELETE_RESTRICTION') . '"/>' . LF;
             $html .= ' ' . ahref_curl($this->_environment->getCurrentContextID(), CS_DATE_TYPE, 'index', $new_aparams, $image, $this->_translator->getMessage('ENTRY_DELETE_RESTRICTION')) . LF;
             $html .= '</td>' . LF;
             $html .= '</tr>' . LF;
         }
         if (!empty($status) and $status != 2) {
             $html .= '<tr>' . LF;
             $html .= '<td style="text-align:right;">' . LF;
             if ($status == 3) {
                 $html .= $this->_translator->getMessage('DATES_PUBLIC');
             } elseif ($status == 4) {
                 $html .= $this->_translator->getMessage('DATES_NON_PUBLIC');
             }
             $new_aparams = $this->_environment->getCurrentParameterArray();
             $new_aparams['selstatus'] = 2;
             $image = '<img src="images/delete_restriction.gif" style="padding-top:3px;" alt="' . $this->_translator->getMessage('ENTRY_DELETE_RESTRICTION') . '"/>' . LF;
             $html .= ' ' . ahref_curl($this->_environment->getCurrentContextID(), CS_DATE_TYPE, 'index', $new_aparams, $image, $this->_translator->getMessage('ENTRY_DELETE_RESTRICTION')) . LF;
             $html .= '</td>' . LF;
             $html .= '</tr>' . LF;
         }
         if (!empty($search) and $search != $this->_translator->getMessage('COMMON_SEARCH_IN_ROOM') and $search != $this->_translator->getMessage('COMMON_SEARCH_IN_ENTRIES')) {
             $html .= '<tr>' . LF;
             $html .= '<td style="text-align:right;">' . LF;
             $html .= encode(AS_HTML_SHORT, $search);
             $new_aparams = $this->_environment->getCurrentParameterArray();
             unset($new_aparams['search']);
             $image = '<img src="images/delete_restriction.gif" style="padding-top:3px;" alt="' . $this->_translator->getMessage('ENTRY_DELETE_RESTRICTION') . '"/>' . LF;
             $html .= ' ' . ahref_curl($this->_environment->getCurrentContextID(), CS_DATE_TYPE, 'index', $new_aparams, $image, $this->_translator->getMessage('ENTRY_DELETE_RESTRICTION')) . LF;
             $html .= '</td>' . LF;
             $html .= '</tr>' . LF;
         }
         $html .= '</table>' . LF;
         $html .= '</div>' . LF;
     }
     return $html;
 }
Beispiel #23
0
 function _getItemEmail($item)
 {
     if ($item->isEmailVisible()) {
         $email = $item->getEmail();
         $email_text = $email;
         $email = curl_mailto($item->getEmail(), $this->_text_as_html_short(chunkText($email_text, 27)));
     } else {
         $email = '<span class="disabled">' . $this->_translator->getMessage('USER_EMAIL_HIDDEN') . '</span>';
     }
     return $email;
 }
Beispiel #24
0
 public function getListContent()
 {
     $session = $this->_environment->getSessionItem();
     include_once 'classes/cs_list.php';
     include_once 'classes/views/cs_view.php';
     $environment = $this->_environment;
     $translator = $environment->getTranslationObject();
     $context_item = $environment->getCurrentContextItem();
     $current_user = $environment->getCurrentUser();
     $converter = $environment->getTextConverter();
     $home_rubric_limit = CS_HOME_RUBRIC_LIST_LIMIT;
     $id_array = array();
     $v_id_array = array();
     $sub_id_array = array();
     $disc_id_array = array();
     $rubrics = $this->getRubrics();
     $rubric_list = array();
     $rubric_list_array = array();
     // determe rubrics to show on home list
     foreach ($rubrics as $rubric) {
         list($rubric_name, $postfix) = explode('_', $rubric);
         // continue if postfix is none or nodisplay
         if ($postfix === 'none' || $postfix === 'nodisplay') {
             continue;
         }
         // TODO: where does activity come from?
         // continue if name of rubric is activity
         if ($rubric_name === 'activity') {
             continue;
         }
         // store hidden state
         $return[$rubric_name]['hidden'] = $postfix === 'short' ? false : true;
         // check rights
         if ($current_user->isUser() && $this->_with_modifying_actions && $rubric_name != CS_USER_TYPE) {
             $return[$rubric_name]['rights']['new'] = true;
         } else {
             $return[$rubric_name]['rights']['new'] = false;
         }
         $rubric_list[] = $rubric_name;
         $list = new cs_list();
         $rubric = '';
         switch ($rubric_name) {
             case CS_ANNOUNCEMENT_TYPE:
                 $manager = $environment->getAnnouncementManager();
                 $manager->reset();
                 $manager->setContextLimit($environment->getCurrentContextID());
                 $count_all = $manager->getCountAll();
                 $manager->setDateLimit(getCurrentDateTimeInMySQL());
                 $manager->setSortOrder('modified');
                 $manager->showNoNotActivatedEntries();
                 $count_select = $manager->getCountAll();
                 $manager->setIntervalLimit(0, $home_rubric_limit);
                 if ($home_rubric_limit < $count_select) {
                     $home_rubric_limit = CS_HOME_RUBRIC_LIST_LIMIT;
                 }
                 $manager->select();
                 $list = $manager->get();
                 break;
             case CS_DATE_TYPE:
                 $manager = $environment->getDatesManager();
                 $manager->reset();
                 $manager->setContextLimit($environment->getCurrentContextID());
                 $manager->setDateModeLimit(2);
                 $count_all = $manager->getCountAll();
                 $manager->setFutureLimit();
                 $manager->setDateModeLimit(3);
                 $manager->showNoNotActivatedEntries();
                 $count_select = $manager->getCountAll();
                 $manager->setIntervalLimit(0, $home_rubric_limit);
                 if ($home_rubric_limit < $count_select) {
                     $home_rubric_limit = CS_HOME_RUBRIC_LIST_LIMIT;
                 }
                 $manager->select();
                 $list = $manager->get();
                 $rubric = 'dates';
                 break;
             case CS_PROJECT_TYPE:
                 $room_type = CS_PROJECT_TYPE;
                 $manager = $environment->getProjectManager();
                 $manager->reset();
                 $manager->setContextLimit($environment->getCurrentPortalID());
                 if (!isset($c_cache_cr_pr) or !$c_cache_cr_pr) {
                     $manager->setCommunityRoomLimit($environment->getCurrentContextID());
                 } else {
                     # use redundant infos in community room
                     $manager->setIDArrayLimit($context_item->getInternalProjectIDArray());
                 }
                 $count_all = $manager->getCountAll();
                 $manager->setSortOrder('activity_rev');
                 if ($count_all > 10) {
                     $manager->setIntervalLimit(0, 10);
                 }
                 $manager->select();
                 $list = $manager->get();
                 break;
             case CS_GROUP_TYPE:
                 $manager = $environment->getGroupManager();
                 $manager->reset();
                 $manager->setContextLimit($environment->getCurrentContextID());
                 $manager->select();
                 $list = $manager->get();
                 $count_all = $list->getCount();
                 break;
             case CS_TODO_TYPE:
                 $manager = $environment->getTodoManager();
                 $manager->reset();
                 $manager->setContextLimit($environment->getCurrentContextID());
                 $count_all = $manager->getCountAll();
                 $manager->setStatusLimit(4);
                 $manager->setSortOrder('date');
                 $manager->showNoNotActivatedEntries();
                 $count_select = $manager->getCountAll();
                 $manager->setIntervalLimit(0, $home_rubric_limit);
                 if ($home_rubric_limit < $count_select) {
                     $home_rubric_limit = CS_HOME_RUBRIC_LIST_LIMIT;
                 }
                 $manager->select();
                 $list = $manager->get();
                 $item = $list->getFirst();
                 $tmp_id_array = array();
                 while ($item) {
                     $tmp_id_array[] = $item->getItemID();
                     $item = $list->getNext();
                 }
                 $step_manager = $environment->getStepManager();
                 $step_list = $step_manager->getAllStepItemListByIDArray($tmp_id_array);
                 $item = $step_list->getFirst();
                 while ($item) {
                     $sub_id_array[] = $item->getItemID();
                     $item = $step_list->getNext();
                 }
                 unset($step_list);
                 unset($step_manager);
                 unset($manager);
                 break;
             case CS_TOPIC_TYPE:
                 $manager = $environment->getTopicManager();
                 $manager->reset();
                 $manager->setContextLimit($environment->getCurrentContextID());
                 $manager->showNoNotActivatedEntries();
                 $manager->select();
                 $list = $manager->get();
                 $count_all = $list->getCount();
                 break;
             case CS_INSTITUTION_TYPE:
                 $manager = $environment->getInstitutionManager();
                 $manager->reset();
                 $manager->setContextLimit($environment->getCurrentContextID());
                 $manager->select();
                 $list = $manager->get();
                 $count_all = $list->getCount();
                 break;
             case CS_USER_TYPE:
                 $manager = $environment->getUserManager();
                 $manager->reset();
                 $manager->setContextLimit($environment->getCurrentContextID());
                 $manager->setUserLimit();
                 $count_all = $manager->getCountAll();
                 if (!$current_user->isGuest()) {
                     $manager->setVisibleToAllAndCommsy();
                 } else {
                     $manager->setVisibleToAll();
                 }
                 $manager->setAgeLimit($context_item->getTimeSpread());
                 $manager->select();
                 $list = $manager->get();
                 break;
             case CS_MATERIAL_TYPE:
                 #	                        $short_list_view = $class_factory->getClass(MATERIAL_SHORT_VIEW,$param_class_array);
                 $manager = $environment->getMaterialManager();
                 $manager->reset();
                 $manager->create_tmp_table($environment->getCurrentContextID());
                 $manager->setContextLimit($environment->getCurrentContextID());
                 $count_all = $manager->getCountAll();
                 $manager->setOrder('date');
                 if ($environment->inProjectRoom()) {
                     $manager->setAgeLimit($context_item->getTimeSpread());
                 } else {
                     $manager->setIntervalLimit(0, 5);
                     $home_rubric_limit = 5;
                 }
                 $manager->showNoNotActivatedEntries();
                 $count_select = $manager->getCountAll();
                 $manager->setIntervalLimit(0, $home_rubric_limit);
                 $home_rubric_limit = CS_HOME_RUBRIC_LIST_LIMIT;
                 if ($home_rubric_limit < $count_select) {
                     $home_rubric_limit = CS_HOME_RUBRIC_LIST_LIMIT;
                 }
                 $manager->select();
                 $list = $manager->get();
                 $manager->delete_tmp_table();
                 $item = $list->getFirst();
                 $tmp_id_array = array();
                 while ($item) {
                     $tmp_id_array[] = $item->getItemID();
                     $item = $list->getNext();
                 }
                 $section_manager = $environment->getSectionManager();
                 $section_list = $section_manager->getAllSectionItemListByIDArray($tmp_id_array);
                 $item = $section_list->getFirst();
                 while ($item) {
                     $sub_id_array[] = $item->getItemID();
                     $v_id_array[$item->getItemID()] = $item->getVersionID();
                     $item = $section_list->getNext();
                 }
                 break;
             case CS_DISCUSSION_TYPE:
                 $manager = $environment->getDiscussionManager();
                 $manager->reset();
                 $manager->setContextLimit($environment->getCurrentContextID());
                 $count_all = $manager->getCountAll();
                 if ($environment->inProjectRoom() or $environment->inGroupRoom()) {
                     $manager->setAgeLimit($context_item->getTimeSpread());
                 } elseif ($environment->inCommunityRoom()) {
                     $manager->setIntervalLimit(0, 5);
                     $home_rubric_limit = 5;
                 }
                 $manager->showNoNotActivatedEntries();
                 $count_select = $manager->getCountAll();
                 $manager->setIntervalLimit(0, $home_rubric_limit);
                 $home_rubric_limit = CS_HOME_RUBRIC_LIST_LIMIT;
                 if ($home_rubric_limit < $count_select) {
                     $home_rubric_limit = CS_HOME_RUBRIC_LIST_LIMIT;
                 }
                 $manager->select();
                 $list = $manager->get();
                 $item = $list->getFirst();
                 $disc_id_array = array();
                 while ($item) {
                     $disc_id_array[] = $item->getItemID();
                     $item = $list->getNext();
                 }
                 $discarticle_manager = $environment->getDiscussionArticleManager();
                 $discarticle_list = $discarticle_manager->getAllDiscArticlesItemListByIDArray($disc_id_array);
                 $item = $discarticle_list->getFirst();
                 while ($item) {
                     $disc_id_array[] = $item->getItemID();
                     $item = $discarticle_list->getNext();
                 }
                 break;
         }
         $rubric_list_array[$rubric_name] = $list;
         $rubric_count_all_array[$rubric_name] = $count_all;
         $tmp = $list->getFirst();
         $ids = array();
         while ($tmp) {
             $id_array[] = $tmp->getItemID();
             if ($rubric_name == CS_MATERIAL_TYPE) {
                 $v_id_array[$tmp->getItemID()] = $tmp->getVersionID();
             }
             $ids[] = $tmp->getItemID();
             $tmp = $list->getNext();
         }
         if (empty($rubric)) {
             $session->setValue('cid' . $environment->getCurrentContextID() . '_' . $rubric_name . '_index_ids', $ids);
         } else {
             $session->setValue('cid' . $environment->getCurrentContextID() . '_' . $rubric . '_index_ids', $ids);
         }
     }
     $noticed_manager = $environment->getNoticedManager();
     $id_array = array_merge($id_array, $disc_id_array);
     $id_array = array_merge($id_array, $sub_id_array);
     $noticed_manager->getLatestNoticedByIDArray($id_array);
     $noticed_manager->getLatestNoticedAnnotationsByIDArray($id_array);
     $link_manager = $environment->getLinkManager();
     $file_id_array = $link_manager->getAllFileLinksForListByIDs($id_array, $v_id_array);
     $file_manager = $environment->getFileManager();
     $file_manager->setIDArrayLimit($file_id_array);
     $file_manager->select();
     $manager = $environment->getProjectManager();
     $room_max_activity = 0;
     if ($this->_environment->inCommunityRoom()) {
         $manager->setContextLimit($environment->getCurrentPortalID());
         global $c_cache_cr_pr;
         if (!isset($c_cache_cr_pr) or !$c_cache_cr_pr) {
             $room_max_activity = $manager->getMaxActivityPointsInCommunityRoom($environment->getCurrentContextID());
         } else {
             $current_context_item = $environment->getCurrentContextItem();
             $room_max_activity = $manager->getMaxActivityPointsInCommunityRoomInternal($current_context_item->getInternalProjectIDArray());
             unset($current_context_item);
         }
     }
     $user_manager = $this->_environment->getUserManager();
     foreach ($rubric_list_array as $key => $list) {
         $item_array = array();
         $column1_addon = '';
         $modificator_id = '';
         $item = $list->getFirst();
         $recurringDateArray = array();
         $params = array();
         $params['environment'] = $environment;
         $params['with_modifying_actions'] = false;
         $view = new cs_view($params);
         while ($item) {
             $may_enter = false;
             $noticed_text = $this->_getItemChangeStatus($item);
             #						$noticed_text = '';
             switch ($key) {
                 case CS_ANNOUNCEMENT_TYPE:
                     $column1 = $item->getTitle();
                     $parse_day_start = convertDateFromInput($item->getSeconddateTime(), $this->_environment->getSelectedLanguage());
                     $conforms = $parse_day_start['conforms'];
                     if ($conforms === true) {
                         $column2 = $translator->getDateInLang($parse_day_start['datetime']);
                     } else {
                         $column2 = $item->getSeconddateTime();
                     }
                     $column3 = $item->getModificatorItem()->getFullName();
                     $modificator_id = $item->getModificatorItem()->getItemID();
                     break;
                 case CS_DATE_TYPE:
                     $displayDate = true;
                     $column1_addon = false;
                     // is this a recurring date?
                     if ($item->getRecurrencePattern()) {
                         // did we already displayed the first date?
                         if (!isset($recurringDateArray[$item->getRecurrenceId()])) {
                             // if not - this is the starting date
                             $recurringDateArray[$item->getRecurrenceId()] = $item;
                         } else {
                             $displayDate = false;
                         }
                     }
                     if ($displayDate) {
                         $column1 = $item->getTitle();
                         if ($item->getRecurrencePattern()) {
                             $column1_addon = true;
                         }
                         $parse_day_start = convertDateFromInput($item->getStartingDay(), $this->_environment->getSelectedLanguage());
                         $conforms = $parse_day_start['conforms'];
                         if ($conforms == TRUE) {
                             $date = $translator->getDateInLang($parse_day_start['datetime']);
                         } else {
                             $date = $item->getStartingDay();
                         }
                         $parse_time_start = convertTimeFromInput($item->getStartingTime());
                         $conforms = $parse_time_start['conforms'];
                         if ($conforms == TRUE) {
                             $time = getTimeLanguage($parse_time_start['datetime']);
                         } else {
                             $time = $item->getStartingTime();
                         }
                         if (!empty($time)) {
                             $time = ', ' . $time;
                         }
                         $column2 = $view->_text_as_html_short($date . $time);
                         $column3 = $item->getPlace();
                     } else {
                         // go to next item
                         $item = $list->getNext();
                         /*
                          * the "2" is needed, to continue the while loop an not only
                          * the nested switch statement
                          */
                         continue 2;
                     }
                     break;
                 case CS_DISCUSSION_TYPE:
                     $column1 = $item->getTitle();
                     $column2 = $this->_environment->getTranslationObject()->getDateInLang($item->getModificationDate());
                     $column3 = $item->getModificatorItem()->getFullName();
                     $modificator_id = $item->getModificatorItem()->getItemID();
                     $reader_array = $item->getAllAndUnreadArticles();
                     $column1_addon = $reader_array['unread'] . ' / ' . $reader_array['count'];
                     break;
                 case CS_USER_TYPE:
                     $column1 = '';
                     $title = $item->getTitle();
                     if (!empty($title)) {
                         $column1 = $item->getTitle() . ' ';
                     }
                     $column1 .= $view->_text_as_html_short($item->getFullname());
                     ##################################################
                     # messenger - MUSS NOCH AUFGERÄUMT WERDEN: HTML INS TEMPLATE
                     ##################################################
                     global $c_commsy_domain;
                     $host = $c_commsy_domain;
                     global $c_commsy_url_path;
                     $url_to_img = $host . $c_commsy_url_path . '/images/messenger';
                     $icq_number = $item->getICQ();
                     if (!empty($icq_number)) {
                         //$column1 .= '   <img style="vertical-align:middle;" src="http://status.icq.com/online.gif?icq='.rawurlencode($icq_number).'&amp;img=5" alt="ICQ Online Status" />'.LF;
                     }
                     $msn_number = $item->getMSN();
                     if (!empty($msn_number)) {
                         //$column1 .= '<a href="http://www.IMStatusCheck.com/?msn">'.LF;
                         //$column1 .= '   <img style="vertical-align:middle;" src="http://www.IMStatusCheck.com/status/msn/'.rawurlencode($msn_number).'?icons" alt="MSN Online Status" />'.LF;
                         //$column1 .= '</a>'.LF;
                     }
                     $skype_number = $item->getSkype();
                     if (!empty($skype_number)) {
                         //$column1 .= '<script type="text/javascript" src="http://download.skype.com/share/skypebuttons/js/skypeCheck.js"></script>'.LF;
                         //$column1 .= '<a href="skype:'.rawurlencode($skype_number).'?chat">'.LF;
                         //$column1 .= '   <img src="http://mystatus.skype.com/smallicon/'.rawurlencode($skype_number).'" style="vertical-align:middle; border: none;" width="16" height="16" alt="Skype Online Status" />'.LF;
                         //$column1 .= '</a>'.LF;
                     }
                     $yahoo_number = $item->getYahoo();
                     if (!empty($yahoo_number)) {
                         //$column1 .= '<a href="http://messenger.yahoo.com/edit/send/?.target='.rawurlencode($yahoo_number).'">'.LF;
                         //$column1 .= '   <img style="vertical-align:middle;" src="http://opi.yahoo.com/yahooonline/u='.rawurlencode($yahoo_number).'/m=g/t=0/l='.$this->_environment->getSelectedLanguage().'/opi.jpg" alt="Yahoo Online Status Indicator" />'.LF;
                         //$column1 .= '</a>'.LF;
                     }
                     ##################################################
                     # messenger - END
                     ##################################################
                     $phone = $item->getTelephone();
                     $handy = $item->getCellularphone();
                     $column2 = '';
                     if (!empty($phone)) {
                         $column2 .= $view->_text_as_html_short($phone) . LF;
                     }
                     if (!empty($phone) and !empty($handy)) {
                         $column2 .= BRLF;
                     }
                     if (!empty($handy)) {
                         $column2 .= $view->_text_as_html_short($handy) . LF;
                     }
                     if ($item->isEmailVisible()) {
                         $email = $item->getEmail();
                         $email_text = $email;
                         $column3 = curl_mailto($item->getEmail(), $view->_text_as_html_short(chunkText($email_text, 20)), $email_text);
                     } else {
                         $column3 = $translator->getMessage('USER_EMAIL_HIDDEN');
                     }
                     break;
                 case CS_GROUP_TYPE:
                     $column1 = $item->getTitle();
                     $members = $item->getMemberItemList();
                     $column2 = $translator->getMessage('GROUP_MEMBERS') . ': ' . $members->getCount();
                     $linked_item_array = $item->getAllLinkedItemIDArray();
                     $column3 = $translator->getMessage('COMMON_REFERENCED_LATEST_ENTRIES') . ': ' . count($linked_item_array);
                     break;
                 case CS_TOPIC_TYPE:
                     $column1 = $item->getTitle();
                     $column2 = $this->_environment->getTranslationObject()->getDateInLang($item->getModificationDate());
                     $linked_item_array = $item->getAllLinkedItemIDArray();
                     $column3 = $translator->getMessage('COMMON_REFERENCED_LATEST_ENTRIES') . ': ' . count($linked_item_array);
                     break;
                 case CS_INSTITUTION_TYPE:
                     $column1 = $item->getTitle();
                     $members = $item->getMemberItemList();
                     $column2 = $translator->getMessage('GROUP_MEMBERS') . ': ' . $members->getCount();
                     $linked_item_array = $item->getAllLinkedItemIDArray();
                     $column3 = $translator->getMessage('COMMON_REFERENCED_LATEST_ENTRIES') . ': ' . count($linked_item_array);
                     break;
                 case CS_PROJECT_TYPE:
                     $column1 = $item->getTitle();
                     $column2 = $translator->getMessage('GROUP_MEMBERS') . ': ' . $item->getAllUsers();
                     $column3 = $this->_getItemActivity($item, $room_max_activity);
                     $user_manager->setUserIDLimit($current_user->getUserID());
                     $user_manager->setAuthSourceLimit($current_user->getAuthSource());
                     $user_manager->setContextLimit($item->getItemID());
                     $user_manager->select();
                     $user_list = $user_manager->get();
                     if (!empty($user_list)) {
                         $room_user = $user_list->getFirst();
                     } else {
                         $room_user = '';
                     }
                     if ($current_user->isRoot()) {
                         $may_enter = true;
                     } elseif (!empty($room_user)) {
                         $may_enter = $item->mayEnter($room_user);
                     } else {
                         $may_enter = false;
                     }
                     break;
                 case CS_TODO_TYPE:
                     $column1 = $item->getTitle();
                     $original_date = $item->getDate();
                     $date = getDateInLang($original_date);
                     $status = $item->getStatus();
                     $actual_date = date("Y-m-d H:i:s");
                     if ($status != $translator->getMessage('TODO_DONE') and $original_date < $actual_date) {
                         $date = '<span class="required">' . $date . '</span>';
                     }
                     if ($original_date == '9999-00-00 00:00:00') {
                         $date = $translator->getMessage('TODO_NO_END_DATE');
                     }
                     $column2 = $date;
                     $column3 = $this->_getTodoItemProcess($item, $translator);
                     break;
                 default:
                     $column1 = $item->getTitle();
                     $column2 = $this->_environment->getTranslationObject()->getDateInLang($item->getModificationDate());
                     $modificatorItem = $item->getModificatorItem();
                     if ($modificatorItem) {
                         $column3 = $modificatorItem->getFullName();
                         $modificator_id = $modificatorItem->getItemID();
                     } else {
                         $column3 = $translator->getMessage('COMMON_DELETED_USER');
                         $modificator_id = null;
                     }
             }
             // files
             $with_files = false;
             $file_count = 0;
             if (in_array($key, $this->getRubricsWithFiles())) {
                 $with_files = true;
                 $attachment_infos = array();
                 if ($key == CS_MATERIAL_TYPE) {
                     $file_count = $item->getFileListWithFilesFromSections()->getCount();
                     $file_list = $item->getFileListWithFilesFromSections();
                 } elseif ($key == CS_DISCUSSION_TYPE) {
                     $file_count = $item->getFileListWithFilesFromArticles()->getCount();
                     $file_list = $item->getFileListWithFilesFromArticles();
                 } else {
                     $file_count = $item->getFileList()->getCount();
                     $file_list = $item->getFileList();
                 }
                 $file = $file_list->getFirst();
                 while ($file) {
                     $lightbox = false;
                     if ((!isset($_GET['download']) || $_GET['download'] !== 'zip') && in_array($file->getExtension(), array('png', 'jpg', 'jpeg', 'gif'))) {
                         $lightbox = true;
                     }
                     $info = array();
                     #$info['file_name']	= $converter->text_as_html_short($file->getDisplayName());
                     $info['file_name'] = $converter->filenameFormatting($file->getDisplayName());
                     $info['file_icon'] = $file->getFileIcon();
                     $info['file_url'] = $file->getURL();
                     $info['file_size'] = $file->getFileSize();
                     $info['lightbox'] = $lightbox;
                     $attachment_infos[] = $info;
                     $file = $file_list->getNext();
                 }
             }
             $item_array[] = array('iid' => $item->getItemID(), 'user_iid' => $modificator_id, 'column_1' => $column1, 'column_1_addon' => $column1_addon, 'column_2' => $column2, 'column_3' => $column3, 'noticed' => $noticed_text, 'has_attachments' => $with_files, 'attachment_count' => $file_count, 'attachment_infos' => $attachment_infos, 'may_enter' => $may_enter);
             $item = $list->getNext();
         }
         $return[$key]['items'] = $item_array;
         // message tag
         $message_tag = '';
         //TODO: complete missing tags
         $shown = 0;
         switch ($key) {
             case CS_ANNOUNCEMENT_TYPE:
                 $message_tag = $translator->getMessage('COMMON_' . mb_strtoupper($key) . '_SHORT_VIEW_DESCRIPTION', $list->getCount(), $rubric_count_all_array[$key]);
                 break;
             case CS_DATE_TYPE:
                 $message_tag = $translator->getMessage('HOME_DATES_SHORT_VIEW_DESCRIPTION', $list->getCount(), $rubric_count_all_array[$key]);
                 break;
             case CS_PROJECT_TYPE:
                 if ($this->_environment->inProjectRoom()) {
                     $message_tag = $translator->getMessage('PROJECT_SHORT_DESCRIPTION', 5);
                 } elseif ($this->_environment->inCommunityRoom()) {
                     if (isset($list) && $list->isNotEmpty() && $list->getCount() < 10) {
                         $count = $list->getCount();
                     } else {
                         $count = '10';
                     }
                     $message_tag = $translator->getMessage('COMMUNITY_SHORT_DESCRIPTION') . ' ' . $count;
                 }
                 break;
             case CS_GROUP_TYPE:
                 $message_tag = $translator->getMessage('HOME_GROUP_SHORT_VIEW_DESCRIPTION', $list->getCount());
                 break;
             case CS_TODO_TYPE:
                 $message_tag = $translator->getMessage('TODO_SHORT_VIEW_DESCRIPTION', $list->getCount(), $rubric_count_all_array[$key]);
                 break;
             case CS_TOPIC_TYPE:
                 if (isset($list) && $list->isNotEmpty()) {
                     $shown = $list->getCount();
                 } else {
                     $shown = 0;
                 }
                 $message_tag = $translator->getMessage('HOME_TOPIC_SHORT_VIEW_DESCRIPTION', $shown);
                 break;
             case CS_INSTITUTION_TYPE:
                 if ($rubric_count_all_array[$key] > 0) {
                     $message_tag = $translator->getMessage('HOME_INSTITUTION_SHORT_VIEW_DESCRIPTION', $list->getCount());
                 }
                 break;
             case CS_USER_TYPE:
                 if ($this->_environment->inProjectRoom()) {
                     global $who_is_online;
                     if (isset($who_is_online) && $who_is_online) {
                         $shown = $list->getCount();
                         if ($shown > 0) {
                             $days = $context_item->isProjectRoom() ? $context_item->getTimeSpread() : 90;
                             $item = $list->getFirst();
                             $count_active_now = 0;
                             while ($item) {
                                 $lastlogin = $item->getLastLogin();
                                 if ($lastlogin > getCurrentDateTimeMinusMinutesInMySQL($days)) {
                                     $count_active_now++;
                                 }
                                 $item = $list->getNext();
                             }
                         }
                         $message_tag = $translator->getMessage('HOME_USER_SHORT_VIEW_DESCRIPTION2', $shown, $count_active_now, $rubric_count_all_array[$key], $days);
                     } else {
                         $message_tag = $translator->getMessage('HOME_USER_SHORT_VIEW_DESCRIPTION', $list->getCount(), $rubric_count_all_array[$key]);
                     }
                 } else {
                     $message_tag = $translator->getMessage('COMMON_SHORT_CONTACT_VIEW_DESCRIPTION', $list->getCount(), $rubric_count_all_array[$key]);
                 }
                 break;
             case CS_MATERIAL_TYPE:
                 if ($this->_environment->inProjectRoom()) {
                     $period = $context_item->getTimeSpread();
                     $message_tag = $translator->getMessage('COMMON_SHORT_VIEW_DESCRIPTION', $list->getCount(), $period, $rubric_count_all_array[$key]);
                 } else {
                     $message_tag = $translator->getMessage('COMMON_SHORT_MATERIAL_VIEW_DESCRIPTION', $list->getCount(), $rubric_count_all_array[$key]);
                 }
                 break;
             case CS_DISCUSSION_TYPE:
                 $shown = $list->getCount();
                 if ($this->_environment->inProjectRoom() || $this->_environment->inGroupRoom()) {
                     $period = $context_item->getTimeSpread();
                     $message_tag = $translator->getMessage('COMMON_SHORT_VIEW_DESCRIPTION', $shown, $period, $rubric_count_all_array[$key]);
                 } elseif ($this->_environment->inCommunityRoom()) {
                     if ($shown != 1) {
                         $message_tag = $translator->getMessage('COMMON_SHORT_VIEW_DESCRIPTION_CR', $shown, $rubric_count_all_array[$key]);
                     } else {
                         $message_tag = $translator->getMessage('COMMON_SHORT_VIEW_DESCRIPTION_CR_ONE', $shown, $rubric_count_all_array[$key]);
                     }
                 }
                 break;
         }
         $return[$key]['message_tag'] = $message_tag;
     }
     // TODO attachment_count...
     // append return
     /*
     					$return = array(
     						'items'		=> $rubric_array/*,
     						'count_all'	=> $count_all_shown*/
     /*);
      */
     return $return;
 }
Beispiel #25
0
 function _getModifiedItemsAsHTML($item)
 {
     $html = '';
     foreach ($this->_modified_items_array as $connection => $ids) {
         $module = Type2Module($connection);
         $manager = $this->_environment->getItemManager();
         $html .= ' <div class="netnavigation_panel">     ' . LF;
         switch (mb_strtoupper($connection, 'UTF-8')) {
             case 'ANNOUNCEMENT':
                 $text = $this->_translator->getMessage('ANNOUNCEMENTS');
                 break;
             case 'DATE':
                 $text = $this->_translator->getMessage('DATES');
                 break;
             case 'DISCUSSION':
                 $text = $this->_translator->getMessage('DISCUSSIONS');
                 break;
             case 'GROUP':
                 $text = $this->_translator->getMessage('GROUPS');
                 break;
             case 'INSTITUTION':
                 $text = $this->_translator->getMessage('INSTITUTIONS');
                 break;
             case 'MATERIAL':
                 $text = $this->_translator->getMessage('MATERIALS');
                 break;
             case 'PROJECT':
                 $text = $this->_translator->getMessage('PROJECTS');
                 break;
             case 'TODO':
                 $text = $this->_translator->getMessage('TODOS');
                 break;
             case 'TOPIC':
                 $text = $this->_translator->getMessage('TOPICS');
                 break;
             case 'USER':
                 $text = $this->_translator->getMessage('USERS');
                 break;
             default:
                 $text = $this->_translator->getMessage('COMMON_MESSAGETAG_ERROR') . ' cs_user_detail_view(' . __LINE__ . ') ';
                 break;
         }
         $html .= '         <noscript>';
         $html .= '<div class="netnavigation_title">' . $text . '(' . sizeof($ids) . ')</div>';
         $html .= '         </noscript>';
         $html .= '<div>' . LF;
         $html .= '<ul style="list-style-type: circle; font-size:8pt;">' . LF;
         $count = sizeof($ids);
         $limit = 0;
         $count_shown = 0;
         $show = true;
         if ($count > 10) {
             $limit = 9;
             $count_shown = 1;
         }
         if ($count == 0) {
             $html .= '   <li><a><span class="disabled">' . $this->_translator->getMessage('COMMON_NONE') . '</span></a></li>' . LF;
         }
         foreach ($ids as $id) {
             if ($show) {
                 $item = $manager->getItem($id);
                 if (isset($item)) {
                     $type = $item->getItemType();
                     $rubric_manager = $this->_environment->getManager($type);
                     $rubric_item = $rubric_manager->getItem($id);
                     // Get link creator
                     $link_creator = $rubric_item->getCreatorItem();
                     $link_created = $this->_translator->getDateInLang($rubric_item->getCreationDate());
                     $link_creator_text = $this->_translator->getMessage('COMMON_LINK_CREATOR') . ' ' . $this->_text_as_html_short($link_creator->getFullname()) . ', ' . $this->_text_as_html_short($link_created);
                     switch ($connection) {
                         case CS_DISCARTICLE_TYPE:
                             $linked_iid = $rubric_item->getDiscussionID();
                             break;
                         default:
                             $linked_iid = $rubric_item->getItemID();
                     }
                     $html .= '   <li>';
                     $params = array();
                     $params['iid'] = $linked_iid;
                     $user = $this->_environment->getCurrentUser();
                     if ($rubric_item->isNotActivated() and !($rubric_item->getCreatorID() == $user->getItemID() or $user->isModerator())) {
                         $activating_date = $rubric_item->getActivatingDate();
                         if (strstr($activating_date, '9999-00-00')) {
                             $link_creator_text .= ' (' . $this->_translator->getMessage('COMMON_NOT_ACTIVATED') . ')';
                         } else {
                             $link_creator_text .= ' (' . $this->_translator->getMessage('COMMON_ACTIVATING_DATE') . ' ' . getDateInLang($rubric_item->getActivatingDate()) . ')';
                         }
                         $html .= ahref_curl($this->_environment->getCurrentContextID(), $module, 'detail', $params, chunkText($this->_text_as_html_short($rubric_item->getTitle()), 27), $link_creator_text, '', '', '', '', '', 'class="disabled"', '', '', true);
                         unset($params);
                     } else {
                         $html .= ahref_curl($this->_environment->getCurrentContextID(), $module, 'detail', $params, chunkText($this->_text_as_html_short($rubric_item->getTitle()), 27), $link_creator_text);
                         unset($params);
                     }
                     $html .= '</li>' . LF;
                     if ($limit > 0) {
                         $count_shown++;
                     }
                     if ($count_shown > $limit) {
                         $show = false;
                     }
                 }
             }
         }
         if ($limit > 0) {
             $html .= '   <li>';
             $params = array();
             $params['ref_user'] = $this->_item->getItemID();
             $params['mode'] = 'attached';
             $html .= ahref_curl($this->_environment->getCurrentContextID(), $module, 'index', $params, $this->_translator->getMessage('RUBRIC_ALL_ATTACHMENTS', count($ids)));
             unset($params);
             $html .= '</li>' . LF;
         }
         $html .= '</ul>' . LF;
         $html .= '</div>' . LF;
         $html .= ' </div>';
     }
     return $html;
 }
Beispiel #26
0
 function _getAllLinkedItemsAsHTML($spaces = 0)
 {
     $html = '';
     $current_context = $this->_environment->getCurrentContextItem();
     $html .= '<div style="margin-bottom:1px;">' . LF;
     $html .= '<div class="right_box">' . LF;
     $connections = $this->getRubricConnections();
     $current_context = $this->_environment->getCurrentContextItem();
     $current_user = $this->_environment->getCurrentUserItem();
     $params = $this->_environment->getCurrentParameterArray();
     $session = $this->_environment->getSessionItem();
     $attached_ids = array();
     if ($session->issetValue('cid' . $this->_environment->getCurrentContextID() . '_linked_items_index_selected_ids')) {
         $attached_ids = $session->getValue('cid' . $this->_environment->getCurrentContextID() . '_linked_items_index_selected_ids');
     }
     $count_linked_items = count($attached_ids);
     $item_manager = $this->_environment->getItemManager();
     $linked_items = $item_manager->getItemList($attached_ids);
     if ($this->_environment->inCommunityRoom() and $this->_environment->getCurrentModule() == CS_USER_TYPE) {
         $html .= '<div class="right_box_title">' . $this->_translator->getMessage('COMMON_ATTACHED_INSTITUTIONS') . ' (' . $count_linked_items . ')</div>';
     } elseif ($this->_environment->getCurrentModule() == CS_USER_TYPE) {
         $html .= '<div class="right_box_title">' . $this->_translator->getMessage('COMMON_ATTACHED_GROUPS') . ' (' . $count_linked_items . ')</div>';
     } else {
         $html .= '<div class="right_box_title">' . $this->_translator->getMessage('COMMON_ATTACHED_ENTRIES') . ' (' . $count_linked_items . ')</div>';
     }
     $html .= '     <div class="right_box_main">     ' . LF;
     if ($linked_items->isEmpty()) {
         $html .= '  <div style="padding:0px 5px; font-size:8pt;" class="disabled">' . $this->_translator->getMessage('COMMON_NONE') . '&nbsp;</div>' . LF;
     } else {
         $html .= '     <ul style="list-style-type: circle; font-size:8pt; list-style-position:inside; margin:0px; padding:0px;">' . LF;
         $linked_item = $linked_items->getFirst();
         while ($linked_item) {
             $fragment = '';
             // there is no anchor defined by default
             $type = $linked_item->getItemType();
             if ($type == 'label') {
                 $label_manager = $this->_environment->getLabelManager();
                 $label_item = $label_manager->getItem($linked_item->getItemID());
                 $type = $label_item->getLabelType();
             }
             $manager = $this->_environment->getManager($type);
             $item = $manager->getItem($linked_item->getItemID());
             $text = getRubricMessageTageName($type);
             $text .= ' - ' . $item->getTitle();
             $html .= '   <li  style="padding-left:5px; list-style-type:none;">';
             $type = $item->getType();
             if ($type == 'label') {
                 $type = $item->getLabelType();
             }
             switch (mb_strtoupper($type, 'UTF-8')) {
                 case 'ANNOUNCEMENT':
                     $img = 'images/commsyicons/netnavigation/announcement.png';
                     break;
                 case 'DATE':
                     $img = 'images/commsyicons/netnavigation/date.png';
                     break;
                 case 'DISCUSSION':
                     $img = 'images/commsyicons/netnavigation/discussion.png';
                     break;
                 case 'GROUP':
                     $img = 'images/commsyicons/netnavigation/group.png';
                     break;
                 case 'INSTITUTION':
                     $img = '';
                     break;
                 case 'MATERIAL':
                     $img = 'images/commsyicons/netnavigation/material.png';
                     break;
                 case 'PROJECT':
                     $img = '';
                     break;
                 case 'TODO':
                     $img = 'images/commsyicons/netnavigation/todo.png';
                     break;
                 case 'TOPIC':
                     $img = 'images/commsyicons/netnavigation/topic.png';
                     break;
                 case 'USER':
                     $img = 'images/commsyicons/netnavigation/user.png';
                     break;
                 default:
                     $img = '';
                     break;
             }
             $html .= '<img src="' . $img . '" style="padding-right:3px;" title="' . $text . '"/>';
             if ($type == CS_USER_TYPE) {
                 $html .= '<a title="' . $text . '">' . $this->_text_as_html_short(chunkText($item->getFullName(), 35)) . '</a>';
             } else {
                 if ($item->isNotActivated() and !($item->getCreatorID() == $current_user->getItemID() or $current_user->isModerator())) {
                     $html .= '<a title="' . $text . '" class="disabled">' . $this->_text_as_html_short(chunkText($item->getTitle(), 35)) . '</a>';
                 } else {
                     $html .= '<a title="' . $text . '">' . $this->_text_as_html_short(chunkText($item->getTitle(), 35)) . '</a>';
                 }
             }
             $html .= '</li>' . LF;
             $linked_item = $linked_items->getNext();
         }
         $html .= '</ul>' . LF;
     }
     $html .= '<div style="width:235px; font-size:8pt; text-align:right; padding-top:5px;">';
     $params = $this->_environment->getCurrentParameterArray();
     if ($session->issetValue('javascript')) {
         $javascript = $session->getValue('javascript');
         if ($javascript == 1) {
             if ($this->_environment->inCommunityRoom() and $this->_environment->getCurrentModule() == CS_USER_TYPE) {
                 $html .= '<a href="javascript:right_box_send(\'edit\',\'right_box_option\',\'' . $this->_translator->getMessage('COMMON_INSTITUTION_ATTACH') . '\');">' . $this->_translator->getMessage('COMMON_INSTITUTION_ATTACH') . '</a>' . LF;
             } elseif ($this->_environment->getCurrentModule() == CS_USER_TYPE) {
                 $html .= '<a href="javascript:right_box_send(\'edit\',\'right_box_option\',\'' . $this->_translator->getMessage('COMMON_GROUP_ATTACH') . '\');">' . $this->_translator->getMessage('COMMON_GROUP_ATTACH') . '</a>' . LF;
             } else {
                 $html .= '<a href="javascript:right_box_send(\'edit\',\'right_box_option\',\'' . $this->_translator->getMessage('COMMON_ITEM_NEW_ATTACH') . '\');">' . $this->_translator->getMessage('COMMON_ITEM_NEW_ATTACH') . '</a>' . LF;
             }
         } else {
             if ($this->_environment->inCommunityRoom() and $this->_environment->getCurrentModule() == CS_USER_TYPE) {
                 $html .= '<input id="right_box_option" type="submit" style="font-size:8pt;" name="right_box_option" value="' . $this->_translator->getMessage('COMMON_INSTITUTION_ATTACH') . '"/>';
             } elseif ($this->_environment->getCurrentModule() == CS_USER_TYPE) {
                 $html .= '<input id="right_box_option" type="submit" style="font-size:8pt;" name="right_box_option" value="' . $this->_translator->getMessage('COMMON_GROUP_ATTACH') . '"/>';
             } else {
                 $html .= '<input id="right_box_option" type="submit" style="font-size:8pt;" name="right_box_option" value="' . $this->_translator->getMessage('COMMON_ITEM_NEW_ATTACH') . '"/>';
             }
         }
     } else {
         if ($this->_environment->inCommunityRoom() and $this->_environment->getCurrentModule() == CS_USER_TYPE) {
             $html .= '<input id="right_box_option" type="submit" style="font-size:8pt;" name="right_box_option" value="' . $this->_translator->getMessage('COMMON_INSTITUTION_ATTACH') . '"/>';
         } elseif ($this->_environment->getCurrentModule() == CS_USER_TYPE) {
             $html .= '<input id="right_box_option" type="submit" style="font-size:8pt;" name="right_box_option" value="' . $this->_translator->getMessage('COMMON_GROUP_ATTACH') . '"/>';
         } else {
             $html .= '<input id="right_box_option" type="submit" style="font-size:8pt;" name="right_box_option" value="' . $this->_translator->getMessage('COMMON_ITEM_NEW_ATTACH') . '"/>';
         }
     }
     $html .= '</div>' . LF;
     $html .= '</div>' . LF;
     $html .= '</div>' . LF;
     $html .= '      </div>';
     return $html;
 }
Beispiel #27
0
 /** get room window as html
  *
  * param cs_project_item project room item
  */
 function _getRoomWindowAsHTML($item)
 {
     global $c_single_entry_point;
     $new_private_room = $this->_environment->inConfigArray('c_use_new_private_room', $this->_environment->getCurrentContextID());
     if ($new_private_room) {
         $current_user = $this->_environment->getCurrentUserItem();
         $may_enter = $item->mayEnter($current_user);
         $title = $item->getTitle();
         $color_array = $item->getColorArray();
         if (count($color_array) > 0) {
             $cs_color['room_title'] = $color_array['tabs_title'];
             $cs_color['room_background'] = $color_array['content_background'];
             $cs_color['tableheader'] = $color_array['tabs_background'];
         } else {
             $cs_color['room_title'] = '';
             $cs_color['room_background'] = '';
             $cs_color['tableheader'] = '';
         }
         $style = '    style="border:1px solid  ' . $cs_color['tableheader'] . '; margin:0px; padding:5px 10px 5px 10px; ';
         $style .= 'background: url(../' . $c_single_entry_point . '?cid=' . $item->getItemID() . '&mod=picture&fct=getfile&picture=' . $color_array['schema'] . '_cs_gradient_24.png) repeat-x;';
         $style .= 'background-color: ' . $cs_color['tableheader'] . ';';
         if (isset($cs_color['room_title'])) {
             $style .= ' color:' . $cs_color['room_title'] . ' "';
         } else {
             $style .= ' color:#000000; "';
         }
         $html = '';
         #      $html = '<td style="width:25%; padding:3px; vertical-align: middle;">'.LF;
         $html = '<div id="' . $item->getItemID() . '" class="portlet-header" ' . $style . '><div style="float:right;"><a name="myroom_remove" style="cursor:pointer;"><img src="images/commsyicons/16x16/delete.png" /></a></div>';
         $params['iid'] = $item->getItemID();
         $display_title = chunkText($this->_text_as_html_short($title), 20) . "\n";
         if ($item->isLocked()) {
             $title = $this->_text_as_html_short($title) . ' (' . $this->_translator->getMessage('PROJECTROOM_LOCKED') . ')';
         } elseif ($item->isClosed()) {
             $title = $this->_text_as_html_short($title) . ' (' . $this->_translator->getMessage('PROJECTROOM_CLOSED') . ')';
         }
         if (isset($cs_color['room_title'])) {
             $style = ' color:' . $cs_color['room_title'] . ' "';
         } else {
             $style = ' color:#000000; "';
         }
         $html .= ahref_curl($item->getItemID(), 'home', 'index', array(), $display_title, $title, '', '', '', '', '', 'style="' . $style . '"');
         $html .= '</div>' . LF;
         $html .= '<table class="room_window' . $item->getItemID() . '" summary="Layout" style="width:100%; border-collapse:collapse;">' . LF;
         $html .= '<tr><td colspan="4" class="detail_view_content_room_window' . $item->getItemID() . '">' . LF;
         $html .= '<table style="width: 100%;" summary="Layout">';
         $html .= '<tr><td class="detail_view_content_room_window' . $item->getItemID() . '">' . LF;
         if ($item->isClosed()) {
             $curl = curl($item->getItemID(), 'home', 'index', '', '');
             $html .= '<a href="' . $curl . '">';
             $html .= '<img alt="door" src="images/door_open_small.gif" style="vertical-align: middle; "/>' . LF;
             $html .= '</a>';
             $html .= ' ' . $this->_translator->getMessage('COMMON_CLOSED_SINCE') . ' ' . $this->_translator->getDateInLang($item->getModificationDate()) . LF;
         } elseif ($item->isLocked()) {
             $html .= ' (' . $this->_translator->getMessage('PROJECTROOM_LOCKED') . ')' . LF;
             $html .= '<img alt="door" src="images/door_closed_small.gif" style="vertical-align: middle; "/>' . LF;
             $html .= ' ' . $this->_translator->getMessage('COMMON_LOCKED_SINCE') . ' ' . $this->_translator->getDateInLang($item->getModificationDate()) . LF;
         } else {
             $curl = curl($item->getItemID(), 'home', 'index', '', '');
             $html .= '<a href="' . $curl . '">';
             $html .= '<img alt="door" src="images/door_open_small.gif" style="vertical-align: middle; "/>' . LF;
             $html .= '</a>';
             $html .= ' ' . $this->_translator->getMessage('COMMON_OPENED_SINCE') . ' ' . $this->_translator->getDateInLang($item->getCreationDate()) . LF;
         }
         $html .= '</td></tr>' . LF;
         $html .= '<tr><td class="detail_view_content_room_window' . $item->getItemID() . '">' . LF;
         $context = $this->_environment->getCurrentContextItem();
         $count_total = $item->getPageImpressions($context->getTimeSpread());
         if ($count_total == 1) {
             $html .= $count_total . '&nbsp;' . $this->_translator->getMessage('ACTIVITY_PAGE_IMPRESSIONS_SINGULAR') . '';
             $html .= BRLF;
         } else {
             $html .= $count_total . '&nbsp;' . $this->_translator->getMessage('ACTIVITY_PAGE_IMPRESSIONS') . '';
             $html .= BRLF;
         }
         $html .= '</td></tr>' . LF;
         $html .= '<tr><td class="detail_view_content_room_window' . $item->getItemID() . '">' . LF;
         // Get number of new entries
         $count_total = $item->getNewEntries($context->getTimeSpread());
         if ($count_total == 1) {
             $html .= $count_total . '&nbsp;' . $this->_translator->getMessage('ACTIVITY_NEW_ENTRIES_SINGULAR');
             $html .= BRLF;
         } else {
             $html .= $count_total . '&nbsp;' . $this->_translator->getMessage('ACTIVITY_NEW_ENTRIES');
             $html .= BRLF;
         }
         $html .= '</td></tr>' . LF;
         $html .= '<tr><td class="detail_view_content_room_window' . $item->getItemID() . '">' . LF;
         // Get percentage of active members
         $active = $item->getActiveMembers($context->getTimeSpread());
         $all_users = $item->getAllUsers();
         $percentage = 0;
         if (!empty($all_users)) {
             $percentage = round($active / $all_users * 100);
         }
         $html .= $this->_translator->getMessage('ACTIVITY_ACTIVE_MEMBERS') . ':' . BRLF;
         $html .= '         <div class="gauge' . $item->getItemID() . '">' . LF;
         if ($percentage >= 5) {
             $html .= '            <div class="gauge-bar' . $item->getItemID() . '" style="width:' . $percentage . '%; color: white;">' . $active . '</div>' . LF;
         } else {
             $html .= '            <div class="gauge-bar' . $item->getItemID() . '" style="float:left; width:' . $percentage . '%;">&nbsp;</div>' . LF;
             $html .= '            <div style="font-size: 8pt; padding-left:3px; font-color: white;">' . $active . '</div>' . LF;
         }
         $html .= '         </div>' . LF;
         $html .= '</td></tr>' . LF;
         $html .= '</table>' . LF . LF;
         $html .= '</td></tr>' . LF;
         $html .= '</table>' . LF . LF;
         #      $html .='</td>';
         return $html;
         /**************/
         /* Alter Code */
         /**************/
     } else {
         $current_user = $this->_environment->getCurrentUserItem();
         $may_enter = $item->mayEnter($current_user);
         $title = $item->getTitle();
         $color_array = $item->getColorArray();
         if (count($color_array) > 0) {
             $cs_color['room_title'] = $color_array['tabs_title'];
             $cs_color['room_background'] = $color_array['content_background'];
             $cs_color['tableheader'] = $color_array['tabs_background'];
         } else {
             $cs_color['room_title'] = '';
             $cs_color['room_background'] = '';
             $cs_color['tableheader'] = '';
         }
         $html = '';
         $html = '<td style="width:50%; padding:3px; vertical-align: middle;">' . LF;
         $html .= '<table class="room_window' . $item->getItemID() . '" summary="Layout" style="width:100%; border-collapse:collapse;">' . LF;
         $html .= '<tr>' . LF;
         $logo = $item->getLogoFilename();
         // Titelzeile
         if (!empty($logo)) {
             $html .= '<td class="detail_view_title_room_window' . $item->getItemID() . '" style="padding:3px;">';
             $params = array();
             $params['picture'] = $item->getLogoFilename();
             $curl = curl($item->getItemID(), 'picture', 'getfile', $params, '');
             unset($params);
             $params['iid'] = $item->getItemID();
             $html .= '<div style="float:left; padding-right:3px;">' . LF;
             $html .= ahref_curl($this->_environment->getCurrentContextID(), 'myroom', 'detail', $params, '<img style="height:20px;" src="' . $curl . '" alt="' . $this->_translator->getMessage('LOGO') . '" border="0"/>');
             $html .= '</div>' . LF;
             $html .= '<div style="font-weight: bold; padding-top: 3px; padding-bottom: 3px; ">' . LF;
             $title = $this->_text_as_html_short($title);
             $html .= ahref_curl($this->_environment->getCurrentContextID(), 'myroom', 'detail', $params, $title);
             unset($params);
             if ($item->isLocked()) {
                 $html .= ' (' . $this->_translator->getMessage('PROJECTROOM_LOCKED') . ')' . LF;
             } elseif ($item->isProjectroom() and $item->isTemplate()) {
                 $html .= ' (' . $this->_translator->getMessage('PROJECTROOM_TEMPLATE') . ')' . LF;
             } elseif ($item->isClosed()) {
                 $html .= ' (' . $this->_translator->getMessage('PROJECTROOM_CLOSED') . ')';
             }
             $html .= '</div>' . LF;
             $html .= '</td>' . LF;
         } else {
             $html .= '<td class="detail_view_title_room_window' . $item->getItemID() . '" colspan="2" style="font-weight: bold; padding-top: 3px; padding-bottom: 3px; padding-left:3px;">';
             $params['iid'] = $item->getItemID();
             $title = $this->_text_as_html_short($title) . "\n";
             $html .= ahref_curl($this->_environment->getCurrentContextID(), 'myroom', 'detail', $params, $title);
             if ($item->isLocked()) {
                 $html .= ' (' . $this->_translator->getMessage('PROJECTROOM_LOCKED') . ')';
             } elseif ($item->isClosed()) {
                 $html .= ' (' . $this->_translator->getMessage('PROJECTROOM_CLOSED') . ')';
             }
             $html .= '</td>';
         }
         $html .= '<td class="detail_view_title_room_window' . $item->getItemID() . '" style="vertical-align:top; text-align:right;">' . LF;
         $html .= '</td>' . LF;
         $html .= '</tr>' . LF;
         $html .= '<tr><td colspan="3" class="detail_view_content_room_window' . $item->getItemID() . '">' . LF;
         $html .= '<table style="width: 100%;" summary="Layout">';
         $html .= '<tr><td class="detail_view_content_room_window' . $item->getItemID() . '">' . LF;
         if ($item->isClosed()) {
             $curl = curl($item->getItemID(), 'home', 'index', '', '');
             $html .= '<a href="' . $curl . '">';
             $html .= '<img alt="door" src="images/door_open_small.gif" style="vertical-align: middle; "/>' . LF;
             $html .= '</a>';
             $html .= ' ' . $this->_translator->getMessage('COMMON_CLOSED_SINCE') . ' ' . $this->_translator->getDateInLang($item->getModificationDate()) . LF;
         } elseif ($item->isLocked()) {
             $html .= ' (' . $this->_translator->getMessage('PROJECTROOM_LOCKED') . ')' . LF;
             $html .= '<img alt="door" src="images/door_closed_small.gif" style="vertical-align: middle; "/>' . LF;
             $html .= ' ' . $this->_translator->getMessage('COMMON_LOCKED_SINCE') . ' ' . $this->_translator->getDateInLang($item->getModificationDate()) . LF;
         } else {
             $curl = curl($item->getItemID(), 'home', 'index', '', '');
             $html .= '<a href="' . $curl . '">';
             $html .= '<img alt="door" src="images/door_open_small.gif" style="vertical-align: middle; "/>' . LF;
             $html .= '</a>';
             $html .= ' ' . $this->_translator->getMessage('COMMON_OPENED_SINCE') . ' ' . $this->_translator->getDateInLang($item->getCreationDate()) . LF;
         }
         $html .= '</td></tr>' . LF;
         $html .= '<tr><td class="detail_view_content_room_window' . $item->getItemID() . '">' . LF;
         $context = $this->_environment->getCurrentContextItem();
         $count_total = $item->getPageImpressions($context->getTimeSpread());
         if ($count_total == 1) {
             $html .= $count_total . '&nbsp;' . $this->_translator->getMessage('ACTIVITY_PAGE_IMPRESSIONS_SINGULAR') . '';
             $html .= BRLF;
         } else {
             $html .= $count_total . '&nbsp;' . $this->_translator->getMessage('ACTIVITY_PAGE_IMPRESSIONS') . '';
             $html .= BRLF;
         }
         $html .= '</td></tr>' . LF;
         $html .= '<tr><td class="detail_view_content_room_window' . $item->getItemID() . '">' . LF;
         // Get number of new entries
         $count_total = $item->getNewEntries($context->getTimeSpread());
         if ($count_total == 1) {
             $html .= $count_total . '&nbsp;' . $this->_translator->getMessage('ACTIVITY_NEW_ENTRIES_SINGULAR');
             $html .= BRLF;
         } else {
             $html .= $count_total . '&nbsp;' . $this->_translator->getMessage('ACTIVITY_NEW_ENTRIES');
             $html .= BRLF;
         }
         $html .= '</td></tr>' . LF;
         $html .= '<tr><td class="detail_view_content_room_window' . $item->getItemID() . '">' . LF;
         // Get percentage of active members
         $active = $item->getActiveMembers($context->getTimeSpread());
         $all_users = $item->getAllUsers();
         if (!empty($active) and $active > 0) {
             $percentage = round($active / $all_users * 100);
         } else {
             $percentage = 0;
         }
         $html .= $this->_translator->getMessage('ACTIVITY_ACTIVE_MEMBERS') . ':' . BRLF;
         $html .= '         <div class="gauge' . $item->getItemID() . '">' . LF;
         if ($percentage >= 5) {
             $html .= '            <div class="gauge-bar' . $item->getItemID() . '" style="width:' . $percentage . '%; color: white;">' . $active . '</div>' . LF;
         } else {
             $html .= '            <div class="gauge-bar' . $item->getItemID() . '" style="float:left; width:' . $percentage . '%;">&nbsp;</div>' . LF;
             $html .= '            <div style="font-size: 8pt; padding-left:3px; font-color: white;">' . $active . '</div>' . LF;
         }
         $html .= '         </div>' . LF;
         $html .= '</td></tr>' . LF;
         $html .= '</table>' . LF . LF;
         $html .= '</td></tr>' . LF;
         $html .= '</table>' . LF . LF;
         $html .= '</td>';
         return $html;
     }
 }