require_once('./includes/api_attachment.php');
require_once('./includes/api_comment.php');
-APIError(array(new API_Error_Handler($message), 'user_cumulative'));
-
if (isset($input->in['attachmentid']))
{
$attachment = $db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "attachment WHERE attachmentid = " . $input->inputClean('attachmentid', TYPE_UINT));
require_once('./includes/class_logging.php');
-$notif = new NotificationCenter;
+$notif = new NotificationCenter();
$notif->set_bug_data($bug);
// ###################################################################
BSApp::debug("max_allowed_packet = $var[Value]");
// create alias
- $FILE =& $_FILES['attachment'];
+ $FILE = &$_FILES['attachment'];
// PHP errors
switch ($FILE['error'])
{
$db->query("UPDATE " . TABLE_PREFIX . "attachment SET obsolete = 1 WHERE attachmentid IN (" . implode(',', $obsoletes) . ") AND !obsolete AND bugid = $bug[bugid]");
- foreach ($obsoletes AS $attachmentid)
+ foreach ($obsoletes as $attachmentid)
{
$log = new Logging;
$log->set_bugid($bug['bugid']);
$obsoletes .= "<div><input name=\"obsoletes[]\" type=\"checkbox\" value=\"$obsolete[attachmentid]\"" . (is_array($input->in['obsoletes']) AND in_array($obsolete['attachmentid'], $input->in['obsoletes']) ? ' checked="checked"' : '') . " /> $obsolete[filename]" . ($obsolete['description'] ? " [$obsolete[description]]" : '') . "</div>\n";
}
- eval('$template->flush("' . $template->fetch('newattach') . '");');
+ $tpl = new BSTemplate('newattach');
+ $tpl->vars = array(
+ 'bug' => $bug,
+ 'message' => $message,
+ 'MAXFILESIZE' => $MAXFILESIZE,
+ 'obsoletes' => $obsoletes,
+ 'input' => $input
+ );
+ $tpl->evaluate()->flush();
}
// ###################################################################
$attachapi = new AttachmentAPI();
$attachapi->set('attachmentid', $input->in['attachmentid']);
- $attachapi->dorelations = array();
- $attachapi->set_condition();
if ($input->in['__delete__'] != '')
{
}
else
{
- $log = new Logging;
+ $log = new Logging();
$log->set_bugid($bug['bugid']);
$log->set_attachmentid($input->in['attachmentid']);
$show['delete'] = (can_perform('caneditattach', $bug['product']) AND can_perform('candeletedata', $bug['productid']));
- eval('$template->flush("' . $template->fetch('editattach') . '");');
+ $tpl = new BSTemplate('editattach');
+ $tpl->vars = array(
+ 'attachment' => $attachment,
+ 'bug' => $bug
+ );
+ $tpl->evaluate()->flush();
}
/*=====================================================================*\