You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							24 lines
						
					
					
						
							680 B
						
					
					
				
			
		
		
		
			
			
			
				
					
				
				
					
				
			
		
		
	
	
							24 lines
						
					
					
						
							680 B
						
					
					
				| <?php | |
| 
 | |
| class FileImport extends MigrationTask { | |
|     var $description = "Import core osTicket attachment files"; | |
| 
 | |
|     function run($runtime) { | |
|         $i18n = new Internationalization('en_US'); | |
|         $files = $i18n->getTemplate('file.yaml')->getData(); | |
|         foreach ($files as $f) { | |
|             if (!($file = AttachmentFile::create($f))) | |
|                 continue; | |
| 
 | |
|             // Ensure the new files are never deleted (attached to Disk) | |
|             $sql ='INSERT INTO '.ATTACHMENT_TABLE | |
|                 .' SET object_id=0, `type`=\'D\', inline=1' | |
|                 .', file_id='.db_input($file->getId()); | |
|             db_query($sql); | |
|         } | |
|     } | |
| } | |
| 
 | |
| return 'FileImport'; | |
| 
 | |
| ?>
 |