Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Someone can review and agree the updated terms and conditions (if any) #217

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/Lib/lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -1731,7 +1731,7 @@
'fd.tc.agree.impl' => 'By clicking <i>Submit</i>, you are agreeing to the following Terms and Conditions.<br />Please review the T&C before continuing.',
'fd.tc.agree.login' => 'You must agree to all of the following Terms and Conditions before continuing.',
'fd.tc.agree.no' => 'Not Agreed',
'fd.tc.agree.yes' => 'Agreed',
'fd.tc.agree.yes' => 'Agreed (%1$s, %2$s)',
'fd.tc.archived' => 'The definition of this T&C changed after the agreement was recorded',
'fd.tc.body' => 'Inline T&C',
'fd.tc.body.desc' => 'Terms and Conditions for inline rendering. If provided, overrides and overwrites the URL',
Expand Down
6 changes: 3 additions & 3 deletions app/Model/CoTermsAndConditions.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,13 +166,13 @@ public function status($copersonid) {
if($a['CoTermsAndConditions']['id'] == $tid) {
// Agreement is to the current T&C
$tandc[$i]['CoTAndCAgreement'] = $a['CoTAndCAgreement'];
$tandc[$i]['CoTermsAndConditions'] = $a['CoTermsAndConditions'];
break;
} elseif($a['CoTermsAndConditions']['co_terms_and_conditions_id'] == $tid) {
// Agreement is to a previous version of the current T&C,
// which for now at least is considered sufficient
$tandc[$i]['CoTAndCAgreement'] = $a['CoTAndCAgreement'];
// Replace with the version actually agreed to
$tandc[$i]['CoTermsAndConditions'] = $a['CoTermsAndConditions'];
// Store the currentCoTermsAndConditions
$tandc[$i]['CurrentCoTermsandConditions'] = $tandc[$i]['CoTermsAndConditions'];
break;
}
}
Expand Down
20 changes: 9 additions & 11 deletions app/View/CoTermsAndConditions/review.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,12 @@
<td>
<?php
if(!empty($c['CoTAndCAgreement'])) {
print _txt('fd.tc.agree.yes')
. " ("
. $c['CoTAndCAgreement']['identifier']
. ", "
. $this->Time->format($c['CoTAndCAgreement']['agreement_time'], "%c $vv_tz", false, $vv_tz)
. ")";
print _txt('fd.tc.agree.yes', array(
$c['CoTAndCAgreement']['identifier'],
$this->Time->format($c['CoTAndCAgreement']['agreement_time'], "%c $vv_tz", false, $vv_tz)
));

if(!empty($c['CoTermsAndConditions']['co_terms_and_conditions_id'])) {
if(!empty($c['CurrentCoTermsandConditions'])) {
print "</br>" . _txt('fd.tc.archived');
}
} else {
Expand All @@ -136,7 +134,7 @@
?>
</td>
<td>
<?php if(!empty($c['CoTAndCAgreement'])): ?>
<?php if(!empty($c['CoTAndCAgreement']) && empty($c['CurrentCoTermsandConditions'])): ?>
<button class="checkbutton"
type="button"
onClick="open_tandc('<?php print addslashes($c['CoTermsAndConditions']['description']); ?>',
Expand All @@ -148,14 +146,14 @@
<?php else: ?>
<button class="checkbutton"
type="button"
onClick="open_tandc('<?php print addslashes($c['CoTermsAndConditions']['description']); ?>',
'<?php print addslashes($c['CoTermsAndConditions']['url']); ?>',
onClick="open_tandc('<?php print addslashes(empty($c['CurrentCoTermsandConditions']) ? $c['CoTermsAndConditions']['description'] : $c['CurrentCoTermsandConditions']['description']); ?>',
'<?php print addslashes(empty($c['CurrentCoTermsandConditions']) ? $c['CoTermsAndConditions']['url'] : $c['CurrentCoTermsandConditions']['url']); ?>',
'agree',
'<?php
$args = array(
'controller' => 'co_terms_and_conditions',
'action' => 'agree',
$c['CoTermsAndConditions']['id'],
(empty($c['CurrentCoTermsandConditions']) ? $c['CoTermsAndConditions']['id'] : $c['CurrentCoTermsandConditions']['id']),
'copersonid' => $vv_co_person['CoPerson']['id']
);

Expand Down