Index: account_prefs_inc.php =================================================================== --- account_prefs_inc.php (revision 281) +++ account_prefs_inc.php (working copy) @@ -297,6 +297,14 @@ + + + + + + drag_and_drop_file_upload, ON ); ?> /> + + Index: account_prefs_update.php =================================================================== --- account_prefs_update.php (revision 281) +++ account_prefs_update.php (working copy) @@ -81,6 +81,8 @@ $t_prefs->bugnote_order = gpc_get_string( 'bugnote_order' ); $t_prefs->email_bugnote_limit = gpc_get_int( 'email_bugnote_limit' ); + + $t_prefs->drag_and_drop_file_upload = gpc_get_bool( 'drag_and_drop_file_upload' ); # prevent users from changing other user's accounts if ( $f_user_id != auth_get_current_user_id() ) { Index: bug_file_add.php =================================================================== --- bug_file_add.php (revision 281) +++ bug_file_add.php (working copy) @@ -24,13 +24,23 @@ # Add file to a bug and then view the bug require_once( 'core.php' ); + + // Drag and Drop File Upload used? + if (config_get('drag_and_drop_file_upload_enabled') && isset($_FILES['userfile']) && isset($_GET['bug_id']) && $_GET['bug_id'] > 0 && isset($_GET['mantis_cookie_string']) && !empty($_GET['mantis_cookie_string'])) { + $drag_and_drop_file_upload_used = 1; + // drag and drop uploaded files are in array 'userfile' but must be in array 'file' + $_FILES['file'] = &$_FILES['userfile']; + $_POST['bug_id'] = $_GET['bug_id']; + $_POST['max_file_size'] = $_GET['max_file_size']; + $_COOKIE['PHPSESSID'] = $_GET['phpsessid']; + $_COOKIE['MANTIS_STRING_COOKIE'] = $_GET['mantis_cookie_string']; + } $t_core_path = config_get( 'core_path' ); require_once( $t_core_path.'file_api.php' ); # helper_ensure_post(); - $f_bug_id = gpc_get_int( 'bug_id', -1 ); $f_file = gpc_get_file( 'file', -1 ); @@ -42,7 +52,6 @@ if ( ! file_allow_bug_upload( $f_bug_id ) ) { access_denied(); } - access_ensure_bug_level( config_get( 'upload_bug_file_threshold' ), $f_bug_id ); $t_bug = bug_get( $f_bug_id, true ); @@ -51,12 +60,28 @@ # ... override the current project. This to avoid problems with categories and handlers lists etc. $g_project_override = $t_bug->project_id; } + + if (is_array($f_file['tmp_name'])) { + // multiple files uploaded + for ($i = 0; $i < count($f_file['tmp_name']); $i++) { + $f_file_error = ( isset( $f_file['error'][$i] ) ) ? $f_file['error'][$i] : 0; + file_add( $f_bug_id, $f_file['tmp_name'][$i], $f_file['name'][$i], $f_file['type'][$i], 'bug', $f_file_error ); + $dnd_uploaded_files[] = $f_file['name'][$i]; + } + } + else { + $f_file_error = ( isset( $f_file['error'] ) ) ? $f_file['error'] : 0; + file_add( $f_bug_id, $f_file['tmp_name'], $f_file['name'], $f_file['type'], 'bug', $f_file_error ); + } - $f_file_error = ( isset( $f_file['error'] ) ) ? $f_file['error'] : 0; - file_add( $f_bug_id, $f_file['tmp_name'], $f_file['name'], $f_file['type'], 'bug', $f_file_error ); - # Determine which view page to redirect back to. - $t_redirect_url = string_get_bug_view_url( $f_bug_id ); + if ($drag_and_drop_file_upload_used) { + print('
Successfully uploaded: ' . implode(', ', $dnd_uploaded_files) . '
'); + exit(); + } + else { + $t_redirect_url = string_get_bug_view_url( $f_bug_id ); + } html_page_top1(); html_meta_redirect( $t_redirect_url ); Index: bug_file_upload_inc.php =================================================================== --- bug_file_upload_inc.php (revision 281) +++ bug_file_upload_inc.php (working copy) @@ -43,7 +43,7 @@
- - +
+ @@ -54,12 +54,94 @@
(' . lang_get( 'max_file_size' ) . ': ' . number_format( $t_max_file_size/1000 ) . 'k)'?>
+ +'; + } + else { + if (strstr($user_agent,"MSIE")) { +?> + + + + + + + + + + + + + +', base64_encode($_SERVER['PHP_AUTH_USER'].":".$_SERVER['PHP_AUTH_PW'])); + } + if($useApplet == 1) { + echo ''; + } + else { + echo ''; + } + } +?> +  
Index: config_inc.php =================================================================== --- config_inc.php (revision 281) +++ config_inc.php (working copy) @@ -105,4 +105,36 @@ # disable "lost password" feature $g_lost_password_feature = OFF; + ########################### + # Drag and Drop File Upload + ########################### + + # There are three different Rad Upload Applets available: + # - Rad Upload Lite (FREE but maximum upload limit is 1 MB and no redirect after upload allowed so you don't see your uploaded files immediately) + # - Rad Upload (standard version, should satisfy all your needs) + # - Rad Upload Plus (enterprise version with enhanced features like resume uploads etc.) + # + # For best results use the standard or the plus version (no file upload limitations, additional "select files"-menu when clicking with your left + # mouse button in the dropbox and redirect after upload so you immediately see your uploaded files attached to the ticket) + # + # You need to download (http://www.radinks.com/downloads/upload.php) the version you want and copy the + # JAR-file (dndlite.jar, dnd.jar or dndplus.jar) into the folder /plugins/fileupload/ + # After that configure the settings below AND in the file /plugins/fileupload/config.php + # see (http://www.radinks.com/upload/settings) for details + + # Turn on Drag and Drop File Upload (Java Applet) + $g_drag_and_drop_file_upload_enabled = ON; + + # What kind of applet do you want to use (lite, standard or plus)? + $g_drag_and_drop_file_upload_applet_type = 'plus'; + # Property file for Drag and Drop File Upload + $g_drag_and_drop_file_upload_config_file = 'config.php'; + # Name of the Applet (displayed when asking if applet shall be executed) + $g_drag_and_drop_file_upload_applet_name = 'EasyCuC Drag & Drop File Upload'; + # Width and height of the dropbox zone + $g_drag_and_drop_file_upload_width = 210; + $g_drag_and_drop_file_upload_height = 40; + # use this option when you encounter problems with ssl proxies (list of ip addresses when to use only http) + $g_drag_and_drop_file_upload_only_by_http = '138.190.32.7'; + ?> Index: core/user_pref_api.php =================================================================== --- core/user_pref_api.php (revision 281) +++ core/user_pref_api.php (working copy) @@ -90,6 +90,7 @@ var $email_on_priority_min_severity = NULL; var $email_bugnote_limit = NULL; var $language = NULL; + var $drag_and_drop_file_upload = NULL; function UserPreferences() { $this->default_profile = 0; Index: custom_strings_inc.php =================================================================== --- custom_strings_inc.php (revision 281) +++ custom_strings_inc.php (working copy) @@ -19,7 +19,8 @@ $s_process_step = 'Prozess-Schritt'; $s_location = 'Standort'; - $s_severity_enum_string = '10:Feature-Wunsch,15:Change Request,20:Trivial,30:Fehler im Text,40:Unschönheit,50:kleinerer Fehler,60:schwerer Fehler,70:Absturz,80:Blocker'; + $s_severity_enum_string = '10:Feature-Wunsch,15:Change Request,20:Trivial,30:Fehler im Text,40:Unschönheit,50:kleinerer Fehler,60:schwerer Fehler,70:Absturz,80:Blocker'; + $s_drag_and_drop_file_upload = 'Drag and Drop File Upload aktiviert (Java Applet)'; # language overwriting $s_update_bug_button = 'Editieren'; @@ -42,7 +43,8 @@ $s_process_step = 'Process step'; $s_location = 'Location'; - $s_severity_enum_string = '10:feature,15:change_request,20:trivial,30:text,40:tweak,50:minor,60:major,70:crash,80:block'; + $s_severity_enum_string = '10:feature,15:change_request,20:trivial,30:text,40:tweak,50:minor,60:major,70:crash,80:block'; + $s_drag_and_drop_file_upload = 'Drag and Drop File Upload enabled (Java Applet)'; # language overwriting $s_actiongroup_bugs = 'Selected Tickets'; Index: plugins/fileupload/config.php =================================================================== --- plugins/fileupload/config.php (revision 0) +++ plugins/fileupload/config.php (revision 0) @@ -0,0 +1,197 @@ +
-> Drop your files here <-
'; +# +# +# The reject_message will be shown when the user attempts to upload +# files that should not be allowed and the filter_action is set to +# reject. +# +# If you enter a text message here it will be displayed as a popup. +# A URl, will result in the a page being loaded inside the applet. +# +# Example: +$params[] = 'reject_message=File rejected'; +# +# +# The message that is displayed when the max_upload property is exceeded is +# defined by the max_upload_message property. If you enter a text message +# here it will be displayed as a popup. If you enter a url here the page you +# specify will be loaded in the applet. +# +# Example: +$params[] = 'max_upload_message=Max upload size exceeded'; +# +# +# If the certificate is not accepted by the user, the applet does not +# have the required permission to access files on the client computer. As +# a result it will not be possible to carry out the file upload. The user +# will be notified, by displaying the message specified for the +# permission_denied property. +# +# Enter a url or a simple text to customize this error message. If left +# blank, a standard message will be displayed. If you choose a url it +# should be on the same website as the page that contains the applet. +# +$params[] = 'permission_denied=Permission Denied.'; + +# +# If you want to impose a limit on the total size of the file upload +# enter a value in kilobytes for the max_upload parameter. A value +# of 0, the default means unlimited. Please make sure that the server +# side configuration does not impose a lower limit than what you choose +# for max_upload +# +# Example: +# max_upload=10240 +# will impose a limit of 10 Mega Bytes +# +$params[] = 'max_upload=8000'; + +# +# The max_upload property checks the sum of file sizes. You can impose +# a limit on the size of individual files using the max_file property. +# The value is in kilobytes. 0 means no limit. +# +# Example: +# max_file=2048 +# for a limit of 2 Mega Bytes +# +$params[] = 'max_file=0'; + +# +# size_exceeded message will be displayed when either the max_upload or +# max_file setting has been exceeded. If you enter a text message it +# will be displayed as a popup. If you enter a URL, the chosen page be +# loaded with in the applet. (Note: size_exceeded is an alias for +# max_upload_message) +# +$params[] = 'size_exceeded=Max upload size or number of files exceeded'; + +# +# As the name suggests the full_path setting determines if absolute pathnames +# should be sent to the server. If you switch this off, folder information will +# be stripped from the filenames. +# +#$params[] = 'full_path=no'; + +# +# When the translate_path setting is switched on, windows style pathnames will +# be converted to unix style paths. In other words '\' becomes '/'. This +# setting is required for Resumable file upload. +# +#$params[] = 'translate_path=yes'; + +# +# When encode_path setting is switched on, pathnames are URLEncoded. This is +# usefull if you are dealing with filenames that contain special characters. +# this setting is required for resumable file upload. +# +#$params[] = 'encode_path=yes'; + +# +# If you need to disable the multiple upload feature, and to upload files +# one at a time, switch to bachelor mode. When bachelor property is set +# the applet will complain if you try to upload more than one file. Use +# the angry_bachelor property to set the error message to be displayed. +# +# Example: +# bachelor=1 +# angry_bachelor=http://upload.thinfile.com/demo/single.html +# + +# +# If you switch on the browse setting the applet listens for mouse clicks +# and brings up a file selection dialog. If instead of clicking on the drop +# target you wish to display a browse button set the browse_button +# property as well. +# +$params[] = 'browse=1'; +$params[] = 'browse_button=0'; + +# +# While the upload is in progress you can keep track of it using one of +# three different progress monitors. Set your preference with the +# monitor.type property. Possible values are; standard, thumbnails +# and compact. These values identify the Standard Progress Monitor, A +# monitor that displays a thumbnail of each image and a compact monitor. +# +# Example: +# monitor.type=thumbnails +# +# +# By default the progress indicator will be hidden (closed) when the upload +# completes. By uncommenting the following line you can continue to keep the +# progress bar visible even after upload has been completed. The user will +# then have to manually close the progress bar. +# +#$params[] = 'monitor.keep_visible=yes'; + +# +# +# Use monitor.position to control the placement of the monitor. Asign one of +# the following values; TL (Top Left), TR (Top Right), BL (Bottom Left), +# BR (Bottom Right) and center. +# +# Example: +# monitor.position=center +# +# +# To achieve even greater control over the monitor's placement, use +# cartesian cordinates. +# +# Example: +# monitor.position=(100,100) +# + +# +# The applet or the entire browser can be redirected to another page +# when upload completes. Select the destination URL with the +# external_redir parameter. +# +# If you do not enter a value for the external_target property, the URL +# given external_target will be loaded with in the applet. Otherwise +# the page will be loaded in the target frame. To redirect the entire +# browser window use '_top' as the target. +# +# If you wish to delay the redirect, enter a value for the +# redirect_delay property (in milliseconds). +# +# Example: +# external_redir=http://upload.thinfile.com +# external_target=_top +$params[] = 'redirect_delay=500'; + + +// print config file to output +print(implode("\r\n\r\n", $params)); \ No newline at end of file Index: plugins/fileupload/dnd.jar =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: plugins\fileupload\dnd.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream