/**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function show($id)
 {
     $issue = \App\IssueModel::findOrFail($id);
     $questions = \App\IssueModel::find($id)->questions;
     // get available status & editable status
     $editable = true;
     $availableStatus = getAvailableStatuses($issue->status);
     return view('admin.issue', ['issue' => $issue, 'questions' => $questions, 'editable' => $editable, 'availableStatus' => $availableStatus]);
 }
 public function testGetAvailableIssuesStatus()
 {
     $statusRules = ['open' => ['open', 'review', 'deferred'], 'review' => ['review', 'deferred', 'approved'], 'deferred' => ['review', 'deferred', 'approved'], 'approved' => ['review', 'deferred', 'approved', 'sandbox', 'live'], 'sandbox' => ['review', 'deferred', 'approved', 'sandbox', 'live'], 'live' => ['live', 'suspended', 'closed'], 'suspended' => ['live', 'suspended', 'closed'], 'closed' => ['closed', 'deleted'], 'deleted' => ['deleted']];
     // make sure easch set of appropiate rules are returned
     foreach ($statusRules as $status => $rules) {
         $this->assertEquals(getAvailableStatuses($status), $rules);
     }
     // make sure an empty array is returned for a incorrect status
     $this->assertEmpty(getAvailableStatuses('not_set'), []);
 }
Example #3
0
     $sContents = fread($rHandle, filesize($sFileName));
     fclose($rHandle);
     $sContents = str_replace("#music#", getUserMusicLink(), $sContents);
     $sContents = str_replace("#video#", getUserVideoLink(), $sContents);
     $sContents = str_replace("#im#", getUserImLink($sId), $sContents);
     $sContents = str_replace("#chat#", getUserChatLink($sId), $sContents);
     $sContents = str_replace("#siteUrl#", $sRootURL, $sContents);
     $sContents = str_replace("#xmlUrl#", $sRayXmlUrl, $sContents);
     $sContents = str_replace("#desktopUrl#", $sModulesUrl . $sModule . "/", $sContents);
     break;
 case 'userAuthorize':
     $sResult = loginUser($sId, $sPassword);
     $sContents = parseXml($aXmlTemplates['result'], $sResult == TRUE_VAL ? TRUE_VAL : "msgUserAuthenticationFailure");
     if ($sResult == TRUE_VAL) {
         $sContents .= parseXml($aXmlTemplates['status'], getUserStatus($sId));
         $sContents .= getAvailableStatuses();
         saveUsers(array('online' => array(), 'offline' => array()));
     }
     break;
 case 'login':
     $sContents = parseXml($aXmlTemplates['result'], "msgUserAuthenticationFailure", FAILED_VAL);
     $sId = getIdByNick($sNick);
     $sPassword = encryptPassword($sId, $sPassword);
     if (loginUser($sNick, $sPassword, true) == TRUE_VAL) {
         $aUserInfo = getUserInfo($sId);
         login($sId, $sPassword);
         $sContents = parseXml($aXmlTemplates['result'], $sId, SUCCESS_VAL, $sPassword);
     }
     break;
 case 'logout':
     logout($sId);