Beispiel #1
0
 /**
  * Finds the Priority model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return Priority the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = Priority::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
Beispiel #2
0
 switch ($fieldName) {
     case 'percent':
     case 'title':
         $rows[] = sprintf('<strong>%s</strong>: "%s" -> "%s"', $fieldLabel, Html::encode($fieldData[0]), Html::encode($fieldData[1]));
         break;
     case 'to_be_done_at':
         $rows[] = sprintf('<strong>%s</strong>: "%s" -> "%s"', $fieldLabel, \Yii::$app->formatter->asDate($fieldData[0]), \Yii::$app->formatter->asDate($fieldData[1]));
         break;
     case 'status_id':
         $oldStatus = Status::findOne($fieldData[0]);
         $newStatus = Status::findOne($fieldData[1]);
         $rows[] = sprintf('<strong>%s</strong>: "%s" -> "%s"', $fieldLabel, $oldStatus ? Html::encode($oldStatus->title) : $notFound, $newStatus ? Html::encode($newStatus->title) : $notFound);
         break;
     case 'priority_id':
         $oldPriority = Priority::findOne($fieldData[0]);
         $newPriority = Priority::findOne($fieldData[1]);
         $rows[] = sprintf('<strong>%s</strong>: "%s" -> "%s"', $fieldLabel, $oldPriority ? Html::encode($oldPriority->title) : $notFound, $newPriority ? Html::encode($newPriority->title) : $notFound);
         break;
     case 'type_id':
         $oldType = Type::findOne($fieldData[0]);
         $newType = Type::findOne($fieldData[1]);
         $rows[] = sprintf('<strong>%s</strong>: "%s" -> "%s"', $fieldLabel, $oldType ? Html::encode($oldType->title) : $notFound, $newType ? Html::encode($newType->title) : $notFound);
         break;
     case 'description':
     case 'smart_specific':
     case 'smart_measurable':
     case 'smart_achievable':
     case 'smart_relevant':
     case 'smart_time_bound':
         $rows[] = sprintf('%s (%s)', \Yii::t('log', 'Field "{0}" updated', ['<strong>' . $fieldLabel . '</strong>']), Html::a('diff', ['log/diff', 'id' => $log->id, 'field' => $fieldName]));
         break;