Code Duplication    Length = 9-9 lines in 2 locations

programs/utilit/collection.class.php 2 locations

@@ 84-92 (lines=9) @@
81
	 * @param	absences_Right	$right
82
	 * @return absences_Collection 
83
	 */
84
	public function addRight(absences_Right $right)
85
	{
86
		global $babDB;
87
		$babDB->db_queryWem('INSERT INTO absences_coll_rights (id_coll, id_right) VALUES ('.$babDB->quote($this->id).', '.$babDB->quote($right->id).')');
88
		
89
		$right->addMovement(sprintf(absences_translate('The collection %s has been linked to the right %s'), $this->name, $this->description));
90
		
91
		return $this;
92
	}
93
	
94
	/**
95
	 * Link all agents with the regime to the right given in parameter
@@ 174-182 (lines=9) @@
171
	 * @param	absences_Right	$right
172
	 * @return absences_Collection
173
	 */
174
	public function removeRight(absences_Right $right)
175
	{
176
		global $babDB;
177
		$babDB->db_query('DELETE FROM absences_coll_rights WHERE id_coll='.$babDB->quote($this->id).' AND id_right='.$babDB->quote($right->id));
178
		
179
		$right->addMovement(sprintf(absences_translate('The collection %s has been unlinked from the right %s'), $this->name, $this->description));
180
		
181
		return $this;
182
	}
183
	
184
	/**
185
	 * Unlink all agents with the collection from the right given in parameter