function getTooltipDate($date) { $parse_time_start = convertTimeFromInput($date->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($date->getStartingTime())); } $parse_time_end = convertTimeFromInput($date->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($date->getEndingTime())); } $parse_day_start = convertDateFromInput($date->getStartingDay(), $this->_environment->getSelectedLanguage()); $conforms = $parse_day_start['conforms']; if ($conforms == TRUE) { $start_day_print = $date->getStartingDayName() . ', ' . $this->_translator->getDateInLang($parse_day_start['datetime']); } else { $start_day_print = $this->_text_as_html_short($this->_compareWithSearchText($date->getStartingDay())); } $parse_day_end = convertDateFromInput($date->getEndingDay(), $this->_environment->getSelectedLanguage()); $conforms = $parse_day_end['conforms']; if ($conforms == TRUE) { $end_day_print = $date->getEndingDayName() . ', ' . $this->_translator->getDateInLang($parse_day_end['datetime']); } else { $end_day_print = $this->_text_as_html_short($this->_compareWithSearchText($date->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; } $tooltip_date = $temp_array; return $tooltip_date; }
/** cron log, INTERNAL * daily cron * * @return array results of running this cron */ function _cronPageImpressionAndUserActivity() { include_once 'functions/misc_functions.php'; $time_start = getmicrotime(); $cron_array = array(); $cron_array['title'] = 'page impression and user activity cron'; $cron_array['description'] = 'count page impressions and user activity'; $cron_array['success'] = true; $cron_array['success_text'] = 'cron failed'; $log_manager = $this->_environment->getLogManager(); $room_list = $this->getRoomList(); $count_rooms = 0; if ($room_list->isNotEmpty()) { $room_item = $room_list->getFirst(); while ($room_item) { // get latest timestamp of page impressions and user actitivty // from extra field PIUA_LAST $piua_last = $room_item->getPageImpressionAndUserActivityLast(); if (!empty($piua_last)) { $oldest_date = $piua_last; } else { // if there is no entry take creation_date $creation_date = $room_item->getCreationDate(); $oldest_date = getYearFromDateTime($creation_date) . getMonthFromDateTime($creation_date) . getDayFromDateTime($creation_date); } $current_date = getCurrentDate(); $day_diff = getDifference($oldest_date, $current_date); $pi_array = $room_item->getPageImpressionArray(); $ua_array = $room_item->getUserActivityArray(); $pi_input = array(); $ua_input = array(); // for each day, get page impressions and user activity for ($i = 1; $i < $day_diff; $i++) { $log_manager->resetLimits(); $log_manager->setContextLimit($room_item->getItemID()); $log_manager->setRequestLimit("commsy.php"); $older_limit_stamp = datetime2Timestamp(date("Y-m-d 00:00:00")) - ($i - 1) * 86400; $older_limit = date('Y-m-d', $older_limit_stamp); $log_manager->setTimestampOlderLimit($older_limit); $log_manager->setTimestampNotOlderLimit($i); $pi_input[] = $log_manager->getCountAll(); $ua_input[] = $log_manager->countWithUserDistinction(); } // put actual date in extra field PIUA_LAST $room_item->setPageImpressionAndUserActivityLast($current_date); $room_item->setPageImpressionArray(array_merge($pi_input, $pi_array)); $room_item->setUserActivityArray(array_merge($ua_input, $ua_array)); $room_item->saveWithoutChangingModificationInformation(); $count_rooms++; unset($room_item); $room_item = $room_list->getNext(); } } unset($room_list); unset($log_manager); $cron_array['success_text'] = 'count page impressions and user activity of ' . $count_rooms . ' rooms'; $time_end = getmicrotime(); $time = round($time_end - $time_start, 0); $cron_array['time'] = $time; return $cron_array; }
<?php require_once dirname(__FILE__) . '/../function/func_addorder.php'; if ($_GET['q'] > 0) { $idfactory = $_GET['q']; $row = getDifference($idfactory); foreach ($row as $value) { $val_idfactory = $value['idfactory']; //$val_idfactory = $value['idfactory']; $val_difference_amount_factory = $value['difference_amount_factory']; echo $val_difference_amount_factory; } }
/** 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; }
/** create the form, INTERNAL * this methods creates the form with the form definitions * * @author CommSy Development Topic */ function _createForm() { // rubrics $iid = $_GET['iid']; $manager = $this->_environment->getItemManager(); $item = $manager->getItem($iid); $module = $item->getItemType(); $link_module = $module; if ($module == 'label' or $module == 'labels') { $label_manager = $this->_environment->getLabelManager(); $label = $label_manager->getItem($iid); $link_module = $label->getLabelType(); } $item_manager = $this->_environment->getManager($module); $item = $item_manager->getItem($iid); $item_name = $item->getTitle(); $context_name = $this->_context_name; $article = ''; // Wenn man mit HTTPS auf Commsy surft und eine Email generiert // sollte diese Mail auch https links erstellen. if (!empty($_SERVER["HTTPS"]) and $_SERVER["HTTPS"]) { $url = 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'] . '?cid=' . $this->_environment->getCurrentContextID() . '&mod=' . $link_module . '&fct=detail' . '&iid=' . $item->getItemID(); } else { $url = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'] . '?cid=' . $this->_environment->getCurrentContextID() . '&mod=' . $link_module . '&fct=detail' . '&iid=' . $item->getItemID(); } $link = $url; $rubric_type_pretty = ''; $content = ''; //generate module name for the interface- a pretty version of module... if ($module == 'new' or $module == 'news') { $news_content = $this->_translator->getMessage('COMMON_NEWS') . ': ' . $item->getTitle() . LF; $content = $news_content; } elseif ($module == CS_DATE_TYPE) { $rubric_type_pretty = $this->_translator->getMessage('COMMON_DATES'); // 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 = $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 = $item->getEndingTime(); } $parse_day_start = convertDateFromInput($item->getStartingDay(), $this->_environment->getSelectedLanguage()); $conforms = $parse_day_start['conforms']; if ($conforms == TRUE) { $start_day_print = getDateInLang($parse_day_start['datetime']); } else { $start_day_print = $item->getStartingDay(); } $parse_day_end = convertDateFromInput($item->getEndingDay(), $this->_environment->getSelectedLanguage()); $conforms = $parse_day_end['conforms']; if ($conforms == TRUE) { $end_day_print = getDateLanguage($parse_day_end['datetime']); } else { $end_day_print = $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 = $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 $dates_content = ''; $dates_content = $this->_translator->getMessage('DATES_DATETIME') . ': ' . $item_name . LF; if ($time_print != '') { $dates_content .= $this->_translator->getMessage('COMMON_TIME') . ': ' . $date_print . ',' . $time_print . LF; } else { $dates_content .= $this->_translator->getMessage('COMMON_TIME') . ': ' . $date_print . LF; } // Place $place = $item->getPlace(); if (!empty($place)) { $dates_content .= $this->_translator->getMessage('DATES_PLACE') . ': '; $dates_content .= $place . LF; } $content = $dates_content; } elseif ($module == 'discussion' or $module == 'discussions') { $discussion_content = $this->_translator->getMessage('COMMON_DISCUSSION') . ': ' . $item->getTitle() . LF; $article_count = $item->getAllArticlesCount(); $discussion_content .= $this->_translator->getMessage('DISCUSSION_DISCARTICLE_COUNT') . ': ' . $article_count . LF; $time = $item->getLatestArticleModificationDate(); $discussion_content .= $this->_translator->getMessage('DISCUSSION_LAST_ENTRY') . ': ' . getDateTimeInLang($time) . LF; $content = $discussion_content; } elseif ($module == 'material' or $module == 'materials') { $material_content = $this->_translator->getMessage('COMMON_MATERIAL') . ': ' . $item->getTitle() . LF; $content = $material_content; } elseif ($module == 'announcement' or $module == CS_ANNOUNCEMENT_TYPE) { $announcement_content = $this->_translator->getMessage('COMMON_ANNOUNCEMENT') . ': ' . $item->getTitle() . LF; $content = $announcement_content; } elseif ($module == 'label' or $module == 'labels') { $label_manager = $this->_environment->getLabelManager(); $label = $label_manager->getItem($iid); $module = $label->getLabelType(); if ($module == 'group' or $module == 'groups') { $group_content = $this->_translator->getMessage('COMMON_GROUP') . ': ' . $item->getTitle() . LF; $content = $group_content; } elseif ($module == 'institution' or $module == 'institutions') { $institution_content = $this->_translator->getMessage('INSTITUTION') . ': ' . $item->getTitle() . LF; $content = $institution_content; } } if ($this->_environment->inProjectRoom()) { $emailtext = $this->_translator->getMessage('RUBRIC_EMAIL_DEFAULT_PROJECT', $context_name) . LF; } elseif ($this->_environment->inGroupRoom()) { $emailtext = $this->_translator->getMessage('RUBRIC_EMAIL_DEFAULT_GROUPROOM', $context_name) . LF; } else { $emailtext = $this->_translator->getMessage('RUBRIC_EMAIL_DEFAULT_COMMUNITY', $context_name) . LF; } if (empty($content)) { $emailtext .= LF . LF; } else { $emailtext .= $content; } $emailtext .= $this->_translator->getMessage('RUBRIC_EMAIL_DEFAULT_PROJECT_END', $link); $this->_form->addTextField('subject', '', $this->_translator->getMessage('COMMON_MAIL_SUBJECT'), '', '', '57', true); $this->_form->addTextArea('mailcontent', $emailtext, $this->_translator->getMessage('COMMON_MAIL_CONTENT'), $this->_translator->getMessage('COMMON_MAIL_CONTENT_DESC'), '60', '15', '', true, false, false); if ($module == 'date') { $this->_form->addCheckBox('attendees', '2', false, $this->_translator->getMessage('COMMON_MAIL_SEND_TO_ASIGNED_PEOPLE'), $this->_translator->getMessage('COMMON_MAIL_SEND_TO_ATTENDEES')); } elseif ($module == 'todo') { $this->_form->addCheckBox('processors', '2', false, $this->_translator->getMessage('COMMON_MAIL_SEND_TO_ASIGNED_PEOPLE'), $this->_translator->getMessage('COMMON_MAIL_SEND_TO_PROCESSORS')); } if ($this->_environment->inProjectRoom() and !empty($this->_group_array)) { $context_item = $this->_environment->getCurrentContextItem(); if ($context_item->withRubric(CS_GROUP_TYPE)) { $this->_initCheckBoxGroup(); } } else { $context_item = $this->_environment->getCurrentContextItem(); if ($context_item->withRubric(CS_INSTITUTION_TYPE) and !empty($this->_institution_array)) { $this->_initCheckBoxInstitution(); } } $projekt_room_show_mail_to_all = false; //Projectroom and no groups enabled -> send mails to group all if ($context_item->isProjectRoom() and !$context_item->withRubric(CS_GROUP_TYPE)) { $cid = $this->_environment->getCurrentContextId(); $user_manager = $this->_environment->getUserManager(); $user_manager->setUserLimit(); $user_manager->setContextLimit($cid); $count = $user_manager->getCountAll(); $all_iid = $this->_group_array[0]['value']; if ($item->getItemType() != CS_DATE_TYPE and $item->getItemType() != CS_TODO_TYPE) { $this->_form->addText('receiver_text', $this->_translator->getMessage('COMMON_MAIL_RECEIVER'), $this->_translator->getMessage('COMMON_MAIL_ALL_IN_ROOM', $count)); $this->_form->addHidden('groups[0]', $all_iid); } else { $this->_form->combine(); $this->_form->addCheckbox('groups[0]', $all_iid, false, $this->_translator->getMessage('COMMON_MAIL_RECEIVER'), $this->_translator->getMessage('COMMON_MAIL_ALL_IN_ROOM', $count)); } } if ($context_item->isCommunityRoom() and !$context_item->withRubric(CS_INSTITUTION_TYPE)) { $cid = $this->_environment->getCurrentContextId(); $user_manager = $this->_environment->getUserManager(); $user_manager->setUserLimit(); $user_manager->setContextLimit($cid); $count = $user_manager->getCountAll(); if ($item->getItemType() != CS_DATE_TYPE and $item->getItemType() != CS_TODO_TYPE) { $this->_form->addText('receiver_text', $this->_translator->getMessage('COMMON_MAIL_RECEIVER'), $this->_translator->getMessage('COMMON_MAIL_ALL_IN_ROOM', $count)); $this->_form->addHidden('send_to_all', true); } else { $this->_form->combine(); $this->_form->addCheckbox('send_to_all', 1, false, $this->_translator->getMessage('COMMON_MAIL_RECEIVER'), $this->_translator->getMessage('COMMON_MAIL_ALL_IN_ROOM', $count)); } } // send to all members in group rooms if ($context_item->isGroupRoom()) { $cid = $this->_environment->getCurrentContextID(); $user_manager = $this->_environment->getUserManager(); $user_manager->setUserLimit(); $user_manager->setContextLimit($cid); $count = $user_manager->getCountAll(); if ($item->getItemType() != CS_DATE_TYPE and $item->getItemType() != CS_TODO_TYPE) { $this->_form->addText('receiver_text', $this->_translator->getMessage('COMMON_MAIL_RECEIVER'), $this->_translator->getMessage('COMMON_MAIL_ALL_IN_ROOM', $count)); $this->_form->addHidden('send_to_all', true); } else { $this->_form->combine(); $this->_form->addCheckbox('send_to_all', 1, false, $this->_translator->getMessage('COMMON_MAIL_RECEIVER'), $this->_translator->getMessage('COMMON_MAIL_ALL_IN_ROOM', $count)); } } $yesno[][] = array(); $yesno['0']['text'] = $this->_translator->getMessage('COMMON_YES'); $yesno['0']['value'] = $this->_translator->getMessage('COMMON_YES'); $yesno['1']['text'] = $this->_translator->getMessage('COMMON_NO'); $yesno['1']['value'] = $this->_translator->getMessage('COMMON_NO'); $this->_form->addRadioGroup('copytosender', $this->_translator->getMessage('MAILCOPY_TO_SENDER'), $this->_translator->getMessage('MAILCOPY_TO_SENDER_DESC'), $yesno, $this->_translator->getMessage('COMMON_NO'), true, false); // buttons $this->_form->addButtonBar('option', $this->_translator->getMessage('COMMON_MAIL_SEND_BUTTON'), $this->_translator->getMessage('COMMON_CANCEL_BUTTON')); }
protected function getDetailContent() { $converter = $this->_environment->getTextConverter(); $translator = $this->_environment->getTranslationObject(); // description $desc = $this->_item->getDescription(); if (!empty($desc)) { $converter->setFileArray($this->getItemFileList()); if ($this->_with_old_text_formating) { $desc = $converter->textFullHTMLFormatting($desc); } else { //$desc = $converter->cleanDataFromTextArea($desc); //$desc = $converter->compareWithSearchText... //$desc = $converter->text_as_html_long($desc); //$desc = $converter->show_images($desc, $this->_item, true); $desc = $converter->textFullHTMLFormatting($desc); } } // set up style of days and times // time $parse_time_start = convertTimeFromInput($this->_item->getStartingTime()); $conforms = $parse_time_start['conforms']; if ($conforms === true) { $start_time_print = getTimeLanguage($parse_time_start['datetime']); } else { // TODO: compareWithSearchText $start_time_print = $converter->text_as_html_short($this->_item->getStartingTime()); } $parse_time_end = convertTimeFromInput($this->_item->getEndingTime()); $conforms = $parse_time_end['conforms']; if ($conforms === true) { $end_time_print = getTimeLanguage($parse_time_end['datetime']); } else { // TODO: compareWithSearchText $end_time_print = $converter->text_as_html_short($this->_item->getEndingTime()); } // day $parse_day_start = convertDateFromInput($this->_item->getStartingDay(), $this->_environment->getSelectedLanguage()); $conforms = $parse_day_start['conforms']; if ($conforms === true) { $start_day_print = $this->_item->getStartingDayName() . ', ' . $translator->getDateInLang($parse_day_start['datetime']); } else { // TODO: compareWithSearchText $start_day_print = $converter->text_as_html_short($this->_item->getStartingDay()); } $parse_day_end = convertDateFromInput($this->_item->getEndingDay(), $this->_environment->getSelectedLanguage()); $conforms = $parse_day_end['conforms']; if ($conforms === true) { $end_day_print = $this->_item->getEndingDayName() . ', ' . $translator->getDateInLang($parse_day_end['datetime']); } else { // TODO: compareWithSearchText $end_day_print = $converter->text_as_html_short($this->_item->getEndingDay()); } // formate dates and times for displaying $date_print = ''; $time_print = ''; if ($end_day_print !== '') { // with ending day $date_print = $translator->getMessage('DATES_AS_OF') . ' ' . $start_day_print . ' ' . $translator->getMessage('DATES_TILL') . ' ' . $end_day_print; if ($parse_day_start['conforms'] && $parse_day_end['conforms']) { // start and end are dates, not string <- ??? $date_print .= ' (' . getDifference($parse_day_start['timestamp'], $parse_day_end['timestamp']) . ' ' . $translator->getMessage('DATES_DAYS') . ')'; } if ($start_time_print !== '' && $end_time_print === '') { // only start time given $time_print = $translator->getMessage('DATES_AS_OF_LOWER') . ' ' . $start_time_print; if ($parse_time_start['conforms'] === true) { $time_print .= ' ' . $translator->getMessage('DATES_OCLOCK'); } } elseif ($start_time_print === '' && $end_time_print !== '') { // only end time given $time_print = $translator->getMessage('DATES_TILL') . ' ' . $end_time_print; if ($parse_time_end['conforms'] === true) { $time_print .= ' ' . $translator->getMessage('DATES_OCLOCK'); } } elseif ($start_time_print !== '' && $end_time_print !== '') { // all times given if ($parse_time_end['conforms'] === true) { $end_time_print .= ' ' . $translator->getMessage('DATES_OCLOCK'); } if ($parse_time_start['conforms'] === true) { $start_time_print .= ' ' . $translator->getMessage('DATES_OCLOCK'); } $date_print = $translator->getMessage('DATES_AS_OF') . ' ' . $start_day_print . ', ' . $start_time_print . '<br/>' . $translator->getMessage('DATES_TILL') . ' ' . $end_day_print . ', ' . $end_time_print; if ($parse_day_start['conforms'] && $parse_day_end['conforms']) { $date_print .= ' (' . getDifference($parse_day_start['timestamp'], $parse_day_end['timestamp']) . ' ' . $translator->getMessage('DATES_DAYS') . ')'; } } } else { // without ending day $date_print = $translator->getMessage('DATES_ON_DAY') . ' ' . $start_day_print; if ($start_time_print !== '' && $end_time_print == '') { // starting time given $time_print = $translator->getMessage('DATES_AS_OF_LOWER') . ' ' . $start_time_print; if ($parse_time_start['conforms'] === true) { $time_print .= ' ' . $translator->getMessage('DATES_OCLOCK'); } } elseif ($start_time_print === '' && $end_time_print !== '') { // end time given $time_print = $translator->getMessage('DATES_TILL') . ' ' . $end_time_print; if ($parse_time_end['conforms'] === true) { $time_print .= ' ' . $translator->getMessage('DATES_OCLOCK'); } } elseif ($start_time_print !== '' && $end_time_print !== '') { // all times given if ($parse_time_end['conforms'] === true) { $end_time_print .= ' ' . $translator->getMessage('DATES_OCLOCK'); } if ($parse_time_start['conforms'] === true) { $start_time_print .= ' ' . $translator->getMessage('DATES_OCLOCK'); } $time_print = $translator->getMessage('DATES_FROM_TIME_LOWER') . ' ' . $start_time_print . ' ' . $translator->getMessage('DATES_TILL') . ' ' . $end_time_print; } } if ($parse_day_start['timestamp'] === $parse_day_end['timestamp'] && $parse_day_start['conforms'] && $parse_day_end['conforms']) { $date_print = $translator->getMessage('DATES_ON_DAY') . ' ' . $start_day_print; if ($start_time_print !== '' && $end_time_print === '') { // starting time given $time_print = $translator->getMessage('DATES_AS_OF_LOWER') . ' ' . $start_time_print; } elseif ($start_time_print === '' && $end_time_print !== '') { // endtime given $time_print = $translator->getMessage('DATES_TILL') . ' ' . $end_time_print; } elseif ($start_time_print !== '' && $end_time_print !== '') { // all times given $time_print = $translator->getMessage('DATES_FROM_TIME_LOWER') . ' ' . $start_time_print . ' ' . $translator->getMessage('DATES_TILL') . ' ' . $end_time_print; } } // date and time $datetime = $date_print; if ($time_print !== '') { $datetime .= BRLF . $time_print; } // place $place = $this->_item->getPlace(); if (!empty($place)) { // TODO: compareWithSearchText $place = $place; } // color $color = $this->_item->getColor(); if (!empty($color)) { $color = $converter->text_as_html_short($color); } $formal = array(); 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; $formal[] = $temp_array; } $temp_array = array(); return array('formal' => $formal, 'privat' => $this->_item->issetPrivatDate(), 'datetime' => $datetime, 'place' => $place, 'color' => $color, 'files' => $this->getFileContent(), 'member' => $this->getMember(), 'item_id' => $this->_item->getItemID(), 'title' => $this->_item->getTitle(), 'description' => $desc, 'moredetails' => $this->getCreatorInformationAsArray($this->_item)); }
public function actionInit() { $response = array(); $iid = $this->_data['itemId']; $current_user = $this->_environment->getCurrentUserItem(); $current_context = $this->_environment->getCurrentContextItem(); $translator = $this->_environment->getTranslationObject(); // context information $contextInformation = array(); $contextInformation["name"] = $current_context->getTitle(); $response['context'] = $contextInformation; // group information $groupArray = $this->getAllLabelsByType("group"); // institutions information $institutionArray = $this->getAllLabelsByType("institution"); // get item $manager = $this->_environment->getItemManager(); $item = $manager->getItem($iid); $module = $item->getItemType(); $link_module = $module; if ($module == 'label' or $module == 'labels') { $label_manager = $this->_environment->getLabelManager(); $label = $label_manager->getItem($iid); $link_module = $label->getLabelType(); } $item_manager = $this->_environment->getManager($module); $item = $item_manager->getItem($iid); $item_name = $item->getTitle(); // Wenn man mit HTTPS auf Commsy surft und eine Email generiert // sollte diese Mail auch https links erstellen. if (!empty($_SERVER["HTTPS"]) and $_SERVER["HTTPS"]) { $url = 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'] . '?cid=' . $this->_environment->getCurrentContextID() . '&mod=' . $link_module . '&fct=detail' . '&iid=' . $item->getItemID(); } else { $url = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'] . '?cid=' . $this->_environment->getCurrentContextID() . '&mod=' . $link_module . '&fct=detail' . '&iid=' . $item->getItemID(); } $link = $url; $content = ''; //generate module name for the interface- a pretty version of module... if ($module == CS_DATE_TYPE) { // 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 = $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 = $item->getEndingTime(); } $parse_day_start = convertDateFromInput($item->getStartingDay(), $this->_environment->getSelectedLanguage()); $conforms = $parse_day_start['conforms']; if ($conforms == TRUE) { $start_day_print = getDateInLang($parse_day_start['datetime']); } else { $start_day_print = $item->getStartingDay(); } $parse_day_end = convertDateFromInput($item->getEndingDay(), $this->_environment->getSelectedLanguage()); $conforms = $parse_day_end['conforms']; if ($conforms == TRUE) { $end_day_print = getDateLanguage($parse_day_end['datetime']); } else { $end_day_print = $item->getEndingDay(); } //formating dates and times for displaying $date_print = ""; $time_print = ""; if ($end_day_print != "") { //with ending day $date_print = $translator->getMessage('DATES_AS_OF') . ' ' . $start_day_print . ' ' . $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']) . ' ' . $translator->getMessage('DATES_DAYS') . ')'; } if ($start_time_print != "" and $end_time_print == "") { //starting time given $time_print = $translator->getMessage('DATES_AS_OF_LOWER') . ' ' . $start_time_print; if ($parse_time_start['conforms'] == true) { $time_print .= ' ' . $translator->getMessage('DATES_OCLOCK'); } } elseif ($start_time_print == "" and $end_time_print != "") { //endtime given $time_print = $translator->getMessage('DATES_TILL') . ' ' . $end_time_print; if ($parse_time_end['conforms'] == true) { $time_print .= ' ' . $translator->getMessage('DATES_OCLOCK'); } } elseif ($start_time_print != "" and $end_time_print != "") { //all times given if ($parse_time_end['conforms'] == true) { $end_time_print .= ' ' . $translator->getMessage('DATES_OCLOCK'); } if ($parse_time_start['conforms'] == true) { $start_time_print .= ' ' . $translator->getMessage('DATES_OCLOCK'); } $date_print = $translator->getMessage('DATES_AS_OF') . ' ' . $start_day_print . ', ' . $start_time_print . '<br />' . $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']) . ' ' . $translator->getMessage('DATES_DAYS') . ')'; } } } else { //without ending day $date_print = $start_day_print; if ($start_time_print != "" and $end_time_print == "") { //starting time given $time_print = $translator->getMessage('DATES_AS_OF_LOWER') . ' ' . $start_time_print; if ($parse_time_start['conforms'] == true) { $time_print .= ' ' . $translator->getMessage('DATES_OCLOCK'); } } elseif ($start_time_print == "" and $end_time_print != "") { //endtime given $time_print = $translator->getMessage('DATES_TILL') . ' ' . $end_time_print; if ($parse_time_end['conforms'] == true) { $time_print .= ' ' . $translator->getMessage('DATES_OCLOCK'); } } elseif ($start_time_print != "" and $end_time_print != "") { //all times given if ($parse_time_end['conforms'] == true) { $end_time_print .= ' ' . $translator->getMessage('DATES_OCLOCK'); } if ($parse_time_start['conforms'] == true) { $start_time_print .= ' ' . $translator->getMessage('DATES_OCLOCK'); } $time_print = $translator->getMessage('DATES_FROM_TIME_LOWER') . ' ' . $start_time_print . ' ' . $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 = $translator->getMessage('DATES_ON_DAY') . ' ' . $start_day_print; if ($start_time_print != "" and $end_time_print == "") { //starting time given $time_print = $translator->getMessage('DATES_AS_OF_LOWER') . ' ' . $start_time_print; } elseif ($start_time_print == "" and $end_time_print != "") { //endtime given $time_print = $translator->getMessage('DATES_TILL') . ' ' . $end_time_print; } elseif ($start_time_print != "" and $end_time_print != "") { //all times given $time_print = $translator->getMessage('DATES_FROM_TIME_LOWER') . ' ' . $start_time_print . ' ' . $translator->getMessage('DATES_TILL') . ' ' . $end_time_print; } } // Date and time $dates_content = ''; $dates_content = $translator->getMessage('DATES_DATETIME') . ': ' . $item_name . LF; if ($time_print != '') { $dates_content .= $translator->getMessage('COMMON_TIME') . ': ' . $date_print . ',' . $time_print . LF; } else { $dates_content .= $translator->getMessage('COMMON_TIME') . ': ' . $date_print . LF; } // Place $place = $item->getPlace(); if (!empty($place)) { $dates_content .= $translator->getMessage('DATES_PLACE') . ': '; $dates_content .= $place . LF; } $content = $dates_content; } elseif ($module == 'discussion' or $module == 'discussions') { $discussion_content = $translator->getMessage('COMMON_DISCUSSION') . ': ' . $item->getTitle() . LF; $article_count = $item->getAllArticlesCount(); $discussion_content .= $translator->getMessage('DISCUSSION_DISCARTICLE_COUNT') . ': ' . $article_count . LF; $time = $item->getLatestArticleModificationDate(); $discussion_content .= $translator->getMessage('DISCUSSION_LAST_ENTRY') . ': ' . getDateTimeInLang($time) . LF; $content = $discussion_content; } elseif ($module == 'material' or $module == 'materials') { $material_content = $translator->getMessage('COMMON_MATERIAL') . ': ' . $item->getTitle() . LF; $content = $material_content; } elseif ($module == 'announcement' or $module == CS_ANNOUNCEMENT_TYPE) { $announcement_content = $translator->getMessage('COMMON_ANNOUNCEMENT') . ': ' . $item->getTitle() . LF; $content = $announcement_content; } elseif ($module == 'label' or $module == 'labels') { $label_manager = $this->_environment->getLabelManager(); $label = $label_manager->getItem($iid); $module = $label->getLabelType(); if ($module == 'group' or $module == 'groups') { $group_content = $translator->getMessage('COMMON_GROUP') . ': ' . $item->getTitle() . LF; $content = $group_content; } elseif ($module == 'institution' or $module == 'institutions') { $institution_content = $translator->getMessage('INSTITUTION') . ': ' . $item->getTitle() . LF; $content = $institution_content; } } if ($this->_environment->inProjectRoom()) { $emailtext = $translator->getMessage('RUBRIC_EMAIL_DEFAULT_PROJECT', $current_context->getTitle()) . LF; } elseif ($this->_environment->inGroupRoom()) { $emailtext = $translator->getMessage('RUBRIC_EMAIL_DEFAULT_GROUPROOM', $current_context->getTitle()) . LF; } else { $emailtext = $translator->getMessage('RUBRIC_EMAIL_DEFAULT_COMMUNITY', $current_context->getTitle()) . LF; } if (empty($content)) { $emailtext .= LF . LF; } else { $emailtext .= $content; } $emailtext .= $translator->getMessage('RUBRIC_EMAIL_DEFAULT_PROJECT_END', $link); $response['body'] = strip_tags($emailtext); // receiver $showAttendees = false; if ($module === CS_DATE_TYPE) { $showAttendees = true; $attendeeType = CS_DATE_TYPE; } if ($module === CS_TODO_TYPE) { $showAttendees = true; $attendeeType = CS_TODO_TYPE; } $response['showAttendees'] = $showAttendees; $response['attendeeType'] = $attendeeType; $showGroupRecipients = false; $showInstitutionRecipients = false; if ($this->_environment->inProjectRoom() and !empty($groupArray)) { if ($current_context->withRubric(CS_GROUP_TYPE)) { $showGroupRecipients = true; } } else { if ($current_context->withRubric(CS_INSTITUTION_TYPE) and !empty($institutionArray)) { $showInstitutionRecipients = true; } } //Projectroom and no groups enabled -> send mails to group all $withGroups = true; if ($current_context->isProjectRoom() && !$current_context->withRubric(CS_GROUP_TYPE)) { $showGroupRecipients = true; $withGroups = false; // get number of users $cid = $this->_environment->getCurrentContextId(); $user_manager = $this->_environment->getUserManager(); $user_manager->setUserLimit(); $user_manager->setContextLimit($cid); $count = $user_manager->getCountAll(); $response['numMebers'] = $count; $groupArray = array_slice($groupArray, 0, 1); } $response['showGroupRecipients'] = $showGroupRecipients; $response['withGroups'] = $withGroups; $response['groups'] = $groupArray; $allMembers = false; if ($current_context->isCommunityRoom() && !$current_context->withRubric(CS_INSTITUTION_TYPE) || $current_context->isGroupRoom()) { $allMembers = true; // get number of users $cid = $this->_environment->getCurrentContextId(); $user_manager = $this->_environment->getUserManager(); $user_manager->setUserLimit(); $user_manager->setContextLimit($cid); $count = $user_manager->getCountAll(); $response['numMebers'] = $count; } $response['showInstitutionRecipients'] = $showInstitutionRecipients; $response['institutions'] = $institutionArray; $response['allMembers'] = $allMembers; $response['allowAdditional'] = true; $this->setSuccessfullDataReturn($response); echo $this->_return; }
array_push($cpi_subgroup, $subgroup); array_push($cpi_classification, $subgroup); $count_subgroup++; $count_classes = 0; $sql_class = "select cpi_class.id_class,name_class,weight_value,color_class from cpi_class,cpi_weight where id_subgroup='" . $id_subgroup . "'" . " and cpi_class.id_class=cpi_weight.CODE and start_time<='" . $start . "' and end_time>='" . $start . "' "; //if($id_group==='12') // echo ''.$sql_class.'<br>'; $sql_class = mysql_query($sql_class) or die(mysql_error()); $count_class = mysql_num_rows($sql_class); if ($count_class > 0) { while ($row1 = mysql_fetch_array($sql_class)) { $id_class = $row1['id_class']; $name_class = $row1['name_class']; $class_value = $row1['weight_value']; $color_class = $row1['color_class']; $cpi_pie_value = getDifference('class', '' . $id_class, '' . $start, '' . $end); $class = array($id_class, $name_class, 'class', $class_value, $color_class, 0, $cpi_pie_value[0], $cpi_pie_value[1], $count_classes); array_push($cpi_classification, $class); $count_classes++; } } } } } } ?> <?php function getDifference($table_Search, $id_search, $start_time, $end_time) { $previous = 0; $first_value = 0;