public function configure() { $this->widgetSchema['users_id'] = new sfWidgetFormChoice(array('choices' => Users::getChoices(array(), 'tickets')), array('class' => 'required')); $this->widgetSchema['sort_order'] = new sfWidgetFormInput(array(), array('size' => 3)); $this->widgetSchema['active'] = new sfWidgetFormInputCheckbox(array(), array('value' => 1)); $this->setDefault('active', 1); $this->widgetSchema->setLabels(array('users_id' => 'Assigned To', 'sort_order' => 'Sort Order')); }
public function executeTeam() { if ($this->project->isNew()) { $this->in_team = array(); $this->in_role = array(); } else { $this->in_team = explode(',', $this->project->getTeam()); $this->project_id = $this->project->getId(); } $this->users_list = Users::getChoices(); }
public function configure() { $projects = $this->getOption('projects'); $sf_user = $this->getOption('sf_user'); $this->widgetSchema['discussions_status_id'] = new sfWidgetFormChoice(array('choices' => app::getItemsChoicesByTable('DiscussionsStatus'))); $this->setDefault('discussions_status_id', app::getDefaultValueByTable('DiscussionsStatus')); $this->widgetSchema['assigned_to'] = new sfWidgetFormChoice(array('choices' => Users::getChoices(array_merge(array($sf_user->getAttribute('id')), array_filter(explode(',', $projects->getTeam()))), 'discussions'), 'expanded' => true, 'multiple' => true)); if (Users::hasAccess('edit', 'projects', $sf_user, $projects->getId())) { $this->widgetSchema['users_id'] = new sfWidgetFormChoice(array('choices' => Users::getChoices(array_merge(array($sf_user->getAttribute('id')), array_filter(explode(',', $projects->getTeam()))), 'discussions_insert'))); } else { $this->widgetSchema['users_id'] = new sfWidgetFormInputHidden(); } $this->widgetSchema['name']->setAttributes(array('size' => '60', 'class' => 'required')); $this->widgetSchema['description']->setAttributes(array('class' => 'editor')); $this->widgetSchema['projects_id'] = new sfWidgetFormInputHidden(); $this->widgetSchema->setLabels(array('discussions_status_id' => 'Status', 'assigned_to' => 'Assigned To', 'users_id' => 'Created By')); }
public function configure() { $projects = $this->getOption('projects'); $sf_user = $this->getOption('sf_user'); $this->widgetSchema['tasks_status_id'] = new sfWidgetFormChoice(array('choices' => app::getItemsChoicesByTable('TasksStatus'))); $this->setDefault('tasks_status_id', app::getDefaultValueByTable('TasksStatus')); $this->widgetSchema['tasks_priority_id'] = new sfWidgetFormChoice(array('choices' => app::getItemsChoicesByTable('TasksPriority'))); $this->setDefault('tasks_priority_id', app::getDefaultValueByTable('TasksPriority')); $this->widgetSchema['tasks_type_id'] = new sfWidgetFormChoice(array('choices' => app::getItemsChoicesByTable('TasksTypes'))); $this->setDefault('tasks_type_id', app::getDefaultValueByTable('TasksTypes')); $this->widgetSchema['tasks_label_id'] = new sfWidgetFormChoice(array('choices' => app::getItemsChoicesByTable('TasksLabels'))); $this->setDefault('tasks_label_id', app::getDefaultValueByTable('TasksLabels')); $this->widgetSchema['tasks_groups_id'] = new sfWidgetFormChoice(array('choices' => app::getItemsChoicesByTable('TasksGroups', true, $projects->getId()))); $this->widgetSchema['projects_phases_id'] = new sfWidgetFormChoice(array('choices' => app::getItemsChoicesByTable('ProjectsPhases', true, $projects->getId()))); $this->widgetSchema['versions_id'] = new sfWidgetFormChoice(array('choices' => app::getItemsChoicesByTable('Versions', true, $projects->getId()))); $this->widgetSchema['progress'] = new sfWidgetFormChoice(array('choices' => Tasks::getProgressChoices())); $this->widgetSchema['assigned_to'] = new sfWidgetFormChoice(array('choices' => Users::getChoices(array_merge(array($sf_user->getAttribute('id')), array_filter(explode(',', $projects->getTeam()))), 'tasks'), 'expanded' => true, 'multiple' => true)); if (Users::hasAccess('edit', 'projects', $sf_user, $projects->getId())) { $this->widgetSchema['created_by'] = new sfWidgetFormChoice(array('choices' => Users::getChoices(array_merge(array($sf_user->getAttribute('id')), array_filter(explode(',', $projects->getTeam()))), 'tasks_insert'))); } else { $this->widgetSchema['created_by'] = new sfWidgetFormInputHidden(); } $this->widgetSchema['name']->setAttributes(array('size' => '60', 'class' => 'required')); $this->widgetSchema['description']->setAttributes(array('class' => 'editor')); $this->widgetSchema['estimated_time']->setAttributes(array('size' => '4')); $this->widgetSchema['start_date'] = new sfWidgetFormInput(array(), array('class' => 'datetimepicker')); $this->widgetSchema['due_date'] = new sfWidgetFormInput(array(), array('class' => 'datetimepicker')); $this->widgetSchema['projects_id'] = new sfWidgetFormInputHidden(); $this->widgetSchema['closed_date'] = new sfWidgetFormInputHidden(); $this->widgetSchema['created_at'] = new sfWidgetFormInputHidden(); $this->setDefault('created_at', date('Y-m-d H:i:s')); $this->widgetSchema->setLabels(array('tasks_priority_id' => 'Priority', 'tasks_type_id' => 'Type', 'tasks_label_id' => 'Label', 'projects_phases_id' => 'Phase', 'versions_id' => 'Version', 'tasks_groups_id' => 'Group', 'tasks_status_id' => 'Status', 'estimated_time' => 'Estimated Time', 'start_date' => 'Start Date', 'due_date' => 'Due Date', 'created_by' => 'Created By')); unset($this->widgetSchema['discussion_id']); unset($this->widgetSchema['tickets_id']); unset($this->widgetSchema['work_hours']); unset($this->validatorSchema['discussion_id']); unset($this->validatorSchema['tickets_id']); unset($this->validatorSchema['work_hours']); }
public function configure() { $projects = $this->getOption('projects'); $sf_user = $this->getOption('sf_user'); $this->widgetSchema['departments_id'] = new sfWidgetFormChoice(array('choices' => app::getItemsChoicesByTable('Departments')), array('class' => 'required')); $this->widgetSchema['tickets_status_id'] = new sfWidgetFormChoice(array('choices' => app::getItemsChoicesByTable('TicketsStatus'))); $this->setDefault('tickets_status_id', app::getDefaultValueByTable('TicketsStatus')); $this->widgetSchema['tickets_types_id'] = new sfWidgetFormChoice(array('choices' => app::getItemsChoicesByTable('TicketsTypes'))); $this->setDefault('tickets_types_id', app::getDefaultValueByTable('TicketsTypes')); if ($projects) { if (Users::hasAccess('edit', 'projects', $sf_user, $projects->getId())) { $this->widgetSchema['users_id'] = new sfWidgetFormChoice(array('choices' => Users::getChoices(array_merge(array($sf_user->getAttribute('id')), array_filter(explode(',', $projects->getTeam()))), 'tickets_insert'))); } else { $this->widgetSchema['users_id'] = new sfWidgetFormInputHidden(); } } $this->widgetSchema['name']->setAttributes(array('size' => '60', 'class' => 'required')); $this->widgetSchema['description']->setAttributes(array('class' => 'editor')); $this->widgetSchema['projects_id'] = new sfWidgetFormInputHidden(); $this->widgetSchema['created_at'] = new sfWidgetFormInputHidden(); $this->setDefault('created_at', date('Y-m-d H:i:s')); $this->widgetSchema->setLabels(array('tickets_types_id' => 'Type', 'tickets_status_id' => 'Status', 'departments_id' => 'Department', 'name' => 'Subject', 'users_id' => 'Created By')); }
<?php if ($action_name == 'index') { ?> <form action="<?php echo url_for('timeReport/' . $action_name); ?> " method="post"> <table> <tr> <td><?php echo __('User'); ?> : </td> <td><?php echo select_tag('filter_by[CommentCreatedBy]', isset($filter_by['CommentCreatedBy']) ? $filter_by['CommentCreatedBy'] : '', array('choices' => Users::getChoices(array(), 'tasks_comments_insert', true)), array('onChange' => 'this.form.submit()')); ?> </td> </tr> </table> <?php echo $sf_request->hasParameter('projects_id') ? input_hidden_tag('projects_id', $sf_request->getParameter('projects_id')) : ''; ?> </form> <?php } else { ?> <table> <tr> <td><?php
?> </td> </tr> <?php } ?> </table> </div> <?php if (isset($projects)) { ?> <div> <?php echo select_tag('fields[assigned_to]', '', array('choices' => Users::getChoices(array_merge(array($sf_user->getAttribute('id')), array_filter(explode(',', $projects->getTeam()))), 'tasks'), 'expanded' => true, 'multiple' => true)); ?> </div> <?php } ?> </div> <br> <input type="submit" value="<?php echo __('Update'); ?> " class="btn"> <?php echo input_hidden_tag('selected_items');
?> <?php echo $form['users_id']; ?> </td> </tr> <?php if ($form->getObject()->isNew()) { ?> <tr> <th><?php echo __('Notify'); ?> </th> <td><div class="checkboxesList"><?php echo select_tag('extra_notification', '', array('choices' => Users::getChoices(array_filter(explode(',', $projects->getTeam())), 'tickets'), 'multiple' => true, 'expanded' => true)); ?> </div></td> </tr> <?php } ?> <?php } ?> </table> </div> <div> <?php include_component('attachments', 'attachments', array('bind_type' => 'tickets', 'bind_id' => $form->getObject()->isNew() ? 0 : $form->getObject()->getId()));
echo app::getReportFormFilterByTable('Status', 'user_reports[tasks_status_id]', 'TasksStatus', $form['tasks_status_id']->getValue()); ?> <?php echo app::getReportFormFilterByTable('Type', 'user_reports[tasks_type_id]', 'TasksTypes', $form['tasks_type_id']->getValue()); ?> <?php echo app::getReportFormFilterByTable('Label', 'user_reports[tasks_label_id]', 'TasksLabels', $form['tasks_label_id']->getValue()); ?> </tr> </table> </td> <?php if (count($choices = Users::getChoices(array(), 'tasks')) > 0 and (Users::hasAccess('insert', 'tasks', $sf_user) or Users::hasAccess('edit', 'tasks', $sf_user))) { if (!is_string($v = $form['assigned_to']->getValue())) { $v = ''; } echo '<td style="padding-right: 10px;"><b>' . __('Assigned To') . '</b><br>' . select_tag('user_reports[assigned_to]', explode(',', $v), array('choices' => $choices, 'multiple' => true), array('style' => 'height: 400px; width: 250px;')) . '</td>'; } ?> </tr> </table> </div> <div> <?php echo __('Tasks Due Date'); ?>
public static function getFilterMenuUsers($m, $t, $title, $path, $params = false, $selected = array()) { if (!is_array($selected)) { $selected = explode(',', $selected); } if (count($selected) > 0) { $ft = 'Preview'; } else { $ft = ''; } $has_access = ''; switch ($t) { case 'TasksAssignedTo': $has_access = 'tasks'; break; case 'TasksCreatedBy': $has_access = 'tasks_insert'; break; case 'TicketsCreatedBy': $has_access = 'tickets_insert'; break; case 'DiscussionsAssignedTo': $has_access = 'discussions'; break; case 'DiscussionsCreatedBy': $has_access = 'discussions_insert'; break; } $s = array(); foreach (Users::getChoices(array(), $has_access) as $n => $g) { if (count($g) > 0) { $gk = array(); foreach ($g as $k => $v) { $gk[] = $k; } $ss = array(); foreach ($g as $k => $v) { $ss[] = array('title' => '<table><tr><td style="padding-right: 10px;"><input class="' . $t . 'Filters' . $ft . '" name="' . $t . $k . '" id="' . $t . $k . '" value="' . $k . '" ' . (in_array($k, $selected) ? 'checked="checked"' : '') . ' type="checkbox"></td><td>' . link_to($v, $path, array('query_string' => 'filter_by[' . $t . ']=' . $k . ($params ? '&' . $params : ''))) . '</td></table>'); } if (count($ss) > 0) { $s[] = array('title' => '<a href="' . url_for($path . '?filter_by[' . $t . ']=' . implode(',', $gk) . ($params ? '&' . $params : '')) . '">' . __($n) . '</a>', 'submenu' => $ss); } } } $s[] = array('title' => '<form id="filter_by_' . $t . '_form" action="' . url_for($path . ($params ? '?' . $params : '')) . '" method="post">' . input_hidden_tag('filter_by[' . $t . ']', '') . '<table onClick="filter_by_selected(\'' . $t . '\',\'' . $ft . '\')"><tr><td style="padding-right: 10px;">' . image_tag('icons/arrow_up.png') . '</td><td>' . __('Filter by selected') . '</td></table></form>', 'is_hr' => true); $m[] = array('title' => __($title), 'submenu' => $s); return $m; }