Reopen ticket from complete status.

@param int $id

@return Response
184849
public function reopen($id)
    {
        if ($this->permToReopen($id) == 'yes') {
            $ticket = $this->tickets->findOrFail($id);
            $ticket->completed_at = null;

            if (Setting::grab('default_reopen_status_id')) {
                $ticket->status_id = Setting::grab('default_reopen_status_id');
            }

            $subject = $ticket->subject;
            $ticket->save();

            session()->flash('status', trans('ticketit::lang.the-ticket-has-been-reopened', ['name' => $subject]));

            return redirect()->route(Setting::grab('main_route').'.index');
        }

        return redirect()->route(Setting::grab('main_route').'.index')
            ->with('warning', trans('ticketit::lang.you-are-not-permitted-to-do-this'));
    }
1136390
public function reset($id)
    {
        $password = Str::random();

        $input = [
            'password' => $password,
        ];

        $rules = [
            'password' => 'required|min:6',
        ];

        $val = UserRepository::validate($input, $rules, true);
        if ($val->fails()) {
            return Redirect::route('users.show', ['users' => $id])->withErrors($val->errors());
        }

        $user = UserRepository::find($id);
        $this->checkUser($user);

        $user->update($input);

        $mail = [
            'password' => $password,
            'email'    => $user->getLogin(),
            'subject'  => Config::get('app.name').' - New Password Information',
        ];

        Mail::queue('credentials::emails.password', $mail, function ($message) use ($mail) {
            $message->to($mail['email'])->subject($mail['subject']);
        });

        return Redirect::route('users.show', ['users' => $id])
            ->with('success', 'The user\'s password has been reset successfully, and has been emailed to them.');
    }
651719
public function actionUpdate($id)
    {
        $model = $this->findModel($id);
        $model->scenario = 'update';

        if ($model->load(\Yii::$app->request->post()) && $model->save()) {
            if(\Yii::$app->request->get('returnUrl')){
                $back = urldecode(\Yii::$app->request->get('returnUrl'));
                return $this->redirect($back);
            }

            \Yii::$app->getSession()->setFlash('block.success', \Yii::t('block', 'Block has been updated'));
            return $this->refresh();
        }

        return $this->render('update', [
            'model' => $model
        ]);
    }
963082
public function cancelDelayed($id)
    {
        $this->setCancelAtEndOfPeriod(true);

        $service = $this->getService();
        $rawData = $this->getRawData(array('subscription' => $this->_params));
        $response = $service->request('subscriptions/' . (int)$id, 'PUT', $rawData);
        $responseArray = $this->getResponseArray($response);

        if (!$this->isError()) {
            $this->_data = $responseArray['subscription'];
        } else {
            $this->_data = array();
        }

        return $this;
    }
255155
public function revert($id)
    {
        $archive = Archive::find($id);

        $model = app($archive->entity_type);
        $modelInstance = $model->find($archive->entity_id);

        $archiveData = (array) json_decode($archive->entity_data);

        $modelInstance->fill($archiveData);
        $modelInstance->save();

        Cms::notification('Reversion was successful', 'success');

        return redirect(URL::previous());
    }
1339360
public function updateAction($id)
    {
        $form = $this->getForm();
        // Get request
        $request = $this->get('request');
        if ('POST' == $request->getMethod()) {
            $form->submit($request);
            
            if ($form->isValid()) {
                // Save instance
                $this->getManager()->create($form->getData());
                $this->get('session')->getFlashBag()->add('success', 'Instance Redis updated successfully');

                return new RedirectResponse($this->generateUrl('ringo_php_redmon'));
            }else {
                $this->get('session')->getFlashBag()->add('error', 'Some errors found');
            }
        }
        
        return $this->render(
            $this->getTemplatePath().'edit.html.twig',
            array(
                'form' => $form->createView(),
                'errors' => $form->getErrors()
            )
        );
    }
951418
public function destroy($id)
    {
        $redirect = $this->redirect->findOrFail($id);

        if($redirect->delete()) return response()->json(['status' => 'ok']);

        return response()->json(['status' => 'failed']);
    }
