Code Duplication    Length = 23-25 lines in 3 locations

programs/utilit/dynamic_right.class.php 1 location

@@ 182-205 (lines=24) @@
179
			}
180
	
181
	
182
		} else {
183
	
184
			if (isset($this->id_entry))
185
			{
186
				$id_entry = $this->id_entry;
187
			} else {
188
				$entry = $this->getEntry();
189
				$id_entry = $entry->id;
190
			}
191
	
192
			$babDB->db_query("
193
				INSERT INTO absences_dynamic_rights 
194
					(id_entry, id_user_right, quantity, createdOn)
195
				VALUES
196
					(
197
					" .$babDB->quote($id_entry). ",
198
					" .$babDB->quote($this->id_user_right). ",
199
					" .$babDB->quote($this->quantity). ",
200
					" .$babDB->quote($this->createdOn). "
201
			)
202
					");
203
	
204
			$this->id = $babDB->db_insert_id();
205
		}
206
		
207
		
208
		$agentRight = $this->getAgentRight();

programs/utilit/entry_elem.class.php 1 location

@@ 269-293 (lines=25) @@
266
			}
267
			
268
			
269
		} else {
270
			
271
			if (isset($this->id_entry))
272
			{
273
				$id_entry = $this->id_entry;
274
			} else {
275
				$entry = $this->getEntry();
276
				$id_entry = $entry->id;
277
			}
278
			
279
			$babDB->db_query("
280
				INSERT INTO absences_entries_elem 
281
					(id_entry, id_right, quantity, date_begin, date_end)
282
				VALUES 
283
				(
284
					" .$babDB->quote($id_entry). ",
285
					" .$babDB->quote($this->id_right). ",
286
					" .$babDB->quote($this->quantity). ",
287
			        " .$babDB->quote($this->date_begin). ",
288
			        " .$babDB->quote($this->date_end). "
289
				)
290
			");
291
			
292
			$this->id = $babDB->db_insert_id();
293
		}
294
	}
295
	
296
	

programs/utilit/entry_period.class.php 1 location

@@ 153-175 (lines=23) @@
150
			);
151
152
			
153
		} else {
154
			
155
			if (isset($this->id_entry))
156
			{
157
				$id_entry = $this->id_entry;
158
			} else {
159
				$entry = $this->getEntry();
160
				$id_entry = $entry->id;
161
			}
162
			
163
			$babDB->db_query("
164
				INSERT INTO absences_entries_periods 
165
					(id_entry, date_begin, date_end)
166
				VALUES 
167
				(
168
					" .$babDB->quote($id_entry). ",
169
			        " .$babDB->quote($this->date_begin). ",
170
			        " .$babDB->quote($this->date_end). "
171
				)
172
			");
173
			
174
			$this->id = $babDB->db_insert_id();
175
		}
176
	}
177
	
178