diff --git a/tine20/HumanResources/Frontend/Json.php b/tine20/HumanResources/Frontend/Json.php index 7c0809f1496..8ed31d1e025 100644 --- a/tine20/HumanResources/Frontend/Json.php +++ b/tine20/HumanResources/Frontend/Json.php @@ -87,9 +87,26 @@ public function searchStreams($filter, $paging) HumanResources_Model_Stream::class); } - public function saveStream($data) + /** + * Return a single stream + * + * @param string $id + * @return array stream data + */ + public function getStream($id) + { + return $this->_get($id, HumanResources_Controller_Stream::getInstance()); + } + + /** + * creates/updates a stream + * + * @param array $recordData + * @return array created/updated stream + */ + public function saveStream($recordData) { - return $this->_save($data, HumanResources_Controller_Stream::getInstance(), HumanResources_Model_Stream::class); + return $this->_save($recordData, HumanResources_Controller_Stream::getInstance(), HumanResources_Model_Stream::class); } public function generateStreamReport($streamId) diff --git a/tine20/HumanResources/Model/StreamModalReport.php b/tine20/HumanResources/Model/StreamModalReport.php index 36ff2a95b9b..29ae5077cb2 100644 --- a/tine20/HumanResources/Model/StreamModalReport.php +++ b/tine20/HumanResources/Model/StreamModalReport.php @@ -47,6 +47,8 @@ class HumanResources_Model_StreamModalReport extends Tinebase_Record_NewAbstract */ protected static $_modelConfiguration = [ self::VERSION => 1, + self::RECORD_NAME => 'Modality Report', + self::RECORDS_NAME => 'Modality Reports', // ngettext('Modality Report', 'Modality Reports', n) self::HAS_RELATIONS => true, self::COPY_RELATIONS => false, self::MODLOG_ACTIVE => true, @@ -81,6 +83,7 @@ class HumanResources_Model_StreamModalReport extends Tinebase_Record_NewAbstract self::FLD_STREAM_MODALITY_ID => [ self::TYPE => self::TYPE_RECORD, self::VALIDATORS => [Zend_Filter_Input::ALLOW_EMPTY => false, 'presence'=>'required'], + self::DISABLED => true, self::CONFIG => [ self::APP_NAME => HumanResources_Config::APP_NAME, self::MODEL_NAME => HumanResources_Model_StreamModality::MODEL_NAME_PART, diff --git a/tine20/HumanResources/Model/StreamModality.php b/tine20/HumanResources/Model/StreamModality.php index 04ec47cb523..0b0dc512112 100644 --- a/tine20/HumanResources/Model/StreamModality.php +++ b/tine20/HumanResources/Model/StreamModality.php @@ -53,6 +53,8 @@ class HumanResources_Model_StreamModality extends Tinebase_Record_NewAbstract */ protected static $_modelConfiguration = [ self::VERSION => 1, + self::RECORD_NAME => 'Modality', + self::RECORDS_NAME => 'Modalities', // ngettext('Modality', 'Modalities', n) self::HAS_RELATIONS => true, self::COPY_RELATIONS => false, self::HAS_NOTES => true, @@ -63,6 +65,8 @@ class HumanResources_Model_StreamModality extends Tinebase_Record_NewAbstract self::APP_NAME => HumanResources_Config::APP_NAME, self::MODEL_NAME => self::MODEL_NAME_PART, + self::TITLE_PROPERTY=> "{# {{start - sorting! #}{{ start |localizeddate('short', 'none', app.request.locale ) }} - {% if end %}{{ end | localizeddate('short', 'none', app.request.locale ) }}{% else %}...{% endif %} {{ interval }} {{ num_interval }}× á {{ hours_interval }}h", + self::ASSOCIATIONS => [ ClassMetadataInfo::MANY_TO_ONE => [ self::FLD_STREAM_ID => [ @@ -89,6 +93,7 @@ class HumanResources_Model_StreamModality extends Tinebase_Record_NewAbstract self::FLD_STREAM_ID => [ self::TYPE => self::TYPE_RECORD, self::VALIDATORS => [Zend_Filter_Input::ALLOW_EMPTY => false, 'presence'=>'required'], + self::DISABLED => true, self::CONFIG => [ self::APP_NAME => HumanResources_Config::APP_NAME, self::MODEL_NAME => HumanResources_Model_Stream::MODEL_NAME_PART, @@ -106,6 +111,7 @@ class HumanResources_Model_StreamModality extends Tinebase_Record_NewAbstract self::FLD_END => [ self::LABEL => 'End', // _('End') self::TYPE => self::TYPE_VIRTUAL, + self::READ_ONLY => true, self::CONFIG => [ self::TYPE => self::TYPE_DATE, ] @@ -150,6 +156,9 @@ class HumanResources_Model_StreamModality extends Tinebase_Record_NewAbstract self::FLD_REPORTS => [ self::LABEL => 'Stream Modality Reports', // _('Stream Modality Reports') self::TYPE => self::TYPE_RECORDS, + self::UI_CONFIG => [ + self::READ_ONLY => true, + ], self::CONFIG => [ self::APP_NAME => HumanResources_Config::APP_NAME, self::MODEL_NAME => HumanResources_Model_StreamModalReport::MODEL_NAME_PART,