diff --git a/protected/humhub/compat/HForm.php b/protected/humhub/compat/HForm.php index 06acf0cc0e..56e6c4eec0 100644 --- a/protected/humhub/compat/HForm.php +++ b/protected/humhub/compat/HForm.php @@ -193,6 +193,7 @@ class HForm extends \yii\base\Component if (isset($definition['readonly']) && $definition['readonly']) { $options['readOnly'] = true; + $options['disabled'] = true; } if (isset($definition['value'])) { diff --git a/protected/humhub/components/ModuleManager.php b/protected/humhub/components/ModuleManager.php index 831f3f21e1..b959ec57f3 100644 --- a/protected/humhub/components/ModuleManager.php +++ b/protected/humhub/components/ModuleManager.php @@ -295,7 +295,7 @@ class ModuleManager extends \yii\base\Component $backupFolderName = $moduleBackupFolder . DIRECTORY_SEPARATOR . $moduleId . "_" . time(); if (!@rename($module->getBasePath(), $backupFolderName)) { - throw new Exception("Could not remove module folder!" . $backupFolderName); + throw new Exception("Could not move module to backup folder!" . $backupFolderName); } } else { //TODO: Delete directory diff --git a/protected/humhub/modules/activity/migrations/m160501_220850_activity_pk_int.php b/protected/humhub/modules/activity/migrations/m160501_220850_activity_pk_int.php new file mode 100644 index 0000000000..be272c8869 --- /dev/null +++ b/protected/humhub/modules/activity/migrations/m160501_220850_activity_pk_int.php @@ -0,0 +1,30 @@ +<?php + +use yii\db\Migration; + +class m160501_220850_activity_pk_int extends Migration +{ + + public function up() + { + $this->alterColumn('activity', 'object_id', 'INT(11) NOT NULL'); + } + + public function down() + { + echo "m160501_220850_activity_pk_int cannot be reverted.\n"; + + return false; + } + + /* + // Use safeUp/safeDown to run migration code within a transaction + public function safeUp() + { + } + + public function safeDown() + { + } + */ +} diff --git a/protected/humhub/modules/admin/messages/it/forms_AuthenticationLdapSettingsForm.php b/protected/humhub/modules/admin/messages/it/forms_AuthenticationLdapSettingsForm.php index b8b8837fb7..565bbca8dd 100644 --- a/protected/humhub/modules/admin/messages/it/forms_AuthenticationLdapSettingsForm.php +++ b/protected/humhub/modules/admin/messages/it/forms_AuthenticationLdapSettingsForm.php @@ -17,7 +17,7 @@ * NOTE: this file must be saved in UTF-8 encoding. */ return [ - 'E-Mail Address Attribute' => '', + 'E-Mail Address Attribute' => 'Attributo indirizzo E-mail', 'Fetch/Update Users Automatically' => '', 'Base DN' => 'DN base', 'Enable LDAP Support' => 'Abilita supporto LDAP', diff --git a/protected/humhub/modules/installer/messages/de/views_config_admin.php b/protected/humhub/modules/installer/messages/de/views_config_admin.php index 0b4ab6c85a..8d8aab3c60 100644 --- a/protected/humhub/modules/installer/messages/de/views_config_admin.php +++ b/protected/humhub/modules/installer/messages/de/views_config_admin.php @@ -1,5 +1,5 @@ <?php return array ( '<strong>Admin</strong> Account' => '<strong>Admin</strong> Account', - 'You\'re almost done. In this step you have to fill out the form to create an admin account. With this account you can manage the whole network.' => 'Fast geschafft! Fülle in diesem Schritt das Eingabeformular aus, um das Administrator-Konto zu erstellen. Mit diesem Konto kannst du das ganze Neztwerk verwalten.', + 'You\'re almost done. In this step you have to fill out the form to create an admin account. With this account you can manage the whole network.' => 'Fast geschafft! Fülle in diesem Schritt das Eingabeformular aus, um das Administrator-Konto zu erstellen. Mit diesem Konto kannst du das ganze Netzwerk verwalten.', ); diff --git a/protected/humhub/modules/tour/messages/de/widgets_views_guide_profile.php b/protected/humhub/modules/tour/messages/de/widgets_views_guide_profile.php index a0cbf7af1b..28b5f32f51 100644 --- a/protected/humhub/modules/tour/messages/de/widgets_views_guide_profile.php +++ b/protected/humhub/modules/tour/messages/de/widgets_views_guide_profile.php @@ -10,7 +10,7 @@ return array ( '<strong>User profile</strong>' => '<strong>Benutzerprofil</strong>', 'Click on this button to update your profile and account settings. You can also add more information to your profile.' => 'Klicke auf diese Schaltfläche, um dein Profil und deine Kontoeinstellungen zu aktualisieren. Du kannst auch weitere Informationen zu deinem Profil hinzufügen .', 'Each profile has its own pin board. Your posts will also appear on the dashboards of those users who are following you.' => 'Jedes Profil hat seine eigene Pinnwand. Deine Beiträge werden auch auf den Übersichten der Benutzer, die dir folgen, angezeigt.', - 'Just like in the space, the user profile can be personalized with various modules.<br><br>You can see which modules are available for your profile by looking them in “Modules” in the account settings menu.' => 'Genau wie in den Spaces, kann das Benutzerprofil mit verschiedenen Modulen personalisiert werden.<br><br>Du kannst sehen welche Module für dein Profil zur Verfügung stehen, indem du das Menüe "Module" in deinen Kontoeinstellungen aufrufst.', + 'Just like in the space, the user profile can be personalized with various modules.<br><br>You can see which modules are available for your profile by looking them in “Modules” in the account settings menu.' => 'Genau wie in den Spaces, kann das Benutzerprofil mit verschiedenen Modulen personalisiert werden.<br><br>Du kannst sehen welche Module für dein Profil zur Verfügung stehen, indem du das Menü "Module" in deinen Kontoeinstellungen aufrufst.', 'This is your public user profile, which can be seen by any registered user.' => 'Das ist dein öffentliches Benutzerprofil, das von jedem registrierten Benutzer gesehen werden kann.', 'Upload a new profile photo by simply clicking here or by drag&drop. Do just the same for updating your cover photo.' => 'Lade ein neues Profilfoto hoch, indem du hier klickst oder es per Drag&Drop hier hin ziehst. Genauso kannst du dein Titelfoto ändern.', 'You\'ve completed the user profile guide!' => 'Du hast die Einführung zur Profilbearbeitung abgeschlossen!', diff --git a/protected/humhub/modules/user/controllers/AccountController.php b/protected/humhub/modules/user/controllers/AccountController.php index 3694f82955..8d1a5860e2 100644 --- a/protected/humhub/modules/user/controllers/AccountController.php +++ b/protected/humhub/modules/user/controllers/AccountController.php @@ -102,10 +102,12 @@ class AccountController extends BaseAccountController $model->tags = $user->tags; $model->show_introduction_tour = $user->getSetting("hideTourPanel", "tour"); + $model->show_share_panel = $user->getSetting("hideSharePanel", "share"); $model->visibility = $user->visibility; if ($model->load(Yii::$app->request->post()) && $model->validate()) { $user->setSetting('hideTourPanel', $model->show_introduction_tour, "tour"); + $user->setSetting("hideSharePanel", $model->show_share_panel, "share"); $user->language = $model->language; $user->tags = $model->tags; $user->time_zone = $model->timeZone; diff --git a/protected/humhub/modules/user/models/fieldtype/Select.php b/protected/humhub/modules/user/models/fieldtype/Select.php index b35f6de3c2..d9733d1f66 100644 --- a/protected/humhub/modules/user/models/fieldtype/Select.php +++ b/protected/humhub/modules/user/models/fieldtype/Select.php @@ -96,6 +96,7 @@ class Select extends BaseType return array($this->profileField->internal_name => array( 'type' => 'dropdownlist', 'class' => 'form-control', + 'readonly' => (!$this->profileField->editable), 'items' => $this->getSelectItems(), 'prompt' => Yii::t('UserModule.models_ProfileFieldTypeSelect', 'Please select:'), )); diff --git a/protected/humhub/modules/user/models/forms/AccountSettings.php b/protected/humhub/modules/user/models/forms/AccountSettings.php index 0319e616ec..92a2a3accd 100644 --- a/protected/humhub/modules/user/models/forms/AccountSettings.php +++ b/protected/humhub/modules/user/models/forms/AccountSettings.php @@ -1,21 +1,9 @@ <?php /** - * HumHub - * Copyright © 2014 The HumHub Project - * - * The texts of the GNU Affero General Public License with an additional - * permission and of our proprietary license can be found at and - * in the LICENSE file you have received along with this program. - * - * According to our dual licensing model, this program can be used either - * under the terms of the GNU Affero General Public License, version 3, - * or under a proprietary license. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. + * @link https://www.humhub.org/ + * @copyright Copyright (c) 2016 HumHub GmbH & Co. KG + * @license https://www.humhub.com/licences */ namespace humhub\modules\user\models\forms; @@ -34,17 +22,18 @@ class AccountSettings extends \yii\base\Model public $tags; public $language; public $show_introduction_tour; + public $show_share_panel; public $visibility; public $timeZone; /** - * Declares the validation rules. + * @inheritdoc */ public function rules() { return array( ['tags', 'string', 'max' => 100], - [['show_introduction_tour'], 'boolean'], + [['show_introduction_tour', 'show_share_panel'], 'boolean'], [['timeZone'], 'in', 'range' => \DateTimeZone::listIdentifiers()], ['language', 'in', 'range' => array_keys(Yii::$app->i18n->getAllowedLanguages())], ['visibility', 'in', 'range' => [1, 2]], @@ -52,16 +41,15 @@ class AccountSettings extends \yii\base\Model } /** - * Declares customized attribute labels. - * If not declared here, an attribute would have a label that is - * the same as its name with the first letter in upper case. + * @inheritdoc */ public function attributeLabels() { return array( 'tags' => Yii::t('UserModule.forms_AccountSettingsForm', 'Tags'), 'language' => Yii::t('UserModule.forms_AccountSettingsForm', 'Language'), - 'show_introduction_tour' => Yii::t('UserModule.forms_AccountSettingsForm', 'Hide panel on dashboard'), + 'show_introduction_tour' => Yii::t('UserModule.forms_AccountSettingsForm', 'Hide introduction tour panel on dashboard'), + 'show_share_panel' => Yii::t('UserModule.forms_AccountSettingsForm', 'Hide share panel on dashboard'), 'timeZone' => Yii::t('UserModule.forms_AccountSettingsForm', 'TimeZone'), 'visibility' => Yii::t('UserModule.forms_AccountSettingsForm', 'Profile visibility'), ); diff --git a/protected/humhub/modules/user/views/account/editSettings.php b/protected/humhub/modules/user/views/account/editSettings.php index 8d2e4fb4d2..355d8696a6 100644 --- a/protected/humhub/modules/user/views/account/editSettings.php +++ b/protected/humhub/modules/user/views/account/editSettings.php @@ -34,7 +34,13 @@ use \humhub\models\Setting; <?php endif; ?> - <?php echo $form->field($model, 'show_introduction_tour')->checkbox(); ?> + <?php if (Setting::Get('enable', 'tour') == 1) : ?> + <?php echo $form->field($model, 'show_introduction_tour')->checkbox(); ?> + <?php endif; ?> + + <?php if (Setting::Get('enable', 'share') == 1) : ?> + <?php echo $form->field($model, 'show_share_panel')->checkbox(); ?> + <?php endif; ?> <hr> <?php echo CHtml::submitButton(Yii::t('UserModule.views_account_editSettings', 'Save'), array('class' => 'btn btn-primary')); ?>