diff options
| author | Malf Furious <m@lfurio.us> | 2018-11-04 17:11:52 -0500 | 
|---|---|---|
| committer | Malf Furious <m@lfurio.us> | 2018-11-04 17:11:52 -0500 | 
| commit | ed8ad6bd4d4e0d389bb95632d08b6c97e85284a4 (patch) | |
| tree | db9ec7a06524cb855bd5814456a3a1120c9fc735 | |
| parent | 0452872abb62d30fa3831e5ffdd4b0dabf702fd6 (diff) | |
| parent | 2fc9cff6006580e3b1d9e3f194de3ef29e5d0247 (diff) | |
| download | scrott-ed8ad6bd4d4e0d389bb95632d08b6c97e85284a4.tar.gz scrott-ed8ad6bd4d4e0d389bb95632d08b6c97e85284a4.zip | |
Merge branch 'feature/assign-issue' into dev
| -rw-r--r-- | app/model/issue.php | 18 | ||||
| -rw-r--r-- | app/view/issue.php | 26 | 
2 files changed, 44 insertions, 0 deletions
| diff --git a/app/model/issue.php b/app/model/issue.php index 910cb14..923bfc2 100644 --- a/app/model/issue.php +++ b/app/model/issue.php @@ -24,6 +24,7 @@ if (isAction("iss-mesg-add"))      $form = new form();      $form->text("issue");      $form->text("mesg", false); +    $form->text("assignee");      if (!$form->populate(input()))          return; @@ -71,6 +72,23 @@ if (isAction("iss-mesg-add"))          }      } +    else if (isset(input()['assIssue'])) +    { +        if (!$user->canModify($issue)) +        { +            logError(ERROR, "You do not have permission to assign this issue"); +            return; +        } + +        $assignee = new user($form->assignee); +        $stat = $issue->addAssignee($assignee, $user); + +        if (!$stat) +            logError(ERROR, "Failed to assign issue"); +        else +            $log = mesg::initNewLog("%s assigned " . $assignee->getDisplayName(), $user, $issue); +    } +      else if (isset(input()['closeIssue']))      {          if (!$user->canModify($issue)) diff --git a/app/view/issue.php b/app/view/issue.php index 67f5627..5f1c518 100644 --- a/app/view/issue.php +++ b/app/view/issue.php @@ -126,6 +126,32 @@ require_once "class/issue.class.php";                                      <button type="submit" name="input[advIssue]" class="btn btn-default" title="Advance issue">                                          <span class="glyphicon glyphicon-chevron-up"></span>                                      </button> + +                                    <button type="button" class="btn btn-default" data-toggle="collapse" data-target="#assignCollapse-<?=$i->guid?>" title="Assign issue"> +                                        <span class="glyphicon glyphicon-share-alt"></span> +                                    </button> +                                </div> + +                                <div class="collapse" id="assignCollapse-<?=$i->guid?>"> +                                    <div class="form-group"> +                                        <label>Select assignee</label> + +                                        <select name="input[assignee]" class="form-control selectpicker"> +                                            <option data-icon="glyphicon-user" value="<?=$i->getParent()->getParent()->getOwner()->guid?>"> +                                                <?=$i->getParent()->getParent()->getOwner()->getDisplayName()?> +                                            </option> + +                                            <?php foreach ($i->getParent()->getParent()->getMembers() as $memb) { ?> +                                                <option data-icon="glyphicon-user" value="<?=$memb->guid?>"> +                                                    <?=$memb->getDisplayName()?> +                                                </option> +                                            <?php } ?> +                                        </select> +                                    </div> + +                                    <button type="submit" name="input[assIssue]" class="btn btn-default"> +                                        <span class="glyphicon glyphicon-share-alt"></span> Post and assign issue +                                    </button>                                  </div>                                  <?=\formctrl\file( "Attachment", "attachment" )?> | 
