%#============================================================================
%# ePortal - WEB Based daily organizer
%# Author - S.Rusakov <rusakov_sa@users.sourceforge.net>
%#
%# Copyright (c) 2000-2003 Sergey Rusakov.  All rights reserved.
%# This program is free software; you can redistribute it
%# and/or modify it under the same terms as Perl itself.
%#
%#
%#----------------------------------------------------------------------------
&nbsp;
<% $dlg->dialog_start(title => pick_lang(rus => "Дело", eng => "ToDo item"), delete_button => 1 ,width => 550) %>

  <% $dlg->field('org_id', RO => 1) %>

% foreach my $field (qw/category_id title datestart dateend /) {
	<% $dlg->field($field) %>
% }

% foreach (qw/status priority memo/) {
	<% $dlg->field($_) %>
% }

<% $dlg->buttons %>
<% $dlg->dialog_end %>
&nbsp;


%#=== @METAGS attr =========================================================
<%attr>
Title => {rus => "Дело", eng => "ToDo item"}
Layout => 'Dialog'
</%attr>


%#=== @METAGS onStartRequest ====================================================
<%method onStartRequest>
<& PARENT:onStartRequest, %ARGS &>
<%perl>
  $obj = new ePortal::App::Organizer::ToDo;
  $obj->org_id($session{_org_id});
  $dlg = new ePortal::HTML::Dialog( obj => $obj);
  my $location = try {
    $dlg->handle_request( );
  } catch ePortal::Exception::DataNotValid with {
    my $E = shift;
    $session{ErrorMessage} = $E->text;
    '';
  };
  return $location if $location;
</%perl></%method>


%#=== @metags once =========================================================
<%once>
my ($dlg, $obj);
</%once>

%#=== @metags cleanup =========================================================
<%cleanup>
($dlg, $obj) = ();
</%cleanup>

