. */ include("./include/include.php"); require_once(FILESYSTEMROOTPATH."jc/include/classes/DefaultLayout.php"); require_once(FILESYSTEMROOTPATH."include/form/AbstractForm.php"); class SolutionForm extends AbstractForm { public function __construct(Layout $layout, IModel $model) { parent::__construct($layout, $model); } public function save(IModel $model) { if (isset($_POST['solved'])){ $model->setSolved('1'); } $cService = $GLOBALS['ClassFactory']->getConflictsService(); $cService->saveOrUpdate($model); $this->layout->redirect("update1.php"); } } $layout = new DefaultLayout("JC_MANAGE", "./jc/"); $layout->init(); $aid = $_SESSION['JC_MODULE']['AgoraId']; $ciaService = $GLOBALS['ClassFactory']->getCIAService(); $is_updated = $ciaService->check_updated($aid); if ($is_updated==1){ $layout->echoln("CIA is already updated!"); $layout->page_footer(); exit(); } $cService = $GLOBALS['ClassFactory']->getConflictsService(); $psService = $GLOBALS['ClassFactory']->getProposals_SentencesService(); $pService = $GLOBALS['ClassFactory']->getProposalsService(); $cid = $_GET['cid']; $conflict = $cService->load($cid); $ps1 = $psService->load($conflict->getPs1()); $ps2 = $psService->load($conflict->getPs2()); $p1 = $pService->load($ps1->getProposal_id()); $p2 = $pService->load($ps2->getProposal_id()); $layout->echoln('Back to conflicts list

'); $layout->echoln(''); $layout->echoln(''); $layout->echoln(''); $layout->echoln(''); $layout->echoln('"); $layout->echoln('
12
'.$p1->getTitle().''.$p2->getTitle().'
'.$ps1->getTitle().', '.$ps1->getTitle2().''.$ps2->getTitle().', '.$ps2->getTitle2().'
Article '.$ps1->getArticle().'. '.$ps1->getArticle_title().', Paragraph ('.$ps1->getParagraph().')Article '.$ps2->getArticle().'. '.$ps2->getArticle_title().', Paragraph ('.$ps2->getParagraph().')
'.$ps1->getSentence().''.$ps1->getSentence_text()."'.$ps2->getSentence().''.$ps2->getSentence_text()."


"); $problem =$conflict->getConflict_type(); $solutionForm = new SolutionForm($layout, $conflict); if($problem=="new_^-new_^"){ $layout->echoln("Two new sentences are inserted above the same sentece.
Select which will be first."); $field1 = new SelectField('solution','Solution',array(1=>'1',2=>'2')); } elseif($problem=="new_v-new_v"){ $layout->echoln("Two new sentences are inserted below the same sentece.
Select which will be first."); $field1 = new SelectField('solution','Solution',array(1=>'1',2=>'2')); } elseif($problem=="edit-edit"){ $layout->echoln("The two proposals are amending the same sentence.
Write the final text."); $field1 = new TextAreaField('solution', 'Solution',3,40); } elseif($problem=="edit-delete"){ $layout->echoln("First proposal amends a sentece, while the second proposal deletes it.
Write the final text (to delete, do not type anything!)."); $field1 = new TextField('solution', 'Solution'); } elseif($problem=="delete-edit"){ $layout->echoln("First proposal deletess a sentece, while the second proposal edits it.
Write the final text (to delete, do not type anything!)."); $field1 = new TextField('solution', 'Solution'); } $solved = new CheckBoxField('solved','Solved'); $solutionForm->addField($field1); $solutionForm->addField($solved); $solutionForm->setSubmitText('Save'); $solutionForm->display(); $layout->page_footer(); ?>