[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [14574] clean up from yui
From: |
Sigurd Nes |
Subject: |
[Fmsystem-commits] [14574] clean up from yui |
Date: |
Fri, 11 Dec 2015 13:07:17 +0000 |
Revision: 14574
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=14574
Author: sigurdne
Date: 2015-12-11 13:07:17 +0000 (Fri, 11 Dec 2015)
Log Message:
-----------
clean up from yui
Modified Paths:
--------------
branches/dev-syncromind/property/inc/class.boadmin_location.inc.php
branches/dev-syncromind/property/inc/class.bobudget.inc.php
branches/dev-syncromind/property/inc/class.bocommon.inc.php
branches/dev-syncromind/property/inc/class.fileuploader.inc.php
branches/dev-syncromind/property/inc/class.notify.inc.php
branches/dev-syncromind/property/inc/class.test.inc.php
branches/dev-syncromind/property/inc/class.uiadmin_location.inc.php
branches/dev-syncromind/property/js/portico/notify.js
Modified: branches/dev-syncromind/property/inc/class.boadmin_location.inc.php
===================================================================
--- branches/dev-syncromind/property/inc/class.boadmin_location.inc.php
2015-12-11 12:16:51 UTC (rev 14573)
+++ branches/dev-syncromind/property/inc/class.boadmin_location.inc.php
2015-12-11 13:07:17 UTC (rev 14574)
@@ -107,8 +107,8 @@
function read_config()
{
- $standard = $this->so->read_config(array('start' =>
$this->start, 'query' => $this->query,
- 'sort' => $this->sort, 'order' =>
$this->order));
+ $standard = $this->so->read_config(array('start'
=> $this->start, 'query' => $this->query,
+ 'sort' => $this->sort, 'order' =>
$this->order));
$this->total_records = $this->so->total_records;
@@ -196,14 +196,14 @@
return $group_list;
}
- function read_attrib_group($location, $allrows = '')
+ function read_attrib_group($data = array())
{
- if($allrows)
+ if($data['allrows'] || phpgw::get_var('allrows') == 1)
{
- $this->allrows = $allrows;
+ $data['allrows'] = true;
}
- $attrib =
$this->custom->find_group('property', $location, $this->start, $this->query,
$this->sort, $this->order, $this->allrows);
+ $attrib = $this->custom->find_group('property',
'.location.' . $data['type_id'], $data['start'], $data['query'], $data['sort'],
$data['order'], $data['allrows']);
$this->total_records = $this->custom->total_records;
return $attrib;
@@ -214,9 +214,18 @@
return $this->custom->get_group('property', $location,
$id, true);
}
- function resort_attrib_group($location, $id, $resort)
+ function resort_attrib_group($data)
{
- $this->custom->resort_group($id, $resort, 'property',
$location);
+ $resort = isset($data['resort']) ? $data['resort'] :
'up';
+ $type_id = isset($data['type_id']) ? $data['type_id'] :
'';
+ $id = (isset($data['id']) ? $data['id'] :
'');
+
+ if(!$type_id || !$id)
+ {
+ return;
+ }
+
+ $this->custom->resort_group($id, $resort, 'property',
'.location.' . $type_id);
}
public function save_attrib_group($group, $action = '')
@@ -399,4 +408,4 @@
return $location;
}
}
- }
\ No newline at end of file
+ }
\ No newline at end of file
Modified: branches/dev-syncromind/property/inc/class.bobudget.inc.php
===================================================================
--- branches/dev-syncromind/property/inc/class.bobudget.inc.php 2015-12-11
12:16:51 UTC (rev 14573)
+++ branches/dev-syncromind/property/inc/class.bobudget.inc.php 2015-12-11
13:07:17 UTC (rev 14574)
@@ -222,13 +222,6 @@
function read_obligations($data = array())
{
- //cramirez: add strtoupper function for $this->sort. in
YUI use asc/desc (lowercase letters)
- /* $obligations =
$this->so->read_obligations(array('start' => $this->start, 'query' =>
$this->query,
- 'sort' => strtoupper($this->sort), 'order' =>
$this->order, 'filter' => $this->filter,
- 'cat_id' => $this->cat_id, 'allrows'=>$this->allrows,
'district_id' => $this->district_id,
- 'year' => $this->year,'month' => $this->month,
'grouping' => $this->grouping, 'revision' => $this->revision,
- 'details' => $this->details,'dimb_id' =>
$this->dimb_id, 'org_unit_id' => $this->org_unit_id,
- 'direction' => $this->direction)); */
$obligations = $this->so->read_obligations(array
(
Modified: branches/dev-syncromind/property/inc/class.bocommon.inc.php
===================================================================
--- branches/dev-syncromind/property/inc/class.bocommon.inc.php 2015-12-11
12:16:51 UTC (rev 14573)
+++ branches/dev-syncromind/property/inc/class.bocommon.inc.php 2015-12-11
13:07:17 UTC (rev 14574)
@@ -1415,7 +1415,7 @@
$parts =
$this->socommon->select_part_of_town($district_id);
$part_of_town_list = array();
- //address@hidden 09/09/08 validate for YUI.
+
if(is_array($parts) && (count($parts)))
{
foreach($parts as $entry)
Modified: branches/dev-syncromind/property/inc/class.fileuploader.inc.php
===================================================================
--- branches/dev-syncromind/property/inc/class.fileuploader.inc.php
2015-12-11 12:16:51 UTC (rev 14573)
+++ branches/dev-syncromind/property/inc/class.fileuploader.inc.php
2015-12-11 13:07:17 UTC (rev 14574)
@@ -30,7 +30,6 @@
* Description
* @package property
*/
- phpgw::import_class('phpgwapi.yui');
class property_fileuploader
{
Modified: branches/dev-syncromind/property/inc/class.notify.inc.php
===================================================================
--- branches/dev-syncromind/property/inc/class.notify.inc.php 2015-12-11
12:16:51 UTC (rev 14573)
+++ branches/dev-syncromind/property/inc/class.notify.inc.php 2015-12-11
13:07:17 UTC (rev 14574)
@@ -132,141 +132,6 @@
}
/**
- * Get definition for an inline YUI table
- *
- * @param array $data location and the number of preceding
tables in the same page
- * @return array table def data and prepared content.
- */
- public function get_yui_table_def($data = array())
- {
- if(!isset($data['count']))
- {
- throw new
Exception("property_notify::get_yui_table_def() - Missing count in input");
- }
-
- $content = array();
-
- if(isset($data['location_id']) &&
isset($data['location_item_id']))
- {
- $content = $this->read($data);
- }
-
- $count = (int)$data['count'];
- $datavalues = array
- (
- 'name' => "{$count}",
- 'values' =>
json_encode($content),
- 'total_records' => count($content),
- 'edit_action' =>
json_encode($GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'addressbook.uiaddressbook.view_person'))),
- 'is_paginator' => 1,
- 'footer' => 0
- );
-
- $column_defs = array
- (
- 'name' => "{$count}",
- 'values' => json_encode(array(array('key' =>
'id', 'hidden' => true),
- // array('key' =>
'email','hidden' => true),
- // array('key' =>
'sms','hidden' => true),
- array('key' => 'contact_id', 'label' =>
lang('id'), 'sortable' => false, 'resizeable' => true,
- 'formatter' =>
'YAHOO.widget.DataTable.formatLink_notify'),
- array('key' => 'first_name', 'label' =>
lang('first name'), 'sortable' => true,
- 'resizeable' => true),
- array('key' => 'last_name', 'label' =>
lang('last name'), 'sortable' => true,
- 'resizeable' => true),
- array('key' => 'email', 'label' =>
lang('email'), 'sortable' => false, 'resizeable' => true),
- array('key' => 'sms', 'label' => 'SMS',
'sortable' => false, 'resizeable' => true),
- array('key' => 'notification_method',
'label' => lang('method'), 'sortable' => true,
- 'resizeable' => true),
- array('key' => 'is_active_text',
'label' => lang('active'), 'sortable' => true,
- 'resizeable' => true),
- array('key' => 'entry_date', 'label' =>
lang('entry_date'), 'sortable' => true,
- 'resizeable' => true),
- array('key' => 'select', 'label' =>
lang('select'), 'sortable' => false, 'resizeable' => false,
- 'formatter' =>
'myFormatterCheck_notify', 'width' => 30)
- ))
- );
-
- $buttons = array
- (
- 'name' => "{$count}",
- 'values' => json_encode(array(
- array('id' => 'check_all', 'type' =>
'buttons', 'value' => '', 'label' => lang('check all'),
- 'funct' => 'check_all_notify',
'classname' => 'actionButton', 'value_hidden' => ""),
- array('id' => 'notify[email]', 'type'
=> 'buttons', 'value' => 'email', 'label' => lang('email'),
- 'funct' =>
'onActionsClick_notify', 'classname' => 'actionButton', 'value_hidden' => ""),
- array('id' => 'notify[sms]', 'type' =>
'buttons', 'value' => 'sms', 'label' => 'SMS',
- 'funct' =>
'onActionsClick_notify', 'classname' => 'actionButton', 'value_hidden' => ""),
- array('id' => 'notify[enable]', 'type'
=> 'buttons', 'value' => 'enable', 'label' => lang('enable'),
- 'funct' =>
'onActionsClick_notify', 'classname' => 'actionButton', 'value_hidden' => ""),
- array('id' => 'notify[disable]', 'type'
=> 'buttons', 'value' => 'disable',
- 'label' => lang('disable'),
'funct' => 'onActionsClick_notify', 'classname' => 'actionButton',
- 'value_hidden' => ""),
- array('id' => 'notify[delete]', 'type'
=> 'buttons', 'value' => 'delete', 'label' => lang('Delete'),
- 'funct' =>
'onActionsClick_notify', 'classname' => 'actionButton', 'value_hidden' => ""),
- ))
- );
-
- $GLOBALS['phpgw']->js->validate_file('yahoo', 'notify',
'property');
-
- $lang_view = lang('view');
- $code = <<<JS
- var myPaginator_{$count}, myDataTable_{$count};
- var Button_{$count}_0, Button_{$count}_1, Button_{$count}_2;
- var notify_table_count = {$count};
- var notify_lang_view = "{$lang_view}";
- var notify_lang_alert = "Posten må lagres før kontakter kan tilordnes";
-
- this.refresh_notify_contact=function()
- {
- if(document.getElementById('notify_contact').value)
- {
- base_java_notify_url['contact_id'] =
document.getElementById('notify_contact').value;
- }
-
- if(document.getElementById('notify_contact').value !=
notify_contact)
- {
- base_java_notify_url['action'] =
'refresh_notify_contact';
- execute_async(myDataTable_{$count},
base_java_notify_url);
- notify_contact =
document.getElementById('notify_contact').value;
- }
- }
-
- this.onActionsClick_notify=function()
- {
- flag = false;
- //clean hidden buttons actions
- cleanValuesHiddenActionsButtons();
-
- //validate ckecks true
- array_checks =
YAHOO.util.Dom.getElementsByClassName('mychecks');
- for ( var i in array_checks )
- {
- if(array_checks[i].checked)
- {
- flag = true;
- break;
- }
- }
-
- if(flag)
- {
- //asign value to hidden
- YAHOO.util.Dom.get("hd_"+this.get("id")).value =
this.get("value");
-
- formObject = document.body.getElementsByTagName('form');
- YAHOO.util.Connect.setForm(formObject[0]);//First form
- base_java_notify_url['action'] =
'refresh_notify_contact';
-
execute_async(myDataTable_{$count},base_java_notify_url);
- }
- }
-JS;
- $GLOBALS['phpgw']->js->add_code($namespace, $code);
-
- return array('datavalues' => $datavalues, 'column_defs'
=> $column_defs, 'buttons' => $buttons);
- }
-
- /**
* Get definition for an inline jquery table
*
* @param array $data location and the number of preceding
tables in the same page
@@ -276,12 +141,12 @@
{
if(!isset($data['count']))
{
- throw new
Exception("property_notify::get_yui_table_def() - Missing count in input");
+ throw new
Exception("property_notify::get_jquery_table_def() - Missing count in input");
}
if(!isset($data['requestUrl']) || !$requestUrl =
$data['requestUrl'])
{
- throw new
Exception("property_notify::get_yui_table_def() - Missing requestUrl in input");
+ throw new
Exception("property_notify::get_jquery_table_def() - Missing requestUrl in
input");
}
$requestUrl = str_replace('&', '&', $requestUrl);
Modified: branches/dev-syncromind/property/inc/class.test.inc.php
===================================================================
--- branches/dev-syncromind/property/inc/class.test.inc.php 2015-12-11
12:16:51 UTC (rev 14573)
+++ branches/dev-syncromind/property/inc/class.test.inc.php 2015-12-11
13:07:17 UTC (rev 14574)
@@ -48,14 +48,14 @@
{
$date1 =
date($GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
- $start_field =
$GLOBALS['phpgw']->yuical->add_listener('start_date', $date1);
- $end_field =
$GLOBALS['phpgw']->yuical->add_listener('end_date');
+ $start_field =
$GLOBALS['phpgw']->jqcal->add_listener('start_date', $date1);
+ $end_field =
$GLOBALS['phpgw']->jqcal->add_listener('end_date');
//Only if not xslt_app
$GLOBALS['phpgw']->common->phpgw_header(true);
$html = <<<HTML
- <div class="yui-content">
+ <div>
<div class="details">
<form action="#" method="post">
<dl class="proplist-col">
Modified: branches/dev-syncromind/property/inc/class.uiadmin_location.inc.php
===================================================================
--- branches/dev-syncromind/property/inc/class.uiadmin_location.inc.php
2015-12-11 12:16:51 UTC (rev 14573)
+++ branches/dev-syncromind/property/inc/class.uiadmin_location.inc.php
2015-12-11 13:07:17 UTC (rev 14574)
@@ -26,9 +26,7 @@
* @subpackage admin
* @version $Id$
*/
- #phpgw::import_class('phpgwapi.yui');
phpgw::import_class('phpgwapi.uicommon_jquery');
- phpgw::import_class('phpgwapi.jquery');
/**
* Description
@@ -305,8 +303,13 @@
switch($data['method'])
{
case 'list_attribute':
- $id_type = $type_id;break;
- default:$id_type = '';break;
+ $id_type = $type_id;
+ break;
+ case 'list_attribute_group':
+ $id_type = $type_id;
+ break;
+ default:$id_type = '';
+ break;
}
$params = array(
@@ -325,8 +328,13 @@
switch($data['method'])
{
case 'list_attribute':
- $values =
$this->bo->read_attrib($params);break;
+ $values =
$this->bo->read_attrib($params);
+ break;
default:
+ case 'list_attribute_group':
+ $values =
$this->bo->read_attrib_group($params);
+ break;
+ default:
$values = $this->bo->read($params);
foreach($values as &$entry)
{
@@ -353,12 +361,19 @@
case 'list_attribute':
$variable = array(
'menuaction' =>
'property.uiadmin_location.list_attribute',
- 'id' => $entity_id,
'allrows' =>
$this->allrows,
'type_id' => $type_id
);
array_walk($result_data['results'],
array($this, '_add_links'), $variable);
break;
+ case 'list_attribute_group':
+ $variable = array(
+ 'menuaction' =>
'property.uiadmin_location.list_attribute_group',
+ 'allrows' =>
$this->allrows,
+ 'type_id' => $type_id
+ );
+ array_walk($result_data['results'],
array($this, '_add_links'), $variable);
+ break;
}
return $this->jquery_results($result_data);
}
@@ -555,152 +570,104 @@
}
$type_id = phpgw::get_var('type_id', 'int');
+ $id = phpgw::get_var('id', 'int');
+ $resort = phpgw::get_var('resort');
+
$GLOBALS['phpgw_info']['flags']['menu_selection'] .=
"::location::attribute_loc_{$type_id}";
- $location = ".location.{$type_id}";
- $id = phpgw::get_var('id', 'int');
- $resort = phpgw::get_var('resort');
-
if($resort)
{
- $this->bo->resort_attrib_group($location, $id,
$resort);
+ $this->bo->resort_attrib_group(array('resort'
=> $resort, 'type_id' => $type_id, 'id' => $id));
}
- $datatable = array();
+ $type = $this->bo->read_single($type_id);
- if(phpgw::get_var('phpgw_return_as') != 'json')
+ if(phpgw::get_var('phpgw_return_as') == 'json')
{
- $datatable['menu']
= $this->bocommon->get_menu();
- $datatable['config']['base_url'] =
$GLOBALS['phpgw']->link('/index.php', array
+ return $this->query(array
(
- 'menuaction' =>
'property.uiadmin_location.list_attribute',
- 'sort' => $this->sort,
- 'order' => $this->order,
- 'query' => $this->query,
- 'type_id' => $type_id
+ 'method' => 'list_attribute_group'
));
+ }
- $datatable['config']['base_java_url'] =
"menuaction:'property.uiadmin_location.list_attribute_group',"
- . "sort:'{$this->sort}',"
- . "order:'{$this->order}',"
- . "query:'{$this->query}',"
- . "type_id:'{$type_id}'";
+ self::add_javascript('phpgwapi', 'jquery',
'editable/jquery.jeditable.js');
+ self::add_javascript('phpgwapi', 'jquery',
'editable/jquery.dataTables.editable.js');
- $datatable['config']['allow_allrows'] = true;
+ $appname = lang('attribute');
+ $function_msg = lang('list entity attribute group');
- $link_data = array
- (
- 'menuaction' =>
'property.uiadmin_location.list_attribute',
- 'sort' => $this->sort,
- 'order' => $this->order,
- 'query' => $this->query,
- 'type_id' => $type_id,
- );
+ $GLOBALS['phpgw_info']['flags']['app_header'] =
lang('property') . '::' . $appname . '::' . $function_msg;
- $datatable['actions']['form'] = array(
- array(
- 'action' =>
$GLOBALS['phpgw']->link('/index.php', array(
- 'menuaction' =>
'property.uiadmin_location.list_attribute',
- 'sort' =>
$this->sort,
- 'order' =>
$this->order,
- 'query' =>
$this->query,
- 'type_id' =>
$type_id
- )
- ),
- 'fields' => array(
- 'field'
=> array(
- array(
- 'type'
=> 'button',
- 'id'
=> 'btn_done',
- 'value'
=> lang('done'),
-
'tab_index' => 1
- ),
- array(
- 'type'
=> 'button',
- 'id'
=> 'btn_new',
- 'value'
=> lang('add'),
-
'tab_index' => 2
- ),
- array(//boton
SEARCH
- 'id'
=> 'btn_search',
- 'name'
=> 'search',
- 'value'
=> lang('search'),
- 'type'
=> 'button',
-
'tab_index' => 3
- ),
- array(// TEXT
INPUT
- 'name'
=> 'query',
- 'id'
=> 'txt_query',
- 'value'
=> '', //$query,
- 'type'
=> 'text',
-
'onkeypress' => 'return pulsar(event)',
- 'size'
=> 28,
-
'tab_index' => 4
- )
+ $data = array(
+ 'datatable_name' => $appname,
+ 'form' => array(
+ 'toolbar' => array(
+ 'item' => array(
+ array(
+ 'type' =>
'link',
+ 'value' =>
lang('new'),
+ 'href' =>
self::link(array(
+
'menuaction' => 'property.uiadmin_location.edit_attrib_group',
+
'type_id' => $type_id
+ )),
+ 'class' =>
'new_item'
),
- 'hidden_value' =>
array(
+ array(
+ 'type' =>
'link',
+ 'value' =>
lang('cancel'),
+ 'href' =>
self::link(array(
+
'menuaction' => 'property.uiadmin_location.index'
+ )),
+ 'class' =>
'new_item'
)
)
)
- );
+ ),
+ 'datatable' => array(
+ 'source' =>
self::link(array(
+ 'menuaction' =>
'property.uiadmin_location.list_attribute_group',
+ 'type_id'
=> $type_id,
+ 'phpgw_return_as' =>
'json'
+ )),
+ 'allrows' => true,
+ 'editor_action' => '',
+ 'field' => array(
+ array(
+ 'key' =>
'name',
+ 'label' =>
lang('Name'),
+ 'sortable' => true
+ ),
+ array(
+ 'key' =>
'descr',
+ 'label' =>
lang('Descr'),
+ 'sortable' =>
false
+ ),
+ array(
+ 'key' =>
'group_sort',
+ 'label' =>
lang('sorting'),
+ 'sortable' => true
+ ),
+ array(
+ 'key' =>
'up',
+ 'label' =>
lang('up'),
+ 'sortable' =>
false,
+ 'formatter' =>
'JqueryPortico.formatLinkGenericLlistAttribute'
+ ),
+ array(
+ 'key' =>
'down',
+ 'label' =>
lang('down'),
+ 'sortable' =>
false,
+ 'formatter' =>
'JqueryPortico.formatLinkGenericLlistAttribute'
+ ),
+ array(
+ 'key' => 'id',
+ 'label' => lang('id'),
+ 'hidden' => true
+ )
+ )
+ )
+ );
- $dry_run = true;
- }
-
- $attrib_list =
$this->bo->read_attrib_group($location);
- $uicols['name'][0] = 'name';
- $uicols['descr'][0] = lang('Name');
- $uicols['name'][1] = 'descr';
- $uicols['descr'][1] = lang('Descr');
- $uicols['name'][2] = 'group_sort';
- $uicols['descr'][2] = lang('sorting');
- $uicols['name'][3] = 'up';
- $uicols['descr'][3] = lang('up');
- $uicols['name'][4] = 'down';
- $uicols['descr'][4] = lang('down');
- $uicols['name'][5] = 'id';
- $uicols['descr'][5] = lang('id');
- $j = 0;
- $count_uicols_name = count($uicols['name']);
-
- if(isset($attrib_list) AND is_array($attrib_list))
- {
- foreach($attrib_list as $attrib_entry)
- {
- for($k = 0; $k < $count_uicols_name;
$k++)
- {
- if($uicols['input_type'][$k] !=
'hidden')
- {
-
$datatable['rows']['row'][$j]['column'][$k]['name'] = $uicols['name'][$k];
-
$datatable['rows']['row'][$j]['column'][$k]['value'] =
$attrib_entry[$uicols['name'][$k]];
- }
-
-
if($datatable['rows']['row'][$j]['column'][$k]['name'] == 'up')
- {
-
$datatable['rows']['row'][$j]['column'][$k]['format'] = 'link';
-
$datatable['rows']['row'][$j]['column'][$k]['value'] =
'up';//$uicols['name'][$k];
-
$datatable['rows']['row'][$j]['column'][$k]['target'] = '_blank';
- $url
= '"' . $GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'property.uiadmin_location.list_attribute_group',
- 'resort' =>
'up', 'type_id' => $type_id, 'id' => $attrib_entry['id'], 'allrows' =>
$this->allrows)) . '"';
-
$datatable['rows']['row'][$j]['column'][$k]['link'] =
'move_record(' . $url . ')';
- }
-
-
if($datatable['rows']['row'][$j]['column'][$k]['name'] == 'down')
- {
-
$datatable['rows']['row'][$j]['column'][$k]['format'] = 'link';
-
$datatable['rows']['row'][$j]['column'][$k]['value'] =
'down';//$uicols['name'][$k];
-
$datatable['rows']['row'][$j]['column'][$k]['target'] = '_blank';
- $url
= '"' . $GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'property.uiadmin_location.list_attribute_group',
- 'resort' =>
'down', 'type_id' => $type_id, 'id' => $attrib_entry['id'], 'allrows' =>
$this->allrows)) . '"';
-
$datatable['rows']['row'][$j]['column'][$k]['link'] =
'move_record(' . $url . ')';
- }
- }
- $j++;
- }
- }
-
- $datatable['rowactions']['action'] = array();
-
$parameters = array
(
'parameter' => array
@@ -725,7 +692,7 @@
)
);
- $datatable['rowactions']['action'][] = array
+ $data['datatable']['actions'][] = array
(
'my_name' => 'edit',
'statustext' => lang('Edit'),
@@ -738,10 +705,10 @@
'type_id' => $type_id
)
),
- 'parameters' => $parameters
+ 'parameters' => json_encode($parameters)
);
- $datatable['rowactions']['action'][] = array
+ $data['datatable']['actions'][] = array
(
'my_name' => 'delete',
'statustext' => lang('Delete'),
@@ -755,160 +722,12 @@
'type_id' => $type_id
)
),
- 'parameters' => $parameters2
+ 'parameters' => json_encode($parameters2)
);
- $datatable['rowactions']['action'][] = array(
- 'my_name' => 'add',
- 'statustext' => lang('add'),
- 'text' => lang('add'),
- 'action' =>
$GLOBALS['phpgw']->link('/index.php', array
- (
- 'menuaction' =>
'property.uiadmin_location.edit_attrib_group',
- 'type_id' => $type_id
- ))
- );
-
unset($parameters);
unset($parameters2);
-
-
- for($i = 0; $i < $count_uicols_name; $i++)
- {
- if($uicols['input_type'][$i] != 'hidden')
- {
-
$datatable['headers']['header'][$i]['formatter'] = ($uicols['formatter'][$i] ==
'' ? '""' : $uicols['formatter'][$i]);
-
$datatable['headers']['header'][$i]['name'] = $uicols['name'][$i];
-
$datatable['headers']['header'][$i]['text'] = $uicols['descr'][$i];
-
$datatable['headers']['header'][$i]['visible'] = true;
-
$datatable['headers']['header'][$i]['sortable'] = false;
- if($uicols['name'][$i] == 'id')
- {
-
$datatable['headers']['header'][$i]['visible'] = false;
- }
-
- if($uicols['name'][$i] == 'name')
- {
-
$datatable['headers']['header'][$i]['sortable'] = true;
-
$datatable['headers']['header'][$i]['sort_field'] = 'name';
- }
- }
- }
-
- //path for property.js
- $property_js = "/property/js/yahoo/property.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, '/'));
- }
-
- $datatable['property_js'] =
$GLOBALS['phpgw_info']['server']['webserver_url'] . $property_js;
-
- // Pagination and sort values
- $datatable['pagination']['records_start'] =
(int)$this->bo->start;
- $datatable['pagination']['records_limit'] =
$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'];
- $datatable['pagination']['records_returned'] =
count($attrib_list);
- $datatable['pagination']['records_total'] =
$this->bo->total_records;
-
- $appname = lang('attribute');
- $function_msg = lang('list entity attribute');
-
- if((phpgw::get_var("start") == "") &&
(phpgw::get_var("order", 'string') == ""))
- {
- $datatable['sorting']['order'] = 'name'; //
name key Column in myColumnDef
- $datatable['sorting']['sort'] = 'asc'; //
ASC / DESC
- }
- else
- {
- $datatable['sorting']['order'] =
phpgw::get_var('order', 'string'); // name of column of Database
- $datatable['sorting']['sort'] =
phpgw::get_var('sort', 'string'); // ASC / DESC
- }
-
- 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');
-
- //-- BEGIN----------------------------- JSON CODE
------------------------------
- //values for Pagination
- $json = array
- (
- 'recordsReturned' =>
$datatable['pagination']['records_returned'],
- 'totalRecords' =>
(int)$datatable['pagination']['records_total'],
- 'startIndex' =>
$datatable['pagination']['records_start'],
- 'sort' =>
$datatable['sorting']['order'],
- 'dir' =>
$datatable['sorting']['sort'],
- 'records' => array()
- );
-
- // values for datatable
- if(isset($datatable['rows']['row']) &&
is_array($datatable['rows']['row']))
- {
- foreach($datatable['rows']['row'] as $row)
- {
- $json_row = array();
- foreach($row['column'] as $column)
- {
- if(isset($column['format']) &&
$column['format'] == "link")
- {
-
$json_row[$column['name']] = "<a href='#' onclick='" . $column['link'] . "'>" .
$column['value'] . "</a>";
- }
- else
- {
-
$json_row[$column['name']] = $column['value'];
- }
- }
- $json['records'][] = $json_row;
- }
- }
-
- // right in datatable
- if(isset($datatable['rowactions']['action']) &&
is_array($datatable['rowactions']['action']))
- {
- $json ['rights'] =
$datatable['rowactions']['action'];
- }
-
- // query parameters
- if(isset($current_Consult) &&
is_array($current_Consult))
- {
- $json ['current_consult'] = $current_Consult;
- }
-
- if(phpgw::get_var('phpgw_return_as') == 'json')
- {
- return $json;
- }
-
-
- $datatable['json_data'] = json_encode($json);
- //-------------------- JSON CODE ----------------------
-
- $template_vars = array();
- $template_vars['datatable'] = $datatable;
-
$GLOBALS['phpgw']->xslttpl->add_file(array('datatable'));
- $GLOBALS['phpgw']->xslttpl->set_var('phpgw',
$template_vars);
-
- if(!isset($GLOBALS['phpgw']->css) ||
!is_object($GLOBALS['phpgw']->css))
- {
- $GLOBALS['phpgw']->css =
createObject('phpgwapi.css');
- }
-
- $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');
-
- $GLOBALS['phpgw_info']['flags']['app_header'] =
lang('property') . ' - ' . $appname . ': ' . $function_msg;
-
- $GLOBALS['phpgw']->js->validate_file('yahoo',
'admin_location.attribute_group', 'property');
+ self::render_template_xsl('datatable_jquery', $data);
}
function edit_attrib_group()
@@ -1155,42 +974,6 @@
)
);
- /*
- if (isset($attrib_list) AND is_array($attrib_list))
- {
- foreach($attrib_list as $attrib_entry)
- {
- for ($k=0;$k<$count_uicols_name;$k++)
- {
- //
if($uicols['input_type'][$k]!='hidden')
- {
- $datatable['rows']['row'][$j]['column'][$k]['name']
= $uicols['name'][$k];
- $datatable['rows']['row'][$j]['column'][$k]['value']
= isset($attrib_entry[$uicols['name'][$k]]) ?
$attrib_entry[$uicols['name'][$k]] : '';
- }
-
-
if(isset($datatable['rows']['row'][$j]['column'][$k]['name']) &&
$datatable['rows']['row'][$j]['column'][$k]['name'] == 'up')
- {
- $datatable['rows']['row'][$j]['column'][$k]['format']
= 'link';
- $datatable['rows']['row'][$j]['column'][$k]['value']
= 'up';//$uicols['name'][$k];
- $datatable['rows']['row'][$j]['column'][$k]['target']
= '_blank';
- $url =
'"'.$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>
'property.uiadmin_location.list_attribute', 'resort'=> 'up', 'id'=>
$attrib_entry['id'], 'allrows'=> $this->allrows, 'type_id' => $type_id)).'"';
- $datatable['rows']['row'][$j]['column'][$k]['link']
= 'move_record('.$url.',"' . $this->allrows . '")';
- }
-
-
if(isset($datatable['rows']['row'][$j]['column'][$k]['name']) &&
$datatable['rows']['row'][$j]['column'][$k]['name'] == 'down')
- {
- $datatable['rows']['row'][$j]['column'][$k]['format']
= 'link';
- $datatable['rows']['row'][$j]['column'][$k]['value']
= 'down';//$uicols['name'][$k];
- $datatable['rows']['row'][$j]['column'][$k]['target']
= '_blank';
- $url =
'"'.$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>
'property.uiadmin_location.list_attribute', 'resort'=> 'down', 'id'=>
$attrib_entry['id'], 'allrows'=> $this->allrows, 'type_id' => $type_id)).'"';
- $datatable['rows']['row'][$j]['column'][$k]['link']
= 'move_record('.$url.',"' . $this->allrows . '")';
- }
- }
- $j++;
- }
- } */
-
-
$parameters = array
(
'parameter' => array
@@ -1356,79 +1139,6 @@
//_debug_array($values);
$GLOBALS['phpgw']->xslttpl->add_file(array('admin_location'));
- /* if (isset($values['save']) && $values['save'])
- {
- if($id)
- {
- $values['id']=$id;
- $action='edit';
- }
- $type_id = $values['type_id'];
-
- if (!$values['column_name'])
- {
- $receipt['error'][] = array('msg'=>lang('Column name
not entered!'));
- }
-
-
if(!preg_match('/^[a-z0-9_]+$/i',$values['column_name']))
- {
- $receipt['error'][] = array('msg'=>lang('Column name
%1 contains illegal character', $values['column_name']));
- }
-
- if (!$values['input_text'])
- {
- $receipt['error'][] = array('msg'=>lang('Input text
not entered!'));
- }
- if (!$values['statustext'])
- {
- $receipt['error'][] = array('msg'=>lang('Statustext
not entered!'));
- }
-
- if (!$values['type_id'])
- {
- $receipt['error'][] = array('msg'=>lang('Location
type not chosen!'));
- }
-
- if (!$values['column_info']['type'])
- {
- $receipt['error'][] = array('msg'=>lang('Datatype
type not chosen!'));
- }
-
- if(!ctype_digit($values['column_info']['precision'])
&& $values['column_info']['precision'])
- {
- $receipt['error'][]=array('msg'=>lang('Please enter
precision as integer !'));
- unset($values['column_info']['precision']);
- }
-
- if($values['column_info']['scale'] &&
!ctype_digit($values['column_info']['scale']))
- {
- $receipt['error'][]=array('msg'=>lang('Please enter
scale as integer !'));
- unset($values['column_info']['scale']);
- }
-
- if (!$values['column_info']['nullable'])
- {
- $receipt['error'][] = array('msg'=>lang('Nullable not
chosen!'));
- }
-
-
- if (!$receipt['error'])
- {
-
- $receipt = $this->bo->save_attrib($values,$action);
-
- if(!$id)
- {
- $id=$receipt['id'];
- }
- }
- else
- {
- $receipt['error'][] = array('msg' =>
lang('Attribute has NOT been saved'));
- }
-
- } */
-
if($id)
{
$values =
$this->bo->read_single_attrib($type_id, $id);
Modified: branches/dev-syncromind/property/js/portico/notify.js
===================================================================
--- branches/dev-syncromind/property/js/portico/notify.js 2015-12-11
12:16:51 UTC (rev 14573)
+++ branches/dev-syncromind/property/js/portico/notify.js 2015-12-11
13:07:17 UTC (rev 14574)
@@ -17,7 +17,7 @@
{
if(!base_java_notify_url['location_item_id'])
{
- alert(notify_lang_alert); // notify_lang_alert is
defined in php-class property_notify::get_yui_table_def()
+ alert(notify_lang_alert);
return;
}
var oArgs =
{menuaction:'property.uilookup.addressbook',column:'notify_contact'};
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [14574] clean up from yui,
Sigurd Nes <=