Author: nathangray
New Revision: 56024
URL: http://svn.stylite.de/viewvc/egroupware?rev=56024&view=rev
Log:
- Export plugins now specify the export record class
- Projectmanager now has filters
Modified:
trunk/addressbook/inc/class.addressbook_export_contacts_csv.inc.php
trunk/addressbook/inc/class.addressbook_export_vcard.inc.php
trunk/admin/inc/class.admin_export_groups_csv.inc.php
trunk/admin/inc/class.admin_export_users_csv.inc.php
trunk/calendar/inc/class.calendar_export_csv.inc.php
trunk/calendar/inc/class.calendar_export_ical.inc.php
trunk/importexport/inc/class.importexport_export_ui.inc.php
trunk/importexport/inc/class.importexport_helper_functions.inc.php
trunk/importexport/inc/class.importexport_iface_export_plugin.inc.php
trunk/infolog/inc/class.infolog_export_csv.inc.php
trunk/projectmanager/inc/class.projectmanager_egw_record_element.inc.php
trunk/projectmanager/inc/class.projectmanager_export_elements_csv.inc.php
trunk/projectmanager/inc/class.projectmanager_export_projects_csv.inc.php
trunk/projectmanager/templates/default/export_csv_selectors.xet
trunk/projectmanager/templates/default/export_elements_csv_selectors.xet
trunk/resources/inc/class.resources_export_csv.inc.php
trunk/sitemgr/inc/class.sitemgr_export_xml.inc.php
trunk/timesheet/inc/class.timesheet_export_csv.inc.php
trunk/tracker/inc/class.tracker_export_csv.inc.php
— trunk/addressbook/inc/class.addressbook_export_contacts_csv.inc.php (original)
+++ trunk/addressbook/inc/class.addressbook_export_contacts_csv.inc.php Wed May 4 21:34:30 2016
@@ -422,6 +422,15 @@
$this->selects[‘tid’][$tid] = $data[‘name’];
}
}
— trunk/addressbook/inc/class.addressbook_export_vcard.inc.php (original)
+++ trunk/addressbook/inc/class.addressbook_export_vcard.inc.php Wed May 4 21:34:30 2016
@@ -142,4 +142,13 @@
‘content’ => ‘all’,
);
}
— trunk/admin/inc/class.admin_export_groups_csv.inc.php (original)
+++ trunk/admin/inc/class.admin_export_groups_csv.inc.php Wed May 4 21:34:30 2016
@@ -103,4 +103,14 @@
‘preserv’ => array(‘no_error_for_no_selection’),
);
}
+
— trunk/admin/inc/class.admin_export_users_csv.inc.php (original)
+++ trunk/admin/inc/class.admin_export_users_csv.inc.php Wed May 4 21:34:30 2016
@@ -109,4 +109,13 @@
‘preserv’ => array(‘no_error_for_all’),
);
}
— trunk/calendar/inc/class.calendar_export_csv.inc.php (original)
+++ trunk/calendar/inc/class.calendar_export_csv.inc.php Wed May 4 21:34:30 2016
@@ -423,4 +423,14 @@
}
}
-}
— trunk/calendar/inc/class.calendar_export_ical.inc.php (original)
+++ trunk/calendar/inc/class.calendar_export_ical.inc.php Wed May 4 21:34:30 2016
@@ -170,4 +170,13 @@
$data = parent::get_selectors_etpl($definition);
return $data;
}
— trunk/importexport/inc/class.importexport_export_ui.inc.php (original)
+++ trunk/importexport/inc/class.importexport_export_ui.inc.php Wed May 4 21:34:30 2016
@@ -68,7 +68,7 @@
$content[‘appname’] = $_appname;
$preserv[‘appname’] = $_appname;
if(empty($_appname)) {
— trunk/importexport/inc/class.importexport_helper_functions.inc.php (original)
+++ trunk/importexport/inc/class.importexport_helper_functions.inc.php Wed May 4 21:34:30 2016
@@ -596,11 +596,11 @@
{
$fields = array();
try {
-
if($record_classname == null) $record_classname = $app_name . '_egw_record';
-
if(!class_exists($record_classname)) throw new Exception('Bad class name ' . $record_classname);
-
$plugin = is_object($plugin_name) ? $plugin_name : new $plugin_name();
$plugin_name = get_class($plugin);
— trunk/importexport/inc/class.importexport_iface_export_plugin.inc.php (original)
+++ trunk/importexport/inc/class.importexport_iface_export_plugin.inc.php Wed May 4 21:34:30 2016
@@ -13,26 +13,26 @@
/**
- class importexport_iface_export_plugin
- This a the abstract interface for an export plugin of importexport
-
-
- You need to implement this class in
-
-
- You need to implement this class in
- EGW_INCLUDE_ROOT/appname/inc/importexport/class.export_.inc.php
- to attend the importexport framwork with your export.
-
-
- NOTE: This is an easy interface, cause plugins live in theire own
-
- space. Means that they are responsible for generating a defintion AND
-
-
- NOTE: This is an easy interface, cause plugins live in theire own
-
- space. Means that they are responsible for generating a defintion AND
- working on that definition.
- So this interface just garanties the interaction with userinterfaces. It
- has nothing to do with datatypes.
-
-
- JS:
- required function in opener:
-
-
-
- // returns array of identifiers
- // NOTE: identifiers need to b
-
- get_selector(); //returns array
-
- get_selector(); //returns array
*/
interface importexport_iface_export_plugin {
@@ -76,7 +76,7 @@
* return etemplate components for options.
* @abstract We can’t deal with etemplate objects here, as an uietemplate
* objects itself are scipt orientated and not “dialog objects”
-
-
-
@return array (
-
name => string,
-
content => array,
@@ -100,5 +100,15 @@
*/
public function get_selectors_etpl();
- /**
-
- Get the class name for the egw_record to use while exporting
-
-
- importexport_iface_egw_record classes are used for a lot of field detection
-
- and automatic conversions. In most cases they are named _egw_record,
-
- but projectmanager is an exception to this.
-
-
- */
- public static function get_egw_record_class();
} // end of iface_export_plugin
?>
— trunk/infolog/inc/class.infolog_export_csv.inc.php (original)
+++ trunk/infolog/inc/class.infolog_export_csv.inc.php Wed May 4 21:34:30 2016
@@ -266,4 +266,14 @@
public static function convert(infolog_egw_record &$record) {
// Stub, for now
}
+
— trunk/projectmanager/inc/class.projectmanager_egw_record_element.inc.php (original)
+++ trunk/projectmanager/inc/class.projectmanager_egw_record_element.inc.php Wed May 4 21:34:30 2016
@@ -25,8 +25,8 @@
// Used in conversions
static $types = array(
-
'select-account' => array('pe_creator','pe_modifier'),
-
'date-time' => array('pe_created', 'pe_modified','pe_planned_start', 'pe_planned_end', 'pe_real_start', 'pe_real_end','pe_synced'),
-
'select-account' => array('pe_modifier'),
-
'date-time' => array('pe_modified','pe_planned_start', 'pe_planned_end', 'pe_real_start', 'pe_real_end','pe_synced'),
'select-cat' => array('cat_id','pe_cat_id'),
);
— trunk/projectmanager/inc/class.projectmanager_export_elements_csv.inc.php (original)
+++ trunk/projectmanager/inc/class.projectmanager_export_elements_csv.inc.php Wed May 4 21:34:30 2016
@@ -89,7 +89,8 @@
unset($query[‘num_rows’]);
$GLOBALS[‘egw’]->session->appsession(‘projectelements_list’,‘projectmanager’, $old_query);
}
-
elseif ( $options['selection'] == 'all' )
-
{
$_query = $GLOBALS['egw']->session->appsession('projectelements_list','projectmanager');
// Clear the PM ID or results will be restricted
unset($ui->pm_id);
@@ -101,7 +102,38 @@
);
$ui->get_rows($query,$selection,$readonlys);
$GLOBALS[‘egw’]->session->appsession(‘projectelements_list’,‘projectmanager’, $_query);
-
}
-
elseif ($options['selection'] == 'filter')
-
{
-
$filter = $_definition->filter;
-
$query = array(
-
'num_rows' => -1,
-
'col_filter' => array('pm_id' => $options['pm_id']),
-
'csv_export' => true, // so get_rows method _can_ produce different content or not store state in the session
-
);
-
-
// Handle ranges
-
foreach($filter as $field => $value)
-
{
-
if($field == 'cat_id')
-
{
-
$query[$field] = implode(',',$value);
-
continue;
-
}
-
-
$query['col_filter'][$field] = $value;
-
if(!is_array($value) || (!$value['from'] && !$value['to'])) continue;
-
-
// Ranges are inclusive, so should be provided that way (from 2 to 10 includes 2 and 10)
-
if($value['from']) $query['col_filter'][] = "$field >= " . (int)$value['from'];
-
if($value['to']) $query['col_filter'][] = "$field <= " . (int)$value['to'];
-
unset($query['col_filter'][$field]);
-
}
-
-
$ui->get_rows($query,$selection,$readonlys);
-
}
-
else
-
{
$_query = $GLOBALS['egw']->session->appsession('projectelements_list','projectmanager');
$query = array(
'num_rows' => -1,
@@ -238,4 +270,17 @@
}
}
}
+
— trunk/projectmanager/inc/class.projectmanager_export_projects_csv.inc.php (original)
+++ trunk/projectmanager/inc/class.projectmanager_export_projects_csv.inc.php Wed May 4 21:34:30 2016
@@ -57,7 +57,8 @@
$list = ‘project_list’;
}
-
if ($options['selection'] == 'selected')
-
{
// Use search results
$old_query = $GLOBALS['egw']->session->appsession($list,'projectmanager');
$query = array_merge($old_query, $query);
@@ -69,7 +70,8 @@
unset($query[‘num_rows’]);
$GLOBALS[‘egw’]->session->appsession($list,‘projectmanager’, $old_query);
}
-
elseif ( $options['selection'] == 'all' )
-
{
$_query = $GLOBALS['egw']->session->appsession($list,'projectmanager');
$query = array(
'filter2' => $list == 'project_list' ? 'active' : '0' ,
@@ -81,7 +83,39 @@
// Reset nm params
$GLOBALS['egw']->session->appsession($list,'projectmanager', $_query);
-
}
-
elseif ($options['selection'] == 'filter')
-
{
-
$filter = $_definition->filter;
-
$query = array(
-
'filter2' => $list == 'project_list' ? 'active' : '0' ,
-
'col_filter' => $list == 'project_list' ? array() : array('pm_id' => $pm_id),
-
'num_rows' => -1, // all
-
'csv_export' => true, // so get_rows method _can_ produce different content or not store state in the session
-
);
-
-
// Handle ranges
-
foreach($filter as $field => $value)
-
{
-
if($field == 'cat_id')
-
{
-
$query[$field] = implode(',',$value);
-
continue;
-
}
-
-
$query['col_filter'][$field] = $value;
-
if(!is_array($value) || (!$value['from'] && !$value['to'])) continue;
-
-
// Ranges are inclusive, so should be provided that way (from 2 to 10 includes 2 and 10)
-
if($value['from']) $query['col_filter'][] = "$field >= " . (int)$value['from'];
-
if($value['to']) $query['col_filter'][] = "$field <= " . (int)$value['to'];
-
unset($query['col_filter'][$field]);
-
}
-
-
$ui->get_rows($query,$selection,$readonlys);
-
}
-
else
-
{
$selection = explode(',',$options['selection']);
}
if(get_class($ui) != 'projectmanager_ui')
@@ -252,4 +286,14 @@
}
}
}
+
— trunk/projectmanager/templates/default/export_csv_selectors.xet (original)
+++ trunk/projectmanager/templates/default/export_csv_selectors.xet Wed May 4 21:34:30 2016
@@ -14,6 +14,9 @@
-
<row disabled="@no_filter">
-
<radio label="Use definition filter" id="selection" onclick="jQuery('div.filters').show();" options="filter"/>
-
</row>
<row disabled="!@project_title">
<radio label="@project_title" id="selection" options="project"/>
</row>
— trunk/projectmanager/templates/default/export_elements_csv_selectors.xet (original)
+++ trunk/projectmanager/templates/default/export_elements_csv_selectors.xet Wed May 4 21:34:30 2016
@@ -14,6 +14,9 @@
-
<row disabled="@no_filter">
-
<radio label="Use definition filter" id="selection" onclick="jQuery('div.filters').show();" options="filter"/>
-
</row>
<row>
<radio label="Selected project" id="selection" options="project"/>
</row>
— trunk/resources/inc/class.resources_export_csv.inc.php (original)
+++ trunk/resources/inc/class.resources_export_csv.inc.php Wed May 4 21:34:30 2016
@@ -174,8 +174,8 @@
/**
* Customize automatically generated filter fields
*/
- public function get_filter_fields(Array &$filters)
- {
// In resources, not all categories are used
$filters[‘cat_id’][‘type’] = ‘select’;
$filters[‘cat_id’][‘name’] = ‘filter’;
@@ -189,9 +189,20 @@
‘rows’ => 5,
‘values’ => resources_bo::$filter_options
);
-
foreach($filters as $field_name => &$settings)
-
{
-
if($this->selects[$field_name]) $settings['values'] = $this->selects[$field_name];
-
}
- }
-
-
- /**
-
- Get the class name for the egw_record to use while exporting
-
-
- */
- public static function get_egw_record_class()
- {
-
return 'resources_egw_record';
- }
}
— trunk/sitemgr/inc/class.sitemgr_export_xml.inc.php (original)
+++ trunk/sitemgr/inc/class.sitemgr_export_xml.inc.php Wed May 4 21:34:30 2016
@@ -363,6 +363,16 @@
xmlwriter_end_element($this->writer);
}
- /**
-
- Get the class name for the egw_record to use while exporting
-
-
- */
- public static function get_egw_record_class()
- {
-
return '';
- }
-
/**
* destructor
*
— trunk/timesheet/inc/class.timesheet_export_csv.inc.php (original)
+++ trunk/timesheet/inc/class.timesheet_export_csv.inc.php Wed May 4 21:34:30 2016
@@ -169,4 +169,13 @@
}
}
— trunk/tracker/inc/class.tracker_export_csv.inc.php (original)
+++ trunk/tracker/inc/class.tracker_export_csv.inc.php Wed May 4 21:34:30 2016
@@ -239,14 +239,24 @@
* Adjust automatically generated filter fields
*/
public function get_filter_fields(Array &$filters)
- {
// When filtering, use only categories flagged as category
$filters[‘cat_id’][‘type’] = ‘select’;
$filters[‘cat_id’][‘values’] = $this->ui->get_tracker_labels(‘cat’,null);
-
foreach($filters as $field_name => &$settings)
-
{
-
if($this->selects[$field_name]) $settings['values'] = $this->selects[$field_name];
-
}
- }
-
- /**
-
- Get the class name for the egw_record to use while exporting
-
-
- */
- public static function get_egw_record_class()
- {
-
return 'tracker_egw_record';
- }
}
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
eGroupWare-cvs mailing list
eGroupWare-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/egroupware-cvs