diff --git a/.gitignore b/.gitignore index d7b19abe8d..37767b9e8f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ data/logs/* data/cache/* +data/upload/* application/config.php /test.php /test2.php @@ -8,4 +9,4 @@ application/Espo/Modules/Crm/Resources/metadata/scopes/CustomTest.json application/Espo/Resources/layouts/CustomTest/* application/Espo/Modules/Crm/Resources/layouts/CustomTest/* application/Espo/Resources/metadata/customTest/* -application/Espo/Modules/Crm/Resources/metadata/customTest/* \ No newline at end of file +application/Espo/Modules/Crm/Resources/metadata/customTest/* diff --git a/application/Espo/Resources/layouts/Note/detail.json b/application/Espo/Resources/layouts/Note/detail.json new file mode 100644 index 0000000000..992557ede7 --- /dev/null +++ b/application/Espo/Resources/layouts/Note/detail.json @@ -0,0 +1,13 @@ +[ + { + "label":"", + "rows": [ + [ + {"name":"message"} + ], + [ + {"name":"attachments","type": "attachmentMultiple"} + ] + ] + } +] diff --git a/application/Espo/Resources/layouts/Note/detailSmall.json b/application/Espo/Resources/layouts/Note/detailSmall.json index df2e9546ba..992557ede7 100644 --- a/application/Espo/Resources/layouts/Note/detailSmall.json +++ b/application/Espo/Resources/layouts/Note/detailSmall.json @@ -6,7 +6,7 @@ {"name":"message"} ], [ - {"name":"attachments"} + {"name":"attachments","type": "attachmentMultiple"} ] ] } diff --git a/application/Espo/Resources/metadata/viewDefs/Note.json b/application/Espo/Resources/metadata/viewDefs/Note.json new file mode 100644 index 0000000000..882761511b --- /dev/null +++ b/application/Espo/Resources/metadata/viewDefs/Note.json @@ -0,0 +1,6 @@ +{ + "recordViews":{ + "edit":"Note.Record.Edit", + "editQuick":"Note.Record.Edit" + } +} diff --git a/application/Espo/Services/Stream.php b/application/Espo/Services/Stream.php index aa1693261a..d3e8bf8f73 100644 --- a/application/Espo/Services/Stream.php +++ b/application/Espo/Services/Stream.php @@ -51,11 +51,17 @@ class Stream extends \Espo\Core\Services\Base $collection = $this->getEntityManager()->getRepository('Note')->find($selectParams); + foreach ($collection as $e) { + if ($e->get('type') == 'Post') { + $e->loadLinkMultipleField('attachments'); + } + } + foreach ($collection as $e) { if ($e->get('type') == 'Post' && $e->get('parentId') && $e->get('parentType')) { $entity = $this->getEntityManager()->getEntity($e->get('parentType'), $e->get('parentId')); $e->set('parentName', $entity->get('name')); - } + } } $count = $this->getEntityManager()->getRepository('Note')->count($selectParams); @@ -94,6 +100,12 @@ class Stream extends \Espo\Core\Services\Base 'order' => 'DESC' )); + foreach ($collection as $e) { + if ($e->get('type') == 'Post') { + $e->loadLinkMultipleField('attachments'); + } + } + $count = $this->getEntityManager()->getRepository('Note')->count(array( 'whereClause' => $where, )); diff --git a/data/upload/52d7f79f200b8 b/data/upload/52d7f79f200b8 deleted file mode 100644 index a5ed334e75..0000000000 --- a/data/upload/52d7f79f200b8 +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env xdg-open -[Desktop Entry] -Version=1.0 -Type=Link -Icon[en_US]=gnome-panel-launcher -URL=/var/www -Name[en_US]=www -Name=www -Icon=gnome-panel-launcher diff --git a/data/upload/52d7f7a1b3927 b/data/upload/52d7f7a1b3927 deleted file mode 100644 index bd0b889adf..0000000000 --- a/data/upload/52d7f7a1b3927 +++ /dev/null @@ -1,19 +0,0 @@ -git remote add upstream git@github.com:sugarcrm/Mango.git -git checkout -t -b caramel upstream/caramel -git checkout -b caramel - -git fetch upstream -git checkout caramel -git merge upstream/caramel - -git add --all -git commit -m 'comment' -git push origin caramel - - -git push -f origin HEAD^:master // remove last push from remote -git reset --soft HEAD^ - -git stash -git stash apply -git stash drop diff --git a/data/upload/52d7f7de5e7fa b/data/upload/52d7f7de5e7fa deleted file mode 100644 index a5ed334e75..0000000000 --- a/data/upload/52d7f7de5e7fa +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env xdg-open -[Desktop Entry] -Version=1.0 -Type=Link -Icon[en_US]=gnome-panel-launcher -URL=/var/www -Name[en_US]=www -Name=www -Icon=gnome-panel-launcher diff --git a/data/upload/52d7f7e06a2e8 b/data/upload/52d7f7e06a2e8 deleted file mode 100644 index bd0b889adf..0000000000 --- a/data/upload/52d7f7e06a2e8 +++ /dev/null @@ -1,19 +0,0 @@ -git remote add upstream git@github.com:sugarcrm/Mango.git -git checkout -t -b caramel upstream/caramel -git checkout -b caramel - -git fetch upstream -git checkout caramel -git merge upstream/caramel - -git add --all -git commit -m 'comment' -git push origin caramel - - -git push -f origin HEAD^:master // remove last push from remote -git reset --soft HEAD^ - -git stash -git stash apply -git stash drop diff --git a/data/upload/52d7f80cbeeaf b/data/upload/52d7f80cbeeaf deleted file mode 100644 index a5ed334e75..0000000000 --- a/data/upload/52d7f80cbeeaf +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env xdg-open -[Desktop Entry] -Version=1.0 -Type=Link -Icon[en_US]=gnome-panel-launcher -URL=/var/www -Name[en_US]=www -Name=www -Icon=gnome-panel-launcher diff --git a/data/upload/52d7f80f8878f b/data/upload/52d7f80f8878f deleted file mode 100644 index bd0b889adf..0000000000 --- a/data/upload/52d7f80f8878f +++ /dev/null @@ -1,19 +0,0 @@ -git remote add upstream git@github.com:sugarcrm/Mango.git -git checkout -t -b caramel upstream/caramel -git checkout -b caramel - -git fetch upstream -git checkout caramel -git merge upstream/caramel - -git add --all -git commit -m 'comment' -git push origin caramel - - -git push -f origin HEAD^:master // remove last push from remote -git reset --soft HEAD^ - -git stash -git stash apply -git stash drop diff --git a/data/upload/52d7f9c5e00de b/data/upload/52d7f9c5e00de deleted file mode 100644 index a5ed334e75..0000000000 --- a/data/upload/52d7f9c5e00de +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env xdg-open -[Desktop Entry] -Version=1.0 -Type=Link -Icon[en_US]=gnome-panel-launcher -URL=/var/www -Name[en_US]=www -Name=www -Icon=gnome-panel-launcher diff --git a/data/upload/52d7f9c7cacc9 b/data/upload/52d7f9c7cacc9 deleted file mode 100644 index bd0b889adf..0000000000 --- a/data/upload/52d7f9c7cacc9 +++ /dev/null @@ -1,19 +0,0 @@ -git remote add upstream git@github.com:sugarcrm/Mango.git -git checkout -t -b caramel upstream/caramel -git checkout -b caramel - -git fetch upstream -git checkout caramel -git merge upstream/caramel - -git add --all -git commit -m 'comment' -git push origin caramel - - -git push -f origin HEAD^:master // remove last push from remote -git reset --soft HEAD^ - -git stash -git stash apply -git stash drop diff --git a/data/upload/52d7fa8f1256f b/data/upload/52d7fa8f1256f deleted file mode 100644 index a5ed334e75..0000000000 --- a/data/upload/52d7fa8f1256f +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env xdg-open -[Desktop Entry] -Version=1.0 -Type=Link -Icon[en_US]=gnome-panel-launcher -URL=/var/www -Name[en_US]=www -Name=www -Icon=gnome-panel-launcher diff --git a/data/upload/52d7fa90cf95c b/data/upload/52d7fa90cf95c deleted file mode 100644 index bd0b889adf..0000000000 --- a/data/upload/52d7fa90cf95c +++ /dev/null @@ -1,19 +0,0 @@ -git remote add upstream git@github.com:sugarcrm/Mango.git -git checkout -t -b caramel upstream/caramel -git checkout -b caramel - -git fetch upstream -git checkout caramel -git merge upstream/caramel - -git add --all -git commit -m 'comment' -git push origin caramel - - -git push -f origin HEAD^:master // remove last push from remote -git reset --soft HEAD^ - -git stash -git stash apply -git stash drop diff --git a/data/upload/52d8007335b05 b/data/upload/52d8007335b05 deleted file mode 100644 index a5ed334e75..0000000000 --- a/data/upload/52d8007335b05 +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env xdg-open -[Desktop Entry] -Version=1.0 -Type=Link -Icon[en_US]=gnome-panel-launcher -URL=/var/www -Name[en_US]=www -Name=www -Icon=gnome-panel-launcher diff --git a/data/upload/52d80204bad7a b/data/upload/52d80204bad7a deleted file mode 100644 index a5ed334e75..0000000000 --- a/data/upload/52d80204bad7a +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env xdg-open -[Desktop Entry] -Version=1.0 -Type=Link -Icon[en_US]=gnome-panel-launcher -URL=/var/www -Name[en_US]=www -Name=www -Icon=gnome-panel-launcher diff --git a/data/upload/52d803585a5f5 b/data/upload/52d803585a5f5 deleted file mode 100644 index a5ed334e75..0000000000 --- a/data/upload/52d803585a5f5 +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env xdg-open -[Desktop Entry] -Version=1.0 -Type=Link -Icon[en_US]=gnome-panel-launcher -URL=/var/www -Name[en_US]=www -Name=www -Icon=gnome-panel-launcher diff --git a/data/upload/52d8039b1fc34 b/data/upload/52d8039b1fc34 deleted file mode 100644 index bd0b889adf..0000000000 --- a/data/upload/52d8039b1fc34 +++ /dev/null @@ -1,19 +0,0 @@ -git remote add upstream git@github.com:sugarcrm/Mango.git -git checkout -t -b caramel upstream/caramel -git checkout -b caramel - -git fetch upstream -git checkout caramel -git merge upstream/caramel - -git add --all -git commit -m 'comment' -git push origin caramel - - -git push -f origin HEAD^:master // remove last push from remote -git reset --soft HEAD^ - -git stash -git stash apply -git stash drop diff --git a/data/upload/52d8039dd386a b/data/upload/52d8039dd386a deleted file mode 100644 index a5ed334e75..0000000000 --- a/data/upload/52d8039dd386a +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env xdg-open -[Desktop Entry] -Version=1.0 -Type=Link -Icon[en_US]=gnome-panel-launcher -URL=/var/www -Name[en_US]=www -Name=www -Icon=gnome-panel-launcher diff --git a/data/upload/52d803a610aad b/data/upload/52d803a610aad deleted file mode 100644 index f168af234d..0000000000 --- a/data/upload/52d803a610aad +++ /dev/null @@ -1,38 +0,0 @@ -espoMetadata)) { - return $this->espoMetadata; - } - - $espoMetadataFile = Util::concatPath($this->getConfig()->get('cachePath'), 'ormMetadata.php'); - - if (!file_exists($espoMetadataFile) || !$this->getConfig()->get('useCache')) { - $this->getConverter()->process(); - } - - $this->espoMetadata = $this->getFileManager()->getContent($espoMetadataFile); - - return $this->espoMetadata; - } - - public function setOrmMetadata(array $espoMetadata) - { - $result = $this->getFileManager()->setContentPHP($espoMetadata, $this->getConfig()->get('cachePath'), 'ormMetadata.php'); - if ($result == false) { - $GLOBALS['log']->add('EXCEPTION', 'Metadata::setOrmMetadata() - Cannot save ormMetadata to a file'); - throw new \Espo\Core\Exceptions\Error(); - } - - $this->espoMetadata = $espoMetadata; - - return $result; - } - -} - diff --git a/data/upload/52d804b39c181 b/data/upload/52d804b39c181 deleted file mode 100644 index a5ed334e75..0000000000 --- a/data/upload/52d804b39c181 +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env xdg-open -[Desktop Entry] -Version=1.0 -Type=Link -Icon[en_US]=gnome-panel-launcher -URL=/var/www -Name[en_US]=www -Name=www -Icon=gnome-panel-launcher diff --git a/data/upload/52d804b6726e6 b/data/upload/52d804b6726e6 deleted file mode 100644 index bd0b889adf..0000000000 --- a/data/upload/52d804b6726e6 +++ /dev/null @@ -1,19 +0,0 @@ -git remote add upstream git@github.com:sugarcrm/Mango.git -git checkout -t -b caramel upstream/caramel -git checkout -b caramel - -git fetch upstream -git checkout caramel -git merge upstream/caramel - -git add --all -git commit -m 'comment' -git push origin caramel - - -git push -f origin HEAD^:master // remove last push from remote -git reset --soft HEAD^ - -git stash -git stash apply -git stash drop diff --git a/data/upload/52d804bab19d4 b/data/upload/52d804bab19d4 deleted file mode 100644 index 235f05d338..0000000000 Binary files a/data/upload/52d804bab19d4 and /dev/null differ