Completed
Push — master ( cccb0d...7ac37e )
by Paul
08:12
created

vacadmb.php ➔ absences_updateEntryCalendar()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
/************************************************************************
3
 * OVIDENTIA http://www.ovidentia.org                                   *
4
 ************************************************************************
5
 * Copyright (c) 2003 by CANTICO ( http://www.cantico.fr )              *
6
 *                                                                      *
7
 * This file is part of Ovidentia.                                      *
8
 *                                                                      *
9
 * Ovidentia is free software; you can redistribute it and/or modify    *
10
 * it under the terms of the GNU General Public License as published by *
11
 * the Free Software Foundation; either version 2, or (at your option)  *
12
 * any later version.													*
13
 *																		*
14
 * This program is distributed in the hope that it will be useful, but  *
15
 * WITHOUT ANY WARRANTY; without even the implied warranty of			*
16
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.					*
17
 * See the  GNU General Public License for more details.				*
18
 *																		*
19
 * You should have received a copy of the GNU General Public License	*
20
 * along with this program; if not, write to the Free Software			*
21
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,*
22
 * USA.																	*
23
************************************************************************/
24
25
include_once $babInstallPath."utilit/afincl.php";
26
include_once dirname(__FILE__).'/utilit/vacincl.php';
27
include_once dirname(__FILE__).'/functions.php';
28
include_once dirname(__FILE__).'/utilit/agent.class.php';
29
include_once dirname(__FILE__).'/utilit/entry.class.php';
30
31
32
function absences_listVacationRequestsb()
33
{
34
	global $babBody;
35
36
	class temp extends absences_Paginate 
0 ignored issues
show
Comprehensibility Best Practice introduced by
The type temp has been defined more than once; this definition is ignored, only the first definition in programs/vacadm.php (L38-118) is considered.

This check looks for classes that have been defined more than once.

If you can, we would recommend to use standard object-oriented programming techniques. For example, to avoid multiple types, it might make sense to create a common interface, and then multiple, different implementations for that interface.

This also has the side-effect of providing you with better IDE auto-completion, static analysis and also better OPCode caching from PHP.

Loading history...
37
		{
38
		var $nametxt;
39
		var $urlname;
40
		var $url;
41
		var $editurl;
42
		var $begindatetxt;
43
		var $enddatetxt;
44
		var $quantitytxt;
45
		var $statustxt;
46
		var $begindate;
47
		var $enddate;
48
		var $quantity;
49
		var $status;
50
				
51
		var $arr = array();
52
		var $count;
53
		var $res;
54
55
		var $statarr;
56
		var $total;
57
		var $checkall;
58
		var $uncheckall;
59
60
		var $usersbrowurl;
61
		var $datetxt;
62
		var $filteron;
63
		var $usertxt;
64
		var $begintxt;
65
		var $endtxt;
66
		var $userval;
67
		var $userid;
68
		var $dateb;
69
		var $datee;
70
		var $dateburl;
71
		var $dateeurl;
72
		var $topurl;
73
		var $bottomurl;
74
		var $nexturl;
75
		var $prevurl;
76
		var $topname;
77
		var $bottomname;
78
		var $nextname;
79
		var $prevname;
80
		var $pos;
81
82
		var $resettxt;
83
84
		var $entryid;
85
		var $alttxt;
86
		var $altbg = true;
87
88
		function temp()
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
89
			{
90
			
91
			
92
			$idstatus = $this->param('idstatus');
0 ignored issues
show
Bug introduced by
The method param() does not seem to exist on object<temp>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
93
			$userid = (int) $this->param('userid');
0 ignored issues
show
Bug introduced by
The method param() does not seem to exist on object<temp>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
94
			$organization = (int) $this->param('organization');
0 ignored issues
show
Bug introduced by
The method param() does not seem to exist on object<temp>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
95
			$dateb = $this->param('dateb');
0 ignored issues
show
Bug introduced by
The method param() does not seem to exist on object<temp>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
96
			$datee = $this->param('datee');
0 ignored issues
show
Bug introduced by
The method param() does not seem to exist on object<temp>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
97
			$vpos = (int) $this->param('vpos', 0);
0 ignored issues
show
Bug introduced by
The method param() does not seem to exist on object<temp>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Unused Code introduced by
$vpos is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
98
			$pos = (int) $this->param('pos', 0);
0 ignored issues
show
Bug introduced by
The method param() does not seem to exist on object<temp>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
99
			$archived = (int) bab_rp('archived', 0);
100
			
101
			include_once $GLOBALS['babInstallPath']."utilit/urlincl.php";
102
			
103
			global $babDB, $babBody;
104
			
105
			if ($archived)
106
			{
107
				$babBody->setTitle(absences_translate("Archived vacations requests list"));
108
			} else {
109
				$babBody->setTitle(absences_translate("Vacations requests list"));
110
			}
111
			
112
			
113
			
114
			$this->uncheckall = absences_translate("Uncheck all");
115
			$this->checkall = absences_translate("Check all");
0 ignored issues
show
Bug introduced by
The property checkall does not seem to exist. Did you mean t_checkall?

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
116
			$this->nametxt = absences_translate("Fullname");
117
			$this->begindatetxt = absences_translate("Begin date");
0 ignored issues
show
Bug introduced by
The property begindatetxt does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
118
			$this->enddatetxt = absences_translate("End date");
0 ignored issues
show
Bug introduced by
The property enddatetxt does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
119
			$this->quantitytxt = absences_translate("Quantity");
0 ignored issues
show
Bug introduced by
The property quantitytxt does not seem to exist. Did you mean quantity?

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
120
			$this->statustxt = absences_translate("Status");
0 ignored issues
show
Bug introduced by
The property statustxt does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
121
			$this->datetxt = absences_translate("Date")." ( ".absences_translate("dd-mm-yyyy")." )";
0 ignored issues
show
Bug introduced by
The property datetxt does not seem to exist. Did you mean begindatetxt?

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
122
			$this->filteron = absences_translate("Filter on");
0 ignored issues
show
Bug introduced by
The property filteron does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
123
			$this->usertxt = absences_translate("User");
0 ignored issues
show
Bug introduced by
The property usertxt does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
124
			$this->begintxt = absences_translate("Begin");
0 ignored issues
show
Bug introduced by
The property begintxt does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
125
			$this->endtxt = absences_translate("End");
0 ignored issues
show
Bug introduced by
The property endtxt does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
126
			$this->resettxt = absences_translate("Reset");
0 ignored issues
show
Bug introduced by
The property resettxt does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
127
			$this->alttxt = absences_translate("Modify");
0 ignored issues
show
Bug introduced by
The property alttxt does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
128
			$this->t_edit = absences_translate("Modification");
129
			$this->t_delete = absences_translate("Delete");
130
131
			$this->t_first_page = absences_translate("First page");
0 ignored issues
show
Bug introduced by
The property t_first_page does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
132
			$this->t_previous_page = absences_translate("Previous page");
0 ignored issues
show
Bug introduced by
The property t_previous_page does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
133
			$this->t_next_page = absences_translate("Next page");
0 ignored issues
show
Bug introduced by
The property t_next_page does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
134
			$this->t_last_page = absences_translate("Last page");
0 ignored issues
show
Bug introduced by
The property t_last_page does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
135
136
			$this->topurl = "";
0 ignored issues
show
Bug introduced by
The property topurl does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
137
			$this->bottomurl = "";
0 ignored issues
show
Bug introduced by
The property bottomurl does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
138
			$this->nexturl = "";
0 ignored issues
show
Bug introduced by
The property nexturl does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
139
			$this->prevurl = "";
0 ignored issues
show
Bug introduced by
The property prevurl does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
140
141
			$this->t_position = '';
0 ignored issues
show
Bug introduced by
The property t_position does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
142
143
			
144
			$this->statarr = array(absences_translate("Waiting"), absences_translate("Accepted"), absences_translate("Refused"), absences_translate('Previsional'));
0 ignored issues
show
Bug introduced by
The property statarr does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
145
			$this->dateb = $dateb;
0 ignored issues
show
Bug introduced by
The property dateb does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
146
			$this->datee = $datee;
0 ignored issues
show
Bug introduced by
The property datee does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
147
			$this->idstatus = $idstatus;
0 ignored issues
show
Bug introduced by
The property idstatus does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
148
			$this->userid = $userid;
0 ignored issues
show
Bug introduced by
The property userid does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
149
			$this->pos = $pos;
0 ignored issues
show
Bug introduced by
The property pos does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
150
			$this->userval = $userid != "" ? bab_toHtml(bab_getUserName($userid)) : "";
0 ignored issues
show
Bug introduced by
The property userval does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
151
			$aaareq = array();
152
			
153
			$req = 'absences_entries e, 
154
			     bab_users u LEFT JOIN absences_personnel p ON p.id_user=u.id WHERE ';
155
			
156
			$aaareq[] = 'u.id=e.id_user';
157
			$aaareq[] = 'e.archived='.$babDB->quote($archived);
158
			
159
			if( $idstatus != "" || $userid > 0 || $organization > 0 || $dateb != "" || $datee != "")
160
				{
161
162
				if( $idstatus != "")
163
					{
164
					switch($idstatus)
165
						{
166
						case 0:
167
							$aaareq[] = "e.status=''"; break;
168
						case 1:
169
							$aaareq[] = "e.status='Y'"; break;
170
						case 2:
171
							$aaareq[] = "e.status='N'"; break;
172
						case 3:
173
							$aaareq[] = "e.status='P'"; break;
174
						}
175
					}
176
177
				if( $userid > 0)
178
					{
179
					$aaareq[] = "e.id_user='".$babDB->db_escape_string($userid)."'";
180
					}
181
					
182
				if ($organization > 0) {
183
				    
184
				    $aaareq[] = "p.id_organization='".$babDB->db_escape_string($organization)."'";
185
				}
186
187 View Code Duplication
				if( $dateb != "" )
0 ignored issues
show
Duplication introduced by
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.

Loading history...
188
					{
189
					$ar = explode("-", $dateb);
190
					$dateb = $ar[2]."-".$ar[1]."-".$ar[0];
191
					}
192
193 View Code Duplication
				if( $datee != "" )
0 ignored issues
show
Duplication introduced by
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.

Loading history...
194
					{
195
					$ar = explode("-", $datee);
196
					$datee = $ar[2]."-".$ar[1]."-".$ar[0];
197
					}
198
199
				if( $datee != "" )
200
					{
201
					$aaareq[] = "e.date_begin <= DATE_ADD('".$babDB->db_escape_string($datee)."', INTERVAL 1 DAY)";
202
					}
203
				if( $dateb != "" )
204
					{
205
					$aaareq[] = "e.date_end >= '".$babDB->db_escape_string($dateb)."'";
206
					}
207
				}
208
209 View Code Duplication
			if( sizeof($aaareq) > 0 )
0 ignored issues
show
Duplication introduced by
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.

Loading history...
210
				{
211
				if( sizeof($aaareq) > 1 )
212
					$req .= implode(' AND ', $aaareq);
213
				else
214
					$req .= $aaareq[0];
215
				}
216
				
217
				
218
			$orderby = bab_rp('orderby', 'begin');
219
				
220
			$url = bab_url::request('tg', 'idx', 'idstatus', 'userid', 'dateb', 'datee', 'vpos', 'orderby', 'archived');
221
			
222
			$this->orderby = bab_toHtml($orderby);
0 ignored issues
show
Bug introduced by
The property orderby does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
223
224
			
225
			switch($orderby) {
226
			
227
				case 'begin.asc':
228
					$this->orderbyname = bab_url::mod($url, 'orderby', 'name');
0 ignored issues
show
Bug introduced by
The property orderbyname does not seem to exist. Did you mean orderby?

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
229
					$this->orderbybegin	= bab_url::mod($url, 'orderby', 'begin.desc');
0 ignored issues
show
Bug introduced by
The property orderbybegin does not seem to exist. Did you mean orderby?

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
230
					$req .= " ORDER BY e.date_begin ASC, u.lastname, u.firstname";
231
					break;
232
					
233
				case 'begin.desc':
234 View Code Duplication
				case 'begin':
0 ignored issues
show
Duplication introduced by
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.

Loading history...
235
					$this->orderbyname = bab_url::mod($url, 'orderby', 'name');
0 ignored issues
show
Bug introduced by
The property orderbyname does not seem to exist. Did you mean orderby?

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
236
					$this->orderbybegin	= bab_url::mod($url, 'orderby', 'begin.asc');
0 ignored issues
show
Bug introduced by
The property orderbybegin does not seem to exist. Did you mean orderby?

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
237
					$req .= " ORDER BY e.date_begin desc, u.lastname, u.firstname";
238
					break;
239
					
240 View Code Duplication
				case 'name.desc':
0 ignored issues
show
Duplication introduced by
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.

Loading history...
241
					$this->orderbyname = bab_url::mod($url, 'orderby', 'name.asc');
0 ignored issues
show
Bug introduced by
The property orderbyname does not seem to exist. Did you mean orderby?

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
242
					$this->orderbybegin	= bab_url::mod($url, 'orderby', 'begin');
0 ignored issues
show
Bug introduced by
The property orderbybegin does not seem to exist. Did you mean orderby?

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
243
					$req .= " ORDER BY u.lastname DESC, u.firstname DESC, e.date desc";
244
					break;
245
					
246
				case 'name.asc':
247 View Code Duplication
				case 'name':
0 ignored issues
show
Duplication introduced by
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.

Loading history...
248
					$this->orderbyname = bab_url::mod($url, 'orderby', 'name.desc');
0 ignored issues
show
Bug introduced by
The property orderbyname does not seem to exist. Did you mean orderby?

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
249
					$this->orderbybegin	= bab_url::mod($url, 'orderby', 'begin');
0 ignored issues
show
Bug introduced by
The property orderbybegin does not seem to exist. Did you mean orderby?

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
250
					$req .= " ORDER BY u.lastname ASC, u.firstname ASC, e.date desc";
251
					break;
252
			}
253
			
254
255
			list($total) = $babDB->db_fetch_row($babDB->db_query("select count(*) as total from ".$req));
256
			$this->paginate($total, ABSENCES_MAX_REQUESTS_LIST);
0 ignored issues
show
Bug introduced by
The method paginate() does not seem to exist on object<temp>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
257
258
259
			if( $total > ABSENCES_MAX_REQUESTS_LIST)
260
				{
261
				$req .= " limit ".$pos.",".ABSENCES_MAX_REQUESTS_LIST;
262
				}
263
			
264
				
265
			bab_debug("select e.*, u.lastname, u.firstname from ".$req);
266
267
			$this->res = $babDB->db_query("select e.*, u.lastname, u.firstname from ".$req);
268
			$this->count = $babDB->db_num_rows($this->res);
269
			
270
			
271
			$this->searchform = $this->getSearchForm();
0 ignored issues
show
Bug introduced by
The property searchform does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
Bug introduced by
The method getSearchForm() does not seem to exist on object<temp>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
272
			}
273
			
274
		/**
275
		 * @return string
276
		 */
277
		private function getSearchForm()
278
		{
279
			$f = new absences_getRequestSearchForm();
280
			return $f->getHtmlForm($this->statarr);
281
		}
282
			
283
			
284 View Code Duplication
		private function param($name, $default = '')
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in 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.

Loading history...
285
		{
286
			if (isset($_REQUEST[$name]))
287
			{
288
				$_SESSION['babVacation'][$name] = $_REQUEST[$name];
289
				return $_REQUEST[$name];
290
			}
291
			
292
			if (isset($_SESSION['babVacation'][$name]))
293
			{
294
				return $_SESSION['babVacation'][$name];
295
			}
296
			
297
			return $default;
298
		}
299
300
		public function getnext()
301
			{
302
			global $babDB;
303
			static $i = 0;
304
			if( $i < $this->count)
305
				{
306
				$this->altbg = !$this->altbg;
307
				$arr = $babDB->db_fetch_array($this->res);
308
				
309
				$entry = new absences_Entry();
310
				$entry->setRow($arr);
311
				
312
				$this->urlname		= bab_toHtml($arr['lastname'].' '.$arr['firstname']);
313
				$this->url 			= bab_toHtml(absences_addon()->getUrl()."vacadmb&idx=morvw&id=".$arr['id']);
314
				$this->editconfirmed = false;
0 ignored issues
show
Bug introduced by
The property editconfirmed does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
315
				if ($entry->firstconfirm && '' === $entry->status) {
316
				    $this->editconfirmed = absences_translate('Modification of an allready confirmed request');
317
				}
318
				
319
				$this->todelete = false;
0 ignored issues
show
Bug introduced by
The property todelete does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
320
				if ($entry->todelete) {
321
				    $this->todelete = absences_translate('Deletion request');
322
				}
323
				
324
				$this->editurl 		= bab_toHtml($entry->getEditUrl(1));
0 ignored issues
show
Bug introduced by
The property editurl does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
325
				$url = absences_addon()->getUrl()."vacadmb&idx=lreq";
326
				$this->urldelete 	= bab_toHtml(absences_addon()->getUrl()."vacadmb&idx=delete&id_entry=".$arr['id']."&from=".urlencode($url));
0 ignored issues
show
Bug introduced by
The property urldelete does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
327
				$this->quantity		= bab_toHtml(absences_vacEntryQuantity($arr['id']));
328
				
329
				$this->begindate	= bab_toHtml(absences_shortDate(bab_mktime($arr['date_begin'])));
0 ignored issues
show
Bug introduced by
The property begindate does not seem to exist. Did you mean begindatetxt?

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
330
				$this->enddate		= bab_toHtml(absences_shortDate(bab_mktime($arr['date_end'])));
0 ignored issues
show
Bug introduced by
The property enddate does not seem to exist. Did you mean enddatetxt?

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
331
332
				$this->status = $entry->getStatusStr();
0 ignored issues
show
Bug introduced by
The property status does not seem to exist. Did you mean statustxt?

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
333
				
334
				$i++;
335
				return true;
336
				}
337
			else
338
				return false;
339
340
			}
341
342 View Code Duplication
		function getnextstatus()
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
Duplication introduced by
This method seems to be duplicated in 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.

Loading history...
343
			{
344
			static $i = 0;
345
			if( $i < count($this->statarr))
346
				{
347
				$this->statusid = $i;
0 ignored issues
show
Bug introduced by
The property statusid does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
348
				$this->statusname = bab_toHtml($this->statarr[$i]);
0 ignored issues
show
Bug introduced by
The property statusname does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
349
				if( $this->idstatus != "" && $i == $this->idstatus )
350
					$this->selected = "selected";
0 ignored issues
show
Bug introduced by
The property selected does not seem to exist. Did you mean yselected?

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
351
				else
352
					$this->selected = "";
0 ignored issues
show
Bug introduced by
The property selected does not seem to exist. Did you mean yselected?

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
353
				$i++;
354
				return true;
355
				}
356
			else
357
				return false;
358
			}
359
		}
360
361
	$temp = new temp();
0 ignored issues
show
Bug introduced by
The call to temp::temp() misses some required arguments starting with $vtid.
Loading history...
362
	
363
	/*@var $babBody babBody */
364
365
	
366
	absences_addSpoofButton('entry', absences_translate('Add a vacation request'));
367
	
368
	$babBody->addStyleSheet(absences_addon()->getStylePath().'vacation.css');
369
	$babBody->addJavascriptFile($GLOBALS['babInstallPath'].'scripts/bab_dialog.js');
370
	$babBody->babecho(	bab_printTemplate($temp,  absences_addon()->getRelativePath()."vacadmb.html", "vrequestslist"));
0 ignored issues
show
Deprecated Code introduced by
The method bab_addonInfos::getRelativePath() has been deprecated with message: Do not use relative path in addons Addons are subject to move out of the core folder in futures version for bab_printTemplate, replace with $addon->printTemplate() for babBody->addStyleSheet use $addon->getStylePath() instead of relative path the addStyleSheet method support full path starting with vendor/ since the 8.1.98 version

This method has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.

Loading history...
371
	return $temp->count;
372
}
373
374
function editVacationRequest($vrid)
375
{
376
	global $babBody;
377
	class temp
0 ignored issues
show
Comprehensibility Best Practice introduced by
The type temp has been defined more than once; this definition is ignored, only the first definition in programs/vacadm.php (L38-118) is considered.

This check looks for classes that have been defined more than once.

If you can, we would recommend to use standard object-oriented programming techniques. For example, to avoid multiple types, it might make sense to create a common interface, and then multiple, different implementations for that interface.

This also has the side-effect of providing you with better IDE auto-completion, static analysis and also better OPCode caching from PHP.

Loading history...
378
		{
379
		var $datebegin;
380
		var $dateend;
381
		var $vactype;
382
		var $addvac;
383
384
		var $daybeginid;
385
		var $monthbeginid;
386
		var $nbdaystxt;
387
388
		var $remark;
389
390
		var $res;
391
		var $count;
392
		
393
		var $daybegin;
394
		var $monthbegin;
395
		var $yearbegin;
396
		var $dayend;
397
		var $monthend;
398
		var $yearend;
399
		var $halfdaybegin;
400
		var $halfdayend;
401
		var $nbdays;
402
		var $remarks;
403
404
		var $daysel;
405
		var $monthsel;
406
		var $yearsel;
407
		var $halfdaysel;
408
		var $totaltxt;
409
		var $totalval;
410
411
		var $invaliddate;
412
		var $invaliddate2;
413
		var $invalidentry;
414
		var $invalidentry1;
415
		var $invalidentry2;
416
		var $iduser;
417
		var $deletetxt;
418
419
		function temp($id)
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
420
			{
421
			global $babBody, $babDB;
422
			$this->vrid = $id;
0 ignored issues
show
Bug introduced by
The property vrid does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
423
			$this->datebegintxt = absences_translate("Begin date");
0 ignored issues
show
Bug introduced by
The property datebegintxt does not seem to exist. Did you mean begintxt?

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
424
			$this->dateendtxt = absences_translate("End date");
0 ignored issues
show
Bug introduced by
The property dateendtxt does not seem to exist. Did you mean endtxt?

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
425
			$this->vactype = absences_translate("Vacation type");
0 ignored issues
show
Bug introduced by
The property vactype does not seem to exist. Did you mean vactypes?

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
426
			$this->addvac = absences_translate("Update");
0 ignored issues
show
Bug introduced by
The property addvac does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
427
			$this->remark = absences_translate("Remarks");
0 ignored issues
show
Bug introduced by
The property remark does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
428
			$this->nbdaystxt = absences_translate("Quantity");
0 ignored issues
show
Bug introduced by
The property nbdaystxt does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
429
			$this->invaliddate = absences_translate("ERROR: End date must be older");
0 ignored issues
show
Bug introduced by
The property invaliddate does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
430
			$this->invaliddate = str_replace("'", "\'", $this->invaliddate);
431
			$this->invaliddate = str_replace('"', "'+String.fromCharCode(34)+'",$this->invaliddate);
432
			$this->invaliddate2 = absences_translate("Total days does'nt fit between dates");
0 ignored issues
show
Bug introduced by
The property invaliddate2 does not seem to exist. Did you mean invaliddate?

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
433
			$this->invaliddate2 = str_replace("'", "\'", $this->invaliddate2);
0 ignored issues
show
Bug introduced by
The property invaliddate2 does not seem to exist. Did you mean invaliddate?

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
434
			$this->invaliddate2 = str_replace('"', "'+String.fromCharCode(34)+'",$this->invaliddate2);
0 ignored issues
show
Bug introduced by
The property invaliddate2 does not seem to exist. Did you mean invaliddate?

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
435
			$this->invalidentry = absences_translate("Invalid entry!  Only numbers are accepted or . !");
0 ignored issues
show
Bug introduced by
The property invalidentry does not seem to exist. Did you mean invalidentry1?

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
436
			$this->invalidentry = str_replace("'", "\'", $this->invalidentry);
0 ignored issues
show
Bug introduced by
The property invalidentry does not seem to exist. Did you mean invalidentry1?

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
437
			$this->invalidentry = str_replace('"', "'+String.fromCharCode(34)+'",$this->invalidentry);
0 ignored issues
show
Bug introduced by
The property invalidentry does not seem to exist. Did you mean invalidentry1?

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
438
			$this->totaltxt = absences_translate("Total");
0 ignored issues
show
Bug introduced by
The property totaltxt does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
439
			$this->invalidentry1 = absences_translate("Invalid entry");
440
			$this->invalidentry2 = absences_translate("Days must be multiple of 0.5");
0 ignored issues
show
Bug introduced by
The property invalidentry2 does not seem to exist. Did you mean invalidentry1?

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
441
			$this->balancetxt = absences_translate("Balance");
0 ignored issues
show
Bug introduced by
The property balancetxt does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
442
443
			$arr = $babDB->db_fetch_array($babDB->db_query("select * from ".ABSENCES_ENTRIES_TBL." where id='".$babDB->db_escape_string($id)."'"));
444
			$this->iduser = $arr['id_user'];
0 ignored issues
show
Bug introduced by
The property iduser does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
445
446
			
447
			include_once $GLOBALS['babInstallPath']."utilit/dateTime.php";
448
			
449
450
			$date_begin = BAB_DateTime::fromIsoDateTime($arr['date_begin']);
451
			$date_end	= BAB_DateTime::fromIsoDateTime($arr['date_end']);
452
			
453
			
454
			$this->daybegin		= $date_begin->getDayOfMonth();
0 ignored issues
show
Bug introduced by
The property daybegin does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
455
			$this->daysel		= $this->daybegin;
0 ignored issues
show
Bug introduced by
The property daysel does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
456
457
			
458
459
			$this->monthbegin	= $date_begin->getMonth();
0 ignored issues
show
Bug introduced by
The property monthbegin does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
460
			$this->monthsel		= $this->monthbegin;
0 ignored issues
show
Bug introduced by
The property monthsel does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
461
			
462
			$this->yearbegin 	= $date_begin->getYear();
0 ignored issues
show
Bug introduced by
The property yearbegin does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
463
			$this->yearsel 		= $this->yearbegin;
0 ignored issues
show
Bug introduced by
The property yearsel does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
464
			$this->timestampbegin	= $date_begin->getTimeStamp();
0 ignored issues
show
Bug introduced by
The property timestampbegin does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
465
			$this->timestampsel	= $this->timestampbegin;
0 ignored issues
show
Bug introduced by
The property timestampsel does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
466
			
467
			
468
			$this->dayend		= $date_end->getDayOfMonth();
0 ignored issues
show
Bug introduced by
The property dayend does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
469
470
			$this->monthend		= $date_end->getMonth();
0 ignored issues
show
Bug introduced by
The property monthend does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
471
			
472
			$this->yearend 		= $date_end->getYear();
0 ignored issues
show
Bug introduced by
The property yearend does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
473
			$this->yearendsel 	= $this->yearend;
0 ignored issues
show
Bug introduced by
The property yearendsel does not seem to exist. Did you mean yearend?

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
474
			$this->timestampend	= $date_end->getTimeStamp();
0 ignored issues
show
Bug introduced by
The property timestampend does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
475
476
477
			$this->hourbegin	= date('H:i:s', $date_begin->getTimeStamp());
0 ignored issues
show
Bug introduced by
The property hourbegin does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
478
			$this->hoursel 		= $this->hourbegin;
0 ignored issues
show
Bug introduced by
The property hoursel does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
479
			$this->hourend		= date('H:i:s', $date_end->getTimeStamp());
0 ignored issues
show
Bug introduced by
The property hourend does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
480
			
481
482
			$this->remarks		= $arr['comment'];
0 ignored issues
show
Bug introduced by
The property remarks does not seem to exist. Did you mean remark?

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
483
			
484
			$this->startyear = $this->yearbegin - 5;
0 ignored issues
show
Bug introduced by
The property startyear does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
485
486
			$this->res = $babDB->db_query("
487
					select 
488
						e.id_right,
489
						e.quantity, 
490
						e.id,
491
						r.description,
492
						r.quantity right_quantity,
493
						r.quantity_unit 
494
					 
495
					FROM ".ABSENCES_ENTRIES_ELEM_TBL." e,
496
						absences_rights r
497
					where 
498
						e.id_entry=".$babDB->quote($id)." 
499
						AND r.id = e.id_right 
500
				");
501
			$this->count = $babDB->db_num_rows($this->res);
502
			$this->totalval = 0;
0 ignored issues
show
Bug introduced by
The property totalval does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
503
504
			$this->dayType = array(absences_translate("Morning"), absences_translate("Afternoon"));
0 ignored issues
show
Bug introduced by
The property dayType does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
505
			
506
			$babBody->addJavascriptFile($GLOBALS['babInstallPath'].'scripts/bab_dialog.js');
507
			
508
			$this->hours = absences_hoursList($GLOBALS['BAB_SESS_USERID']);
0 ignored issues
show
Bug introduced by
The property hours does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
509
		}
510
511
512
		function getnexttype()
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
513
			{
514
			static $i = 0;
515
			global $babDB;
516
			if( $i < $this->count)
517
				{
518
				$arr = $babDB->db_fetch_array($this->res);
519
520
				$this->typename = bab_toHtml($arr['description']);
0 ignored issues
show
Bug introduced by
The property typename does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
521
				$this->id_entry_elem = bab_toHtml($arr['id']);
0 ignored issues
show
Bug introduced by
The property id_entry_elem does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
522
				$this->nbdays = $arr['quantity'];
0 ignored issues
show
Bug introduced by
The property nbdays does not seem to exist. Did you mean nbdaystxt?

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
523
				$this->totalval += $this->nbdays;
0 ignored issues
show
Bug introduced by
The property nbdays does not seem to exist. Did you mean nbdaystxt?

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
524
525
				$row2 = $babDB->db_fetch_array($babDB->db_query("select sum(quantity) as total from ".ABSENCES_ENTRIES_ELEM_TBL." ee
526
				join ".ABSENCES_ENTRIES_TBL." e 
527
				where e.id_user='".$babDB->db_escape_string($this->iduser)."' 
528
					and e.status!='N' 
529
					and ee.id_right='".$babDB->db_escape_string($arr['id_right'])."' 
530
					and ee.id_entry=e.id"));
531
532
				$qdp = isset($row2['total'])? $row2['total'] : 0;
533
534
				list($quant) = $babDB->db_fetch_row($babDB->db_query("select quantity from ".ABSENCES_USERS_RIGHTS_TBL." where id_right='".$babDB->db_escape_string($arr['id_right'])."' and id_user='".$babDB->db_escape_string($this->iduser)."'"));
535
				if( $quant == '' )
536
					$quant = $arr['right_quantity'];
537
				
538 View Code Duplication
				switch($arr['quantity_unit'])
0 ignored issues
show
Duplication introduced by
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.

Loading history...
539
				{
540
					case 'D':
541
						$this->unit = absences_translate('day(s)');
0 ignored issues
show
Bug introduced by
The property unit does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
542
						break;
543
					case 'H':
544
						$this->unit = absences_translate('hour(s)');
545
						break;
546
				}
547
548
				$this->quantity_available = $quant - $qdp;
0 ignored issues
show
Bug introduced by
The property quantity_available does not seem to exist. Did you mean quantity?

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
549
				$i++;
550
				return true;
551
				}
552
			else
553
				{
554
				$this->daysel = $this->dayend;
555
				$i = 1;
556
				return false;
557
				}
558
559
			}
560
561
562
		function getnextday()
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
563
			{
564
			static $i = 1;
565
566
			if( $i <= date('t', $this->timestampsel))
567
				{
568
				$this->dayid = $i;
0 ignored issues
show
Bug introduced by
The property dayid does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
569
				if( $this->daysel == $i)
570
					{
571
					$this->selected = "selected";
0 ignored issues
show
Bug introduced by
The property selected does not seem to exist. Did you mean yselected?

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
572
					}
573
				else
574
					$this->selected = "";
0 ignored issues
show
Bug introduced by
The property selected does not seem to exist. Did you mean yselected?

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
575
				
576
				$i++;
577
				return true;
578
				}
579
			else
580
				{
581
				$this->daysel = $this->dayend;
582
				$this->timestampsel = $this->timestampend;
583
				$i = 1;
584
				return false;
585
				}
586
587
			}
588
589
		function getnextmonth()
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
590
			{
591
			static $i = 1;
592
593
			if( $i < 13)
594
				{
595
				$this->monthid = $i;
0 ignored issues
show
Bug introduced by
The property monthid does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
596
				$this->monthname = bab_DateStrings::getMonth($i);
0 ignored issues
show
Bug introduced by
The property monthname does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
597
				if( $this->monthsel == $i)
598
					{
599
					$this->selected = "selected";
0 ignored issues
show
Bug introduced by
The property selected does not seem to exist. Did you mean yselected?

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
600
					}
601
				else
602
					$this->selected = "";
0 ignored issues
show
Bug introduced by
The property selected does not seem to exist. Did you mean yselected?

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
603
604
				$i++;
605
				return true;
606
				}
607
			else
608
				{
609
				$this->monthsel = $this->monthend;
610
				$i = 1;
611
				return false;
612
				}
613
614
			}
615
		function getnextyear()
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
616
			{
617
			static $i = 0;
618
			if( $i < 20)
619
				{
620
				$this->yearidval = $this->startyear + $i;
0 ignored issues
show
Bug introduced by
The property yearidval does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
621
				if( $this->yearsel == $this->yearidval )
622
					{
623
					$this->selected = "selected";
0 ignored issues
show
Bug introduced by
The property selected does not seem to exist. Did you mean yselected?

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
624
					}
625
				else
626
					$this->selected = "";
0 ignored issues
show
Bug introduced by
The property selected does not seem to exist. Did you mean yselected?

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
627
				$i++;
628
				return true;
629
				}
630
			else
631
				{
632
				$this->yearsel = $this->yearendsel;
0 ignored issues
show
Bug introduced by
The property yearendsel does not seem to exist. Did you mean yearend?

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
633
				$i = 0;
634
				return false;
635
				}
636
637
			}
638
		function getnexthour()
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
639
			{
640
			if (list($key, $value) = each($this->hours))
641
			{
642
				$this->value = bab_toHtml($key);
0 ignored issues
show
Bug introduced by
The property value does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
643
				$this->option = bab_toHtml($value);
0 ignored issues
show
Bug introduced by
The property option does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
644
				if ($this->hoursel === $this->value)
645
				{
646
					$this->selected = "selected";
0 ignored issues
show
Bug introduced by
The property selected does not seem to exist. Did you mean yselected?

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
647
				} else {
648
					$this->selected = "";
0 ignored issues
show
Bug introduced by
The property selected does not seem to exist. Did you mean yselected?

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
649
				}
650
				return true;
651
			}
652
			
653
			$this->hoursel = $this->hourend;
654
			reset($this->hours);
655
			return false;
656
			}
657
658
		}
659
660
	$temp = new temp($vrid);
0 ignored issues
show
Bug introduced by
The call to temp::temp() misses some required arguments starting with $what.
Loading history...
661
	$babBody->babecho( bab_printTemplate($temp, absences_addon()->getRelativePath()."vacadmb.html", "editvacrequest"));
0 ignored issues
show
Deprecated Code introduced by
The method bab_addonInfos::getRelativePath() has been deprecated with message: Do not use relative path in addons Addons are subject to move out of the core folder in futures version for bab_printTemplate, replace with $addon->printTemplate() for babBody->addStyleSheet use $addon->getStylePath() instead of relative path the addStyleSheet method support full path starting with vendor/ since the 8.1.98 version

This method has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.

Loading history...
662
}
663
664
665
666
function deleteVacationRequests($dateb, $userid)
667
	{
668
	global $babBody, $babDB;
669
	class tempa
0 ignored issues
show
Comprehensibility Best Practice introduced by
The type tempa has been defined more than once; this definition is ignored, only the first definition in programs/utilit/vacincl.php (L1109-1321) is considered.

This check looks for classes that have been defined more than once.

If you can, we would recommend to use standard object-oriented programming techniques. For example, to avoid multiple types, it might make sense to create a common interface, and then multiple, different implementations for that interface.

This also has the side-effect of providing you with better IDE auto-completion, static analysis and also better OPCode caching from PHP.

Loading history...
670
		{
671
		var $datetxt;
672
		var $dateformattxt;
673
		var $delete;
674
		var $usertext;
675
		var $usersbrowurl;
676
		var $dateburl;
677
678
		function tempa($dateb, $userid)
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
679
			{
680
			global $babDB;
681
			$this->datetxt = absences_translate("End date");
0 ignored issues
show
Bug introduced by
The property datetxt does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
682
			$this->dateformattxt = "( ".absences_translate("dd-mm-yyyy")." )";
0 ignored issues
show
Bug introduced by
The property dateformattxt does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
683
			$this->delete = absences_translate("Delete");
0 ignored issues
show
Bug introduced by
The property delete does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
684
			$this->usertext = absences_translate("User");
0 ignored issues
show
Bug introduced by
The property usertext does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
685
			$this->usersbrowurl = absences_addon()->getUrl()."vacadm&idx=browu&cb=";
0 ignored issues
show
Bug introduced by
The property usersbrowurl does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
686
			$this->dateburl = $GLOBALS['babUrlScript']."?tg=month&callback=dateBegin&ymin=10&ymax=0";
0 ignored issues
show
Bug introduced by
The property dateburl does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
687
			if( $dateb != "" )
688
				$this->datebval = $dateb;
0 ignored issues
show
Bug introduced by
The property datebval does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
689
			else
690
				$this->datebval = "";
691
			if( $userid != "" )
692
				{
693
				$this->userval = bab_getUserName($userid);
0 ignored issues
show
Bug introduced by
The property userval does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
694
				$this->userid =$userid;
0 ignored issues
show
Bug introduced by
The property userid does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
695
				}
696
			else
697
				{
698
				$this->userval ="";
699
				$this->userid ="";
700
				}
701
			}
702
		}
703
704
	$temp = new tempa($dateb, $userid);
705
	$babBody->babecho(bab_printTemplate($temp, absences_addon()->getRelativePath()."vacadmb.html", "reqdelete"));
0 ignored issues
show
Deprecated Code introduced by
The method bab_addonInfos::getRelativePath() has been deprecated with message: Do not use relative path in addons Addons are subject to move out of the core folder in futures version for bab_printTemplate, replace with $addon->printTemplate() for babBody->addStyleSheet use $addon->getStylePath() instead of relative path the addStyleSheet method support full path starting with vendor/ since the 8.1.98 version

This method has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.

Loading history...
706
	}
707
708
function deleteInfoVacationRequests($dateb, $userid)
709
	{
710
	global $babBody;
711
	
712
	class temp
0 ignored issues
show
Comprehensibility Best Practice introduced by
The type temp has been defined more than once; this definition is ignored, only the first definition in programs/vacadm.php (L38-118) is considered.

This check looks for classes that have been defined more than once.

If you can, we would recommend to use standard object-oriented programming techniques. For example, to avoid multiple types, it might make sense to create a common interface, and then multiple, different implementations for that interface.

This also has the side-effect of providing you with better IDE auto-completion, static analysis and also better OPCode caching from PHP.

Loading history...
713
		{
714
		var $warning;
715
		var $message;
716
		var $title;
717
		var $urlyes;
718
		var $urlno;
719
		var $yes;
720
		var $no;
721
722
		function temp($dateb, $userid)
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
723
			{
724
			$this->message = absences_translate("Are you sure you want to remove the requests which finish before the following date ").$dateb;
0 ignored issues
show
Bug introduced by
The property message does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
725
			if( $userid == "" )
726
				$this->title = bab_getUserName("All users");
0 ignored issues
show
Bug introduced by
The property title does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
727
			else
728
				$this->title = bab_getUserName($userid);
729
			$this->warning = absences_translate("WARNING: This operation will delete vacations requests"). "!";
0 ignored issues
show
Bug introduced by
The property warning does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
730
			$this->urlyes = absences_addon()->getUrl()."vacadmb&idx=lreq&date=".$dateb."&userid=".$userid."&action=Yes";
0 ignored issues
show
Bug introduced by
The property urlyes does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
731
			$this->yes = absences_translate("Yes");
0 ignored issues
show
Bug introduced by
The property yes does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
732
			$this->urlno = absences_addon()->getUrl()."vacadmb&idx=lreq";
0 ignored issues
show
Bug introduced by
The property urlno does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
733
			$this->no = absences_translate("No");
0 ignored issues
show
Bug introduced by
The property no does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
734
			}
735
		}
736
737
	$ret = true;
738
	if( $dateb == "" )
739
		{
740
		$ret = false;
741
		}
742
743
	$ar = explode("-", $dateb);
744
	if( count($ar) != 3 || !is_numeric($ar[0]) || !is_numeric($ar[1]) || !is_numeric($ar[2]))
745
		{
746
		$ret = false;
747
		}
748
749
	if( $ar[0] <= 0 || $ar[1] <= 0 || $ar[2] <= 0)
750
		{
751
		$ret = false;
752
		}
753
754
	if( !$ret )
755
		{
756
		$babBody->msgerror = absences_translate("You must provide a correct date");
757
		return false;
758
		}
759
760
	$temp = new temp($dateb, $userid);
0 ignored issues
show
Bug introduced by
The call to temp::temp() misses some required arguments starting with $tname.
Loading history...
761
	$babBody->babecho( bab_printTemplate($temp, absences_addon()->getRelativePath()."warning.html", "warningyesno"));
0 ignored issues
show
Deprecated Code introduced by
The method bab_addonInfos::getRelativePath() has been deprecated with message: Do not use relative path in addons Addons are subject to move out of the core folder in futures version for bab_printTemplate, replace with $addon->printTemplate() for babBody->addStyleSheet use $addon->getStylePath() instead of relative path the addStyleSheet method support full path starting with vendor/ since the 8.1.98 version

This method has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.

Loading history...
762
	return true;
763
	}
764
765
	
766
	
767
function updateVacationRequest($daybegin, $monthbegin, $yearbegin,$dayend, $monthend, $yearend, $hourbegin, $hourend, $remarks, $vrid, $quantity)
768
{
769
	global $babBody, $babDB;
770
	$nbdays = array();
771
772
	$res = $babDB->db_query("select * from ".ABSENCES_ENTRIES_ELEM_TBL." where id_entry='".$babDB->db_escape_string($vrid)."'");
773
774
	$ntotal = 0;
775
	while( $arr = $babDB->db_fetch_array($res))
776
	{
777
		if( isset($quantity[$arr['id']]))
778
		{
779
			$nbd = $quantity[$arr['id']];
780
			if( !is_numeric($nbd) || $nbd < 0 )
781
				{
782
				$babBody->msgerror = absences_translate("You must specify a correct number days") ." !";
783
				return false;
784
				}
785
			
786
			if( $nbd >= 0 )
787
			{
788
				$nbdays['id'][] = $arr['id'];
789
				$nbdays['val'][] = $nbd;
790
				$ntotal += $nbd;
791
			}
792
		}
793
	}
794
795
	$begin = bab_mktime("$yearbegin-$monthbegin-$daybegin $hourbegin");
796
	$end = bab_mktime("$yearend-$monthend-$dayend $hourend");
797
798
	if( $begin >= $end) {
799
		$babBody->msgerror = absences_translate("ERROR: End date must be older")." !";
800
		return false;
801
	}
802
	
803
	$res = $babDB->db_query("
804
		SELECT 
805
			date_begin,
806
			date_end,
807
			id_user 
808
		FROM ".ABSENCES_ENTRIES_TBL." 
809
		WHERE 
810
			id='".$babDB->db_escape_string($vrid)."'
811
		");
812
		
813
	$old = $babDB->db_fetch_assoc($res);
814
	
815
	$old_begin = bab_mktime($old['date_begin']);
816
	$old_end = bab_mktime($old['date_end']);
817
818
819
	$b = date('Y-m-d H:i:s', $begin);
820
	$e = date('Y-m-d H:i:s', $end);
821
	
822
	
823
824
	
825
	
826
827
	$babDB->db_query("
828
		update ".ABSENCES_ENTRIES_TBL." SET 
829
			date_begin	= '".$babDB->db_escape_string($b)."', 
830
			date_end	= '".$babDB->db_escape_string($e)."',  
831
			comment		= '".$babDB->db_escape_string($remarks)."' 
832
		where 
833
			id='".$babDB->db_escape_string($vrid)."'
834
		");
835
836
	for( $i = 0; $i < count($nbdays['id']); $i++)
0 ignored issues
show
Performance Best Practice introduced by
It seems like you are calling the size function count() as part of the test condition. You might want to compute the size beforehand, and not on each iteration.

If the size of the collection does not change during the iteration, it is generally a good practice to compute it beforehand, and not on each iteration:

for ($i=0; $i<count($array); $i++) { // calls count() on each iteration
}

// Better
for ($i=0, $c=count($array); $i<$c; $i++) { // calls count() just once
}
Loading history...
837
		{
838
		if( $nbdays['val'][$i] > 0 ) {
839
			$babDB->db_query("update ".ABSENCES_ENTRIES_ELEM_TBL." set quantity='".$babDB->db_escape_string($nbdays['val'][$i])."' where id='".$babDB->db_escape_string($nbdays['id'][$i])."'");
840
		}
841
		else {
842
			$babDB->db_query("delete from ".ABSENCES_ENTRIES_ELEM_TBL." where id='".$babDB->db_escape_string($nbdays['id'][$i])."'");
843
		}
844
	}
845
	
846
	
847
	require_once $GLOBALS['babInstallPath'].'utilit/dateTime.php';
848
	absences_updatePeriod($vrid, BAB_DateTime::fromIsoDateTime($b), BAB_DateTime::fromIsoDateTime($e));
849
	
850
	
851
	$period_begin	= $old_begin 	< $begin 	? $old_begin 	: $begin;
852
	$period_end 	= $old_end 		> $end 		? $old_end 		: $end;
853
	
854
855
	include_once $GLOBALS['babInstallPath']."utilit/eventperiod.php";
856
	$event = new bab_eventPeriodModified($period_begin, $period_end, $old['id_user']);
857
	$event->types = BAB_PERIOD_VACATION;
858
	bab_fireEvent($event);
859
	
860
	return true;
861
}
862
863
864
function doDeleteVacationRequests($date, $userid)
865
{
866
	global $babDB;
867
868
	$ar = explode("-", $date);
869
	$dateb = sprintf("%04d-%02d-%02d", $ar[2], $ar[1], $ar[0]);
870
871
	$req = "SELECT id FROM ".ABSENCES_ENTRIES_TBL." WHERE date_end <= ".$babDB->quote($dateb);
872
	if( $userid != "" )
873
		$req .= " and id_user=".$babDB->quote($userid);
874
875
	$res = 	$babDB->db_query($req);
876
	while( $arr = $babDB->db_fetch_array($res))
877
	{
878
		absences_delete_request($arr['id']);
879
	}
880
}
881
882
883
884
/* main */
885
bab_requireCredential();
886
$agent = absences_Agent::getCurrentUser();
887
if( !$agent->isManager())
888
	{
889
	$babBody->msgerror = absences_translate("Access denied");
890
	return;
891
	}
892
893
894
$idx = bab_rp('idx', "lreq");
895
$Submit = bab_pp('Submit', null);
896
897
if( bab_rp('add') == "modvr")
898
{
899
	if( isset($Submit))
900
	{
901
	if(!updateVacationRequest(bab_pp('daybegin'), bab_pp('monthbegin'), bab_pp('yearbegin'),bab_pp('dayend'), bab_pp('monthend'), bab_pp('yearend'), bab_pp('hourbegin'), bab_pp('hourend'), bab_pp('remarks'), bab_pp('vrid'), bab_pp('quantity')))
902
		$idx = "vunew";
903
	}
904
	else if( isset($bdelete))
905
	{
906
		$idx = "delur";
907
	}
908
}
909
else if( bab_rp('action') == "Yes")
910
	{
911
	doDeleteVacationRequests(bab_rp('date'), bab_rp('userid'));
912
	}
913
914
if ($agent->isInPersonnel())
915
{
916
	$babBody->addItemMenu("vacuser", absences_translate("Vacations"), absences_addon()->getUrl()."vacuser");
917
}
918
919
$babBody->addItemMenu("menu", absences_translate("Management"), absences_addon()->getUrl()."vacadm&idx=menu");
920
921
922
923
924
925
/**
926
 * Manually update the calendar for one absence entry
927
 * @param int $id
928
 */
929
function absences_updateEntryCalendar($id) {
930
    $entry = absences_Entry::getById($id);
931
    $entry->updateCalendar();
932
}
933
934
935
936
		
937
$pos = bab_rp('pos');
938
$idcol = bab_rp('idcol');
939
$idsa = bab_rp('idsa');		
940
941
switch($idx)
942
	{
943 View Code Duplication
	case "morvw":
0 ignored issues
show
Duplication introduced by
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.

Loading history...
944
		require_once dirname(__FILE__).'/utilit/request.ui.php';
945
		$babBody->addItemMenu("lreq", absences_translate("Requests"), absences_addon()->getUrl()."vacadmb&idx=lreq");
946
		$babBody->addItemMenu("morvw", absences_translate("View"), absences_addon()->getUrl()."vacadmb&idx=morvw&id=".bab_rp('id'));
947
		absences_viewVacationRequestDetail(bab_rp('id'), true);
948
		break;
949
		
950
	case 'updcal':
951
	    if (bab_isUserAdministrator()) {
952
    	    absences_updateEntryCalendar(bab_rp('id'));
953
	    }
954
	    break;
955
	    
956
	    
957
    case 'crecal':
958
        if (bab_isUserAdministrator()) {
959
            // warning, this can create duplicates
960
            absences_createPeriod(bab_rp('id'));
961
        }
962
        break;
963
		
964
965 View Code Duplication
	case "edvr":
0 ignored issues
show
Duplication introduced by
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.

Loading history...
966
		$babBody->title = absences_translate("Edit request vacation");
967
		editVacationRequest(bab_rp('id'));
968
		$babBody->addItemMenu("lreq", absences_translate("Requests"), absences_addon()->getUrl()."vacadmb&idx=lreq");
969
		$babBody->addItemMenu("edvr", absences_translate("Modify"), absences_addon()->getUrl()."vacadmb&idx=edvr");
970
		break;
971
972
973
		
974 View Code Duplication
	case "ddreq":
0 ignored issues
show
Duplication introduced by
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.

Loading history...
975
		$babBody->title = absences_translate("Delete vacations requests");
976
		if(!empty($_POST)) {
977
			deleteInfoVacationRequests(bab_rp('dateb'), bab_rp('userid'));
978
		} else {
979
			deleteVacationRequests(bab_rp('dateb'), bab_rp('userid'));
980
		}
981
		
982
		$babBody->addItemMenu("lreq", absences_translate("Requests"), absences_addon()->getUrl()."vacadmb&idx=lreq");
983
		$babBody->addItemMenu("ddreq", absences_translate("Delete"), absences_addon()->getUrl()."vacadmb&idx=ddreq");
984
		break;
985
		
986 View Code Duplication
	case 'delete':
0 ignored issues
show
Duplication introduced by
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.

Loading history...
987
		$babBody->title = absences_translate("Delete vacation request");
988
		absences_deleteVacationRequest(bab_rp('id_entry'), true);
989
		$babBody->addItemMenu("lreq", absences_translate("Requests"), absences_addon()->getUrl()."vacadmb&idx=lreq");
990
		$babBody->addItemMenu("delete", absences_translate("Delete"), absences_addon()->getUrl()."vacadmb&idx=delete");
991
		break;
992
		
993
994
	case 'archives';
995
	case "lreq":
996 View Code Duplication
	default:
0 ignored issues
show
Duplication introduced by
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.

Loading history...
997
		
998
		absences_listVacationRequestsb();
999
		$babBody->addItemMenu("lreq", absences_translate("Requests"), absences_addon()->getUrl()."vacadmb&idx=lreq");
1000
		$babBody->addItemMenu("archives", absences_translate("Archives"), absences_addon()->getUrl()."vacadmb&idx=archives&archived=1");
1001
		$babBody->addItemMenu("ddreq", absences_translate("Delete"), absences_addon()->getUrl()."vacadmb&idx=ddreq");
1002
		break;
1003
	}
1004
$babBody->setCurrentItemMenu($idx);
1005
bab_siteMap::setPosition('absences','User');
1006
1007