@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | |
| 53 | 53 | public function create($title, $stackId, $type, $order, $owner) { |
| 54 | 54 | $this->permissionService->checkPermission($this->stackMapper, $stackId, Acl::PERMISSION_EDIT); |
| 55 | - if($this->boardService->isArchived($this->stackMapper, $stackId)) { |
|
| 55 | + if ($this->boardService->isArchived($this->stackMapper, $stackId)) { |
|
| 56 | 56 | throw new StatusException('Operation not allowed. This board is archived.'); |
| 57 | 57 | } |
| 58 | 58 | $card = new Card(); |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | |
| 68 | 68 | public function delete($id) { |
| 69 | 69 | $this->permissionService->checkPermission($this->cardMapper, $id, Acl::PERMISSION_EDIT); |
| 70 | - if($this->boardService->isArchived($this->cardMapper, $id)) { |
|
| 70 | + if ($this->boardService->isArchived($this->cardMapper, $id)) { |
|
| 71 | 71 | throw new StatusException('Operation not allowed. This board is archived.'); |
| 72 | 72 | } |
| 73 | 73 | return $this->cardMapper->delete($this->cardMapper->find($id)); |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | |
| 76 | 76 | public function update($id, $title, $stackId, $type, $order, $description, $owner, $duedate) { |
| 77 | 77 | $this->permissionService->checkPermission($this->cardMapper, $id, Acl::PERMISSION_EDIT); |
| 78 | - if($this->boardService->isArchived($this->cardMapper, $id)) { |
|
| 78 | + if ($this->boardService->isArchived($this->cardMapper, $id)) { |
|
| 79 | 79 | throw new StatusException('Operation not allowed. This board is archived.'); |
| 80 | 80 | } |
| 81 | 81 | $card = $this->cardMapper->find($id); |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | |
| 95 | 95 | public function rename($id, $title) { |
| 96 | 96 | $this->permissionService->checkPermission($this->cardMapper, $id, Acl::PERMISSION_EDIT); |
| 97 | - if($this->boardService->isArchived($this->cardMapper, $id)) { |
|
| 97 | + if ($this->boardService->isArchived($this->cardMapper, $id)) { |
|
| 98 | 98 | throw new StatusException('Operation not allowed. This board is archived.'); |
| 99 | 99 | } |
| 100 | 100 | $card = $this->cardMapper->find($id); |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | |
| 108 | 108 | public function reorder($id, $stackId, $order) { |
| 109 | 109 | $this->permissionService->checkPermission($this->cardMapper, $id, Acl::PERMISSION_EDIT); |
| 110 | - if($this->boardService->isArchived($this->cardMapper, $id)) { |
|
| 110 | + if ($this->boardService->isArchived($this->cardMapper, $id)) { |
|
| 111 | 111 | throw new StatusException('Operation not allowed. This board is archived.'); |
| 112 | 112 | } |
| 113 | 113 | $cards = $this->cardMapper->findAll($stackId); |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | |
| 139 | 139 | public function archive($id) { |
| 140 | 140 | $this->permissionService->checkPermission($this->cardMapper, $id, Acl::PERMISSION_EDIT); |
| 141 | - if($this->boardService->isArchived($this->cardMapper, $id)) { |
|
| 141 | + if ($this->boardService->isArchived($this->cardMapper, $id)) { |
|
| 142 | 142 | throw new StatusException('Operation not allowed. This board is archived.'); |
| 143 | 143 | } |
| 144 | 144 | $card = $this->cardMapper->find($id); |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | |
| 149 | 149 | public function unarchive($id) { |
| 150 | 150 | $this->permissionService->checkPermission($this->cardMapper, $id, Acl::PERMISSION_EDIT); |
| 151 | - if($this->boardService->isArchived($this->cardMapper, $id)) { |
|
| 151 | + if ($this->boardService->isArchived($this->cardMapper, $id)) { |
|
| 152 | 152 | throw new StatusException('Operation not allowed. This board is archived.'); |
| 153 | 153 | } |
| 154 | 154 | $card = $this->cardMapper->find($id); |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | |
| 159 | 159 | public function assignLabel($cardId, $labelId) { |
| 160 | 160 | $this->permissionService->checkPermission($this->cardMapper, $cardId, Acl::PERMISSION_EDIT); |
| 161 | - if($this->boardService->isArchived($this->cardMapper, $cardId)) { |
|
| 161 | + if ($this->boardService->isArchived($this->cardMapper, $cardId)) { |
|
| 162 | 162 | throw new StatusException('Operation not allowed. This board is archived.'); |
| 163 | 163 | } |
| 164 | 164 | $card = $this->cardMapper->find($cardId); |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | |
| 171 | 171 | public function removeLabel($cardId, $labelId) { |
| 172 | 172 | $this->permissionService->checkPermission($this->cardMapper, $cardId, Acl::PERMISSION_EDIT); |
| 173 | - if($this->boardService->isArchived($this->cardMapper, $cardId)) { |
|
| 173 | + if ($this->boardService->isArchived($this->cardMapper, $cardId)) { |
|
| 174 | 174 | throw new StatusException('Operation not allowed. This board is archived.'); |
| 175 | 175 | } |
| 176 | 176 | $card = $this->cardMapper->find($cardId); |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | Util::addScript('deck', 'vendor/markdown-it-link-target/dist/markdown-it-link-target.min'); |
| 39 | 39 | Util::addScript('deck', 'vendor/jquery-timepicker/jquery.ui.timepicker'); |
| 40 | 40 | |
| 41 | -if(!\OC::$server->getConfig()->getSystemValue('debug', false)) { |
|
| 41 | +if (!\OC::$server->getConfig()->getSystemValue('debug', false)) { |
|
| 42 | 42 | Util::addScript('deck', 'public/app'); |
| 43 | 43 | } else { |
| 44 | 44 | // Load seperate JS files when debug mode is enabled |
@@ -49,9 +49,9 @@ discard block |
||
| 49 | 49 | 'filters' => ['boardFilterAcl', 'cardFilter', 'cardSearchFilter', 'iconWhiteFilter', 'lightenColorFilter', 'orderObjectBy', 'dateFilters', 'textColorFilter'], |
| 50 | 50 | 'service' => ['ApiService', 'BoardService', 'CardService', 'LabelService', 'StackService', 'StatusService'], |
| 51 | 51 | ]; |
| 52 | - foreach($js as $folder=>$files) { |
|
| 52 | + foreach ($js as $folder=>$files) { |
|
| 53 | 53 | foreach ($files as $file) { |
| 54 | - Util::addScript('deck', $folder.'/'.$file); |
|
| 54 | + Util::addScript('deck', $folder . '/' . $file); |
|
| 55 | 55 | } |
| 56 | 56 | } |
| 57 | 57 | } |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | public function getDuedate() { |
| 62 | - if($this->duedate === null) |
|
| 62 | + if ($this->duedate === null) |
|
| 63 | 63 | return null; |
| 64 | 64 | $dt = new DateTime($this->duedate); |
| 65 | 65 | return $dt->format('c'); |
@@ -71,16 +71,16 @@ discard block |
||
| 71 | 71 | $due = strtotime($this->duedate); |
| 72 | 72 | |
| 73 | 73 | $today = new DateTime(); |
| 74 | - $today->setTime( 0, 0, 0 ); |
|
| 74 | + $today->setTime(0, 0, 0); |
|
| 75 | 75 | |
| 76 | 76 | $match_date = new DateTime($this->duedate); |
| 77 | 77 | |
| 78 | - $match_date->setTime( 0, 0, 0 ); |
|
| 78 | + $match_date->setTime(0, 0, 0); |
|
| 79 | 79 | |
| 80 | - $diff = $today->diff( $match_date ); |
|
| 81 | - $diffDays = (integer)$diff->format( "%R%a" ); // Extract days count in interval |
|
| 80 | + $diff = $today->diff($match_date); |
|
| 81 | + $diffDays = (integer) $diff->format("%R%a"); // Extract days count in interval |
|
| 82 | 82 | |
| 83 | - if($due !== false) { |
|
| 83 | + if ($due !== false) { |
|
| 84 | 84 | if ($diffDays === 1) { |
| 85 | 85 | $json['overdue'] = self::DUEDATE_NEXT; |
| 86 | 86 | } |
@@ -59,8 +59,9 @@ |
||
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | public function getDuedate() { |
| 62 | - if($this->duedate === null) |
|
| 63 | - return null; |
|
| 62 | + if($this->duedate === null) { |
|
| 63 | + return null; |
|
| 64 | + } |
|
| 64 | 65 | $dt = new DateTime($this->duedate); |
| 65 | 66 | return $dt->format('c'); |
| 66 | 67 | } |