[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [7567] demo: more on demo
From: |
Sigurd Nes |
Subject: |
[Fmsystem-commits] [7567] demo: more on demo |
Date: |
Thu, 08 Sep 2011 13:30:21 +0000 |
Revision: 7567
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=7567
Author: sigurdne
Date: 2011-09-08 13:30:19 +0000 (Thu, 08 Sep 2011)
Log Message:
-----------
demo: more on demo
Modified Paths:
--------------
trunk/demo/inc/class.uidemo.inc.php
Added Paths:
-----------
trunk/demo/js/yahoo/demo.edit.js
Modified: trunk/demo/inc/class.uidemo.inc.php
===================================================================
--- trunk/demo/inc/class.uidemo.inc.php 2011-09-08 10:38:03 UTC (rev 7566)
+++ trunk/demo/inc/class.uidemo.inc.php 2011-09-08 13:30:19 UTC (rev 7567)
@@ -683,8 +683,6 @@
}
}
-
$GLOBALS['phpgw']->xslttpl->add_file(array('demo','attributes_form'));
-
if (isset($values) && is_array($values))
{
if(!$this->acl_edit)
@@ -706,6 +704,11 @@
if ((isset($values['save']) && $values['save'])
|| (isset($values['apply']) && $values['apply']))
{
+
if($GLOBALS['phpgw']->session->is_repost())
+ {
+
$receipt['error'][]=array('msg'=>lang('Hmm... looks like a repost!'));
+ }
+
if(!$values['cat_id'] ||
$values['cat_id'] == 'none')
{
$receipt['error'][]=array('msg'=>lang('Please select a category!'));
@@ -810,17 +813,61 @@
);
}
+ // date 1 (jscalendar)
+
execMethod('phpgwapi.jscalendar.add_listener','values_start_date');
+
+ // date 2 (YUI)
+ $end_date =
$GLOBALS['phpgw']->yuical->add_listener('end_date',date($GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'],
time()));
+
+
+
+
+ //inline tables
+ $values['consume'][] = array
+ (
+ 'amount' => 123456,
+ 'date' => 2012,
+ 'delete' => ''
+ );
+ $values['consume'][] = array
+ (
+ 'amount' => 6789012,
+ 'date' => 2013,
+ 'delete' => ''
+ );
- $msgbox_data =
(isset($receipt)?$GLOBALS['phpgw']->common->msgbox_data($receipt):'');
+
+ $datavalues[0] = array
+ (
+ 'name' => "0",
+ 'values' =>
json_encode($values['consume']),
+ 'total_records' =>
count($values['consume']),
+ 'edit_action' => "''",
+ 'is_paginator' => 1,
+ 'footer' => 0
+ );
+
+
+ $myColumnDefs[0] = array
+ (
+ 'name' => "0",
+ 'values' => json_encode(array(
array('key' =>
'amount','label'=>lang('amount'),'sortable'=>true,'resizeable'=>true,
'formatter' => FormatterRight),
+
array('key' =>
'date','label'=>lang('date'),'sortable'=>true,'resizeable'=>true),
+
array('key' =>
'delete','label'=>lang('delete'),'sortable'=>false,'resizeable'=>false)))
+ );
+
+
+ $msgbox_data =
isset($receipt)?$GLOBALS['phpgw']->common->msgbox_data($receipt):'';
+
$data = array
(
- 'value_entry_date'
=> (isset($values['entry_date'])?$values['entry_date']:''),
- 'value_name'
=> (isset($values['name'])?$values['name']:''),
- 'value_address'
=> (isset($values['address'])?$values['address']:''),
- 'value_zip'
=> (isset($values['zip'])?$values['zip']:''),
- 'value_town'
=> (isset($values['town'])?$values['town']:''),
- 'value_remark'
=> (isset($values['remark'])?$values['remark']:''),
+ 'value_entry_date'
=> isset($values['entry_date'])?$values['entry_date']:'',
+ 'value_name'
=> isset($values['name'])?$values['name']:'',
+ 'value_address'
=> isset($values['address'])?$values['address']:'',
+ 'value_zip'
=> isset($values['zip'])?$values['zip']:'',
+ 'value_town'
=> isset($values['town'])?$values['town']:'',
+ 'value_remark'
=> isset($values['remark'])?$values['remark']:'',
'msgbox_data'
=> $GLOBALS['phpgw']->common->msgbox($msgbox_data),
'form_action'
=> $GLOBALS['phpgw']->link('/index.php',$link_data),
@@ -831,6 +878,15 @@
'value_access'
=> isset($values['access'])?$values['access']:'',
'generic_list_1'
=> array('options' => $generic_list_1),
'generic_list_2'
=> array('options' => $generic_list_2),
+
+ 'value_start_date'
=> date($GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'],
time()),
+ 'img_cal'
=> $GLOBALS['phpgw']->common->image('phpgwapi','cal'),
+ 'end_date'
=> $end_date,
+ //inline tables
+ 'property_js'
=>
json_encode($GLOBALS['phpgw_info']['server']['webserver_url']."/property/js/yahoo/property2.js"),
+ 'datatable'
=> $datavalues,
+ 'myColumnDefs'
=> $myColumnDefs,
+ 'tabs'
=> self::_generate_tabs(),
);
$GLOBALS['phpgw']->richtext->replace_element('remark');
@@ -839,9 +895,42 @@
$appname = lang('demo');
$GLOBALS['phpgw_info']['flags']['app_header'] =
lang('demo') . " - {$appname}: {$function_msg}";
+
$GLOBALS['phpgw']->xslttpl->add_file(array('edit','attributes_form'));
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('edit' => $data));
+
+ $GLOBALS['phpgw']->js->validate_file( 'yahoo',
'demo.edit', 'demo' );
+
+ phpgwapi_yui::load_widget('dragdrop');
+ phpgwapi_yui::load_widget('datatable');
+ // phpgwapi_yui::load_widget('menu');
+ 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');
+
$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');
+
}
+
+ protected function _generate_tabs()
+ {
+ $tabs = array
+ (
+ 'general' => array('label' =>
lang('general'), 'link' => '#general'),
+ 'list' => array('label' =>
lang('list'), 'link' => '#list'),
+ 'tables' => array('label' =>
lang('inline tables'), 'link' => '#tables'),
+ 'dates' => array('label' =>
lang('dates'), 'link' => '#dates'),
+ );
+
+ phpgwapi_yui::tabview_setup('demo_tabview');
+
+ return phpgwapi_yui::tabview_generate($tabs,
'general');
+ }
+
+
public function view()
{
if(!$this->acl_read)
Added: trunk/demo/js/yahoo/demo.edit.js
===================================================================
--- trunk/demo/js/yahoo/demo.edit.js (rev 0)
+++ trunk/demo/js/yahoo/demo.edit.js 2011-09-08 13:30:19 UTC (rev 7567)
@@ -0,0 +1,64 @@
+var myDataSource,myDataTable, myContextMenu;
+var tableYUI;
+var myPaginator_0;
+var myDataTable_0;
+
+
+/********************************************************************************
+ *
+ */
+ this.addFooterDatatable = function(paginator,datatable)
+ {
+ //call getSumPerPage(name of column) in property.js
+ tmp_sum1 = getSumPerPage('budget',2,paginator,datatable);
+ tmp_sum2 = getSumPerPage('calculation',2,paginator,datatable);
+
+ if(typeof(tableYUI)=='undefined')
+ {
+ tableYUI =
YAHOO.util.Dom.getElementsByClassName("yui-dt-data","tbody")[0].parentNode;
+ tableYUI.setAttribute("id","tableYUI");
+ }
+ else
+ {
+ tableYUI.deleteTFoot();
+ }
+
+ //Create ROW
+ newTR = document.createElement('tr');
+
+ td_sum('Sum');
+ td_sum(tmp_sum1);
+ td_sum(tmp_sum2);
+ td_empty(3);
+
+ myfoot = tableYUI.createTFoot();
+ myfoot.setAttribute("id","myfoot");
+ myfoot.appendChild(newTR);
+ }
+
+/********************************************************************************/
+ var FormatterCenter = function(elCell, oRecord, oColumn, oData)
+ {
+ elCell.innerHTML = "<center>"+oData+"</center>";
+ }
+
+ var FormatterRight = function(elCell, oRecord, oColumn, oData)
+ {
+ elCell.innerHTML = "<div
align=\"right\">"+YAHOO.util.Number.format(oData, {thousandsSeparator:"
"})+"</div>";
+ }
+
+/********************************************************************************/
+YAHOO.util.Event.addListener(window, "load", function()
+{
+ var loader = new YAHOO.util.YUILoader();
+ loader.addModule({
+ name: "anyone",
+ type: "js",
+ fullpath: property_js
+ });
+
+ loader.require("anyone");
+ loader.insert();
+});
+
+
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [7567] demo: more on demo,
Sigurd Nes <=