@@ -11,4 +11,4 @@ |
||
11 | 11 | * @version $Id$ |
12 | 12 | */ |
13 | 13 | header('Location: ../index.php?menuaction=mail.mail_ui.index'. |
14 | - (isset($_GET['sessionid']) ? '&sessionid='.$_GET['sessionid'].'&kp3='.$_GET['kp3'] : '')); |
|
14 | + (isset($_GET['sessionid']) ? '&sessionid='.$_GET['sessionid'].'&kp3='.$_GET['kp3'] : '')); |
@@ -32,11 +32,11 @@ discard block |
||
32 | 32 | } |
33 | 33 | if ($args[0] == '-c') |
34 | 34 | { |
35 | - $color = explode(',',$args[1]); |
|
35 | + $color = explode(',', $args[1]); |
|
36 | 36 | array_shift($args); |
37 | 37 | array_shift($args); |
38 | 38 | } |
39 | -foreach($args as $path) |
|
39 | +foreach ($args as $path) |
|
40 | 40 | { |
41 | 41 | if (!preg_match('|^([^/]+)/.*/(.*).svg$|', $path, $matches) || !($svg = file_get_contents($path))) |
42 | 42 | { |
@@ -53,11 +53,11 @@ discard block |
||
53 | 53 | $svg = preg_replace('/(<svg.*) id="[^"]+"/', '\\1 id="'.$id.'"', $svg); |
54 | 54 | |
55 | 55 | // Replace fill color with color[0] |
56 | - $svg = preg_replace('/(<.*) fill="[^"]*"/','\\1 fill="'.$color[0] .'"', $svg); |
|
56 | + $svg = preg_replace('/(<.*) fill="[^"]*"/', '\\1 fill="'.$color[0].'"', $svg); |
|
57 | 57 | // Replace stroke color with color[1] |
58 | - $svg = preg_replace('/(<.*) stroke="[^"]*"/', '\\1 stroke="'.$color[1] .'"', $svg); |
|
58 | + $svg = preg_replace('/(<.*) stroke="[^"]*"/', '\\1 stroke="'.$color[1].'"', $svg); |
|
59 | 59 | |
60 | - error_log(__METHOD__."svg: ". var_dump($svg)); |
|
60 | + error_log(__METHOD__."svg: ".var_dump($svg)); |
|
61 | 61 | // store image again |
62 | 62 | file_put_contents($path, $svg); |
63 | 63 | echo "$path: added $style_url and id=\"$id\"\n"; |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | array_pop($i_parts); |
70 | 70 | $rel_parts = $s_parts = explode('/', $stylesheet); |
71 | 71 | |
72 | - foreach($i_parts as $n => $i_part) |
|
72 | + foreach ($i_parts as $n => $i_part) |
|
73 | 73 | { |
74 | 74 | if (isset($s_parts[$n]) && $s_parts[$n] === $i_part) |
75 | 75 | { |
@@ -10,18 +10,24 @@ |
||
10 | 10 | * @version $Id$ |
11 | 11 | */ |
12 | 12 | |
13 | -if (php_sapi_name() !== 'cli') die("This is a commandline ONLY tool!\n"); |
|
13 | +if (php_sapi_name() !== 'cli') |
|
14 | +{ |
|
15 | + die("This is a commandline ONLY tool!\n"); |
|
16 | +} |
|
14 | 17 | |
15 | 18 | $args = $_SERVER['argv']; |
16 | 19 | $prog = array_shift($args); |
17 | 20 | |
18 | -if ($_SERVER['argc'] <= 1 || $prog != 'pixelegg/stylesheet2svg.php') die(" |
|
21 | +if ($_SERVER['argc'] <= 1 || $prog != 'pixelegg/stylesheet2svg.php') |
|
22 | +{ |
|
23 | + die(" |
|
19 | 24 | Usage: pixelegg/stylesheet2svg [-s stylesheet|-c color] svg-image(s) |
20 | 25 | Add an external stylesheet to an svg image and sets id of svg tag to app_image |
21 | 26 | Examples: |
22 | 27 | - pixelegg/stylesheet2svg -s pixelegg/less/svg.css */templates/pixelegg/images/*.svg pixelegg/images/*.svg |
23 | 28 | - pixelegg/stylesheet2svg -c '#6e6e6e,#939393' */templates/pixelegg/images/*.svg pixelegg/images/*.svg |
24 | 29 | \n"); |
30 | +} |
|
25 | 31 | |
26 | 32 | $stylesheet = 'pixelegg/less/svg.css'; |
27 | 33 | if ($args[0] == '-s') |
@@ -98,13 +98,13 @@ |
||
98 | 98 | } |
99 | 99 | |
100 | 100 | /** |
101 | - * generate the module content AND process submitted forms |
|
102 | - * Overridden from parent to pass arguments |
|
103 | - * |
|
104 | - * @param array &$arguments $arguments['arg1']-$arguments['arg3'] will be passed for non-submitted forms (first call) |
|
105 | - * @param array $properties |
|
106 | - * @return string the Api\Html content |
|
107 | - */ |
|
101 | + * generate the module content AND process submitted forms |
|
102 | + * Overridden from parent to pass arguments |
|
103 | + * |
|
104 | + * @param array &$arguments $arguments['arg1']-$arguments['arg3'] will be passed for non-submitted forms (first call) |
|
105 | + * @param array $properties |
|
106 | + * @return string the Api\Html content |
|
107 | + */ |
|
108 | 108 | function get_content(&$arguments,$properties) |
109 | 109 | { |
110 | 110 | list($app) = explode('.',$this->etemplate_method); |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | $categories = new Api\Categories('', 'resources'); |
27 | 27 | $cat_list = $categories->return_sorted_array(); |
28 | 28 | $cat_options = array(); |
29 | - foreach($cat_list as $category) |
|
29 | + foreach ($cat_list as $category) |
|
30 | 30 | { |
31 | 31 | $cat_options[$category['id']] = $category['name']; |
32 | 32 | } |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | 'email_message' => array( |
55 | 55 | 'type' => 'textarea', |
56 | 56 | 'large' => true, |
57 | - 'label' => lang('Confirmation email text').'<br />%1 = ' . lang('Event start').'<br/>%2 = link<br />%3 = '.lang('expiry'), |
|
57 | + 'label' => lang('Confirmation email text').'<br />%1 = '.lang('Event start').'<br/>%2 = link<br />%3 = '.lang('expiry'), |
|
58 | 58 | 'params' => array( |
59 | 59 | 'rows' => 8, |
60 | 60 | 'cols' => 110 |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | 'label' => lang('Confirmed addressbook.').' ('.lang('The anonymous user needs add rights for it!').')', |
66 | 66 | 'options' => array( |
67 | 67 | '' => lang('None'), |
68 | - )+registration_bo::get_allowed_addressbooks(registration_bo::CONFIRMED) |
|
68 | + ) + registration_bo::get_allowed_addressbooks(registration_bo::CONFIRMED) |
|
69 | 69 | ), |
70 | 70 | 'include_group' => array( |
71 | 71 | 'type' => 'select', |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | // Add resources from selected category |
91 | 91 | $bo = new resources_bo(); |
92 | 92 | $bo->get_rows($query, $list, $readonlys); |
93 | - foreach($list as $resource) |
|
93 | + foreach ($list as $resource) |
|
94 | 94 | { |
95 | 95 | $this->arguments['resource']['options'][$resource['res_id']] = $resource['name']; |
96 | 96 | } |
@@ -105,9 +105,9 @@ discard block |
||
105 | 105 | * @param array $properties |
106 | 106 | * @return string the Api\Html content |
107 | 107 | */ |
108 | - function get_content(&$arguments,$properties) |
|
108 | + function get_content(&$arguments, $properties) |
|
109 | 109 | { |
110 | - list($app) = explode('.',$this->etemplate_method); |
|
110 | + list($app) = explode('.', $this->etemplate_method); |
|
111 | 111 | Api\Translation::add_app($app); |
112 | 112 | |
113 | 113 | $extra = "<style type=\"text/css\">\n<!--\n@import url(".$GLOBALS['egw_info']['server']['webserver_url']. |
@@ -122,14 +122,14 @@ discard block |
||
122 | 122 | $extra .= "-->\n</style>\n"; |
123 | 123 | $extra .= '<script src="'.$GLOBALS['egw_info']['server']['webserver_url'].'/etemplate/js/etemplate.js" type="text/javascript"></script>'."\n"; |
124 | 124 | $ret = false; |
125 | - if($_POST['etemplate_exec_id']) |
|
125 | + if ($_POST['etemplate_exec_id']) |
|
126 | 126 | { |
127 | 127 | $ret = ExecMethod('etemplate.etemplate.process_exec'); |
128 | 128 | } |
129 | - if($_GET['date']) $arguments['date'] = strtotime($_GET['date']); |
|
129 | + if ($_GET['date']) $arguments['date'] = strtotime($_GET['date']); |
|
130 | 130 | $arguments['link'] = $this->link(); |
131 | 131 | $arguments['sitemgr_version'] = $this->block->version; |
132 | - return $extra.($ret ? $ret : ExecMethod2($this->etemplate_method,null,$arguments)); |
|
132 | + return $extra.($ret ? $ret : ExecMethod2($this->etemplate_method, null, $arguments)); |
|
133 | 133 | } |
134 | 134 | |
135 | 135 | } |
@@ -126,7 +126,10 @@ |
||
126 | 126 | { |
127 | 127 | $ret = ExecMethod('etemplate.etemplate.process_exec'); |
128 | 128 | } |
129 | - if($_GET['date']) $arguments['date'] = strtotime($_GET['date']); |
|
129 | + if($_GET['date']) |
|
130 | + { |
|
131 | + $arguments['date'] = strtotime($_GET['date']); |
|
132 | + } |
|
130 | 133 | $arguments['link'] = $this->link(); |
131 | 134 | $arguments['sitemgr_version'] = $this->block->version; |
132 | 135 | return $extra.($ret ? $ret : ExecMethod2($this->etemplate_method,null,$arguments)); |
@@ -14,26 +14,26 @@ discard block |
||
14 | 14 | $phpgw_baseline = array( |
15 | 15 | 'egw_resources' => array( |
16 | 16 | 'fd' => array( |
17 | - 'res_id' => array('type' => 'auto','nullable' => False), |
|
18 | - 'name' => array('type' => 'varchar','precision' => '100'), |
|
19 | - 'short_description' => array('type' => 'varchar','precision' => '100'), |
|
20 | - 'cat_id' => array('type' => 'int','meta' => 'category','precision' => '11','nullable' => False), |
|
21 | - 'quantity' => array('type' => 'int','precision' => '11','default' => '1'), |
|
22 | - 'useable' => array('type' => 'int','precision' => '11','default' => '1'), |
|
23 | - 'location' => array('type' => 'varchar','precision' => '100'), |
|
24 | - 'bookable' => array('type' => 'varchar','precision' => '1'), |
|
25 | - 'buyable' => array('type' => 'varchar','precision' => '1'), |
|
26 | - 'prize' => array('type' => 'varchar','precision' => '200'), |
|
17 | + 'res_id' => array('type' => 'auto', 'nullable' => False), |
|
18 | + 'name' => array('type' => 'varchar', 'precision' => '100'), |
|
19 | + 'short_description' => array('type' => 'varchar', 'precision' => '100'), |
|
20 | + 'cat_id' => array('type' => 'int', 'meta' => 'category', 'precision' => '11', 'nullable' => False), |
|
21 | + 'quantity' => array('type' => 'int', 'precision' => '11', 'default' => '1'), |
|
22 | + 'useable' => array('type' => 'int', 'precision' => '11', 'default' => '1'), |
|
23 | + 'location' => array('type' => 'varchar', 'precision' => '100'), |
|
24 | + 'bookable' => array('type' => 'varchar', 'precision' => '1'), |
|
25 | + 'buyable' => array('type' => 'varchar', 'precision' => '1'), |
|
26 | + 'prize' => array('type' => 'varchar', 'precision' => '200'), |
|
27 | 27 | 'long_description' => array('type' => 'longtext'), |
28 | - 'picture_src' => array('type' => 'varchar','precision' => '20'), |
|
29 | - 'accessory_of' => array('type' => 'int','precision' => '11','default' => '-1'), |
|
30 | - 'storage_info' => array('type' => 'varchar','precision' => '200'), |
|
31 | - 'inventory_number' => array('type' => 'varchar','precision' => '20'), |
|
32 | - 'deleted' => array('type' => 'int','meta' => 'timestamp','precision' => '8'), |
|
33 | - 'res_creator' => array('type' => 'int','meta' => 'user','precision' => '11'), |
|
34 | - 'res_created' => array('type' => 'int','meta' => 'timestamp','precision' => '8'), |
|
35 | - 'res_modifier' => array('type' => 'int','meta' => 'user','precision' => '11'), |
|
36 | - 'res_modified' => array('type' => 'int','meta' => 'timestamp','precision' => '8') |
|
28 | + 'picture_src' => array('type' => 'varchar', 'precision' => '20'), |
|
29 | + 'accessory_of' => array('type' => 'int', 'precision' => '11', 'default' => '-1'), |
|
30 | + 'storage_info' => array('type' => 'varchar', 'precision' => '200'), |
|
31 | + 'inventory_number' => array('type' => 'varchar', 'precision' => '20'), |
|
32 | + 'deleted' => array('type' => 'int', 'meta' => 'timestamp', 'precision' => '8'), |
|
33 | + 'res_creator' => array('type' => 'int', 'meta' => 'user', 'precision' => '11'), |
|
34 | + 'res_created' => array('type' => 'int', 'meta' => 'timestamp', 'precision' => '8'), |
|
35 | + 'res_modifier' => array('type' => 'int', 'meta' => 'user', 'precision' => '11'), |
|
36 | + 'res_modified' => array('type' => 'int', 'meta' => 'timestamp', 'precision' => '8') |
|
37 | 37 | ), |
38 | 38 | 'pk' => array('res_id'), |
39 | 39 | 'fk' => array(), |
@@ -42,12 +42,12 @@ discard block |
||
42 | 42 | ), |
43 | 43 | 'egw_resources_extra' => array( |
44 | 44 | 'fd' => array( |
45 | - 'extra_id' => array('type' => 'int','precision' => '4','nullable' => False), |
|
46 | - 'extra_name' => array('type' => 'varchar','meta' => 'cfname','precision' => '40','nullable' => False), |
|
47 | - 'extra_owner' => array('type' => 'int','meta' => 'account','precision' => '4','nullable' => False,'default' => '-1'), |
|
48 | - 'extra_value' => array('type' => 'varchar','meta' => 'cfvalue','precision' => '255','nullable' => False,'default' => '') |
|
45 | + 'extra_id' => array('type' => 'int', 'precision' => '4', 'nullable' => False), |
|
46 | + 'extra_name' => array('type' => 'varchar', 'meta' => 'cfname', 'precision' => '40', 'nullable' => False), |
|
47 | + 'extra_owner' => array('type' => 'int', 'meta' => 'account', 'precision' => '4', 'nullable' => False, 'default' => '-1'), |
|
48 | + 'extra_value' => array('type' => 'varchar', 'meta' => 'cfvalue', 'precision' => '255', 'nullable' => False, 'default' => '') |
|
49 | 49 | ), |
50 | - 'pk' => array('extra_id','extra_name','extra_owner'), |
|
50 | + 'pk' => array('extra_id', 'extra_name', 'extra_owner'), |
|
51 | 51 | 'fk' => array(), |
52 | 52 | 'ix' => array(), |
53 | 53 | 'uc' => array() |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | |
17 | 17 | function resources_upgrade0_0_1_008() |
18 | 18 | { |
19 | - $GLOBALS['phpgw_setup']->oProc->AddColumn('egw_resources','picture_src',array( |
|
19 | + $GLOBALS['phpgw_setup']->oProc->AddColumn('egw_resources', 'picture_src', array( |
|
20 | 20 | 'type' => 'varchar', |
21 | 21 | 'precision' => '20' |
22 | 22 | )); |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | |
29 | 29 | function resources_upgrade0_0_1_012() |
30 | 30 | { |
31 | - $GLOBALS['phpgw_setup']->oProc->AddColumn('egw_resources','picture_thumb',array( |
|
31 | + $GLOBALS['phpgw_setup']->oProc->AddColumn('egw_resources', 'picture_thumb', array( |
|
32 | 32 | 'type' => 'blob' |
33 | 33 | )); |
34 | 34 | |
@@ -39,49 +39,49 @@ discard block |
||
39 | 39 | |
40 | 40 | function resources_upgrade0_0_1_013() |
41 | 41 | { |
42 | - $GLOBALS['phpgw_setup']->oProc->DropColumn('egw_resources',array( |
|
42 | + $GLOBALS['phpgw_setup']->oProc->DropColumn('egw_resources', array( |
|
43 | 43 | 'fd' => array( |
44 | 44 | 'id' => array('type' => 'auto'), |
45 | - 'name' => array('type' => 'varchar','precision' => '100'), |
|
46 | - 'short_description' => array('type' => 'varchar','precision' => '100'), |
|
47 | - 'cat_id' => array('type' => 'int','precision' => '11','nullable' => False), |
|
48 | - 'quantity' => array('type' => 'int','precision' => '11'), |
|
49 | - 'useable' => array('type' => 'int','precision' => '11'), |
|
50 | - 'location' => array('type' => 'varchar','precision' => '100'), |
|
51 | - 'bookable' => array('type' => 'varchar','precision' => '1'), |
|
52 | - 'buyable' => array('type' => 'varchar','precision' => '1'), |
|
53 | - 'prize' => array('type' => 'varchar','precision' => '200'), |
|
45 | + 'name' => array('type' => 'varchar', 'precision' => '100'), |
|
46 | + 'short_description' => array('type' => 'varchar', 'precision' => '100'), |
|
47 | + 'cat_id' => array('type' => 'int', 'precision' => '11', 'nullable' => False), |
|
48 | + 'quantity' => array('type' => 'int', 'precision' => '11'), |
|
49 | + 'useable' => array('type' => 'int', 'precision' => '11'), |
|
50 | + 'location' => array('type' => 'varchar', 'precision' => '100'), |
|
51 | + 'bookable' => array('type' => 'varchar', 'precision' => '1'), |
|
52 | + 'buyable' => array('type' => 'varchar', 'precision' => '1'), |
|
53 | + 'prize' => array('type' => 'varchar', 'precision' => '200'), |
|
54 | 54 | 'long_description' => array('type' => 'longtext'), |
55 | - 'accessories' => array('type' => 'varchar','precision' => '50'), |
|
56 | - 'picture_src' => array('type' => 'varchar','precision' => '20'), |
|
55 | + 'accessories' => array('type' => 'varchar', 'precision' => '50'), |
|
56 | + 'picture_src' => array('type' => 'varchar', 'precision' => '20'), |
|
57 | 57 | 'picture_thumb' => array('type' => 'blob') |
58 | 58 | ), |
59 | 59 | 'pk' => array('id'), |
60 | 60 | 'fk' => array(), |
61 | 61 | 'ix' => array(), |
62 | 62 | 'uc' => array() |
63 | - ),'picture'); |
|
64 | - $GLOBALS['phpgw_setup']->oProc->DropColumn('egw_resources',array( |
|
63 | + ), 'picture'); |
|
64 | + $GLOBALS['phpgw_setup']->oProc->DropColumn('egw_resources', array( |
|
65 | 65 | 'fd' => array( |
66 | 66 | 'id' => array('type' => 'auto'), |
67 | - 'name' => array('type' => 'varchar','precision' => '100'), |
|
68 | - 'short_description' => array('type' => 'varchar','precision' => '100'), |
|
69 | - 'cat_id' => array('type' => 'int','precision' => '11','nullable' => False), |
|
70 | - 'quantity' => array('type' => 'int','precision' => '11'), |
|
71 | - 'useable' => array('type' => 'int','precision' => '11'), |
|
72 | - 'location' => array('type' => 'varchar','precision' => '100'), |
|
73 | - 'bookable' => array('type' => 'varchar','precision' => '1'), |
|
74 | - 'buyable' => array('type' => 'varchar','precision' => '1'), |
|
75 | - 'prize' => array('type' => 'varchar','precision' => '200'), |
|
67 | + 'name' => array('type' => 'varchar', 'precision' => '100'), |
|
68 | + 'short_description' => array('type' => 'varchar', 'precision' => '100'), |
|
69 | + 'cat_id' => array('type' => 'int', 'precision' => '11', 'nullable' => False), |
|
70 | + 'quantity' => array('type' => 'int', 'precision' => '11'), |
|
71 | + 'useable' => array('type' => 'int', 'precision' => '11'), |
|
72 | + 'location' => array('type' => 'varchar', 'precision' => '100'), |
|
73 | + 'bookable' => array('type' => 'varchar', 'precision' => '1'), |
|
74 | + 'buyable' => array('type' => 'varchar', 'precision' => '1'), |
|
75 | + 'prize' => array('type' => 'varchar', 'precision' => '200'), |
|
76 | 76 | 'long_description' => array('type' => 'longtext'), |
77 | - 'accessories' => array('type' => 'varchar','precision' => '50'), |
|
78 | - 'picture_src' => array('type' => 'varchar','precision' => '20') |
|
77 | + 'accessories' => array('type' => 'varchar', 'precision' => '50'), |
|
78 | + 'picture_src' => array('type' => 'varchar', 'precision' => '20') |
|
79 | 79 | ), |
80 | 80 | 'pk' => array('id'), |
81 | 81 | 'fk' => array(), |
82 | 82 | 'ix' => array(), |
83 | 83 | 'uc' => array() |
84 | - ),'picture_thumb'); |
|
84 | + ), 'picture_thumb'); |
|
85 | 85 | |
86 | 86 | $GLOBALS['setup_info']['resources']['currentver'] = '0.0.1.014'; |
87 | 87 | return $GLOBALS['setup_info']['resources']['currentver']; |
@@ -90,12 +90,12 @@ discard block |
||
90 | 90 | |
91 | 91 | function resources_upgrade0_0_1_014() |
92 | 92 | { |
93 | - $GLOBALS['phpgw_setup']->oProc->AlterColumn('egw_resources','quantity',array( |
|
93 | + $GLOBALS['phpgw_setup']->oProc->AlterColumn('egw_resources', 'quantity', array( |
|
94 | 94 | 'type' => 'int', |
95 | 95 | 'precision' => '11', |
96 | 96 | 'default' => '1' |
97 | 97 | )); |
98 | - $GLOBALS['phpgw_setup']->oProc->AlterColumn('egw_resources','useable',array( |
|
98 | + $GLOBALS['phpgw_setup']->oProc->AlterColumn('egw_resources', 'useable', array( |
|
99 | 99 | 'type' => 'int', |
100 | 100 | 'precision' => '11', |
101 | 101 | 'default' => '1' |
@@ -108,16 +108,16 @@ discard block |
||
108 | 108 | |
109 | 109 | function resources_upgrade0_0_1_015() |
110 | 110 | { |
111 | - $GLOBALS['phpgw_setup']->oProc->AlterColumn('egw_resources','accessories',array( |
|
111 | + $GLOBALS['phpgw_setup']->oProc->AlterColumn('egw_resources', 'accessories', array( |
|
112 | 112 | 'type' => 'varchar', |
113 | 113 | 'precision' => '100' |
114 | 114 | )); |
115 | - $GLOBALS['phpgw_setup']->oProc->AddColumn('egw_resources','accessory_only',array( |
|
115 | + $GLOBALS['phpgw_setup']->oProc->AddColumn('egw_resources', 'accessory_only', array( |
|
116 | 116 | 'type' => 'varchar', |
117 | 117 | 'precision' => '1', |
118 | 118 | 'default' => '0' |
119 | 119 | )); |
120 | - $GLOBALS['phpgw_setup']->oProc->AddColumn('egw_resources','relatives',array( |
|
120 | + $GLOBALS['phpgw_setup']->oProc->AddColumn('egw_resources', 'relatives', array( |
|
121 | 121 | 'type' => 'varchar', |
122 | 122 | 'precision' => '100' |
123 | 123 | )); |
@@ -129,70 +129,70 @@ discard block |
||
129 | 129 | |
130 | 130 | function resources_upgrade0_0_1_016() |
131 | 131 | { |
132 | - $GLOBALS['phpgw_setup']->oProc->DropColumn('egw_resources',array( |
|
132 | + $GLOBALS['phpgw_setup']->oProc->DropColumn('egw_resources', array( |
|
133 | 133 | 'fd' => array( |
134 | 134 | 'id' => array('type' => 'auto'), |
135 | - 'name' => array('type' => 'varchar','precision' => '100'), |
|
136 | - 'short_description' => array('type' => 'varchar','precision' => '100'), |
|
137 | - 'cat_id' => array('type' => 'int','precision' => '11','nullable' => False), |
|
138 | - 'quantity' => array('type' => 'int','precision' => '11','default' => '1'), |
|
139 | - 'useable' => array('type' => 'int','precision' => '11','default' => '1'), |
|
140 | - 'location' => array('type' => 'varchar','precision' => '100'), |
|
141 | - 'bookable' => array('type' => 'varchar','precision' => '1'), |
|
142 | - 'buyable' => array('type' => 'varchar','precision' => '1'), |
|
143 | - 'prize' => array('type' => 'varchar','precision' => '200'), |
|
135 | + 'name' => array('type' => 'varchar', 'precision' => '100'), |
|
136 | + 'short_description' => array('type' => 'varchar', 'precision' => '100'), |
|
137 | + 'cat_id' => array('type' => 'int', 'precision' => '11', 'nullable' => False), |
|
138 | + 'quantity' => array('type' => 'int', 'precision' => '11', 'default' => '1'), |
|
139 | + 'useable' => array('type' => 'int', 'precision' => '11', 'default' => '1'), |
|
140 | + 'location' => array('type' => 'varchar', 'precision' => '100'), |
|
141 | + 'bookable' => array('type' => 'varchar', 'precision' => '1'), |
|
142 | + 'buyable' => array('type' => 'varchar', 'precision' => '1'), |
|
143 | + 'prize' => array('type' => 'varchar', 'precision' => '200'), |
|
144 | 144 | 'long_description' => array('type' => 'longtext'), |
145 | - 'accessories' => array('type' => 'varchar','precision' => '100'), |
|
146 | - 'picture_src' => array('type' => 'varchar','precision' => '20'), |
|
147 | - 'relatives' => array('type' => 'varchar','precision' => '100') |
|
145 | + 'accessories' => array('type' => 'varchar', 'precision' => '100'), |
|
146 | + 'picture_src' => array('type' => 'varchar', 'precision' => '20'), |
|
147 | + 'relatives' => array('type' => 'varchar', 'precision' => '100') |
|
148 | 148 | ), |
149 | 149 | 'pk' => array('id'), |
150 | 150 | 'fk' => array(), |
151 | 151 | 'ix' => array(), |
152 | 152 | 'uc' => array() |
153 | - ),'accessory_only'); |
|
154 | - $GLOBALS['phpgw_setup']->oProc->DropColumn('egw_resources',array( |
|
153 | + ), 'accessory_only'); |
|
154 | + $GLOBALS['phpgw_setup']->oProc->DropColumn('egw_resources', array( |
|
155 | 155 | 'fd' => array( |
156 | 156 | 'id' => array('type' => 'auto'), |
157 | - 'name' => array('type' => 'varchar','precision' => '100'), |
|
158 | - 'short_description' => array('type' => 'varchar','precision' => '100'), |
|
159 | - 'cat_id' => array('type' => 'int','precision' => '11','nullable' => False), |
|
160 | - 'quantity' => array('type' => 'int','precision' => '11','default' => '1'), |
|
161 | - 'useable' => array('type' => 'int','precision' => '11','default' => '1'), |
|
162 | - 'location' => array('type' => 'varchar','precision' => '100'), |
|
163 | - 'bookable' => array('type' => 'varchar','precision' => '1'), |
|
164 | - 'buyable' => array('type' => 'varchar','precision' => '1'), |
|
165 | - 'prize' => array('type' => 'varchar','precision' => '200'), |
|
157 | + 'name' => array('type' => 'varchar', 'precision' => '100'), |
|
158 | + 'short_description' => array('type' => 'varchar', 'precision' => '100'), |
|
159 | + 'cat_id' => array('type' => 'int', 'precision' => '11', 'nullable' => False), |
|
160 | + 'quantity' => array('type' => 'int', 'precision' => '11', 'default' => '1'), |
|
161 | + 'useable' => array('type' => 'int', 'precision' => '11', 'default' => '1'), |
|
162 | + 'location' => array('type' => 'varchar', 'precision' => '100'), |
|
163 | + 'bookable' => array('type' => 'varchar', 'precision' => '1'), |
|
164 | + 'buyable' => array('type' => 'varchar', 'precision' => '1'), |
|
165 | + 'prize' => array('type' => 'varchar', 'precision' => '200'), |
|
166 | 166 | 'long_description' => array('type' => 'longtext'), |
167 | - 'accessories' => array('type' => 'varchar','precision' => '100'), |
|
168 | - 'picture_src' => array('type' => 'varchar','precision' => '20') |
|
167 | + 'accessories' => array('type' => 'varchar', 'precision' => '100'), |
|
168 | + 'picture_src' => array('type' => 'varchar', 'precision' => '20') |
|
169 | 169 | ), |
170 | 170 | 'pk' => array('id'), |
171 | 171 | 'fk' => array(), |
172 | 172 | 'ix' => array(), |
173 | 173 | 'uc' => array() |
174 | - ),'relatives'); |
|
175 | - $GLOBALS['phpgw_setup']->oProc->DropColumn('egw_resources',array( |
|
174 | + ), 'relatives'); |
|
175 | + $GLOBALS['phpgw_setup']->oProc->DropColumn('egw_resources', array( |
|
176 | 176 | 'fd' => array( |
177 | 177 | 'id' => array('type' => 'auto'), |
178 | - 'name' => array('type' => 'varchar','precision' => '100'), |
|
179 | - 'short_description' => array('type' => 'varchar','precision' => '100'), |
|
180 | - 'cat_id' => array('type' => 'int','precision' => '11','nullable' => False), |
|
181 | - 'quantity' => array('type' => 'int','precision' => '11','default' => '1'), |
|
182 | - 'useable' => array('type' => 'int','precision' => '11','default' => '1'), |
|
183 | - 'location' => array('type' => 'varchar','precision' => '100'), |
|
184 | - 'bookable' => array('type' => 'varchar','precision' => '1'), |
|
185 | - 'buyable' => array('type' => 'varchar','precision' => '1'), |
|
186 | - 'prize' => array('type' => 'varchar','precision' => '200'), |
|
178 | + 'name' => array('type' => 'varchar', 'precision' => '100'), |
|
179 | + 'short_description' => array('type' => 'varchar', 'precision' => '100'), |
|
180 | + 'cat_id' => array('type' => 'int', 'precision' => '11', 'nullable' => False), |
|
181 | + 'quantity' => array('type' => 'int', 'precision' => '11', 'default' => '1'), |
|
182 | + 'useable' => array('type' => 'int', 'precision' => '11', 'default' => '1'), |
|
183 | + 'location' => array('type' => 'varchar', 'precision' => '100'), |
|
184 | + 'bookable' => array('type' => 'varchar', 'precision' => '1'), |
|
185 | + 'buyable' => array('type' => 'varchar', 'precision' => '1'), |
|
186 | + 'prize' => array('type' => 'varchar', 'precision' => '200'), |
|
187 | 187 | 'long_description' => array('type' => 'longtext'), |
188 | - 'picture_src' => array('type' => 'varchar','precision' => '20') |
|
188 | + 'picture_src' => array('type' => 'varchar', 'precision' => '20') |
|
189 | 189 | ), |
190 | 190 | 'pk' => array('id'), |
191 | 191 | 'fk' => array(), |
192 | 192 | 'ix' => array(), |
193 | 193 | 'uc' => array() |
194 | - ),'accessories'); |
|
195 | - $GLOBALS['phpgw_setup']->oProc->AddColumn('egw_resources','accessory_of',array( |
|
194 | + ), 'accessories'); |
|
195 | + $GLOBALS['phpgw_setup']->oProc->AddColumn('egw_resources', 'accessory_of', array( |
|
196 | 196 | 'type' => 'int', |
197 | 197 | 'precision' => '11', |
198 | 198 | 'default' => '-1' |
@@ -204,22 +204,22 @@ discard block |
||
204 | 204 | |
205 | 205 | function resources_upgrade0_0_1_017() |
206 | 206 | { |
207 | - $GLOBALS['phpgw_setup']->oProc->RenameColumn('egw_resources','id','res_id'); |
|
208 | - $GLOBALS['phpgw_setup']->oProc->RefreshTable('egw_resources',array( |
|
207 | + $GLOBALS['phpgw_setup']->oProc->RenameColumn('egw_resources', 'id', 'res_id'); |
|
208 | + $GLOBALS['phpgw_setup']->oProc->RefreshTable('egw_resources', array( |
|
209 | 209 | 'fd' => array( |
210 | 210 | 'res_id' => array('type' => 'auto'), |
211 | - 'name' => array('type' => 'varchar','precision' => '100'), |
|
212 | - 'short_description' => array('type' => 'varchar','precision' => '100'), |
|
213 | - 'cat_id' => array('type' => 'int','precision' => '11','nullable' => False), |
|
214 | - 'quantity' => array('type' => 'int','precision' => '11','default' => '1'), |
|
215 | - 'useable' => array('type' => 'int','precision' => '11','default' => '1'), |
|
216 | - 'location' => array('type' => 'varchar','precision' => '100'), |
|
217 | - 'bookable' => array('type' => 'varchar','precision' => '1'), |
|
218 | - 'buyable' => array('type' => 'varchar','precision' => '1'), |
|
219 | - 'prize' => array('type' => 'varchar','precision' => '200'), |
|
211 | + 'name' => array('type' => 'varchar', 'precision' => '100'), |
|
212 | + 'short_description' => array('type' => 'varchar', 'precision' => '100'), |
|
213 | + 'cat_id' => array('type' => 'int', 'precision' => '11', 'nullable' => False), |
|
214 | + 'quantity' => array('type' => 'int', 'precision' => '11', 'default' => '1'), |
|
215 | + 'useable' => array('type' => 'int', 'precision' => '11', 'default' => '1'), |
|
216 | + 'location' => array('type' => 'varchar', 'precision' => '100'), |
|
217 | + 'bookable' => array('type' => 'varchar', 'precision' => '1'), |
|
218 | + 'buyable' => array('type' => 'varchar', 'precision' => '1'), |
|
219 | + 'prize' => array('type' => 'varchar', 'precision' => '200'), |
|
220 | 220 | 'long_description' => array('type' => 'longtext'), |
221 | - 'picture_src' => array('type' => 'varchar','precision' => '20'), |
|
222 | - 'accessory_of' => array('type' => 'int','precision' => '11','default' => '-1') |
|
221 | + 'picture_src' => array('type' => 'varchar', 'precision' => '20'), |
|
222 | + 'accessory_of' => array('type' => 'int', 'precision' => '11', 'default' => '-1') |
|
223 | 223 | ), |
224 | 224 | 'pk' => array('res_id'), |
225 | 225 | 'fk' => array(), |
@@ -234,7 +234,7 @@ discard block |
||
234 | 234 | |
235 | 235 | function resources_upgrade0_0_1_018() |
236 | 236 | { |
237 | - $GLOBALS['phpgw_setup']->oProc->AddColumn('egw_resources','storage_info',array( |
|
237 | + $GLOBALS['phpgw_setup']->oProc->AddColumn('egw_resources', 'storage_info', array( |
|
238 | 238 | 'type' => 'varchar', |
239 | 239 | 'precision' => '200' |
240 | 240 | )); |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | |
247 | 247 | function resources_upgrade0_0_1_019() |
248 | 248 | { |
249 | - $GLOBALS['phpgw_setup']->oProc->AddColumn('egw_resources','inventory_number',array( |
|
249 | + $GLOBALS['phpgw_setup']->oProc->AddColumn('egw_resources', 'inventory_number', array( |
|
250 | 250 | 'type' => 'varchar', |
251 | 251 | 'precision' => '20' |
252 | 252 | )); |
@@ -258,14 +258,14 @@ discard block |
||
258 | 258 | |
259 | 259 | function resources_upgrade0_0_1_020() |
260 | 260 | { |
261 | - $GLOBALS['egw_setup']->oProc->CreateTable('egw_resources_extra',array( |
|
261 | + $GLOBALS['egw_setup']->oProc->CreateTable('egw_resources_extra', array( |
|
262 | 262 | 'fd' => array( |
263 | - 'extra_id' => array('type' => 'int','precision' => '4','nullable' => False), |
|
264 | - 'extra_name' => array('type' => 'varchar','precision' => '40','nullable' => False), |
|
265 | - 'extra_owner' => array('type' => 'int','precision' => '4','nullable' => False,'default' => '-1'), |
|
266 | - 'extra_value' => array('type' => 'varchar','precision' => '255','nullable' => False,'default' => '') |
|
263 | + 'extra_id' => array('type' => 'int', 'precision' => '4', 'nullable' => False), |
|
264 | + 'extra_name' => array('type' => 'varchar', 'precision' => '40', 'nullable' => False), |
|
265 | + 'extra_owner' => array('type' => 'int', 'precision' => '4', 'nullable' => False, 'default' => '-1'), |
|
266 | + 'extra_value' => array('type' => 'varchar', 'precision' => '255', 'nullable' => False, 'default' => '') |
|
267 | 267 | ), |
268 | - 'pk' => array('extra_id','extra_name','extra_owner'), |
|
268 | + 'pk' => array('extra_id', 'extra_name', 'extra_owner'), |
|
269 | 269 | 'fk' => array(), |
270 | 270 | 'ix' => array(), |
271 | 271 | 'uc' => array() |
@@ -298,20 +298,20 @@ discard block |
||
298 | 298 | Vfs::load_wrapper('sqlfs'); |
299 | 299 | if (Vfs::is_dir('/resources/pictures')) |
300 | 300 | { |
301 | - Vfs::remove('/resources/pictures/thumbs'); // remove thumb dir incl. thumbnails |
|
302 | - foreach(Vfs::find('sqlfs://default/resources/pictures',array('url' => true)) as $url) |
|
301 | + Vfs::remove('/resources/pictures/thumbs'); // remove thumb dir incl. thumbnails |
|
302 | + foreach (Vfs::find('sqlfs://default/resources/pictures', array('url' => true)) as $url) |
|
303 | 303 | { |
304 | - if (is_numeric($id = basename($url,'.jpg'))) |
|
304 | + if (is_numeric($id = basename($url, '.jpg'))) |
|
305 | 305 | { |
306 | 306 | if (!Vfs::is_dir($dir = "/apps/resources/$id")) |
307 | 307 | { |
308 | - Vfs::mkdir($dir,0777,STREAM_MKDIR_RECURSIVE); |
|
308 | + Vfs::mkdir($dir, 0777, STREAM_MKDIR_RECURSIVE); |
|
309 | 309 | } |
310 | - rename($url,'sqlfs://default'.$dir.'/.picture.jpg'); // we need to rename on the same wrapper! |
|
310 | + rename($url, 'sqlfs://default'.$dir.'/.picture.jpg'); // we need to rename on the same wrapper! |
|
311 | 311 | } |
312 | 312 | } |
313 | - Vfs::rmdir('/resources/pictures',0); |
|
314 | - Vfs::rmdir('/resources',0); |
|
313 | + Vfs::rmdir('/resources/pictures', 0); |
|
314 | + Vfs::rmdir('/resources', 0); |
|
315 | 315 | } |
316 | 316 | return $GLOBALS['setup_info']['resources']['currentver'] = '1.6'; |
317 | 317 | } |
@@ -326,14 +326,14 @@ discard block |
||
326 | 326 | function resources_upgrade1_8() |
327 | 327 | { |
328 | 328 | // add location category required for CalDAV to distinguish between locations and resources |
329 | - $GLOBALS['egw_setup']->db->insert($GLOBALS['egw_setup']->cats_table,array('cat_parent' => 0, 'cat_owner' => Api\Categories::GLOBAL_ACCOUNT,'cat_access' => 'public','cat_appname' => 'resources','cat_name' => 'Locations','cat_description' => 'This category has been added by setup','last_mod' => time()),false,__LINE__,__FILE__); |
|
330 | - $locations_cat_id = $GLOBALS['egw_setup']->db->get_last_insert_id($GLOBALS['egw_setup']->cats_table,'cat_id'); |
|
329 | + $GLOBALS['egw_setup']->db->insert($GLOBALS['egw_setup']->cats_table, array('cat_parent' => 0, 'cat_owner' => Api\Categories::GLOBAL_ACCOUNT, 'cat_access' => 'public', 'cat_appname' => 'resources', 'cat_name' => 'Locations', 'cat_description' => 'This category has been added by setup', 'last_mod' => time()), false, __LINE__, __FILE__); |
|
330 | + $locations_cat_id = $GLOBALS['egw_setup']->db->get_last_insert_id($GLOBALS['egw_setup']->cats_table, 'cat_id'); |
|
331 | 331 | Api\Config::save_value('location_cats', $locations_cat_id, 'resources'); |
332 | 332 | |
333 | 333 | // Give default group all rights to this general cat |
334 | - $defaultgroup = $GLOBALS['egw_setup']->add_account('Default','Default','Group',False,False); |
|
335 | - $GLOBALS['egw_setup']->add_acl('resources','run',$defaultgroup); |
|
336 | - $GLOBALS['egw_setup']->add_acl('resources',"L$locations_cat_id",$defaultgroup,399); |
|
334 | + $defaultgroup = $GLOBALS['egw_setup']->add_account('Default', 'Default', 'Group', False, False); |
|
335 | + $GLOBALS['egw_setup']->add_acl('resources', 'run', $defaultgroup); |
|
336 | + $GLOBALS['egw_setup']->add_acl('resources', "L$locations_cat_id", $defaultgroup, 399); |
|
337 | 337 | |
338 | 338 | return $GLOBALS['setup_info']['resources']['currentver'] = '1.9.001'; |
339 | 339 | } |
@@ -341,7 +341,7 @@ discard block |
||
341 | 341 | |
342 | 342 | function resources_upgrade1_9_001() |
343 | 343 | { |
344 | - $GLOBALS['egw_setup']->oProc->AddColumn('egw_resources','deleted',array( |
|
344 | + $GLOBALS['egw_setup']->oProc->AddColumn('egw_resources', 'deleted', array( |
|
345 | 345 | 'type' => 'int', |
346 | 346 | 'precision' => '8' |
347 | 347 | )); |
@@ -358,22 +358,22 @@ discard block |
||
358 | 358 | |
359 | 359 | function resources_upgrade1_9_003() |
360 | 360 | { |
361 | - $GLOBALS['egw_setup']->oProc->AddColumn('egw_resources','res_creator',array( |
|
361 | + $GLOBALS['egw_setup']->oProc->AddColumn('egw_resources', 'res_creator', array( |
|
362 | 362 | 'type' => 'int', |
363 | 363 | 'meta' => 'user', |
364 | 364 | 'precision' => '11' |
365 | 365 | )); |
366 | - $GLOBALS['egw_setup']->oProc->AddColumn('egw_resources','res_created',array( |
|
366 | + $GLOBALS['egw_setup']->oProc->AddColumn('egw_resources', 'res_created', array( |
|
367 | 367 | 'type' => 'int', |
368 | 368 | 'meta' => 'timestamp', |
369 | 369 | 'precision' => '8' |
370 | 370 | )); |
371 | - $GLOBALS['egw_setup']->oProc->AddColumn('egw_resources','res_modifier',array( |
|
371 | + $GLOBALS['egw_setup']->oProc->AddColumn('egw_resources', 'res_modifier', array( |
|
372 | 372 | 'type' => 'int', |
373 | 373 | 'meta' => 'user', |
374 | 374 | 'precision' => '11' |
375 | 375 | )); |
376 | - $GLOBALS['egw_setup']->oProc->AddColumn('egw_resources','res_modified',array( |
|
376 | + $GLOBALS['egw_setup']->oProc->AddColumn('egw_resources', 'res_modified', array( |
|
377 | 377 | 'type' => 'int', |
378 | 378 | 'meta' => 'timestamp', |
379 | 379 | 'precision' => '8' |
@@ -333,7 +333,7 @@ |
||
333 | 333 | // Give default group all rights to this general cat |
334 | 334 | $defaultgroup = $GLOBALS['egw_setup']->add_account('Default','Default','Group',False,False); |
335 | 335 | $GLOBALS['egw_setup']->add_acl('resources','run',$defaultgroup); |
336 | - $GLOBALS['egw_setup']->add_acl('resources',"L$locations_cat_id",$defaultgroup,399); |
|
336 | + $GLOBALS['egw_setup']->add_acl('resources',"l$locations_cat_id",$defaultgroup,399); |
|
337 | 337 | |
338 | 338 | return $GLOBALS['setup_info']['resources']['currentver'] = '1.9.001'; |
339 | 339 | } |
@@ -14,26 +14,26 @@ discard block |
||
14 | 14 | $resources_table_prefix = 'egw_resources'; |
15 | 15 | |
16 | 16 | // Add a general category for resources |
17 | -$GLOBALS['egw_setup']->db->insert($GLOBALS['egw_setup']->cats_table,array('cat_parent' => 0, 'cat_owner' => Api\Categories::GLOBAL_ACCOUNT,'cat_access' => 'public','cat_appname' => 'resources','cat_name' => 'General resources','cat_description' => 'This category has been added by setup','last_mod' => time()),false,__LINE__,__FILE__); |
|
18 | -$cat_id = $GLOBALS['egw_setup']->db->get_last_insert_id($GLOBALS['egw_setup']->cats_table,'cat_id'); |
|
19 | -$GLOBALS['egw_setup']->db->insert($GLOBALS['egw_setup']->cats_table,array('cat_parent' => 0, 'cat_owner' => Api\Categories::GLOBAL_ACCOUNT,'cat_access' => 'public','cat_appname' => 'resources','cat_name' => 'Locations','cat_description' => 'This category has been added by setup','last_mod' => time()),false,__LINE__,__FILE__); |
|
20 | -$locations_cat_id = $GLOBALS['egw_setup']->db->get_last_insert_id($GLOBALS['egw_setup']->cats_table,'cat_id'); |
|
17 | +$GLOBALS['egw_setup']->db->insert($GLOBALS['egw_setup']->cats_table, array('cat_parent' => 0, 'cat_owner' => Api\Categories::GLOBAL_ACCOUNT, 'cat_access' => 'public', 'cat_appname' => 'resources', 'cat_name' => 'General resources', 'cat_description' => 'This category has been added by setup', 'last_mod' => time()), false, __LINE__, __FILE__); |
|
18 | +$cat_id = $GLOBALS['egw_setup']->db->get_last_insert_id($GLOBALS['egw_setup']->cats_table, 'cat_id'); |
|
19 | +$GLOBALS['egw_setup']->db->insert($GLOBALS['egw_setup']->cats_table, array('cat_parent' => 0, 'cat_owner' => Api\Categories::GLOBAL_ACCOUNT, 'cat_access' => 'public', 'cat_appname' => 'resources', 'cat_name' => 'Locations', 'cat_description' => 'This category has been added by setup', 'last_mod' => time()), false, __LINE__, __FILE__); |
|
20 | +$locations_cat_id = $GLOBALS['egw_setup']->db->get_last_insert_id($GLOBALS['egw_setup']->cats_table, 'cat_id'); |
|
21 | 21 | Api\Config::save_value('location_cats', $locations_cat_id, 'resources'); |
22 | 22 | |
23 | 23 | // Give default group all rights to this general cat |
24 | -$defaultgroup = $GLOBALS['egw_setup']->add_account('Default','Default','Group',False,False); |
|
25 | -$GLOBALS['egw_setup']->add_acl('resources','run',$defaultgroup); |
|
26 | -$GLOBALS['egw_setup']->add_acl('resources',"L$cat_id",$defaultgroup,399); |
|
27 | -$GLOBALS['egw_setup']->add_acl('resources',"L$locations_cat_id",$defaultgroup,399); |
|
24 | +$defaultgroup = $GLOBALS['egw_setup']->add_account('Default', 'Default', 'Group', False, False); |
|
25 | +$GLOBALS['egw_setup']->add_acl('resources', 'run', $defaultgroup); |
|
26 | +$GLOBALS['egw_setup']->add_acl('resources', "L$cat_id", $defaultgroup, 399); |
|
27 | +$GLOBALS['egw_setup']->add_acl('resources', "L$locations_cat_id", $defaultgroup, 399); |
|
28 | 28 | |
29 | 29 | // Add two rooms to give user an idea of what resources is... |
30 | 30 | $oProc->query("INSERT INTO {$resources_table_prefix} (name,cat_id,bookable,picture_src,accessory_of) VALUES ( 'Meeting room 1',$locations_cat_id,1,'cat_src',-1)"); |
31 | 31 | $oProc->query("INSERT INTO {$resources_table_prefix} (name,cat_id,bookable,picture_src,accessory_of) VALUES ( 'Meeting room 2',$locations_cat_id,1,'cat_src',-1)"); |
32 | -$res_id = $oProc->m_odb->get_last_insert_id($resources_table_prefix,'res_id'); |
|
32 | +$res_id = $oProc->m_odb->get_last_insert_id($resources_table_prefix, 'res_id'); |
|
33 | 33 | $oProc->query("INSERT INTO {$resources_table_prefix} (name,cat_id,bookable,picture_src,accessory_of) VALUES ( 'Fixed Beamer',$cat_id,0,'cat_src',$res_id)"); |
34 | 34 | |
35 | 35 | // Turn on history by default |
36 | -foreach(array( |
|
36 | +foreach (array( |
|
37 | 37 | 'history' => 'history', |
38 | 38 | ) as $name => $value) |
39 | 39 | { |
@@ -43,10 +43,10 @@ discard block |
||
43 | 43 | 'config_app' => 'resources', |
44 | 44 | 'config_name' => $name, |
45 | 45 | 'config_value' => $value, |
46 | - ),array( |
|
46 | + ), array( |
|
47 | 47 | 'config_app' => 'resources', |
48 | 48 | 'config_name' => $name, |
49 | - ),__LINE__,__FILE__ |
|
49 | + ), __LINE__, __FILE__ |
|
50 | 50 | ); |
51 | 51 | } |
52 | 52 |
@@ -23,8 +23,8 @@ |
||
23 | 23 | // Give default group all rights to this general cat |
24 | 24 | $defaultgroup = $GLOBALS['egw_setup']->add_account('Default','Default','Group',False,False); |
25 | 25 | $GLOBALS['egw_setup']->add_acl('resources','run',$defaultgroup); |
26 | -$GLOBALS['egw_setup']->add_acl('resources',"L$cat_id",$defaultgroup,399); |
|
27 | -$GLOBALS['egw_setup']->add_acl('resources',"L$locations_cat_id",$defaultgroup,399); |
|
26 | +$GLOBALS['egw_setup']->add_acl('resources',"l$cat_id",$defaultgroup,399); |
|
27 | +$GLOBALS['egw_setup']->add_acl('resources',"l$locations_cat_id",$defaultgroup,399); |
|
28 | 28 | |
29 | 29 | // Add two rooms to give user an idea of what resources is... |
30 | 30 | $oProc->query("INSERT INTO {$resources_table_prefix} (name,cat_id,bookable,picture_src,accessory_of) VALUES ( 'Meeting room 1',$locations_cat_id,1,'cat_src',-1)"); |
@@ -44,7 +44,7 @@ |
||
44 | 44 | 'long_description' => lang('Long description'), |
45 | 45 | 'inventory_number' => lang('inventory number'), |
46 | 46 | 'accessory_of' => lang('Accessory of') |
47 | - ); |
|
47 | + ); |
|
48 | 48 | |
49 | 49 | $custom = Api\Storage\Customfields::get('resources', true); |
50 | 50 | foreach($custom as $name => $data) { |
@@ -47,7 +47,7 @@ |
||
47 | 47 | ); |
48 | 48 | |
49 | 49 | $custom = Api\Storage\Customfields::get('resources', true); |
50 | - foreach($custom as $name => $data) { |
|
50 | + foreach ($custom as $name => $data) { |
|
51 | 51 | $this->mapping_fields['#'.$name] = $data['label']; |
52 | 52 | } |
53 | 53 |
@@ -47,7 +47,8 @@ |
||
47 | 47 | ); |
48 | 48 | |
49 | 49 | $custom = Api\Storage\Customfields::get('resources', true); |
50 | - foreach($custom as $name => $data) { |
|
50 | + foreach($custom as $name => $data) |
|
51 | + { |
|
51 | 52 | $this->mapping_fields['#'.$name] = $data['label']; |
52 | 53 | } |
53 | 54 |
@@ -58,7 +58,7 @@ |
||
58 | 58 | } else { |
59 | 59 | $data['msg']= '<div class="confirm">'.lang('Unable to process confirmation.').'</div>'; |
60 | 60 | } |
61 | - } |
|
61 | + } |
|
62 | 62 | |
63 | 63 | $this->tmpl->read('resources.sitemgr_book'); |
64 | 64 |
@@ -26,17 +26,17 @@ discard block |
||
26 | 26 | */ |
27 | 27 | public function book($content = array(), $arguments = array()) |
28 | 28 | { |
29 | - Framework::includeJS('jscalendar','calendar'); |
|
29 | + Framework::includeJS('jscalendar', 'calendar'); |
|
30 | 30 | $data = array(); |
31 | 31 | $readonlys = array(); |
32 | 32 | $display_days = $_GET['planner_days'] ? $_GET['planner_days'] : 3; |
33 | - $planner_date = $_GET['date'] ? $_GET['date'] : strtotime('yesterday',$content['date'] ? $content['date'] : time()); |
|
33 | + $planner_date = $_GET['date'] ? $_GET['date'] : strtotime('yesterday', $content['date'] ? $content['date'] : time()); |
|
34 | 34 | |
35 | - if($_GET['confirm']) { |
|
36 | - $register_code = ($_GET['confirm'] && preg_match('/^[0-9a-f]{32}$/',$_GET['confirm'])) ? $_GET['confirm'] : false; |
|
37 | - if($register_code && $registration = registration_bo::confirm($register_code)) { |
|
35 | + if ($_GET['confirm']) { |
|
36 | + $register_code = ($_GET['confirm'] && preg_match('/^[0-9a-f]{32}$/', $_GET['confirm'])) ? $_GET['confirm'] : false; |
|
37 | + if ($register_code && $registration = registration_bo::confirm($register_code)) { |
|
38 | 38 | // Get calendar through link |
39 | - $links = Link::get_links('registration', $registration['reg_id'],'calendar'); |
|
39 | + $links = Link::get_links('registration', $registration['reg_id'], 'calendar'); |
|
40 | 40 | $bo = new calendar_boupdate(); |
41 | 41 | $data = $bo->read(current($links)); |
42 | 42 | |
@@ -45,24 +45,24 @@ discard block |
||
45 | 45 | |
46 | 46 | // Show date of reservation, so they can see it blocked off |
47 | 47 | $display_days = 1; |
48 | - $planner_date = mktime(0,0,0,date('m',$data['start']),date('d',$data['start']),date('Y',$data['start'])); |
|
48 | + $planner_date = mktime(0, 0, 0, date('m', $data['start']), date('d', $data['start']), date('Y', $data['start'])); |
|
49 | 49 | $readonlys['__ALL__'] = true; |
50 | 50 | $content = array( |
51 | 51 | 'resource' => key($data['participant_types']['r']), |
52 | 52 | 'date' => $data['start'], |
53 | - 'time' => $data['start'] - mktime(0,0,0,date('m',$data['start']),date('d',$data['start']),date('Y',$data['start'])), |
|
53 | + 'time' => $data['start'] - mktime(0, 0, 0, date('m', $data['start']), date('d', $data['start']), date('Y', $data['start'])), |
|
54 | 54 | 'quantity' => 0 |
55 | 55 | ); |
56 | - calendar_so::split_status($data['participant_types']['r'][$content['resource']], $content['quantity'],$role); |
|
57 | - $data['msg']= '<div class="confirm">'.lang('Registration confirmed %1', Api\DateTime::to($data['start'])) .'</div>'; |
|
56 | + calendar_so::split_status($data['participant_types']['r'][$content['resource']], $content['quantity'], $role); |
|
57 | + $data['msg'] = '<div class="confirm">'.lang('Registration confirmed %1', Api\DateTime::to($data['start'])).'</div>'; |
|
58 | 58 | } else { |
59 | - $data['msg']= '<div class="confirm">'.lang('Unable to process confirmation.').'</div>'; |
|
59 | + $data['msg'] = '<div class="confirm">'.lang('Unable to process confirmation.').'</div>'; |
|
60 | 60 | } |
61 | 61 | } |
62 | 62 | |
63 | 63 | $this->tmpl->read('resources.sitemgr_book'); |
64 | 64 | |
65 | - if(!$arguments['resource'] && !($arguments['resource'] = $content['resource'])) return false; |
|
65 | + if (!$arguments['resource'] && !($arguments['resource'] = $content['resource'])) return false; |
|
66 | 66 | $data += $this->bo->read($arguments['resource']); |
67 | 67 | |
68 | 68 | $data['quantity'] = $content['quantity'] ? $content['quantity'] : 2; |
@@ -81,11 +81,11 @@ discard block |
||
81 | 81 | $preserve['include_group'] = $arguments['include_group'] ? $arguments['include_group'] : $content['include_group']; |
82 | 82 | |
83 | 83 | // Check for valid time |
84 | - if($data['date'] && $content['book']) |
|
84 | + if ($data['date'] && $content['book']) |
|
85 | 85 | { |
86 | - $start_time = $data['date'] + (is_array($data['time']) ? $data['time']['hour']*3600 + $data['time']['minute']*60 : $data['time']); |
|
86 | + $start_time = $data['date'] + (is_array($data['time']) ? $data['time']['hour'] * 3600 + $data['time']['minute'] * 60 : $data['time']); |
|
87 | 87 | // Use sitemgr's default appointment length |
88 | - if($GLOBALS['egw_info']['user']['account_lid'] != $GLOBALS['sitemgr_info']['anonymous_user']) |
|
88 | + if ($GLOBALS['egw_info']['user']['account_lid'] != $GLOBALS['sitemgr_info']['anonymous_user']) |
|
89 | 89 | { |
90 | 90 | $preferences = new Api\Preferences($GLOBALS['egw']->accounts->name2id($GLOBALS['sitemgr_info']['anonymous_user'])); |
91 | 91 | $preferences = $preferences->read_repository(); |
@@ -100,21 +100,21 @@ discard block |
||
100 | 100 | $config = Api\Config::read('registration'); |
101 | 101 | |
102 | 102 | // Not a user, need contact |
103 | - if($GLOBALS['egw_info']['user']['account_lid'] == $GLOBALS['sitemgr_info']['anonymous_user'] && !$content['contact_id']) |
|
103 | + if ($GLOBALS['egw_info']['user']['account_lid'] == $GLOBALS['sitemgr_info']['anonymous_user'] && !$content['contact_id']) |
|
104 | 104 | { |
105 | 105 | if ($config['pending_addressbook']) // save the contact in the addressbook |
106 | 106 | { |
107 | 107 | $content['owner'] = $config['pending_addressbook']; |
108 | - $content['private'] = 0; // in case default_private is set |
|
108 | + $content['private'] = 0; // in case default_private is set |
|
109 | 109 | } |
110 | 110 | |
111 | 111 | $addressbook = new Api\Contacts(); |
112 | 112 | $contact_fields = $addressbook->contact_fields; |
113 | 113 | unset($contact_fields['email']); // Always present |
114 | 114 | unset($contact_fields['id']); // Address already there |
115 | - if(array_intersect_key($contact_fields,$content)) { |
|
115 | + if (array_intersect_key($contact_fields, $content)) { |
|
116 | 116 | $result = $addressbook->save($content); |
117 | - if(!$result) { |
|
117 | + if (!$result) { |
|
118 | 118 | throw new Api\Exception\NoPermission($addressbook->error); |
119 | 119 | return False; |
120 | 120 | } |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | $contact_id = $GLOBALS['egw_info']['user']['person_id']; |
131 | 131 | } |
132 | 132 | |
133 | - if($contact) { |
|
133 | + if ($contact) { |
|
134 | 134 | // Make event |
135 | 135 | $event = array( |
136 | 136 | 'title' => Link::title('addressbook', $contact_id), |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | $contact => calendar_so::combine_status('U', $data['quantity'], 'REQ-PARTICIPANT') |
142 | 142 | ) |
143 | 143 | ); |
144 | - if($preserve['include_group']) |
|
144 | + if ($preserve['include_group']) |
|
145 | 145 | { |
146 | 146 | $event['participants'][$preserve['include_group']] = calendar_so::combine_status('U', 1, 'REQ-PARTICIPANT'); |
147 | 147 | } |
@@ -150,21 +150,21 @@ discard block |
||
150 | 150 | |
151 | 151 | // Show date of reservation, so they can see it blocked off |
152 | 152 | $display_days = 1; |
153 | - $planner_date = mktime(0,0,0,date('m',$event['start']),date('d',$event['start']),date('Y',$event['start'])); |
|
153 | + $planner_date = mktime(0, 0, 0, date('m', $event['start']), date('d', $event['start']), date('Y', $event['start'])); |
|
154 | 154 | |
155 | 155 | // Free time search |
156 | - if(!is_numeric($result)) |
|
156 | + if (!is_numeric($result)) |
|
157 | 157 | { |
158 | 158 | $form = new calendar_uiforms(); |
159 | 159 | $freetime = $form->freetime('r'.$data['res_id'], |
160 | - strtotime($GLOBALS['egw_info']['user']['preferences']['calendar']['workdaystarts'] . ':00',$start_time), |
|
161 | - strtotime($GLOBALS['egw_info']['user']['preferences']['calendar']['workdayends'] . ':00 ',$end_time), |
|
160 | + strtotime($GLOBALS['egw_info']['user']['preferences']['calendar']['workdaystarts'].':00', $start_time), |
|
161 | + strtotime($GLOBALS['egw_info']['user']['preferences']['calendar']['workdayends'].':00 ', $end_time), |
|
162 | 162 | $duration |
163 | 163 | ); |
164 | 164 | $data += $content; |
165 | 165 | $data['msg'] = lang('Please choose a different time:')."\n"; |
166 | - foreach($freetime as $slot) { |
|
167 | - $data['msg'] .= Api\DateTime::to($slot['start']) . ' - ' . Api\DateTime::to($slot['end'])."<br />\n"; |
|
166 | + foreach ($freetime as $slot) { |
|
167 | + $data['msg'] .= Api\DateTime::to($slot['start']).' - '.Api\DateTime::to($slot['end'])."<br />\n"; |
|
168 | 168 | } |
169 | 169 | } |
170 | 170 | elseif ($preserve['confirmation'] && $contact_id && $result) |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | 'post_confirm_hook' => 'resources.resources_reserve.confirm', |
177 | 177 | 'sitemgr_version' => $preserve['sitemgr_version'] |
178 | 178 | ), false); |
179 | - if(is_numeric($reg_id)) |
|
179 | + if (is_numeric($reg_id)) |
|
180 | 180 | { |
181 | 181 | // Link to event |
182 | 182 | Link::link('registration', $reg_id, 'calendar', $result); |
@@ -185,10 +185,10 @@ discard block |
||
185 | 185 | // Send email |
186 | 186 | $email_info = $config + array( |
187 | 187 | 'title' => $data['name'], |
188 | - 'subject' => $data['name'] . ' ' . Api\DateTime::to($start_time), |
|
188 | + 'subject' => $data['name'].' '.Api\DateTime::to($start_time), |
|
189 | 189 | 'link' => $preserve['link'], |
190 | 190 | ); |
191 | - if($preserve['email_message']) |
|
191 | + if ($preserve['email_message']) |
|
192 | 192 | { |
193 | 193 | $email_info['message'] = lang($preserve['email_message'], |
194 | 194 | Api\DateTime::to($start_time), |
@@ -205,23 +205,23 @@ discard block |
||
205 | 205 | $data['picture'] = $this->bo->get_picture($data); |
206 | 206 | |
207 | 207 | // Not a user, need contact |
208 | - if($GLOBALS['egw_info']['user']['account_lid'] == $GLOBALS['sitemgr_info']['anonymous_user'] && !$content['contact_id']) |
|
208 | + if ($GLOBALS['egw_info']['user']['account_lid'] == $GLOBALS['sitemgr_info']['anonymous_user'] && !$content['contact_id']) |
|
209 | 209 | { |
210 | 210 | $data['contact_form'] = $preserve['contact_form']; |
211 | 211 | $data['show_contact'] = !$preserve['contact_form']; |
212 | 212 | } |
213 | 213 | |
214 | 214 | $cal_user = array('r'.$arguments['resource']); |
215 | - foreach($this->bo->get_acc_list($data['res_id']) as $acc_id => $name) |
|
215 | + foreach ($this->bo->get_acc_list($data['res_id']) as $acc_id => $name) |
|
216 | 216 | { |
217 | 217 | $cal_user[] = 'r'.$acc_id; |
218 | 218 | } |
219 | 219 | |
220 | - if(!$data['date']) $data['date'] = strtotime('tomorrow'); |
|
221 | - if(!$data['time']) $data['time']['hour'] = $GLOBALS['egw_info']['user']['preferences']['calendar']['workdaystarts']; |
|
220 | + if (!$data['date']) $data['date'] = strtotime('tomorrow'); |
|
221 | + if (!$data['time']) $data['time']['hour'] = $GLOBALS['egw_info']['user']['preferences']['calendar']['workdaystarts']; |
|
222 | 222 | |
223 | 223 | // Use sitemgr's default appointment length |
224 | - if($GLOBALS['egw_info']['user']['account_lid'] != $GLOBALS['sitemgr_info']['anonymous_user']) |
|
224 | + if ($GLOBALS['egw_info']['user']['account_lid'] != $GLOBALS['sitemgr_info']['anonymous_user']) |
|
225 | 225 | { |
226 | 226 | $preferences = new Api\Preferences($GLOBALS['egw']->accounts->name2id($GLOBALS['sitemgr_info']['anonymous_user'])); |
227 | 227 | $preferences = $preferences->read_repository(); |
@@ -234,28 +234,28 @@ discard block |
||
234 | 234 | // Leading 0 |
235 | 235 | $data['duration'] = '0'.$data['duration']; |
236 | 236 | |
237 | - if(!$GLOBALS['egw_info']['user']['apps']['resources'] || !$this->bo->get_calendar_info($data['res_id']) || // Needed for booking |
|
237 | + if (!$GLOBALS['egw_info']['user']['apps']['resources'] || !$this->bo->get_calendar_info($data['res_id']) || // Needed for booking |
|
238 | 238 | !$GLOBALS['egw_info']['user']['apps']['calendar'] // Needed for updating schedule |
239 | 239 | ) |
240 | 240 | { |
241 | - $data['planner'] = 'Permission error - site not configured properly. Need ' . lang('resources') . ' & ' . lang('calendar'); |
|
241 | + $data['planner'] = 'Permission error - site not configured properly. Need '.lang('resources').' & '.lang('calendar'); |
|
242 | 242 | } |
243 | 243 | else |
244 | 244 | { |
245 | 245 | $data['planner'] = $this->get_planner( |
246 | 246 | $arguments['resource'], |
247 | - $planner_date ? $planner_date : strtotime('yesterday',$date), // Show day before, too |
|
247 | + $planner_date ? $planner_date : strtotime('yesterday', $date), // Show day before, too |
|
248 | 248 | $display_days, |
249 | 249 | $preserve['link'] |
250 | 250 | ); |
251 | 251 | } |
252 | 252 | |
253 | 253 | // Restrict times to working hours |
254 | - for($i = $GLOBALS['egw_info']['user']['preferences']['calendar']['workdaystarts']; $i < $GLOBALS['egw_info']['user']['preferences']['calendar']['workdayends']; $i++) |
|
254 | + for ($i = $GLOBALS['egw_info']['user']['preferences']['calendar']['workdaystarts']; $i < $GLOBALS['egw_info']['user']['preferences']['calendar']['workdayends']; $i++) |
|
255 | 255 | { |
256 | - if($GLOBALS['egw_info']['user']['preferences']['common']['timeformat'] == '12') |
|
256 | + if ($GLOBALS['egw_info']['user']['preferences']['common']['timeformat'] == '12') |
|
257 | 257 | { |
258 | - $sel_options['hour'][$i] = ($i < '12' ? $i .' am' : ($i > 12 ? $i -12 : $i).' pm'); |
|
258 | + $sel_options['hour'][$i] = ($i < '12' ? $i.' am' : ($i > 12 ? $i - 12 : $i).' pm'); |
|
259 | 259 | } |
260 | 260 | else |
261 | 261 | { |
@@ -263,14 +263,14 @@ discard block |
||
263 | 263 | } |
264 | 264 | } |
265 | 265 | |
266 | - return $this->tmpl->exec('resources.resources_reserve.book',$data,$sel_options,$readonlys,$preserve); |
|
266 | + return $this->tmpl->exec('resources.resources_reserve.book', $data, $sel_options, $readonlys, $preserve); |
|
267 | 267 | } |
268 | 268 | |
269 | 269 | public function ajax_update_planner($resource_id, $date) { |
270 | 270 | $response = Api\Json\Response::get(); |
271 | - $response->assign('exec[planner_div]','innerHTML',$this->get_planner( |
|
271 | + $response->assign('exec[planner_div]', 'innerHTML', $this->get_planner( |
|
272 | 272 | $resource_id, |
273 | - strtotime('yesterday',$date), |
|
273 | + strtotime('yesterday', $date), |
|
274 | 274 | 3, |
275 | 275 | $_SERVER['HTTP_REFERER'] |
276 | 276 | )); |
@@ -296,7 +296,7 @@ discard block |
||
296 | 296 | // Need to add this in explicitly, or it may be lost if use clicks a day |
297 | 297 | $calendar->search_params['users'][] = 'r'.$resource_id; |
298 | 298 | $calendar->search_params['users'][] = $GLOBALS['egw_info']['user']['account_id']; |
299 | - $calendar->allowEdit = false; // switches off all edit popups |
|
299 | + $calendar->allowEdit = false; // switches off all edit popups |
|
300 | 300 | |
301 | 301 | $planner = '<style type="text/css">'."\n". |
302 | 302 | '@import url('.$GLOBALS['egw_info']['server']['webserver_url'].'/calendar/templates/default/app.css'.");\n". |
@@ -318,10 +318,10 @@ discard block |
||
318 | 318 | public function confirm($registration) |
319 | 319 | { |
320 | 320 | // Get calendar through link |
321 | - $links = Link::get_links('registration', $registration['reg_id'],'calendar'); |
|
321 | + $links = Link::get_links('registration', $registration['reg_id'], 'calendar'); |
|
322 | 322 | $bo = new calendar_boupdate(); |
323 | 323 | $event = $bo->read(current($links)); |
324 | - if($registration['status'] == registration_bo::CONFIRMED) |
|
324 | + if ($registration['status'] == registration_bo::CONFIRMED) |
|
325 | 325 | { |
326 | 326 | $bo->set_status(current($links), 'c'.$registration['contact_id'], 'A'); |
327 | 327 | } |
@@ -329,7 +329,7 @@ discard block |
||
329 | 329 | { |
330 | 330 | $bo->delete(current($links)); |
331 | 331 | // Remove contact ID, or registration will try to purge the account |
332 | - if($registration['account_id']) |
|
332 | + if ($registration['account_id']) |
|
333 | 333 | { |
334 | 334 | unset($registration['contact_id']); |
335 | 335 | } |
@@ -14,9 +14,11 @@ discard block |
||
14 | 14 | use EGroupware\Api\Link; |
15 | 15 | use EGroupware\Api\Framework; |
16 | 16 | |
17 | -class resources_reserve { |
|
17 | +class resources_reserve |
|
18 | +{ |
|
18 | 19 | |
19 | - public function __construct() { |
|
20 | + public function __construct() |
|
21 | + { |
|
20 | 22 | $this->tmpl = new etemplate(); |
21 | 23 | $this->bo = new resources_bo(); |
22 | 24 | } |
@@ -32,9 +34,11 @@ discard block |
||
32 | 34 | $display_days = $_GET['planner_days'] ? $_GET['planner_days'] : 3; |
33 | 35 | $planner_date = $_GET['date'] ? $_GET['date'] : strtotime('yesterday',$content['date'] ? $content['date'] : time()); |
34 | 36 | |
35 | - if($_GET['confirm']) { |
|
37 | + if($_GET['confirm']) |
|
38 | + { |
|
36 | 39 | $register_code = ($_GET['confirm'] && preg_match('/^[0-9a-f]{32}$/',$_GET['confirm'])) ? $_GET['confirm'] : false; |
37 | - if($register_code && $registration = registration_bo::confirm($register_code)) { |
|
40 | + if($register_code && $registration = registration_bo::confirm($register_code)) |
|
41 | + { |
|
38 | 42 | // Get calendar through link |
39 | 43 | $links = Link::get_links('registration', $registration['reg_id'],'calendar'); |
40 | 44 | $bo = new calendar_boupdate(); |
@@ -55,14 +59,19 @@ discard block |
||
55 | 59 | ); |
56 | 60 | calendar_so::split_status($data['participant_types']['r'][$content['resource']], $content['quantity'],$role); |
57 | 61 | $data['msg']= '<div class="confirm">'.lang('Registration confirmed %1', Api\DateTime::to($data['start'])) .'</div>'; |
58 | - } else { |
|
62 | + } |
|
63 | + else |
|
64 | + { |
|
59 | 65 | $data['msg']= '<div class="confirm">'.lang('Unable to process confirmation.').'</div>'; |
60 | 66 | } |
61 | 67 | } |
62 | 68 | |
63 | 69 | $this->tmpl->read('resources.sitemgr_book'); |
64 | 70 | |
65 | - if(!$arguments['resource'] && !($arguments['resource'] = $content['resource'])) return false; |
|
71 | + if(!$arguments['resource'] && !($arguments['resource'] = $content['resource'])) |
|
72 | + { |
|
73 | + return false; |
|
74 | + } |
|
66 | 75 | $data += $this->bo->read($arguments['resource']); |
67 | 76 | |
68 | 77 | $data['quantity'] = $content['quantity'] ? $content['quantity'] : 2; |
@@ -102,9 +111,12 @@ discard block |
||
102 | 111 | // Not a user, need contact |
103 | 112 | if($GLOBALS['egw_info']['user']['account_lid'] == $GLOBALS['sitemgr_info']['anonymous_user'] && !$content['contact_id']) |
104 | 113 | { |
105 | - if ($config['pending_addressbook']) // save the contact in the addressbook |
|
114 | + if ($config['pending_addressbook']) |
|
115 | + { |
|
116 | + // save the contact in the addressbook |
|
106 | 117 | { |
107 | 118 | $content['owner'] = $config['pending_addressbook']; |
119 | + } |
|
108 | 120 | $content['private'] = 0; // in case default_private is set |
109 | 121 | } |
110 | 122 | |
@@ -112,9 +124,11 @@ discard block |
||
112 | 124 | $contact_fields = $addressbook->contact_fields; |
113 | 125 | unset($contact_fields['email']); // Always present |
114 | 126 | unset($contact_fields['id']); // Address already there |
115 | - if(array_intersect_key($contact_fields,$content)) { |
|
127 | + if(array_intersect_key($contact_fields,$content)) |
|
128 | + { |
|
116 | 129 | $result = $addressbook->save($content); |
117 | - if(!$result) { |
|
130 | + if(!$result) |
|
131 | + { |
|
118 | 132 | throw new Api\Exception\NoPermission($addressbook->error); |
119 | 133 | return False; |
120 | 134 | } |
@@ -130,7 +144,8 @@ discard block |
||
130 | 144 | $contact_id = $GLOBALS['egw_info']['user']['person_id']; |
131 | 145 | } |
132 | 146 | |
133 | - if($contact) { |
|
147 | + if($contact) |
|
148 | + { |
|
134 | 149 | // Make event |
135 | 150 | $event = array( |
136 | 151 | 'title' => Link::title('addressbook', $contact_id), |
@@ -163,7 +178,8 @@ discard block |
||
163 | 178 | ); |
164 | 179 | $data += $content; |
165 | 180 | $data['msg'] = lang('Please choose a different time:')."\n"; |
166 | - foreach($freetime as $slot) { |
|
181 | + foreach($freetime as $slot) |
|
182 | + { |
|
167 | 183 | $data['msg'] .= Api\DateTime::to($slot['start']) . ' - ' . Api\DateTime::to($slot['end'])."<br />\n"; |
168 | 184 | } |
169 | 185 | } |
@@ -217,8 +233,14 @@ discard block |
||
217 | 233 | $cal_user[] = 'r'.$acc_id; |
218 | 234 | } |
219 | 235 | |
220 | - if(!$data['date']) $data['date'] = strtotime('tomorrow'); |
|
221 | - if(!$data['time']) $data['time']['hour'] = $GLOBALS['egw_info']['user']['preferences']['calendar']['workdaystarts']; |
|
236 | + if(!$data['date']) |
|
237 | + { |
|
238 | + $data['date'] = strtotime('tomorrow'); |
|
239 | + } |
|
240 | + if(!$data['time']) |
|
241 | + { |
|
242 | + $data['time']['hour'] = $GLOBALS['egw_info']['user']['preferences']['calendar']['workdaystarts']; |
|
243 | + } |
|
222 | 244 | |
223 | 245 | // Use sitemgr's default appointment length |
224 | 246 | if($GLOBALS['egw_info']['user']['account_lid'] != $GLOBALS['sitemgr_info']['anonymous_user']) |
@@ -236,8 +258,7 @@ discard block |
||
236 | 258 | |
237 | 259 | if(!$GLOBALS['egw_info']['user']['apps']['resources'] || !$this->bo->get_calendar_info($data['res_id']) || // Needed for booking |
238 | 260 | !$GLOBALS['egw_info']['user']['apps']['calendar'] // Needed for updating schedule |
239 | - ) |
|
240 | - { |
|
261 | + ) { |
|
241 | 262 | $data['planner'] = 'Permission error - site not configured properly. Need ' . lang('resources') . ' & ' . lang('calendar'); |
242 | 263 | } |
243 | 264 | else |
@@ -266,7 +287,8 @@ discard block |
||
266 | 287 | return $this->tmpl->exec('resources.resources_reserve.book',$data,$sel_options,$readonlys,$preserve); |
267 | 288 | } |
268 | 289 | |
269 | - public function ajax_update_planner($resource_id, $date) { |
|
290 | + public function ajax_update_planner($resource_id, $date) |
|
291 | + { |
|
270 | 292 | $response = Api\Json\Response::get(); |
271 | 293 | $response->assign('exec[planner_div]','innerHTML',$this->get_planner( |
272 | 294 | $resource_id, |
@@ -26,26 +26,26 @@ discard block |
||
26 | 26 | |
27 | 27 | // Custom fields |
28 | 28 | $custom = Api\Storage\Customfields::get('resources', true); |
29 | - foreach($custom as $name => $data) { |
|
29 | + foreach ($custom as $name => $data) { |
|
30 | 30 | $this->export_fields['#'.$name] = $data['label']; |
31 | 31 | } |
32 | 32 | } |
33 | 33 | |
34 | 34 | public function wizard_step50(&$content, &$sel_options, &$readonlys, &$preserv) { |
35 | - if($this->debug || true) error_log(get_class($this) . '::wizard_step50->$content '.print_r($content,true)); |
|
35 | + if ($this->debug || true) error_log(get_class($this).'::wizard_step50->$content '.print_r($content, true)); |
|
36 | 36 | // return |
37 | 37 | if ($content['step'] == 'wizard_step50') |
38 | 38 | { |
39 | 39 | switch (array_search('pressed', $content['button'])) |
40 | 40 | { |
41 | 41 | case 'next': |
42 | - return $GLOBALS['egw']->importexport_definitions_ui->get_step($content['step'],1); |
|
42 | + return $GLOBALS['egw']->importexport_definitions_ui->get_step($content['step'], 1); |
|
43 | 43 | case 'previous' : |
44 | - return $GLOBALS['egw']->importexport_definitions_ui->get_step($content['step'],-1); |
|
44 | + return $GLOBALS['egw']->importexport_definitions_ui->get_step($content['step'], -1); |
|
45 | 45 | case 'finish': |
46 | 46 | return 'wizard_finish'; |
47 | 47 | default : |
48 | - return $this->wizard_step50($content,$sel_options,$readonlys,$preserv); |
|
48 | + return $this->wizard_step50($content, $sel_options, $readonlys, $preserv); |
|
49 | 49 | } |
50 | 50 | } |
51 | 51 | // init step |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | unset ($preserv['button']); |
58 | 58 | $fields = array('pm_used_time', 'pm_planned_time', 'pm_replanned_time'); |
59 | 59 | $sel_options = array_fill_keys($fields, array('h' => lang('hours'), 'd' => lang('days'))); |
60 | - foreach($fields as $field) { |
|
60 | + foreach ($fields as $field) { |
|
61 | 61 | $content[$field] = $content[$field] ? $content[$field] : $content['plugin_options'][$field]; |
62 | 62 | } |
63 | 63 | } |
@@ -14,7 +14,8 @@ discard block |
||
14 | 14 | |
15 | 15 | class resources_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 |
@@ -26,13 +27,18 @@ discard block |
||
26 | 27 | |
27 | 28 | // Custom fields |
28 | 29 | $custom = Api\Storage\Customfields::get('resources', true); |
29 | - foreach($custom as $name => $data) { |
|
30 | + foreach($custom as $name => $data) |
|
31 | + { |
|
30 | 32 | $this->export_fields['#'.$name] = $data['label']; |
31 | 33 | } |
32 | 34 | } |
33 | 35 | |
34 | - public function wizard_step50(&$content, &$sel_options, &$readonlys, &$preserv) { |
|
35 | - if($this->debug || true) error_log(get_class($this) . '::wizard_step50->$content '.print_r($content,true)); |
|
36 | + public function wizard_step50(&$content, &$sel_options, &$readonlys, &$preserv) |
|
37 | + { |
|
38 | + if($this->debug || true) |
|
39 | + { |
|
40 | + error_log(get_class($this) . '::wizard_step50->$content '.print_r($content,true)); |
|
41 | + } |
|
36 | 42 | // return |
37 | 43 | if ($content['step'] == 'wizard_step50') |
38 | 44 | { |
@@ -57,7 +63,8 @@ discard block |
||
57 | 63 | unset ($preserv['button']); |
58 | 64 | $fields = array('pm_used_time', 'pm_planned_time', 'pm_replanned_time'); |
59 | 65 | $sel_options = array_fill_keys($fields, array('h' => lang('hours'), 'd' => lang('days'))); |
60 | - foreach($fields as $field) { |
|
66 | + foreach($fields as $field) |
|
67 | + { |
|
61 | 68 | $content[$field] = $content[$field] ? $content[$field] : $content['plugin_options'][$field]; |
62 | 69 | } |
63 | 70 | } |