[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [12728] convert uidimb_role_user
From: |
Sigurd Nes |
Subject: |
[Fmsystem-commits] [12728] convert uidimb_role_user |
Date: |
Tue, 10 Feb 2015 14:06:49 +0000 |
Revision: 12728
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=12728
Author: sigurdne
Date: 2015-02-10 14:06:48 +0000 (Tue, 10 Feb 2015)
Log Message:
-----------
convert uidimb_role_user
Modified Paths:
--------------
branches/dev-syncromind/phpgwapi/js/jquery/common.js
branches/dev-syncromind/property/inc/class.uidimb_role_user.inc.php
branches/dev-syncromind/property/js/portico/ajax_dimb_role_user.js
branches/dev-syncromind/property/templates/base/dimb_role_user.xsl
Removed Paths:
-------------
branches/dev-syncromind/property/js/yahoo/dimb_role_user.index.js
Modified: branches/dev-syncromind/phpgwapi/js/jquery/common.js
===================================================================
--- branches/dev-syncromind/phpgwapi/js/jquery/common.js 2015-02-10
13:09:35 UTC (rev 12727)
+++ branches/dev-syncromind/phpgwapi/js/jquery/common.js 2015-02-10
14:06:48 UTC (rev 12728)
@@ -143,6 +143,10 @@
return "<div align=\"right\">"+oData[key]+"</div>";
};
+JqueryPortico.FormatterCenter = function(key, oData) {
+ return "<center>"+oData[key]+"</center>";
+};
+
JqueryPortico.inlineTableHelper = function(container, ajax_url, columns,
options, data) {
options = options || {};
Modified: branches/dev-syncromind/property/inc/class.uidimb_role_user.inc.php
===================================================================
--- branches/dev-syncromind/property/inc/class.uidimb_role_user.inc.php
2015-02-10 13:09:35 UTC (rev 12727)
+++ branches/dev-syncromind/property/inc/class.uidimb_role_user.inc.php
2015-02-10 14:06:48 UTC (rev 12728)
@@ -26,14 +26,9 @@
* @version $Id$
*/
- phpgw::import_class('phpgwapi.yui');
- /**
- * Import the jQuery class
- */
- phpgw::import_class('phpgwapi.jquery');
+ phpgw::import_class('phpgwapi.uicommon_jquery');
-
- class property_uidimb_role_user
+ class property_uidimb_role_user extends phpgwapi_uicommon_jquery
{
var $cat_id;
var $start;
@@ -56,6 +51,8 @@
function __construct()
{
+ parent::__construct();
+
$GLOBALS['phpgw_info']['flags']['xslt_app'] = true;
$this->account_id =
$GLOBALS['phpgw_info']['user']['account_id'];
$this->bo =
CreateObject('property.bodimb_role_user');
@@ -116,8 +113,6 @@
}
-
-
function index()
{
$receipt = array();
@@ -135,23 +130,8 @@
$msgbox_data =
$GLOBALS['phpgw']->common->msgbox($msgbox_data);
}
- $myColumnDefs = array();
- $datavalues = array();
- $myButtons = array();
-
- $datavalues[] = array
+ $myColumnDefs = array
(
- 'name' => "0",
- 'values' =>
$this->query(),//json_encode(array()),
- 'total_records' => 0,
- 'permission' => "''",
- 'is_paginator' => 0,
- 'edit_action' => "''",
- 'footer' => 0
- );
-
- $datatable = array
- (
array
(
'key' => 'id',
@@ -168,13 +148,13 @@
'key' => 'ecodimb',
'label' => lang('dim b'),
'sortable' => false,
- 'formatter' => 'FormatterRight',
+ 'formatter' =>
'JqueryPortico.FormatterRight',
),
array
(
'key' => 'role',
'label' => lang('role'),
- 'formatter' => 'FormatterRight',
+ 'formatter' =>
'JqueryPortico.FormatterRight',
'sortable' => true
),
array
@@ -182,53 +162,59 @@
'key' => 'default_user',
'label' => lang('default'),
'sortable' => false,
- 'formatter' => 'FormatterCenter',
+ 'formatter' =>
'JqueryPortico.FormatterCenter',
),
array
(
'key' => 'active_from',
'label' => lang('date from'),
'sortable' => true,
- 'formatter' => 'FormatterRight',
+ 'formatter' =>
'JqueryPortico.FormatterRight',
),
array
(
'key' => 'active_to',
'label' => lang('date to'),
'sortable' => false,
- 'formatter' => 'FormatterCenter',
+ 'formatter' =>
'JqueryPortico.FormatterCenter',
),
array
(
'key' => 'add',
'label' => lang('add'),
'sortable' => false,
- 'formatter' => 'FormatterCenter',
+ 'formatter' =>
'JqueryPortico.FormatterCenter',
),
array
(
'key' => 'delete',
'label' => lang('delete'),
'sortable' => false,
- 'formatter' => 'FormatterCenter',
+ 'formatter' =>
'JqueryPortico.FormatterCenter',
),
array
(
'key' => 'alter_date',
'label' => lang('alter date'),
'sortable' => false,
- 'formatter' => 'FormatterCenter',
+ 'formatter' =>
'JqueryPortico.FormatterCenter',
),
);
- $myColumnDefs[0] = array
+
+ $datatable_def[] = array
(
- 'name' => "0",
- 'values' => json_encode($datatable)
- );
+ 'container' =>
'datatable-container_0',
+ 'requestUrl' =>
json_encode(self::link(array('menuaction' =>
'property.uidimb_role_user.query','phpgw_return_as'=>'json'))),
+ 'ColumnDefs' => $myColumnDefs,
+ 'data' => '',
+ 'config' => array(
+ array('disableFilter' => true),
+ array('disablePagination' => true)
+ )
+ );
-
$user_list =
$this->bocommon->get_user_list_right2('select', PHPGW_ACL_READ, $this->filter,
'.invoice', array(), $this->account_id);
$role_list = execMethod('property.bogeneric.get_list',
array('type'=>'dimb_role', 'selected' => $role ));
$dimb_list = execMethod('property.bogeneric.get_list',
array('type'=>'dimb', 'selected' => $dimb ));
@@ -239,12 +225,7 @@
$data = array
(
- 'td_count'
=> '""',
- 'property_js'
=>
json_encode($GLOBALS['phpgw_info']['server']['webserver_url']."/property/js/yahoo/property2.js"),
- 'datatable'
=> $datavalues,
- 'myColumnDefs'
=> $myColumnDefs,
- 'myButtons'
=> $myButtons,
-
+ 'datatable_def'
=> $datatable_def,
'msgbox_data'
=> $msgbox_data,
'filter_form'
=> array
(
@@ -260,24 +241,9 @@
$GLOBALS['phpgw']->jqcal->add_listener('active_from');
$GLOBALS['phpgw']->jqcal->add_listener('active_to');
-
$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');
-
- phpgwapi_yui::load_widget('dragdrop');
- phpgwapi_yui::load_widget('datatable');
- phpgwapi_yui::load_widget('connection');
- phpgwapi_yui::load_widget('loader');
- phpgwapi_yui::load_widget('tabview');
- phpgwapi_yui::load_widget('paginator');
- phpgwapi_yui::load_widget('animation');
-
- phpgwapi_jquery::load_widget('core');
-
self::add_javascript('property', 'portico',
'ajax_dimb_role_user.js');
- self::add_javascript('property', 'yahoo',
'dimb_role_user.index.js');
-
$GLOBALS['phpgw']->xslttpl->add_file(array('dimb_role_user'));
+
$GLOBALS['phpgw']->xslttpl->add_file(array('dimb_role_user',
'datatable_inline'));
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('data' => $data));
}
@@ -313,7 +279,17 @@
$results['results'][]= $entry;
}
- return json_encode($values);
+ $result_data = array
+ (
+ 'results' => $values,
+ 'total_records' => count($values),
+ 'draw' => phpgw::get_var('draw', 'int')
+ );
+
+
+ return $this->jquery_results($result_data);
+
+ // return json_encode($values);
}
public function edit()
Modified: branches/dev-syncromind/property/js/portico/ajax_dimb_role_user.js
===================================================================
--- branches/dev-syncromind/property/js/portico/ajax_dimb_role_user.js
2015-02-10 13:09:35 UTC (rev 12727)
+++ branches/dev-syncromind/property/js/portico/ajax_dimb_role_user.js
2015-02-10 14:06:48 UTC (rev 12728)
@@ -45,7 +45,8 @@
{
$(submitBnt).val("Lagret");
var oArgs =
{menuaction:'property.uidimb_role_user.query', dimb_id:$("#dimb_id").val(),
user_id:$("#user_id").val(),role_id:$("#role_id").val(),query_start:$("#query_start").val(),query_end:$("#query_end").val()};
-
execute_async(myDataTable_0,oArgs);
+ var requestUrl =
phpGWLink('index.php', oArgs, true);
+
JqueryPortico.updateinlineTableHelper(oTable0, requestUrl);
}
else
{
@@ -90,7 +91,10 @@
function update_dimb_role_user_table()
{
var oArgs = {menuaction:'property.uidimb_role_user.query',
dimb_id:$("#dimb_id").val(),
user_id:$("#user_id").val(),role_id:$("#role_id").val(),query_start:$("#query_start").val(),query_end:$("#query_end").val()};
- execute_async(myDataTable_0, oArgs);
+ var requestUrl = phpGWLink('index.php', oArgs, true);
+
+ JqueryPortico.updateinlineTableHelper(oTable0, requestUrl);
+// execute_async(myDataTable_0, oArgs);
$("#receipt").html('');
}
Deleted: branches/dev-syncromind/property/js/yahoo/dimb_role_user.index.js
===================================================================
--- branches/dev-syncromind/property/js/yahoo/dimb_role_user.index.js
2015-02-10 13:09:35 UTC (rev 12727)
+++ branches/dev-syncromind/property/js/yahoo/dimb_role_user.index.js
2015-02-10 14:06:48 UTC (rev 12728)
@@ -1,38 +0,0 @@
-var myPaginator_0, myDataTable_0
-
- this.myParticularRenderEvent = function()
- {
-
- }
-
-
-
- var FormatterRight = function(elCell, oRecord, oColumn, oData)
- {
- elCell.innerHTML = "<div align=\"right\">"+oData+"</div>";
- }
-
- var FormatterCenter = function(elCell, oRecord, oColumn, oData)
- {
- elCell.innerHTML = "<center>"+oData+"</center>";
- }
-
-
-
/********************************************************************************/
-
-
-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();
-});
-
-
-
Modified: branches/dev-syncromind/property/templates/base/dimb_role_user.xsl
===================================================================
--- branches/dev-syncromind/property/templates/base/dimb_role_user.xsl
2015-02-10 13:09:35 UTC (rev 12727)
+++ branches/dev-syncromind/property/templates/base/dimb_role_user.xsl
2015-02-10 14:06:48 UTC (rev 12728)
@@ -1,22 +1,5 @@
<!-- $Id$ -->
-<func:function name="phpgw:conditional">
- <xsl:param name="test"/>
- <xsl:param name="true"/>
- <xsl:param name="false"/>
-
- <func:result>
- <xsl:choose>
- <xsl:when test="$test">
- <xsl:value-of select="$true"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$false"/>
- </xsl:otherwise>
- </xsl:choose>
- </func:result>
-</func:function>
-
<!-- separate tabs and inline tables-->
@@ -70,11 +53,26 @@
<xsl:call-template name="role_fields" />
<tr>
<td
colspan = '6'>
-
<xsl:apply-templates select="paging"/>
-
<xsl:apply-templates select="datatable"/>
+
<!--xsl:apply-templates select="paging"/>
+
<xsl:apply-templates select="datatable"/-->
+
<xsl:for-each select="datatable_def">
+
<xsl:if test="container = 'datatable-container_0'">
+
<xsl:call-template name="table_setup">
+
<xsl:with-param name="container" select ='container'/>
+
<xsl:with-param name="requestUrl" select ='requestUrl'/>
+
<xsl:with-param name="ColumnDefs" select ='ColumnDefs'/>
+
<xsl:with-param name="data" select ='data'/>
+
<xsl:with-param name="config" select ='config'/>
+
</xsl:call-template>
+
</xsl:if>
+
</xsl:for-each>
+
</td>
</tr>
</table>
+ <div id="receipt"></div>
+ <xsl:variable
name="label_submit"><xsl:value-of select="php:function('lang', 'save')"
/></xsl:variable>
+ <div
class="row_on"><input type="submit" name="update_acl" id="frm_update_acl"
value="{$label_submit}"/></div>
</form>
</div>
</div>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [12728] convert uidimb_role_user,
Sigurd Nes <=