Merge branch '2016.11' into 2016.11-develop
authorPhilipp Schüle <p.schuele@metaways.de>
Tue, 13 Jun 2017 13:55:17 +0000 (15:55 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Tue, 13 Jun 2017 13:55:17 +0000 (15:55 +0200)
Change-Id: I91ed04756eede4c56b96cf02934a4d7c1d449ed0

1  2 
tests/tine20/Crm/JsonTest.php
tests/tine20/Felamimail/Controller/MessageTest.php
tine20/Felamimail/Controller/Message.php
tine20/Tinebase/Frontend/Cli.php
tine20/Tinebase/Relations.php
tine20/Tinebase/Setup/Update/Release9.php

Simple merge
@@@ -1673,4 -1673,30 +1673,16 @@@ class Felamimail_Controller_MessageTes
          </span><pre><span style="font-family:tahoma;">John Smith
  Photographer', $message->body);
      }
 -
 -    /**
 -     * @see: 0010150: Jump Labels get converted
 -     * 
 -     * https://forge.tine20.org/mantisbt/view.php?id=10150
 -     */
 -    public function testHtmlJumpLabels()
 -    {
 -        $cachedMessage = $this->messageTestHelper('html_jump_labels.eml');
 -        $message = $this->_controller->getCompleteMessage($cachedMessage);
 -        $this->assertContains('<a href="#felamimail_inline_test" target="_blank">test</a>
 -<p>Hello,</p>
 -<p id="felamimail_inline_test">Text Content</p>', $message->body);
 -    }
+     /**
+      * @see 0013150: convert single part file content body to attachment
+      */
+     public function testSinglePartPdfMail()
+     {
+         $cachedMessage = $this->messageTestHelper('single_part_pdf.eml');
+         $message = $this->_controller->getCompleteMessage($cachedMessage);
+         self::assertEquals(1, count($message->attachments));
+         self::assertTrue($message->has_attachment, 'attachments missing!');
+     }
  }
Simple merge
@@@ -503,10 -501,17 +503,18 @@@ class Tinebase_Relation
          if (Tinebase_Core::isLogLevel(Zend_Log::TRACE)) Tinebase_Core::getLogger()->trace(__METHOD__ . '::' . __LINE__
              . ' Relation: ' . print_r($_relation->toArray(), TRUE));
  
-         /** @var Tinebase_Record_Interface $record */
-         $record = $appController->$method($_relation->related_record, $_doCreateUpdateCheck && $this->_doCreateUpdateCheck($_relation));
-         $_relation->related_id = $record->getId();
-         
+         if ($method === 'update' && $appController->doContainerACLChecks()
+             && ! Tinebase_Core::getUser()->hasGrant($_relation->related_record->container_id, Tinebase_Model_Grants::GRANT_EDIT)
+         ) {
+             if (Tinebase_Core::isLogLevel(Zend_Log::NOTICE)) Tinebase_Core::getLogger()->notice(__METHOD__ . '::' . __LINE__
+                 . ' Don\'t update related record because user has no update grant');
+         } else {
++            /** @var Tinebase_Record_Interface $record */
+             $record = $appController->$method($_relation->related_record,
+                 $_doCreateUpdateCheck && $this->_doCreateUpdateCheck($_relation));
+             $_relation->related_id = $record->getId();
+         }
          switch ($_relation->related_model) {
              case 'Addressbook_Model_Contact':
                  $_relation->related_backend = ucfirst(Addressbook_Backend_Factory::SQL);
              }
              $modelMap[$relation->related_model]->addRecord($relation);
          }
 -        
 +
 +        /** @var Tinebase_Record_RecordSet $records */
-         
++
          // fill related_record
          foreach ($modelMap as $modelName => $relations) {
              
@@@ -299,82 -305,7 +305,93 @@@ class Tinebase_Setup_Update_Release9 ex
       */
      public function update_10()
      {
-         $this->setApplicationVersion('Tinebase', '9.11');
+         $this->_addOwnerIdColumn();
+         $this->setApplicationVersion('Tinebase', '9.11');
+     }
++
++    /**
++     * update to 9.12
++     *
++     * @see xxx: add numberables
++     */
++    public function update_11()
++    {
 +        if ($this->getTableVersion('numberable') === 0) {
 +            $declaration = new Setup_Backend_Schema_Table_Xml('<table>
 +                <name>numberable</name>
 +                <version>1</version>
 +                <declaration>
 +                    <field>
 +                        <name>id</name>
 +                        <type>integer</type>
 +                        <notnull>true</notnull>
 +                        <autoincrement>true</autoincrement>
 +                    </field>
 +                    <field>
 +                        <name>bucket</name>
 +                        <type>text</type>
 +                        <length>255</length>
 +                        <notnull>false</notnull>
 +                    </field>
 +                    <field>
 +                        <name>number</name>
 +                        <type>integer</type>
 +                        <notnull>true</notnull>
 +                    </field>
 +                    <index>
 +                        <name>id</name>
 +                        <primary>true</primary>
 +                        <field>
 +                            <name>id</name>
 +                        </field>
 +                    </index>
 +                    <index>
 +                        <name>bucket_number</name>
 +                        <unique>true</unique>
 +                        <field>
 +                            <name>bucket</name>
 +                        </field>
 +                        <field>
 +                            <name>number</name>
 +                        </field>
 +                    </index>
 +                </declaration>
 +            </table>');
 +
 +            $this->createTable('numberable', $declaration);
 +        }
-      * update to 9.12
++        $this->setApplicationVersion('Tinebase', '9.12');
 +    }
 +
 +    /**
-     public function update_11()
++     * update to 9.13
 +     *
 +     * @see 0012162: create new MailFiler application
 +     */
-         $this->setApplicationVersion('Tinebase', '9.12');
++    public function update_12()
 +    {
 +        if ($this->getTableVersion('tree_fileobjects') < 3) {
 +            $declaration = new Setup_Backend_Schema_Field_Xml('
 +                <field>
 +                    <name>description</name>
 +                    <type>text</type>
 +                    <notnull>false</notnull>
 +                </field>
 +            ');
 +            $this->_backend->alterCol('tree_fileobjects', $declaration);
 +            $this->setTableVersion('tree_fileobjects', '3');
 +        }
 +
-     public function update_12()
++        $this->setApplicationVersion('Tinebase', '9.13');
 +    }
 +
 +    /**
 +     * update to 10.0
 +     *
 +     * @return void
 +     */
++    public function update_13()
 +    {
 +        $this->setApplicationVersion('Tinebase', '10.0');
 +    }
  }