@@ -142,7 +142,10 @@ discard block |
||
| 142 | 142 | */ |
| 143 | 143 | function search($filter,$order='history_id',$sort='DESC',$limit=null) |
| 144 | 144 | { |
| 145 | - if (!is_array($filter)) $filter = is_numeric($filter) ? array('history_record_id' => $filter) : array(); |
|
| 145 | + if (!is_array($filter)) |
|
| 146 | + { |
|
| 147 | + $filter = is_numeric($filter) ? array('history_record_id' => $filter) : array(); |
|
| 148 | + } |
|
| 146 | 149 | |
| 147 | 150 | if (!$order || !preg_match('/^[a-z0-9_]+$/i',$order) || !preg_match('/^(asc|desc)?$/i',$sort)) |
| 148 | 151 | { |
@@ -160,10 +163,16 @@ discard block |
||
| 160 | 163 | unset($filter[$col]); |
| 161 | 164 | } |
| 162 | 165 | } |
| 163 | - if (!isset($filter['history_appname'])) $filter['history_appname'] = $this->appname; |
|
| 166 | + if (!isset($filter['history_appname'])) |
|
| 167 | + { |
|
| 168 | + $filter['history_appname'] = $this->appname; |
|
| 169 | + } |
|
| 164 | 170 | |
| 165 | 171 | // do not try to read all history entries of an app |
| 166 | - if (!$filter['history_record_id']) return array(); |
|
| 172 | + if (!$filter['history_record_id']) |
|
| 173 | + { |
|
| 174 | + return array(); |
|
| 175 | + } |
|
| 167 | 176 | |
| 168 | 177 | $rows = array(); |
| 169 | 178 | foreach($this->db->select(self::TABLE, '*', $filter, __LINE__, __FILE__, |
@@ -188,8 +197,10 @@ discard block |
||
| 188 | 197 | $rows = array(); |
| 189 | 198 | $filter['history_appname'] = $query['appname']; |
| 190 | 199 | $filter['history_record_id'] = $query['record_id']; |
| 191 | - if(is_array($query['colfilter'])) { |
|
| 192 | - foreach($query['colfilter'] as $column => $value) { |
|
| 200 | + if(is_array($query['colfilter'])) |
|
| 201 | + { |
|
| 202 | + foreach($query['colfilter'] as $column => $value) |
|
| 203 | + { |
|
| 193 | 204 | $filter[$column] = $value; |
| 194 | 205 | } |
| 195 | 206 | } |
@@ -21,7 +21,10 @@ |
||
| 21 | 21 | { |
| 22 | 22 | function __construct($msg=null,$code=102) |
| 23 | 23 | { |
| 24 | - if (is_null($msg)) $msg = 'admin'; |
|
| 24 | + if (is_null($msg)) |
|
| 25 | + { |
|
| 26 | + $msg = 'admin'; |
|
| 27 | + } |
|
| 25 | 28 | |
| 26 | 29 | parent::__construct($msg,$code); |
| 27 | 30 | } |
@@ -19,4 +19,6 @@ |
||
| 19 | 19 | * User lacks a record level permission, eg. he's not the owner and has no grant from the owner |
| 20 | 20 | * |
| 21 | 21 | */ |
| 22 | -class Record extends Exception\NoPermission { } |
|
| 22 | +class Record extends Exception\NoPermission |
|
| 23 | +{ |
|
| 24 | +} |
|
@@ -28,7 +28,10 @@ |
||
| 28 | 28 | */ |
| 29 | 29 | function __construct($msg=null,$code=2) |
| 30 | 30 | { |
| 31 | - if (is_null($msg)) $msg = lang('Entry not found!'); |
|
| 31 | + if (is_null($msg)) |
|
| 32 | + { |
|
| 33 | + $msg = lang('Entry not found!'); |
|
| 34 | + } |
|
| 32 | 35 | |
| 33 | 36 | parent::__construct($msg,$code); |
| 34 | 37 | } |
@@ -17,4 +17,6 @@ |
||
| 17 | 17 | * Wrong or missing required user input: message should be translated so it can be shown directly to the user |
| 18 | 18 | * |
| 19 | 19 | */ |
| 20 | -class WrongUserinput extends AssertionFailed { } |
|
| 20 | +class WrongUserinput extends AssertionFailed |
|
| 21 | +{ |
|
| 22 | +} |
|
@@ -18,4 +18,6 @@ |
||
| 18 | 18 | * |
| 19 | 19 | * As you get this only by an error in the code or during development, the message does not need to be translated |
| 20 | 20 | */ |
| 21 | -class WrongParameter extends AssertionFailed { } |
|
| 21 | +class WrongParameter extends AssertionFailed |
|
| 22 | +{ |
|
| 23 | +} |
|
@@ -20,4 +20,6 @@ |
||
| 20 | 20 | * |
| 21 | 21 | * As you get this only by an error in the code or during development, the message does not need to be translated |
| 22 | 22 | */ |
| 23 | -class AssertionFailed extends Api\Exception { } |
|
| 23 | +class AssertionFailed extends Api\Exception |
|
| 24 | +{ |
|
| 25 | +} |
|
@@ -29,7 +29,10 @@ |
||
| 29 | 29 | */ |
| 30 | 30 | function __construct($msg=null,$code=100) |
| 31 | 31 | { |
| 32 | - if (is_null($msg)) $msg = lang('Permisson denied!'); |
|
| 32 | + if (is_null($msg)) |
|
| 33 | + { |
|
| 34 | + $msg = lang('Permisson denied!'); |
|
| 35 | + } |
|
| 33 | 36 | |
| 34 | 37 | parent::__construct($msg,$code); |
| 35 | 38 | } |
@@ -36,7 +36,11 @@ discard block |
||
| 36 | 36 | die("EGroupware requires PHP $egw_min_php_version or greater.<br />Please contact your System Administrator to upgrade PHP!"); |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | -if (!defined('EGW_API_INC')) define('EGW_API_INC',PHPGW_API_INC); // this is to support the header upgrade |
|
| 39 | +if (!defined('EGW_API_INC')) |
|
| 40 | +{ |
|
| 41 | + define('EGW_API_INC',PHPGW_API_INC); |
|
| 42 | +} |
|
| 43 | +// this is to support the header upgrade |
|
| 40 | 44 | |
| 41 | 45 | /* Make sure the header.inc.php is current. */ |
| 42 | 46 | if (!isset($GLOBALS['egw_domain']) || $GLOBALS['egw_info']['server']['versions']['header'] < $GLOBALS['egw_info']['server']['versions']['current_header']) |
@@ -70,21 +74,32 @@ discard block |
||
| 70 | 74 | $GLOBALS['egw_info'] = array_merge($_SESSION[Session::EGW_INFO_CACHE],array('flags' => $GLOBALS['egw_info']['flags'])); |
| 71 | 75 | |
| 72 | 76 | // include required class-definitions |
| 73 | - if (is_array($_SESSION[Session::EGW_REQUIRED_FILES])) // all classes, which can not be autoloaded |
|
| 77 | + if (is_array($_SESSION[Session::EGW_REQUIRED_FILES])) |
|
| 78 | + { |
|
| 79 | + // all classes, which can not be autoloaded |
|
| 74 | 80 | { |
| 75 | 81 | foreach($_SESSION[Session::EGW_REQUIRED_FILES] as $file) |
| 76 | 82 | { |
| 77 | 83 | require_once($file); |
| 84 | + } |
|
| 78 | 85 | } |
| 79 | 86 | } |
| 80 | 87 | $GLOBALS['egw'] = unserialize($_SESSION[Session::EGW_OBJECT_CACHE]); |
| 81 | 88 | |
| 82 | - if (is_object($GLOBALS['egw']) && ($GLOBALS['egw'] instanceof Egw)) // only egw object has wakeup2, setups egw_minimal eg. has not! |
|
| 89 | + if (is_object($GLOBALS['egw']) && ($GLOBALS['egw'] instanceof Egw)) |
|
| 83 | 90 | { |
| 84 | - $GLOBALS['egw']->wakeup2(); // adapt the restored egw-object/enviroment to this request (eg. changed current app) |
|
| 91 | + // only egw object has wakeup2, setups egw_minimal eg. has not! |
|
| 92 | + { |
|
| 93 | + $GLOBALS['egw']->wakeup2(); |
|
| 94 | + } |
|
| 95 | + // adapt the restored egw-object/enviroment to this request (eg. changed current app) |
|
| 85 | 96 | |
| 86 | 97 | $GLOBALS['egw_info']['flags']['session_restore_time'] = microtime(true) - $GLOBALS['egw_info']['flags']['page_start_time']; |
| 87 | - if (is_object($GLOBALS['egw']->translation)) return; // exit this file, as the rest of the file creates a new egw-object and -enviroment |
|
| 98 | + if (is_object($GLOBALS['egw']->translation)) |
|
| 99 | + { |
|
| 100 | + return; |
|
| 101 | + } |
|
| 102 | + // exit this file, as the rest of the file creates a new egw-object and -enviroment |
|
| 88 | 103 | } |
| 89 | 104 | // egw object could NOT be restored from the session, create a new one |
| 90 | 105 | unset($GLOBALS['egw']); |