~ubuntu-branches/debian/sid/bugzilla/sid

« back to all changes in this revision

Viewing changes to docs/html/api/Bugzilla/Attachment.html

  • Committer: Bazaar Package Importer
  • Author(s): Raphael Bossek
  • Date: 2008-06-27 22:34:34 UTC
  • mfrom: (1.1.7 upstream)
  • Revision ID: james.westby@ubuntu.com-20080627223434-0ib57vstn43bb4a3
Tags: 3.0.4.1-1
* Update of French, Russian and German translations. (closes: #488251)
* Added Bulgarian and Belarusian translations.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2
 
<html>
3
 
  <head>
4
 
    <title>
5
 
Bugzilla::Attachment</title>
6
 
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
7
 
  <link rel="stylesheet" title="style" type="text/css" href="../style.css" media="all" >
8
 
 
9
 
</head>
10
 
  <body id="pod">
11
 
<p class="backlinktop"><b><a name="___top" href="../index.html" accesskey="1" title="All Documents">&lt;&lt;</a></b></p>
12
 
<h1>Bugzilla::Attachment</h1>
13
 
<div class='indexgroup'>
14
 
<ul   class='indexList indexList1'>
15
 
  <li class='indexItem indexItem1'><a href='#NAME'>NAME</a>
16
 
  <li class='indexItem indexItem1'><a href='#SYNOPSIS'>SYNOPSIS</a>
17
 
  <li class='indexItem indexItem1'><a href='#DESCRIPTION'>DESCRIPTION</a>
18
 
  <ul   class='indexList indexList2'>
19
 
    <li class='indexItem indexItem2'><a href='#Instance_Properties'>Instance Properties</a>
20
 
    <li class='indexItem indexItem2'><a href='#Class_Methods'>Class Methods</a>
21
 
  </ul>
22
 
</ul>
23
 
</div>
24
 
 
25
 
<h1><a class='u' href='#___top' title='click to go to top of document'
26
 
name="NAME"
27
 
>NAME</a></h1>
28
 
 
29
 
<p>Bugzilla::Attachment - a file related to a bug that a user has uploaded to the Bugzilla server</p>
30
 
 
31
 
<h1><a class='u' href='#___top' title='click to go to top of document'
32
 
name="SYNOPSIS"
33
 
>SYNOPSIS</a></h1>
34
 
 
35
 
<pre  class="code">  use Bugzilla::Attachment;
36
 
 
37
 
  # Get the attachment with the given ID.
38
 
  my $attachment = Bugzilla::Attachment-&#62;get($attach_id);
39
 
 
40
 
  # Get the attachments with the given IDs.
41
 
  my $attachments = Bugzilla::Attachment-&#62;get_list($attach_ids);</pre>
42
 
 
43
 
<h1><a class='u' href='#___top' title='click to go to top of document'
44
 
name="DESCRIPTION"
45
 
>DESCRIPTION</a></h1>
46
 
 
47
 
<p>This module defines attachment objects, which represent files related to bugs that users upload to the Bugzilla server.</p>
48
 
 
49
 
<h2><a class='u' href='#___top' title='click to go to top of document'
50
 
name="Instance_Properties"
51
 
>Instance Properties</a></h2>
52
 
 
53
 
<dl>
54
 
<dt><a name="id"
55
 
><code  class="code">id</code></a></dt>
56
 
 
57
 
<dd>
58
 
<p>the unique identifier for the attachment</p>
59
 
</dd>
60
 
</dl>
61
 
 
62
 
<dl>
63
 
<dt><a name="bug_id"
64
 
><code  class="code">bug_id</code></a></dt>
65
 
 
66
 
<dd>
67
 
<p>the ID of the bug to which the attachment is attached</p>
68
 
</dd>
69
 
</dl>
70
 
 
71
 
<dl>
72
 
<dt><a name="description"
73
 
><code  class="code">description</code></a></dt>
74
 
 
75
 
<dd>
76
 
<p>user-provided text describing the attachment</p>
77
 
</dd>
78
 
</dl>
79
 
 
80
 
<dl>
81
 
<dt><a name="contenttype"
82
 
><code  class="code">contenttype</code></a></dt>
83
 
 
84
 
<dd>
85
 
<p>the attachment&#39;s MIME media type</p>
86
 
</dd>
87
 
</dl>
88
 
 
89
 
<dl>
90
 
<dt><a name="attacher"
91
 
><code  class="code">attacher</code></a></dt>
92
 
 
93
 
<dd>
94
 
<p>the user who attached the attachment</p>
95
 
</dd>
96
 
</dl>
97
 
 
98
 
<dl>
99
 
<dt><a name="attached"
100
 
><code  class="code">attached</code></a></dt>
101
 
 
102
 
<dd>
103
 
<p>the date and time on which the attacher attached the attachment</p>
104
 
</dd>
105
 
</dl>
106
 
 
107
 
<dl>
108
 
<dt><a name="filename"
109
 
><code  class="code">filename</code></a></dt>
110
 
 
111
 
<dd>
112
 
<p>the name of the file the attacher attached</p>
113
 
</dd>
114
 
</dl>
115
 
 
116
 
<dl>
117
 
<dt><a name="ispatch"
118
 
><code  class="code">ispatch</code></a></dt>
119
 
 
120
 
<dd>
121
 
<p>whether or not the attachment is a patch</p>
122
 
</dd>
123
 
</dl>
124
 
 
125
 
<dl>
126
 
<dt><a name="isurl"
127
 
><code  class="code">isurl</code></a></dt>
128
 
 
129
 
<dd>
130
 
<p>whether or not the attachment is a URL</p>
131
 
</dd>
132
 
</dl>
133
 
 
134
 
<dl>
135
 
<dt><a name="isobsolete"
136
 
><code  class="code">isobsolete</code></a></dt>
137
 
 
138
 
<dd>
139
 
<p>whether or not the attachment is obsolete</p>
140
 
</dd>
141
 
</dl>
142
 
 
143
 
<dl>
144
 
<dt><a name="isprivate"
145
 
><code  class="code">isprivate</code></a></dt>
146
 
 
147
 
<dd>
148
 
<p>whether or not the attachment is private</p>
149
 
</dd>
150
 
</dl>
151
 
 
152
 
<dl>
153
 
<dt><a name="data"
154
 
><code  class="code">data</code></a></dt>
155
 
 
156
 
<dd>
157
 
<p>the content of the attachment</p>
158
 
</dd>
159
 
</dl>
160
 
 
161
 
<dl>
162
 
<dt><a name="datasize"
163
 
><code  class="code">datasize</code></a></dt>
164
 
 
165
 
<dd>
166
 
<p>the length (in characters) of the attachment content</p>
167
 
</dd>
168
 
</dl>
169
 
 
170
 
<dl>
171
 
<dt><a name="flags"
172
 
><code  class="code">flags</code></a></dt>
173
 
 
174
 
<dd>
175
 
<p>flags that have been set on the attachment</p>
176
 
</dd>
177
 
</dl>
178
 
 
179
 
<h2><a class='u' href='#___top' title='click to go to top of document'
180
 
name="Class_Methods"
181
 
>Class Methods</a></h2>
182
 
 
183
 
<dl>
184
 
<dt><a name="get_attachments_by_bug($bug_id)"
185
 
><code  class="code">get_attachments_by_bug($bug_id)</code></a></dt>
186
 
 
187
 
<dd>
188
 
<p>Description: retrieves and returns the attachments the currently logged in user can view for the given bug.</p>
189
 
 
190
 
<p>Params: <code  class="code">$bug_id</code> - integer - the ID of the bug for which to retrieve and return attachments.</p>
191
 
 
192
 
<p>Returns: a reference to an array of attachment objects.</p>
193
 
 
194
 
<dt><a name="validate_is_patch()"
195
 
><code  class="code">validate_is_patch()</code></a></dt>
196
 
 
197
 
<dd>
198
 
<p>Description: validates the &#34;patch&#34; flag passed in by CGI.</p>
199
 
 
200
 
<p>Returns: 1 on success.</p>
201
 
 
202
 
<dt><a name="validate_description()"
203
 
><code  class="code">validate_description()</code></a></dt>
204
 
 
205
 
<dd>
206
 
<p>Description: validates the description passed in by CGI.</p>
207
 
 
208
 
<p>Returns: 1 on success.</p>
209
 
 
210
 
<dt><a name="validate_content_type()"
211
 
><code  class="code">validate_content_type()</code></a></dt>
212
 
 
213
 
<dd>
214
 
<p>Description: validates the content type passed in by CGI.</p>
215
 
 
216
 
<p>Returns: 1 on success.</p>
217
 
 
218
 
<dt><a name="validate_can_edit($attachment,_$product_id)"
219
 
><code  class="code">validate_can_edit($attachment, $product_id)</code></a></dt>
220
 
 
221
 
<dd>
222
 
<p>Description: validates if the user is allowed to view and edit the attachment. Only the submitter or someone with editbugs privs can edit it. Only the submitter and users in the insider group can view private attachments.</p>
223
 
 
224
 
<p>Params: $attachment - the attachment object being edited. $product_id - the product ID the attachment belongs to.</p>
225
 
 
226
 
<p>Returns: 1 on success. Else an error is thrown.</p>
227
 
 
228
 
<dt><a name="validate_obsolete($bug)"
229
 
><code  class="code">validate_obsolete($bug)</code></a></dt>
230
 
 
231
 
<dd>
232
 
<p>Description: validates if attachments the user wants to mark as obsolete really belong to the given bug and are not already obsolete. Moreover, a user cannot mark an attachment as obsolete if he cannot view it (due to restrictions on it).</p>
233
 
 
234
 
<p>Params: $bug - The bug object obsolete attachments should belong to.</p>
235
 
 
236
 
<p>Returns: 1 on success. Else an error is thrown.</p>
237
 
 
238
 
<dt><a name="insert_attachment_for_bug($throw_error,_$bug,_$user,_$timestamp,_$hr_vars)"
239
 
><code  class="code">insert_attachment_for_bug($throw_error, $bug, $user, $timestamp, $hr_vars)</code></a></dt>
240
 
 
241
 
<dd>
242
 
<p>Description: inserts an attachment from CGI input for the given bug.</p>
243
 
 
244
 
<p>Params: <code  class="code">$bug</code> - Bugzilla::Bug object - the bug for which to insert the attachment. <code  class="code">$user</code> - Bugzilla::User object - the user we&#39;re inserting an attachment for. <code  class="code">$timestamp</code> - scalar - timestamp of the insert as returned by SELECT NOW(). <code  class="code">$hr_vars</code> - hash reference - reference to a hash of template variables.</p>
245
 
 
246
 
<p>Returns: the ID of the new attachment.</p>
247
 
</dd>
248
 
</dl>
249
 
<p class="backlinkbottom"><b><a name="___bottom" href="../index.html" title="All Documents">&lt;&lt;</a></b></p>
250
 
 
251
 
<!-- end doc -->
252
 
 
253
 
</body></html>