These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | /** |
||
3 | * Copyright (c) 2011 Georg Ehrke <ownclouddev at georgswebsite dot de> |
||
4 | * This file is licensed under the Affero General Public License version 3 or |
||
5 | * later. |
||
6 | * See the COPYING-README file. |
||
7 | */ |
||
8 | OCP\User::checkLoggedIn(); |
||
9 | OCP\App::checkAppEnabled('calendar'); |
||
10 | |||
11 | // Create default calendar ... |
||
12 | $calendars = OC_Calendar_Calendar::allCalendars(OCP\USER::getUser(), false); |
||
13 | View Code Duplication | if( count($calendars) == 0) { |
|
0 ignored issues
–
show
|
|||
14 | OC_Calendar_Calendar::addDefaultCalendars(OCP\USER::getUser()); |
||
15 | $calendars = OC_Calendar_Calendar::allCalendars(OCP\USER::getUser(), true); |
||
16 | } |
||
17 | |||
18 | //Fix currentview for fullcalendar |
||
19 | View Code Duplication | if(OCP\Config::getUserValue(OCP\USER::getUser(), 'calendar', 'currentview', 'month') == "oneweekview") { |
|
0 ignored issues
–
show
This code seems to be duplicated across your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository. ![]() |
|||
20 | OCP\Config::setUserValue(OCP\USER::getUser(), "calendar", "currentview", "agendaWeek"); |
||
21 | } |
||
22 | View Code Duplication | if(OCP\Config::getUserValue(OCP\USER::getUser(), 'calendar', 'currentview', 'month') == "onemonthview") { |
|
0 ignored issues
–
show
This code seems to be duplicated across your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository. ![]() |
|||
23 | OCP\Config::setUserValue(OCP\USER::getUser(), "calendar", "currentview", "month"); |
||
24 | } |
||
25 | View Code Duplication | if(OCP\Config::getUserValue(OCP\USER::getUser(), 'calendar', 'currentview', 'month') == "listview") { |
|
0 ignored issues
–
show
This code seems to be duplicated across your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository. ![]() |
|||
26 | OCP\Config::setUserValue(OCP\USER::getUser(), 'calendar', 'currentview', 'agendaDay'); |
||
27 | } |
||
28 | View Code Duplication | if(OCP\Config::getUserValue(OCP\USER::getUser(), 'calendar', 'currentview', 'month') == 'list') { |
|
0 ignored issues
–
show
This code seems to be duplicated across your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository. ![]() |
|||
29 | OCP\Config::setUserValue(OCP\USER::getUser(), 'calendar', 'currentview', 'agendaDay'); |
||
30 | } |
||
31 | |||
32 | OCP\Util::addScript('calendar', '../3rdparty/fullcalendar/js/fullcalendar'); |
||
33 | OCP\Util::addStyle('calendar', '../3rdparty/fullcalendar/css/fullcalendar'); |
||
34 | OCP\Util::addScript('calendar', '../3rdparty/timepicker/js/jquery.ui.timepicker'); |
||
35 | OCP\Util::addStyle('calendar', '../3rdparty/timepicker/css/jquery.ui.timepicker'); |
||
36 | if(OCP\Config::getUserValue(OCP\USER::getUser(), "calendar", "timezone") == null || OCP\Config::getUserValue(OCP\USER::getUser(), 'calendar', 'timezonedetection') == 'true') { |
||
37 | OCP\Util::addScript('calendar', 'geo'); |
||
38 | } |
||
39 | OCP\Util::addScript('calendar', 'calendar'); |
||
40 | OCP\Util::addStyle('calendar', 'style'); |
||
41 | OCP\Util::addScript('calendar', '../3rdparty/jquery.multiselect/js/jquery.multiselect'); |
||
42 | OCP\Util::addStyle('calendar', '../3rdparty/jquery.multiselect/css/jquery.multiselect'); |
||
43 | OCP\Util::addScript('calendar','jquery.multi-autocomplete'); |
||
44 | OCP\Util::addScript('calendar', '../3rdparty/jsTz/jstz-1.0.4.min'); |
||
45 | OCP\Util::addScript('core','tags'); |
||
46 | OCP\Util::addScript('calendar','on-event'); |
||
47 | OCP\Util::addScript('calendar','settings'); |
||
48 | OCP\Util::addScript('calendar','share'); |
||
49 | OCP\Util::addStyle('calendar','share'); |
||
50 | OCP\App::setActiveNavigationEntry('calendar_index'); |
||
51 | $tmpl = new OCP\Template('calendar', 'calendar', 'user'); |
||
52 | $timezone=OCP\Config::getUserValue(OCP\USER::getUser(),'calendar','timezone',date_default_timezone_get()); |
||
53 | $tmpl->assign('timezone',$timezone); |
||
54 | $tmpl->assign('timezones',DateTimeZone::listIdentifiers()); |
||
55 | |||
56 | if(array_key_exists('showevent', $_GET)) { |
||
57 | $tmpl->assign('showevent', $_GET['showevent']); |
||
58 | } |
||
59 | $tmpl->printPage(); |
||
60 |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.