コード例 #1
0
 /**
  * Display after submit
  */
 protected function displayAfterSubmit()
 {
     if ($this->submitMode == StandardFormular::$SUBMIT_MODE_CREATE) {
         $this->displayHeader();
         echo HTML::okay(__('The activity has been successfully created.'));
         echo Ajax::closeOverlay();
         if (Configuration::ActivityForm()->showActivity()) {
             echo Ajax::wrapJS('Runalyze.Training.load(' . $this->dataObject->id() . ');');
         }
     } else {
         if (Request::param('mode') == 'multi') {
             echo Ajax::wrapJS('Runalyze.goToNextMultiEditor();');
         } else {
             parent::displayAfterSubmit();
         }
     }
 }
コード例 #2
0
ファイル: window.schuhe.php プロジェクト: n0rthface/Runalyze
    DB::getInstance()->deleteByID('shoe', (int) Request::sendId());
    DB::getInstance()->query('UPDATE `' . PREFIX . 'training` SET `shoeid`=0 WHERE `shoeid`=' . (int) Request::sendId() . ' AND accountid = ' . SessionAccountHandler::getId());
    Cache::delete(ShoeFactory::CACHE_KEY);
    header('Location: window.schuhe.table.php?reload=true');
    exit;
}
if (Request::sendId() === false) {
    $Header = __('Add new shoe');
    $Mode = StandardFormular::$SUBMIT_MODE_CREATE;
    $Shoe = new Shoe(DataObject::$DEFAULT_ID);
} else {
    $Header = __('Edit shoe');
    $Mode = StandardFormular::$SUBMIT_MODE_EDIT;
    $Shoe = new Shoe(Request::sendId());
}
$Formular = new StandardFormular($Shoe, $Mode);
if ($Formular->submitSucceeded()) {
    header('Location: window.schuhe.table.php');
    ShoeFactory::clearCache();
    exit;
}
if (Request::sendId() > 0) {
    $DeleteText = '<strong>' . __('Delete shoe') . ' &raquo;</strong>';
    $DeleteUrl = $_SERVER['SCRIPT_NAME'] . '?delete=true&id=' . $Shoe->id();
    $DeleteLink = Ajax::link($DeleteText, 'ajax', $DeleteUrl);
    if ($Shoe->getKm() != $Shoe->getAdditionalKm()) {
        $DeleteLink = __('The shoe cannot be deleted as long it is used for some activity.');
    }
    $DeleteFieldset = new FormularFieldset(__('Delete shoe'));
    $DeleteFieldset->addWarning($DeleteLink);
    $Formular->addFieldset($DeleteFieldset);
コード例 #3
0
ファイル: window.sportler.php プロジェクト: guancio/Runalyze
    DB::getInstance()->deleteByID('user', (int) Request::sendId());
    Cache::delete(UserData::CACHE_KEY);
    header('Location: window.sportler.table.php?reload=true');
    exit;
}
if (Request::sendId() === false) {
    $Header = __('Add body values');
    $Mode = StandardFormular::$SUBMIT_MODE_CREATE;
    $UserData = new UserData(DataObject::$LAST_OBJECT);
    $UserData->setCurrentTimestamp();
} else {
    $Header = __('Edit body values');
    $Mode = StandardFormular::$SUBMIT_MODE_EDIT;
    $UserData = new UserData(Request::sendId());
}
$Formular = new StandardFormular($UserData, $Mode);
if ($Formular->submitSucceeded()) {
    header('Location: window.sportler.table.php?reload=true');
    exit;
}
$Factory = new PluginFactory();
$Plugin = $Factory->newInstance('RunalyzePluginPanel_Sportler');
echo '<div class="panel-heading">';
echo '<div class="panel-menu"><ul><li>' . $Plugin->tableLink() . '</li></ul></div>';
echo '<h1>' . $Header . '</h1>';
echo '</div>';
echo '<div class="panel-content">';
$Formular->addCSSclass('no-automatic-reload');
$Formular->setId('sportler');
$Formular->setLayoutForFields(FormularFieldset::$LAYOUT_FIELD_W33);
$Formular->display();