<?php
// ResponsibilitySelectForm.php
include_once('core/base/Form.php');

/**
 * 
 *
 * @todo Modifiy the Form class to be able to handle checkbox arrays of multiple form values;  When 
 *       that is done, modify the DeedSelectView class to use the new form functions.  Right now
 *		 the form names and values are hardcoded.
 * @author Matthew Lindberg
 */
class ResponsibilitySelectForm extends Form
{
	var $_ResponIDs 			= "responids";
	var $_DurationValue			= "durationval";
	var $_DurationType			= "durationtype";
	
	var $member_id;
	var $member_id_inputname	= "member_id";
	var $owner_type				= "member";
	var $checkbox_inputname		= "respons";
	var $complete_time_inputname= "completetime";		

	
	/**
	 * Constructor.
	 *
	 * @access public
	 */
	function ResponsibilitySelectForm(& $session, & $request)
	{
		parent::Form(& $session, & $request);
		$this->entries = array();
	}

	/**
	 *
	 * @access public
	 * @return array( array(<responid>,<countval>,<counttype>)* )
	 */
	function getSelections()
	{
		$ids = $this->request->get("responid");
		
		$respons = array();
		for($i=0; $i<count($ids); $i++) {
			$respons[] = array($ids[$i],$this->request->get("completetimevalue".$ids[$i]),$this->request->get("completetimetype".$ids[$i]));
		}
		return $respons;
	}
}


/*
$smarty->assign( "ownerid",33 );
$smarty->assign( "owneridname","rankid" );
$smarty->assign( "ownertype", "rank" );
$smarty->assign( "backbuttonlink", "http://goback" );
$smarty->assign( "checkboxname", "respons" );
$smarty->assign( "completetimename", "completetime" );
$smarty->assign( "formaction", "http://formaction" );
$smarty->assign( "respon", array(
									array( 	"responid" => 3,
											"respondesc" => "Recruit 3 new members",
											"checked" => "yes",
											"detailslink" => "href://details",
											"completetime" => 2,
											"completetimetype" => "day"
										 ),
									array(	"responid" => 4,
											"respondesc" => "Recruit 3 new members",
											"checked" => "yes",
											"detailslink" => "href://details",
											"completetime" => 5,
											"completetimetype" => "month"
										 ),
									array(	"responid" => 3,
											"respondesc" => "Recruit 3 new members",
											"checked" => "yes",
											"detailslink" => "href://details",
											"completetime" => 2,
											"completetimetype" => "year"
										 )
								));
$smarty->assign( "completetimeoptions", array( "1"=>"1", "2"=>"2", "3"=>"3", "4"=>"4", "5"=>"5", "6"=>"6" ));
$smarty->assign( "completetimetypeoptions", array( "day"=>"day","month"=>"month","year"=>"year" ));
*/
?>