370097
public function reopenIssue($id)
    {
        $this->connect();

        $action = $this->getReopenActionId($id);

        if (isset($action)) {
            $this->soapClient->progressWorkflowAction($this->token, $id, $action, array());
        }
    }
540691
public function reset($id = null) {
		$fields = [
			'completed' => null,
			'fetched' => null,
			'progress' => 0,
			'failed' => 0,
			'workerkey' => null,
			'failure_message' => null,
		];
		$conditions = [
			'completed IS' => null,
		];
		if ($id) {
			$conditions['id'] = $id;
		}

		return $this->updateAll($fields, $conditions);
	}
937134
function reopenObject( $id )
    {
        $this->nStack++;
        $this->stack[$this->nStack] = array( 'c' => $this->currentContents,
                                             'p' => $this->currentPage );
        $this->currentContents=$id;
        // also if this object is the primary contents for a page, then set the current page to its parent
        if ( isset( $this->objects[$id]['onPage'] ) )
        {
            $this->currentPage = $this->objects[$id]['onPage'];
        }
    }
879294
public function handleDeletePermission(int $id): void
	{
		if ($this->isAjax()) {
			$permission = $this->orm->acl->getById($id);
			$this->orm->acl->removeAndFlush($permission);
			$this['permissionsList']->reload();
		} else {
			$this->terminate();
		}
	}
874558
public function status($id) 
    {
        $url = self::HOST . self::STATUS;

        $params = $this->get_default_params();
        $params['id'] = $id;
        $result = $this->request($url, $params);

        return $result;
    }
1024910
function reopenObject($id) {
		//Helpers::dompdf_debug("trace", "Enter My_TCPDF.reopenObject($id)");

		if ($this->state == 2) {
			$curr_buffer = $this->getPageBuffer($this->page);
		}
		else {
			$curr_buffer = $this->getBuffer();
		}

		$this->dompdf_num_stack++;
		$this->dompdf_stack[$this->dompdf_num_stack] = array('c' => $curr_buffer, 'p' => $this->page, 'g' => $this->getGraphicVars());

		if ($this->state == 2) {
			$this->setPageBuffer($this->page, $this->dompdf_objects[$id]['c']);
		}
		else {
			$this->buffer = $this->dompdf_objects[$id]['c'];
			$this->bufferlen = strlen($this->buffer);
		}
		$this->page = 1;

		//$this->page = $this->dompdf_objects[$id]['p'];

		$this->setGraphicVars($this->dompdf_objects[$id]['g']);
	}
1317900
public function fireRestore($id)
    {
        if (is_callable($this->getRestore())) {
            return $this->app->call($this->getRestore(), [$id]);
        }
    }
999564
public function passwordResetRequest($id)
    {
        if (! $user = $this->user->find($id)) {
            flash(trans('core::messages.resource.resource not found', ['name' => trans('user::users.title.user')]));

            return redirect()->route('backend::user.index');
        }

        $code = $this->auth->createReminderCode($user);

        event(new UserHasBegunResetProcess($user, $code));

        Flash::success(trans('user::messages.reset password email sent'));

        return redirect()->route('backend::user.user.index');
    }
1093904
public function show($id)
    {
        $user = $this->userRepo->getById($id);
        if (!empty($user)) {
            $this->authorize('read', $user);
            return $this->respondWithSuccess($user, new UserTransformer);
        }
        return $this->respondNotFound();
    }
416717
public function permToClose($id)
    {
        $close_ticket_perm = Setting::grab('close_ticket_perm');

        if ($this->agent->isAdmin() && $close_ticket_perm['admin'] == 'yes') {
            return 'yes';
        }
        if ($this->agent->isAgent() && $close_ticket_perm['agent'] == 'yes') {
            return 'yes';
        }
        if ($this->agent->isTicketOwner($id) && $close_ticket_perm['owner'] == 'yes') {
            return 'yes';
        }

        return 'no';
    }