[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [12555] more on uitts
From: |
Sigurd Nes |
Subject: |
[Fmsystem-commits] [12555] more on uitts |
Date: |
Wed, 07 Jan 2015 15:19:08 +0000 |
Revision: 12555
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=12555
Author: sigurdne
Date: 2015-01-07 15:19:07 +0000 (Wed, 07 Jan 2015)
Log Message:
-----------
more on uitts
Modified Paths:
--------------
branches/dev-syncromind/property/inc/class.uitts.inc.php
branches/dev-syncromind/property/js/portico/tts.view.js
branches/dev-syncromind/property/templates/base/tts.xsl
Modified: branches/dev-syncromind/property/inc/class.uitts.inc.php
===================================================================
--- branches/dev-syncromind/property/inc/class.uitts.inc.php 2015-01-07
15:17:56 UTC (rev 12554)
+++ branches/dev-syncromind/property/inc/class.uitts.inc.php 2015-01-07
15:19:07 UTC (rev 12555)
@@ -2286,7 +2286,6 @@
);
$payments = $this->bo->get_payments($id);
-
$datatable_def[] = array
(
'container' =>
'datatable-container_4',
@@ -2364,14 +2363,6 @@
$this->cats->set_appname('property','.project');
$order_catetory =
$this->cats->formatted_xslt_list(array('select_name' =>
'values[cat_id]','selected' => $ticket['order_cat_id']));
- $property_js = "/property/js/yahoo/property2.js";
-
- if
(!isset($GLOBALS['phpgw_info']['server']['no_jscombine']) ||
!$GLOBALS['phpgw_info']['server']['no_jscombine'])
- {
- $cachedir =
urlencode($GLOBALS['phpgw_info']['server']['temp_dir']);
- $property_js =
"/phpgwapi/inc/combine.php?cachedir={$cachedir}&type=javascript&files=" .
str_replace('/', '--', ltrim($property_js,'/'));
- }
-
$year = date('Y') -1;
$limit = $year + 3;
@@ -2415,7 +2406,6 @@
'need_approval'
=> $need_approval,
'value_approval_mail_address' =>
$supervisor_email,
- // 'vendor_email'
=> $vendor_email,
'contact_data'
=> $contact_data,
'lookup_type'
=> $lookup_type,
@@ -2424,8 +2414,6 @@
'tabs'
=> self::_generate_tabs(true),
'td_count'
=> '""',
'base_java_url'
=> "{menuaction:'property.uitts.update_data',id:{$id}}",
- 'base_java_notify_url'
=>
"{menuaction:'property.notify.update_data',location_id:{$location_id},location_item_id:'{$id}'}",
- // 'property_js'
=> json_encode($GLOBALS['phpgw_info']['server']['webserver_url'] .
$property_js),
'value_origin'
=> $ticket['origin'],
'value_target'
=> $ticket['target'],
'value_finnish_date'
=> $ticket['finnish_date'],
@@ -2511,14 +2499,6 @@
);
-/*
- $GLOBALS['phpgw']->css->validate_file('datatable');
- $GLOBALS['phpgw']->css->validate_file('property');
-
$GLOBALS['phpgw']->css->add_external_file('property/templates/base/css/property.css');
-
$GLOBALS['phpgw']->css->add_external_file('phpgwapi/js/yahoo/datatable/assets/skins/sam/datatable.css');
-
$GLOBALS['phpgw']->css->add_external_file('phpgwapi/js/yahoo/paginator/assets/skins/sam/paginator.css');
-
$GLOBALS['phpgw']->css->add_external_file('phpgwapi/js/yahoo/container/assets/skins/sam/container.css');
- */
self::add_javascript('property', 'portico',
'tts.view.js');
$this->_insert_custom_js();
Modified: branches/dev-syncromind/property/js/portico/tts.view.js
===================================================================
--- branches/dev-syncromind/property/js/portico/tts.view.js 2015-01-07
15:17:56 UTC (rev 12554)
+++ branches/dev-syncromind/property/js/portico/tts.view.js 2015-01-07
15:19:07 UTC (rev 12555)
@@ -1,57 +1,44 @@
-var myPaginator_0, myDataTable_0
-var myPaginator_1, myDataTable_1;
-var myPaginator_2, myDataTable_2;
-var myPaginator_3, myDataTable_3;
-var myPaginator_4, myDataTable_4;
-var myPaginator_5, myDataTable_5;
var d;
var vendor_id = 0;
-/********************************************************************************/
-this.myParticularRenderEvent = function()
+this.local_DrawCallback4 = function()
{
- this.addFooterDatatable(myPaginator_4,myDataTable_4);
-}
+ //console.log(oTable4);
+ var api = oTable4.api();
+ // Remove the formatting to get integer data for
summation
+ var intVal = function ( i )
+ {
+ return typeof i === 'string' ?
+ i.replace(/[\$,]/g, '')*1 :
+ typeof i === 'number' ?
+ i : 0;
+ };
-this.addFooterDatatable = function(paginator,datatable)
-{
- //call getSumPerPage(name of column) in property.js
- tmp_sum1 = getTotalSum('amount',2,paginator,datatable);
+ var columns = ["1"];
- if(typeof(tableYUI)=='undefined')
- {
- tableYUI =
YAHOO.util.Dom.getElementsByClassName("yui-dt-data","tbody")[1].parentNode;
- tableYUI.setAttribute("id","tableYUI");
- }
- else
- {
- tableYUI.deleteTFoot();
- }
+ columns.forEach(function(col)
+ {
+ data = api.column( col, { page: 'current'}
).data();
+ pageTotal = data.length ?
+ data.reduce(function (a, b){
+ return intVal(a) +
intVal(b);
+ }) : 0;
- //Create ROW
- newTR = document.createElement('tr');
+ $(api.column(col).footer()).html("<div
align=\"right\">"+pageTotal+"</div>");
+ });
- td_sum('Sum');
- td_sum(tmp_sum1);
- td_empty(1);
-
- myfoot = tableYUI.createTFoot();
- myfoot.setAttribute("id","myfoot");
- myfoot.appendChild(newTR);
-}
-
+};
/********************************************************************************/
var FormatterCenter = function(key, oData)
{
return "<center>"+oData[key]+"</center>";
-}
+};
-var FormatterAmount2 = function(elCell, oRecord, oColumn, oData)
+var FormatterAmount2 = function(key, oData)
{
- var amount = YAHOO.util.Number.format(oData, {decimalPlaces:2,
decimalSeparator:",", thousandsSeparator:" "});
- elCell.innerHTML = "<div align=\"right\">"+amount+"</div>";
-}
+ return "<div align=\"right\">"+oData[key]+"</div>";
+};
/********************************************************************************/
@@ -88,11 +75,11 @@
},
failure: function(o)
{
- window.alert('failure - try again - once')
+ window.alert('failure - try again - once');
},
timeout: 5000
});
- }
+ };
function SmsCountKeyUp(maxChar)
@@ -133,8 +120,6 @@
this.fetch_vendor_email=function()
{
-// formObject = document.body.getElementsByTagName('form');
-// YAHOO.util.Connect.setForm(formObject[0]);//First form
if(document.getElementById('vendor_id').value)
{
base_java_url['vendor_id'] =
document.getElementById('vendor_id').value;
@@ -143,87 +128,49 @@
if(document.getElementById('vendor_id').value != vendor_id)
{
base_java_url['action'] = 'get_vendor';
- execute_async(myDataTable_3);
+ var oArgs = base_java_url;
+ var strURL = phpGWLink('index.php', oArgs, true);
+ JqueryPortico.updateinlineTableHelper(oTable3, strURL);
vendor_id = document.getElementById('vendor_id').value;
}
- }
+ };
this.onDOMAttrModified = function(e)
{
- var attr = e.attrName || e.propertyName
+ var attr = e.attrName || e.propertyName;
var target = e.target || e.srcElement;
- if (attr.toLowerCase() == 'vendor_id')
+ if (attr.toLowerCase() === 'vendor_id')
{
fetch_vendor_email();
}
- }
+ };
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();
- }
+ TINY.box.show({iframe:sUrl,
boxid:"frameless",width:750,height:450,fixed:false,maskid:"darkmask",maskopacity:40,
mask:true, animate:true, close: true,closejs:function(){location.reload();}});
+ };
this.refresh_files = function()
{
base_java_url['action'] = 'get_files';
execute_async(myDataTable_2);
- }
+ };
-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",
- type: "js",
- fullpath: property_js
- });
-
- loader.require("anyone");
- loader.insert();
-});
-
-YAHOO.util.Event.addListener(window, "load", function()
-{
- d = document.getElementById('vendor_id');
- if(d)
+ window.addEventListener("load", function()
{
- if (d.attachEvent)
+ d = document.getElementById('vendor_id');
+ if(d)
{
- d.attachEvent('onpropertychange', onDOMAttrModified,
false);
- }
- else
- {
- d.addEventListener('DOMAttrModified',
onDOMAttrModified, false);
- }
- }
-});
+ if (d.attachEvent)
+ {
+ d.attachEvent('onpropertychange',
onDOMAttrModified, false);
+ }
+ else
+ {
+ d.addEventListener('DOMAttrModified',
onDOMAttrModified, false);
+ }
+ }
+ });
\ No newline at end of file
Modified: branches/dev-syncromind/property/templates/base/tts.xsl
===================================================================
--- branches/dev-syncromind/property/templates/base/tts.xsl 2015-01-07
15:17:56 UTC (rev 12554)
+++ branches/dev-syncromind/property/templates/base/tts.xsl 2015-01-07
15:19:07 UTC (rev 12555)
@@ -1096,9 +1096,7 @@
</div>
<!-- DATATABLE DEFINITIONS-->
<script type="text/javascript">
- var property_js = <xsl:value-of select="property_js"/>;
var base_java_url = <xsl:value-of select="base_java_url"/>;
- var base_java_notify_url = <xsl:value-of
select="base_java_notify_url"/>;
var datatable = new Array();
var myColumnDefs = new Array();
var myButtons = new Array();
@@ -1258,6 +1256,24 @@
</xsl:for-each>
</tr>
</thead>
+ <tfoot>
+ <tr>
+ <xsl:for-each select="$ColumnDefs">
+ <xsl:choose>
+ <xsl:when test="hidden">
+ <xsl:if
test="hidden =0">
+ <th>
+ </th>
+ </xsl:if>
+ </xsl:when>
+ <xsl:otherwise>
+ <th>
+ </th>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:for-each>
+ </tr>
+ </tfoot>
</table>
<script>
JqueryPortico.inlineTablesDefined += 1;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [12555] more on uitts,
Sigurd Nes <=