@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Legalpad - make "Cancel" button "Log Out" button for required signature documents

Summary: Fixes T7299. Also re-direct the user to the initial request uri if the signature was required.

Test Plan: made a signature required legalpad doc. visit the instance at a specific uri, signed the document, and ended up at that specific uri

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T7299

Differential Revision: https://secure.phabricator.com/D11809

+21 -5
+21 -5
src/applications/legalpad/controller/LegalpadDocumentSignController.php
··· 180 180 if (!$errors) { 181 181 $signature->save(); 182 182 183 - // If the viewer is logged in, send them to the document page, which 184 - // will show that they have signed the document. Otherwise, send them 185 - // to a completion page. 183 + // If the viewer is logged in, signing for themselves, send them to 184 + // the document page, which will show that they have signed the 185 + // document. Unless of course they were required to sign the 186 + // document to use Phabricator; in that case try really hard to 187 + // re-direct them to where they wanted to go. 188 + // 189 + // Otherwise, send them to a completion page. 186 190 if ($viewer->isLoggedIn() && $is_individual) { 187 191 $next_uri = '/'.$document->getMonogram(); 192 + if ($document->getRequireSignature()) { 193 + $request_uri = $request->getRequestURI(); 194 + $next_uri = (string) $request_uri; 195 + } 188 196 } else { 189 197 $this->sendVerifySignatureEmail( 190 198 $document, ··· 401 409 'agree', 402 410 'agree', 403 411 pht('I agree to the terms laid forth above.'), 404 - false)) 412 + false)); 413 + if ($document->getRequireSignature()) { 414 + $cancel_uri = '/logout/'; 415 + $cancel_text = pht('Log Out'); 416 + } else { 417 + $cancel_uri = $this->getApplicationURI(); 418 + $cancel_text = pht('Cancel'); 419 + } 420 + $form 405 421 ->appendChild( 406 422 id(new AphrontFormSubmitControl()) 407 423 ->setValue(pht('Sign Document')) 408 - ->addCancelButton($this->getApplicationURI())); 424 + ->addCancelButton($cancel_uri, $cancel_text)); 409 425 410 426 return $form; 411 427 }