Code Duplication    Length = 7-9 lines in 5 locations

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

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