@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | { |
35 | 35 | if (isset($_GET['auth'])) |
36 | 36 | { |
37 | - list($_SERVER['PHP_AUTH_USER'],$_SERVER['PHP_AUTH_PW']) = explode(':',base64_decode($_GET['auth']),2); |
|
37 | + list($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']) = explode(':', base64_decode($_GET['auth']), 2); |
|
38 | 38 | } |
39 | 39 | return Api\Header\Authenticate::autocreate_session_callback($account); |
40 | 40 | } |
@@ -45,8 +45,8 @@ discard block |
||
45 | 45 | 'noheader' => True, |
46 | 46 | 'currentapp' => preg_match('|/webdav.php/apps/([A-Za-z0-9_-]+)/|', $_SERVER['REQUEST_URI'], $matches) ? $matches[1] : 'filemanager', |
47 | 47 | 'autocreate_session_callback' => 'check_access', |
48 | - 'no_exception_handler' => 'basic_auth', // we use a basic auth exception handler (sends exception message as basic auth realm) |
|
49 | - 'auth_realm' => 'EGroupware WebDAV server', // cant use Vfs\WebDAV::REALM as autoloading and include path not yet setup! |
|
48 | + 'no_exception_handler' => 'basic_auth', // we use a basic auth exception handler (sends exception message as basic auth realm) |
|
49 | + 'auth_realm' => 'EGroupware WebDAV server', // cant use Vfs\WebDAV::REALM as autoloading and include path not yet setup! |
|
50 | 50 | ) |
51 | 51 | ); |
52 | 52 | |
@@ -74,12 +74,12 @@ discard block |
||
74 | 74 | |
75 | 75 | // temporary mount ownCloud default /clientsync as /home/$user, if not explicitly mounted |
76 | 76 | // so ownCloud dir contains users home-dir by default |
77 | -if (strpos($_SERVER['REQUEST_URI'],'/webdav.php/clientsync') !== false && |
|
78 | - ($fstab=Vfs::mount()) && !isset($fstab['/clientsync'])) |
|
77 | +if (strpos($_SERVER['REQUEST_URI'], '/webdav.php/clientsync') !== false && |
|
78 | + ($fstab = Vfs::mount()) && !isset($fstab['/clientsync'])) |
|
79 | 79 | { |
80 | 80 | $is_root_backup = Vfs::$is_root; |
81 | 81 | Vfs::$is_root = true; |
82 | - $ok = Vfs::mount($url='vfs://default/home/$user', $clientsync='/clientsync', null, false); |
|
82 | + $ok = Vfs::mount($url = 'vfs://default/home/$user', $clientsync = '/clientsync', null, false); |
|
83 | 83 | Vfs::$is_root = $is_root_backup; |
84 | 84 | //error_log("mounting ownCloud default '$clientsync' as '$url' ".($ok ? 'successful' : 'failed!')); |
85 | 85 | } |
@@ -28,7 +28,7 @@ |
||
28 | 28 | * Create a session or if the user has no account return authenticate header and 401 Unauthorized |
29 | 29 | * |
30 | 30 | * @param array &$account |
31 | - * @return int session-id |
|
31 | + * @return string session-id |
|
32 | 32 | */ |
33 | 33 | function check_access(&$account) |
34 | 34 | { |
@@ -13,13 +13,13 @@ discard block |
||
13 | 13 | |
14 | 14 | if (!defined('TIMESHEET_APP')) |
15 | 15 | { |
16 | - define('TIMESHEET_APP','timesheet'); |
|
16 | + define('TIMESHEET_APP', 'timesheet'); |
|
17 | 17 | } |
18 | 18 | |
19 | 19 | $setup_info[TIMESHEET_APP]['name'] = TIMESHEET_APP; |
20 | 20 | $setup_info[TIMESHEET_APP]['version'] = '16.1'; |
21 | 21 | $setup_info[TIMESHEET_APP]['app_order'] = 5; |
22 | -$setup_info[TIMESHEET_APP]['tables'] = array('egw_timesheet','egw_timesheet_extra'); |
|
22 | +$setup_info[TIMESHEET_APP]['tables'] = array('egw_timesheet', 'egw_timesheet_extra'); |
|
23 | 23 | $setup_info[TIMESHEET_APP]['enable'] = 1; |
24 | 24 | $setup_info[TIMESHEET_APP]['index'] = 'timesheet.timesheet_ui.index&ajax=true'; |
25 | 25 | |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | 'name' => 'Ralf Becker', |
29 | 29 | 'email' => '[email protected]' |
30 | 30 | ); |
31 | -$setup_info[TIMESHEET_APP]['license'] = 'GPL'; |
|
31 | +$setup_info[TIMESHEET_APP]['license'] = 'GPL'; |
|
32 | 32 | $setup_info[TIMESHEET_APP]['description'] = |
33 | 33 | 'Tracking times and other activities for the Projectmanager.'; |
34 | 34 | $setup_info[TIMESHEET_APP]['note'] = |
@@ -50,5 +50,5 @@ |
||
50 | 50 | /* Dependencies for this app to work */ |
51 | 51 | $setup_info[TIMESHEET_APP]['depends'][] = array( |
52 | 52 | 'appname' => 'api', |
53 | - 'versions' => Array('16.1') |
|
53 | + 'versions' => array('16.1') |
|
54 | 54 | ); |
@@ -14,33 +14,33 @@ |
||
14 | 14 | $phpgw_baseline = array( |
15 | 15 | 'egw_timesheet' => array( |
16 | 16 | 'fd' => array( |
17 | - 'ts_id' => array('type' => 'auto','nullable' => False,'comment' => 'id of the timesheet entry'), |
|
18 | - 'ts_project' => array('type' => 'varchar','precision' => '255','comment' => 'project title'), |
|
19 | - 'ts_title' => array('type' => 'varchar','precision' => '255','nullable' => False,'comment' => 'title of the timesheet entry'), |
|
20 | - 'ts_description' => array('type' => 'varchar','precision' => '16384','comment' => 'description of the timesheet entry'), |
|
21 | - 'ts_start' => array('type' => 'int','meta' => 'timestamp','precision' => '8','nullable' => False,'comment' => 'timestamp of the startdate'), |
|
22 | - 'ts_duration' => array('type' => 'int','precision' => '8','nullable' => False,'default' => '0','comment' => 'duration of the timesheet-entry'), |
|
23 | - 'ts_quantity' => array('type' => 'float','precision' => '8','nullable' => False,'comment' => 'quantity'), |
|
24 | - 'ts_unitprice' => array('type' => 'float','precision' => '4','comment' => 'unitprice'), |
|
25 | - 'cat_id' => array('type' => 'int','meta' => 'category','precision' => '4','default' => '0','comment' => 'category'), |
|
26 | - 'ts_owner' => array('type' => 'int','meta' => 'user','precision' => '4','nullable' => False,'comment' => 'owner of the timesheet'), |
|
27 | - 'ts_modified' => array('type' => 'int','meta' => 'timestamp','precision' => '8','nullable' => False,'comment' => 'date modified ot the timesheet'), |
|
28 | - 'ts_modifier' => array('type' => 'int','meta' => 'user','precision' => '4','nullable' => False,'comment' => 'account id of the last modifier'), |
|
29 | - 'pl_id' => array('type' => 'int','precision' => '4','default' => '0','comment' => 'id of the linked project'), |
|
30 | - 'ts_status' => array('type' => 'int','precision' => '4','comment' => 'status of the timesheet-entry') |
|
17 | + 'ts_id' => array('type' => 'auto', 'nullable' => False, 'comment' => 'id of the timesheet entry'), |
|
18 | + 'ts_project' => array('type' => 'varchar', 'precision' => '255', 'comment' => 'project title'), |
|
19 | + 'ts_title' => array('type' => 'varchar', 'precision' => '255', 'nullable' => False, 'comment' => 'title of the timesheet entry'), |
|
20 | + 'ts_description' => array('type' => 'varchar', 'precision' => '16384', 'comment' => 'description of the timesheet entry'), |
|
21 | + 'ts_start' => array('type' => 'int', 'meta' => 'timestamp', 'precision' => '8', 'nullable' => False, 'comment' => 'timestamp of the startdate'), |
|
22 | + 'ts_duration' => array('type' => 'int', 'precision' => '8', 'nullable' => False, 'default' => '0', 'comment' => 'duration of the timesheet-entry'), |
|
23 | + 'ts_quantity' => array('type' => 'float', 'precision' => '8', 'nullable' => False, 'comment' => 'quantity'), |
|
24 | + 'ts_unitprice' => array('type' => 'float', 'precision' => '4', 'comment' => 'unitprice'), |
|
25 | + 'cat_id' => array('type' => 'int', 'meta' => 'category', 'precision' => '4', 'default' => '0', 'comment' => 'category'), |
|
26 | + 'ts_owner' => array('type' => 'int', 'meta' => 'user', 'precision' => '4', 'nullable' => False, 'comment' => 'owner of the timesheet'), |
|
27 | + 'ts_modified' => array('type' => 'int', 'meta' => 'timestamp', 'precision' => '8', 'nullable' => False, 'comment' => 'date modified ot the timesheet'), |
|
28 | + 'ts_modifier' => array('type' => 'int', 'meta' => 'user', 'precision' => '4', 'nullable' => False, 'comment' => 'account id of the last modifier'), |
|
29 | + 'pl_id' => array('type' => 'int', 'precision' => '4', 'default' => '0', 'comment' => 'id of the linked project'), |
|
30 | + 'ts_status' => array('type' => 'int', 'precision' => '4', 'comment' => 'status of the timesheet-entry') |
|
31 | 31 | ), |
32 | 32 | 'pk' => array('ts_id'), |
33 | 33 | 'fk' => array(), |
34 | - 'ix' => array('ts_project','ts_owner','ts_status'), |
|
34 | + 'ix' => array('ts_project', 'ts_owner', 'ts_status'), |
|
35 | 35 | 'uc' => array() |
36 | 36 | ), |
37 | 37 | 'egw_timesheet_extra' => array( |
38 | 38 | 'fd' => array( |
39 | - 'ts_id' => array('type' => 'int','precision' => '4','nullable' => False), |
|
40 | - 'ts_extra_name' => array('type' => 'varchar','meta' => 'cfname','precision' => '32','nullable' => False), |
|
41 | - 'ts_extra_value' => array('type' => 'varchar','meta' => 'cfvalue','precision' => '255','nullable' => False,'default' => '') |
|
39 | + 'ts_id' => array('type' => 'int', 'precision' => '4', 'nullable' => False), |
|
40 | + 'ts_extra_name' => array('type' => 'varchar', 'meta' => 'cfname', 'precision' => '32', 'nullable' => False), |
|
41 | + 'ts_extra_value' => array('type' => 'varchar', 'meta' => 'cfvalue', 'precision' => '255', 'nullable' => False, 'default' => '') |
|
42 | 42 | ), |
43 | - 'pk' => array('ts_id','ts_extra_name'), |
|
43 | + 'pk' => array('ts_id', 'ts_extra_name'), |
|
44 | 44 | 'fk' => array(), |
45 | 45 | 'ix' => array(), |
46 | 46 | 'uc' => array() |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | |
16 | 16 | function timesheet_upgrade0_1_001() |
17 | 17 | { |
18 | - $GLOBALS['egw_setup']->oProc->AddColumn('egw_timesheet','pl_id',array( |
|
18 | + $GLOBALS['egw_setup']->oProc->AddColumn('egw_timesheet', 'pl_id', array( |
|
19 | 19 | 'type' => 'int', |
20 | 20 | 'precision' => '4', |
21 | 21 | 'default' => '0' |
@@ -27,13 +27,13 @@ discard block |
||
27 | 27 | |
28 | 28 | function timesheet_upgrade0_2_001() |
29 | 29 | { |
30 | - $GLOBALS['egw_setup']->oProc->CreateTable('egw_timesheet_extra',array( |
|
30 | + $GLOBALS['egw_setup']->oProc->CreateTable('egw_timesheet_extra', array( |
|
31 | 31 | 'fd' => array( |
32 | - 'ts_id' => array('type' => 'int','precision' => '4','nullable' => False), |
|
33 | - 'ts_extra_name' => array('type' => 'varchar','precision' => '32','nullable' => False), |
|
34 | - 'ts_extra_value' => array('type' => 'varchar','precision' => '255','nullable' => False,'default' => '') |
|
32 | + 'ts_id' => array('type' => 'int', 'precision' => '4', 'nullable' => False), |
|
33 | + 'ts_extra_name' => array('type' => 'varchar', 'precision' => '32', 'nullable' => False), |
|
34 | + 'ts_extra_value' => array('type' => 'varchar', 'precision' => '255', 'nullable' => False, 'default' => '') |
|
35 | 35 | ), |
36 | - 'pk' => array('ts_id','ts_extra_name'), |
|
36 | + 'pk' => array('ts_id', 'ts_extra_name'), |
|
37 | 37 | 'fk' => array(), |
38 | 38 | 'ix' => array(), |
39 | 39 | 'uc' => array() |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | function timesheet_upgrade1_4() |
53 | 53 | { |
54 | 54 | // delete empty cf's generated by 1.4 |
55 | - $GLOBALS['egw_setup']->db->delete('egw_timesheet_extra',"ts_extra_value=''",__LINE__,__FILE__,'timesheet'); |
|
55 | + $GLOBALS['egw_setup']->db->delete('egw_timesheet_extra', "ts_extra_value=''", __LINE__, __FILE__, 'timesheet'); |
|
56 | 56 | |
57 | 57 | return $GLOBALS['setup_info']['timesheet']['currentver'] = '1.6'; |
58 | 58 | } |
@@ -60,12 +60,12 @@ discard block |
||
60 | 60 | |
61 | 61 | function timesheet_upgrade1_6() |
62 | 62 | { |
63 | - $GLOBALS['egw_setup']->oProc->AddColumn('egw_timesheet','ts_status',array( |
|
63 | + $GLOBALS['egw_setup']->oProc->AddColumn('egw_timesheet', 'ts_status', array( |
|
64 | 64 | 'type' => 'int', |
65 | 65 | 'precision' => '4' |
66 | 66 | )); |
67 | 67 | |
68 | - $GLOBALS['egw_setup']->oProc->CreateIndex('egw_timesheet','ts_status'); |
|
68 | + $GLOBALS['egw_setup']->oProc->CreateIndex('egw_timesheet', 'ts_status'); |
|
69 | 69 | |
70 | 70 | return $GLOBALS['setup_info']['timesheet']['currentver'] = '1.7.001'; |
71 | 71 | } |
@@ -92,12 +92,12 @@ discard block |
||
92 | 92 | */ |
93 | 93 | function timesheet_upgrade1_9_001() |
94 | 94 | { |
95 | - $GLOBALS['egw_setup']->oProc->AlterColumn('egw_timesheet','ts_project',array( |
|
95 | + $GLOBALS['egw_setup']->oProc->AlterColumn('egw_timesheet', 'ts_project', array( |
|
96 | 96 | 'type' => 'varchar', |
97 | 97 | 'precision' => '255', |
98 | 98 | 'comment' => 'project title' |
99 | 99 | )); |
100 | - $GLOBALS['egw_setup']->oProc->AlterColumn('egw_timesheet','ts_title',array( |
|
100 | + $GLOBALS['egw_setup']->oProc->AlterColumn('egw_timesheet', 'ts_title', array( |
|
101 | 101 | 'type' => 'varchar', |
102 | 102 | 'precision' => '255', |
103 | 103 | 'nullable' => False, |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | // returns NULL, if there are no rows! |
109 | 109 | if ((int)$max_description_length <= 16384 && $GLOBALS['egw_setup']->oProc->max_varchar_length >= 16384) |
110 | 110 | { |
111 | - $GLOBALS['egw_setup']->oProc->AlterColumn('egw_timesheet','ts_description',array( |
|
111 | + $GLOBALS['egw_setup']->oProc->AlterColumn('egw_timesheet', 'ts_description', array( |
|
112 | 112 | 'type' => 'varchar', |
113 | 113 | 'precision' => '16384', |
114 | 114 | 'comment' => 'description of the timesheet entry' |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | * @version $Id$ |
10 | 10 | */ |
11 | 11 | |
12 | -foreach(array( |
|
12 | +foreach (array( |
|
13 | 13 | 'history' => 'history', |
14 | 14 | ) as $name => $value) |
15 | 15 | { |
@@ -19,10 +19,10 @@ discard block |
||
19 | 19 | 'config_app' => 'timesheet', |
20 | 20 | 'config_name' => $name, |
21 | 21 | 'config_value' => $value, |
22 | - ),array( |
|
22 | + ), array( |
|
23 | 23 | 'config_app' => 'timesheet', |
24 | 24 | 'config_name' => $name, |
25 | - ),__LINE__,__FILE__ |
|
25 | + ), __LINE__, __FILE__ |
|
26 | 26 | ); |
27 | 27 | } |
28 | 28 |
@@ -43,14 +43,14 @@ discard block |
||
43 | 43 | } |
44 | 44 | if (!is_array($data_id)) |
45 | 45 | { |
46 | - if (!(int) $data_id || !($data = $GLOBALS['timesheet_bo']->read((int) $data_id))) |
|
46 | + if (!(int)$data_id || !($data = $GLOBALS['timesheet_bo']->read((int)$data_id))) |
|
47 | 47 | { |
48 | 48 | return false; |
49 | 49 | } |
50 | 50 | } |
51 | 51 | else |
52 | 52 | { |
53 | - $data =& $data_id; |
|
53 | + $data = & $data_id; |
|
54 | 54 | } |
55 | 55 | $ds = array( |
56 | 56 | 'pe_title' => $GLOBALS['timesheet_bo']->link_title($data), |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | ); |
67 | 67 | if ($data['ts_duration']) |
68 | 68 | { |
69 | - $ds['pe_real_end'] = $data['ts_start'] + 60*$data['ts_duration']; |
|
69 | + $ds['pe_real_end'] = $data['ts_start'] + 60 * $data['ts_duration']; |
|
70 | 70 | $ds['pe_used_time'] = $data['ts_duration']; |
71 | 71 | } |
72 | 72 | if ($this->debug) |
@@ -85,9 +85,9 @@ discard block |
||
85 | 85 | * @param array $extra =null data of target-project, atm not used by the infolog datasource |
86 | 86 | * @return array|boolean array(info_id,link_id) on success, false otherwise |
87 | 87 | */ |
88 | - function copy($element,$target,$extra=null) |
|
88 | + function copy($element, $target, $extra = null) |
|
89 | 89 | { |
90 | - unset($element,$target,$extra); // not used, but required by function signature |
|
90 | + unset($element, $target, $extra); // not used, but required by function signature |
|
91 | 91 | |
92 | 92 | return false; |
93 | 93 | } |
@@ -24,7 +24,7 @@ |
||
24 | 24 | // Custom fields |
25 | 25 | unset($this->export_fields['customfields']); |
26 | 26 | $custom = Api\Storage\Customfields::get('timesheet', true); |
27 | - foreach($custom as $name => $data) { |
|
27 | + foreach ($custom as $name => $data) { |
|
28 | 28 | $this->export_fields['#'.$name] = $data['label']; |
29 | 29 | } |
30 | 30 | } |
@@ -14,7 +14,8 @@ discard block |
||
14 | 14 | |
15 | 15 | class timesheet_wizard_export_csv extends importexport_wizard_basic_export_csv |
16 | 16 | { |
17 | - public function __construct() { |
|
17 | + public function __construct() |
|
18 | + { |
|
18 | 19 | parent::__construct(); |
19 | 20 | |
20 | 21 | // Field mapping |
@@ -24,7 +25,8 @@ discard block |
||
24 | 25 | // Custom fields |
25 | 26 | unset($this->export_fields['customfields']); |
26 | 27 | $custom = Api\Storage\Customfields::get('timesheet', true); |
27 | - foreach($custom as $name => $data) { |
|
28 | + foreach($custom as $name => $data) |
|
29 | + { |
|
28 | 30 | $this->export_fields['#'.$name] = $data['label']; |
29 | 31 | } |
30 | 32 | } |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | $context['appname'] = 'timesheet'; |
29 | 29 | |
30 | 30 | // Let parent handle the basic stuff |
31 | - parent::__construct($context,$need_reload); |
|
31 | + parent::__construct($context, $need_reload); |
|
32 | 32 | |
33 | 33 | $this->context['template'] = 'timesheet.index.rows'; |
34 | 34 | $this->nm_settings += array( |
@@ -42,24 +42,24 @@ discard block |
||
42 | 42 | ); |
43 | 43 | } |
44 | 44 | |
45 | - public function exec($id = null, Etemplate &$etemplate = null) |
|
45 | + public function exec($id = null, Etemplate&$etemplate = null) |
|
46 | 46 | { |
47 | 47 | $ui = new timesheet_ui(); |
48 | 48 | |
49 | 49 | $date_filters = array('All'); |
50 | - foreach(array_keys($ui->date_filters) as $name) |
|
50 | + foreach (array_keys($ui->date_filters) as $name) |
|
51 | 51 | { |
52 | 52 | $date_filters[$name] = $name; |
53 | 53 | } |
54 | 54 | $date_filters['custom'] = 'custom'; |
55 | 55 | $this->context['sel_options']['filter'] = $date_filters; |
56 | - $this->context['sel_options']['filter2'] = array('No details','Details'); |
|
56 | + $this->context['sel_options']['filter2'] = array('No details', 'Details'); |
|
57 | 57 | $read_grants = $ui->grant_list(Acl::READ); |
58 | 58 | $this->context['sel_options'] += array( |
59 | 59 | 'ts_owner' => $read_grants, |
60 | 60 | 'pm_id' => array(lang('No project')), |
61 | 61 | 'cat_id' => array(array('value' => '', 'label' => lang('all')), array('value' => 0, 'label'=>lang('None'))), |
62 | - 'ts_status' => $ui->status_labels+array(lang('No status')), |
|
62 | + 'ts_status' => $ui->status_labels + array(lang('No status')), |
|
63 | 63 | ); |
64 | 64 | $this->nm_settings['actions'] = $ui->get_actions($this->nm_settings); |
65 | 65 | |
@@ -112,29 +112,29 @@ discard block |
||
112 | 112 | if (!count($content['nm']['selected']) && !$content['nm']['select_all']) |
113 | 113 | { |
114 | 114 | $msg = lang('You need to select some entries first!'); |
115 | - Api\Json\Response::get()->apply('egw.message',array($msg,'error')); |
|
115 | + Api\Json\Response::get()->apply('egw.message', array($msg, 'error')); |
|
116 | 116 | } |
117 | 117 | else |
118 | 118 | { |
119 | 119 | $success = $failed = $action_msg = null; |
120 | - if ($ui->action($content['nm']['action'],$content['nm']['selected'],$content['nm']['select_all'], |
|
121 | - $success,$failed,$action_msg,'index',$msg)) |
|
120 | + if ($ui->action($content['nm']['action'], $content['nm']['selected'], $content['nm']['select_all'], |
|
121 | + $success, $failed, $action_msg, 'index', $msg)) |
|
122 | 122 | { |
123 | - $msg .= lang('%1 timesheets(s) %2',$success,$action_msg); |
|
123 | + $msg .= lang('%1 timesheets(s) %2', $success, $action_msg); |
|
124 | 124 | |
125 | - Api\Json\Response::get()->apply('egw.message',array($msg,'success')); |
|
126 | - foreach($content['nm']['selected'] as &$id) |
|
125 | + Api\Json\Response::get()->apply('egw.message', array($msg, 'success')); |
|
126 | + foreach ($content['nm']['selected'] as &$id) |
|
127 | 127 | { |
128 | 128 | $id = 'timesheet::'.$id; |
129 | 129 | } |
130 | 130 | // Directly request an update - this will get timesheet tab too |
131 | - Api\Json\Response::get()->apply('egw.dataRefreshUIDs',array($content['nm']['selected'])); |
|
131 | + Api\Json\Response::get()->apply('egw.dataRefreshUIDs', array($content['nm']['selected'])); |
|
132 | 132 | } |
133 | - elseif(empty($msg)) |
|
133 | + elseif (empty($msg)) |
|
134 | 134 | { |
135 | - $msg .= lang('%1 timesheets(s) %2, %3 failed because of insufficent rights !!!',$success,$action_msg,$failed); |
|
135 | + $msg .= lang('%1 timesheets(s) %2, %3 failed because of insufficent rights !!!', $success, $action_msg, $failed); |
|
136 | 136 | } |
137 | - Api\Json\Response::get()->apply('egw.message',array($msg,'error')); |
|
137 | + Api\Json\Response::get()->apply('egw.message', array($msg, 'error')); |
|
138 | 138 | } |
139 | 139 | } |
140 | 140 | } |
@@ -96,9 +96,12 @@ |
||
96 | 96 | |
97 | 97 | // This is just copy+pasted from timesheet_ui line 816, but we don't want |
98 | 98 | // the etemplate exec to fire again. |
99 | - if (is_array($content) && isset($content['nm']['rows']['document'])) // handle insert in default document button like an action |
|
99 | + if (is_array($content) && isset($content['nm']['rows']['document'])) |
|
100 | + { |
|
101 | + // handle insert in default document button like an action |
|
100 | 102 | { |
101 | 103 | list($id) = @each($content['nm']['rows']['document']); |
104 | + } |
|
102 | 105 | $content['nm']['action'] = 'document'; |
103 | 106 | $content['nm']['selected'] = array($id); |
104 | 107 | } |
@@ -23,7 +23,7 @@ |
||
23 | 23 | * Construct the portlet |
24 | 24 | * |
25 | 25 | */ |
26 | - public function __construct(Array &$context = array(), &$need_reload = false) |
|
26 | + public function __construct(array &$context = array(), &$need_reload = false) |
|
27 | 27 | { |
28 | 28 | $context['appname'] = 'timesheet'; |
29 | 29 |
@@ -92,8 +92,6 @@ |
||
92 | 92 | * Here we need to handle any incoming data. Setup is done in the constructor, |
93 | 93 | * output is handled by parent. |
94 | 94 | * |
95 | - * @param type $id |
|
96 | - * @param Etemplate $etemplate |
|
97 | 95 | */ |
98 | 96 | public static function process($content = array()) |
99 | 97 | { |
@@ -35,9 +35,9 @@ discard block |
||
35 | 35 | $this->mapping_fields = array('ts_id' => lang('Timesheet ID')) + $bo->field2label; |
36 | 36 | |
37 | 37 | // These aren't in the list |
38 | - $this->mapping_fields += array( |
|
39 | - 'ts_modified' => lang('Modified'), |
|
40 | - ); |
|
38 | + $this->mapping_fields += array( |
|
39 | + 'ts_modified' => lang('Modified'), |
|
40 | + ); |
|
41 | 41 | |
42 | 42 | // List each custom field |
43 | 43 | unset($this->mapping_fields['customfields']); |
@@ -113,9 +113,9 @@ discard block |
||
113 | 113 | ); |
114 | 114 | } |
115 | 115 | $sel_options = array( |
116 | - 'translate_status' => $options + array($set_to => $ui->status_labels), |
|
117 | - 'translate_cat_id' => $options + array($set_to => $cat_list), |
|
118 | - ); |
|
116 | + 'translate_status' => $options + array($set_to => $ui->status_labels), |
|
117 | + 'translate_cat_id' => $options + array($set_to => $cat_list), |
|
118 | + ); |
|
119 | 119 | $preserv = $content; |
120 | 120 | foreach($sel_options as $field => $options) { |
121 | 121 | if(!array_key_exists($field,$content)) $content[$field] = $content['plugin_options'][$field]; |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | // List each custom field |
43 | 43 | unset($this->mapping_fields['customfields']); |
44 | 44 | $custom = Api\Storage\Customfields::get('timesheet'); |
45 | - foreach($custom as $name => $data) { |
|
45 | + foreach ($custom as $name => $data) { |
|
46 | 46 | $this->mapping_fields['#'.$name] = $data['label']; |
47 | 47 | } |
48 | 48 | |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | |
73 | 73 | function wizard_step45(&$content, &$sel_options, &$readonlys, &$preserv) |
74 | 74 | { |
75 | - if($this->debug) error_log(__METHOD__.'->$content '.print_r($content,true)); |
|
75 | + if ($this->debug) error_log(__METHOD__.'->$content '.print_r($content, true)); |
|
76 | 76 | |
77 | 77 | // return from step45 |
78 | 78 | if ($content['step'] == 'wizard_step45') |
@@ -80,13 +80,13 @@ discard block |
||
80 | 80 | switch (array_search('pressed', $content['button'])) |
81 | 81 | { |
82 | 82 | case 'next': |
83 | - return $GLOBALS['egw']->importexport_definitions_ui->get_step($content['step'],1); |
|
83 | + return $GLOBALS['egw']->importexport_definitions_ui->get_step($content['step'], 1); |
|
84 | 84 | case 'previous' : |
85 | - return $GLOBALS['egw']->importexport_definitions_ui->get_step($content['step'],-1); |
|
85 | + return $GLOBALS['egw']->importexport_definitions_ui->get_step($content['step'], -1); |
|
86 | 86 | case 'finish': |
87 | 87 | return 'wizard_finish'; |
88 | 88 | default : |
89 | - return $this->wizard_step45($content,$sel_options,$readonlys,$preserv); |
|
89 | + return $this->wizard_step45($content, $sel_options, $readonlys, $preserv); |
|
90 | 90 | } |
91 | 91 | } |
92 | 92 | // init step45 |
@@ -101,11 +101,11 @@ discard block |
||
101 | 101 | '~skip~' => lang('Skip record'), |
102 | 102 | 'add' => lang('Add'), |
103 | 103 | ); |
104 | - $set_to = lang('Set to') . ':'; |
|
105 | - $categories = new Api\Categories('','timesheet'); |
|
104 | + $set_to = lang('Set to').':'; |
|
105 | + $categories = new Api\Categories('', 'timesheet'); |
|
106 | 106 | $cat_list = array(); |
107 | - foreach((array)$categories->return_sorted_array(0,False,'','','',true) as $cat) { |
|
108 | - $s = str_repeat(' ',$cat['level']) . stripslashes($cat['name']); |
|
107 | + foreach ((array)$categories->return_sorted_array(0, False, '', '', '', true) as $cat) { |
|
108 | + $s = str_repeat(' ', $cat['level']).stripslashes($cat['name']); |
|
109 | 109 | |
110 | 110 | $cat_list[$cat['id']] = empty($cat['description']) ? $s : array( |
111 | 111 | 'label' => $s, |
@@ -117,8 +117,8 @@ discard block |
||
117 | 117 | 'translate_cat_id' => $options + array($set_to => $cat_list), |
118 | 118 | ); |
119 | 119 | $preserv = $content; |
120 | - foreach($sel_options as $field => $options) { |
|
121 | - if(!array_key_exists($field,$content)) $content[$field] = $content['plugin_options'][$field]; |
|
120 | + foreach ($sel_options as $field => $options) { |
|
121 | + if (!array_key_exists($field, $content)) $content[$field] = $content['plugin_options'][$field]; |
|
122 | 122 | } |
123 | 123 | unset ($preserv['button']); |
124 | 124 | return $this->step_templates['wizard_step45']; |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | |
135 | 135 | function wizard_step60(&$content, &$sel_options, &$readonlys, &$preserv) |
136 | 136 | { |
137 | - if($this->debug) error_log(__METHOD__.'->$content '.print_r($content,true)); |
|
137 | + if ($this->debug) error_log(__METHOD__.'->$content '.print_r($content, true)); |
|
138 | 138 | unset($content['no_owner_map']); |
139 | 139 | |
140 | 140 | // return from step60 |
@@ -143,13 +143,13 @@ discard block |
||
143 | 143 | switch (array_search('pressed', $content['button'])) |
144 | 144 | { |
145 | 145 | case 'next': |
146 | - return $GLOBALS['egw']->importexport_definitions_ui->get_step($content['step'],1); |
|
146 | + return $GLOBALS['egw']->importexport_definitions_ui->get_step($content['step'], 1); |
|
147 | 147 | case 'previous' : |
148 | - return $GLOBALS['egw']->importexport_definitions_ui->get_step($content['step'],-1); |
|
148 | + return $GLOBALS['egw']->importexport_definitions_ui->get_step($content['step'], -1); |
|
149 | 149 | case 'finish': |
150 | 150 | return 'wizard_finish'; |
151 | 151 | default : |
152 | - return $this->wizard_step60($content,$sel_options,$readonlys,$preserv); |
|
152 | + return $this->wizard_step60($content, $sel_options, $readonlys, $preserv); |
|
153 | 153 | } |
154 | 154 | } |
155 | 155 | // init step60 |
@@ -158,17 +158,17 @@ discard block |
||
158 | 158 | $content['msg'] = $this->steps['wizard_step60']; |
159 | 159 | $content['step'] = 'wizard_step60'; |
160 | 160 | $preserv = $content; |
161 | - if(!array_key_exists($content['record_owner']) && $content['plugin_options']) { |
|
161 | + if (!array_key_exists($content['record_owner']) && $content['plugin_options']) { |
|
162 | 162 | $content['record_owner'] = $content['plugin_options']['record_owner']; |
163 | 163 | } |
164 | - if(!array_key_exists($content['owner_from_csv']) && $content['plugin_options']) { |
|
164 | + if (!array_key_exists($content['owner_from_csv']) && $content['plugin_options']) { |
|
165 | 165 | $content['owner_from_csv'] = $content['plugin_options']['owner_from_csv']; |
166 | 166 | } |
167 | - if(!array_key_exists($content['change_owner']) && $content['plugin_options']) { |
|
167 | + if (!array_key_exists($content['change_owner']) && $content['plugin_options']) { |
|
168 | 168 | $content['change_owner'] = $content['plugin_options']['change_owner']; |
169 | 169 | } |
170 | 170 | |
171 | - if(!in_array('ts_owner', $content['field_mapping'])) { |
|
171 | + if (!in_array('ts_owner', $content['field_mapping'])) { |
|
172 | 172 | $content['no_owner_map'] = true; |
173 | 173 | } |
174 | 174 |
@@ -42,7 +42,8 @@ discard block |
||
42 | 42 | // List each custom field |
43 | 43 | unset($this->mapping_fields['customfields']); |
44 | 44 | $custom = Api\Storage\Customfields::get('timesheet'); |
45 | - foreach($custom as $name => $data) { |
|
45 | + foreach($custom as $name => $data) |
|
46 | + { |
|
46 | 47 | $this->mapping_fields['#'.$name] = $data['label']; |
47 | 48 | } |
48 | 49 | |
@@ -72,7 +73,10 @@ discard block |
||
72 | 73 | |
73 | 74 | function wizard_step45(&$content, &$sel_options, &$readonlys, &$preserv) |
74 | 75 | { |
75 | - if($this->debug) error_log(__METHOD__.'->$content '.print_r($content,true)); |
|
76 | + if($this->debug) |
|
77 | + { |
|
78 | + error_log(__METHOD__.'->$content '.print_r($content,true)); |
|
79 | + } |
|
76 | 80 | |
77 | 81 | // return from step45 |
78 | 82 | if ($content['step'] == 'wizard_step45') |
@@ -104,7 +108,8 @@ discard block |
||
104 | 108 | $set_to = lang('Set to') . ':'; |
105 | 109 | $categories = new Api\Categories('','timesheet'); |
106 | 110 | $cat_list = array(); |
107 | - foreach((array)$categories->return_sorted_array(0,False,'','','',true) as $cat) { |
|
111 | + foreach((array)$categories->return_sorted_array(0,False,'','','',true) as $cat) |
|
112 | + { |
|
108 | 113 | $s = str_repeat(' ',$cat['level']) . stripslashes($cat['name']); |
109 | 114 | |
110 | 115 | $cat_list[$cat['id']] = empty($cat['description']) ? $s : array( |
@@ -117,8 +122,12 @@ discard block |
||
117 | 122 | 'translate_cat_id' => $options + array($set_to => $cat_list), |
118 | 123 | ); |
119 | 124 | $preserv = $content; |
120 | - foreach($sel_options as $field => $options) { |
|
121 | - if(!array_key_exists($field,$content)) $content[$field] = $content['plugin_options'][$field]; |
|
125 | + foreach($sel_options as $field => $options) |
|
126 | + { |
|
127 | + if(!array_key_exists($field,$content)) |
|
128 | + { |
|
129 | + $content[$field] = $content['plugin_options'][$field]; |
|
130 | + } |
|
122 | 131 | } |
123 | 132 | unset ($preserv['button']); |
124 | 133 | return $this->step_templates['wizard_step45']; |
@@ -134,7 +143,10 @@ discard block |
||
134 | 143 | |
135 | 144 | function wizard_step60(&$content, &$sel_options, &$readonlys, &$preserv) |
136 | 145 | { |
137 | - if($this->debug) error_log(__METHOD__.'->$content '.print_r($content,true)); |
|
146 | + if($this->debug) |
|
147 | + { |
|
148 | + error_log(__METHOD__.'->$content '.print_r($content,true)); |
|
149 | + } |
|
138 | 150 | unset($content['no_owner_map']); |
139 | 151 | |
140 | 152 | // return from step60 |
@@ -158,17 +170,21 @@ discard block |
||
158 | 170 | $content['msg'] = $this->steps['wizard_step60']; |
159 | 171 | $content['step'] = 'wizard_step60'; |
160 | 172 | $preserv = $content; |
161 | - if(!array_key_exists($content['record_owner']) && $content['plugin_options']) { |
|
173 | + if(!array_key_exists($content['record_owner']) && $content['plugin_options']) |
|
174 | + { |
|
162 | 175 | $content['record_owner'] = $content['plugin_options']['record_owner']; |
163 | 176 | } |
164 | - if(!array_key_exists($content['owner_from_csv']) && $content['plugin_options']) { |
|
177 | + if(!array_key_exists($content['owner_from_csv']) && $content['plugin_options']) |
|
178 | + { |
|
165 | 179 | $content['owner_from_csv'] = $content['plugin_options']['owner_from_csv']; |
166 | 180 | } |
167 | - if(!array_key_exists($content['change_owner']) && $content['plugin_options']) { |
|
181 | + if(!array_key_exists($content['change_owner']) && $content['plugin_options']) |
|
182 | + { |
|
168 | 183 | $content['change_owner'] = $content['plugin_options']['change_owner']; |
169 | 184 | } |
170 | 185 | |
171 | - if(!in_array('ts_owner', $content['field_mapping'])) { |
|
186 | + if(!in_array('ts_owner', $content['field_mapping'])) |
|
187 | + { |
|
172 | 188 | $content['no_owner_map'] = true; |
173 | 189 | } |
174 | 190 |