. */ include("./include/include.php"); require_once(FILESYSTEMROOTPATH."jc/include/classes/DefaultLayout.php"); require_once(FILESYSTEMROOTPATH."include/form/AbstractForm.php"); /** * Helper classes */ class PMForm extends AbstractForm { private $pmService; public function __construct(Layout $layout, IModel $model, Proposals_managementService $pmService) { parent::__construct($layout, $model); $this->pmService = $pmService; } public function save(IModel $model) { $pService = $GLOBALS['ClassFactory']->getProposalsService(); $proposal = $pService->load($model->getProposal_id()); $proposal->setStatus('Plenary'); if($model->getResult() == 'Withdrawn'){ $proposal->setStatus('Withdrawn'); } $pService->saveOrUpdate($proposal); if( $this->pmService->saveOrUpdate($model) ) { $this->layout->redirect('summary.php?pm_id='.$model->getId()); }else { $this->layout->echoln("Failed saving."); } } } /** * End of helper classes */ $layout = new DefaultLayout("JC_MANAGE", "./jc/"); $layout->init(); $proposal_id = $_GET['proposal_id']; $layout->echoln('Back
'); $layout->echoln('

If the proposal is ready for voting, press "save"' ); //form to create/edit proposals_management object $pmService = $GLOBALS['ClassFactory']->getProposals_managementService(); $pm = $pmService->loadByPID($proposal_id, 'Plenary'); if ($pm == NULL){ $layout->page_footer(); exit(); } $form = new PMForm($layout, $pm, $pmService); $void = new HiddenField('session_type', 'Finish'); $void->setReadOnly(true); $void->setClass('disabled'); $form->addHiddenField($void); $form->display(); $layout->echoln('

If you press "save", you won\'t be able to make any changes!' ); $layout->page_footer(); ?>