Code Duplication    Length = 13-13 lines in 2 locations

main/dropbox/dropbox_class.inc.php 2 locations

@@ 574-586 (lines=13) @@
571
	/**
572
	 * Deletes all the received work of this person
573
	 */
574
	function deleteAllReceivedWork()
575
    {
576
	    $course_id = api_get_course_int_id();
577
        $dropbox_cnf = getDropboxConf();
578
		// Delete entries in person table concerning received works
579
		foreach ($this->receivedWork as $w) {
580
            $sql = "DELETE FROM ".$dropbox_cnf['tbl_person']."
581
			        WHERE c_id = $course_id AND user_id='".$this->userId."' AND file_id='".$w->id."'";
582
			Database::query($sql);
583
		}
584
        // Check for unused files
585
		removeUnusedFiles();
586
	}
587
588
	/**
589
	 * Deletes all the received categories and work of this person
@@ 644-656 (lines=13) @@
641
	/**
642
	 * Deletes all the sent dropbox files of this person
643
	 */
644
	function deleteAllSentWork()
645
    {
646
	    $course_id = api_get_course_int_id();
647
        $dropbox_cnf = getDropboxConf();
648
		//delete entries in person table concerning sent works
649
		foreach ($this->sentWork as $w) {
650
            $sql = "DELETE FROM ".$dropbox_cnf['tbl_person']."
651
                    WHERE c_id = $course_id AND user_id='".$this->userId."' AND file_id='".$w->id."'";
652
			Database::query($sql);
653
			removeMoreIfMailing($w->id);
654
		}
655
		removeUnusedFiles();	// Check for unused files
656
	}
657
658
	/**
659
	 * Deletes a sent dropbox file of this person with id=$id