Beispiel #1
0
 public function get_index()
 {
     $status = Input::get('status', 1);
     $projects_active = Project\User::active_projects(true);
     $projects_inactive = Project\User::inactive_projects(true);
     return $this->layout->with('active', 'projects')->nest('content', 'projects.index', array('projects' => $status == 1 ? $projects_active : $projects_inactive, 'active' => $status == 1 ? 'active' : 'archived', 'active_count' => (int) count($projects_active), 'archived_count' => (int) count($projects_inactive)));
 }
Beispiel #2
0
 /**
  * Soft deletes a user and empties the email
  *
  * @param  int   $id
  * @return bool
  */
 public static function delete_user($id)
 {
     $update = array('email' => '', 'deleted' => 1);
     User::find($id)->fill($update)->save();
     Project\User::where('user_id', '=', $id)->delete();
     return true;
 }
Beispiel #3
0
					<?php 
echo $errors->first('body', '<span class="error">:message</span>');
?>
				</td>
			</tr>
			<?php 
if (Auth::user()->permission('issue-modify')) {
    ?>
			<tr>
				<th><?php 
    echo __('tinyissue.assigned_to');
    ?>
</th>
				<td>
					<?php 
    echo Form::select('assigned_to', array(0 => '') + Project\User::dropdown($project->users()->get()));
    ?>
				</td>
			</tr>
			<?php 
}
?>
			<tr>
				<th><?php 
echo __('tinyissue.attachments');
?>
</th>
				<td>
					<input id="upload" type="file" name="file_upload" />

					<ul id="uploaded-attachments"></ul>
Beispiel #4
0
 /**
  * Shows the user's assigned issues
  * /user/issues
  *
  * @return View
  */
 public function get_issues()
 {
     return $this->layout->with('active', 'issues')->nest('content', 'user.issues', array('projects' => Project\User::users_issues()));
 }
Beispiel #5
0
<?php

$active_projects = Project\User::active_projects();
if (count($active_projects) > 1) {
    ?>
<form class="projects_selector">
<fieldset><label for="projects_select">Projects</label>
<select name="projects_select" id="projects_select"  onchange="if (this.value) window.location.href=this.value">
<?php 
    foreach ($active_projects as $p) {
        $selected = $p->id == Project::current()->id ? 'selected' : '';
        echo '<option value="' . $p->to() . '" ' . $selected . '>' . $p->name . '</option>';
    }
    if (Auth::user()->permission('project-create')) {
        ?>
		<option value="<?php 
        echo URL::to('projects/new');
        ?>
"><?php 
        echo __('tinyissue.create_a_new_project');
        ?>
</option>
	<?php 
    }
    ?>
</select>
</fieldset>
</form>
<?php 
}
?>
Beispiel #6
0
 public function post_remove_user()
 {
     Project\User::remove_assign(Input::get('user_id'), Input::get('project_id'));
 }
Beispiel #7
0
 /**
  * Delete a project and it's children
  *
  * @param  Project  $project
  * @return void
  */
 public static function delete_project($project)
 {
     $id = $project->id;
     $project->delete();
     /* Delete all children from the project */
     Project\Issue::where('project_id', '=', $id)->delete();
     Project\Issue\Comment::where('project_id', '=', $id)->delete();
     Project\User::where('project_id', '=', $id)->delete();
     User\Activity::where('parent_id', '=', $id)->delete();
 }
    ?>
</a>
	<?php 
}
?>
	<?php 
echo __('tinyissue.active_projects');
?>
	<span><?php 
echo __('tinyissue.active_projects_description');
?>
</span>
</h2>

<ul>
	<?php 
foreach (Project\User::active_projects() as $row) {
    ?>
	<li>
		<a href="<?php 
    echo $row->to();
    ?>
"><?php 
    echo $row->name;
    ?>
</a>
	</li>
	<?php 
}
?>
</ul>
Beispiel #9
0
						});
					});
					</script>
				</td>
			</tr>
			<?php 
if (Auth::user()->permission('issue-modify')) {
    ?>
			<tr>
				<th><?php 
    echo __('tinyissue.assigned_to');
    ?>
</th>
				<td>
					<?php 
    echo Form::select('assigned_to', array(0 => '') + Project\User::dropdown($project->users()->get()), Input::old('asigned_to', $issue->assigned_to));
    ?>
				</td>
			</tr>
			<?php 
}
?>
			<tr>
				<th></th>
				<td><input type="submit" value="<?php 
echo __('tinyissue.update_issue');
?>
" class="button primary" /></td>
			</tr>
		</table>
Beispiel #10
0
echo __('tinyissue.status');
?>
</th>
				<td><?php 
echo Form::select('status', array(1 => 'Open', 0 => 'Archived'), Project::current()->status);
?>
</td>
			</tr>
			<tr>
			<th><?php 
echo __('tinyissue.default_assignee');
?>
</th>
				<td>
					<?php 
echo Form::select('default_assignee', array(0 => '') + Project\User::dropdown(Project::current()->users()->get()), Project::current()->default_assignee);
?>
				</td>
			</tr>
			<tr>
				<th></th>
				<td>
					<input type="submit" value="<?php 
echo __('tinyissue.update');
?>
" />
					<input type="submit" name="delete" value="<?php 
echo __('tinyissue.delete');
?>
 <?php 
echo Project::current()->name;