@@ -4,7 +4,7 @@ discard block |
||
| 4 | 4 | $target_person_label = midcom::get()->i18n->get_string('system', 'org.openpsa.projects'); |
| 5 | 5 | |
| 6 | 6 | $fallback_creator = midcom_db_person::get_cached(1); |
| 7 | -if ( $task_status->metadata->creator |
|
| 7 | +if ($task_status->metadata->creator |
|
| 8 | 8 | && $task_status->metadata->creator != $fallback_creator->guid) |
| 9 | 9 | { |
| 10 | 10 | $status_changer = org_openpsa_widgets_contact::get($task_status->metadata->creator); |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | } |
| 39 | 39 | echo $task_label; |
| 40 | 40 | } |
| 41 | -catch (midcom_error $e){} |
|
| 41 | +catch (midcom_error $e) {} |
|
| 42 | 42 | ?> |
| 43 | 43 | </td> |
| 44 | 44 | <td class="multivalue"> |
@@ -37,8 +37,7 @@ |
||
| 37 | 37 | $task_label = "<a href=\"{$data['projects_url']}task/{$task->guid}/\">{$task_label}</a>"; |
| 38 | 38 | } |
| 39 | 39 | echo $task_label; |
| 40 | -} |
|
| 41 | -catch (midcom_error $e){} |
|
| 40 | +} catch (midcom_error $e){} |
|
| 42 | 41 | ?> |
| 43 | 42 | </td> |
| 44 | 43 | <td class="multivalue"> |
@@ -125,8 +125,7 @@ |
||
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | // Mark the new task work session as started |
| 128 | - $workingon = array |
|
| 129 | - ( |
|
| 128 | + $workingon = array( |
|
| 130 | 129 | 'task' => $task_guid, |
| 131 | 130 | 'description' => $description, |
| 132 | 131 | 'invoiceable' => $invoiceable, |
@@ -54,8 +54,7 @@ |
||
| 54 | 54 | { |
| 55 | 55 | midcom::get()->auth->require_valid_user(); |
| 56 | 56 | $this->person = midcom::get()->auth->user->get_storage(); |
| 57 | - } |
|
| 58 | - else |
|
| 57 | + } else |
|
| 59 | 58 | { |
| 60 | 59 | // TODO: Check that this is really a person object |
| 61 | 60 | $this->person = $person; |
@@ -15,22 +15,18 @@ discard block |
||
| 15 | 15 | { |
| 16 | 16 | private function _populate_toolbar() |
| 17 | 17 | { |
| 18 | - $buttons = array |
|
| 19 | - ( |
|
| 20 | - array |
|
| 21 | - ( |
|
| 18 | + $buttons = array( |
|
| 19 | + array( |
|
| 22 | 20 | MIDCOM_TOOLBAR_URL => 'weekreview/' . $this->_request_data['this_day'] . '/', |
| 23 | 21 | MIDCOM_TOOLBAR_LABEL => $this->_l10n->get('week review'), |
| 24 | 22 | MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/properties.png', |
| 25 | 23 | ), |
| 26 | - array |
|
| 27 | - ( |
|
| 24 | + array( |
|
| 28 | 25 | MIDCOM_TOOLBAR_URL => 'day/' . $this->_request_data['prev_day'] . '/', |
| 29 | 26 | MIDCOM_TOOLBAR_LABEL => $this->_l10n_midcom->get('previous'), |
| 30 | 27 | MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/back.png', |
| 31 | 28 | ), |
| 32 | - array |
|
| 33 | - ( |
|
| 29 | + array( |
|
| 34 | 30 | MIDCOM_TOOLBAR_URL => 'day/' . $this->_request_data['next_day'] . '/', |
| 35 | 31 | MIDCOM_TOOLBAR_LABEL => $this->_l10n_midcom->get('next'), |
| 36 | 32 | MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/next.png', |
@@ -77,10 +73,9 @@ discard block |
||
| 77 | 73 | org_openpsa_widgets_calendar::add_head_elements(); |
| 78 | 74 | |
| 79 | 75 | //set the start-constraints for journal-entries |
| 80 | - $time_span = 7 * 24 * 60 * 60 ; //7 days |
|
| 76 | + $time_span = 7 * 24 * 60 * 60; //7 days |
|
| 81 | 77 | |
| 82 | - $this->_request_data['journal_constraints'] = array |
|
| 83 | - ( |
|
| 78 | + $this->_request_data['journal_constraints'] = array( |
|
| 84 | 79 | //just show entries of current_user |
| 85 | 80 | array( |
| 86 | 81 | 'property' => 'metadata.creator', |
@@ -49,8 +49,7 @@ |
||
| 49 | 49 | if ($handler_id == 'today') |
| 50 | 50 | { |
| 51 | 51 | $data['requested_time'] = new DateTime; |
| 52 | - } |
|
| 53 | - else |
|
| 52 | + } else |
|
| 54 | 53 | { |
| 55 | 54 | // TODO: Check format as YYYY-MM-DD via regexp |
| 56 | 55 | $data['requested_time'] = new DateTime($args[0]); |
@@ -107,7 +107,7 @@ |
||
| 107 | 107 | $customer = $customer_id; |
| 108 | 108 | } |
| 109 | 109 | catch (midcom_error $e){} |
| 110 | - } |
|
| 110 | + } |
|
| 111 | 111 | } |
| 112 | 112 | $customer_cache[$array['task']] = $customer; |
| 113 | 113 | if (!isset($this->_request_data['customers'][$customer])) |
@@ -30,8 +30,7 @@ discard block |
||
| 30 | 30 | $task_conf = midcom_helper_datamanager2_widget_autocomplete::get_widget_config('task'); |
| 31 | 31 | $task_conf['id_field'] = 'guid'; |
| 32 | 32 | |
| 33 | - $task_conf['constraints'][] = array |
|
| 34 | - ( |
|
| 33 | + $task_conf['constraints'][] = array( |
|
| 35 | 34 | 'field' => 'status', |
| 36 | 35 | 'op' => '<', |
| 37 | 36 | 'value' => org_openpsa_projects_task_status_dba::COMPLETED, |
@@ -65,8 +64,7 @@ discard block |
||
| 65 | 64 | $hours = $hours_mc->list_keys(); |
| 66 | 65 | |
| 67 | 66 | $this->_request_data['customers'] = array(); |
| 68 | - $this->_request_data['hours'] = array |
|
| 69 | - ( |
|
| 67 | + $this->_request_data['hours'] = array( |
|
| 70 | 68 | 'invoiceable' => array(), |
| 71 | 69 | 'uninvoiceable' => array(), |
| 72 | 70 | 'total_invoiceable' => 0, |
@@ -106,7 +104,7 @@ discard block |
||
| 106 | 104 | $customer_label = $customer->official; |
| 107 | 105 | $customer = $customer_id; |
| 108 | 106 | } |
| 109 | - catch (midcom_error $e){} |
|
| 107 | + catch (midcom_error $e) {} |
|
| 110 | 108 | } |
| 111 | 109 | } |
| 112 | 110 | $customer_cache[$array['task']] = $customer; |
@@ -173,7 +171,7 @@ discard block |
||
| 173 | 171 | $workingon = new org_openpsa_mypage_workingon(); |
| 174 | 172 | if (!$workingon->set($_POST['task'])) |
| 175 | 173 | { |
| 176 | - midcom::get()->uimessages->add($this->_l10n->get('org.openpsa.mypage'), 'Failed to set "working on" parameter to "' . $_POST['task'] . '", reason ' . midcom_connection::get_error_string(), 'error'); |
|
| 174 | + midcom::get()->uimessages->add($this->_l10n->get('org.openpsa.mypage'), 'Failed to set "working on" parameter to "' . $_POST['task'] . '", reason ' . midcom_connection::get_error_string(), 'error'); |
|
| 177 | 175 | } |
| 178 | 176 | |
| 179 | 177 | return new midcom_response_relocate($relocate . "workingon/"); |
@@ -105,8 +105,7 @@ discard block |
||
| 105 | 105 | $customer = new org_openpsa_contacts_group_dba($customer_id); |
| 106 | 106 | $customer_label = $customer->official; |
| 107 | 107 | $customer = $customer_id; |
| 108 | - } |
|
| 109 | - catch (midcom_error $e){} |
|
| 108 | + } catch (midcom_error $e){} |
|
| 110 | 109 | } |
| 111 | 110 | } |
| 112 | 111 | $customer_cache[$array['task']] = $customer; |
@@ -127,8 +126,7 @@ discard block |
||
| 127 | 126 | if (!isset($this->_request_data['hours'][$category][$customer])) |
| 128 | 127 | { |
| 129 | 128 | $this->_request_data['hours'][$category][$customer] = $array['hours']; |
| 130 | - } |
|
| 131 | - else |
|
| 129 | + } else |
|
| 132 | 130 | { |
| 133 | 131 | $this->_request_data['hours'][$category][$customer] += $array['hours']; |
| 134 | 132 | } |
@@ -21,73 +21,73 @@ discard block |
||
| 21 | 21 | register_shutdown_function(function(){midcom::get()->finish();}); |
| 22 | 22 | } |
| 23 | 23 | |
| 24 | - /** |
|
| 25 | - * Save uploaded file. |
|
| 26 | - * On success return array with new file stat and with removed file hash (if existed file was replaced) |
|
| 24 | + /** |
|
| 25 | + * Save uploaded file. |
|
| 26 | + * On success return array with new file stat and with removed file hash (if existed file was replaced) |
|
| 27 | 27 | * |
| 28 | 28 | * Copied from parent and slightly modified to support attachment versioning |
| 29 | - * |
|
| 30 | - * @param Resource $fp file pointer |
|
| 31 | - * @param string $dst destination folder hash |
|
| 32 | - * @param string $src file name |
|
| 33 | - * @param string $tmpname file tmp name - required to detect mime type |
|
| 34 | - * @return array|false |
|
| 35 | - * @author Dmitry (dio) Levashov |
|
| 36 | - **/ |
|
| 37 | - public function upload($fp, $dst, $name, $tmpname, $hashes = array()) { |
|
| 38 | - if ($this->commandDisabled('upload')) { |
|
| 39 | - return $this->setError(elFinder::ERROR_PERM_DENIED); |
|
| 40 | - } |
|
| 41 | - |
|
| 42 | - if (($dir = $this->dir($dst)) == false) { |
|
| 43 | - return $this->setError(elFinder::ERROR_TRGDIR_NOT_FOUND, '#'.$dst); |
|
| 44 | - } |
|
| 45 | - |
|
| 46 | - if (!$dir['write']) { |
|
| 47 | - return $this->setError(elFinder::ERROR_PERM_DENIED); |
|
| 48 | - } |
|
| 49 | - |
|
| 50 | - if (!$this->nameAccepted($name)) { |
|
| 51 | - return $this->setError(elFinder::ERROR_INVALID_NAME); |
|
| 52 | - } |
|
| 53 | - |
|
| 54 | - $mime = $this->mimetype($this->mimeDetect == 'internal' ? $name : $tmpname, $name); |
|
| 55 | - $mimeByName = ''; |
|
| 56 | - if ($this->mimeDetect !== 'internal') { |
|
| 57 | - $mimeByName = elFinderVolumeDriver::mimetypeInternalDetect($name); |
|
| 58 | - if ($mime == 'unknown') { |
|
| 59 | - $mime = $mimeByName; |
|
| 60 | - } |
|
| 61 | - } |
|
| 62 | - |
|
| 63 | - if (!$this->allowPutMime($mime) || ($mimeByName && $mimeByName !== 'unknown' && !$this->allowPutMime($mimeByName))) { |
|
| 64 | - return $this->setError(elFinder::ERROR_UPLOAD_FILE_MIME); |
|
| 65 | - } |
|
| 66 | - |
|
| 67 | - $tmpsize = sprintf('%u', filesize($tmpname)); |
|
| 68 | - if ($this->uploadMaxSize > 0 && $tmpsize > $this->uploadMaxSize) { |
|
| 69 | - return $this->setError(elFinder::ERROR_UPLOAD_FILE_SIZE); |
|
| 70 | - } |
|
| 71 | - |
|
| 72 | - $dstpath = $this->decode($dst); |
|
| 73 | - if (isset($hashes[$name])) { |
|
| 74 | - $test = $this->decode($hashes[$name]); |
|
| 75 | - } else { |
|
| 76 | - $test = $this->joinPathCE($dstpath, $name); |
|
| 77 | - } |
|
| 78 | - |
|
| 79 | - $file = $this->stat($test); |
|
| 80 | - $this->clearcache(); |
|
| 81 | - |
|
| 82 | - if ($file && $file['name'] === $name) { // file exists and check filename for item ID based filesystem |
|
| 83 | - // check POST data `overwrite` for 3rd party uploader |
|
| 84 | - $overwrite = isset($_POST['overwrite'])? (bool)$_POST['overwrite'] : $this->options['uploadOverwrite']; |
|
| 85 | - if ($overwrite) { |
|
| 86 | - if (!$file['write']) { |
|
| 87 | - return $this->setError(elFinder::ERROR_PERM_DENIED); |
|
| 88 | - } elseif ($file['mime'] == 'directory') { |
|
| 89 | - return $this->setError(elFinder::ERROR_NOT_REPLACE, $name); |
|
| 90 | - } |
|
| 29 | + * |
|
| 30 | + * @param Resource $fp file pointer |
|
| 31 | + * @param string $dst destination folder hash |
|
| 32 | + * @param string $src file name |
|
| 33 | + * @param string $tmpname file tmp name - required to detect mime type |
|
| 34 | + * @return array|false |
|
| 35 | + * @author Dmitry (dio) Levashov |
|
| 36 | + **/ |
|
| 37 | + public function upload($fp, $dst, $name, $tmpname, $hashes = array()) { |
|
| 38 | + if ($this->commandDisabled('upload')) { |
|
| 39 | + return $this->setError(elFinder::ERROR_PERM_DENIED); |
|
| 40 | + } |
|
| 41 | + |
|
| 42 | + if (($dir = $this->dir($dst)) == false) { |
|
| 43 | + return $this->setError(elFinder::ERROR_TRGDIR_NOT_FOUND, '#'.$dst); |
|
| 44 | + } |
|
| 45 | + |
|
| 46 | + if (!$dir['write']) { |
|
| 47 | + return $this->setError(elFinder::ERROR_PERM_DENIED); |
|
| 48 | + } |
|
| 49 | + |
|
| 50 | + if (!$this->nameAccepted($name)) { |
|
| 51 | + return $this->setError(elFinder::ERROR_INVALID_NAME); |
|
| 52 | + } |
|
| 53 | + |
|
| 54 | + $mime = $this->mimetype($this->mimeDetect == 'internal' ? $name : $tmpname, $name); |
|
| 55 | + $mimeByName = ''; |
|
| 56 | + if ($this->mimeDetect !== 'internal') { |
|
| 57 | + $mimeByName = elFinderVolumeDriver::mimetypeInternalDetect($name); |
|
| 58 | + if ($mime == 'unknown') { |
|
| 59 | + $mime = $mimeByName; |
|
| 60 | + } |
|
| 61 | + } |
|
| 62 | + |
|
| 63 | + if (!$this->allowPutMime($mime) || ($mimeByName && $mimeByName !== 'unknown' && !$this->allowPutMime($mimeByName))) { |
|
| 64 | + return $this->setError(elFinder::ERROR_UPLOAD_FILE_MIME); |
|
| 65 | + } |
|
| 66 | + |
|
| 67 | + $tmpsize = sprintf('%u', filesize($tmpname)); |
|
| 68 | + if ($this->uploadMaxSize > 0 && $tmpsize > $this->uploadMaxSize) { |
|
| 69 | + return $this->setError(elFinder::ERROR_UPLOAD_FILE_SIZE); |
|
| 70 | + } |
|
| 71 | + |
|
| 72 | + $dstpath = $this->decode($dst); |
|
| 73 | + if (isset($hashes[$name])) { |
|
| 74 | + $test = $this->decode($hashes[$name]); |
|
| 75 | + } else { |
|
| 76 | + $test = $this->joinPathCE($dstpath, $name); |
|
| 77 | + } |
|
| 78 | + |
|
| 79 | + $file = $this->stat($test); |
|
| 80 | + $this->clearcache(); |
|
| 81 | + |
|
| 82 | + if ($file && $file['name'] === $name) { // file exists and check filename for item ID based filesystem |
|
| 83 | + // check POST data `overwrite` for 3rd party uploader |
|
| 84 | + $overwrite = isset($_POST['overwrite'])? (bool)$_POST['overwrite'] : $this->options['uploadOverwrite']; |
|
| 85 | + if ($overwrite) { |
|
| 86 | + if (!$file['write']) { |
|
| 87 | + return $this->setError(elFinder::ERROR_PERM_DENIED); |
|
| 88 | + } elseif ($file['mime'] == 'directory') { |
|
| 89 | + return $this->setError(elFinder::ERROR_NOT_REPLACE, $name); |
|
| 90 | + } |
|
| 91 | 91 | $document = new org_openpsa_documents_document_dba($test); |
| 92 | 92 | $document->backup_version(); |
| 93 | 93 | $attachments = org_openpsa_helpers::get_dm2_attachments($document, 'document'); |
@@ -108,28 +108,28 @@ discard block |
||
| 108 | 108 | |
| 109 | 109 | return $this->stat($document->guid); |
| 110 | 110 | |
| 111 | - } else { |
|
| 112 | - $name = $this->uniqueName($dstpath, $name, '-', false); |
|
| 113 | - } |
|
| 114 | - } |
|
| 111 | + } else { |
|
| 112 | + $name = $this->uniqueName($dstpath, $name, '-', false); |
|
| 113 | + } |
|
| 114 | + } |
|
| 115 | 115 | |
| 116 | - $stat = array( |
|
| 117 | - 'mime' => $mime, |
|
| 118 | - 'width' => 0, |
|
| 119 | - 'height' => 0, |
|
| 120 | - 'size' => $tmpsize); |
|
| 116 | + $stat = array( |
|
| 117 | + 'mime' => $mime, |
|
| 118 | + 'width' => 0, |
|
| 119 | + 'height' => 0, |
|
| 120 | + 'size' => $tmpsize); |
|
| 121 | 121 | |
| 122 | - if (strpos($mime, 'image') === 0 && ($s = getimagesize($tmpname))) { |
|
| 123 | - $stat['width'] = $s[0]; |
|
| 124 | - $stat['height'] = $s[1]; |
|
| 125 | - } |
|
| 122 | + if (strpos($mime, 'image') === 0 && ($s = getimagesize($tmpname))) { |
|
| 123 | + $stat['width'] = $s[0]; |
|
| 124 | + $stat['height'] = $s[1]; |
|
| 125 | + } |
|
| 126 | 126 | |
| 127 | - if (($path = $this->saveCE($fp, $dstpath, $name, $stat)) == false) { |
|
| 128 | - return false; |
|
| 129 | - } |
|
| 127 | + if (($path = $this->saveCE($fp, $dstpath, $name, $stat)) == false) { |
|
| 128 | + return false; |
|
| 129 | + } |
|
| 130 | 130 | |
| 131 | - return $this->stat($path); |
|
| 132 | - } |
|
| 131 | + return $this->stat($path); |
|
| 132 | + } |
|
| 133 | 133 | |
| 134 | 134 | /** |
| 135 | 135 | * Return parent directory path |
@@ -264,11 +264,11 @@ discard block |
||
| 264 | 264 | { |
| 265 | 265 | $object = midcom::get()->dbfactory->get_object_by_guid($path); |
| 266 | 266 | } |
| 267 | - catch (midcom_error $e) |
|
| 267 | + catch (midcom_error $e) |
|
| 268 | 268 | { |
| 269 | 269 | $e->log(); |
| 270 | - return ''; |
|
| 271 | - } |
|
| 270 | + return ''; |
|
| 271 | + } |
|
| 272 | 272 | |
| 273 | 273 | $output = array(); |
| 274 | 274 | if ($object instanceof org_openpsa_documents_document_dba) |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | // elfinder tmp detection doesn't work on OS X |
| 19 | 19 | $this->tmpPath = midcom::get()->config->get('midcom_tempdir'); |
| 20 | 20 | // elfinder calls exit(), so we need to make sure we write caches |
| 21 | - register_shutdown_function(function(){midcom::get()->finish();}); |
|
| 21 | + register_shutdown_function(function() {midcom::get()->finish(); }); |
|
| 22 | 22 | } |
| 23 | 23 | |
| 24 | 24 | /** |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | if (($dir = $this->dir($dst)) == false) { |
| 43 | - return $this->setError(elFinder::ERROR_TRGDIR_NOT_FOUND, '#'.$dst); |
|
| 43 | + return $this->setError(elFinder::ERROR_TRGDIR_NOT_FOUND, '#' . $dst); |
|
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | if (!$dir['write']) { |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | |
| 82 | 82 | if ($file && $file['name'] === $name) { // file exists and check filename for item ID based filesystem |
| 83 | 83 | // check POST data `overwrite` for 3rd party uploader |
| 84 | - $overwrite = isset($_POST['overwrite'])? (bool)$_POST['overwrite'] : $this->options['uploadOverwrite']; |
|
| 84 | + $overwrite = isset($_POST['overwrite']) ? (bool) $_POST['overwrite'] : $this->options['uploadOverwrite']; |
|
| 85 | 85 | if ($overwrite) { |
| 86 | 86 | if (!$file['write']) { |
| 87 | 87 | return $this->setError(elFinder::ERROR_PERM_DENIED); |
@@ -280,7 +280,7 @@ discard block |
||
| 280 | 280 | $output[] = $object->extra; |
| 281 | 281 | } |
| 282 | 282 | $parent = $object->get_parent(); |
| 283 | - while ( $parent |
|
| 283 | + while ($parent |
|
| 284 | 284 | && $parent->component == 'org.openpsa.documents') |
| 285 | 285 | { |
| 286 | 286 | $output[] = $parent->extra; |
@@ -354,8 +354,7 @@ discard block |
||
| 354 | 354 | } |
| 355 | 355 | $object = midcom::get()->dbfactory->get_object_by_guid($path); |
| 356 | 356 | |
| 357 | - $data = array |
|
| 358 | - ( |
|
| 357 | + $data = array( |
|
| 359 | 358 | 'ts' => $object->metadata->revised, |
| 360 | 359 | 'read' => true, |
| 361 | 360 | 'write' => $object->can_do('midgard:update'), |
@@ -465,7 +464,7 @@ discard block |
||
| 465 | 464 | * @param string $mode open mode |
| 466 | 465 | * @return resource|false |
| 467 | 466 | */ |
| 468 | - protected function _fopen($path, $mode="rb") |
|
| 467 | + protected function _fopen($path, $mode = "rb") |
|
| 469 | 468 | { |
| 470 | 469 | $document = new org_openpsa_documents_document_dba($path); |
| 471 | 470 | $attachments = org_openpsa_helpers::get_dm2_attachments($document, 'document'); |
@@ -484,7 +483,7 @@ discard block |
||
| 484 | 483 | * @param string $path file path |
| 485 | 484 | * @return bool |
| 486 | 485 | */ |
| 487 | - protected function _fclose($fp, $path='') |
|
| 486 | + protected function _fclose($fp, $path = '') |
|
| 488 | 487 | { |
| 489 | 488 | fclose($fp); |
| 490 | 489 | return true; |
@@ -688,7 +687,7 @@ discard block |
||
| 688 | 687 | { |
| 689 | 688 | $filename = midcom_db_attachment::safe_filename($name, true); |
| 690 | 689 | $att = $doc->create_attachment($filename, $name, $mimetype); |
| 691 | - if ( !$att |
|
| 690 | + if (!$att |
|
| 692 | 691 | || !$att->copy_from_handle($fp)) |
| 693 | 692 | { |
| 694 | 693 | return false; |
@@ -144,8 +144,7 @@ discard block |
||
| 144 | 144 | $topic = new org_openpsa_documents_directory($path); |
| 145 | 145 | $parent = $topic->get_parent(); |
| 146 | 146 | return $parent->guid; |
| 147 | - } |
|
| 148 | - catch (midcom_error $e) |
|
| 147 | + } catch (midcom_error $e) |
|
| 149 | 148 | { |
| 150 | 149 | $e->log(); |
| 151 | 150 | try |
@@ -153,8 +152,7 @@ discard block |
||
| 153 | 152 | $document = new org_openpsa_documents_document_dba($path); |
| 154 | 153 | $parent = $document->get_parent(); |
| 155 | 154 | return $parent->guid; |
| 156 | - } |
|
| 157 | - catch (midcom_error $e) |
|
| 155 | + } catch (midcom_error $e) |
|
| 158 | 156 | { |
| 159 | 157 | $e->log(); |
| 160 | 158 | return ''; |
@@ -174,16 +172,14 @@ discard block |
||
| 174 | 172 | { |
| 175 | 173 | $topic = new org_openpsa_documents_directory($path); |
| 176 | 174 | return $topic->extra; |
| 177 | - } |
|
| 178 | - catch (midcom_error $e) |
|
| 175 | + } catch (midcom_error $e) |
|
| 179 | 176 | { |
| 180 | 177 | $e->log(); |
| 181 | 178 | try |
| 182 | 179 | { |
| 183 | 180 | $document = new org_openpsa_documents_document_dba($path); |
| 184 | 181 | return $document->title; |
| 185 | - } |
|
| 186 | - catch (midcom_error $e) |
|
| 182 | + } catch (midcom_error $e) |
|
| 187 | 183 | { |
| 188 | 184 | $e->log(); |
| 189 | 185 | return ''; |
@@ -263,8 +259,7 @@ discard block |
||
| 263 | 259 | try |
| 264 | 260 | { |
| 265 | 261 | $object = midcom::get()->dbfactory->get_object_by_guid($path); |
| 266 | - } |
|
| 267 | - catch (midcom_error $e) |
|
| 262 | + } catch (midcom_error $e) |
|
| 268 | 263 | { |
| 269 | 264 | $e->log(); |
| 270 | 265 | return ''; |
@@ -274,8 +269,7 @@ discard block |
||
| 274 | 269 | if ($object instanceof org_openpsa_documents_document_dba) |
| 275 | 270 | { |
| 276 | 271 | $output[] = $object->title; |
| 277 | - } |
|
| 278 | - else |
|
| 272 | + } else |
|
| 279 | 273 | { |
| 280 | 274 | $output[] = $object->extra; |
| 281 | 275 | } |
@@ -308,8 +302,7 @@ discard block |
||
| 308 | 302 | try |
| 309 | 303 | { |
| 310 | 304 | $parentdir = new org_openpsa_documents_directory($parent); |
| 311 | - } |
|
| 312 | - catch (midcom_error $e) |
|
| 305 | + } catch (midcom_error $e) |
|
| 313 | 306 | { |
| 314 | 307 | $e->log(); |
| 315 | 308 | return false; |
@@ -320,8 +313,7 @@ discard block |
||
| 320 | 313 | if ($object instanceof org_openpsa_documents_document_dba) |
| 321 | 314 | { |
| 322 | 315 | $qb->add_constraint('id', '=', $object->topic); |
| 323 | - } |
|
| 324 | - else |
|
| 316 | + } else |
|
| 325 | 317 | { |
| 326 | 318 | $qb->add_constraint('id', '=', $object->id); |
| 327 | 319 | } |
@@ -380,8 +372,7 @@ discard block |
||
| 380 | 372 | $data['size'] = $stat['size']; |
| 381 | 373 | } |
| 382 | 374 | } |
| 383 | - } |
|
| 384 | - else |
|
| 375 | + } else |
|
| 385 | 376 | { |
| 386 | 377 | $parentfield = 'up'; |
| 387 | 378 | $group = midcom::get()->auth->get_assignee($object->get_parameter('org.openpsa.core', 'orgOpenpsaOwnerWg')); |
@@ -612,8 +603,7 @@ discard block |
||
| 612 | 603 | { |
| 613 | 604 | return $source; |
| 614 | 605 | } |
| 615 | - } |
|
| 616 | - catch (midcom_error $e) |
|
| 606 | + } catch (midcom_error $e) |
|
| 617 | 607 | { |
| 618 | 608 | $e->log(); |
| 619 | 609 | $dir = new org_openpsa_documents_directory($source); |
@@ -640,8 +630,7 @@ discard block |
||
| 640 | 630 | { |
| 641 | 631 | $doc = new org_openpsa_documents_document_dba($path); |
| 642 | 632 | return $doc->delete(); |
| 643 | - } |
|
| 644 | - catch (midcom_error $e) |
|
| 633 | + } catch (midcom_error $e) |
|
| 645 | 634 | { |
| 646 | 635 | return false; |
| 647 | 636 | } |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | $search_config = org_openpsa_widgets_ui::get_search_providers(); |
| 3 | -if ( array_key_exists('org.openpsa.documents', $search_config) |
|
| 3 | +if (array_key_exists('org.openpsa.documents', $search_config) |
|
| 4 | 4 | && midcom::get()->indexer->enabled()) |
| 5 | 5 | { |
| 6 | 6 | $prefix = midcom_core_context::get()->get_key(MIDCOM_CONTEXT_ANCHORPREFIX); |
@@ -1,11 +1,11 @@ |
||
| 1 | 1 | <div class="area org_openpsa_helper_box"> |
| 2 | -<h3><?php echo $data['l10n']->get('folders');?></h3> |
|
| 2 | +<h3><?php echo $data['l10n']->get('folders'); ?></h3> |
|
| 3 | 3 | <?php |
| 4 | 4 | midcom_show_style('show-search-form-simple'); |
| 5 | 5 | |
| 6 | 6 | $nap = new midcom_helper_nav(); |
| 7 | 7 | $current_node = $nap->get_node($nap->get_current_node()); |
| 8 | 8 | $url = $current_node[MIDCOM_NAV_RELATIVEURL]; |
| 9 | -midcom::get()->dynamic_load($url. "directory/navigation/"); |
|
| 9 | +midcom::get()->dynamic_load($url . "directory/navigation/"); |
|
| 10 | 10 | ?> |
| 11 | 11 | </div> |
| 12 | 12 | \ No newline at end of file |
@@ -1,3 +1,3 @@ |
||
| 1 | 1 | |
| 2 | -<li class="folder" id="key_<?php echo $data["id"];?>"> |
|
| 3 | - <a href="<?php echo $data["link_url"];?>"><?php echo $data["name"]; ?></a> |
|
| 4 | 2 | \ No newline at end of file |
| 3 | +<li class="folder" id="key_<?php echo $data["id"]; ?>"> |
|
| 4 | + <a href="<?php echo $data["link_url"]; ?>"><?php echo $data["name"]; ?></a> |
|
| 5 | 5 | \ No newline at end of file |
@@ -18,8 +18,7 @@ discard block |
||
| 18 | 18 | public $__midcom_class_name__ = __CLASS__; |
| 19 | 19 | public $__mgdschema_class_name__ = 'org_openpsa_document'; |
| 20 | 20 | |
| 21 | - public $autodelete_dependents = array |
|
| 22 | - ( |
|
| 21 | + public $autodelete_dependents = array( |
|
| 23 | 22 | 'org_openpsa_documents_document_dba' => 'nextVersion' |
| 24 | 23 | ); |
| 25 | 24 | |
@@ -79,7 +78,7 @@ discard block |
||
| 79 | 78 | return; |
| 80 | 79 | } |
| 81 | 80 | $parent = $this->get_parent(); |
| 82 | - if ( $parent |
|
| 81 | + if ($parent |
|
| 83 | 82 | && $parent->component == 'org.openpsa.documents') |
| 84 | 83 | { |
| 85 | 84 | midcom::get()->auth->request_sudo('org.openpsa.documents'); |
@@ -95,7 +94,7 @@ discard block |
||
| 95 | 94 | |
| 96 | 95 | public function get_class() |
| 97 | 96 | { |
| 98 | - if ( !midcom::get()->auth->user |
|
| 97 | + if (!midcom::get()->auth->user |
|
| 99 | 98 | || empty($this->guid)) |
| 100 | 99 | { |
| 101 | 100 | return ''; |
@@ -103,7 +102,7 @@ discard block |
||
| 103 | 102 | $person = midcom::get()->auth->user->get_storage(); |
| 104 | 103 | $lastvisited = $person->get_parameter('org.openpsa.documents_visited', $this->guid); |
| 105 | 104 | |
| 106 | - if ( $lastvisited |
|
| 105 | + if ($lastvisited |
|
| 107 | 106 | && $lastvisited > $this->metadata->revised) |
| 108 | 107 | { |
| 109 | 108 | return 'visited'; |
@@ -201,7 +200,7 @@ discard block |
||
| 201 | 200 | * if nothing matched so far and the subtype is alphanumeric, uppercase it on the theory |
| 202 | 201 | * that it's probably a file extension |
| 203 | 202 | */ |
| 204 | - if ( $parts[1] == $subtype |
|
| 203 | + if ($parts[1] == $subtype |
|
| 205 | 204 | && preg_match('/^[a-z0-9]+$/', $subtype)) |
| 206 | 205 | { |
| 207 | 206 | $subtype = strtoupper($subtype); |
@@ -218,7 +217,7 @@ discard block |
||
| 218 | 217 | // Copy current properties |
| 219 | 218 | foreach ($properties as $key) |
| 220 | 219 | { |
| 221 | - if ( $key != 'guid' |
|
| 220 | + if ($key != 'guid' |
|
| 222 | 221 | && $key != 'id' |
| 223 | 222 | && $key != 'metadata') |
| 224 | 223 | { |
@@ -263,7 +262,7 @@ discard block |
||
| 263 | 262 | $backup_attachment = $backup->create_attachment($original_attachment->name, $original_attachment->title, $original_attachment->mimetype); |
| 264 | 263 | |
| 265 | 264 | $original_handle = $original_attachment->open('r'); |
| 266 | - if ( !$backup_attachment |
|
| 265 | + if (!$backup_attachment |
|
| 267 | 266 | || !$original_handle) |
| 268 | 267 | { |
| 269 | 268 | // Failed to copy the attachment, abort |
@@ -177,12 +177,10 @@ |
||
| 177 | 177 | { |
| 178 | 178 | $type = str_replace('vnd.oasis.opendocument.', '', $subtype); |
| 179 | 179 | $subtype = 'OpenDocument'; |
| 180 | - } |
|
| 181 | - else if (preg_match('/^vnd\.ms/', $subtype)) |
|
| 180 | + } else if (preg_match('/^vnd\.ms/', $subtype)) |
|
| 182 | 181 | { |
| 183 | 182 | $subtype = ucfirst(str_replace('vnd.ms-', '', $subtype)); |
| 184 | - } |
|
| 185 | - else if (preg_match('/^vnd\.openxmlformats/', $subtype)) |
|
| 183 | + } else if (preg_match('/^vnd\.openxmlformats/', $subtype)) |
|
| 186 | 184 | { |
| 187 | 185 | $type = str_replace('vnd.openxmlformats-officedocument.', '', $subtype); |
| 188 | 186 | $type = str_replace('ml.', ' ', $type); |