-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
unfiled items api calls #152
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -424,6 +424,15 @@ public function items() { | |
$this->permissions | ||
); | ||
} | ||
// Unfiled items | ||
else if ($this->subset == 'unfiled') { | ||
$this->allowMethods(array('GET')); | ||
|
||
$title = "Unfiled items"; | ||
$itemIDs = Zotero_Items::getItemsWithoutCollection( | ||
$this->objectLibraryID | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This will need to use
SELECT * FROM items I
LEFT JOIN itemTopLevel ITL USING (itemID)
LEFT JOIN collectionItems CI USING (itemID)
WHERE libraryID=?
AND ITL.itemID IS NULL
AND CI.collectionID IS NULL There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Makes sense. I added another parameter to |
||
); | ||
} | ||
else if ($this->subset == 'children') { | ||
$item = Zotero_Items::getByLibraryAndKey($this->objectLibraryID, $this->objectKey); | ||
if (!$item) { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -107,6 +107,10 @@ | |
$router->map('/users/i:objectUserID/publications/items/:objectKey/children', ['controller' => 'Items', 'extra' => ['publications' => true, 'subset' => 'children']]); | ||
$router->map('/users/i:objectUserID/publications/items/:objectKey', ['controller' => 'Items', 'extra' => ['publications' => true]]); | ||
|
||
// Unfiled items | ||
$router->map('/users/i:objectUserID/items/unfiled', array('controller' => 'Items', 'extra' => array('subset' => 'unfiled'))); | ||
$router->map('/users/i:objectUserID/items/unfiled/tags', array('controller' => 'Tags', 'extra' => array('subset' => 'unfiled'))); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
// Other top-level URLs, with an optional key and subset | ||
$router->map('/users/i:objectUserID/:controller/:objectKey/:subset'); | ||
$router->map('/groups/i:objectGroupID/:controller/:objectKey/:subset'); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can always use
[…]
instead ofarray(…)
for new code