Code Duplication    Length = 7-9 lines in 5 locations

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

@@ 6032-6040 (lines=9) @@
6029
    					$row[5] = $obj_document->title;
6030
6031
    					break;
6032
    				case 'announcement':
6033
                        $sql = "SELECT title FROM $table_tool
6034
                                WHERE c_id = $course_id AND id = $ref";
6035
    					$rs_document = Database::query($sql);
6036
    					$obj_document = Database::fetch_object($rs_document);
6037
                        if ($obj_document) {
6038
                            $row[5] = $obj_document->title;
6039
                        }
6040
    					break;
6041
    				case 'glossary':
6042
                        $sql = "SELECT name FROM $table_tool
6043
    					        WHERE c_id = $course_id AND glossary_id = $ref";
@@ 6066-6074 (lines=9) @@
6063
                            $row[5] = $obj_document->title;
6064
                        }
6065
    					break;
6066
    				case 'course_description':
6067
                        $sql = "SELECT title FROM $table_tool
6068
                                WHERE c_id = $course_id AND id = $ref";
6069
    					$rs_document = Database::query($sql);
6070
    					$obj_document = Database::fetch_object($rs_document);
6071
                        if ($obj_document) {
6072
                            $row[5] = $obj_document->title;
6073
                        }
6074
    					break;
6075
    				case 'thematic':
6076
    					$rs = Database::query("SELECT title FROM $table_tool WHERE c_id = $course_id AND id = $ref");
6077
    					if (Database::num_rows($rs) > 0) {
@@ 6075-6081 (lines=7) @@
6072
                            $row[5] = $obj_document->title;
6073
                        }
6074
    					break;
6075
    				case 'thematic':
6076
    					$rs = Database::query("SELECT title FROM $table_tool WHERE c_id = $course_id AND id = $ref");
6077
    					if (Database::num_rows($rs) > 0) {
6078
    						$obj = Database::fetch_object($rs);
6079
    						$row[5] = $obj->title;
6080
    					}
6081
    					break;
6082
    				case 'thematic_advance':
6083
    					$rs = Database::query("SELECT content FROM $table_tool WHERE c_id = $course_id AND id = $ref");
6084
    					if (Database::num_rows($rs) > 0) {
@@ 6082-6088 (lines=7) @@
6079
    						$row[5] = $obj->title;
6080
    					}
6081
    					break;
6082
    				case 'thematic_advance':
6083
    					$rs = Database::query("SELECT content FROM $table_tool WHERE c_id = $course_id AND id = $ref");
6084
    					if (Database::num_rows($rs) > 0) {
6085
    						$obj = Database::fetch_object($rs);
6086
    						$row[5] = $obj->content;
6087
    					}
6088
    					break;
6089
    				case 'thematic_plan':
6090
    					$rs = Database::query("SELECT title FROM $table_tool WHERE c_id = $course_id AND id = $ref");
6091
    					if (Database::num_rows($rs) > 0) {
@@ 6089-6095 (lines=7) @@
6086
    						$row[5] = $obj->content;
6087
    					}
6088
    					break;
6089
    				case 'thematic_plan':
6090
    					$rs = Database::query("SELECT title FROM $table_tool WHERE c_id = $course_id AND id = $ref");
6091
    					if (Database::num_rows($rs) > 0) {
6092
    						$obj = Database::fetch_object($rs);
6093
    						$row[5] = $obj->title;
6094
    					}
6095
    					break;
6096
    				default:
6097
    					break;
6098
    			}