Code Duplication    Length = 7-9 lines in 5 locations

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

@@ 6042-6050 (lines=9) @@
6039
    					$row[5] = $obj_document->title;
6040
6041
    					break;
6042
    				case 'announcement':
6043
                        $sql = "SELECT title FROM $table_tool
6044
                                WHERE c_id = $course_id AND id = $ref";
6045
    					$rs_document = Database::query($sql);
6046
    					$obj_document = Database::fetch_object($rs_document);
6047
                        if ($obj_document) {
6048
                            $row[5] = $obj_document->title;
6049
                        }
6050
    					break;
6051
    				case 'glossary':
6052
                        $sql = "SELECT name FROM $table_tool
6053
    					        WHERE c_id = $course_id AND glossary_id = $ref";
@@ 6076-6084 (lines=9) @@
6073
                            $row[5] = $obj_document->title;
6074
                        }
6075
    					break;
6076
    				case 'course_description':
6077
                        $sql = "SELECT title FROM $table_tool
6078
                                WHERE c_id = $course_id AND id = $ref";
6079
    					$rs_document = Database::query($sql);
6080
    					$obj_document = Database::fetch_object($rs_document);
6081
                        if ($obj_document) {
6082
                            $row[5] = $obj_document->title;
6083
                        }
6084
    					break;
6085
    				case 'thematic':
6086
    					$rs = Database::query("SELECT title FROM $table_tool WHERE c_id = $course_id AND id = $ref");
6087
    					if (Database::num_rows($rs) > 0) {
@@ 6085-6091 (lines=7) @@
6082
                            $row[5] = $obj_document->title;
6083
                        }
6084
    					break;
6085
    				case 'thematic':
6086
    					$rs = Database::query("SELECT title FROM $table_tool WHERE c_id = $course_id AND id = $ref");
6087
    					if (Database::num_rows($rs) > 0) {
6088
    						$obj = Database::fetch_object($rs);
6089
    						$row[5] = $obj->title;
6090
    					}
6091
    					break;
6092
    				case 'thematic_advance':
6093
    					$rs = Database::query("SELECT content FROM $table_tool WHERE c_id = $course_id AND id = $ref");
6094
    					if (Database::num_rows($rs) > 0) {
@@ 6092-6098 (lines=7) @@
6089
    						$row[5] = $obj->title;
6090
    					}
6091
    					break;
6092
    				case 'thematic_advance':
6093
    					$rs = Database::query("SELECT content FROM $table_tool WHERE c_id = $course_id AND id = $ref");
6094
    					if (Database::num_rows($rs) > 0) {
6095
    						$obj = Database::fetch_object($rs);
6096
    						$row[5] = $obj->content;
6097
    					}
6098
    					break;
6099
    				case 'thematic_plan':
6100
    					$rs = Database::query("SELECT title FROM $table_tool WHERE c_id = $course_id AND id = $ref");
6101
    					if (Database::num_rows($rs) > 0) {
@@ 6099-6105 (lines=7) @@
6096
    						$row[5] = $obj->content;
6097
    					}
6098
    					break;
6099
    				case 'thematic_plan':
6100
    					$rs = Database::query("SELECT title FROM $table_tool WHERE c_id = $course_id AND id = $ref");
6101
    					if (Database::num_rows($rs) > 0) {
6102
    						$obj = Database::fetch_object($rs);
6103
    						$row[5] = $obj->title;
6104
    					}
6105
    					break;
6106
    				default:
6107
    					break;
6108
    			}