Beispiel #1
0
 public function __construct($task_id = 0)
 {
     parent::__construct();
     $this->_taskds = new EDS('\\ZippyERP\\ERP\\Entity\\Task');
     $this->add(new Panel('listtab'));
     $this->listtab->add(new Form('filterform'))->setSubmitHandler($this, 'OnFilter');
     $this->listtab->filterform->add(new DropDownChoice('filterproject', Project::findArray('projectname'), 0));
     $this->listtab->filterform->add(new DropDownChoice('filterassignedto', Task::getAssignedList(), 0));
     $this->listtab->filterform->add(new DropDownChoice('filterstatus', Task::getStatusList(), -1));
     $this->listtab->filterform->add(new DropDownChoice('filtersorting'));
     //форма   поиска  по  коду
     $this->listtab->add(new Form('searchform'))->setSubmitHandler($this, 'OnSearch');
     $this->listtab->searchform->add(new TextInput('searchcode'));
     $this->listtab->add(new DataView('tasklist', $this->_taskds, $this, 'tasklistOnRow'));
     $this->add(new Panel('contenttab'))->setVisible(false);
     $this->contenttab->add(new Label('showtaskname'));
     $this->contenttab->add(new Form('editform'))->setSubmitHandler($this, 'OnEdit');
     $this->contenttab->editform->add(new DropDownChoice('editstatus', Task::getStatusList(), 0));
     $this->contenttab->editform->add(new DropDownChoice('editassignedto', Task::getAssignedList(), 0));
     $this->contenttab->add(new DataView('dw_msglist', new ArrayDataSource(new Prop($this, '_msglist')), $this, 'dw_msglistOnRow'));
     $this->contenttab->add(new Form('addmsgform'))->setSubmitHandler($this, 'OnMsgSubmit');
     $this->contenttab->addmsgform->add(new TextArea('addmsg'));
     $this->contenttab->add(new DataView('dw_files', new ArrayDataSource(new Prop($this, '_fileslist')), $this, 'dw_filesOnRow'));
     $this->contenttab->add(new Form('addfileform'))->setSubmitHandler($this, 'OnFileSubmit');
     $this->contenttab->addfileform->add(new File('addfile'));
     $this->contenttab->addfileform->add(new TextInput('adddescfile'));
     $this->contenttab->add(new ClickLink('tolist'))->setClickHandler($this, 'tolistOnClick');
     //$this->_taskds->setWhere('task_id=' . ($task_id > 0 ? $task_id : 0 ));
     //$this->listtab->tasklist->Reload();
     if ($task_id > 0) {
         $this->_task = Task::load($task_id);
         $this->OpenTask();
     }
 }
Beispiel #2
0
 public function __construct()
 {
     parent::__construct();
     $this->_projectds = new EDS('\\ZippyERP\\ERP\\Entity\\Project');
     $this->_taskds = new EDS('\\ZippyERP\\ERP\\Entity\\Task');
     $this->add(new Panel('listtab'));
     $this->listtab->add(new ClickLink('addnew'))->setClickHandler($this, 'addnewOnClick');
     $this->listtab->add(new DataView('projectlist', $this->_projectds, $this, 'projectlistOnRow'))->Reload();
     $this->add(new Panel('edittab'))->setVisible(false);
     $editform = $this->edittab->add(new Form('editform'));
     $editform->add(new TextInput('editprojectname'));
     $editform->add(new Date('editstartdate', time()));
     $editform->add(new Date('editenddate', time()));
     $editform->add(new TextArea('editdesc'));
     $editform->add(new AutocompleteTextInput('editbase'))->setAutocompleteHandler($this, 'editbaseOnAutocomplete');
     $editform->add(new SubmitButton('save'))->setClickHandler($this, 'saveOnClick');
     $editform->add(new Button('cancel'))->setClickHandler($this, 'cancelOnClick');
     $this->add(new Panel('contenttab'))->setVisible(false);
     $this->contenttab->add(new DataView('dw_msglist', new ArrayDataSource(new Prop($this, '_msglist')), $this, 'dw_msglistOnRow'));
     $this->contenttab->add(new Form('addmsgform'))->setSubmitHandler($this, 'OnMsgSubmit');
     $this->contenttab->addmsgform->add(new TextArea('addmsg'));
     $this->contenttab->add(new DataView('dw_files', new ArrayDataSource(new Prop($this, '_fileslist')), $this, 'dw_filesOnRow'));
     $this->contenttab->add(new Form('addfileform'))->setSubmitHandler($this, 'OnFileSubmit');
     $this->contenttab->addfileform->add(new File('addfile'));
     $this->contenttab->addfileform->add(new TextInput('adddescfile'));
     $this->contenttab->add(new Label('showname'));
     $this->contenttab->add(new Label('showdesc'));
     $this->contenttab->add(new ClickLink('tolist'))->setClickHandler($this, 'cancelOnClick');
     //задачи
     $this->add(new Panel('taskstab'))->setVisible(false);
     $this->taskstab->add(new Panel('tasklisttab'));
     $this->taskstab->add(new ClickLink('tolist2'))->setClickHandler($this, 'cancelOnClick');
     $this->taskstab->add(new Label('showname2'));
     $this->taskstab->tasklisttab->add(new ClickLink('taskaddnew'))->setClickHandler($this, 'addnewtaskOnClick');
     $this->taskstab->tasklisttab->add(new ClickLink('togantt'))->setClickHandler($this, 'toogleGantt');
     $this->taskstab->tasklisttab->add(new DataView('tasklist', $this->_taskds, $this, 'tasklistOnRow'));
     $this->add(new Panel('edittasktab'))->setVisible(false);
     $edittaskform = $this->edittasktab->add(new Form('edittaskform'));
     $edittaskform->add(new TextInput('edittaskname'));
     $edittaskform->add(new TextInput('edittaskhours'));
     $edittaskform->add(new Date('edittaskstartdate'));
     $edittaskform->add(new TextArea('edittaskdesc'));
     $edittaskform->add(new DropDownChoice('edittaskstatus', Task::getStatusList(), 0));
     $edittaskform->add(new DropDownChoice('edittaskspriority', Task::getPriorityList(), 3));
     $edittaskform->add(new DropDownChoice('editassignedto', Task::getAssignedList(), 0));
     $edittaskform->add(new SubmitButton('tasksave'))->setClickHandler($this, 'tasksaveOnClick');
     $edittaskform->add(new Button('taskcancel'))->setClickHandler($this, 'taskcancelOnClick');
     $this->taskstab->add(new Panel('ganttab'))->setVisible(false);
     $this->taskstab->ganttab->add(new ClickLink('fromgantt'))->setClickHandler($this, 'toogleGantt');
     $this->taskstab->ganttab->add(new \ZCL\Gantt\Gantt('gantt'))->setAjaxEvent($this, 'OnGantt');
 }