Code Duplication    Length = 7-9 lines in 5 locations

main/inc/lib/tracking.lib.php 5 locations

@@ 5875-5883 (lines=9) @@
5872
    					$row[5] = $obj_document->title;
5873
5874
    					break;
5875
    				case 'announcement':
5876
                        $sql = "SELECT title FROM $table_tool
5877
                                WHERE c_id = $course_id AND id = $ref";
5878
    					$rs_document = Database::query($sql);
5879
    					$obj_document = Database::fetch_object($rs_document);
5880
                        if ($obj_document) {
5881
                            $row[5] = $obj_document->title;
5882
                        }
5883
    					break;
5884
    				case 'glossary':
5885
                        $sql = "SELECT name FROM $table_tool
5886
    					        WHERE c_id = $course_id AND glossary_id = $ref";
@@ 5909-5917 (lines=9) @@
5906
                            $row[5] = $obj_document->title;
5907
                        }
5908
    					break;
5909
    				case 'course_description':
5910
                        $sql = "SELECT title FROM $table_tool
5911
                                WHERE c_id = $course_id AND id = $ref";
5912
    					$rs_document = Database::query($sql);
5913
    					$obj_document = Database::fetch_object($rs_document);
5914
                        if ($obj_document) {
5915
                            $row[5] = $obj_document->title;
5916
                        }
5917
    					break;
5918
    				case 'thematic':
5919
    					$rs = Database::query("SELECT title FROM $table_tool WHERE c_id = $course_id AND id = $ref");
5920
    					if (Database::num_rows($rs) > 0) {
@@ 5918-5924 (lines=7) @@
5915
                            $row[5] = $obj_document->title;
5916
                        }
5917
    					break;
5918
    				case 'thematic':
5919
    					$rs = Database::query("SELECT title FROM $table_tool WHERE c_id = $course_id AND id = $ref");
5920
    					if (Database::num_rows($rs) > 0) {
5921
    						$obj = Database::fetch_object($rs);
5922
    						$row[5] = $obj->title;
5923
    					}
5924
    					break;
5925
    				case 'thematic_advance':
5926
    					$rs = Database::query("SELECT content FROM $table_tool WHERE c_id = $course_id AND id = $ref");
5927
    					if (Database::num_rows($rs) > 0) {
@@ 5925-5931 (lines=7) @@
5922
    						$row[5] = $obj->title;
5923
    					}
5924
    					break;
5925
    				case 'thematic_advance':
5926
    					$rs = Database::query("SELECT content FROM $table_tool WHERE c_id = $course_id AND id = $ref");
5927
    					if (Database::num_rows($rs) > 0) {
5928
    						$obj = Database::fetch_object($rs);
5929
    						$row[5] = $obj->content;
5930
    					}
5931
    					break;
5932
    				case 'thematic_plan':
5933
    					$rs = Database::query("SELECT title FROM $table_tool WHERE c_id = $course_id AND id = $ref");
5934
    					if (Database::num_rows($rs) > 0) {
@@ 5932-5938 (lines=7) @@
5929
    						$row[5] = $obj->content;
5930
    					}
5931
    					break;
5932
    				case 'thematic_plan':
5933
    					$rs = Database::query("SELECT title FROM $table_tool WHERE c_id = $course_id AND id = $ref");
5934
    					if (Database::num_rows($rs) > 0) {
5935
    						$obj = Database::fetch_object($rs);
5936
    						$row[5] = $obj->title;
5937
    					}
5938
    					break;
5939
    				default:
5940
    					break;
5941
    			}