Upload button setup
TODO: add files to database TODO: hash folder to stick files in
This commit is contained in:
parent
822d255aa7
commit
2311731fae
9 changed files with 2059 additions and 10 deletions
|
@ -250,3 +250,4 @@ code/nel/tools/build_gamedata/processes/rbank/build_rbank.cfg
|
|||
code/nel/tools/build_gamedata/processes/zone/debug_zone_dependencies.cfg
|
||||
code/web/public_php/config.php
|
||||
code/web/public_php/is_installed
|
||||
code/web/public_php/ams/files
|
||||
|
|
|
@ -80,6 +80,9 @@ class Helpers {
|
|||
$smarty -> assign( $key, $value);
|
||||
}
|
||||
|
||||
$id = session_id();
|
||||
$smarty -> assign( "sessionid", $id );
|
||||
|
||||
// smarty inheritance for loading the matching wrapper layout (with the matching menu bar)
|
||||
if ( isset( $vars['permission'] ) && $vars['permission'] == 3 ) {
|
||||
$inherited = "extends:layout_admin.tpl|";
|
||||
|
|
37
code/web/public_php/ams/func/upload.php
Normal file
37
code/web/public_php/ams/func/upload.php
Normal file
|
@ -0,0 +1,37 @@
|
|||
<?php
|
||||
|
||||
require( '../../config.php' );
|
||||
require_once( $AMS_LIB . '/libinclude.php' );
|
||||
$id = $_POST['PHPSESSID'];
|
||||
session_id($id);
|
||||
session_start();
|
||||
|
||||
global $FILE_STORAGE_PATH;
|
||||
|
||||
// Set permission
|
||||
if ( isset( $_SESSION['ticket_user'] ) ) {
|
||||
$return['permission'] = unserialize( $_SESSION['ticket_user'] ) -> getPermission();
|
||||
} else {
|
||||
// default permission
|
||||
$return['permission'] = 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if(WebUsers::isLoggedIn() && isset($_GET['id'])){
|
||||
|
||||
$ticket_id = filter_var($_GET['id'], FILTER_SANITIZE_NUMBER_INT);
|
||||
$target_ticket = new Ticket();
|
||||
$target_ticket->load_With_TId($ticket_id);
|
||||
if(($target_ticket->getAuthor() == unserialize($_SESSION['ticket_user'])->getTUserId()) || Ticket_User::isMod(unserialize($_SESSION['ticket_user'])) ){
|
||||
|
||||
if (!empty($_FILES)) {
|
||||
$tempFile = $_FILES['Filedata']['tmp_name'];
|
||||
$targetFile = $FILE_STORAGE_PATH . $_FILES['Filedata']['name'];
|
||||
|
||||
$fileParts = pathinfo($_FILES['Filedata']['name']);
|
||||
move_uploaded_file($tempFile,$targetFile);
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
|
@ -28,6 +28,7 @@ require( '../config.php' );
|
|||
require_once( $AMS_LIB . '/libinclude.php' );
|
||||
session_start();
|
||||
|
||||
|
||||
// Running Cron
|
||||
if ( isset( $_GET["cron"] ) ) {
|
||||
if ( $_GET["cron"] == "true" ) {
|
||||
|
|
13
code/web/public_php/ams/js/custom.js
Normal file
13
code/web/public_php/ams/js/custom.js
Normal file
|
@ -0,0 +1,13 @@
|
|||
$(document).ready(function () {
|
||||
//other things to do on document ready, separated for ajax calls
|
||||
docReady();
|
||||
});
|
||||
|
||||
|
||||
function docReady() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
6
code/web/public_php/ams/js/jquery.min.js
vendored
Normal file
6
code/web/public_php/ams/js/jquery.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1971
code/web/public_php/ams/js/jquery.uploadify-3.1.js
Normal file
1971
code/web/public_php/ams/js/jquery.uploadify-3.1.js
Normal file
File diff suppressed because it is too large
Load diff
|
@ -22,12 +22,6 @@
|
|||
<link id="bs-css" href="css/bootstrap-cerulean.min.css" rel="stylesheet">
|
||||
|
||||
<link href="css/charisma-app.css" rel="stylesheet">
|
||||
<link href='bower_components/fullcalendar/dist/fullcalendar.css' rel='stylesheet'>
|
||||
<link href='bower_components/fullcalendar/dist/fullcalendar.print.css' rel='stylesheet' media='print'>
|
||||
<link href='bower_components/chosen/chosen.min.css' rel='stylesheet'>
|
||||
<link href='bower_components/colorbox/example3/colorbox.css' rel='stylesheet'>
|
||||
<link href='bower_components/responsive-tables/responsive-tables.css' rel='stylesheet'>
|
||||
<link href='bower_components/bootstrap-tour/build/css/bootstrap-tour.min.css' rel='stylesheet'>
|
||||
<link href='css/jquery.noty.css' rel='stylesheet'>
|
||||
<link href='css/noty_theme_default.css' rel='stylesheet'>
|
||||
<link href='css/elfinder.min.css' rel='stylesheet'>
|
||||
|
@ -36,6 +30,9 @@
|
|||
<link href='css/uploadify.css' rel='stylesheet'>
|
||||
<link href='css/animate.min.css' rel='stylesheet'>
|
||||
|
||||
<!-- jQuery -->
|
||||
<script src="js/jquery.min.js"></script>
|
||||
|
||||
<!-- The HTML5 shim, for IE6-8 support of HTML5 elements -->
|
||||
<!--[if lt IE 9]>
|
||||
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
|
||||
|
@ -165,7 +162,7 @@
|
|||
</footer>
|
||||
{/if}
|
||||
</div><!--/.fluid-container-->
|
||||
|
||||
</div>
|
||||
<!-- external javascript
|
||||
================================================== -->
|
||||
<!-- Placed at the end of the document so the pages load faster -->
|
||||
|
@ -304,7 +301,8 @@
|
|||
<!-- <script src="js/charisma.js"></script> -->
|
||||
<!-- help script for page help -->
|
||||
<script src="js/help.js"></script>
|
||||
<!-- application script for Charisma demo -->
|
||||
<script src="js/custom.js"></script>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -112,6 +112,25 @@
|
|||
{/if}
|
||||
<input type="hidden" name="function" value="reply_on_ticket">
|
||||
<input type="hidden" name="ticket_id" value="{$ticket_id}">
|
||||
|
||||
<h3>Upload Attachment</h3>
|
||||
<input data-no-uniform="true" type="file" name="file_upload" id="file_upload">
|
||||
{literal}
|
||||
<script language='JavaScript'>
|
||||
$(document).ready( function () {
|
||||
|
||||
$('#file_upload').uploadify({
|
||||
'formData' : {'PHPSESSID': '{/literal}{$sessionid}{literal}'},
|
||||
'auto' : true,
|
||||
'multi' : true,
|
||||
'method' : 'post',
|
||||
'swf': 'misc/uploadify.swf',
|
||||
'uploader': 'func/upload.php?id='+{/literal}{$ticket_id}{literal}
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
{/literal}
|
||||
<div class="control-group">
|
||||
<label class="control-label"></label>
|
||||
<div class="controls">
|
||||
|
|
Loading…
Reference in a new issue