Beispiel #1
0
 function saveVersion($args, &$request)
 {
     $this->validate();
     $rtDao = DAORegistry::getDAO('RTDAO');
     $conference = $request->getConference();
     $versionId = isset($args[0]) ? $args[0] : 0;
     $version =& $rtDao->getVersion($versionId, $conference->getId());
     if (isset($version)) {
         import('classes.rt.ocs.form.VersionForm');
         $versionForm = new VersionForm($versionId, $conference->getId());
         $versionForm->readInputData();
         $versionForm->execute();
     }
     $request->redirect(null, null, null, 'versions');
 }
 function saveVersion($args)
 {
     $this->validate();
     $rtDao =& DAORegistry::getDAO('RTDAO');
     $journal = Request::getJournal();
     $versionId = isset($args[0]) ? $args[0] : 0;
     $version =& $rtDao->getVersion($versionId, $journal->getId());
     if (isset($version)) {
         import('classes.rt.ojs.form.VersionForm');
         $versionForm = new VersionForm($versionId, $journal->getId());
         $versionForm->readInputData();
         $versionForm->execute();
     }
     Request::redirect(null, null, 'versions');
 }
 function saveVersion($args)
 {
     $this->validate();
     $rtDao =& DAORegistry::getDAO('RTDAO');
     $versionId = (int) array_shift($args);
     $archiveId = (int) Request::getUserVar('archiveId');
     $version =& $rtDao->getVersion($versionId, $archiveId);
     if (isset($version)) {
         import('rt.harvester2.form.VersionForm');
         $versionForm = new VersionForm($versionId, $archiveId);
         $versionForm->readInputData();
         $versionForm->execute();
     }
     Request::redirect(null, 'versions', $archiveId);
 }
	public function executeAddItems(sfWebRequest $request){

		$versionId = $request->getParameter('versionId');
		if($versionId) {
			$index = sfContext::getInstance()->getUser()->getAttribute('N1added'.$versionId);
			$configuration = sfProjectConfiguration::getActive();
			$configuration->loadHelpers(array('jQuery','Asset','Tag','Url'));


			$fichero = new Ficheros();

			$fichero->setversionId($versionId);

			sfContext::getInstance()->getUser()->setAttribute('inclusion', true);
			$form = new VersionForm();
			$form -> embedForm('item_pos'.++$index, new FicherosForm($fichero));

			$widgetSchema = $form->getWidgetSchema();
			$label = "Fichero $index: ".jq_link_to_remote(image_tag('/sf/sf_admin/images/add'), array(
    			'url'     =>  'version/addItems?versionId='.$versionId,
    			'update'  =>  'ficheros',
    			'position'=>  'bottom',
			));
			$widgetSchema->setLabel('item_pos'.$index,$label);

			sfContext::getInstance()->getUser()->setAttribute('N1added'.$versionId, $index);

			return $this->renderPartial('version/fichero',array
			('index' => $index,'form'=>$form));
		}
	}