[ Index ]

PHP Cross Reference of Eventum

title

Body

[close]

/include/ -> class.attachment.php (summary)

(no description)

File Size: 644 lines (25 kb)
Included or required: 5 times
Referenced: 0 times
Includes or requires: 9 files
 include/class.date.php
 include/class.misc.php
 include/class.auth.php
 include/class.status.php
 include/class.history.php
 include/class.user.php
 include/class.error_handler.php
 include/class.issue.php
 include/class.workflow.php

Defines 1 class

Attachment:: (16 methods):
  _getPHPExtensions()
  _getTextPlainExtensions()
  _getNoDownloadExtensions()
  outputDownload()
  removeIndividualFile()
  getDetails()
  removeByIssues()
  remove()
  removeFile()
  getFileList()
  getList()
  attach()
  addFile()
  add()
  nameToSafe()
  getMaxAttachmentSize()


Class: Attachment  - X-Ref

Class designed to handle all business logic related to attachments being
uploaded to issues in the application.

_getPHPExtensions()   X-Ref
Returns a list of file extensions that should be opened
directly in the browser window as PHP source files.

return: array List of file extensions

_getTextPlainExtensions()   X-Ref
Returns a list of file extensions that should be opened
directly in the browser window and treated as text/plain
files.

return: array List of file extensions

_getNoDownloadExtensions()   X-Ref
Returns a list of file extensions that should be opened
directly in the browser window.

return: array List of file extensions

outputDownload(&$data, $filename, $filesize, $filetype)   X-Ref
Method used to output the headers and the binary data for
an attachment file.

param: string $data The binary data of this file download
param: string $filename The filename
param: integer $filesize The size of this file
param: string $filetype The mimetype of this file
return: void

removeIndividualFile($iaf_id)   X-Ref
Method used to remove a specific file out of an existing attachment.

param: integer $iaf_id The attachment file ID
return: -1 or -2 if the removal was not successful, 1 otherwise

getDetails($file_id)   X-Ref
Method used to return the details for a given attachment.

param: integer $file_id The attachment ID
return: array The details of the attachment

removeByIssues($ids)   X-Ref
Removes all attachments (and associated files) related to a set
of specific issues.

param: array $ids The issue IDs that need to be removed
return: boolean Whether the removal worked or not

remove($iat_id, $add_history = true)   X-Ref
Method used to remove attachments from the database.

param: integer $iat_id attachment_id.
param: boolean $add_history whether to add history entry.
return: integer Numeric code used to check for any errors

removeFile($iaf_id)   X-Ref
Method used to remove a specific file from an attachment, since every
attachment can have several files associated with it.

param: integer $iaf_id The attachment file ID
return: void

getFileList($attachment_id)   X-Ref
Method used to get the full listing of files for a specific attachment.

param: integer $attachment_id The attachment ID
return: array The full list of files

getList($issue_id)   X-Ref
Method used to return the full list of attachments related to a specific
issue in the database.

param: integer $issue_id The issue ID
return: array The full list of attachments

attach($usr_id, $status = 'public')   X-Ref
Method used to associate an attachment to an issue, and all of its
related files. It also notifies any subscribers of this new attachment.

Error codes:
-1 - An error occurred while trying to process the uploaded file.
-2 - The uploaded file is already attached to the current issue.
1 - The uploaded file was associated with the issue.

param: integer $usr_id The user ID
param: string $status The attachment status
return: integer Numeric code used to check for any errors

addFile($attachment_id, $filename, $filetype, &$blob)   X-Ref
Method used to add files to a specific attachment in the database.

param: integer $attachment_id The attachment ID
param: string $filename The filename to be added
return: boolean

add($issue_id, $usr_id, $description, $internal_only = FALSE, $unknown_user = FALSE, $associated_note_id = FALSE)   X-Ref
Method used to add an attachment to the database.

param: integer $issue_id The issue ID
param: integer $usr_id The user ID
param: string $description The description for this new attachment
param: boolean $internal_only Whether this attachment is supposed to be internal only or not
param: string $unknown_user The email of the user who originally sent this email, who doesn't have an account.
param: integer $associated_note_id The note ID that these attachments should be associated with
return: integer The new attachment ID

nameToSafe($name, $maxlen = 250)   X-Ref
Method used to replace unsafe characters by safe characters.

Side-effects: if $name is not in ISO8859-1 encoding, not very logical
replacements are done. Eventually the non-ASCII characters are stripped.

param: string $name The name of the file to be checked. In ISO8859-1 encoding.
param: integer $maxlen The maximum length of the filename
return: string The 'safe' version of the filename. Always in US-ASCII encoding.

getMaxAttachmentSize()   X-Ref
Returns the current maximum file upload size.

return: string A string containing the formatted max file size.



Generated: Wed Dec 19 21:21:33 2007 Cross-referenced by PHPXref 0.7