Code Duplication    Length = 7-9 lines in 5 locations

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

@@ 6002-6010 (lines=9) @@
5999
    					$row[5] = $obj_document->title;
6000
6001
    					break;
6002
    				case 'announcement':
6003
                        $sql = "SELECT title FROM $table_tool
6004
                                WHERE c_id = $course_id AND id = $ref";
6005
    					$rs_document = Database::query($sql);
6006
    					$obj_document = Database::fetch_object($rs_document);
6007
                        if ($obj_document) {
6008
                            $row[5] = $obj_document->title;
6009
                        }
6010
    					break;
6011
    				case 'glossary':
6012
                        $sql = "SELECT name FROM $table_tool
6013
    					        WHERE c_id = $course_id AND glossary_id = $ref";
@@ 6036-6044 (lines=9) @@
6033
                            $row[5] = $obj_document->title;
6034
                        }
6035
    					break;
6036
    				case 'course_description':
6037
                        $sql = "SELECT title FROM $table_tool
6038
                                WHERE c_id = $course_id AND id = $ref";
6039
    					$rs_document = Database::query($sql);
6040
    					$obj_document = Database::fetch_object($rs_document);
6041
                        if ($obj_document) {
6042
                            $row[5] = $obj_document->title;
6043
                        }
6044
    					break;
6045
    				case 'thematic':
6046
    					$rs = Database::query("SELECT title FROM $table_tool WHERE c_id = $course_id AND id = $ref");
6047
    					if (Database::num_rows($rs) > 0) {
@@ 6045-6051 (lines=7) @@
6042
                            $row[5] = $obj_document->title;
6043
                        }
6044
    					break;
6045
    				case 'thematic':
6046
    					$rs = Database::query("SELECT title FROM $table_tool WHERE c_id = $course_id AND id = $ref");
6047
    					if (Database::num_rows($rs) > 0) {
6048
    						$obj = Database::fetch_object($rs);
6049
    						$row[5] = $obj->title;
6050
    					}
6051
    					break;
6052
    				case 'thematic_advance':
6053
    					$rs = Database::query("SELECT content FROM $table_tool WHERE c_id = $course_id AND id = $ref");
6054
    					if (Database::num_rows($rs) > 0) {
@@ 6052-6058 (lines=7) @@
6049
    						$row[5] = $obj->title;
6050
    					}
6051
    					break;
6052
    				case 'thematic_advance':
6053
    					$rs = Database::query("SELECT content FROM $table_tool WHERE c_id = $course_id AND id = $ref");
6054
    					if (Database::num_rows($rs) > 0) {
6055
    						$obj = Database::fetch_object($rs);
6056
    						$row[5] = $obj->content;
6057
    					}
6058
    					break;
6059
    				case 'thematic_plan':
6060
    					$rs = Database::query("SELECT title FROM $table_tool WHERE c_id = $course_id AND id = $ref");
6061
    					if (Database::num_rows($rs) > 0) {
@@ 6059-6065 (lines=7) @@
6056
    						$row[5] = $obj->content;
6057
    					}
6058
    					break;
6059
    				case 'thematic_plan':
6060
    					$rs = Database::query("SELECT title FROM $table_tool WHERE c_id = $course_id AND id = $ref");
6061
    					if (Database::num_rows($rs) > 0) {
6062
    						$obj = Database::fetch_object($rs);
6063
    						$row[5] = $obj->title;
6064
    					}
6065
    					break;
6066
    				default:
6067
    					break;
6068
    			}