Code Duplication    Length = 7-9 lines in 5 locations

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

@@ 5924-5932 (lines=9) @@
5921
    					$row[5] = $obj_document->title;
5922
5923
    					break;
5924
    				case 'announcement':
5925
                        $sql = "SELECT title FROM $table_tool
5926
                                WHERE c_id = $course_id AND id = $ref";
5927
    					$rs_document = Database::query($sql);
5928
    					$obj_document = Database::fetch_object($rs_document);
5929
                        if ($obj_document) {
5930
                            $row[5] = $obj_document->title;
5931
                        }
5932
    					break;
5933
    				case 'glossary':
5934
                        $sql = "SELECT name FROM $table_tool
5935
    					        WHERE c_id = $course_id AND glossary_id = $ref";
@@ 5958-5966 (lines=9) @@
5955
                            $row[5] = $obj_document->title;
5956
                        }
5957
    					break;
5958
    				case 'course_description':
5959
                        $sql = "SELECT title FROM $table_tool
5960
                                WHERE c_id = $course_id AND id = $ref";
5961
    					$rs_document = Database::query($sql);
5962
    					$obj_document = Database::fetch_object($rs_document);
5963
                        if ($obj_document) {
5964
                            $row[5] = $obj_document->title;
5965
                        }
5966
    					break;
5967
    				case 'thematic':
5968
    					$rs = Database::query("SELECT title FROM $table_tool WHERE c_id = $course_id AND id = $ref");
5969
    					if (Database::num_rows($rs) > 0) {
@@ 5967-5973 (lines=7) @@
5964
                            $row[5] = $obj_document->title;
5965
                        }
5966
    					break;
5967
    				case 'thematic':
5968
    					$rs = Database::query("SELECT title FROM $table_tool WHERE c_id = $course_id AND id = $ref");
5969
    					if (Database::num_rows($rs) > 0) {
5970
    						$obj = Database::fetch_object($rs);
5971
    						$row[5] = $obj->title;
5972
    					}
5973
    					break;
5974
    				case 'thematic_advance':
5975
    					$rs = Database::query("SELECT content FROM $table_tool WHERE c_id = $course_id AND id = $ref");
5976
    					if (Database::num_rows($rs) > 0) {
@@ 5974-5980 (lines=7) @@
5971
    						$row[5] = $obj->title;
5972
    					}
5973
    					break;
5974
    				case 'thematic_advance':
5975
    					$rs = Database::query("SELECT content FROM $table_tool WHERE c_id = $course_id AND id = $ref");
5976
    					if (Database::num_rows($rs) > 0) {
5977
    						$obj = Database::fetch_object($rs);
5978
    						$row[5] = $obj->content;
5979
    					}
5980
    					break;
5981
    				case 'thematic_plan':
5982
    					$rs = Database::query("SELECT title FROM $table_tool WHERE c_id = $course_id AND id = $ref");
5983
    					if (Database::num_rows($rs) > 0) {
@@ 5981-5987 (lines=7) @@
5978
    						$row[5] = $obj->content;
5979
    					}
5980
    					break;
5981
    				case 'thematic_plan':
5982
    					$rs = Database::query("SELECT title FROM $table_tool WHERE c_id = $course_id AND id = $ref");
5983
    					if (Database::num_rows($rs) > 0) {
5984
    						$obj = Database::fetch_object($rs);
5985
    						$row[5] = $obj->title;
5986
    					}
5987
    					break;
5988
    				default:
5989
    					break;
5990
    			}