Пример #1
0
 public function addreleaseAction()
 {
     $form = new App_Form_Release();
     $form->addElement('Submit', 'continue', array('label' => 'Save & Add Tracks', 'value' => 'continue'));
     if (!empty($_POST) && $form->isValid($_POST)) {
         //find the artistId for this account:
         $release = new Release();
         $release->title = $form->getValue('title');
         $release->artistId = $this->_artist->id;
         $release->publishDate = $form->getValue('publishDate');
         $release->save();
         $this->_flash->addMessage('Your release has been created.');
         if ($form->getValue('continue') != null) {
             $this->_redirector->gotoSimple('addtrack', null, null, array('releaseId' => $release->id));
         }
         $form->setDefaults(array('publishDate' => date('m/d/Y')));
     }
     $form->setMethod('post');
     $form->setAction('/dashboard/catalog/addrelease');
     $this->view->form = $form;
 }
Пример #2
0
 ********************************************************************************/
require_once 'modules/Releases/Release.php';
$focus = new Release();
$focus->retrieve($_REQUEST['record']);
foreach ($focus->column_fields as $field) {
    if (isset($_REQUEST[$field])) {
        $focus->{$field} = $_REQUEST[$field];
    }
}
foreach ($focus->additional_column_fields as $field) {
    if (isset($_REQUEST[$field])) {
        $value = $_REQUEST[$field];
        $focus->{$field} = $value;
    }
}
$focus->save();
$return_id = $focus->id;
$edit = '';
if (isset($_REQUEST['return_module']) && $_REQUEST['return_module'] != "") {
    $return_module = $_REQUEST['return_module'];
} else {
    $return_module = "Releases";
}
if (isset($_REQUEST['return_action']) && $_REQUEST['return_action'] != "") {
    $return_action = $_REQUEST['return_action'];
} else {
    $return_action = "DetailView";
}
if (isset($_REQUEST['return_id']) && $_REQUEST['return_id'] != "") {
    $return_id = $_REQUEST['return_id'];
}