Skip to content
This repository was archived by the owner on Jul 24, 2018. It is now read-only.

[WIP] Annotations #274

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions ajax/documentController.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,27 @@ public static function rename($args){
'message' => Config::getL10n()->t('You don\'t have permission to rename this document')
));
}

public static function canReview($args){
self::preDispatch();
$fileId = intval(Helper::getArrayValueByKey($args, 'file_id', 0));
$shareWith = Helper::getArrayValueByKey($_POST, 'share_with');
\OCP\JSON::success(array('canReview'=> Db_Review::canReview($fileId, $shareWith)));
}

public static function updateReview($args){
self::preDispatch();
$fileId = intval(Helper::getArrayValueByKey($args, 'file_id', 0));
$shareWith = Helper::getArrayValueByKey($_POST, 'share_with');
$reviewAllowed = (bool) intval(Helper::getArrayValueByKey($_POST, 'can_review', 0));

if ($reviewAllowed){
Db_Review::addEntry($fileId, $shareWith);
} else {
Db_Review::removeEntry($fileId, $shareWith);
}
\OCP\JSON::success(array('canReview'=> Db_Review::canReview($fileId, $shareWith)));
}

/**
* lists the documents the user has access to (including shared files, once the code in core has been fixed)
Expand Down
1 change: 1 addition & 0 deletions appinfo/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
OC::$CLASSPATH['OCA\Documents\Db_Session'] = 'documents/lib/db/session.php';
OC::$CLASSPATH['OCA\Documents\Db_Member'] = 'documents/lib/db/member.php';
OC::$CLASSPATH['OCA\Documents\Db_Op'] = 'documents/lib/db/op.php';
OC::$CLASSPATH['OCA\Documents\Db_Review'] = 'documents/lib/db/review.php';
OC::$CLASSPATH['OCA\Documents\Filter_Office'] = 'documents/lib/filter/office.php';

//Script for registering file actions
Expand Down
28 changes: 4 additions & 24 deletions appinfo/database.xml
Original file line number Diff line number Diff line change
Expand Up @@ -178,36 +178,16 @@
</declaration>
</table>
<table>
<name>*dbprefix*documents_invite</name>
<name>*dbprefix*documents_review</name>
<declaration>

<field>
<name>es_id</name>
<type>text</type>
<notnull>true</notnull>
<length>64</length>
<comments>Related editing session id</comments>
</field>
<field>
<name>uid</name>
<type>text</type>
<length>64</length>
</field>
<field>
<name>status</name>
<name>share_id</name>
<type>integer</type>
<default>0</default>
<length>2</length>
</field>
<field>
<name>sent_on</name>
<type>integer</type>
<default></default>
<notnull>false</notnull>
<unsigned>true</unsigned>
<notnull>true</notnull>
<length>4</length>
</field>

</field>
</declaration>
</table>
<table>
Expand Down
8 changes: 8 additions & 0 deletions appinfo/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@
->get()
->action('\OCA\Documents\DocumentController', 'listAll')
;
$this->create('documents_review_status', 'ajax/document/can_review/{file_id}')
->post()
->action('\OCA\Documents\DocumentController', 'canReview')
;
$this->create('documents_review_update', 'ajax/document/update_review/{file_id}')
->post()
->action('\OCA\Documents\DocumentController', 'updateReview')
;

/**
* Session routes
Expand Down
2 changes: 1 addition & 1 deletion appinfo/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.8.1
0.8.2
24 changes: 24 additions & 0 deletions css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,12 @@
white-space: nowrap;
}

.document button{
position: absolute;
z-index: 50;
margin: 3px;
}

#odf-toolbar{
text-align: left;
position: absolute;
Expand Down Expand Up @@ -234,6 +240,24 @@
top: 87px;
}

/* Review mode */

.documents-review #collaboration{
display:none;
}
#webodfeditor-toolbar0{
margin-top:31px;
}

.documents-review #mainContainer{
text-align: center;
}

#webodfeditor-editor0{
background-color: transparent;
padding:0;
}

/* override WebODF styling here */
#mainContainer #collaboration{
float:right;position: relative;z-index: 1;
Expand Down
Loading