Code Duplication    Length = 7-9 lines in 5 locations

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

@@ 5964-5972 (lines=9) @@
5961
    					$row[5] = $obj_document->title;
5962
5963
    					break;
5964
    				case 'announcement':
5965
                        $sql = "SELECT title FROM $table_tool
5966
                                WHERE c_id = $course_id AND id = $ref";
5967
    					$rs_document = Database::query($sql);
5968
    					$obj_document = Database::fetch_object($rs_document);
5969
                        if ($obj_document) {
5970
                            $row[5] = $obj_document->title;
5971
                        }
5972
    					break;
5973
    				case 'glossary':
5974
                        $sql = "SELECT name FROM $table_tool
5975
    					        WHERE c_id = $course_id AND glossary_id = $ref";
@@ 5998-6006 (lines=9) @@
5995
                            $row[5] = $obj_document->title;
5996
                        }
5997
    					break;
5998
    				case 'course_description':
5999
                        $sql = "SELECT title FROM $table_tool
6000
                                WHERE c_id = $course_id AND id = $ref";
6001
    					$rs_document = Database::query($sql);
6002
    					$obj_document = Database::fetch_object($rs_document);
6003
                        if ($obj_document) {
6004
                            $row[5] = $obj_document->title;
6005
                        }
6006
    					break;
6007
    				case 'thematic':
6008
    					$rs = Database::query("SELECT title FROM $table_tool WHERE c_id = $course_id AND id = $ref");
6009
    					if (Database::num_rows($rs) > 0) {
@@ 6007-6013 (lines=7) @@
6004
                            $row[5] = $obj_document->title;
6005
                        }
6006
    					break;
6007
    				case 'thematic':
6008
    					$rs = Database::query("SELECT title FROM $table_tool WHERE c_id = $course_id AND id = $ref");
6009
    					if (Database::num_rows($rs) > 0) {
6010
    						$obj = Database::fetch_object($rs);
6011
    						$row[5] = $obj->title;
6012
    					}
6013
    					break;
6014
    				case 'thematic_advance':
6015
    					$rs = Database::query("SELECT content FROM $table_tool WHERE c_id = $course_id AND id = $ref");
6016
    					if (Database::num_rows($rs) > 0) {
@@ 6014-6020 (lines=7) @@
6011
    						$row[5] = $obj->title;
6012
    					}
6013
    					break;
6014
    				case 'thematic_advance':
6015
    					$rs = Database::query("SELECT content FROM $table_tool WHERE c_id = $course_id AND id = $ref");
6016
    					if (Database::num_rows($rs) > 0) {
6017
    						$obj = Database::fetch_object($rs);
6018
    						$row[5] = $obj->content;
6019
    					}
6020
    					break;
6021
    				case 'thematic_plan':
6022
    					$rs = Database::query("SELECT title FROM $table_tool WHERE c_id = $course_id AND id = $ref");
6023
    					if (Database::num_rows($rs) > 0) {
@@ 6021-6027 (lines=7) @@
6018
    						$row[5] = $obj->content;
6019
    					}
6020
    					break;
6021
    				case 'thematic_plan':
6022
    					$rs = Database::query("SELECT title FROM $table_tool WHERE c_id = $course_id AND id = $ref");
6023
    					if (Database::num_rows($rs) > 0) {
6024
    						$obj = Database::fetch_object($rs);
6025
    						$row[5] = $obj->title;
6026
    					}
6027
    					break;
6028
    				default:
6029
    					break;
6030
    			}