From 8820c41c3dcdc164effb16173f802a513343aad5 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Thu, 2 Jun 2011 16:50:41 +0000 Subject: [PATCH] Add context menu --- .../class.importexport_definitions_ui.inc.php | 249 +++++++++++++++--- .../inc/class.importexport_export_ui.inc.php | 8 +- .../class.importexport_schedule_ui.inc.php | 13 + importexport/js/importexport.js | 1 + importexport/lang/egw_en.lang | 2 + importexport/setup/etemplates.inc.php | 39 ++- .../templates/default/import_definition.xet | 25 ++ 7 files changed, 298 insertions(+), 39 deletions(-) create mode 100644 importexport/templates/default/import_definition.xet diff --git a/importexport/inc/class.importexport_definitions_ui.inc.php b/importexport/inc/class.importexport_definitions_ui.inc.php index 1c174cf9e8..57467d545f 100644 --- a/importexport/inc/class.importexport_definitions_ui.inc.php +++ b/importexport/inc/class.importexport_definitions_ui.inc.php @@ -92,38 +92,62 @@ class importexport_definitions_ui } } - $bodefinitions = new importexport_definitions_bo(false, true); if (is_array($content)) { - if (isset($content['rows']['delete'])) + // Handle legacy actions + if (isset($content['nm']['rows']['delete'])) { - $bodefinitions->delete(array_keys($content['delete'],'pressed')); + $content['nm']['action'] = 'delete'; + $content['nm']['selected'] = array_keys($content['nm']['rows']['delete'],'pressed'); } elseif(($button = array_search('pressed',$content['nm']['rows'])) !== false) { $selected = $content['nm']['rows']['selected']; - if(count($selected) < 1 || !is_array($selected)) exit(); + if(count($selected) < 1 || !is_array($selected)) common::egw_exit(); switch ($button) { case 'delete_selected' : - $bodefinitions->delete($selected); + $content['nm']['selected'] = $selected; + $content['nm']['action'] = 'delete'; break; - - case 'export_selected' : - $mime_type = ($GLOBALS['egw']->html->user_agent == 'msie' || $GLOBALS['egw']->html->user_agent == 'opera') ? - 'application/octetstream' : 'application/octet-stream'; - $name = 'importexport_definition.xml'; - header('Content-Type: ' . $mime_type); - header('Content-Disposition: attachment; filename="'.$name.'"'); - echo $bodefinitions->export($selected); - exit(); - + case 'export_selected': + $content['nm']['selected'] = $selected; + $content['nm']['action'] = 'export'; break; - - default: } } - + if ($content['nm']['action']) + { + if (!count($content['nm']['selected']) && !$content['nm']['select_all']) + { + $msg = lang('You need to select some entries first!'); + } + else + { + // Action has an additional parameter + if(in_array($content['nm']['action'], array('owner', 'allowed'))) + { + if($content['nm']['action'] == 'allowed' && $content['allowed_private']) + { + $content['allowed'] = null; + } + if(is_array($content[$content['nm']['action']])) + { + $content[$content['nm']['action']] = implode(',',$content[$content['nm']['action']]); + } + $content['nm']['action'] .= '_' . $content[$content['nm']['action']]; + } + if ($this->action($content['nm']['action'],$content['nm']['selected'],$content['nm']['select_all'], + $success,$failed,$action_msg,'index',$msg)) + { + $msg .= lang('%1 definition(s) %2',$success,$action_msg); + } + elseif(empty($msg)) + { + $msg .= lang('%1 definition(s) %2, %3 failed because of insufficent rights !!!',$success,$action_msg,$failed); + } + } + } } if(!is_array($content['nm'])) { @@ -134,13 +158,14 @@ class importexport_definitions_ui 'no_filter2' => true, 'header_right' => 'importexport.definition_index.add', 'csv_fields' => false, // Disable CSV export, uses own export - 'row_id' => 'id', - 'actions' => $this->get_actions() + 'default_cols' => '!actions', // switch legacy actions column and row off by default + 'row_id' => 'definition_id', ); } if(egw_session::appsession('index', 'importexport')) { $content['nm'] = array_merge($content['nm'], egw_session::appsession('index', 'importexport')); } + $content['nm']['actions'] = $this->get_actions(); $sel_options = array( 'type' => array( 'import' => lang('import'), @@ -154,29 +179,191 @@ class importexport_definitions_ui $sel_options['application'][$appname] = lang($appname); } } + if($msg) $content['msg'] = $msg; $etpl = new etemplate(self::_appname.'.definition_index'); return $etpl->exec( self::_appname.'.importexport_definitions_ui.index', $content, $sel_options, $readonlys, $preserv ); } private function get_actions() { - $group = 1; + $group = 0; $actions = array( 'edit' => array( - 'caption' => 'Edit', + 'caption' => 'Open', + 'default' => true, 'allowOnMultiple' => false, - 'url' => 'menuaction=addressbook.addressbook_ui.edit&contact_id=$id', - 'popup' => egw_link::get_registry('addressbook', 'add_popup'), + 'url' => 'menuaction=importexport.importexport_definitions_ui.edit&definition=$id', + 'popup' => 'width=500,height=500', 'group' => $group, 'disableClass' => 'rowNoEdit', ), + 'add' => array( + 'caption' => 'Add', + 'url' => 'menuaction=importexport.importexport_definitions_ui.edit', + 'popup' => 'width=500,height=500', + 'group' => $group, + ), + 'execute' => array( + 'caption' => 'Execute', + 'icon' => 'importexport/navbar', + 'allowOnMultiple' => false, + 'group' => $group, + ), + 'schedule' => array( + 'caption' => 'Schedule', + 'icon' => 'schedule', + 'allowOnMultiple' => false, + 'url' => 'menuaction=importexport.importexport_schedule_ui.edit&definition=$id', + 'popup' => 'width=500,height=500', + 'group' => $group, + ), + 'change' => array( + 'caption' => 'Change', + 'icon' => 'edit', + 'children' => array( + 'owner' => array( + 'caption' => 'Owner', + 'group' => 1, + 'nm_action' => 'open_popup', + ), + 'allowed' => array( + 'caption' => 'Allowed users', + 'group' => 1, + 'nm_action' => 'open_popup', + ) + ), + ), + 'select_all' => array( + 'caption' => 'Whole query', + 'checkbox' => true, + 'hint' => 'Apply the action on the whole query, NOT only the shown contacts!!!', + 'group' => ++$group, + ), + 'copy' => array( + 'caption' => 'Copy', + 'group' => ++$group, + ), + 'export' => array( + 'caption' => 'Export', + 'group' => $group, + ), + 'delete' => array( + 'caption' => 'Delete', + 'confirm' => 'Delete this entry', + 'confirm_multiple' => 'Delete these entries', + 'group' => ++$group, + 'disableClass' => 'rowNoDelete', + ), ); - $actions['select_all'] = array( - 'caption' => 'Whole query', - 'checkbox' => true, - 'hint' => 'Apply the action on the whole query, NOT only the shown contacts!!!', - 'group' => ++$group, - ); + + // Unset admin actions + if(!$GLOBALS['egw_info']['user']['apps']['admin']) + { + unset($actions['schedule']); + } + return $actions; + } + + /** + * apply an action to multiple entries + * + * @param string/int $action 'delete', 'export', etc. + * @param array $selected id's to use if !$use_all + * @param boolean $use_all if true use all entries of the current selection (in the session) + * @param int &$success number of succeded actions + * @param int &$failed number of failed actions (not enought permissions) + * @param string &$action_msg translated verb for the actions, to be used in a message like %1 contacts 'deleted' + * @param string/array $session_name 'index' or 'email', or array with session-data depending if we are in the main list or the popup + * @return boolean true if all actions succeded, false otherwise + */ + function action($action,$selected,$use_all,&$success,&$failed,&$action_msg,$session_name,&$msg) + { + //echo __METHOD__."('$action', ".array2string($selected).', '.array2string($use_all).",,, '$session_name')"; + if ($use_all) + { + // get the whole selection + $old_query = $query = is_array($session_name) ? $session_name : egw_session::appsession($session_name,'importexport'); + + @set_time_limit(0); // switch off the execution time limit, as it's for big selections to small + $query['num_rows'] = -1; // all + $this->get_rows($query,$rows,$readonlys); + + $selected = array(); + foreach($rows as $row) { + $selected[] = $row['definition_id']; + } + if(!is_array($session_name)) + { + // Restore old query + egw_session::appsession($session_name, 'importexport',$old_query); + } + } + + // Dialogs to get options + list($action, $settings) = explode('_', $action, 2); + + $bodefinitions = new importexport_definitions_bo(false, true); + + switch($action) { + case 'execute': + // There's probably a way to do this in just JS, all the info should be there... + foreach($selected as $id) { + $definition = $bodefinitions->read((int)$id); + $link = egw::link('/index.php', array( + 'menuaction' => 'importexport.importexport_'.$definition['type'].'_ui.'.$definition['type'].'_dialog', + 'appname' => $definition['application'], + 'definition' => $definition['name'] + )); + egw_framework::set_onload("egw_openWindowCentered2('$link','_blank',850,440,'yes');"); + } + break; + case 'allowed': + $action = 'allowed_users';// Field is allowed_users, popup doesn't like _ + case 'owner': + $action_msg = lang('changed'. ' ' . $action); + foreach($selected as $id) { + $definition = $bodefinitions->read((int)$id); + if($definition['definition_id']) { + // Prevent private with no owner + if(!$definition['owner'] && !$settings) $definition['owner'] = $GLOBALS['egw_info']['user']['account_id']; + + $definition[$action] = $settings; + $bodefinitions->save($definition); + $success++; + } + } + break; + case 'delete': + $bodefinitions->delete($selected); + $action_msg = lang('deleted'); + break; + + case 'export' : + $action_msg = lang('exported'); + $mime_type = ($GLOBALS['egw']->html->user_agent == 'msie' || $GLOBALS['egw']->html->user_agent == 'opera') ? + 'application/octetstream' : 'application/octet-stream'; + $name = 'importexport_definition.xml'; + header('Content-Type: ' . $mime_type); + header('Content-Disposition: attachment; filename="'.$name.'"'); + echo $bodefinitions->export($selected); + common::egw_exit(); + break; + + case 'copy': + $action_msg = lang('copied'); + // Should only be one selected + foreach($selected as $id) { + $definition = $bodefinitions->read((int)$id); + if($definition['definition_id']) { + unset($definition['definition_id']); + $definition['name'] = $settings ? $settings : $definition['name'] . ' copy'; + $bodefinitions->save($definition); + $success++; + } + } + break; + } + return !$failed; } public function get_rows(&$query, &$rows, &$readonlys) { @@ -473,7 +660,7 @@ class importexport_definitions_ui { try { $check_definition = new importexport_definition($content['name']); - if($check_definition && $check_definition->definition_id != $content['definition_id']) + if($check_definition && $check_definition->definition_id && $check_definition->definition_id != $content['definition_id']) { throw new Exception('Already exists'); } diff --git a/importexport/inc/class.importexport_export_ui.inc.php b/importexport/inc/class.importexport_export_ui.inc.php index f74b332e09..86d088fa76 100644 --- a/importexport/inc/class.importexport_export_ui.inc.php +++ b/importexport/inc/class.importexport_export_ui.inc.php @@ -84,10 +84,10 @@ class importexport_export_ui { // permission error continue; } - if ($title = $definition->get_title()) { - $sel_options['definition'][$title] = $title; - } - unset($definition); + if ($title = $definition->get_title()) { + $sel_options['definition'][$title] = $title; + } + unset($definition); } if(count($sel_options['definition']) == 2 && !$content['definition']) { $content['definition'] = end($sel_options['definition']); diff --git a/importexport/inc/class.importexport_schedule_ui.inc.php b/importexport/inc/class.importexport_schedule_ui.inc.php index 90798b2e01..31f045eed4 100644 --- a/importexport/inc/class.importexport_schedule_ui.inc.php +++ b/importexport/inc/class.importexport_schedule_ui.inc.php @@ -62,6 +62,8 @@ public function edit($content = array()) { $id = $_GET['id'] ? $_GET['id'] : $content['id']; + $definition_id = $_GET['definition']; + unset($content['id']); $data = $content; @@ -103,6 +105,17 @@ } } else { $data['type'] = $content['type'] ? $content['type'] : 'import'; + + if((int)$definition_id) { + $bo = new importexport_definitions_bo(); + $definition = $bo->read($definition_id); + if($definition['definition_id']) { + $data['type'] = $definition['type']; + $data['appname'] = $definition['application']; + $data['plugin'] = $definition['plugin']; + $data['definition'] = $definition['name']; + } + } } if($data['target'] && $data['type']) { diff --git a/importexport/js/importexport.js b/importexport/js/importexport.js index 8366b2e0c4..e10216b1c3 100644 --- a/importexport/js/importexport.js +++ b/importexport/js/importexport.js @@ -11,3 +11,4 @@ function clear_options(id) { list.options[count] = null; } } + diff --git a/importexport/lang/egw_en.lang b/importexport/lang/egw_en.lang index 2e1f3cc385..eaf8a7fb91 100644 --- a/importexport/lang/egw_en.lang +++ b/importexport/lang/egw_en.lang @@ -10,6 +10,8 @@ admin disabled exporting importexport en Admin disabled exporting allowed users importexport en Allowed users automatically created by importexport importexport en Automatically created by importexport basic csv import importexport en Basic CSV import +changed allowed_users importexport en changed allowed users +changed owner importexport en changed owner charset of file importexport en Charset of file check all importexport en Check all choose a name for this definition importexport en Choose a name for this definition diff --git a/importexport/setup/etemplates.inc.php b/importexport/setup/etemplates.inc.php index 6ddd6299da..51ed7cd59d 100644 --- a/importexport/setup/etemplates.inc.php +++ b/importexport/setup/etemplates.inc.php @@ -2,7 +2,7 @@ /** * EGroupware - eTemplates for Application importexport * http://www.egroupware.org - * generated by soetemplate::dump4setup() 2011-05-27 12:33 + * generated by soetemplate::dump4setup() 2011-06-02 10:48 * * @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License * @package importexport @@ -14,15 +14,46 @@ $templ_version=1; $templ_data[] = array('name' => 'importexport.config','template' => '','lang' => '','group' => '0','version' => '1.9.001','data' => 'a:1:{i:0;a:4:{s:4:"type";s:4:"grid";s:4:"data";a:5:{i:0;a:2:{s:2:"c2";s:4:",top";s:2:"c3";s:4:",top";}i:1;a:2:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:45:"Users allowed to create their own definitions";}s:1:"B";a:2:{s:4:"type";s:8:"checkbox";s:4:"name";s:24:"users_create_definitions";}}i:2;a:2:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:44:"Users allowed to share their own definitions";}s:1:"B";a:3:{s:4:"type";s:14:"select-account";s:4:"size";s:6:"5,both";s:4:"name";s:16:"share_definition";}}i:3;a:2:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:39:"Export Spreadsheet link display folders";}s:1:"B";a:3:{s:4:"type";s:6:"select";s:4:"size";s:1:"3";s:4:"name";s:25:"export_spreadsheet_folder";}}i:4;a:2:{s:1:"A";a:4:{s:4:"type";s:4:"hbox";s:4:"size";s:1:"1";s:4:"span";s:3:"all";i:1;a:4:{s:4:"type";s:6:"button";s:4:"span";s:3:"all";s:5:"label";s:4:"Save";s:4:"name";s:4:"save";}}s:1:"B";a:1:{s:4:"type";s:5:"label";}}}s:4:"rows";i:4;s:4:"cols";i:2;}}','size' => '','style' => '','modified' => '1298390222',); -$templ_data[] = array('name' => 'importexport.definition_index','template' => '','lang' => '','group' => '0','version' => '1.9.002','data' => 'a:1:{i:0;a:5:{s:4:"type";s:4:"grid";s:4:"data";a:3:{i:0;a:1:{s:2:"h1";s:6:",!@msg";}i:1;a:1:{s:1:"A";a:4:{s:4:"span";s:13:"all,redItalic";s:7:"no_lang";s:1:"1";s:4:"name";s:3:"msg";s:4:"type";s:5:"label";}}i:2;a:1:{s:1:"A";a:6:{s:4:"type";s:9:"nextmatch";s:4:"data";a:3:{i:0;a:2:{s:2:"c1";s:2:"th";s:2:"c2";s:7:"row,top";}i:1;a:6:{s:1:"A";a:3:{s:4:"type";s:5:"label";s:5:"label";s:4:"Type";s:4:"span";s:11:",lr_padding";}s:1:"B";a:3:{s:4:"type";s:5:"label";s:5:"label";s:4:"Name";s:4:"span";s:11:",lr_padding";}s:1:"C";a:3:{s:4:"type";s:5:"label";s:5:"label";s:11:"Application";s:4:"span";s:11:",lr_padding";}s:1:"D";a:4:{s:5:"align";s:6:"center";s:4:"type";s:5:"label";s:5:"label";s:13:"Allowed users";s:4:"span";s:11:",lr_padding";}s:1:"E";a:5:{s:5:"label";s:3:"Add";s:5:"align";s:6:"center";s:4:"type";s:6:"button";s:4:"span";s:11:",lr_padding";s:7:"onclick";s:226:"window.open(egw::link(\'/index.php\',\'menuaction=importexport.importexport_definitions_ui.wizard\'),\'\',\'dependent=yes,width=500,height=500,location=no,menubar=no,toolbar=no,scrollbars=yes,status=yes\'); return false; return false;";}s:1:"F";a:4:{s:4:"type";s:4:"hbox";s:4:"size";s:1:"2";i:1;a:6:{s:5:"label";s:6:"Delete";s:4:"name";s:15:"delete_selected";s:4:"type";s:6:"button";s:4:"help";s:31:"delete ALL selected definitions";s:4:"size";s:6:"delete";s:7:"onclick";s:65:"return confirm(\'Do you really want to DELETE this definitions?\');";}i:2;a:5:{s:5:"label";s:6:"Export";s:4:"name";s:15:"export_selected";s:4:"type";s:6:"button";s:4:"help";s:31:"export ALL selected definitions";s:4:"size";s:10:"fileexport";}}}i:2;a:6:{s:1:"A";a:5:{s:7:"no_lang";s:1:"1";s:4:"type";s:5:"image";s:4:"span";s:18:",lr_padding button";s:4:"name";s:12:"${row}[type]";s:7:"onclick";s:222:"window.open(egw::link(\'/index.php\',\'menuaction=${row_cont[menuaction]}&appname=${row_cont[application]}&definition=${row_cont[name]}\'),\'_blank\',\'dependent=yes,width=850,height=440,scrollbars=yes,status=yes\'); return false;";}s:1:"B";a:5:{s:7:"no_lang";s:1:"1";s:4:"name";s:12:"${row}[name]";s:4:"type";s:5:"label";s:4:"span";s:11:",lr_padding";s:4:"size";s:1:",";}s:1:"C";a:4:{s:7:"no_lang";s:1:"1";s:4:"name";s:19:"${row}[application]";s:4:"type";s:5:"label";s:4:"span";s:11:",lr_padding";}s:1:"D";a:6:{s:7:"no_lang";s:1:"1";s:4:"type";s:14:"select-account";s:4:"span";s:11:",lr_padding";s:8:"readonly";s:1:"1";s:4:"name";s:21:"${row}[allowed_users]";s:4:"size";s:6:"5,both";}s:1:"E";a:5:{s:5:"align";s:6:"center";s:4:"type";s:4:"hbox";s:4:"size";s:1:"2";i:1;a:4:{s:5:"label";s:4:"Edit";s:4:"type";s:6:"button";s:4:"size";s:4:"edit";s:7:"onclick";s:263:"window.open(egw::link(\'/index.php\',\'menuaction=importexport.importexport_definitions_ui.edit&definition=$row_cont[name]\'),\'\',\'dependent=yes,width=500,height=500,location=no,menubar=no,toolbar=no,scrollbars=yes,resizable=1,status=yes\'); return false; return false;";}i:2;a:6:{s:5:"label";s:6:"Delete";s:7:"onclick";s:41:"return confirm(\'Delete this definition\');";s:4:"name";s:32:"delete[$row_cont[definition_id]]";s:4:"type";s:6:"button";s:4:"size";s:6:"delete";s:4:"help";s:21:"Delete this eTemplate";}}s:1:"F";a:4:{s:5:"align";s:6:"center";s:4:"name";s:34:"selected[$row_cont[definition_id]]";s:4:"type";s:8:"checkbox";s:4:"help";s:34:"select this eTemplate to delete it";}}}s:4:"cols";i:6;s:4:"rows";i:2;s:4:"name";s:2:"nm";s:4:"size";s:33:"importexport.definition_index.row";}}}s:4:"cols";i:1;s:4:"rows";i:2;s:4:"size";s:4:"100%";}}','size' => '100%','style' => '.redItalic { color:red; font-style:italic;} td.lr_padding { padding-left: 5px; padding-right: 5px; } +$templ_data[] = array('name' => 'importexport.definition_index','template' => '','lang' => '','group' => '0','version' => '1.9.002','data' => 'a:1:{i:0;a:5:{s:4:"type";s:4:"grid";s:4:"data";a:4:{i:0;a:1:{s:2:"h1";s:6:",!@msg";}i:1;a:1:{s:1:"A";a:4:{s:4:"span";s:13:"all,redItalic";s:7:"no_lang";s:1:"1";s:4:"name";s:3:"msg";s:4:"type";s:5:"label";}}i:2;a:1:{s:1:"A";a:6:{s:4:"type";s:9:"nextmatch";s:4:"data";a:3:{i:0;a:2:{s:2:"c1";s:2:"th";s:2:"c2";s:7:"row,top";}i:1;a:6:{s:1:"A";a:3:{s:4:"type";s:5:"label";s:5:"label";s:4:"Type";s:4:"span";s:11:",lr_padding";}s:1:"B";a:3:{s:4:"type";s:5:"label";s:5:"label";s:4:"Name";s:4:"span";s:11:",lr_padding";}s:1:"C";a:3:{s:4:"type";s:5:"label";s:5:"label";s:11:"Application";s:4:"span";s:11:",lr_padding";}s:1:"D";a:4:{s:5:"align";s:6:"center";s:4:"type";s:5:"label";s:5:"label";s:13:"Allowed users";s:4:"span";s:11:",lr_padding";}s:1:"E";a:5:{s:5:"label";s:3:"Add";s:5:"align";s:6:"center";s:4:"type";s:6:"button";s:4:"span";s:11:",lr_padding";s:7:"onclick";s:226:"window.open(egw::link(\'/index.php\',\'menuaction=importexport.importexport_definitions_ui.wizard\'),\'\',\'dependent=yes,width=500,height=500,location=no,menubar=no,toolbar=no,scrollbars=yes,status=yes\'); return false; return false;";}s:1:"F";a:4:{s:4:"type";s:4:"hbox";s:4:"size";s:1:"2";i:1;a:6:{s:5:"label";s:6:"Delete";s:4:"name";s:15:"delete_selected";s:4:"type";s:6:"button";s:4:"help";s:31:"delete ALL selected definitions";s:4:"size";s:6:"delete";s:7:"onclick";s:65:"return confirm(\'Do you really want to DELETE this definitions?\');";}i:2;a:5:{s:5:"label";s:6:"Export";s:4:"name";s:15:"export_selected";s:4:"type";s:6:"button";s:4:"help";s:31:"export ALL selected definitions";s:4:"size";s:10:"fileexport";}}}i:2;a:6:{s:1:"A";a:5:{s:7:"no_lang";s:1:"1";s:4:"type";s:5:"image";s:4:"span";s:18:",lr_padding button";s:4:"name";s:12:"${row}[type]";s:7:"onclick";s:222:"window.open(egw::link(\'/index.php\',\'menuaction=${row_cont[menuaction]}&appname=${row_cont[application]}&definition=${row_cont[name]}\'),\'_blank\',\'dependent=yes,width=850,height=440,scrollbars=yes,status=yes\'); return false;";}s:1:"B";a:5:{s:7:"no_lang";s:1:"1";s:4:"name";s:12:"${row}[name]";s:4:"type";s:5:"label";s:4:"span";s:11:",lr_padding";s:4:"size";s:1:",";}s:1:"C";a:4:{s:7:"no_lang";s:1:"1";s:4:"name";s:19:"${row}[application]";s:4:"type";s:5:"label";s:4:"span";s:11:",lr_padding";}s:1:"D";a:6:{s:7:"no_lang";s:1:"1";s:4:"type";s:14:"select-account";s:4:"span";s:11:",lr_padding";s:8:"readonly";s:1:"1";s:4:"name";s:21:"${row}[allowed_users]";s:4:"size";s:6:"5,both";}s:1:"E";a:5:{s:5:"align";s:6:"center";s:4:"type";s:4:"hbox";s:4:"size";s:1:"2";i:1;a:4:{s:5:"label";s:4:"Edit";s:4:"type";s:6:"button";s:4:"size";s:4:"edit";s:7:"onclick";s:263:"window.open(egw::link(\'/index.php\',\'menuaction=importexport.importexport_definitions_ui.edit&definition=$row_cont[name]\'),\'\',\'dependent=yes,width=500,height=500,location=no,menubar=no,toolbar=no,scrollbars=yes,resizable=1,status=yes\'); return false; return false;";}i:2;a:6:{s:5:"label";s:6:"Delete";s:7:"onclick";s:41:"return confirm(\'Delete this definition\');";s:4:"name";s:32:"delete[$row_cont[definition_id]]";s:4:"type";s:6:"button";s:4:"size";s:6:"delete";s:4:"help";s:21:"Delete this eTemplate";}}s:1:"F";a:4:{s:5:"align";s:6:"center";s:4:"name";s:34:"selected[$row_cont[definition_id]]";s:4:"type";s:8:"checkbox";s:4:"help";s:34:"select this eTemplate to delete it";}}}s:4:"cols";i:6;s:4:"rows";i:2;s:4:"name";s:2:"nm";s:4:"size";s:33:"importexport.definition_index.row";}}i:3;a:1:{s:1:"A";a:4:{s:4:"type";s:4:"hbox";s:4:"size";s:1:"2";i:1;a:6:{s:5:"class";s:19:"action_popup prompt";s:4:"name";s:11:"owner_popup";s:4:"type";s:3:"box";s:4:"size";s:1:"1";i:1;a:6:{s:4:"type";s:4:"vbox";s:4:"size";s:1:"4";i:1;a:3:{s:4:"type";s:5:"label";s:5:"label";s:12:"Change owner";s:4:"span";s:13:",promptheader";}i:2;a:2:{s:4:"type";s:5:"label";s:5:"label";s:12:"Select owner";}i:3;a:4:{s:4:"type";s:14:"select-account";s:4:"name";s:5:"owner";s:4:"size";s:10:"None,users";s:4:"span";s:21:",action_popup-content";}i:4;a:4:{s:4:"type";s:4:"hbox";s:4:"size";s:1:"2";i:1;a:3:{s:5:"label";s:4:"Save";s:7:"onclick";s:36:"nm_submit_popup(this); return false;";s:4:"type";s:6:"button";}i:2;a:3:{s:5:"label";s:6:"Cancel";s:7:"onclick";s:40:"nm_hide_popup(this,\'responsible_popup\');";s:4:"type";s:10:"buttononly";}}}s:4:"span";s:20:",action_popup prompt";}i:2;a:6:{s:5:"class";s:19:"action_popup prompt";s:4:"name";s:13:"allowed_popup";s:4:"type";s:3:"box";s:4:"size";s:1:"1";i:1;a:7:{s:4:"type";s:4:"vbox";s:4:"size";s:1:"5";i:1;a:3:{s:4:"type";s:5:"label";s:5:"label";s:20:"Change allowed users";s:4:"span";s:13:",promptheader";}i:2;a:2:{s:4:"type";s:5:"label";s:5:"label";s:13:"Select groups";}i:3;a:3:{s:4:"type";s:8:"checkbox";s:4:"name";s:15:"allowed_private";s:5:"label";s:10:"%s Just me";}i:4;a:4:{s:4:"type";s:14:"select-account";s:4:"name";s:7:"allowed";s:4:"size";s:8:"5,groups";s:4:"span";s:21:",action_popup-content";}i:5;a:4:{s:4:"type";s:4:"hbox";s:4:"size";s:1:"2";i:1;a:3:{s:5:"label";s:4:"Save";s:7:"onclick";s:36:"nm_submit_popup(this); return false;";s:4:"type";s:6:"button";}i:2;a:3:{s:5:"label";s:6:"Cancel";s:7:"onclick";s:40:"nm_hide_popup(this,\'responsible_popup\');";s:4:"type";s:10:"buttononly";}}}s:4:"span";s:20:",action_popup prompt";}}}}s:4:"cols";i:1;s:4:"rows";i:3;s:4:"size";s:4:"100%";}}','size' => '100%','style' => '.redItalic { color:red; font-style:italic;} td.lr_padding { padding-left: 5px; padding-right: 5px; } .button { cursor: pointer; +} +/** + * Add / remove link or category popup used for actions on multiple entries + */ + +.action_popup { + position: fixed; + top: 200px; + left: 450px; + width: 76ex; + z-index: 20000; + display: none; + border-collapse:collapse; + border-spacing:0px +} +.action_popup-content { + display:block; + padding:2ex; + color:#666666; + margin: -2px -1px 0px -2px; +} +.action_popup > table { + width: 100% +} +.action_popup .promptheader { + padding: 1ex; + width: 100% +} + +.action_select { + width: 100% }','modified' => '1303225543',); $templ_data[] = array('name' => 'importexport.definition_index.add','template' => '','lang' => '','group' => '0','version' => '1.9.002','data' => 'a:1:{i:0;a:4:{s:4:"type";s:4:"grid";s:4:"data";a:2:{i:0;a:0:{}i:1;a:1:{s:1:"A";a:4:{s:4:"type";s:6:"button";s:5:"label";s:3:"Add";s:4:"name";s:3:"add";s:7:"onclick";s:182:"window.open(egw::link(\'/index.php\',\'menuaction=importexport.importexport_definitions_ui.edit\'),\'_blank\',\'dependent=yes,width=600,height=500,scrollbars=yes,status=yes\'); return false;";}}}s:4:"rows";i:1;s:4:"cols";i:1;}}','size' => '','style' => '','modified' => '1303226106',); -$templ_data[] = array('name' => 'importexport.definition_index.row','template' => '','lang' => '','group' => '0','version' => '1.9.002','data' => 'a:1:{i:0;a:5:{s:4:"type";s:4:"grid";s:4:"data";a:3:{i:0;a:2:{s:2:"c1";s:2:"th";s:2:"c2";s:3:"row";}i:1;a:7:{s:1:"A";a:4:{s:4:"type";s:22:"nextmatch-filterheader";s:4:"span";s:11:",lr_padding";s:4:"name";s:4:"type";s:4:"size";s:12:"importexport";}s:1:"B";a:4:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:4:"Name";s:4:"span";s:11:",lr_padding";s:4:"name";s:4:"name";}s:1:"C";a:4:{s:4:"type";s:22:"nextmatch-filterheader";s:4:"span";s:11:",lr_padding";s:4:"name";s:11:"application";s:4:"size";s:11:"Application";}s:1:"D";a:6:{s:5:"align";s:6:"center";s:4:"type";s:23:"nextmatch-accountfilter";s:5:"label";s:13:"Allowed users";s:4:"span";s:11:",lr_padding";s:4:"name";s:13:"allowed_users";s:4:"size";s:10:"All,groups";}s:1:"E";a:3:{s:4:"type";s:23:"nextmatch-accountfilter";s:5:"label";s:5:"Owner";s:4:"name";s:5:"owner";}s:1:"F";a:5:{s:5:"label";s:7:"Actions";s:5:"align";s:6:"center";s:4:"type";s:16:"nextmatch-header";s:4:"span";s:11:",lr_padding";s:4:"name";s:7:"actions";}s:1:"G";a:4:{s:4:"type";s:4:"hbox";s:4:"size";s:1:"2";i:1;a:6:{s:5:"label";s:6:"Delete";s:4:"name";s:15:"delete_selected";s:4:"type";s:6:"button";s:4:"help";s:31:"delete ALL selected definitions";s:4:"size";s:6:"delete";s:7:"onclick";s:65:"return confirm(\'Do you really want to DELETE this definitions?\');";}i:2;a:5:{s:5:"label";s:6:"Export";s:4:"name";s:15:"export_selected";s:4:"type";s:6:"button";s:4:"help";s:31:"export ALL selected definitions";s:4:"size";s:10:"fileexport";}}}i:2;a:7:{s:1:"A";a:5:{s:7:"no_lang";s:1:"1";s:4:"type";s:5:"image";s:4:"span";s:18:",lr_padding button";s:4:"name";s:12:"${row}[type]";s:7:"onclick";s:270:"window.open(egw::link(\'/index.php\',\'menuaction=importexport.importexport_${row_cont[type]}_ui.{$row_cont[type]}_dialog&appname=${row_cont[application]}&definition=${row_cont[name]}\'),\'_blank\',\'dependent=yes,width=850,height=440,scrollbars=yes,status=yes\'); return false;";}s:1:"B";a:5:{s:7:"no_lang";s:1:"1";s:4:"name";s:12:"${row}[name]";s:4:"type";s:5:"label";s:4:"span";s:11:",lr_padding";s:4:"size";s:1:",";}s:1:"C";a:4:{s:7:"no_lang";s:1:"1";s:4:"name";s:19:"${row}[application]";s:4:"type";s:5:"label";s:4:"span";s:11:",lr_padding";}s:1:"D";a:6:{s:7:"no_lang";s:1:"1";s:4:"type";s:14:"select-account";s:4:"span";s:11:",lr_padding";s:8:"readonly";s:1:"1";s:4:"name";s:21:"${row}[allowed_users]";s:4:"size";s:6:"5,both";}s:1:"E";a:3:{s:4:"type";s:14:"select-account";s:4:"name";s:13:"${row}[owner]";s:8:"readonly";s:1:"1";}s:1:"F";a:5:{s:5:"align";s:6:"center";s:4:"type";s:4:"hbox";s:4:"size";s:1:"2";i:1;a:5:{s:5:"label";s:4:"Edit";s:4:"type";s:6:"button";s:4:"size";s:4:"edit";s:7:"onclick";s:263:"window.open(egw::link(\'/index.php\',\'menuaction=importexport.importexport_definitions_ui.edit&definition=$row_cont[name]\'),\'\',\'dependent=yes,width=500,height=500,location=no,menubar=no,toolbar=no,scrollbars=yes,resizable=1,status=yes\'); return false; return false;";s:4:"name";s:32:"edit[{$row_cont[definition_id]}]";}i:2;a:6:{s:5:"label";s:6:"Delete";s:7:"onclick";s:41:"return confirm(\'Delete this definition\');";s:4:"name";s:32:"delete[$row_cont[definition_id]]";s:4:"type";s:6:"button";s:4:"size";s:6:"delete";s:4:"help";s:21:"Delete this eTemplate";}}s:1:"G";a:5:{s:5:"align";s:6:"center";s:4:"name";s:10:"selected[]";s:4:"type";s:8:"checkbox";s:4:"help";s:34:"select this eTemplate to delete it";s:4:"size";s:24:"$row_cont[definition_id]";}}}s:4:"cols";i:7;s:4:"rows";i:2;s:4:"size";s:4:"100%";}}','size' => '100%','style' => '.redItalic { color:red; font-style:italic;} td.lr_padding { padding-left: 5px; padding-right: 5px; } +$templ_data[] = array('name' => 'importexport.definition_index.row','template' => '','lang' => '','group' => '0','version' => '1.9.002','data' => 'a:1:{i:0;a:5:{s:4:"type";s:4:"grid";s:4:"data";a:3:{i:0;a:3:{s:2:"c1";s:2:"th";s:2:"c2";s:3:"row";s:1:"G";s:12:",@no_actions";}i:1;a:7:{s:1:"A";a:4:{s:4:"type";s:22:"nextmatch-filterheader";s:4:"span";s:11:",lr_padding";s:4:"name";s:4:"type";s:4:"size";s:12:"importexport";}s:1:"B";a:4:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:4:"Name";s:4:"span";s:11:",lr_padding";s:4:"name";s:4:"name";}s:1:"C";a:4:{s:4:"type";s:22:"nextmatch-filterheader";s:4:"span";s:11:",lr_padding";s:4:"name";s:11:"application";s:4:"size";s:11:"Application";}s:1:"D";a:6:{s:5:"align";s:6:"center";s:4:"type";s:23:"nextmatch-accountfilter";s:5:"label";s:13:"Allowed users";s:4:"span";s:11:",lr_padding";s:4:"name";s:13:"allowed_users";s:4:"size";s:10:"All,groups";}s:1:"E";a:3:{s:4:"type";s:23:"nextmatch-accountfilter";s:5:"label";s:5:"Owner";s:4:"name";s:5:"owner";}s:1:"F";a:5:{s:5:"label";s:7:"Actions";s:5:"align";s:6:"center";s:4:"type";s:16:"nextmatch-header";s:4:"span";s:11:",lr_padding";s:4:"name";s:7:"actions";}s:1:"G";a:4:{s:4:"type";s:4:"hbox";s:4:"size";s:1:"2";i:1;a:6:{s:5:"label";s:6:"Delete";s:4:"name";s:15:"delete_selected";s:4:"type";s:6:"button";s:4:"help";s:31:"delete ALL selected definitions";s:4:"size";s:6:"delete";s:7:"onclick";s:65:"return confirm(\'Do you really want to DELETE this definitions?\');";}i:2;a:5:{s:5:"label";s:6:"Export";s:4:"name";s:15:"export_selected";s:4:"type";s:6:"button";s:4:"help";s:31:"export ALL selected definitions";s:4:"size";s:10:"fileexport";}}}i:2;a:7:{s:1:"A";a:5:{s:7:"no_lang";s:1:"1";s:4:"type";s:5:"image";s:4:"span";s:18:",lr_padding button";s:4:"name";s:12:"${row}[type]";s:7:"onclick";s:270:"window.open(egw::link(\'/index.php\',\'menuaction=importexport.importexport_${row_cont[type]}_ui.{$row_cont[type]}_dialog&appname=${row_cont[application]}&definition=${row_cont[name]}\'),\'_blank\',\'dependent=yes,width=850,height=440,scrollbars=yes,status=yes\'); return false;";}s:1:"B";a:5:{s:7:"no_lang";s:1:"1";s:4:"name";s:12:"${row}[name]";s:4:"type";s:5:"label";s:4:"span";s:11:",lr_padding";s:4:"size";s:1:",";}s:1:"C";a:4:{s:7:"no_lang";s:1:"1";s:4:"name";s:19:"${row}[application]";s:4:"type";s:5:"label";s:4:"span";s:11:",lr_padding";}s:1:"D";a:6:{s:7:"no_lang";s:1:"1";s:4:"type";s:14:"select-account";s:4:"span";s:11:",lr_padding";s:8:"readonly";s:1:"1";s:4:"name";s:21:"${row}[allowed_users]";s:4:"size";s:6:"5,both";}s:1:"E";a:3:{s:4:"type";s:14:"select-account";s:4:"name";s:13:"${row}[owner]";s:8:"readonly";s:1:"1";}s:1:"F";a:5:{s:5:"align";s:6:"center";s:4:"type";s:4:"hbox";s:4:"size";s:1:"2";i:1;a:5:{s:5:"label";s:4:"Edit";s:4:"type";s:6:"button";s:4:"size";s:4:"edit";s:7:"onclick";s:263:"window.open(egw::link(\'/index.php\',\'menuaction=importexport.importexport_definitions_ui.edit&definition=$row_cont[name]\'),\'\',\'dependent=yes,width=500,height=500,location=no,menubar=no,toolbar=no,scrollbars=yes,resizable=1,status=yes\'); return false; return false;";s:4:"name";s:32:"edit[{$row_cont[definition_id]}]";}i:2;a:6:{s:5:"label";s:6:"Delete";s:7:"onclick";s:41:"return confirm(\'Delete this definition\');";s:4:"name";s:32:"delete[$row_cont[definition_id]]";s:4:"type";s:6:"button";s:4:"size";s:6:"delete";s:4:"help";s:21:"Delete this eTemplate";}}s:1:"G";a:5:{s:5:"align";s:6:"center";s:4:"name";s:10:"selected[]";s:4:"type";s:8:"checkbox";s:4:"help";s:34:"select this eTemplate to delete it";s:4:"size";s:24:"$row_cont[definition_id]";}}}s:4:"cols";i:7;s:4:"rows";i:2;s:4:"size";s:4:"100%";}}','size' => '100%','style' => '.redItalic { color:red; font-style:italic;} td.lr_padding { padding-left: 5px; padding-right: 5px; } .button { cursor: pointer; @@ -58,7 +89,7 @@ $templ_data[] = array('name' => 'importexport.export_dialog.options_tab','templa $templ_data[] = array('name' => 'importexport.export_dialog.selection_tab','template' => '','lang' => '','group' => '0','version' => '','data' => 'a:1:{i:0;a:6:{s:4:"type";s:4:"grid";s:4:"data";a:3:{i:0;a:2:{s:2:"c1";s:4:",top";s:2:"h1";s:27:",@plugin_selectors_template";}i:1;a:1:{s:1:"A";a:3:{s:4:"type";s:4:"html";s:4:"name";s:21:"plugin_selectors_html";s:7:"no_lang";s:1:"1";}}i:2;a:1:{s:1:"A";a:2:{s:4:"type";s:8:"template";s:4:"name";s:26:"@plugin_selectors_template";}}}s:4:"rows";i:2;s:4:"cols";i:1;s:4:"size";s:6:",200px";s:7:"options";a:1:{i:1;s:5:"200px";}}}','size' => ',200px','style' => '','modified' => '1158223796',); -$templ_data[] = array('name' => 'importexport.import_definition','template' => '','lang' => '','group' => '0','version' => '0.0.1','data' => 'a:1:{i:0;a:4:{s:4:"type";s:4:"grid";s:4:"data";a:4:{i:0;a:0:{}i:1;a:1:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:92:"Import definitions (Attension: Existing definitions with equal names will be overwritten!!!)";}}i:2;a:1:{s:1:"A";a:2:{s:4:"type";s:4:"file";s:4:"name";s:11:"import_file";}}i:3;a:1:{s:1:"A";a:3:{s:4:"type";s:6:"button";s:5:"label";s:6:"Import";s:4:"name";s:6:"import";}}}s:4:"rows";i:3;s:4:"cols";i:1;}}','size' => '','style' => '','modified' => '1150533844',); +$templ_data[] = array('name' => 'importexport.import_definition','template' => '','lang' => '','group' => '0','version' => '1.9.001','data' => 'a:1:{i:0;a:4:{s:4:"type";s:4:"grid";s:4:"data";a:4:{i:0;a:0:{}i:1;a:1:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:92:"Import definitions (Attension: Existing definitions with equal names will be overwritten!!!)";}}i:2;a:1:{s:1:"A";a:2:{s:4:"type";s:4:"file";s:4:"name";s:11:"import_file";}}i:3;a:1:{s:1:"A";a:4:{s:4:"type";s:4:"hbox";s:4:"size";s:1:"2";i:1;a:3:{s:4:"type";s:6:"button";s:5:"label";s:6:"Import";s:4:"name";s:6:"import";}i:2;a:3:{s:4:"type";s:6:"button";s:4:"name";s:6:"update";s:5:"label";s:26:"Update default-definitions";}}}}s:4:"rows";i:3;s:4:"cols";i:1;}}','size' => '','style' => '','modified' => '1306253183',); $templ_data[] = array('name' => 'importexport.import_dialog','template' => '','lang' => '','group' => '0','version' => '0.1','data' => 'a:1:{i:0;a:4:{s:4:"type";s:4:"grid";s:4:"data";a:7:{i:0;a:1:{s:2:"h1";s:10:",!@message";}i:1;a:2:{s:1:"A";a:3:{s:4:"type";s:5:"label";s:4:"span";s:11:"all,message";s:4:"name";s:7:"message";}s:1:"B";a:1:{s:4:"type";s:5:"label";}}i:2;a:2:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:11:"Application";}s:1:"B";a:3:{s:4:"type";s:6:"select";s:4:"name";s:7:"appname";s:8:"onchange";s:87:"xajax_doXMLHTTP(\'importexport.importexport_import_ui.ajax_get_definitions\',this.value);";}}i:3;a:2:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:17:"Import definition";}s:1:"B";a:2:{s:4:"type";s:6:"select";s:4:"name";s:10:"definition";}}i:4;a:2:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:28:"Please select file to import";}s:1:"B";a:2:{s:4:"type";s:4:"file";s:4:"name";s:4:"file";}}i:5;a:2:{s:1:"A";a:1:{s:4:"type";s:5:"label";}s:1:"B";a:1:{s:4:"type";s:5:"label";}}i:6;a:2:{s:1:"A";a:6:{s:4:"type";s:4:"hbox";s:4:"size";s:1:"3";s:4:"span";s:3:"all";i:1;a:3:{s:4:"type";s:6:"button";s:5:"label";s:6:"Import";s:4:"name";s:6:"import";}i:2;a:3:{s:4:"type";s:6:"button";s:4:"name";s:6:"cancel";s:5:"label";s:6:"Cancel";}i:3;a:4:{s:4:"type";s:8:"checkbox";s:4:"name";s:7:"dry-run";s:5:"label";s:9:"Test only";s:5:"align";s:5:"right";}}s:1:"B";a:1:{s:4:"type";s:5:"label";}}}s:4:"rows";i:6;s:4:"cols";i:2;}}','size' => '','style' => '','modified' => '1266439013',); diff --git a/importexport/templates/default/import_definition.xet b/importexport/templates/default/import_definition.xet new file mode 100644 index 0000000000..10b44a5e18 --- /dev/null +++ b/importexport/templates/default/import_definition.xet @@ -0,0 +1,25 @@ + + + + + \ No newline at end of file