/** * @inheritdoc */ public function disableContentContainer(ContentContainerActiveRecord $container) { parent::disableContentContainer($container); foreach (Note::find()->contentContainer($container)->all() as $note) { $note->delete(); } }
public function up() { $this->renameClass('Note', Note::className()); $this->delete('notification', ['class' => 'NoteCreatedNotification']); $this->delete('notification', ['class' => 'NoteUpdatedNotification']); foreach (\humhub\modules\activity\models\Activity::findAll(['module' => 'notes']) as $activity) { $activity->delete(); } }
public function actionEdit() { $id = (int) Yii::$app->request->get('id', 0); $note = Note::find()->contentContainer($this->contentContainer)->readable()->where(['note.id' => $id])->one(); // get current revision count $revisionCountNow = $note->getRevisionCount(); $revisionCountByOpening = (int) Yii::$app->request->get('revision', 0); /* if ($revisionCountNow != $revisionCountByOpening) { } */ $this->redirect($this->contentContainer->getUrl()); }
public function setupFilters() { $this->activeQuery->andWhere(['content.object_model' => Note::className()]); }
<br> <?php echo Yii::t('NotesModule.views_noteConfig_index', 'Please read the module documentation under /protected/modules/notes/docs/install.txt for more details!'); ?> </p> <br/> <?php if (Setting::Get('baseUrl', 'notes') != "" && Setting::Get('apiKey', 'notes') != "") { ?> <p><?php echo Yii::t('NotesModule.views_noteConfig_index', 'Current Status:'); ?> <?php if (Note::testAPIConnection()) { ?> <span style="color:green"><?php echo Yii::t('NotesModule.views_noteConfig_index', 'API Connection successful!'); ?> </span> <?php } else { ?> <span style="color:red"><?php echo Yii::t('NotesModule.views_noteConfig_index', 'Could not connect to API!'); ?> </span> <?php } ?>