[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [6962] property: multiple fileupload at ticket
From: |
Sigurd Nes |
Subject: |
[Fmsystem-commits] [6962] property: multiple fileupload at ticket |
Date: |
Thu, 10 Feb 2011 10:42:37 +0000 |
Revision: 6962
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=6962
Author: sigurdne
Date: 2011-02-10 10:42:36 +0000 (Thu, 10 Feb 2011)
Log Message:
-----------
property: multiple fileupload at ticket
Modified Paths:
--------------
trunk/property/inc/class.botts.inc.php
trunk/property/inc/class.fileuploader.inc.php
trunk/property/inc/class.uitts.inc.php
trunk/property/js/yahoo/entity.edit.js
trunk/property/js/yahoo/tts.view.js
trunk/property/setup/phpgw_no.lang
trunk/property/templates/base/tts.xsl
Added Paths:
-----------
trunk/property/templates/portico/images/TestImageNoText_65x29.png
Modified: trunk/property/inc/class.botts.inc.php
===================================================================
--- trunk/property/inc/class.botts.inc.php 2011-02-10 08:56:21 UTC (rev
6961)
+++ trunk/property/inc/class.botts.inc.php 2011-02-10 10:42:36 UTC (rev
6962)
@@ -54,11 +54,12 @@
public $sum_actual_cost = 0;
var $public_functions = array
- (
- 'read' => true,
- 'read_single' => true,
- 'save' => true,
- );
+ (
+ 'read' => true,
+ 'read_single' => true,
+ 'save' => true,
+ 'addfiles' => true,
+ );
function property_botts($session=false)
{
@@ -1131,4 +1132,41 @@
array_unshift($values,$default_value);
return $values;
}
+
+ public function addfiles()
+ {
+ $GLOBALS['phpgw_info']['flags']['xslt_app'] = false;
+ $GLOBALS['phpgw_info']['flags']['noframework'] = true;
+ $GLOBALS['phpgw_info']['flags']['nofooter'] = true;
+
+ $acl = & $GLOBALS['phpgw']->acl;
+ $acl_add = $this->check('.ticket',
PHPGW_ACL_ADD, 'property');
+ $acl_edit = $this->check('.ticket',
PHPGW_ACL_EDIT, 'property');
+ $id = phpgw::get_var('id',
'int');
+ $fileuploader = CreateObject('property.fileuploader');
+
+ if(!$acl_add && !$acl_edit)
+ {
+ $GLOBALS['phpgw']->common->phpgw_exit();
+ }
+
+ if(!$id)
+ {
+ $GLOBALS['phpgw']->common->phpgw_exit();
+ }
+
+ $test = false;//true;
+ if ($test)
+ {
+ foreach ($_FILES as $fieldName => $file)
+ {
+ move_uploaded_file($file['tmp_name'],
"{$GLOBALS['phpgw_info']['server']['temp_dir']}/" .
strip_tags(basename($file['name'])));
+ }
+ $GLOBALS['phpgw']->common->phpgw_exit();
+ }
+
+ $bofiles = CreateObject('property.bofiles');
+
+ $fileuploader->upload($bofiles,
"{$bofiles->fakebase}/fmticket/{$id}");
+ }
}
Modified: trunk/property/inc/class.fileuploader.inc.php
===================================================================
--- trunk/property/inc/class.fileuploader.inc.php 2011-02-10 08:56:21 UTC
(rev 6961)
+++ trunk/property/inc/class.fileuploader.inc.php 2011-02-10 10:42:36 UTC
(rev 6962)
@@ -72,6 +72,7 @@
$js_code = self::get_js($oArgs);
$title = lang('fileuploader');
+ $lang_cancel = lang('cancel');
$html = <<<HTML
<!DOCTYPE html>
<html>
@@ -97,7 +98,7 @@
<div id="divStatus">0 Files
Uploaded</div>
<div>
<span
id="spanButtonPlaceHolder"></span>
- <input
id="btnCancel" type="button" value="Cancel All Uploads"
onclick="swfu.cancelQueue();" disabled="disabled" style="margin-left: 2px;
font-size: 8pt; height: 29px;" />
+ <input
id="btnCancel" type="button" value="{$lang_cancel}"
onclick="swfu.cancelQueue();" disabled="disabled" style="margin-left: 2px;
font-size: 8pt; height: 29px;" />
</div>
</form>
</div>
@@ -110,13 +111,14 @@
static function get_js($oArgs = '')
{
- $button_text = lang('Select Files');
+ $button_text = lang('Select');
$str_base_url = 'http';
$str_base_url .= phpgw::get_var('HTTPS', 'bool',
'SERVER') ? 's' : '' ;
$str_base_url .= '://';
$str_base_url .= phpgw::get_var('HTTP_HOST', 'string',
'SERVER');
$str_base_url .= $GLOBALS['phpgw']->link('/', array(),
true);
+ $image_url =
$GLOBALS['phpgw']->common->image('property', 'TestImageNoText_65x29');
$js_code = <<<JS
<script type="text/javascript">
var swfu;
@@ -142,7 +144,7 @@
debug: false,
// Button settings
- button_image_url:
"images/TestImageNoText_65x29.png",
+ button_image_url: "{$image_url}",
button_width: "65",
button_height: "29",
button_placeholder_id: "spanButtonPlaceHolder",
Modified: trunk/property/inc/class.uitts.inc.php
===================================================================
--- trunk/property/inc/class.uitts.inc.php 2011-02-10 08:56:21 UTC (rev
6961)
+++ trunk/property/inc/class.uitts.inc.php 2011-02-10 10:42:36 UTC (rev
6962)
@@ -88,7 +88,6 @@
$this->acl_edit =
$this->acl->check($this->acl_location, PHPGW_ACL_EDIT, 'property');
$this->acl_delete =
$this->acl->check($this->acl_location, PHPGW_ACL_DELETE, 'property');
$this->acl_manage =
$this->acl->check($this->acl_location, PHPGW_ACL_PRIVATE, 'property'); // manage
- $this->bo->acl_location = $this->acl_location;
$this->start =
$this->bo->start;
$this->query =
$this->bo->query;
@@ -1422,6 +1421,7 @@
'start_date'
=>$start_date,
'end_date'
=>$end_date
)
+
)),
'lang_priority' =>
lang('Priority'),
@@ -3008,6 +3008,10 @@
'contact_phone'
=> $ticket['contact_phone'],
'pref_send_mail'
=>
isset($GLOBALS['phpgw_info']['user']['preferences']['property']['tts_user_mailnotification'])?$GLOBALS['phpgw_info']['user']['preferences']['property']['tts_user_mailnotification']:'',
'fileupload'
=>
isset($this->bo->config->config_data['fmttsfileupload'])?$this->bo->config->config_data['fmttsfileupload']:'',
+ 'multiple_uploader'
=> true,
+ 'fileuploader_action'
=> "{menuaction:'property.fileuploader.add',"
+
."upload_target:'property.botts.addfiles',"
+
."id:'{$id}'}",
'link_view_file'
=> $GLOBALS['phpgw']->link('/index.php',$link_file_data),
'link_to_files'
=>
isset($this->bo->config->config_data['files_url'])?$this->bo->config->config_data['files_url']:'',
'files'
=> isset($ticket['files'])?$ticket['files']:'',
Modified: trunk/property/js/yahoo/entity.edit.js
===================================================================
--- trunk/property/js/yahoo/entity.edit.js 2011-02-10 08:56:21 UTC (rev
6961)
+++ trunk/property/js/yahoo/entity.edit.js 2011-02-10 10:42:36 UTC (rev
6962)
@@ -31,7 +31,7 @@
this.refresh_files = function()
{
- execute_async(myDataTable_0);
+ execute_async(myDataTable_2);
}
Modified: trunk/property/js/yahoo/tts.view.js
===================================================================
--- trunk/property/js/yahoo/tts.view.js 2011-02-10 08:56:21 UTC (rev 6961)
+++ trunk/property/js/yahoo/tts.view.js 2011-02-10 10:42:36 UTC (rev 6962)
@@ -121,10 +121,46 @@
}
}
+ this.fileuploader = function()
+ {
+ var sUrl = phpGWLink('index.php', fileuploader_action);
+ var onDialogShow = function(e, args, o)
+ {
+ var frame = document.createElement('iframe');
+ frame.src = sUrl;
+ frame.width = "100%";
+ frame.height = "400";
+ o.setBody(frame);
+ };
+ lightbox.showEvent.subscribe(onDialogShow, lightbox);
+ lightbox.show();
+ }
+ this.refresh_files = function()
+ {
+ execute_async(myDataTable_0);
+ }
YAHOO.util.Event.addListener(window, "load", function()
{
+ lightbox = new YAHOO.widget.Dialog("lightbox-placeholder",
+ {
+ width : "600px",
+ fixedcenter : true,
+ visible : false,
+ modal : false
+ //draggable: true,
+ //constraintoviewport : true
+ });
+
+ lightbox.render();
+
+ YAHOO.util.Dom.setStyle('lightbox-placeholder', 'display',
'block');
+});
+
+
+YAHOO.util.Event.addListener(window, "load", function()
+{
loader = new YAHOO.util.YUILoader();
loader.addModule({
name: "anyone",
Modified: trunk/property/setup/phpgw_no.lang
===================================================================
--- trunk/property/setup/phpgw_no.lang 2011-02-10 08:56:21 UTC (rev 6961)
+++ trunk/property/setup/phpgw_no.lang 2011-02-10 10:42:36 UTC (rev 6962)
@@ -1393,6 +1393,7 @@
select email property no velg e-post
select file to roll back property no velg fil for
tilbakerulling
select file to upload property no Velg fil for opplasting
+select files property no Velg filer
select grouping property no velg gruppering
select invoice type property no Velg Art
select key responsible property no velg nøkkelansvarlig
@@ -1718,6 +1719,7 @@
update the not active category for locations property no
Oppdater kategori til utgått for lokaliseringer
upload file property no Last opp fil
upload multiple files property no Last opp flere filer
+upload files property no Last opp filer
url property no URL
user property no Bruker
user contact info property no Bruker kontaktinfo
Modified: trunk/property/templates/base/tts.xsl
===================================================================
--- trunk/property/templates/base/tts.xsl 2011-02-10 08:56:21 UTC (rev
6961)
+++ trunk/property/templates/base/tts.xsl 2011-02-10 10:42:36 UTC (rev
6962)
@@ -1082,6 +1082,9 @@
<xsl:choose>
<xsl:when test="fileupload = 1">
+ <script type="text/javascript">
+ var fileuploader_action =
<xsl:value-of select="fileuploader_action" />;
+ </script>
<xsl:call-template name="file_upload"/>
</xsl:when>
</xsl:choose>
@@ -1470,6 +1473,12 @@
<hr noshade="noshade" width="100%" align="center"
size="1"/>
+ <div id="lightbox-placeholder"
style="background-color:#000000;color:#FFFFFF;display:none">
+ <div class="hd"
style="background-color:#000000;color:#000000; border:0; text-align:center">
<xsl:value-of select="php:function('lang', 'fileuploader')" /> </div>
+ <div class="bd" style="text-align:center;"> </div>
+
+ </div>
+
<!-- DATATABLE DEFINITIONS-->
<script type="text/javascript">
var property_js = <xsl:value-of
select="property_js" />;
Added: trunk/property/templates/portico/images/TestImageNoText_65x29.png
===================================================================
(Binary files differ)
Property changes on:
trunk/property/templates/portico/images/TestImageNoText_65x29.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [6962] property: multiple fileupload at ticket,
Sigurd Nes <=