@@ -12,9 +12,9 @@ discard block |
||
12 | 12 | if (!extension_loaded('dom')) |
13 | 13 | { |
14 | 14 | echo "<p>Required PHP DOM extension missing, installation of ImportExport definitions aborted.</p>\n"; |
15 | - return; // otherwise we mess up the whole eGroupware install process |
|
15 | + return; // otherwise we mess up the whole eGroupware install process |
|
16 | 16 | } |
17 | -require_once(EGW_INCLUDE_ROOT. '/importexport/inc/class.importexport_definitions_bo.inc.php'); |
|
17 | +require_once(EGW_INCLUDE_ROOT.'/importexport/inc/class.importexport_definitions_bo.inc.php'); |
|
18 | 18 | |
19 | 19 | // This sets up $GLOBALS['egw']->accounts and $GLOBALS['egw']->db |
20 | 20 | $GLOBALS['egw_setup']->setup_account_object(); |
@@ -22,22 +22,22 @@ discard block |
||
22 | 22 | // step through every source code intstalled app |
23 | 23 | $egwdir = dir(EGW_INCLUDE_ROOT); |
24 | 24 | while (false !== ($appdir = $egwdir->read())) { |
25 | - $defdir = EGW_INCLUDE_ROOT. "/$appdir/setup/"; |
|
26 | - if ( !is_dir( $defdir ) ) continue; |
|
25 | + $defdir = EGW_INCLUDE_ROOT."/$appdir/setup/"; |
|
26 | + if (!is_dir($defdir)) continue; |
|
27 | 27 | |
28 | 28 | // step through each file in defdir of app |
29 | 29 | $d = dir($defdir); |
30 | 30 | while (false !== ($entry = $d->read())) { |
31 | - $file = $defdir. '/'. $entry; |
|
32 | - list( $filename, $extension) = explode('.',$entry); |
|
33 | - if ( $extension != 'xml' ) continue; |
|
34 | - importexport_definitions_bo::import( $file ); |
|
31 | + $file = $defdir.'/'.$entry; |
|
32 | + list($filename, $extension) = explode('.', $entry); |
|
33 | + if ($extension != 'xml') continue; |
|
34 | + importexport_definitions_bo::import($file); |
|
35 | 35 | } |
36 | 36 | } |
37 | 37 | |
38 | 38 | // give Default and Admins group rights for ImportExport |
39 | -foreach(array('Default' => 'Default','Admins' => 'Admin') as $account_lid => $name) |
|
39 | +foreach (array('Default' => 'Default', 'Admins' => 'Admin') as $account_lid => $name) |
|
40 | 40 | { |
41 | - $account_id = $GLOBALS['egw_setup']->add_account($account_lid,$name,'Group',False,False); |
|
42 | - $GLOBALS['egw_setup']->add_acl('importexport','run',$account_id); |
|
41 | + $account_id = $GLOBALS['egw_setup']->add_account($account_lid, $name, 'Group', False, False); |
|
42 | + $GLOBALS['egw_setup']->add_acl('importexport', 'run', $account_id); |
|
43 | 43 | } |
@@ -33,7 +33,7 @@ |
||
33 | 33 | * @param definition $_definition |
34 | 34 | * @return int number of successful imports |
35 | 35 | */ |
36 | - public function import( $_stream, importexport_definition $_definition ); |
|
36 | + public function import($_stream, importexport_definition $_definition); |
|
37 | 37 | |
38 | 38 | /** |
39 | 39 | * Reads entries, and presents them back as they will be understood |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | * @param array $_options options for specific backends |
34 | 34 | * @return bool |
35 | 35 | */ |
36 | - public function __construct( $_stream, array $_options ); |
|
36 | + public function __construct($_stream, array $_options); |
|
37 | 37 | |
38 | 38 | /** |
39 | 39 | * exports a record into resource of handle |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | * @param object of interface egw_record _record |
42 | 42 | * @return bool |
43 | 43 | */ |
44 | - public function export_record( importexport_iface_egw_record $_record ); |
|
44 | + public function export_record(importexport_iface_egw_record $_record); |
|
45 | 45 | |
46 | 46 | /** |
47 | 47 | * Retruns total number of exported records. |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | * @param array $_options options for specific backends |
28 | 28 | * @return bool |
29 | 29 | */ |
30 | - public function __construct( $_stream, array $_options ); |
|
30 | + public function __construct($_stream, array $_options); |
|
31 | 31 | |
32 | 32 | /** |
33 | 33 | * cleanup |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | * @param string _position may be: {first|last|next|previous|somenumber} |
43 | 43 | * @return bool |
44 | 44 | */ |
45 | - public function get_record( $_position = 'next' ); |
|
45 | + public function get_record($_position = 'next'); |
|
46 | 46 | |
47 | 47 | /** |
48 | 48 | * Retruns total number of records for the open resource. |
@@ -30,39 +30,39 @@ discard block |
||
30 | 30 | * @param DOMElement $_node |
31 | 31 | * @return string XML string |
32 | 32 | */ |
33 | - public static function array2xml ( $_data, $_name = 'root', $_node=null ) { |
|
33 | + public static function array2xml($_data, $_name = 'root', $_node = null) { |
|
34 | 34 | $returnXML = false; |
35 | - if ( $_node === null ) { |
|
36 | - $_node = new DOMDocument( '1.0', 'utf-8' ); |
|
35 | + if ($_node === null) { |
|
36 | + $_node = new DOMDocument('1.0', 'utf-8'); |
|
37 | 37 | $_node->formatOutput = true; |
38 | 38 | $returnXML = true; |
39 | 39 | } |
40 | 40 | |
41 | - $datatype = gettype( $_data ); |
|
42 | - switch ( $datatype ) { |
|
41 | + $datatype = gettype($_data); |
|
42 | + switch ($datatype) { |
|
43 | 43 | case 'array' : |
44 | - $subnode = new DOMElement( 'entry' ); |
|
45 | - $_node->appendChild( $subnode ); |
|
46 | - $subnode->setAttribute( 'type', $datatype ); |
|
47 | - $subnode->setAttribute( 'name' , $_name ); |
|
44 | + $subnode = new DOMElement('entry'); |
|
45 | + $_node->appendChild($subnode); |
|
46 | + $subnode->setAttribute('type', $datatype); |
|
47 | + $subnode->setAttribute('name', $_name); |
|
48 | 48 | |
49 | - foreach ( $_data as $ikey => $ivalue ) { |
|
50 | - self::array2xml( $ivalue, $ikey, $subnode ); |
|
49 | + foreach ($_data as $ikey => $ivalue) { |
|
50 | + self::array2xml($ivalue, $ikey, $subnode); |
|
51 | 51 | } |
52 | 52 | break; |
53 | 53 | |
54 | 54 | default : |
55 | - switch ( $datatype ) { |
|
55 | + switch ($datatype) { |
|
56 | 56 | case 'boolean' : |
57 | 57 | $data = $_data !== false ? 'TRUE' : 'FALSE'; |
58 | 58 | break; |
59 | 59 | default: |
60 | 60 | $data = &$_data; |
61 | 61 | } |
62 | - $subnode = new DOMElement( 'entry' , $data ); |
|
63 | - $_node->appendChild( $subnode ); |
|
64 | - $subnode->setAttribute( 'type', $datatype ); |
|
65 | - $subnode->setAttribute( 'name' , $_name ); |
|
62 | + $subnode = new DOMElement('entry', $data); |
|
63 | + $_node->appendChild($subnode); |
|
64 | + $subnode->setAttribute('type', $datatype); |
|
65 | + $subnode->setAttribute('name', $_name); |
|
66 | 66 | break; |
67 | 67 | } |
68 | 68 | return $returnXML ? $_node->saveXML() : ''; |
@@ -74,28 +74,28 @@ discard block |
||
74 | 74 | * @param string $_xml |
75 | 75 | * @return array |
76 | 76 | */ |
77 | - public static function xml2array( $_xml ) { |
|
78 | - if ( $_xml instanceof DOMElement ) { |
|
77 | + public static function xml2array($_xml) { |
|
78 | + if ($_xml instanceof DOMElement) { |
|
79 | 79 | $n = &$_xml; |
80 | 80 | } else { |
81 | 81 | $n = new DOMDocument; |
82 | 82 | $loaded = $n->loadXML($_xml); |
83 | - if(!$loaded) return array(); |
|
83 | + if (!$loaded) return array(); |
|
84 | 84 | } |
85 | 85 | $xml_array = array(); |
86 | 86 | |
87 | - foreach($n->childNodes as $nc) { |
|
87 | + foreach ($n->childNodes as $nc) { |
|
88 | 88 | |
89 | - if ( $nc->nodeType != XML_ELEMENT_NODE ) continue; |
|
89 | + if ($nc->nodeType != XML_ELEMENT_NODE) continue; |
|
90 | 90 | |
91 | 91 | $name = $nc->attributes->getNamedItem('name')->nodeValue; |
92 | 92 | $type = $nc->attributes->getNamedItem('type')->nodeValue; |
93 | 93 | |
94 | 94 | //echo $nc->nodeType. "(length ): ". $nc->nodeName. " => ". $nc->nodeValue. "; Attriubtes: name=$name, type=$type \n "; |
95 | - if( $nc->childNodes->length >= 2) { |
|
95 | + if ($nc->childNodes->length >= 2) { |
|
96 | 96 | $xml_array[$name] = self::xml2array($nc); |
97 | 97 | } else { |
98 | - switch ( $type ) { |
|
98 | + switch ($type) { |
|
99 | 99 | case 'boolean' : |
100 | 100 | $value = $nc->nodeValue == 'FALSE' ? false : true; |
101 | 101 | break; |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | * |
37 | 37 | * @param string $_identifier |
38 | 38 | */ |
39 | - public function __construct( $_identifier='' ); |
|
39 | + public function __construct($_identifier = ''); |
|
40 | 40 | |
41 | 41 | /** |
42 | 42 | * magic method to set attributes of record |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | * |
98 | 98 | * @return string identifier |
99 | 99 | */ |
100 | - public function save ( $_dst_identifier ); |
|
100 | + public function save($_dst_identifier); |
|
101 | 101 | |
102 | 102 | /** |
103 | 103 | * copys current record to record identified by $_dst_identifier |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | * @param string $_dst_identifier |
106 | 106 | * @return string dst_identifier |
107 | 107 | */ |
108 | - public function copy ( $_dst_identifier ); |
|
108 | + public function copy($_dst_identifier); |
|
109 | 109 | |
110 | 110 | /** |
111 | 111 | * moves current record to record identified by $_dst_identifier |
@@ -114,14 +114,14 @@ discard block |
||
114 | 114 | * @param string $_dst_identifier |
115 | 115 | * @return string dst_identifier |
116 | 116 | */ |
117 | - public function move ( $_dst_identifier ); |
|
117 | + public function move($_dst_identifier); |
|
118 | 118 | |
119 | 119 | /** |
120 | 120 | * delets current record from backend |
121 | 121 | * @return void |
122 | 122 | * |
123 | 123 | */ |
124 | - public function delete (); |
|
124 | + public function delete(); |
|
125 | 125 | |
126 | 126 | /** |
127 | 127 | * destructor |
@@ -29,23 +29,23 @@ discard block |
||
29 | 29 | |
30 | 30 | if (ini_get('session.save_handler') == 'files' && !is_writable(ini_get('session.save_path')) && is_dir('/tmp') && is_writable('/tmp')) |
31 | 31 | { |
32 | - ini_set('session.save_path','/tmp'); // regular users may have no rights to apache's session dir |
|
32 | + ini_set('session.save_path', '/tmp'); // regular users may have no rights to apache's session dir |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | // Include PEAR::Console_Getopt |
36 | 36 | require_once 'Console/Getopt.php'; |
37 | 37 | |
38 | 38 | // Define exit codes for errors |
39 | -define('HEADER_NOT_FOUND',9); |
|
40 | -define('NO_ARGS',10); |
|
41 | -define('INVALID_OPTION',11); |
|
39 | +define('HEADER_NOT_FOUND', 9); |
|
40 | +define('NO_ARGS', 10); |
|
41 | +define('INVALID_OPTION', 11); |
|
42 | 42 | |
43 | 43 | // Reading the incoming arguments - same as $argv |
44 | 44 | $args = Console_Getopt::readPHPArgv(); |
45 | 45 | |
46 | 46 | // Make sure we got them (for non CLI binaries) |
47 | 47 | if (PEAR::isError($args)) { |
48 | - fwrite(STDERR,"importexport_cli: ".$args->getMessage()."\n".$usage); |
|
48 | + fwrite(STDERR, "importexport_cli: ".$args->getMessage()."\n".$usage); |
|
49 | 49 | exit(NO_ARGS); |
50 | 50 | } |
51 | 51 | |
@@ -63,15 +63,15 @@ discard block |
||
63 | 63 | ); |
64 | 64 | |
65 | 65 | // Convert the arguments to options - check for the first argument |
66 | -if ( realpath($_SERVER['argv'][0]) == __FILE__ ) { |
|
67 | - $options = Console_Getopt::getOpt($args,$short_opts,$long_opts); |
|
66 | +if (realpath($_SERVER['argv'][0]) == __FILE__) { |
|
67 | + $options = Console_Getopt::getOpt($args, $short_opts, $long_opts); |
|
68 | 68 | } else { |
69 | - $options = Console_Getopt::getOpt2($args,$short_opts,$long_opts); |
|
69 | + $options = Console_Getopt::getOpt2($args, $short_opts, $long_opts); |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | // Check the options are valid |
73 | 73 | if (PEAR::isError($options)) { |
74 | - fwrite(STDERR,"importexport_cli: ".$options->getMessage()."\n".$usage."\n"); |
|
74 | + fwrite(STDERR, "importexport_cli: ".$options->getMessage()."\n".$usage."\n"); |
|
75 | 75 | exit(INVALID_OPTION); |
76 | 76 | } |
77 | 77 | |
@@ -98,13 +98,13 @@ discard block |
||
98 | 98 | $dryrun = true; |
99 | 99 | break; |
100 | 100 | default : |
101 | - fwrite (STDERR,$usage."\n"); |
|
101 | + fwrite(STDERR, $usage."\n"); |
|
102 | 102 | exit(INVALID_OPTION); |
103 | 103 | } |
104 | 104 | } |
105 | 105 | // check file |
106 | -if ( !$user || !$password ) { |
|
107 | - fwrite(STDERR,'importexport_cli: You have to supply a username / password'."\n".$usage); |
|
106 | +if (!$user || !$password) { |
|
107 | + fwrite(STDERR, 'importexport_cli: You have to supply a username / password'."\n".$usage); |
|
108 | 108 | exit(INVALID_OPTION); |
109 | 109 | } |
110 | 110 | |
@@ -117,12 +117,12 @@ discard block |
||
117 | 117 | 'nonavbar' => True, |
118 | 118 | 'currentapp' => 'importexport', |
119 | 119 | 'autocreate_session_callback' => 'import_export_access', |
120 | - 'login' => $user . '@' . $domain, |
|
120 | + 'login' => $user.'@'.$domain, |
|
121 | 121 | 'passwd' => $password, |
122 | 122 | ); |
123 | 123 | if (!is_readable($path_to_egroupware.'/header.inc.php')) |
124 | 124 | { |
125 | - fwrite(STDERR,"importexport.php: Could not find '$path_to_egroupware/header.inc.php', exiting !!!\n"); |
|
125 | + fwrite(STDERR, "importexport.php: Could not find '$path_to_egroupware/header.inc.php', exiting !!!\n"); |
|
126 | 126 | exit(HEADER_NOT_FOUND); |
127 | 127 | } |
128 | 128 | include($path_to_egroupware.'/header.inc.php'); |
@@ -130,13 +130,13 @@ discard block |
||
130 | 130 | // check file |
131 | 131 | if (!is_readable($file)) |
132 | 132 | { |
133 | - fwrite(STDERR,"importexport_cli: ". $file. ' is not readable'."\n"); |
|
133 | + fwrite(STDERR, "importexport_cli: ".$file.' is not readable'."\n"); |
|
134 | 134 | exit(INVALID_OPTION); |
135 | 135 | } |
136 | 136 | |
137 | 137 | $definition = new importexport_definition($definition); |
138 | -if( $definition->get_identifier() < 1 ) { |
|
139 | - fwrite(STDERR,"importexport_cli: Definition not found! \n"); |
|
138 | +if ($definition->get_identifier() < 1) { |
|
139 | + fwrite(STDERR, "importexport_cli: Definition not found! \n"); |
|
140 | 140 | exit(INVALID_OPTION); |
141 | 141 | } |
142 | 142 | |
@@ -147,8 +147,8 @@ discard block |
||
147 | 147 | |
148 | 148 | $po = new $definition->plugin; |
149 | 149 | |
150 | -$resource = fopen( $file, 'r' ); |
|
151 | -$po->$type( $resource, $definition ); |
|
150 | +$resource = fopen($file, 'r'); |
|
151 | +$po->$type($resource, $definition); |
|
152 | 152 | |
153 | 153 | exit(); |
154 | 154 |
@@ -12,9 +12,9 @@ discard block |
||
12 | 12 | $setup_info['admin']['name'] = 'admin'; |
13 | 13 | $setup_info['admin']['version'] = '16.1'; |
14 | 14 | $setup_info['admin']['app_order'] = 1; |
15 | -$setup_info['admin']['tables'] = array('egw_admin_queue','egw_admin_remote'); |
|
15 | +$setup_info['admin']['tables'] = array('egw_admin_queue', 'egw_admin_remote'); |
|
16 | 16 | $setup_info['admin']['enable'] = 1; |
17 | -$setup_info['admin']['index'] = 'admin.admin_ui.index&ajax=true'; |
|
17 | +$setup_info['admin']['index'] = 'admin.admin_ui.index&ajax=true'; |
|
18 | 18 | |
19 | 19 | $setup_info['admin']['author'][] = array( |
20 | 20 | 'name' => 'eGroupWare coreteam', |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | 'url' => 'www.egroupware.org' |
28 | 28 | ); |
29 | 29 | |
30 | -$setup_info['admin']['license'] = 'GPL'; |
|
30 | +$setup_info['admin']['license'] = 'GPL'; |
|
31 | 31 | $setup_info['admin']['description'] = 'EGroupware administration application'; |
32 | 32 | |
33 | 33 | /* The hooks this app includes, needed for hooks registration */ |
@@ -15,37 +15,37 @@ |
||
15 | 15 | $phpgw_baseline = array( |
16 | 16 | 'egw_admin_queue' => array( |
17 | 17 | 'fd' => array( |
18 | - 'cmd_id' => array('type' => 'auto','nullable' => False), |
|
19 | - 'cmd_uid' => array('type' => 'ascii','precision' => '64','nullable' => False), |
|
20 | - 'cmd_creator' => array('type' => 'int','meta' => 'user','precision' => '4','nullable' => False), |
|
21 | - 'cmd_creator_email' => array('type' => 'varchar','precision' => '128','nullable' => False), |
|
22 | - 'cmd_created' => array('type' => 'int','meta' => 'timestamp','precision' => '8','nullable' => False), |
|
23 | - 'cmd_type' => array('type' => 'ascii','precision' => '32','nullable' => False,'default' => 'admin_cmd'), |
|
24 | - 'cmd_status' => array('type' => 'int','precision' => '1'), |
|
25 | - 'cmd_scheduled' => array('type' => 'int','meta' => 'timestamp','precision' => '8'), |
|
26 | - 'cmd_modified' => array('type' => 'int','meta' => 'timestamp','precision' => '8'), |
|
27 | - 'cmd_modifier' => array('type' => 'int','meta' => 'user','precision' => '4'), |
|
28 | - 'cmd_modifier_email' => array('type' => 'varchar','precision' => '128'), |
|
29 | - 'cmd_error' => array('type' => 'varchar','precision' => '255'), |
|
30 | - 'cmd_errno' => array('type' => 'int','precision' => '4'), |
|
31 | - 'cmd_requested' => array('type' => 'int','precision' => '4'), |
|
32 | - 'cmd_requested_email' => array('type' => 'varchar','precision' => '128'), |
|
33 | - 'cmd_comment' => array('type' => 'varchar','precision' => '255'), |
|
34 | - 'cmd_data' => array('type' => 'ascii','precision' => '16384'), |
|
35 | - 'remote_id' => array('type' => 'int','precision' => '4') |
|
18 | + 'cmd_id' => array('type' => 'auto', 'nullable' => False), |
|
19 | + 'cmd_uid' => array('type' => 'ascii', 'precision' => '64', 'nullable' => False), |
|
20 | + 'cmd_creator' => array('type' => 'int', 'meta' => 'user', 'precision' => '4', 'nullable' => False), |
|
21 | + 'cmd_creator_email' => array('type' => 'varchar', 'precision' => '128', 'nullable' => False), |
|
22 | + 'cmd_created' => array('type' => 'int', 'meta' => 'timestamp', 'precision' => '8', 'nullable' => False), |
|
23 | + 'cmd_type' => array('type' => 'ascii', 'precision' => '32', 'nullable' => False, 'default' => 'admin_cmd'), |
|
24 | + 'cmd_status' => array('type' => 'int', 'precision' => '1'), |
|
25 | + 'cmd_scheduled' => array('type' => 'int', 'meta' => 'timestamp', 'precision' => '8'), |
|
26 | + 'cmd_modified' => array('type' => 'int', 'meta' => 'timestamp', 'precision' => '8'), |
|
27 | + 'cmd_modifier' => array('type' => 'int', 'meta' => 'user', 'precision' => '4'), |
|
28 | + 'cmd_modifier_email' => array('type' => 'varchar', 'precision' => '128'), |
|
29 | + 'cmd_error' => array('type' => 'varchar', 'precision' => '255'), |
|
30 | + 'cmd_errno' => array('type' => 'int', 'precision' => '4'), |
|
31 | + 'cmd_requested' => array('type' => 'int', 'precision' => '4'), |
|
32 | + 'cmd_requested_email' => array('type' => 'varchar', 'precision' => '128'), |
|
33 | + 'cmd_comment' => array('type' => 'varchar', 'precision' => '255'), |
|
34 | + 'cmd_data' => array('type' => 'ascii', 'precision' => '16384'), |
|
35 | + 'remote_id' => array('type' => 'int', 'precision' => '4') |
|
36 | 36 | ), |
37 | 37 | 'pk' => array('cmd_id'), |
38 | 38 | 'fk' => array(), |
39 | - 'ix' => array('cmd_status','cmd_scheduled'), |
|
39 | + 'ix' => array('cmd_status', 'cmd_scheduled'), |
|
40 | 40 | 'uc' => array('cmd_uid') |
41 | 41 | ), |
42 | 42 | 'egw_admin_remote' => array( |
43 | 43 | 'fd' => array( |
44 | - 'remote_id' => array('type' => 'auto','nullable' => False), |
|
45 | - 'remote_name' => array('type' => 'varchar','precision' => '64','nullable' => False), |
|
46 | - 'remote_hash' => array('type' => 'ascii','precision' => '32','nullable' => False), |
|
47 | - 'remote_url' => array('type' => 'ascii','precision' => '128','nullable' => False), |
|
48 | - 'remote_domain' => array('type' => 'ascii','precision' => '64','nullable' => False) |
|
44 | + 'remote_id' => array('type' => 'auto', 'nullable' => False), |
|
45 | + 'remote_name' => array('type' => 'varchar', 'precision' => '64', 'nullable' => False), |
|
46 | + 'remote_hash' => array('type' => 'ascii', 'precision' => '32', 'nullable' => False), |
|
47 | + 'remote_url' => array('type' => 'ascii', 'precision' => '128', 'nullable' => False), |
|
48 | + 'remote_domain' => array('type' => 'ascii', 'precision' => '64', 'nullable' => False) |
|
49 | 49 | ), |
50 | 50 | 'pk' => array('remote_id'), |
51 | 51 | 'fk' => array(), |