Exemple #1
0
 public function getCMSFields()
 {
     DateField::set_default_config('showcalendar', true);
     $f = new FieldList(new DateField('StartDate', _t('CalendarDateTime.STARTDATE', 'Start date')), new DateField('EndDate', _t('CalendarDateTime.ENDDATE', 'End date')), new TimeField('StartTime', _t('CalendarDateTime.STARTTIME', 'Start time')), new TimeField('EndTime', _t('CalendarDateTime.ENDTIME', 'End time')), new CheckboxField('AllDay', _t('CalendarDateTime.ALLDAY', 'This event lasts all day')));
     $this->extend('updateCMSFields', $f);
     return $f;
 }
 public function getCMSFields()
 {
     DateField::set_default_config('showcalendar', true);
     $f = new FieldList(new DateField('ExceptionDate', _t('CalendarDateTime.EXCEPTIONDATE', 'Exception Date')));
     $this->extend('updateCMSFields', $f);
     return $f;
 }
 public function addtaskForm()
 {
     $project = Project::get()->map('ID', 'Title');
     DateField::set_default_config('showcalendar', true);
     DateField::set_default_config('dateformat', 'dd/MM/YYYY');
     $fields = new FieldList(new DropDownField('ProjectID', 'Project', $project), new TextField('Title'), new TextAreaField('Description'), new DropDownField("Status", "Status", singleton('Task')->dbObject('Status')->enumValues()), new DateField('DueDate', 'Due Date'), new NumericField('OriginalHourEstimate', 'Est. in Hours'));
     $actions = new FieldList(new FormAction('dotaskadd', 'Submit'));
     return new Form($this, 'addtaskForm', $fields, $actions);
 }
Exemple #4
0
 public function addWorkForm()
 {
     $project = Task::get()->map('ID', 'Title');
     DateField::set_default_config('showcalendar', true);
     DateField::set_default_config('dateformat', 'dd/MM/YYYY');
     $fields = new FieldList(new DropDownField('TaskID', 'Project', $project), new TextField('Title'), new DropDownField("Status", "Status", singleton('Task')->dbObject('Status')->enumValues()), new DateField('Date', 'Date'), new NumericField('HourSpent', 'Time Spent in Hours'));
     $actions = new FieldList(new FormAction('doworkadd', 'Submit'));
     return new Form($this, 'addWorkForm', $fields, $actions);
 }
Exemple #5
0
 function editTaskForm()
 {
     $task = $this->getTask();
     DateField::set_default_config('showcalendar', true);
     DateField::set_default_config('dateformat', 'dd/MM/YYYY');
     $fields = new FieldList(new HiddenField('ID', 'aID'), new LiteralField("LiteralField", "<div class='addForm'>"), new LiteralField("LiteralField", "<div class='formleft'>"), new TextField('Title'), new DateField('DueDate', 'Due Date'), new LiteralField("LiteralField", "</div>"), new LiteralField("LiteralField", "<div class='formright'>"), new TextAreaField('Description', 'Description'), new LiteralField("LiteralField", "</div>"), new LiteralField("LiteralField", "<div class='formleft'>"), new LiteralField("LiteralField", "<div class='checkboxes'>"), new OptionSetField('Status', 'Status', singleton('Task')->dbObject('Status')->enumValues()), new LiteralField("LiteralField", "</div>"), new LiteralField("LiteralField", "</div>"), new LiteralField("LiteralField", "</div>"));
     $actions = new FieldList(new LiteralField("LiteralField", "<div class='addForm'>"), new LiteralField("LiteralField", "<div class='formright'>"), new FormAction("dosave", "Save"), new LiteralField("LiteralField", "</div>"), new LiteralField("LiteralField", "</div>"));
     $form = new Form($this, 'editTaskForm', $fields, $actions);
     $Params = $this->getURLParams();
     if (is_numeric($Params['ID']) && ($edittask = DataObject::get_by_id('Task', $Params['ID']))) {
         $form->loadDataFrom($edittask->data());
     }
     return $form;
 }
 public function addTaskForm()
 {
     $theproj = $this->getProjectID();
     DateField::set_default_config('showcalendar', true);
     DateField::set_default_config('dateformat', 'dd/MM/YYYY');
     $fields = new FieldList(new LiteralField("LiteralField", "<h3>Add a Task</h3>"), new HiddenField('ProjectID', '', $theproj), new LiteralField("LiteralField", "<table class='standard'>"), new LiteralField("LiteralField", "<thead>"), new LiteralField("LiteralField", "<tr>"), new LiteralField("LiteralField", "<th class='form450'>Title</th>"), new LiteralField("LiteralField", "<th class='form90'>Due Date</th>"), new LiteralField("LiteralField", "<th class='form450'>Description</th>"), new LiteralField("LiteralField", "<th class='form90'>Hours Est.</th>"), new LiteralField("LiteralField", "<th>&nbsp;</th>"), new LiteralField("LiteralField", "</tr>"), new LiteralField("LiteralField", "</thead>"), new LiteralField("LiteralField", "<tbody>"), new LiteralField("LiteralField", "<tr>"), new LiteralField("LiteralField", "<td>"), new TextField('Title', ''), new LiteralField("LiteralField", "</td>"), new LiteralField("LiteralField", "<td>"), new DateField('DueDate', ''), new LiteralField("LiteralField", "</td>"), new LiteralField("LiteralField", "<td>"), new TextAreaField('Description', ''), new LiteralField("LiteralField", "</td>"), new LiteralField("LiteralField", "<td class='hours'>"), new NumericField('OriginalHourEstimate', '', '0'), new LiteralField("LiteralField", "</td>"));
     $actions = new FieldList(new LiteralField("LiteralField", "<td>"), new FormAction('doTaskadd', 'Submit'), new LiteralField("LiteralField", "</td>"), new LiteralField("LiteralField", "</tr>"), new LiteralField("LiteralField", "<tbody>"), new LiteralField("LiteralField", "</table>"));
     return new Form($this, 'addTaskForm', $fields, $actions);
 }