* @license http://www.contenido.org/license/LIZENZ.txt
* @link http://www.4fb.de
* @link http://www.contenido.org
* @since file available since contenido release <= 4.6
*
* {@internal
* created unknown
* modified 2008-06-27, Frederic Schneider, add security fix
* modified 2009-11-06, Murat Purc, replaced deprecated functions (PHP 5.3 ready)
*
* $Id$:
* }}
*
*/
if(!defined('CON_FRAMEWORK')) {
die('Illegal call');
}
$cpage = new cPage;
$todoitem = new TODOItem;
$todoitem->loadByPrimaryKey($idcommunication);
$ui = new UI_Table_Form("reminder");
$ui->addHeader(i18n("Edit Reminder item"));
$ui->addCancel($sess->url("main.php?area=mycontenido_tasks&frame=$frame"));
$ui->setVar("area","mycontenido_tasks");
$ui->setVar("frame", $frame);
$ui->setVar("action", "todo_save_item");
$ui->setVar("idcommunication", $idcommunication);
$userselect = new cHTMLSelectElement("userassignment");
$userclass = new User;
foreach ($userclass->getAvailableUsers(explode(',', $auth->auth['perm'])) as $key => $value)
{
$acusers[$key] = $value["username"]." (".$value["realname"].")";
}
asort($acusers);
$userselect->autoFill($acusers);
$userselect->setDefault($auth->auth["uid"]);
$ui->add(i18n("Assigned to"), $userselect->render());
$subject = new cHTMLTextbox("subject", $todoitem->get("subject"),60);
$ui->add(i18n("Subject"), $subject->render());
$message = new cHTMLTextarea("message", $todoitem->get("message"));
$ui->add(i18n("Description"), $message->render());
$reminderdue = new cHTMLTextbox("enddate", $todoitem->getProperty("todo", "enddate"), '', '', "enddate");
$duepopup = '';
$ui->add(i18n("End date"),'
'.$reminderdue->render().' | '.$duepopup.' |
');
$notiemail = new cHTMLCheckbox("notiemail", i18n("E-Mail notification"));
$notiemail->setChecked($todoitem->getProperty("todo", "emailnoti"));
$notiemail->setEvent("click","if(this.checked){ document.forms['reminder'].reminderdate.disabled=false; } else { document.forms['reminder'].reminderdate.disabled=true; }");
$ui->add(i18n("Reminder options"), $notiemail->toHTML());
$remindertimestamp = $todoitem->getProperty("todo", "reminderdate");
if ($remindertimestamp != 0)
{
$mydate = date("Y-m-d H:i:s", $remindertimestamp);
} else {
$mydate = "";
}
$reminderdate = new cHTMLTextbox("reminderdate", $mydate, '', '', "reminderdate");
if (!$todoitem->getProperty("todo", "emailnoti"))
{
$reminderdate->setDisabled(true);
}
$datepopup = '';
$ui->add(i18n("Reminder date"),''.$reminderdate->render().' | '.$datepopup.' |
');
$calscript = '";
$todos = new TODOCollection;
$priorityselect = new cHTMLSelectElement("priority");
$priorityselect->autoFill($todos->getPriorityTypes());
$priorityselect->setDefault($todoitem->getProperty("todo", "priority"));
$ui->add(i18n("Priority"), $priorityselect->render());
$statusselect = new cHTMLSelectElement("status");
$statusselect->autoFill($todos->getStatusTypes());
$statusselect->setDefault($todoitem->getProperty("todo", "status"));
$ui->add(i18n("Status"), $statusselect->render());
$progress = new cHTMLTextbox("progress", (int)$todoitem->getProperty("todo", "progress"),5);
$ui->add(i18n("Progress"), $progress->render()."%");
$cpage->setcontent($ui->render().$calscript);
$cpage->addScript("cal", '
');
$cpage->render();
?>