From 4c37f90cc1aadbb6372970bd4a9d768ba3a6f1ec Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Tue, 1 Mar 2016 16:26:14 +0000 Subject: [PATCH] remove old no longer used stuff --- calendar/inc/class.calendar_ui.inc.php | 8 +- calendar/js/navigation.js | 166 ------------------------- 2 files changed, 3 insertions(+), 171 deletions(-) delete mode 100644 calendar/js/navigation.js diff --git a/calendar/inc/class.calendar_ui.inc.php b/calendar/inc/class.calendar_ui.inc.php index f85b87d01d..0ce4ae699c 100644 --- a/calendar/inc/class.calendar_ui.inc.php +++ b/calendar/inc/class.calendar_ui.inc.php @@ -145,9 +145,7 @@ class calendar_ui { $this->bo = new calendar_bo(); } - $this->jscal = $GLOBALS['egw']->jscalendar; $this->datetime = $GLOBALS['egw']->datetime; - $this->accountsel = $GLOBALS['egw']->uiaccountsel; $this->categories = new categories($this->user,'calendar'); @@ -616,7 +614,7 @@ class calendar_ui $content = $this->cal_prefs['saved_states']; $content['view'] = $this->view ? $this->view : 'week'; $content['date'] = $this->date ? $this->date : egw_time(); - + $readonlys = array(); $sel_options['status_filter'] = array( array('value' => 'default', 'label' => lang('Not rejected'), 'title' => lang('Show all status, but rejected')), @@ -702,7 +700,7 @@ class calendar_ui while ($rrule->valid() && $occurrence <= $this_month ); } } - + /** * Prepare an array of event information for sending to the client * @@ -715,7 +713,7 @@ class calendar_ui public function to_client(&$event) { if(!$event || !is_array($event)) return false; - + if (!$this->bo->check_perms(EGW_ACL_EDIT,$event)) { $event['class'] .= 'rowNoEdit '; diff --git a/calendar/js/navigation.js b/calendar/js/navigation.js deleted file mode 100644 index ec9ab3ad3b..0000000000 --- a/calendar/js/navigation.js +++ /dev/null @@ -1,166 +0,0 @@ -/** - * Calendar - sidebox navigation - * - * @link http://www.egroupware.org - * @author Ralf Becker - * @package calendar - * @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License - * @version $Id$ - */ - -/** - * Sidebox navigation for calendar - * - */ -(function() -{ - var script_tag = document.getElementById('calendar-navigation-script'); - var current_view_url, link_day_url,link_week_url,link_month_url,flatdate, current_date; - if (script_tag) - { - current_view_url = script_tag.getAttribute('data-current-view-url'); - link_day_url = script_tag.getAttribute('data-link-day-url'); - link_week_url = script_tag.getAttribute('data-link-week-url'); - link_month_url = script_tag.getAttribute('data-link-month-url'); - flatdate = script_tag.getAttribute('data-date'); - current_date = script_tag.getAttribute('data-current-date'); - } - function load_cal(url,id,no_reset) { - var owner=''; - var i = 0; - selectBox = document.getElementById(id); - for(i=0; i < selectBox.length; ++i) { - if (selectBox.options[i].selected) { - owner += (owner ? ',' : '') + selectBox.options[i].value; - } - } - if (owner) { - if (typeof no_reset == 'unknown') no_reset = false; - url += '&owner='+(no_reset?'':'0,')+owner; - if (url.match('&ajax=true')) url = url.replace('&ajax=true', '')+'&ajax=true'; - egw_link_handler(url, 'calendar'); - } - } - - /** - * Load template specific app.css file in top window too as sidebox needs it - * - * @returns {Boolean} - */ - function load_top_app_css() - { - var calendar_window = egw_appWindow('calendar'); - // include template specific app.css - var link_tags = calendar_window.document.getElementsByTagName('link'); - var cal_app_css = /calendar\/templates\/[^/]+\/app.css/; - for(var i=0; i < link_tags.length; i++) - // include template specific app.css - { - var href = cal_app_css.exec(link_tags[i].href); - if (href) - { - //alert('loading into top window: '+href); - egw(calendar_window.top).includeCSS(egw_webserverUrl+'/'+href[0]); - return true; - } - } - // try loading a little later, due to async loading app.css might not already loaded - window.setTimeout(load_top_app_css, 100); - return false; - } - - /* - * - * @param {type} calendar - * @returns {undefined} - */ - function dateChanged(calendar) { - - if (calendar.dateClicked) { - egw_link_handler(link_day_url+"&date=" + calendar.date.print("%Y%m%d"),"calendar"); - } - } - - /* - * - * @param {type} calendar - * @returns {undefined} - */ - function todayClicked(calendar) { - egw_link_handler(current_view_url+"&date="+ current_date ,"calendar"); - } - - /* - * - * @param {type} calendar - * @param {type} weekstart - * @returns {undefined} - */ - function weekClicked(calendar,weekstart) { - egw_link_handler(link_week_url+"&date=" + weekstart.print("%Y%m%d"),"calendar"); - } - - /* - * - * @param {type} calendar - * @param {type} monthstart - * @returns {undefined} - */ - function monthClicked(calendar,monthstart) { - egw_link_handler(link_month_url+"&date=" + monthstart.print("%Y%m%d"),"calendar"); - } - - /** - * Initialisation after DOM *and* jQuery is loaded - */ - egw_LAB.wait(function() { - $j(function(){ - var calendar_window = egw_appWindow('calendar'); - // include template specific app.css - load_top_app_css(); - // change handlers setting a certain url, eg. view - $j('#calendar_view').change(function(){ - egw_link_handler(egw_webserverUrl+'/index.php?'+this.value, 'calendar'); - }); - // calendar owner selection change - $j('#uical_select_owner,#uical_select_resource').change(function(e){ - if (this.value != 'popup') - { - load_cal(current_view_url, this.id, this.id != 'uical_select_owner'); - e.preventDefault(); - } - }); - // diverse change handlers appending a name=value to url - $j('#calendar_merge,#calendar_filter,#calendar_cat_id,#calendar_test').change(function(){ - var val = this.name == 'test' ? this.checked.toString() : $j(this).val(); - if ($j.isArray(val)) val = val.join(','); - var url = current_view_url+(current_view_url.search.length ? '&' : '?')+this.name+'='+val; - if (url.match('&ajax=true')) url = url.replace('&ajax=true', '')+'&ajax=true'; - egw_link_handler(url, 'calendar'); - if (this.name == 'merge') this.value=''; - }); - // click handler to switch selectbox to multiple - $j('#calendar_cat_id_multiple').click(function(){ - var selectBox = document.getElementById(this.id.replace('_multiple', '')); - if (selectBox && !selectBox.multiple) - { - selectBox.size=4; - selectBox.multiple=true; - } - }); - $j('#calendar_keywords').change(function(){ - egw.open_link('calendar.calendar_uilist.listview&keywords='+encodeURIComponent(this.value)+'&ajax=true', 'calendar'); - }); - }); - Calendar.setup({ - flat : "calendar-container", - flatCallback : dateChanged, - flatWeekCallback : (link_week_url)?weekClicked:'', - flatWeekTTip : egw.lang('show this week'), - flatMonthCallback : (link_month_url)?monthClicked:'', - flatMonthTTip : egw.lang('show this month'), - flatTodayCallback : (flatdate)?todayClicked:'', - date : (flatdate)?flatdate:'' - }); - }); -})(); \ No newline at end of file