protected function showOrdersForToday() { // sprawdzamy czy pobieralismy juz info $aMealName = $this->oCurrentUser->propertie('aMealName'); if (empty($aMealName)) { $oOrder = new Model_Order(); // pobieramy posilek na dzisiaj $aOrder = $oOrder->getOrderForToday((int) $this->oCurrentUser->user_id); $aName = array(); foreach ($aOrder as $aIngredient) { $aName[] = $aIngredient['name']; $sMealName = $aIngredient['meal_name']; } if (!empty($aName)) { $sShortName = $sMealName . '. ' . $aName[0]; $sShortName = strlen($sShortName) > 43 ? substr($sShortName, 0, 40) . '...' : $sShortName; $aMealName = array('sDinnersFullName' => implode(', ', $aName), 'sText' => $this->getLang('catering.welcome_text_meal', array($this->oCurrentUser->fname, $sShortName))); } else { $aMealName = array('sDinnersFullName' => '', 'sText' => $this->getLang('catering.welcome_text', $this->oCurrentUser->fname)); } // zapisujemy wlasciwosc w obiekcie zalogowanego uzytkownika $this->oCurrentUser->propertie('aMealName', $aMealName); } $this->mTemplate->aWelcomeMessage = $aMealName; }