AssignmentBatchEditSubmit.php

Go to the documentation of this file.
00001 <?php
00003 // {{{ license
00004 
00005 // +----------------------------------------------------------------------+
00006 // | FastFrame Application Framework                                      |
00007 // +----------------------------------------------------------------------+
00008 // | Copyright (c) 2002-2006 The Codejanitor Group                        |
00009 // +----------------------------------------------------------------------+
00010 // | This source file is subject to the GNU Lesser Public License (LGPL), |
00011 // | that is bundled with this package in the file LICENSE, and is        |
00012 // | available at through the world-wide-web at                           |
00013 // | http://www.fsf.org/copyleft/lesser.html                              |
00014 // | If you did not receive a copy of the LGPL and are unable to          |
00015 // | obtain it through the world-wide-web, you can get it by writing the  |
00016 // | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, |
00017 // | MA 02111-1307, USA.                                                  |
00018 // +----------------------------------------------------------------------+
00019 // | Authors: Jason Rust <jrust@codejanitor.com>                          |
00020 // +----------------------------------------------------------------------+
00021 
00022 // }}}
00023 // {{{ requires
00024 
00025 require_once FASTFRAME_ROOT . 'lib/FastFrame/Action/FormSubmit.php';
00026 
00027 // }}}
00028 // {{{ class FF_Action_BatchEditSubmit_Assignment
00029 
00040 // }}}
00041 class FF_Action_BatchEditSubmit_Assignment extends FF_Action_FormSubmit {
00042     // {{{ properties
00043 
00048     var $editActionId = ACTION_BATCH_EDIT_SUBMIT;
00049 
00050     // }}}
00051     // {{{ save()
00052 
00059     function save()
00060     {
00061         return $this->o_model->batchEdit(FF_Request::getParam('requested_action', 'p'));
00062     }
00063 
00064     // }}}
00065     // {{{ fillModelWithSubmitData()
00066 
00073     function fillModelWithSubmitData()
00074     {
00075         $this->o_model->setBatchIds(array_keys(FF_Request::getParam('assignment', 'p', array())));
00076         $this->o_model->setOpenTime(FF_Request::getParam('update_open_time', 'p', 0));
00077         $this->o_model->setLateTime(FF_Request::getParam('update_late_time', 'p', 0));
00078         $this->o_model->setCloseTime(FF_Request::getParam('update_close_time', 'p', 0));
00079         $this->o_model->setSession(FF_Request::getParam('new_session', 'p'));
00080         $this->o_model->setCourseCode(FF_Request::getParam('new_course_code', 'p'));
00081         $this->o_model->setOwnerId(FF_Auth::getCredential('userId'));
00082     }
00083 
00084     // }}}
00085     // {{{ getSingularText()
00086 
00093     function getSingularText()
00094     {
00095         return _('Assignments');
00096     }
00097 
00098     // }}}
00099     // {{{ validateInput()
00100 
00107     function validateInput()
00108     {
00109         require_once dirname(__FILE__) . '/../Validate/Assignment.php';
00110         $o_validate =& new FF_Validate_Assignment($this->o_model, $this->isUpdate());
00111         return $o_validate->validate(true);
00112     }
00113 
00114     // }}}
00115     // {{{ setProblemActionId()
00116 
00123     function setProblemActionId()
00124     {
00125         $this->o_nextAction->setNextActionId(ACTION_BATCH_EDIT);
00126     }
00127 
00128     // }}}
00129     // {{{ checkPerms()
00130 
00137     function checkPerms()
00138     {
00139         if (!$this->o_perms->hasPerm('can_use_homework')) {
00140             $this->o_output->setMessage(_('You cannot edit these assignments.'), FASTFRAME_ERROR_MESSAGE);
00141             return false;
00142         }
00143 
00144         return true;
00145     }
00146 
00147     // }}}
00148 }
00149 ?>

Generated on Fri Jun 23 11:38:14 2006 for FastFrame by  doxygen 1.4.4